perf(react): reuse incremental parsing in streams - #397
Conversation
◈ PR Lens
Architecture 8 components touched across 3 lanes. Inside the changed components — 2 viewsComponent view — React Streaming & Component Factory Modules inside @comark/react managing parser serialization, option memoization, and browser test execution. Component view — Core Incremental Parsing & Token Processing Core engine modules handling full-document reparsing for headings/references and omission of reference tokens. Data flow
Drill down
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@onmax is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
Documentation previewsPreviews are disabled for pull requests from forks. |
comark
@comark/angular
@comark/ansi
@comark/html
@comark/nuxt
@comark/react
@comark/svelte
@comark/vue
commit: |
What
Keep a serialized parser in React streaming components so each update reuses completed blocks. Reset it when parser settings change and parse the full source when streaming ends. Keep defined components' options and plugins stable across renders.
Why
React currently parses the entire source on each update, as discussed in #135. Also clear stale frontmatter when a stream switches documents. Use a full parse for heading tails and reference definitions to preserve IDs and links.
Related #396.
Parser timings for the shared React/Svelte call pattern, using the published PR code: