Skip to content

[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

Closed
9 of 10 tasks
Rumyra opened this issue Feb 13, 2023 · 11 comments
Closed
9 of 10 tasks

[Behind Pref] [Web API] Implement worker modules #24402

Rumyra opened this issue Feb 13, 2023 · 11 comments
Assignees
Labels
Content:WebAPI Web API docs fx release archive A closed issue relating to firefox release notes for developers.

Comments

@Rumyra
Copy link
Collaborator

Rumyra commented Feb 13, 2023

Acceptance Criteria

  • The listed features are documented sufficiently on MDN
  • BCD is updated
  • Interactive example and data repos are updated if appropriate
  • The content has been reviewed as needed

For folks helping with Firefox related documentation

  • Set bugs to dev-doc-complete
  • Add entry to Firefox release notes if feature is enabled in release
  • Add entry to Firefox experimental features page if feature is not yet enabled in release

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

  • Check content open issues to see if any pertain to the subject matter. If there are any that can be closed because of the work, do so. If there are any that can be fixed relatively quickly because of the knowledge from completing this issue and you have time, feel free to go ahead and fix them.
  • Check if glossary updates are required for the feature you're documenting - whether an existing term needs to be updated or a new term should be added.
  • Check if BCD update means that content pages need to have experimental markup removed or deprecated markup added (front matter tags and macros).
@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Feb 13, 2023
@Rumyra Rumyra added Content:WebAPI Web API docs Firefox 111 and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Feb 13, 2023
@Rumyra Rumyra moved this from Backlog to Todo in MDN Web Docs Content Team Feb 13, 2023
@hamishwillee
Copy link
Collaborator

hamishwillee commented Mar 3, 2023

Status:

This is behind pref and in nightly. Only supported for import (static import) not import() (dynamic import).

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.

@hamishwillee hamishwillee moved this from Todo to In Progress in MDN Web Docs Content Team Mar 3, 2023
@hamishwillee hamishwillee changed the title [Web API] Implement worker modules [Behind Pref] [Web API] Implement worker modules Mar 6, 2023
@hamishwillee hamishwillee self-assigned this Mar 6, 2023
@hamishwillee hamishwillee moved this from In Progress to Done in MDN Web Docs Content Team Mar 17, 2023
@hamishwillee
Copy link
Collaborator

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.

@okikio
Copy link

okikio commented Apr 22, 2023

Does Firefox support module workers now? I thought it would be announced in the Firefox 111 announcement but it wasn't

@WolfgangDrescher
Copy link

Yes it does, but you have to enable it manually via about:config and set dom.workers.modules.enabled to true.

https://caniuse.com/mdn-api_worker_worker_ecmascript_modules

I wonder when it will be enabled by default.

@okikio
Copy link

okikio commented Apr 22, 2023

Thanks 👍🏽

@hamishwillee
Copy link
Collaborator

I wonder when it will be enabled by default.

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.

@okikio
Copy link

okikio commented Apr 24, 2023

Awesome 👌

@Josh-Cena Josh-Cena added the fx release archive A closed issue relating to firefox release notes for developers. label Jun 22, 2023
@adamziel
Copy link

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.

@hamishwillee
Copy link
Collaborator

hamishwillee commented Apr 26, 2024

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

@adamziel
Copy link

@hamishwillee oh, I meant service workers with type: 'module', not dynamic imports specifically:

	await navigator.serviceWorker.register(scriptUrl, {
		type: 'module',
	});

@hamishwillee
Copy link
Collaborator

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

'module'
The loaded service worker is in an ES module and the import statement is available on worker contexts. For ES module compatibility info, see the browser compatibility data table for the ServiceWorker interface.

If you look at browser compatibility data table for the ServiceWorker interface. it says FF service workers do not have "Support for ECMAScript modules"

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:WebAPI Web API docs fx release archive A closed issue relating to firefox release notes for developers.
Projects
Archived in project
Development

No branches or pull requests

6 participants