-
Notifications
You must be signed in to change notification settings - Fork 22.7k
[Behind Pref] [Web API] Implement worker modules #24402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Status: This is behind pref and in nightly. Only supported for import (static import) not
The core work for release is done - that was just BCD and experimental features. Still doing some cleanup though for old info in the pages that should be in BCD. If any of this can't go through it wouldn't be tragic if it was dropped. |
Closing. Core work done. I'll keep an eye on the clean up item, but not hopeful I'll get a clear answer from anyone. |
Does Firefox support module workers now? I thought it would be announced in the Firefox 111 announcement but it wasn't |
Yes it does, but you have to enable it manually via https://caniuse.com/mdn-api_worker_worker_ecmascript_modules I wonder when it will be enabled by default. |
Thanks 👍🏽 |
Probably not long. Support for dynamic import of modules into workers was just added (behind pref - I htink in 113). I think the goal was to release this when support for both was available, so probably after a release (or two) of hardening. |
Awesome 👌 |
This only covers web workers, not service workers, right? WordPress Playground builds its service worker to an ES Module in local development mode, and that doesn't work on Firefox. The production build produces a regular JavaScript file and works without issues. |
@adamziel At the time I wrote this static/dynamic import was planned for shared/dedicated workers, along with static import of modules in service workers (and as I recall full support for the spec came in FF114). The spec authors weren't sure what to do with dynamic import into service workers, as per w3c/ServiceWorker#1585. This might have changed - I'm not tracking it. |
@hamishwillee oh, I meant service workers with await navigator.serviceWorker.register(scriptUrl, {
type: 'module',
}); |
You mean "does firefox support service workers of type "module"? Probably not. I base this on https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#module which says
If you look at browser compatibility data table for the ServiceWorker interface. it says FF service workers do not have "Support for ECMAScript modules" |
Uh oh!
There was an error while loading. Please reload this page.
Acceptance Criteria
For folks helping with Firefox related documentation
dev-doc-complete
Features to document
We have a few things dotted about about this, so not sure if there's much else to document. Rel note & bcd as per
Related Gecko bugs
https://bugzilla.mozilla.org/show_bug.cgi?id=1247687
https://bugzilla.mozilla.org/show_bug.cgi?id=1812628 - Behind pref
Other
The text was updated successfully, but these errors were encountered: