-
Notifications
You must be signed in to change notification settings - Fork 72
Dynamic import-map tag insertion and prefetching #218
Comments
The answer is no. Once |
One would still need to fetch/parse/execute the top-level of I'm trying to consider the case of prefetching and parsing while the DOM is still being constructed. |
Sure, but you can't execute |
Got it. Thanks. |
The HTML Standard also does not define |
Will the ability to insert import-map tags dynamically from out-of-line scripts harm a browser's ability to prefetch and compile module graphs?
Example:
Without import-maps, a browser is able to look at this page and reasonably expect to begin to fetch the module-graph and things it imports transitively. With this proposal, that prefetching would either have to be avoided, or we would need to refetch and recompile the module graph. The proposal seems to blame the developer in this case which suggests the browser should reasonable pre-fetch and then re-fetch if maps are used.
Pages that do not use an import-map may be inclined to put an empty
<script type="importmap"></script>
tag to reassure the browser that URI rewriting will not happen.Only allowing re-writes for non-URL import identifiers would avoid this all, but that was ruled out elsewhere in the proposal.
The text was updated successfully, but these errors were encountered: