-
Notifications
You must be signed in to change notification settings - Fork 72
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
link instead of script? #8
Comments
With |
I take that back, looks like the typical size limit is 8k, I doubt a packagemap would exceed that. I had thought the limit was smaller. |
@matthewp if the link header is mostly a href I don't think it likely to exceed the size limits. Per inlining into the document, I'm not sure if a precomputed workflow like this is as desirable to output back into inline HTML for most situations. If desirable to inline we could certainly support both ways to load things, similar to CSS. I somewhat still question if inlining is going to be more desirable than linking since you will be doing many resource requests most likely as the README states. Inlining can help with initial load, but could cause fewer cache hits on the initial document load if the package name map changes over time. In particular, being unable to load updated package name maps after initial load means that any changes would require a refresh in order to be synced up. Hopefully, we can find a workflow where package name maps change rarely; I am unsure of that being realistic. |
Good point about cache hits. For a lot (but not all) sites, caching isn't used on documents as they tend to be dynamic. I'm concerned about using hrefs with http/1.1 servers though. The packagemap is a super-dependency of all modules, so it will block the preload scanner from doing its job. |
We considered both, but started with |
@justinfagnani I'm curious about this:
Should we be concerned that a large packagemap will block scripts from loading? One case where you might want multiple packagemaps would be if you wanted to put essential, above-the-fold scripts into its own tree and then defer the rest for later. For example: <script type="packagemap">
[ESSENTIAL MAPPING HERE]
</script>
<script type="module" src="./main.js"></script>
<main> ... </main>
<script type="packagemap">
[NON-ESSENTIAL MAPPING HERE]
</script>
<script type="module" src="./less-important.js"></script> The question being whether a packagemap is ever big enough where splitting would be desired. I understand that allowing multiple maps starts to raise conflict resolution problems... |
I hope that can be explored more, and my team has asked for it. I understand that there might be blockers, but maybe there's some way to figure it out. |
btw, this is a dupe of #1 |
Hmm, I really tried to pre-empt this by pre-filing #1. Let's please continue discussion there? Some good points have been raised so far though! |
Well, I agree the issues slightly bleed over, but since #1 is where |
Is there a specific reason for the use of
<script>
instead of<link>
? The only reason I can think of is the HTTP Header support that comes with<link>
, but am unsure what is problematic about that.The text was updated successfully, but these errors were encountered: