RC RANDOM CHAOS

Rust React Compiler Lands Natively in Vite, Cutting Compile Time ~17×

· via Hacker News

Original source

The Rust React Compiler is now native in Vite

Hacker News →

The oxc team shipped official Rust-based React Compiler support on August 4, 2026, and it’s now wired into Vite directly rather than routed through Babel. The developers behind Outlyne, a website builder, moved their 1,036-file React Router codebase onto the native compiler and clocked the compiler stage dropping from 14.3 seconds under Babel to 0.81 seconds single-threaded — roughly a 17.6× gain that lines up with oxc lead Boshen’s claim of 10×-plus over Babel. Because the compiler is only one slice of a build, the end-to-end improvement was more modest at about 2.4× (22.1s to 9.3s), but with agent-assisted coding pushing CI usage up, shaving GitHub Actions minutes has become a tangible cost saving.

Speed aside, the more durable win is staying current with a compiler that keeps closing JavaScript-support gaps. The Rust version already handles patterns that made the stable 1.0 Babel compiler bail out: conditional logic inside try/catch, reassigning a destructured prop later used in a nested closure, and computed object property keys. For this codebase those fixes brought seven additional functions under optimization. Some gaps remain — a throw inside a try block and logical assignment operators (??=, &&=, ||=) still trigger skips — but the Rust path means future fixes arrive automatically, whereas the Babel-based compiler is a dead end.

There’s also a consistency payoff. Running Oxlint and the build on different React Compiler versions had previously produced a false-positive bug report, since one package version supported a pattern the other didn’t. Aligning linter and build on the same compiler eliminates that class of drift and the risk of uncompiled components slipping into production. Adopting it means simpler config: @vitejs/plugin-react users on Vite 8+ swap in oxc-transform-react and pass { compiler: true }, dropping the Babel plugin, while React Router framework-mode projects can replace their Babel chain with @acusti/vite-plugin-react-compiler.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.