-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Add media
option to ReactDOM.preload()
#27129
Conversation
Comparing: 72411c4...ef3bac4 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
Any progress on this? This feature would be really needed, especially for NextJS users as they disabled custom Head in the AppDir. As a solution to some missing features for preloading they just refer to ReactDOM.preload(): https://nextjs.org/docs/app/api-reference/functions/generate-metadata#resource-hints |
11a175f
to
ef3bac4
Compare
@eps1lon I've rebased, but the changes in I've retained the test and type updates though, and the test is failing - so #27641 probably hasn't solved this issue as far as I can tell. |
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
Fixed in #28635 where tests were also added. Sorry for not getting around to this earlier. |
Appreciate that it happened at all, thanks mate! |
Summary
Similar to #27096, we've encountered an issue in Next.js while using ReactDOM.preload(), where adding a
media
attribute does nothing.I've not contributed to OSS before and am not familiar with the React core codebase, so I've followed the example set by the author of the #27096 pull request as a basis for this change.
How did you test this change?
I wrote the test within
ReactDOMFloat-test.js
before making any functional changes, and ran:both before and after making the functional changes to verify that the test failed before the change, and passed after.