Repository navigation
ENG-12682 Add opt-in React Compiler support - #7234
Conversation
|
Merging this PR will not alter performance
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
All reported issues were addressed across 14 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
No conflicts. Claude-Session: https://claude.ai/code/session_01PXcFKAgnzhgdnSvhuCmxWE
Evaluate the generated vite.config.js with both flags in Node, apply the adapter's config hook with Vite's merge semantics, and check that optimizeDeps keeps the compiler-runtime include and the production-React rolldownOptions. Claude-Session: https://claude.ai/code/session_01PXcFKAgnzhgdnSvhuCmxWE
The dependency toggle test hardcoded the current pins, and the cache test patched in 1.0.1, which a real pin bump to 1.0.1 would make a no-op. Build both from constants.PackageJson.REACT_COMPILER_DEV_DEPENDENCIES. Claude-Session: https://claude.ai/code/session_01PXcFKAgnzhgdnSvhuCmxWE
masenf
left a comment
There was a problem hiding this comment.
this would be the perfect thing to implement as a config Plugin... except the framework provides no "nice" mechanism for updating the vite config from a plugin.
implementation is fine for now, but we probably would want to move it into a plugin later, once the necessary interfaces are in place.
|
The integration failures on 269734d come from a timing problem on npm, not from this PR. In run 37386208888, every failing
None of the failing fixtures turn on All of those packages are published now, so "Re-run failed jobs" on run 37386208888 should pass with no code change. I can't trigger re-runs from here (403). CodSpeed's two Generated by Claude Code |
|
@masenf agreed. I briefly tried moving this into a plugin with a new Vite-config hook, but the framework doesn't have a settled interface for plugins to update the Vite config yet, so I dropped that attempt. The PR keeps the Generated by Claude Code |
There was a problem hiding this comment.
All reported issues were addressed across 21 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
View guided diff | Turn on auto-fix | Re-trigger cubic
93b2bc6 to
269734d
Compare
Add experimental, opt-in React Compiler support for generated components. Existing apps retain the current build and memoization behavior by default.
REFLEX_REACT_COMPILER=trueprovides the equivalent environment setting. The compiler runs before React Router in development and production, targeting React 19 with normal inference and correctness bailouts. Scope is limited to generatedapp/,app_components/, andutils/components/JavaScript/JSX; runtime state providers, event utilities, dependencies, and custom public assets are excluded.The flag installs pinned Babel/compiler development dependencies through the existing dependency cache. Disabling it removes the transform and optional dependencies when no longer needed. The Vite plugin prebundles
react/compiler-runtime, which is injected after dependency scanning, to prevent first-load HTTP 504 errors.Validation:
test_run_granian_backend_refuses_requests_while_the_app_is_broken: it also fails on clean upstream7cac2faf9(recovery assertion there, refusal assertion on this run). The backend implementation and that test are unchanged by this PR.ty, and Biome formatting.Runtime gains depend on the workload; list-heavy updates can regress and compilation adds build time/memory. Documentation makes these tradeoffs explicit. This PR preserves existing Reflex memoization and does not include the fixture-specific filter-callback rewrite from the performance experiment.
<source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg">