We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
React version: 18.3.0-canary-a389046a5-20230512
<script>
<link>
fetchpriority
<link rel="preload">
Link to code example:
Currently, if we server render a component such as the one below:
<html lang="en"> <head> <link rel="stylesheet" href="/styles.css" fetchpriority="low" ></link> </head> <body> <script src="/script.js" fetchpriority="low" ></script> </body> </html>
React will also render preload links for the script and link but without the fetchpriority set:
script
link
<head> <link rel="preload" as="style" href="/styles.css" /> <link rel="preload" as="script" href="/script.js" /> <link rel="stylesheet" href="/styles.css" fetchpriority="low" ></link> </head> <body> <script src="/script.js" fetchpriority="low"></script> </body>
The result is that both styles.css and script.js are fetched with fetchpriority set to high
styles.css
script.js
When generating preload links for script and link components, React should respect fetchpriority if specified.
The text was updated successfully, but these errors were encountered:
Looking through the code, it seems that this should be a straightforward fix by making a change here and here
If that sounds correct (and there isn't any disagreement about the expected behavior) - I'm happy to push up a PR to address this.
Sorry, something went wrong.
cc @gnoff
@liuyenwei PR would be welcome!
@gnoff #26826
Closing per #26826 (review).
fetchPriority
No branches or pull requests
React version: 18.3.0-canary-a389046a5-20230512
Steps To Reproduce
<script>
or<link>
tags withfetchpriority
set<link rel="preload">
links for each of the discovered resources but without the same fetchpriority set.Link to code example:
The current behavior
Currently, if we server render a component such as the one below:
React will also render preload links for the
script
andlink
but without thefetchpriority
set:The result is that both
styles.css
andscript.js
are fetched withfetchpriority
set to highThe expected behavior
When generating preload links for
script
andlink
components, React should respectfetchpriority
if specified.The text was updated successfully, but these errors were encountered: