Closed Bug 1916277 Opened 1 year ago Closed 1 month ago

Support multiple import maps

Categories

(Core :: JavaScript Engine, enhancement, P3)

Firefox 128
enhancement

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
relnote-firefox --- nightly+
firefox150 --- fixed

People

(Reporter: yoav, Assigned: allstars.chh)

References

(Blocks 3 open bugs)

Details

(Keywords: dev-doc-complete, parity-chrome, parity-safari)

User Story

platform-scheduled:2026-06-30

Attachments

(20 files, 1 obsolete file)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Steps to reproduce:

Import maps currently have to load before any ES module and there can only be a single import map per document. That makes them fragile and potentially slow to use in real-life scenarios: Any module that loads before them breaks the entire app, and in apps with many modules the become a large blocking resource, as the entire map for all possible modules needs to load first.

There's a proposal [1] to enable multiple import maps per document, by merging them in a consistent and deterministic way.

Mozilla standard position - https://github.com/mozilla/standards-positions/issues/1058

[1] https://github.com/whatwg/html/pull/10528

Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Severity: -- → N/A
Priority: -- → P3

Needinfo'ing Yoshi, as he's our expert for Import Maps

Yoshi: Not sure about your GitHub handle but you probably want to take a look at the proposal and give it some thought about implementation challenge.

Blocks: js-lang
Flags: needinfo?(allstars.chh)
Summary: Support dynamic import maps → Support multiple import maps
Assignee: nobody → allstars.chh
Flags: needinfo?(allstars.chh)

The related MDN page already mentions multiple import maps, so there's probably no updated needed for that. Though this should be reflected in the related browser compat data.

Sebastian

Keywords: dev-doc-needed
No longer depends on: 1892199
Depends on: 1945540

Is 'Multiple import maps' supported by Firefox or not? If it is, then it is should updated in browser compat data.

Checking the code, Firefox is still sending an error message when we try to use multiple importmaps:

https://searchfox.org/mozilla-central/rev/a589ce1e3ff122d53690f101780a3b4747946d71/dom/script/ScriptLoader.cpp#1550
https://searchfox.org/mozilla-central/rev/a589ce1e3ff122d53690f101780a3b4747946d71/dom/locales/en-US/chrome/dom/dom.properties#371

Note that the code above also prevents to process import maps after a previous module import, which Yoav's PR changed too

A Document can have multiple import maps processed, which can happen either before or after any modules have been imported,

(note: I found this while writing tests for Trusted Types at https://phabricator.services.mozilla.com/D251456)

(In reply to [:anutrix] from comment #3)
Multiple import maps are not supported yet.

(In reply to Jon Coppeard (:jonco) (PTO until Friday 13th June) from comment #5)

(In reply to [:anutrix] from comment #3)
Multiple import maps are not supported yet.

Is there a PR out for multiple import maps on Firefox? Or otherwise any details on release date?

The compatibility gap with Firefox on this one is starting to grow - https://caniuse.com/mdn-html_elements_script_type_importmap_multiple_import_maps.

While we do have ES Module Shims polyfill to fill the gap, it would be a huge benefit to have these modern import maps workflows working natively.

(In reply to guybedford from comment #7)

The compatibility gap with Firefox on this one is starting to grow - https://caniuse.com/mdn-html_elements_script_type_importmap_multiple_import_maps.

While we do have ES Module Shims polyfill to fill the gap, it would be a huge benefit to have these modern import maps workflows working natively.

Can you elaborate on the huge benefit? It can help in getting the work prioritized.

Here's the article on the feature here being used by Shopify - https://shopify.engineering/resilient-import-maps.

Currently they use the polyfill to support older browsers - https://github.com/guybedford/es-module-shims, which is slower and less efficient than native.

Are there more details on the performance costs of the polyfill? (I've only skimmed the article so may have missed it)

Flags: needinfo?(guybedford)

The polyfill re-executes all modules using source text rewriting and blog URLs, effectively re-handling the entire module system. It's typically 1.5-2x slower than native modules to execute a module graph.

Flags: needinfo?(guybedford)

(In reply to Jeff Muizelaar [:jrmuizel] from comment #8)

(In reply to guybedford from comment #7)

The compatibility gap with Firefox on this one is starting to grow - https://caniuse.com/mdn-html_elements_script_type_importmap_multiple_import_maps.

While we do have ES Module Shims polyfill to fill the gap, it would be a huge benefit to have these modern import maps workflows working natively.

Can you elaborate on the huge benefit? It can help in getting the work prioritized.

I have a site that relies on import maps and won't work without them. The problem is that if users have extensions that inject import maps or modules before the site's, it'll break the page for some fraction of users and there's nothing we can do about it. Supporting multiple import maps is necessary for robustness vs. misbehaving extensions. Currently the site is working fine in browsers that support that, but Firefox is left behind.

User Story: (updated)
See Also: → 1990764
Duplicate of this bug: 1997781

This is to simplify ImportMap::ResolveModuleSpecifier, so we just need
to pass baseURL to it.

This is just a minor update to the latest spec, the logic remains the same.

Before:
If found a match in scopesImportMatch, return result.

After:
If found a match in scopesImportMatch, break from the for-loop.
if result is not null, return result

Add a request parameter to construct the ReportWarningHelper.

During preload, module resolution may be incomplete because import map
information is not yet available. To handle this, store the resolved
module set within the module script itself.

Later, when the preloaded request is reused during parsing, merge the
preloaded resolved module set into the global resolved module set to
ensure consistency.

When registering an import map, we must remove any preloaded scripts
because their resolved URLs may no longer be valid under the new import
map.

If top-level module scripts have already been preloaded, we also clear
the [[LoadedModules]] slot in the ModuleObject, as well as the
[ParseError] and [ErrorToRethrow] fields in the module scripts. This
ensures that when these modules are fetched again, the entries in
mFetchedModules do not reuse stale preload data.

For entries in mFetchingModules, we verify whether each module’s
resolution remains consistent after merging the import map. If a
resolution no longer matches, the ongoing (preload) fetch request is
canceled.

We take no action on mFetchedModules entries because we cannot determine
whether their associated scripts were fetched before or after the import
map registration.

Updating the tests with multiple import maps.

Even with a 0.5-second delay, preloading causes the module script to
arrive before the import map. Increase the delay to guarantee the import
map is available before module execution.

FYI, there are a couple of trusted type tests that had to place import map before a module load: https://searchfox.org/firefox-main/search?q=1916277&path=testing%2Fweb-platform%2Ftests&case=false&regexp=false ; I don't know if that improved with your patches, but it would be nice to check if putting import map load after module load works and remove these comments from WPT.

Do we have a WPT test that actually checks whether import map load is possible after a module load? Probably we should add one in /import-maps

Flags: needinfo?(allstars.chh)

Add multiple import maps into /trusted-types

(In reply to Frédéric Wang (:fredw) from comment #28)

FYI, there are a couple of trusted type tests that had to place import map before a module load: https://searchfox.org/firefox-main/search?q=1916277&path=testing%2Fweb-platform%2Ftests&case=false&regexp=false ; I don't know if that improved with your patches, but it would be nice to check if putting import map load after module load works and remove these comments from WPT.

Do we have a WPT test that actually checks whether import map load is possible after a module load? Probably we should add one in /import-maps

Thanks for the info.
Added/Updated WPT for /trusted-types.
Where there's a will, there's a way.

Flags: needinfo?(allstars.chh)
Attachment #9526974 - Attachment description: Bug 1916277 - Part 5: Update ImportMap::ResolveModuleSpecifier. → Bug 1916277 - Part 4: Update ImportMap::ResolveModuleSpecifier.
Attachment #9526975 - Attachment description: Bug 1916277 - Part 6: AddToResolvedModuleSet in ResolveModuleSpecifier. → Bug 1916277 - Part 5: AddToResolvedModuleSet in ResolveModuleSpecifier.
Attachment #9526976 - Attachment description: Bug 1916277 - Part 7: Update RegisterImportMap. → Bug 1916277 - Part 6: Update RegisterImportMap.
Attachment #9526977 - Attachment description: Bug 1916277 - Part 8: Implement ImportMap::Merge. → Bug 1916277 - Part 7: Implement ImportMap::Merge.
Attachment #9526978 - Attachment description: Bug 1916277 - Part 9: Store Preloaded Resolved Module Set in LoadedScript. → Bug 1916277 - Part 8: Store Preloaded Resolved Module Set in LoadedScript.

When the preloaded request is reused during parsing, merge the preloaded
resolved module set into the global resolved module set to ensure consistency.

Attachment #9526979 - Attachment description: Bug 1916277 - Part 10: Reset top-level preloads and fetching modules. → Bug 1916277 - Part 10: Reset preloaded module graphs.

Originally, RegisterImportMap was not invoked if any module requests
were in the fetching or fetched state. With this limitation removed,
the behavior is updated so that only the preloading requests are canceled.

Attachment #9526980 - Attachment description: Bug 1916277 - Part 11: Add/Update Mochitest tests. → Bug 1916277 - Part 12: Add/Update Mochitest tests.
Attachment #9526981 - Attachment description: Bug 1916277 - Part 12: Update WPT ini for /import-maps. → Bug 1916277 - Part 13: Update WPT ini for /import-maps.
Attachment #9526982 - Attachment description: Bug 1916277 - Part 13: Increase module fetching delay. → Bug 1916277 - Part 14: Increase module fetching delay.
Attachment #9527135 - Attachment description: Bug 1916277 - Part 14: Update trusted-types WPT. → Bug 1916277 - Part 15: Update trusted-types WPT.
Attachment #9526973 - Attachment is obsolete: true

Add a pref to enable support for multiple import maps.

Calling DisallowImportMaps() conditionally if the pref is off.

Attachment #9526976 - Attachment description: Bug 1916277 - Part 6: Update RegisterImportMap. → Bug 1916277 - Part 5: Update RegisterImportMap.
Attachment #9526975 - Attachment description: Bug 1916277 - Part 5: AddToResolvedModuleSet in ResolveModuleSpecifier. → Bug 1916277 - Part 6: AddToResolvedModuleSet in ResolveModuleSpecifier.
Attachment #9526978 - Attachment description: Bug 1916277 - Part 8: Store Preloaded Resolved Module Set in LoadedScript. → Bug 1916277 - Part 8: Store Preloaded resolved set in the root module's ResolvedModuleSet

Reset modules information happened during preload.

Attachment #9526979 - Attachment description: Bug 1916277 - Part 10: Reset preloaded module graphs. → Bug 1916277 - Part 11: Reset preloaded module graphs before registering an import map.
Attachment #9531043 - Attachment description: Bug 1916277 - Part 11: Fetching/Fetched module maps update. → Bug 1916277 - Part 12: Fetching/Fetched module maps update.
Attachment #9526980 - Attachment description: Bug 1916277 - Part 12: Add/Update Mochitest tests. → Bug 1916277 - Part 13: Add/Update Mochitest tests.
Attachment #9526981 - Attachment description: Bug 1916277 - Part 13: Update WPT ini for /import-maps. → Bug 1916277 - Part 14: Update WPT ini for /import-maps.
Attachment #9526982 - Attachment description: Bug 1916277 - Part 14: Increase module fetching delay. → Bug 1916277 - Part 15: Increase module fetching delay.
Attachment #9527135 - Attachment description: Bug 1916277 - Part 15: Update trusted-types WPT. → Bug 1916277 - Part 16: Update trusted-types WPT.
Attachment #9536950 - Attachment description: Bug 1916277 - Check the pref before DisallowImportMaps. → Bug 1916277 - Part 2: Check the pref before DisallowImportMaps.

Currently Gecko only set mIsPreload to true for the top-level preloading
load. To identify a non-top-level preload, update mIsPreload accordingly
to match the mIsPreload flag from the root module.

Attachment #9526978 - Attachment description: Bug 1916277 - Part 8: Store Preloaded resolved set in the root module's ResolvedModuleSet → Bug 1916277 - Part 9: Store Preloaded resolved set in the root moduleScript.
Attachment #9531042 - Attachment description: Bug 1916277 - Part 9: Add preloaded specifiers into global's resolved set. → Bug 1916277 - Part 10: Add preloaded specifiers into global's resolved set.

This will allow us to identify the module is loaded during preloading
phase.

Attachment #9536951 - Attachment description: Bug 1916277 - Part 10: Add ModuleScript::Reset. → Bug 1916277 - Part 12: Add ModuleScript::ResetPreload.
Attachment #9526979 - Attachment description: Bug 1916277 - Part 11: Reset preloaded module graphs before registering an import map. → Bug 1916277 - Part 13: Reset preloaded module graphs before registering an import map.
Attachment #9531043 - Attachment description: Bug 1916277 - Part 12: Fetching/Fetched module maps update. → Bug 1916277 - Part 14: Fetching/Fetched module maps update.
Attachment #9526980 - Attachment description: Bug 1916277 - Part 13: Add/Update Mochitest tests. → Bug 1916277 - Part 15: Add/Update Mochitest tests.
Attachment #9526981 - Attachment description: Bug 1916277 - Part 14: Update WPT ini for /import-maps. → Bug 1916277 - Part 16: Update WPT ini for /import-maps.
Attachment #9526982 - Attachment description: Bug 1916277 - Part 15: Increase module fetching delay. → Bug 1916277 - Part 17: Increase module fetching delay.
Attachment #9527135 - Attachment description: Bug 1916277 - Part 16: Update trusted-types WPT. → Bug 1916277 - Part 18: Update trusted-types WPT.
Attachment #9526975 - Attachment description: Bug 1916277 - Part 6: AddToResolvedModuleSet in ResolveModuleSpecifier. → Bug 1916277 - Part 6: AddToResolvedModuleSet in ResolveModuleSpecifier. r?jonco
Attachment #9536949 - Attachment description: Bug 1916277 - Part 1: Add pref dom.multiple_import_maps.enabled. → Bug 1916277 - Part 1: Add pref dom.multiple_import_maps.enabled. r?jonco
Attachment #9536950 - Attachment description: Bug 1916277 - Part 2: Check the pref before DisallowImportMaps. → Bug 1916277 - Part 2: Check the pref before DisallowImportMaps. r?jonco
Attachment #9526972 - Attachment description: Bug 1916277 - Part 3: Add ResolvedModuleSet.h. → Bug 1916277 - Part 3: Add ResolvedModuleSet.h. r?jonco
Attachment #9526974 - Attachment description: Bug 1916277 - Part 4: Update ImportMap::ResolveModuleSpecifier. → Bug 1916277 - Part 4: Update ImportMap::ResolveModuleSpecifier. r?jonco
Attachment #9526976 - Attachment description: Bug 1916277 - Part 5: Update RegisterImportMap. → Bug 1916277 - Part 5: Update RegisterImportMap. r?jonco
Attachment #9526977 - Attachment description: Bug 1916277 - Part 7: Implement ImportMap::Merge. → Bug 1916277 - Part 7: Implement ImportMap::Merge. r?jonco
Attachment #9541203 - Attachment description: Bug 1916277 - Part 8: Set mIsPreload to true for non-top-level modules. → Bug 1916277 - Part 8: Set mIsPreload to true for non-top-level modules. r?jonco
Attachment #9526978 - Attachment description: Bug 1916277 - Part 9: Store Preloaded resolved set in the root moduleScript. → Bug 1916277 - Part 9: Store Preloaded resolved set in the root moduleScript. r?jonco
Attachment #9531042 - Attachment description: Bug 1916277 - Part 10: Add preloaded specifiers into global's resolved set. → Bug 1916277 - Part 10: Add preloaded specifiers into global's resolved set. r?jonco
Attachment #9541204 - Attachment description: Bug 1916277 - Part 11: Add a debug slot [[IsPreload]] in ModuleObject. → Bug 1916277 - Part 11: Add a debug slot [[IsPreload]] in ModuleObject. r?jonco
Attachment #9536951 - Attachment description: Bug 1916277 - Part 12: Add ModuleScript::ResetPreload. → Bug 1916277 - Part 12: Add ModuleScript::ResetPreload. r?jonco
Attachment #9531043 - Attachment description: Bug 1916277 - Part 14: Fetching/Fetched module maps update. → Bug 1916277 - Part 14: Fetching/Fetched module maps update. r?jonco
Attachment #9526979 - Attachment description: Bug 1916277 - Part 13: Reset preloaded module graphs before registering an import map. → Bug 1916277 - Part 13: Reset preloaded module graphs before registering an import map. r?jonco
Attachment #9526980 - Attachment description: Bug 1916277 - Part 15: Add/Update Mochitest tests. → Bug 1916277 - Part 15: Add/Update Mochitest tests. r?jonco
Attachment #9526981 - Attachment description: Bug 1916277 - Part 16: Update WPT ini for /import-maps. → Bug 1916277 - Part 16: Update WPT ini for /import-maps. r?jonco
Attachment #9526982 - Attachment description: Bug 1916277 - Part 17: Increase module fetching delay. → Bug 1916277 - Part 17: Increase module fetching delay. r?jonco
Attachment #9527135 - Attachment description: Bug 1916277 - Part 18: Update trusted-types WPT. → Bug 1916277 - Part 18: Update trusted-types WPT. r?fredw
Attachment #9536950 - Attachment description: Bug 1916277 - Part 2: Check the pref before DisallowImportMaps. r?jonco → Bug 1916277 - Part 2: Check the pref before DisallowImportMaps.
Attachment #9526972 - Attachment description: Bug 1916277 - Part 3: Add ResolvedModuleSet.h. r?jonco → Bug 1916277 - Part 3: Add ResolvedModuleSet.h.
Attachment #9526974 - Attachment description: Bug 1916277 - Part 4: Update ImportMap::ResolveModuleSpecifier. r?jonco → Bug 1916277 - Part 4: Update ImportMap::ResolveModuleSpecifier.
Attachment #9526976 - Attachment description: Bug 1916277 - Part 5: Update RegisterImportMap. r?jonco → Bug 1916277 - Part 5: Update RegisterImportMap.
Attachment #9526975 - Attachment description: Bug 1916277 - Part 6: AddToResolvedModuleSet in ResolveModuleSpecifier. r?jonco → Bug 1916277 - Part 6: AddToResolvedModuleSet in ResolveModuleSpecifier.
User Story: (updated)
Attachment #9536949 - Attachment description: Bug 1916277 - Part 1: Add pref dom.multiple_import_maps.enabled. r?jonco → Bug 1916277 - Part 1: Add pref dom.multiple_import_maps.enabled.
Attachment #9526975 - Attachment description: Bug 1916277 - Part 6: AddToResolvedModuleSet in ResolveModuleSpecifier. → Bug 1916277 - Part 6: Implement AddToResolvedModuleSet to complete the 'resolve a module specifier' per spec.
Attachment #9526977 - Attachment description: Bug 1916277 - Part 7: Implement ImportMap::Merge. r?jonco → Bug 1916277 - Part 7: Implement ImportMap::Merge.
Attachment #9541203 - Attachment description: Bug 1916277 - Part 8: Set mIsPreload to true for non-top-level modules. r?jonco → Bug 1916277 - Part 8: Set mIsPreload to true for non-top-level modules.
Attachment #9526978 - Attachment description: Bug 1916277 - Part 9: Store Preloaded resolved set in the root moduleScript. r?jonco → Bug 1916277 - Part 9: Store Preloaded resolved set in the root moduleScript.
Attachment #9531042 - Attachment description: Bug 1916277 - Part 10: Add preloaded specifiers into global's resolved set. r?jonco → Bug 1916277 - Part 10: Add preloaded specifiers into global's resolved set.
Attachment #9541204 - Attachment description: Bug 1916277 - Part 11: Add a debug slot [[IsPreload]] in ModuleObject. r?jonco → Bug 1916277 - Part 11: Add a debug slot [[IsPreload]] in ModuleObject.
Attachment #9536951 - Attachment description: Bug 1916277 - Part 12: Add ModuleScript::ResetPreload. r?jonco → Bug 1916277 - Part 12: Add ModuleScript::ResetPreload.
Attachment #9526979 - Attachment description: Bug 1916277 - Part 13: Reset preloaded module graphs before registering an import map. r?jonco → Bug 1916277 - Part 13: Reset preloaded module graphs before registering an import map.
Attachment #9531043 - Attachment description: Bug 1916277 - Part 14: Fetching/Fetched module maps update. r?jonco → Bug 1916277 - Part 14: Fetching/Fetched module maps update.
Attachment #9526980 - Attachment description: Bug 1916277 - Part 15: Add/Update Mochitest tests. r?jonco → Bug 1916277 - Part 15: Add/Update Mochitest tests.
Attachment #9526981 - Attachment description: Bug 1916277 - Part 16: Update WPT ini for /import-maps. r?jonco → Bug 1916277 - Part 16: Update WPT ini for /import-maps.
Attachment #9526982 - Attachment description: Bug 1916277 - Part 17: Increase module fetching delay. r?jonco → Bug 1916277 - Part 17: Increase module fetching delay.
Attachment #9527135 - Attachment description: Bug 1916277 - Part 18: Update trusted-types WPT. r?fredw → Bug 1916277 - Part 18: Update trusted-types WPT.
Attachment #9541204 - Attachment description: Bug 1916277 - Part 11: Add a debug slot [[IsPreload]] in ModuleObject. → Bug 1916277 - Part 10: Add a debug slot [[IsPreload]] in ModuleObject.
Attachment #9531042 - Attachment description: Bug 1916277 - Part 10: Add preloaded specifiers into global's resolved set. → Bug 1916277 - Part 11: Add preloaded specifiers into global's resolved set.
Pushed by allstars.chh@gmail.com: https://github.com/mozilla-firefox/firefox/commit/19b9ec22f6f2 https://hg.mozilla.org/integration/autoland/rev/3a76af935b1d Part 1: Add pref dom.multiple_import_maps.enabled. r=jonco https://github.com/mozilla-firefox/firefox/commit/27a8d5f10022 https://hg.mozilla.org/integration/autoland/rev/56b312c1f37d Part 2: Check the pref before DisallowImportMaps. r=jonco https://github.com/mozilla-firefox/firefox/commit/d5d5dfa6c87f https://hg.mozilla.org/integration/autoland/rev/f9d983d1e3e2 Part 3: Add ResolvedModuleSet.h. r=jonco https://github.com/mozilla-firefox/firefox/commit/dacb61844a40 https://hg.mozilla.org/integration/autoland/rev/fa2331e74853 Part 4: Update ImportMap::ResolveModuleSpecifier. r=jonco https://github.com/mozilla-firefox/firefox/commit/ada725c0a3ed https://hg.mozilla.org/integration/autoland/rev/15eeb297ee62 Part 5: Update RegisterImportMap. r=jonco https://github.com/mozilla-firefox/firefox/commit/b267594cfd43 https://hg.mozilla.org/integration/autoland/rev/2c99c4ed2495 Part 6: Implement AddToResolvedModuleSet to complete the 'resolve a module specifier' per spec. r=jonco https://github.com/mozilla-firefox/firefox/commit/2e020fb8419f https://hg.mozilla.org/integration/autoland/rev/bc51a6464df2 Part 7: Implement ImportMap::Merge. r=jonco,flod https://github.com/mozilla-firefox/firefox/commit/ac6a7c224d29 https://hg.mozilla.org/integration/autoland/rev/bb6a7df845a8 Part 8: Set mIsPreload to true for non-top-level modules. r=jonco https://github.com/mozilla-firefox/firefox/commit/14a186766a10 https://hg.mozilla.org/integration/autoland/rev/0c2d420621fb Part 9: Store Preloaded resolved set in the root moduleScript. r=jonco https://github.com/mozilla-firefox/firefox/commit/8377cfe15c30 https://hg.mozilla.org/integration/autoland/rev/61bba4bc022d Part 10: Add a debug slot [[IsPreload]] in ModuleObject. r=jonco https://github.com/mozilla-firefox/firefox/commit/f10f564f7b76 https://hg.mozilla.org/integration/autoland/rev/89c6089e6a89 Part 11: Add preloaded specifiers into global's resolved set. r=jonco https://github.com/mozilla-firefox/firefox/commit/cb89c5ad775b https://hg.mozilla.org/integration/autoland/rev/cb9f3ad567ab Part 12: Add ModuleScript::ResetPreload. r=jonco https://github.com/mozilla-firefox/firefox/commit/2ed834694eef https://hg.mozilla.org/integration/autoland/rev/a5d469a28b3a Part 13: Reset preloaded module graphs before registering an import map. r=jonco https://github.com/mozilla-firefox/firefox/commit/45458027144e https://hg.mozilla.org/integration/autoland/rev/3962bb975cde Part 14: Fetching/Fetched module maps update. r=jonco https://github.com/mozilla-firefox/firefox/commit/62eb44522bda https://hg.mozilla.org/integration/autoland/rev/f0f9edc6c0c2 Part 15: Add/Update Mochitest tests. r=jonco,frontend-codestyle-reviewers https://github.com/mozilla-firefox/firefox/commit/5fe845ced5e7 https://hg.mozilla.org/integration/autoland/rev/c497a8561d89 Part 16: Update WPT ini for /import-maps. r=jonco https://github.com/mozilla-firefox/firefox/commit/280c56397abe https://hg.mozilla.org/integration/autoland/rev/38d64e1c3b2c Part 17: Increase module fetching delay. r=jonco https://github.com/mozilla-firefox/firefox/commit/0565840cd164 https://hg.mozilla.org/integration/autoland/rev/40e922e2c3b7 Part 18: Update trusted-types WPT. r=fredw

https://hg.mozilla.org/mozilla-central/rev/3a76af935b1d
https://hg.mozilla.org/mozilla-central/rev/56b312c1f37d
https://hg.mozilla.org/mozilla-central/rev/f9d983d1e3e2
https://hg.mozilla.org/mozilla-central/rev/fa2331e74853
https://hg.mozilla.org/mozilla-central/rev/15eeb297ee62
https://hg.mozilla.org/mozilla-central/rev/2c99c4ed2495
https://hg.mozilla.org/mozilla-central/rev/bc51a6464df2
https://hg.mozilla.org/mozilla-central/rev/bb6a7df845a8
https://hg.mozilla.org/mozilla-central/rev/0c2d420621fb
https://hg.mozilla.org/mozilla-central/rev/61bba4bc022d
https://hg.mozilla.org/mozilla-central/rev/89c6089e6a89
https://hg.mozilla.org/mozilla-central/rev/cb9f3ad567ab
https://hg.mozilla.org/mozilla-central/rev/a5d469a28b3a
https://hg.mozilla.org/mozilla-central/rev/3962bb975cde
https://hg.mozilla.org/mozilla-central/rev/f0f9edc6c0c2
https://hg.mozilla.org/mozilla-central/rev/c497a8561d89
https://hg.mozilla.org/mozilla-central/rev/38d64e1c3b2c
https://hg.mozilla.org/mozilla-central/rev/40e922e2c3b7

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
Upstream PR was closed without merging

:allstars.chh is this something you want to mention in the Fx150 release notes? Feel free to nominate if so.

Flags: needinfo?(allstars.chh)
Upstream PR was closed without merging

Release Note Request (optional, but appreciated)

[Why is this notable]:
The current restriction to a single import map imposes several limitations. Enabling support for multiple import maps would lift these constraints and provide increased flexibility for web developers.

[Suggested wording]:
Multiple Import Maps

relnote-firefox: --- → ?
Flags: needinfo?(allstars.chh)
Upstream PR merged by moz-wptsync-bot

(In reply to Dianna Smith [:diannaS] from comment #48)

Added to Fx150 release notes https://www.firefox.com/en-US/firefox/150.0a1/releasenotes/

Hi, Dianna,
I'd like to remind you that the feature is behind the pref "dom.multiple_import_maps.enabled", which is still off by default.

The note doesn't mention that and I think it will cause some confusion.

Firefox now supports multiple import maps per document ...

See the pref in
https://searchfox.org/firefox-main/rev/83d1a08db47b91a4d53341a799745caac9c38bde/modules/libpref/init/StaticPrefList.yaml#3769-3773

User Story: (updated)
Flags: needinfo?(dsmith)
User Story: (updated)

my apologies I didnt realize it was off by default. Is there a ticket tracking it being enabled? I can remove the relnote until that happens.

Flags: needinfo?(dsmith) → needinfo?(allstars.chh)

(In reply to Dianna Smith [:diannaS] from comment #50)

my apologies I didnt realize it was off by default. Is there a ticket tracking it being enabled? I can remove the relnote until that happens.

bug 2021012, although I don't know if we should put some experienment feature (off by default) in relnote.

Flags: needinfo?(allstars.chh)

I can add something like "Starting with Firefox 150, multiple import maps per document is now supported, giving web developers more flexibility when structuring and loading modern JavaScript modules. This is considered experimental as we gather feedback before enabling it in regular releases." Please let me know how that sounds.

Flags: needinfo?(allstars.chh)

(In reply to Dianna Smith [:diannaS] from comment #52)

I can add something like "Starting with Firefox 150, multiple import maps per document is now supported, giving web developers more flexibility when structuring and loading modern JavaScript modules. This is considered experimental as we gather feedback before enabling it in regular releases." Please let me know how that sounds.

That looks perfect, thanks.
(And I assume you will add it in https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/150#experimental_web_features, with mentioning the pref "dom.multiple_import_maps.enabled")

Flags: needinfo?(allstars.chh)

For the mdn changes, the dev-doc-needed keyword would move to
dev-doc-complete when someone from the mdn makes the change

QA Whiteboard: [qa-triage-done-c151/b150]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: