PR #36173 landed on June 10 — 435 commits rewriting the React Compiler from TypeScript to Rust. The majority of the code was written by AI. All 1,725 fixtures pass. Here's the full analysis.
On June 10, 2026, Joseph Savona — one of the core React team members at Meta — merged PR #36173 into the main React repository. The pull request represents one of the most significant under-the-hood changes to React's tooling ecosystem: a full port of the React Compiler from TypeScript to Rust.
The React Compiler (formerly known as React Forget) is the automatic memoization tool that eliminates
the need for manual useMemo, useCallback, and React.memo calls.
If you're not familiar with how it works as a user, I covered that in my
React Compiler guide for React 19.2 — this article focuses
on the Rust port itself: why it was done, how the architecture works, the performance gains, and
what it signals for the future of the React ecosystem.
The majority of the 435 commits were generated by AI. Humans guided the architecture and reviewed the output. This is one of the largest real-world demonstrations of AI-assisted refactoring in core infrastructure software — the entire TS-to-Rust translation of a production-grade compiler with arena-based memory management, Babel/OXC/SWC integration points, and per-pass IR comparison tests. The implications for how we approach framework rewrites are significant.
The React Compiler's TypeScript implementation worked well for small codebases, but as the compiler analyzed larger and larger component trees, the overhead of JavaScript's garbage-collected memory model became apparent. The compiler performs sophisticated static analysis — building intermediate representations, control flow graphs, and SSA form — all of which create and destroy many short-lived objects during compilation.
In JavaScript, this allocation pattern creates pressure on the garbage collector. Even with V8's optimized generational GC, the TypeScript version of the compiler exhibited latency spikes on large files. The Rust port solves this with arena-based allocation — a pattern where objects are allocated in contiguous memory regions and freed all at once when the arena is dropped.
The key architectural difference between the TypeScript and Rust versions is the memory management strategy. The TypeScript version used JavaScript objects and arrays for its internal data structures (HIR nodes, basic blocks, SSA variables). The Rust version replaces these with arena allocators:
// TypeScript version: individual heap allocations
interface BasicBlock {
id: number;
statements: Statement[];
predecessors: number[];
successors: number[];
}
// Rust version: arena-allocated
struct BasicBlock {
id: u32,
statements: ArenaVec<Statement>,
predecessors: SmallVec<[u32; 4]>,
successors: SmallVec<[u32; 4]>,
}
struct FunctionArena {
blocks: Arena<BasicBlock>,
statements: ArenaVecStore<Statement>,
// ... all per-function allocations
}
impl Drop for FunctionArena {
fn drop(&mut self) {
// All memory freed at once — no per-object GC
}
}
The difference is dramatic. In the TypeScript version, compiling a large component function creates thousands of individual heap allocations — each tracked by the GC. In the Rust version, all the per-function intermediate data lives in a single arena that is freed atomically when the function is fully processed. No GC overhead, no allocation tracking, no latency spikes.
The Rust port does not change the compiler's architecture. It preserves the same pipeline that the TypeScript version uses:
Every one of the 1,725 test fixtures passes — and the test suite is notably thorough: it checks not just the final output but also the intermediate IR state after each compiler pass. This means correctness is verified at every stage of the pipeline, not just at the end.
One of the important design decisions is that the Rust port ships with three integration targets, giving developers and framework authors flexibility:
The Babel plugin calls into the Rust binary via FFI (Foreign Function Interface). From a user's perspective, nothing changes — you add the same Babel plugin to your config. Under the hood, the plugin compiles the JavaScript file by passing it to the Rust compiler, which processes the AST directly. This is the integration that's 3x faster than the pure-TypeScript version.
OXC is the Rust parser and toolchain from VoidZero (the team behind Vite). The React Compiler can now run directly on OXC's AST without any JavaScript interop. For projects already using OXC (available through Rolldown and future Vite versions), this eliminates the serialization overhead entirely — the parser and compiler share the same memory space.
SWC is another Rust-based compiler toolchain, widely used in Next.js and other frameworks. The React Compiler can consume SWC's parsed AST and emit optimized output. This makes the compiler available to the entire SWC ecosystem without additional JavaScript bridge costs.
The three-target approach is strategically important. It means the React Compiler is not tied to any single build tool — it works in Babel-based projects (the majority of existing React apps), OXC-based projects (the future of the Vite ecosystem), and SWC-based projects (Next.js, Turbopack). This is a bet on ecosystem neutrality.
The headline numbers are impressive, but let's break down what they mean in practice:
It's worth noting that the "3x Babel plugin" number accounts for the overhead of the JavaScript-to-Rust FFI bridge. The OXC and SWC integrations, which share memory with the parser, should be even faster — though official benchmarks for those paths haven't been published yet.
The fact that the majority of the 435 commits were written by AI (with humans guiding the architecture) deserves its own analysis. This is not a toy example — this is a production compiler that runs in thousands of build pipelines, processing millions of lines of React code daily.
The workflow, as described in the PR, followed this pattern:
This is a template that will likely be repeated across the JavaScript ecosystem. If a complex compiler can be ported from TypeScript to Rust with AI assistance in a matter of weeks, then many more tools can follow the same path. The VoidZero acquisition by Cloudflare (which I covered in my VoidZero analysis) is part of the same trend — the JavaScript tooling ecosystem is aggressively pursuing native performance.
The Rust port completes a broader trend in the React and JavaScript build tooling landscape. Let's connect the dots:
Consider the tools that power modern React development:
Every major build performance bottleneck in the React stack is being rewritten in Rust. The React Compiler was the last significant TypeScript-only tool — and now it's Rust-native too.
For the average React developer, the tangible benefits are:
It's important to emphasize what does not change:
useMemo and useCallback still work and take precedenceFor a full understanding of how to use the React Compiler effectively (whether TypeScript or Rust), see my React Compiler usage guide with code examples and migration strategies.
The Rust port of the React Compiler opens several interesting possibilities:
With VoidZero now part of Cloudflare (and OXC being their parser of choice), the OXC integration path for the React Compiler could become the default for new projects. The combination of OXC's Rust parser + the Rust compiler eliminates all JavaScript interop overhead, making the combined pipeline significantly faster than the current Babel route.
Next.js already uses SWC for compilation. The SWC integration means the React Compiler can be embedded directly in Next.js's build pipeline without a separate Babel step. This could make the React Compiler enabled by default in future Next.js versions with zero configuration.
The success of this AI-assisted port may inspire other projects to attempt similar rewrites. If a compiler as complex as the React Compiler can be ported successfully, then projects like TypeScript's own type checker, ESLint rules, or Prettier plugins could follow the same pattern.
useMemo and useCallback still take precedence. The only difference you'll notice is faster builds. For a complete guide on using the React Compiler effectively, see my React Compiler usage guide. Important security note: If you're running React Server Components, ensure you've patched the critical CVE-2025-55182 (React2Shell) vulnerability — see my React RCE vulnerability guide for details.The React ecosystem is evolving rapidly — from the React Compiler's Rust port to VoidZero-Cloudflare, Angular's OnPush-by-default approach, and the expanding Rust tooling landscape. Navigating these changes requires a developer who stays current with the ecosystem and understands how to choose the right tools for your specific project.
I'm a full-stack web developer with 20+ years of experience building production React applications. Whether you're starting a new project, migrating an existing codebase, or need guidance on adopting the React Compiler, I'm happy to help. Reach out to me for a free initial consultation.
I also write in-depth technical articles on the tools and frameworks that matter — follow my articles for the latest in web development.
Need a React developer who stays on top of the ecosystem? Tell me about your project — I'll provide honest advice and a preliminary estimate. Free of charge.