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

Deduping fetches #83

Closed
jakearchibald opened this issue Dec 5, 2018 · 2 comments
Closed

Deduping fetches #83

jakearchibald opened this issue Dec 5, 2018 · 2 comments

Comments

@jakearchibald
Copy link

jakearchibald commented Dec 5, 2018

If I fetch('import:whatever') twice, does it go to the network twice or dedupe in the way import('whatever') would?

Also:

const module1 = import('whatever');
const module2 = import('import:whatever');

Are the modules equal in the above example?

@matthewp
Copy link

matthewp commented Dec 5, 2018

Interesting question. I would expect import: to only affect resolution, and not have everything be stored in the module map. However, there are some scenarios where you might want the deduplication (inside a css @import is one I'm thinking of). So I could see import: being a nice way to opt different resources into the module fetching algorithm.

@domenic
Copy link
Collaborator

domenic commented Dec 11, 2018

If I fetch('import:whatever') twice, does it go to the network twice or dedupe in the way import('whatever') would?

The current intention is that it would go to the network (or memory cache, or wherever) twice. The import map only controls the specifier -> fetchable URL translation (including import:someSpecifier -> HTTPS URL). This is vaguely written down in https://github.com/domenic/import-maps/blob/master/spec.md#import-url-fetches; we could keep this open until it gets more concrete, though.

Also:

import('import:whatever') will not work, as import:whatever is not a fetch-schemed URL. See tests in the reference implementation.

@domenic domenic added this to the Full featured milestone Jul 3, 2019
@domenic domenic modified the milestones: Full featured, Fallback support Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants