Intent to ship: Module Workers

129 views
Skip to first unread message

Yoshi Cheng-Hao Huang

unread,
May 2, 2023, 5:15:38 AM5/2/23
to dev-pl...@mozilla.org

[I am sending this on behalf of Yulia Startsev, who is taking parental leave now]


Summary:


Module workers enables you to use ECMAScript modules on workers rather than just classic scripts. This enables the `import` `export` style syntax to be run in a worker. It also enables dynamic import to run in workers, for both shared and dedicated workers. You instantiate it like so:


```

const worker = new Worker(“<url>”, {type: “module”});

```


I intend to ship this feature in Firefox 114

Bugs: 

Specification: https://html.spec.whatwg.org/multipage/workers.html#worker-processing-model

Platform Coverage: All

Preference: enabled by default under `dom.workers.modules.enabled` when Bug 1812591 lands.

Documentation: https://developer.mozilla.org/en-US/docs/Web/API/Worker 


Other Browsers: Safari and Chrome have shipped.

Testing: Tested through our tests as well as web platform tests.



Reply all
Reply to author
Forward
0 new messages