revert: disable React Compiler — breaks iframe srcDoc updates#2479
Merged
Conversation
Reverts 6e4bd23. The auto-memoization is patching too aggressively on components that drive an <iframe srcDoc={...}> off React state: it decides the iframe element is structurally identical across renders and skips the srcDoc attribute update, leaving the preview frozen on the initial render. Hit in two places in production: - web/src/pages/TemplatesPage/EditorPage.tsx — /templates editor preview doesn't update when the user edits HTML/CSS or field values. - web/src/pages/PreviewApkgPage/CardFrame.tsx — apkg deck preview flip button doesn't reveal the back of the card. Same pattern exists on the new web/src/pages/SharedDeckPage via CardFrame, so anonymous share recipients hit it too. A surgical `'use no memo'` opt-out on the two files would also fix this, but there's no protection against the same pattern showing up elsewhere and we have no way to find every iframe srcDoc consumer in 30 seconds. Revert the whole enable; reintroduce later behind explicit iframe tests that catch this class of regression. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for notion2anki ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
5 tasks
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
Reverts #2465. The React Compiler auto-memoization is freezing every component that drives an
<iframe srcDoc={...}>off React state: it treats the iframe element as structurally identical across renders and skips thesrcDocattribute patch. The preview stays on the first render forever.Production impact
Confirmed broken right now:
/templateseditor preview —web/src/pages/TemplatesPage/EditorPage.tsx. Editing HTML, CSS, or field values does not update the live preview iframe.web/src/pages/PreviewApkgPage/CardFrame.tsx. The flip button does not reveal the back of the card.web/src/pages/SharedDeckPage(usesCardFrame). Same root cause; anonymous share recipients hit it too.Why revert and not opt out
A surgical
'use no memo'directive at the top of those two files would also fix the known surfaces. But:'use no memo'anywhere in the codebase before this PR.web/vite.config.ts,web/package.json,pnpm-lock.yaml— no source code depends on the compiler being on.Reintroduce the compiler later behind explicit iframe regression tests that catch this class of failure.
Test plan
pnpm --filter 2anki-web typecheckcleanpnpm --filter 2anki-web testgreenpnpm --filter 2anki-web buildclean🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.