perf: enable React Compiler for the web app#2465
Merged
Merged
Conversation
✅ Deploy Preview for notion2anki ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Adds babel-plugin-react-compiler to the Vite React plugin's Babel chain. Auto-memoizes components and hooks, reducing re-renders and shaving main-thread work on interaction-heavy pages. Verified: pnpm typecheck, pnpm build (5.7s), pnpm lint clean, 774 tests pass. Note: this targets INP/runtime perf, not LCP. The render-blocking + unused-JS work from the PageSpeed report is a separate PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
13a1aa9 to
34778ec
Compare
|
This was referenced May 20, 2026
aalemayhu
added a commit
that referenced
this pull request
May 20, 2026
The template gallery and editor preview both ran every starter through
a substituter that only knew about {{Field}} and {{cloze:Field}} — no
support for the {{#Field}}...{{/Field}} and {{^Field}}...{{/Field}}
section syntax Anki templates rely on, and no support for field names
with spaces.
Hits half the gallery the moment the iframe actually renders again
after the React Compiler revert: Image Occlusion (uses {{#Header}} and
{{#Back Extra}}), every Notion variant on the cloze base type (uses
{{#Extra}}), the Abhiyan Night Mode pair (uses {{#Tags}}), and the
Modern Cloze / Vocabulary / Medical / etc. starters in
DefaultTemplatesService (use {{#Example}}, {{#Mnemonic}}). Thumbnails
either rendered the literal {{#Field}} / {{/Field}} tokens or went
blank when an entire layout sat inside a section block.
Pre-existing since the note-types page shipped on 2026-05-15, masked
until now by the iframe-srcDoc freeze from #2465.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
babel-plugin-react-compilerin@vitejs/plugin-react's Babel chain.Why
Separate from the PageSpeed LCP work (render-blocking + unused JS — that's a different PR). React Compiler targets runtime/interaction perf (TBT/INP), not first paint. Low-risk to enable: if the build keeps passing and tests stay green, we keep it; if a component opts out is needed, the compiler has built-in escape hatches (
'use no memo').Test plan
Not in this PR
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.