Repository navigation
Description
Description
At this point, according to MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap, Chrome, Firefox, Opera & Safari have added support for importmaps ONLY for main threads.
Since March 2018 there is an open ticket to also enable their support for Worker, SharedWorker & ServiceWorker without any progress: WICG/import-maps#2
For me, being the author of a JavaScript (off the main thread) multithreading framework: https://github.com/neomjs/neo, not having the support for the worker scope is a showstopper / blocker.
This mostly affects the micro frontends topic. Use case: An application worker loads apps & components which are specified as JS modules, using import statements. Right now it is impossible to use importmaps here (unless hacking a compile step in there to manually replace relative paths).
Now devs could create additional npm packages to create components or child-apps, which would import framework base-classes from a different path / folder. This can easily result in getting multiple versions of the same file. Not only problematic for file size, but has a potential to break things (imagine importing 2 different IdGenerator classes).
In case the app worker had an import map, all framework related imports would point to the same source of truth.
It would make a big impact and make a lot of devs who would like to create JavaScript code which runs without a build step very happy, in case this feature was in place.
Thanks a lot!
Tobias
Specification
https://github.com/WICG/import-maps
Additional Signals
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
AshleyScirra commentedon Oct 7, 2024
We also need this for Construct so we support this.
rektide commentedon Nov 26, 2024
Getting to use modules in 2025 would be a nice present for their 10th anniversary. Please can we do this please please please.
nickchomey commentedon Feb 4, 2025
I was just blindsided by the lack of support for import maps in a worker. I'm hesitant to use the heavy convolutions of the (fantastic) es-module-shims library, so am now forced to figure out some weird hacks to make it all work.
I, and surely many others, would be very grateful for adding such support.
wpt-interop commentedon Feb 13, 2025
Thank you for proposing Import Maps for Workers (Dedicated, Shared, Service) for inclusion in Interop 2025.
We wanted to let you know that this proposal was not selected to be part of Interop this year.
On behalf of the entire Interop team, thank you for submitting this proposal for consideration. We got many more proposals than we could include in this year's project, necessitating some difficult choices. Please note this should not be taken as a comment on the technology as a whole, or our willingness to consider it for Interop in the future. We appreciate the work you put into your proposal, and would welcome your participation in future rounds of Interop.
For an overview of our process, see proposal selection. Thank you again for contributing to Interop 2025.
Posted on behalf of the Interop team.