AGENTS.md
react/AGENTS.mdAGENTS.md
Quality
71/100
Scores the file, not the repository.Length
525 words
10 headings · 0 code blocksRepository
72k
— · pushed 74 days agoLast changed
3 days ago
First indexed 3 days ago.1# React Wrapper Notes23This directory contains the `@revealjs/react` wrapper. Keep the guidance here high level and update it when the public API, source layout, or Reveal/React synchronization model changes.45## Current Layout67- Source lives under `react/src/`.8- Components live in `react/src/components/` and use kebab-case filenames.9- Shared helpers live in `react/src/utils/`.10- Public exports are defined in `react/src/index.ts`.11- Shared types live in `react/src/types.ts`.12- The Reveal instance context lives in `react/src/reveal-context.ts`.13- Component tests are colocated with their components as `*.test.tsx`.14- Test setup remains in `react/src/__tests__/setup.ts`.15- The demo app lives in `react/demo/src/`.1617## Source Of Truth1819- Implementation:20 - `react/src/components/deck.tsx`21 - `react/src/components/slide.tsx`22 - `react/src/components/stack.tsx`23 - `react/src/components/fragment.tsx`24 - `react/src/components/code.tsx`25 - `react/src/components/markdown.tsx`26- Shared helpers:27 - `react/src/utils/slide-attributes.ts`28 - `react/src/utils/markdown.ts`29- Behavioral tests:30 - `react/src/components/deck.test.tsx`31 - `react/src/components/slide.test.tsx`32 - `react/src/components/fragment.test.tsx`33 - `react/src/components/code.test.tsx`34 - `react/src/components/markdown.test.tsx`35- Public-facing behavior summary:36 - `react/README.md`3738## Deck Lifecycle Invariants3940- `Deck` creates one `Reveal` instance on mount and destroys it on unmount.41- `Deck` must remain safe under React `StrictMode`; do not reintroduce double initialization.42- Event props are wired with `deck.on()` after initialization and cleaned up with `deck.off()` when callbacks change or the component unmounts.4344## Sync Policy4546- `Reveal.sync()` is expensive. Call it rarely.47- `Deck` should only call `sync()` when the rendered slide structure changes.48 - Example: slides added, removed, reordered, or regrouped into or out of vertical stacks.49- Ordinary React content updates inside an existing slide must not trigger a full deck sync.50- One deck-level sync is still expected once the deck is ready.5152## Configure Policy5354- `config` is shallow-compared.55- Recreating a config object with the same shallow values must not call `configure()`.56- `configure()` should only run after the deck is initialized and ready.57- `configure()` performs its own Reveal-side sync, so the wrapper must avoid an immediate redundant `sync()` afterward.5859## Component Responsibilities6061- `Deck` owns Reveal lifecycle, config application, event wiring, and structure-level sync.62- `Slide` owns slide-local attribute mapping and calls `syncSlide()` only when the effective slide `data-*` attributes change after mount.63- `Markdown` mirrors the core Reveal Markdown plugin behavior in React.64 - It is responsible for markdown parsing, separator support, notes support, and comment-based `.slide:` and `.element:` attributes.65 - It should keep markdown-specific DOM post-processing local rather than expanding deck-wide sync behavior.66- `Code` owns explicit code block rendering and Reveal highlight integration for non-markdown code blocks.67- `Stack` and `Fragment` should stay lightweight unless there is a strong reason otherwise.6869## Markdown And Highlighting Notes7071- Markdown behavior should stay aligned with the core Reveal Markdown plugin unless the React API intentionally diverges.72- Markdown slide parsing and comment-based attribute helpers belong in `react/src/utils/markdown.ts`.73- Markdown code highlighting should recover on rerender and after Reveal becomes available, without requiring a full deck sync.7475## When Changing Behavior7677- If sync, configure, markdown, or highlight behavior changes, update the relevant colocated tests in the same change.78- If the public React API or documented behavior changes, update `react/README.md`.79- Prefer focused regression tests over broad snapshots.8081## Validation8283Run these after React wrapper changes:8485- `npm test --prefix react`86- `npm run build --prefix react`87
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| wpscanteam/wpscanAGENTS.md · 9.7k | AGENTS.md | setupbuildteststyle+6 | 100/100 | 2 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago |
