Skip to content

feat(wasm): expand test suite, unwrap WebAssembly.Global and enable js-string builtins#22674

Open
guybedford wants to merge 5 commits into
vitejs:mainfrom
guybedford:feat/wasm-esm-integration
Open

feat(wasm): expand test suite, unwrap WebAssembly.Global and enable js-string builtins#22674
guybedford wants to merge 5 commits into
vitejs:mainfrom
guybedford:feat/wasm-esm-integration

Conversation

@guybedford

Copy link
Copy Markdown

Follow-on to the ESM Integration PR, to enable direct .wasm imports exposing exported WebAssembly.Global values unwrapped to their JS value, while retaining a backing table to support wasm-to-wasm global imports. This is done via a two-layer module split: a raw layer owns the instance and exposes globals as WebAssembly.Global objects, while the user-facing module re-exports the raw layer and unwraps globals (preserving live cells for wasm-to-wasm imports).

This PR also enables the JS String Builtins and Imported String Constants proposals on compile/instantiate, matching the spec and Node.js implementation.

…or direct imports

Direct .wasm imports now expose exported WebAssembly.Global values unwrapped
to their JS value, and support wasm-to-wasm global imports via a two-layer
module split: a raw layer owns the instance and exposes globals as
WebAssembly.Global objects, while the user-facing module re-exports the raw
layer and unwraps globals (preserving live cells for wasm-to-wasm imports).

Also enable the JS String Builtins and Imported String Constants proposals on
compile/instantiate, matching the WebAssembly/ES Module Integration loader.
@guybedford guybedford force-pushed the feat/wasm-esm-integration branch from 7ba7032 to 7b3269d Compare June 12, 2026 23:40
daltino

This comment was marked as spam.

@sapphi-red sapphi-red added feat: wasm p2-nice-to-have Not breaking anything but nice to have (priority) labels Jun 18, 2026

@sapphi-red sapphi-red left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

(I pushed some minor refactors, hope you don't mind)

@Menci If you have a chance, I'd appreciate it if you could take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: wasm p2-nice-to-have Not breaking anything but nice to have (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants