Registry / web-framework / oxc-plugin-react-compiler

oxc-plugin-react-compiler

JSON →
library0.2.0jsnpmunverified

Rust port of babel-plugin-react-compiler for OXC/Vite v8. Current stable version: 0.2.0. Release cadence: frequent (10+ versions in 3 months). Key differentiators: 100% conformance parity with upstream React Compiler, Rust performance, source map generation. Not official React or OXC project, community-driven. Experimental, but aims for exact behavior alignment.

npm install oxc-plugin-react-compiler
INSTALL
IMPORT
SIG · OXC-PLUGIN-REACT-C
O
oxc-plugin-react-compiler
web-frameworkjavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

reactCompilerOxc
import { reactCompilerOxc } from 'oxc-plugin-react-compiler'
import { reactCompilerOxc } from 'oxc-plugin-react-compiler/react'
Named export from package root for Vite plugin. ESM-only since v0.2.0.
default (ESLint)
import reactCompiler from 'oxc-plugin-react-compiler/eslint'
import reactCompiler from 'oxc-plugin-react-compiler'
ESLint plugin is a subpath export; package root exports Vite plugin. Use subpath for ESLint/Oxlint.
reactCompiler.configs.recommended
import reactCompiler from 'oxc-plugin-react-compiler/eslint'
require('oxc-plugin-react-compiler/eslint').configs.recommended
ESM-only; CommonJS require will fail. Access configs via default import.

Configures Vite 8+ with oxc-plugin-react-compiler for React compiler optimizations.

import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { reactCompilerOxc } from 'oxc-plugin-react-compiler'; export default defineConfig({ plugins: [ reactCompilerOxc({ compilationMode: 'infer', panicThreshold: 'none', target: '19', }), react(), ], });
Debug
Known issues
gotchaESLint plugin must use subpath import 'oxc-plugin-react-compiler/eslint', not package root.
fix
Use import from 'oxc-plugin-react-compiler/eslint' for ESLint/Oxlint.
affects: >=0.0.1
breakingRequires Vite 8.0 or later; will fail on earlier versions.
fix
Update Vite to >=8.0.0.
affects: >=0.0.1
breakingESM-only; CommonJS require() will throw.
fix
Use import syntax instead of require().
affects: >=0.2.0
gotchapackage root exports Vite plugin, not the linter. Mis-importing leads to undefined.
fix
Use 'oxc-plugin-react-compiler/eslint' for ESLint/Oxlint.
affects: >=0.0.1
deprecatedv0.1.0 and earlier did not support ESM-only; check your bundler.
fix
Upgrade to v0.2.0+ for ESM support or use bundler that handles mixed modules.
affects: <0.2.0
Errors
Common errors & fixes
Error: [vite] The requested module 'oxc-plugin-react-compiler' does not provide an export named 'reactCompilerOxc'
Mis-imported from wrong path or older version that had different export.
fix
Ensure you use import { reactCompilerOxc } from 'oxc-plugin-react-compiler' and have v0.2.0+ installed.
Error: Cannot find module 'oxc-plugin-react-compiler/eslint'
Using CommonJS require() on an ESM-only module.
fix
Use import statement and ensure project uses ESM (type: 'module' in package.json) or use bundler.
Error: [plugin:oxc-react-compiler] Failed to resolve plugin options
Invalid options object passed to reactCompilerOxc().
fix
Check documentation for valid options: compilationMode ('infer'|'annotation'|'all'), panicThreshold ('none'|'all'), target ('18'|'19'), sources (string[]|function).
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
eslintoptionalpeer dependency for ESLint plugin
viteoptionalpeer dependency for Vite plugin
Agent activity
2 hits · last 30 days
node
2
Resources
oxc-plugin-react-compiler — npm install oxc-plugin-react-compiler · libregistry