Closed Bug 1994828 Opened 5 months ago Closed 3 months ago

ESM: Add initial support for fetching wasm modules

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
148 Branch
Tracking Status
firefox148 --- fixed

People

(Reporter: dminor, Assigned: dminor)

References

(Blocks 2 open bugs)

Details

Attachments

(14 files, 8 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

I'm going to scope this initial bug according to the note at the top of https://webassembly.github.io/esm-integration/js-api/index.html#esm-integration, specifically: "In this case, the ResolveExport abstract operation should be implemented as returning null, and the InitializeEnvironment and ExecuteModule abstract operations implemented as unconditionally throwing a SyntaxError exception."

Summary: Support direct imports of wasm modules → Add initial support for direct imports of wasm modules
Severity: -- → N/A
Priority: -- → P3

This has been renamed to "javascript-or-wasm" in the specification.

The only way we can distinguish between JavaScript and wasm modules is
using the mime type in the response. This adds a field to track this
information in the load request.

Since we don't support full evaulation/instance phase integration, we
throw on InitializeEnvironment and return null for ResolveExport.

This checks that we can parse a wasm module, and that attempting to
link it will throw a SyntaxError as expected.

I'm going to scope this bug even smaller, and just add support for fetching wasm modules in this bug. I'll file follow ups to cover the other patches I originally had on this bug.

Summary: Add initial support for direct imports of wasm modules → Add initial support for fetching wasm modules
Blocks: 1997621
Summary: Add initial support for fetching wasm modules → ESM: Add initial support for fetching wasm modules
Attachment #9522602 - Attachment description: Bug 1994828 - Rename ModuleType::JavaScript to JavaScriptOrWasm; r=allstarschh! → Bug 1994828 - Add ModuleType::JavaScriptOrWasm to reflect specification change; r=allstarschh!
Attachment #9522604 - Attachment description: Bug 1994828 - Add IsWasmMimeType; r=#dom-core! → Bug 1994828 - Add HasWasmMimeTypeEssence; r=#dom-core!
Attachment #9522606 - Attachment description: Bug 1994828 - Track wasm mime type in ModuleLoadRequest; r=allstarschh! → Bug 1994828 - Track wasm mime type essence in ModuleLoadRequest; r=allstarschh!
Attachment #9522608 - Attachment description: Bug 1994828 - Add JS::CompileWasmModule; r=allstarschh!,rhunt! → Bug 1994828 - Add empty JS::CompileWasmModule; r=allstarschh!
Attachment #9522609 - Attachment is obsolete: true
Attachment #9522611 - Attachment is obsolete: true
Attachment #9522612 - Attachment is obsolete: true
Attachment #9522613 - Attachment is obsolete: true
Attachment #9522614 - Attachment is obsolete: true
Attachment #9522616 - Attachment is obsolete: true
Attachment #9522617 - Attachment is obsolete: true
Attachment #9522618 - Attachment is obsolete: true
Pushed by dminor@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/22ab64ea6d4b https://hg.mozilla.org/integration/autoland/rev/40b07d51d5b5 Add ModuleType::JavaScriptOrWasm to reflect specification change; r=allstarschh,dom-worker-reviewers,asuth https://github.com/mozilla-firefox/firefox/commit/754a58c63513 https://hg.mozilla.org/integration/autoland/rev/5444c6f25ed3 Add pref for wasm/esm integration; r=allstarschh https://github.com/mozilla-firefox/firefox/commit/b6c54c546d7e https://hg.mozilla.org/integration/autoland/rev/521f575d58a3 Add HasWasmMimeTypeEssence; r=dom-core,smaug https://github.com/mozilla-firefox/firefox/commit/29510a29713b https://hg.mozilla.org/integration/autoland/rev/a20026a4833a Add checks for wasm mime type for script loading; r=dom-core,necko-reviewers,smaug,sunil https://github.com/mozilla-firefox/firefox/commit/092a9faecc5b https://hg.mozilla.org/integration/autoland/rev/467c90d79ed5 Track wasm mime type essence in ModuleLoadRequest; r=allstarschh https://github.com/mozilla-firefox/firefox/commit/67234fcc689f https://hg.mozilla.org/integration/autoland/rev/4ba2fa139419 Set wasm mime type on module request; r=dom-core,smaug https://github.com/mozilla-firefox/firefox/commit/dab845c9edf7 https://hg.mozilla.org/integration/autoland/rev/956cd9b7d24e Add empty JS::CompileWasmModule; r=allstarschh https://github.com/mozilla-firefox/firefox/commit/26107c4f6374 https://hg.mozilla.org/integration/autoland/rev/d0d00cd30f0f Don't cache wasm modules; r=arai https://github.com/mozilla-firefox/firefox/commit/5c2dc323f00d https://hg.mozilla.org/integration/autoland/rev/b894b8e202b2 Add support for wasm modules in module loaders; r=allstarschh,dom-core,smaug https://github.com/mozilla-firefox/firefox/commit/dac591595425 https://hg.mozilla.org/integration/autoland/rev/b4b97092cbf2 Set wasm mime type for worker requests; r=dom-worker-reviewers,edenchuang https://github.com/mozilla-firefox/firefox/commit/c06884446e58 https://hg.mozilla.org/integration/autoland/rev/2a4b97162023 Add wasm to mimetype check in ScriptResponseHeaderProcessor.cpp; r=dom-worker-reviewers,edenchuang https://github.com/mozilla-firefox/firefox/commit/d9af9be984bd https://hg.mozilla.org/integration/autoland/rev/e7a2a3052ddc Set wasm mime type essence for worklets; r=allstarschh https://github.com/mozilla-firefox/firefox/commit/18958bfdef8b https://hg.mozilla.org/integration/autoland/rev/a4cac8f679b4 Allow service workers to load wasm modules; r=dom-worker-reviewers,edenchuang https://github.com/mozilla-firefox/firefox/commit/88571c466f03 https://hg.mozilla.org/integration/autoland/rev/cd6d393e47d9 Set pref for esm-integration tests and update expected results; r=allstarschh
Regressions: 2005882
QA Whiteboard: [qa-triage-done-c149/b148]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: