Skip to content

[wasm] ESM Integration import maps test#53722

Open
guybedford wants to merge 3 commits intoweb-platform-tests:masterfrom
guybedford:instance-builtin-polyfill
Open

[wasm] ESM Integration import maps test#53722
guybedford wants to merge 3 commits intoweb-platform-tests:masterfrom
guybedford:instance-builtin-polyfill

Conversation

@guybedford
Copy link
Copy Markdown
Contributor

This adds a new WebAssembly webapi test for the integration of import maps and WebAssembly module imports.

This tests specifier mappings for Wasm along with string builtins support. It also tests the ability for unknown string builtins to fallback to mapped implementations as public non-compile-time imports.

//cc @eqrion this should provide additional coverage for WebAssembly/js-string-builtins#46.

@nicolo-ribaudo
Copy link
Copy Markdown
Member

I don't know how other wasm WPT tests are written, but it'd be helpful to also have the .wat file to:

  • see what the .wasm file is actually doing
  • to be able to edit the test if needed

@Ms2ger
Copy link
Copy Markdown
Contributor

Ms2ger commented Jul 18, 2025

Mostly we've dynamically generated wasm binaries from js within the test, but I agree we shouldn't put binary wasm in the repo without a source and perhaps added to tools/ci/update_built.py

@guybedford
Copy link
Copy Markdown
Contributor Author

guybedford commented Jul 19, 2025

@Ms2ger yes we can't dynamically construct Wasm when testing static imports. Note that we already have multiple compiled Wasm cases in the webapi folder:

In general the main loss over having something like .wat is just being able to have comments.

The ideal approach might be to have a WPT harness approach that allows file.wat to be served as file.wasm so we can then support commented WAT.

I wonder if something like that might be possible? I think it should be a separate PR though.

@eqrion
Copy link
Copy Markdown
Contributor

eqrion commented Jul 29, 2025

The ideal approach might be to have a WPT harness approach that allows file.wat to be served as file.wasm so we can then support commented WAT.

That would be really nice, if possible. In general the text format is so much easier to use.

GH has support for displaying binary files specially depending on their file format. I opened a community discussion to see if they would consider adding wasm support.

@guybedford guybedford force-pushed the instance-builtin-polyfill branch from cfdb064 to fa4225d Compare October 3, 2025 23:13
@guybedford
Copy link
Copy Markdown
Contributor Author

The feedback here has now been addressed.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants