Closed Bug 1812591 Opened 1 year ago Closed 1 year ago

Ship module workers

Categories

(Core :: DOM: Workers, task)

task

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
relnote-firefox --- 114+
firefox114 --- fixed

People

(Reporter: yulia, Assigned: yulia)

References

(Blocks 3 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: nobody → ystartsev
Keywords: dev-doc-needed
Blocks: interop-2023
Blocks: interop-2023-modules
No longer blocks: interop-2023
Depends on: 1821066

Depends on D174235

Depends on: 1824498
Depends on: 1823281
Depends on: 1824803
Attachment #9326226 - Attachment description: Bug 1812591 - Ship Module Workers; r=allstarschh,jonco → Bug 1812591 - Ship Module Workers;
Attachment #9326227 - Attachment description: Bug 1812591 - update wpt test expectations for beta; r=allstarschh,jonco → Bug 1812591 - update wpt test expectations for beta;
Pushed by allstars.chh@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/8d375e536076
Ship Module Workers; r=allstarschh,jonco,webidl,smaug,saschanaz
https://hg.mozilla.org/integration/autoland/rev/b248fa33a294
update wpt test expectations for beta; r=allstarschh
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch

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

Flags: needinfo?(allstars.chh)

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/

relnote-firefox: --- → ?
Flags: needinfo?(allstars.chh)

(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?

Flags: needinfo?(allstars.chh)

(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.

Flags: needinfo?(allstars.chh)

Note added to beta notes with this wording:

DOM: Added support for ES Modules on DedicatedWorker and SharedWorker

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 via import() 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?
  1. Is the above correct?
  2. Is there anything else that specifically needs to be mentioned?
Flags: needinfo?(krosylight)

(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"

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.

Flags: needinfo?(krosylight) → needinfo?(jcoppeard)

No I think that covers it.

Flags: needinfo?(jcoppeard)

That is an excellent answer. I'll move it forward on Monday. Thank you.

Blocks: 1834360
No longer blocks: 1824591
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: