Add <link> rel="modulepreload" #2383
|
If I have a document A with a same-origin |
| @@ -12307,6 +12329,7 @@ interface <dfn>HTMLLinkElement</dfn> : <span>HTMLElement</span> { | ||
| <code data-x="rel-alternate">alternate</code>, | ||
| <code data-x="rel-dns-prefetch">dns-prefetch</code>, | ||
| <code data-x="rel-icon">icon</code>, | ||
| + <code data-x="rel-modulepreload">modulepreload</code>, |
Can we call it preloadmodule instead, so it's listed next to preload and autocomplete works better?
On second thought... "preloadmodule" sounds like "preload a module" ("why not just use preload??"), or maybe "a module specifying a bunch of preload stuff".
Whereas "modulepreload" sounds like "a module-specific variant of preload".
Seems better as-is to me now...
| + | ||
| + <li><p><span data-x="parse a url">Parse</span> the <span>URL</span> given by the <code | ||
| + data-x="attr-link-href">href</code> attribute, relative to the element's <span>node | ||
| + document</span>. If that fails, then abort these steps. Otherwise, let <var>url</var> be the |
I didn't know that was true; I guess that falls into the same "preload cache is unspecified" bucket. But yes, this is definitely what we want; this is a great point as to why it has to be separate. Each document has a separate module map, and we don't want to introduce ways for one document to accidentally start overwriting the other document's module map. |
| + | ||
| + <div w-nodev> | ||
| + | ||
| + <p>The following contains are the appropriate times to fetch the resource for such a link:</p> |
<p>The following contains are the appropriate times to fetch the resource for such a link:</p>
Drop the word contains here?
| + <!-- integrity?? https://github.com/whatwg/html/issues/2382 --> | ||
| + | ||
| + <li><p><span data-x="concept-fetch">Fetch</span> <var>request</var>, and asynchronously wait | ||
| + to run the remaining steps as part of fetch's <span>process response</span> for the <span |
to run the remaining steps as part of fetch's <span>process response</span> for the <span
Add the before fetch here? So, as part of the fetch's process response
This allows preloading module script graphs. The processing model for
this turns out to be different enough that simply extending
rel="preload" is not a good option.
Closes whatwg/fetch#486.
/cc @whatwg/modules @yoavweiss