[WebAPI] Implement Import Maps
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 or
- [ ] Add entry to Firefox experimental features page if feature is not yet enabled in release
Features to document
This is an experimental feature, but will still need documenting, so best to get ahead.
Related Gecko bugs
https://bugzilla.mozilla.org/show_bug.cgi?id=1688879
- https://bugzilla.mozilla.org/show_bug.cgi?id=1795647 - shipping in 108!
@Rumyra Looking at the recent discussions on this and the code it looks like:
- Spec https://wicg.github.io/import-maps/ and here https://github.com/WICG/import-maps#readme
- This is behind a pref
dom.importMaps.enabledand disabled by default for FF102 - The spec is not really standardised. According to the thread there is a lot of churn.
- External import maps not yet supported: https://github.com/WICG/import-maps/issues/235
So this probably isn't something for 102. I'm also not certain I am sufficiently expert. Suggest we ask dev team when they think it might be stable enough to document, park this until then, and in the meantime see if we can seek help for documenting. Thoughts?
Yeh that sounds like a good plan @hamishwillee - I'll come back and revisit this issue when I check the release project next week 👍
https://bugzilla.mozilla.org/show_bug.cgi?id=1775424 related - still seems early days tho so I'm going to put this in the backlog for now (just as there are lots of issues for 103 which take higher priority)
Question: since this is a web feature instead of a JS feature (the ECMA spec does not specify how module specifiers should be resolved; it's entirely host-specific), should this be triaged as a web API documentation instead?
Label fixed: https://wicg.github.io/import-maps/ It is indeed not part of the language itself.
I'm not entirely sure how to structure this yet. The feature is implemented using an inline script element with type="importmap" so it is relatively easy to understand where compatibility information should go.
However there really isn't enough space under the script element under the type attribute to capture a faction of the nuances/use cases here. I think I'll probably need to have an "HTML script import map page" or "Script importing in HTML" page. That will be useful in any case for linking from docs like JavaScript modules to show the specific differences in browser environments.
Advice welcome.
Status:
- [x] BCD - https://github.com/mdn/browser-compat-data/pull/18214
- [x] Docs
- [x] #22300
- [x] Release note #22888
- [x] dev-doc-complete
So giving a brief overview - yes I think we should have something of a guide on import maps. The JS module guide does include stuff about <script> and as guides simply can not abide by one technology that might be a relevant place (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)
However this guide is very long 🤔 - I can catch up with you about this when you've also given it some thought @hamishwillee :)
All done bar the reviews - we've iterated once so I think fairly close now. I'll move to done but there might be some final tidy up.
Phew! All done.
Phew for you! Thanks @hamishwillee
Too right!