[compiler] Port React Compiler to Rust # 36173 mvitousek merged 435 commits into react:main react/react:main from josephsavona:rust-research josephsavona/react:rust-research Copy head branch name to clipboard
josephsavona commented Mar 30, 2026 • edited Loading Uh oh!
There was an error while loading. Please reload this page .
This is an experimental, work-in-progress port of React Compiler to Rust. Key points:
We're excited to partner with teams to integrate the Rust version of React Compiler into other tools, like OXC and SWC. If you're interested in working with us on this, the best place to start is by taking a look at the react_compiler_swc and react_compiler_oxc crates. These give you an idea of the API shape that we're thinking of.
Note that the conversion from any AST into our HIR is complex, and we can only maintain one version. Hence we've aligned on using a Babel-like AST as our public API. Another key point is that we don't yet implement our own scope analysis (since the TS version of the compiler relied on Babel's scope analysis), so for now we require that the scope data be serialized. It's a denormalized graph, and some metadata has to be stored to associate nodes with scopes. We're open to feedback about the AST and scope representation - we iterated a bit just to get things to work, but it can be more optimal.