@evanyou: To answer a common question - why not make React Compiler a plugin? It all comes down to practical trade-offs. Making i…
Summary
Evan You explains why integrating React Compiler directly into OXC (Rust) offers significant performance gains over a plugin approach, while addressing binary size concerns and future plans for AST transfer.
View Cached Full Text
Cached at: 06/24/26, 01:56 AM
To answer a common question - why not make React Compiler a plugin?
It all comes down to practical trade-offs. Making it a rust-based plugin is already significantly faster than the Babel version (up to 15x), but still 50% slower than direct-in-oxc due to the data passing / AST cloning overhead for being a plugin.
This is also different from e.g. Vue or Svelte where there are completely different AST formats; the React Compiler works on a JS/JSX AST that Oxc already supports (with only slight format differences). By integrating it in Oxc we can eliminate a lot of the AST cloning / transforming overhead, which isn’t feasible for other frameworks. It’d be a shame to leave such a big perf opportunity on the table.
We are also fully aware of how integrating it will result in bigger binary size for users who don’t use React Compiler, which is why I personally blocked the version that resulted in a ~5mb increase. We are aiming to get it down to a reasonable level while optimizing binary size across the board to minimize the downside.
For the long run, we are aiming to make raw AST transfer (which is already used in oxlint JS plugins) applicable to transform plugins. This would allow us to ship oxc plugins without AST cloning perf overhead.
Boshen (@boshen_c): We withdrew the Rust React Compiler integration from Rolldown and Vite because it increased the binary size from 28.7MB to 33.8MB, a 17% increase, which cannot be justified for all Vite users.
My current experiment is to have Claude understand our constraints.
Preliminary
Similar Articles
Port React Compiler to Rust
An initiative to port the React Compiler to Rust, aiming to improve performance and integration with the Rust ecosystem.
Making React Context Cheap with React Compiler
A deep-dive blog post exploring how React Context re-renders affect performance with large component trees, and how the React Compiler could make context cheap without needing a context selector API.
Octane – React's programming model, compiled
Octane is a compiled frontend framework that brings React's programming model—hooks, Suspense, and actions—with ahead-of-time compilation, no virtual DOM, and no rules of hooks.
@evanyou: Compiling TS to native is cool, but what if plain TS can be as fast as native
Evan You musing about whether plain TypeScript could achieve native-level performance rather than relying on compilation to native code.
@freeCodeCamp: Large React apps get harder to scale when every feature has to live inside the core codebase. In this tutorial, Jessica…
This tutorial explains how to design a type-safe, lazy-loaded, and secure plugin architecture in React using TypeScript, covering plugin lifecycles, bundling, and runtime loading.