modulepreload in Link header & early hints#7862
Conversation
|
This has a few issues that are not fleshed out yet, but it expresses the idea of fetching the top-level imported module, and continue the module script preload (e.g. potentially loading the dependencies) once the document is initialized. |
domenic
left a comment
There was a problem hiding this comment.
Seems very promising. To me it brings up that we have a few stages to investigate:
- Shouldn't referrerpolicy apply to allow preload early hints? Fix that first?
- Do a refactoring editorial PR turning things into a switch statement
- Then we're set up to add modulepreload
In preparation for supporting [modulepreload](whatwg#7862) in link headers. - Parse `referrerpolicy` from link headers - Add referrer policy and nonce to link processing optinos
Done! |
5db34e6 to
7dac51e
Compare
modulepreload in Link header & early hints
domenic
left a comment
There was a problem hiding this comment.
This is pretty good. Given how messy the script-fetching stuff is right now, I'm happy to take this approach, and maybe me or you or someone can clean up the script fetching later.
I'll file an issue with how to clean up the script fetching where we can discuss, if you're interested.
|
@domenic: additional review? :) |
3377f07 to
9c62b0f
Compare
source
Outdated
| <li><p>If <var>options</var>'s <span data-x="link options destination">destination</span> is not | ||
| a <span data-x="concept-request-destination">destination</span>, then return null.</p></li> | ||
| <li><p>If <var>options</var>'s <span data-x="link options as">as</span> is not a <span | ||
| data-x="concept-request-destination">destination</span>, then return null.</p></li> |
There was a problem hiding this comment.
I think you want to test against (and link to) potential destination, not destination.
|
I will need some time to review this fully -- we currently do not implement this afaik. I will try to find some time. |
| <li><p>If <var>request</var>'s <span data-x="concept-request-destination">destination</span> is | ||
| "<code data-x="">worker</code>", "<code data-x="">sharedworker</code>", or "<code | ||
| data-x="">serviceworker</code>", then set <var>request</var>'s <span | ||
| data-x="concept-request-mode">mode</span> to "<code data-x="">same-origin</code>".</p></li> |
There was a problem hiding this comment.
Hmm, I realized worker destination when dealing with the main thread modulepreload is kind of odd. Same applies link elements.
|
@noamr would you be up for rebasing or recreating this? Sorry we let it fall through the cracks. The script-fetching stuff should be much nicer these days though. |
|
Any update on this? |
Closes #7854
(See WHATWG Working Mode: Changes for more details.)
/links.html ( diff )
/semantics.html ( diff )
/webappapis.html ( diff )