Skip to content

[wasm] Source Phase Imports for ESM Integration - #42467

Merged
Ms2ger merged 11 commits into
web-platform-tests:masterfrom
guybedford:source-phase-imports
Nov 17, 2023
Merged

Ms2ger merged 11 commits into
web-platform-tests:masterfrom
guybedford:source-phase-imports

Conversation

@guybedford

Copy link
Copy Markdown
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?

@lucacasonato lucacasonato 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.

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

@Ms2ger

Ms2ger commented Oct 25, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

Comment thread wasm/jsapi/module/moduleSource.any.js Outdated
Comment thread wasm/jsapi/module/moduleSource.any.js Outdated
Comment thread wasm/jsapi/module/moduleSource.any.js Outdated
Comment thread wasm/jsapi/module/moduleSource.any.js Outdated
Comment thread wasm/webapi/esm-integration/resources/worker.js Outdated
Comment thread wasm/webapi/esm-integration/source-phase.tentative.html Outdated
@guybedford
guybedford force-pushed the source-phase-imports branch 2 times, most recently from 8e1e061 to 9c2a61f Compare November 9, 2023 17:47
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