Skip to content

Commit ea8b522

Browse files
committed
[Fizz] Preload "suspensey" images (#27191)
Eventually we will treat images without `loading="lazy"` as suspensey meaning we will coordinate the reveal of boundaries when these images have loaded and ideally decoded. As a step in that direction this change prioritizes these images for preloading to ensure the highest chance that they are loaded before boundaries reveal (or initial paint). every img rendered that is non lazy loading will emit a preload just behind fonts. This change implements a new resource queue for high priority image preloads There are a number of scenarios where we end up putting a preload in this queue 1. If you render a non-lazy image and there are fewer than 10 high priority image preloads 2. if you render a non-lazy image with fetchPriority "high" 3. if you preload as "image" with fetchPriority "high" This means that by default we won't overrsaturate this queue with every img rendered on the page but the earlier encountered ones will go first. Essentially this is React's own implementation of fetchPriority="auto". If however you specify that the fetchPriority is higher then in theory an unlimited number of images can preload in this queue. This gives users some control over queuing while still providing a good default that does not require any opting into Additionally we use fetchPriority "low" as a signal that an image does not require preloading. This may end up being pointless if not using lazy (which also opts out of preloading) because it might delay initial paint but we'll start with this hueristic and consider changes in the future when we have more information DiffTrain build for commit f359f9b.
1 parent 4dce0c4 commit ea8b522

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23961,7 +23961,7 @@ function createFiberRoot(
2396123961
return root;
2396223962
}
2396323963

23964-
var ReactVersion = "18.3.0-canary-a20eea251-20230809";
23964+
var ReactVersion = "18.3.0-canary-f359f9b41-20230810";
2396523965

2396623966
// Might add PROFILE later.
2396723967

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8615,7 +8615,7 @@ var devToolsConfig$jscomp$inline_1029 = {
86158615
throw Error("TestRenderer does not support findFiberByHostInstance()");
86168616
},
86178617
bundleType: 0,
8618-
version: "18.3.0-canary-a20eea251-20230809",
8618+
version: "18.3.0-canary-f359f9b41-20230810",
86198619
rendererPackageName: "react-test-renderer"
86208620
};
86218621
var internals$jscomp$inline_1228 = {
@@ -8646,7 +8646,7 @@ var internals$jscomp$inline_1228 = {
86468646
scheduleRoot: null,
86478647
setRefreshHandler: null,
86488648
getCurrentFiber: null,
8649-
reconcilerVersion: "18.3.0-canary-a20eea251-20230809"
8649+
reconcilerVersion: "18.3.0-canary-f359f9b41-20230810"
86508650
};
86518651
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
86528652
var hook$jscomp$inline_1229 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9041,7 +9041,7 @@ var devToolsConfig$jscomp$inline_1071 = {
90419041
throw Error("TestRenderer does not support findFiberByHostInstance()");
90429042
},
90439043
bundleType: 0,
9044-
version: "18.3.0-canary-a20eea251-20230809",
9044+
version: "18.3.0-canary-f359f9b41-20230810",
90459045
rendererPackageName: "react-test-renderer"
90469046
};
90479047
var internals$jscomp$inline_1269 = {
@@ -9072,7 +9072,7 @@ var internals$jscomp$inline_1269 = {
90729072
scheduleRoot: null,
90739073
setRefreshHandler: null,
90749074
getCurrentFiber: null,
9075-
reconcilerVersion: "18.3.0-canary-a20eea251-20230809"
9075+
reconcilerVersion: "18.3.0-canary-f359f9b41-20230810"
90769076
};
90779077
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90789078
var hook$jscomp$inline_1270 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-canary-a20eea251-20230809";
30+
var ReactVersion = "18.3.0-canary-f359f9b41-20230810";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
616616
exports.useTransition = function () {
617617
return ReactCurrentDispatcher.current.useTransition();
618618
};
619-
exports.version = "18.3.0-canary-a20eea251-20230809";
619+
exports.version = "18.3.0-canary-f359f9b41-20230810";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
619619
exports.useTransition = function () {
620620
return ReactCurrentDispatcher.current.useTransition();
621621
};
622-
exports.version = "18.3.0-canary-a20eea251-20230809";
622+
exports.version = "18.3.0-canary-f359f9b41-20230810";
623623

624624
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
625625
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a20eea25197df0da80104917df414747eeab1ac9
1+
f359f9b41ac1a8127f5ba505e0c04675eee0d310

0 commit comments

Comments
 (0)