Files
oxc/crates/oxc_react_compiler
camc314 b904d51667 fix(react-compiler): avoid panic on non-ASCII ref-like names (#28758)
Reading `object_name[..1]` panics when a ref-like identifier starts with a multibyte character, such as `한글Ref`. Use `.chars().next()` to preserve the ASCII name check without slicing through a UTF-8 character. Ports the fix and regression fixture from https://github.com/facebook/react/pull/38025.

Fixes #28278.
2026-11-03 14:13:47 +00:00
..
…
…

Oxc React Compiler

oxc integration for the Rust port of the React Compiler.

Overview

This crate owns the oxc ↔ react_compiler_ast (Babel) conversion layer and runs the React Compiler over an oxc AST, memoizing React components and hooks. The compiler core crates are front-end agnostic (they never depend on oxc), so they are consumed from crates.io as a published fork; the AST and scope conversion lives here, written against the live oxc AST.

Ambient TypeScript variable declarations are erased from compiled functions. Their references remain external values rather than runtime locals, hoisted bindings, or captured context.

API

  • compile — run the compiler and return a CompileResult with the rewrite to apply (via CompileOutput::transform) plus diagnostics.
  • lint — report diagnostics only, without emitting code; each finding is tagged with its ErrorCategory.
  • PluginOptions — configure which functions are compiled and how.