Skip to content
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

Add support for multiple import maps #25450

Open
yoavweiss opened this issue Sep 5, 2024 · 5 comments
Open

Add support for multiple import maps #25450

yoavweiss opened this issue Sep 5, 2024 · 5 comments
Labels
question a question about the use of Deno

Comments

@yoavweiss
Copy link

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 an HTML PR proposal to enable multiple import maps per document, by merging them in a consistent and deterministic way.

I'd appreciate y'all's opinions.

@marvinhagemeister
Copy link
Contributor

We're eagerly waiting for that proposal to be fleshed out. For now our solution to that problem is publishing on JSR. With JSR each library can have their own import map. Other than that there isn't another option at the moment. We're waiting for the proposal you linked to, to be finished to support nested import maps outside of JSR and npm packages.

@marvinhagemeister marvinhagemeister added the question a question about the use of Deno label Sep 5, 2024
@yoavweiss
Copy link
Author

That's great to hear!! FWIW, I feel the proposal has already gotten a lot of feedback and is in good shape. I also have a Chromium implementation going, but that is just starting its review process.

@yoavweiss yoavweiss changed the title Add support for dynamic import maps Add support for multiple import maps Oct 8, 2024
@oscarotero
Copy link
Contributor

Hi. The multiple import maps proposal has merged!
Now we have a standard way to import ES modules using other maps and merge them in the main import map. That's a huge leap forward for HTTP imports and dependencies dedupe.

@bartlomieju
Copy link
Member

@oscarotero could you please link to the relevant proposal change? I'm having trouble finding it.

@oscarotero
Copy link
Contributor

@bartlomieju This is the link to the new section https://html.spec.whatwg.org/multipage/webappapis.html#merge-existing-and-new-import-maps

And the pull request where you can see the changes and conversation: whatwg/html#10528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question a question about the use of Deno
Projects
None yet
Development

No branches or pull requests

4 participants