-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Support link modulepreload for import assertions #7388
Comments
cc @whatwg/modules |
I agree that this is needed, thanks for raising the issue. Instead of using MIME type for the values, I think we could just use the same shorter strings as import assertions: <link rel="modulepreload" href="app.mjs">
<link rel="modulepreload" href="style.css" type="css">
<link rel="modulepreload" href="data.json" type="json"> For the attribute name, <link rel="modulepreload" href="style.css" moduletype="css">` or even <link rel="modulepreload" href="style.css" modulepreloadtype="css"> An alternative idea is to add new <link rel="modulepreload" href="app.mjs">
<link rel="cssmodulepreload" href="style.css">
<link rel="jsonmodulepreload" href="data.json"> |
I think having some way to do this is good, but it seems precarious given that arbitrary key/values are allowed for assertions to only cater to a single one as a special case. |
I think @dandclark is on the right track. The main thing to consider is how well such ideas fit with possible future extensions.
For example, as a strawperson, you could imagine something like <link rel="modulepreload" href="style.css" assert='{ type: "css" }'>
<script type="module" assert='{ type: "css" }'>
.class { prop: value; }
</script> This unfortunately has the usual quote-related problems of putting JSON in attributes, so it's mostly just a strawperson. But it's worth thinking about. |
I, as a full stack developer, love when knowledge can be reused. @domenic, Tell me the <script type="module" > In a perfect world, was it supposed to be like this <script type="application/javascript" > |
No, type=module is intentional. Application/JavaScript is not correct. |
Hello.
The current implementation in Chrome does not support the
<link rel=modulepreload>
for import assertionshttps://bugs.chromium.org/p/chromium/issues/detail?id=1274871
The specification says that you can specify the
as
attributeBut
as
not support and has not validas
value for typejson
module.Perhaps it makes sense to add support for the
type
attribute?Thanks.
The text was updated successfully, but these errors were encountered: