The Binaryen (O1–O3) checkbox is off by default. When enabled at O1–O3, the worker uses the pinned [email protected] to run only optimize-instructions with MVP + multi-value. The separate guard validates the output before it is displayed, executed, or made available for download. If post-processing fails, no unoptimized fallback is published; uncheck Binaryen to retry. O0 never loads the optional assets.
To refresh the guard, run this from the was-compiler root:
wasm-pack build crates/browser \
--target web \
--out-dir ../../target/playground-binaryen-guard \
--out-name was_compiler \
--mode no-install --no-opt --offline \
--features playground-binaryenCopy was_compiler.js, was_compiler.d.ts, was_compiler_bg.wasm, and was_compiler_bg.wasm.d.ts from that output into src/assets/binaryen/. Leave the primary package in src/assets/compiler/ unchanged.
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
The React Compiler is enabled on this template. See this documentation for more information.
Note: This will impact Vite dev & build performances. You can also try the experimental native React Compiler support in plugin-react by using compiler: true in the plugin options instead of using the Babel plugin.
If you are developing a production application, we recommend enabling type-aware lint rules by installing oxlint-tsgolint and editing .oxlintrc.json:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"options": {
"typeAware": true
},
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}See the Oxlint rules documentation for the full list of rules and categories.