-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Blazor] Use <LinkPreload /> component to preload assets #62225
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
@@maraf, this change will be considered for inclusion in the blog post for the release it'll ship in. Nice work! Please ensure that the original comment in this thread contains a clear explanation of what the change does, why it's important (what problem does it solve?), and, if relevant, include things like code samples and/or performance numbers. This content may not be exactly what goes into the blog post, but it will help the team putting together the announcement. Thanks! |
Using
link
headers has several disadvantagesFor these reasons we have decided to switch to a component-based approach. Thanks to
<base href="https://github.com/...">
element, preload links are correctly rooted.This PR adds
<LinkPreload />
component that in case of InteractiveWebAssembly component presence on the page generates preloading links into the place where the component is used, into the HTML head, after the<base href="https://github.com/...">
. In case there isn't any InteractiveWebAssembly, the component does nothing.This PR also updates the BlazorWeb template to include the
<LinkPreload />
component.Fixes #62174