Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Source Phase Imports for ESM Integration #42467

Merged
merged 11 commits into from
Nov 17, 2023

Conversation

guybedford
Copy link
Contributor

This adds a test for the new source phase imports aspect of the ESM integration.

Includes tests both for using the source phase, and for checking that the prototype behaviours match the updated requirements on WebAssembly.Module extending AbstractModuleSource.

Per the note in https://github.com/WebAssembly/esm-integration#es-module-integration-proposal-for-webassembly, it is possible for implementations to implement source phase imports independently from non-source-phase imports. I don't know if there's a way we want to reflect that in the test structure though?

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

This can be rewritten as a .any.js file which will make this also runnable from Web Workers and Service Workers.

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 25, 2023

Can it? Note <script type=module>. The docs seem to show that the worker scopes have a module variant, but window doesn't.

@guybedford
Copy link
Contributor Author

I've split out the tests to separate the module source constructor tests from the HTML ones, so they should work across different contexts. I've also extended the ESM integration HTML worker test to include source phase imports. PTAL

wasm/jsapi/module/moduleSource.any.js Outdated Show resolved Hide resolved
wasm/jsapi/module/moduleSource.any.js Outdated Show resolved Hide resolved
wasm/jsapi/module/moduleSource.any.js Outdated Show resolved Hide resolved
wasm/jsapi/module/moduleSource.any.js Outdated Show resolved Hide resolved
wasm/webapi/esm-integration/resources/worker.js Outdated Show resolved Hide resolved
wasm/webapi/esm-integration/source-phase.tentative.html Outdated Show resolved Hide resolved
@guybedford guybedford force-pushed the source-phase-imports branch 2 times, most recently from 8e1e061 to 9c2a61f Compare November 9, 2023 17:47
@Ms2ger Ms2ger merged commit 8b18dd1 into web-platform-tests:master Nov 17, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants