You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Float][Fizz][Fiber] support imagesrcset and imagesizes for ReactDOM.preload() (#26940)
For float methods the href argument is usually all we need to uniquely
key the request. However when preloading responsive images it is
possible that you may need more than one preload for differing
imagesizes attributes. When using imagesrcset for preloads the href
attribute acts more like a fallback href. For keying purposes the
imagesrcset becomes the primary key conceptually.
This change updates the keying logic for `ReactDOM.preload()` when you
pass `{as: "image"}`
1. If `options.imageSrcSet` is a non-emtpy string the key is defined as
`options.imageSrcSet + options.imageSizes`. The `href` argument is still
required but does not participate in keying.
2. If `options.imageSrcSet` is empty, missing, or an invalid format the
key is defined as the `href`. Changing the `options.imageSizes` does not
affect the key as this option is inert when not using
`options.imageSrcSet`
Additionally, currently there is a bug in webkit (Safari) that causes
preload links to fail to use imageSrcSet and fallback to href even when
the browser will correctly resolve srcset on an `<img>` tag. Because the
drawbacks of preloading the wrong image (href over imagesrcset) in a
modern browser outweight the drawbacks of not preloading anything for
responsive images in browsers that do not support srcset at all we will
omit the `href` attribute whenever `options.imageSrcSet` is provided. We
still require you provide an href since we want to be able to revert
this behavior once all major browsers support it
bug link: https://bugs.webkit.org/show_bug.cgi?id=231150
DiffTrain build for commit fc929cf.
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23922,7 +23922,7 @@ function createFiberRoot(
23922
23922
return root;
23923
23923
}
23924
23924
23925
-
var ReactVersion = "18.3.0-canary-86acc10f2-20230615";
23925
+
var ReactVersion = "18.3.0-canary-fc929cf4e-20230615";
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8617,7 +8617,7 @@ var devToolsConfig$jscomp$inline_1031 = {
8617
8617
throwError("TestRenderer does not support findFiberByHostInstance()");
8618
8618
},
8619
8619
bundleType: 0,
8620
-
version: "18.3.0-canary-86acc10f2-20230615",
8620
+
version: "18.3.0-canary-fc929cf4e-20230615",
8621
8621
rendererPackageName: "react-test-renderer"
8622
8622
};
8623
8623
varinternals$jscomp$inline_1230={
@@ -8648,7 +8648,7 @@ var internals$jscomp$inline_1230 = {
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9043,7 +9043,7 @@ var devToolsConfig$jscomp$inline_1073 = {
9043
9043
throwError("TestRenderer does not support findFiberByHostInstance()");
9044
9044
},
9045
9045
bundleType: 0,
9046
-
version: "18.3.0-canary-86acc10f2-20230615",
9046
+
version: "18.3.0-canary-fc929cf4e-20230615",
9047
9047
rendererPackageName: "react-test-renderer"
9048
9048
};
9049
9049
varinternals$jscomp$inline_1271={
@@ -9074,7 +9074,7 @@ var internals$jscomp$inline_1271 = {
0 commit comments