react-compiler-migration
React Compiler Migration
Make a file compile. Nothing else. The marker tells you what is broken and, after the edit, whether you actually fixed it.
Rule
react-compiler-marker is the source of truth. Run it before the first edit and after every edit. A fix is not done because the reasoning is sound; it is done because the failure count dropped.
It earns that status: it loads the workspace's own babel-plugin-react-compiler and runs a real transformFromAstSync with noEmit: false, failing if codegen fails. It is not a lint pass or a heuristic. It also runs with compilationMode: "infer" and panicThreshold: "none" — the plugin defaults this repo builds with — plus enableTreatRefLikeIdentifiersAsRefs: true, which the build does not set. That last flag makes it stricter than the app build, so a marker-clean file is build-clean, not the other way round.
Know the one thing it cannot tell you: the compiled output is generated and thrown away, never executed. Jest disables the compiler (scripts/react-compiler.js gates on NODE_ENV === 'test'), so a green test run proves the source still behaves, not the compiled version. Codegen is verified; runtime behavior of the memoized output is not. Say so when reporting anything beyond a trivial fix.
Never fix a bail-out by suppressing it. "use no memo", a fresh eslint-disable, or deleting the behavior that failed are all non-fixes.
Workflow
1. Baseline
The CLI scans directories, not files, and resolves babel-plugin-react-compiler relative to the scanned path — so pass the plugin path explicitly and run from the repo root: