Turbopack: extract WASM and Worker loading into importable `@turbopack/wasm-*`…
Turbopack: extract WASM and Worker loading into importable `@turbopack/wasm-*` and `@turbopack/worker-*` modules
Follow the pattern of #92549 (base64 extraction) to move rarely-used WASM loading
and Worker creation logic out of the always-shipped runtime into on-demand modules.
WASM loading is split into three environment-specific modules:
- `@turbopack/wasm-node` (uses fs/stream for Node.js)
- `@turbopack/wasm-dom` (uses fetch for browsers)
- `@turbopack/wasm-edge` (uses pre-compiled edge modules)
Worker creation is split into two modules:
- `@turbopack/worker-browser` (Web Worker / SharedWorker via URL params)
- `@turbopack/worker-node` (worker_threads with forwarded globals)
The runtime now exposes four new context shortcuts (`w`, `u`, `X`, `b`) that
provide environment-specific primitives (chunk URL resolution, asset suffix,
forwarded globals, chunk path resolution) which the extracted modules consume
via `__turbopack_*__` free variables.
Co-Authored-By:
Claude <noreply@anthropic.com>
Showing
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
File moved
File moved
This diff is collapsed.
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
Please
register
or
sign in
to comment