WICG / import-maps

How to control the behavior of JavaScript imports
https://html.spec.whatwg.org/multipage/webappapis.html#import-maps
Other
2.66k stars 69 forks source link

Document privacy expectations vs prefetching #219

Closed moztcampbell closed 4 years ago

moztcampbell commented 4 years ago

Related to #218..

With described use-case of CDN-remapping, I would expect some developers to use this to avoid their traffic going to specific CDNs. With the dynamic import-map tag insertion, it is very conceivable that a browser will be eagerly prefetching module graphs before the import-map is executed.

Can we clarify in https://github.com/WICG/import-maps#general-url-like-specifier-remapping if browser may still make fetches against the original URI before the import-map is loaded and the requests are re-issued?

domenic commented 4 years ago

it is very conceivable that a browser will be eagerly prefetching module graphs before the import-map is executed.

I'm really not sure where you're getting this from. Can you point me to what part of the spec leads you to believe this?

Can we clarify in https://github.com/WICG/import-maps#general-url-like-specifier-remapping if browser may still make fetches against the original URI before the import-map is loaded and the requests are re-issued?

This is not true in either the current HTML Standard nor after it is modified by import maps.

To cause prefetches, you need to use <link rel="preload" href="a URL">.

moztcampbell commented 4 years ago

I'm definitely misinterpreting things here. Closing issue.