Ship module workers
Categories
(Core :: DOM: Workers, task)
Tracking
()
People
(Reporter: yulia, Assigned: yulia)
References
(Blocks 5 open bugs)
Details
(Keywords: dev-doc-complete)
Attachments
(2 files)
Before we ship module workers, we should have it on nightly for a while to catch any issues. This bug is a placeholder for that work. I'll put it behind a flag for now.
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D174235
Comment hidden (advocacy) |
Updated•2 years ago
|
Updated•2 years ago
|
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8d375e536076
https://hg.mozilla.org/mozilla-central/rev/b248fa33a294
Comment 6•2 years ago
|
||
Yoshi, is that something that should be mentioned in our release notes (web platform section)? If it is worthy of a note, could you please request it and suggest the wording? Thanks!
https://wiki.mozilla.org/Release_Management/Release_Notes#Nomination_in_Bugzilla
Release Note Request (optional, but appreciated)
[Why is this notable]: Workers (DedicatedWorker, SharedWorker) can import ES modules. And this is also one of the interop 2023 feature (interop-2023-modules).
[Affects Firefox for Android]: Yes
[Suggested wording]: ES Modules on DedicatedWorker and SharedWorker.
[Links (documentation, blog post, etc)]:
https://web.dev/module-workers/
Comment 8•2 years ago
|
||
(In reply to Yoshi Cheng-Hao Huang [:allstars.chh][:allstarschh][:yoshi] from comment #7)
Release Note Request (optional, but appreciated)
[Why is this notable]: Workers (DedicatedWorker, SharedWorker) can import ES modules. And this is also one of the interop 2023 feature (interop-2023-modules).
[Affects Firefox for Android]: Yes
[Suggested wording]: ES Modules on DedicatedWorker and SharedWorker.
[Links (documentation, blog post, etc)]:
https://web.dev/module-workers/
Is there a more browser neutral documentation we would link to than the Chrome team blog? A standards specification? Or is it that we are implementing a Chrome non-standardized technology for webcompat?
(In reply to Pascal Chevrel:pascalc from comment #8)
Is there a more browser neutral documentation we would link to than the Chrome team blog? A standards specification? Or is it that we are implementing a Chrome non-standardized technology for webcompat?
Oh sorry
The spec is in
https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface
https://html.spec.whatwg.org/multipage/workers.html#shared-workers-and-the-sharedworker-interface
with WorkerType is "module" in WorkerOptions, https://html.spec.whatwg.org/multipage/workers.html#workeroptions.
Comment 10•2 years ago
|
||
Note added to beta notes with this wording:
DOM: Added support for ES Modules on DedicatedWorker and SharedWorker
Comment 11•2 years ago
|
||
FF114 MDN docs for this can be tracked in https://github.com/mdn/content/issues/26149 (and possibly some aspects in https://github.com/mdn/content/issues/26695).
Can you please confirm what is delivered by this. My "understanding" is"
- Static import via
import
statement and dynamic import viaimport()
operator syntax inside:- dedicated worker scripts
- shared worker scripts
- worklet scripts
- Support for worker modules using the
Worker
constructor option:new Worker(..., {type: "module"})
- No support for module import in service workers (static or dynamic)? If not, why?
- Is the above correct?
- Is there anything else that specifically needs to be mentioned?
(In reply to Hamish Willee from comment #11)
FF114 MDN docs for this can be tracked in https://github.com/mdn/content/issues/26149 (and possibly some aspects in https://github.com/mdn/content/issues/26695).
Can you please confirm what is delivered by this. My "understanding" is"
- Static import via
import
statement and dynamic import viaimport()
operator syntax inside:
- dedicated worker scripts
- shared worker scripts
Correct for these two workers
- worklet scripts
For worklets, only static import is supported (or import statements
, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import).
Dynamic import (or import operator
, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) on worklets is DISALLOWED per spec.
https://html.spec.whatwg.org/multipage/webappapis.html#hostloadimportedmodule:workletglobalscope
- Support for worker modules using the
Worker
constructor option:new Worker(..., {type: "module"})
Correct, and for SharedWorker it would be new SharedWorker(script, {type: "module"})
- No support for module import in service workers (static or dynamic)? If not, why?
Modules on Service worker is being tracked in bug 1360870
As this is not a requirement for interop-2023 modules
Check https://wpt.fyi/results/workers/modules?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned&view=interop&q=label%3Ainterop-2023-modules
But we will try to land it soon.
Is there anything else that specifically needs to be mentioned?
Other than dynamic import on worklets, above LGTM, I'll forward the ni? to jonco if he wants to add anything.
Comment 14•2 years ago
|
||
That is an excellent answer. I'll move it forward on Monday. Thank you.
Updated•2 years ago
|
Updated•1 years ago
|
Description
•