-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Many modern frameworks use Rust-based compilers that are exposed to Node.js via NAPI-RS.
These ship as native .node addons rather than pure JavaScript, which means they won't
work in a browser-based runtime without special handling.
Example: Qwik
The Qwik optimizer is a Rust-based SWC transform (swc_ecmascript) exposed to Node.js via
NAPI-RS (napi = "2"). It runs as a Vite plugin during development and build. Without
native addon support, Qwik projects cannot run in Nodepod.
- Rust optimizer source: packages/qwik/src/optimizer/core/ in QwikDev/qwik
- NAPI bindings: packages/qwik/src/napi/
Other affected tools:
- oxc-parser — Used in the Vite/Rolldown ecosystem, also Rust + NAPI-RS
- Other frameworks with Rust-based compilers exposed via NAPI-RS (this pattern is
becoming increasingly common)
Context:
Nodepod already handles replacing Rolldown with Rollup (since Rolldown is Rust-based),
but NAPI-RS addons are a broader pattern across the Vite ecosystem. Most Vite-based
framework projects depend on at least one NAPI-RS module.
Possible approaches:
- WASM builds of the native addons (some projects may publish WASM variants)
- Auto-detection and substitution of NAPI modules with WASM equivalents where available
- A polyfill/shim layer for the NAPI-RS runtime