Skip to content

Commit 47a7b36

Browse files
committed
[Fizz] improve Hoistable handling for Elements and Resources inside Suspense Boundaries (#28069)
Updates Fizz to handle Hoistables (Resources and Elements) in a way that better aligns with Suspense fallbacks 1. Hoistable Elements inside a fallback (regardless of how deep and how many additional boundaries are intermediate) will be ignored. The reasoning is fallbacks are transient and since there is not good way to clean up hoistables because they escape their Suspense container its better to not emit them in the first place. SSR fallbacks are already not full fidelity because they never hydrate so this aligns with that somewhat. 2. Hoistable stylesheets in fallbacks will only block the reveal of a parent suspense boundary if the fallback is going to flush with that completed parent suspense boundary. Previously if you rendered a stylesheet Resource inside a fallback any parent suspense boundaries that completed after the shell flushed would include that resource in the set required to resolve before the boundary reveal happens on the client. This is not a semantic change, just a performance optimization 3. preconnect and preload hoistable queues are gone, if you want to optimize resource loading you shoudl use `ReactDOM.preconnect` and `ReactDOM.preload`. `viewport` meta tags get their own queue because they need to go before any preloads since they affect the media state. In addition to those functional changes this PR also refactors the boundary resource tracking by moving it to the task rather than using function calls at the start of each render and flush. Tasks also now track whether they are a fallback task supercedes prior work here: #27534 DiffTrain build for commit 554fc49.
1 parent cb419ff commit 47a7b36

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -25607,7 +25607,7 @@ if (__DEV__) {
2560725607
return root;
2560825608
}
2560925609

25610-
var ReactVersion = "18.3.0-canary-1c958aa4a-20240130";
25610+
var ReactVersion = "18.3.0-canary-554fc49f4-20240130";
2561125611

2561225612
// Might add PROFILE later.
2561325613

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -9149,7 +9149,7 @@ var devToolsConfig$jscomp$inline_1029 = {
91499149
throw Error("TestRenderer does not support findFiberByHostInstance()");
91509150
},
91519151
bundleType: 0,
9152-
version: "18.3.0-canary-1c958aa4a-20240130",
9152+
version: "18.3.0-canary-554fc49f4-20240130",
91539153
rendererPackageName: "react-test-renderer"
91549154
};
91559155
var internals$jscomp$inline_1205 = {
@@ -9180,7 +9180,7 @@ var internals$jscomp$inline_1205 = {
91809180
scheduleRoot: null,
91819181
setRefreshHandler: null,
91829182
getCurrentFiber: null,
9183-
reconcilerVersion: "18.3.0-canary-1c958aa4a-20240130"
9183+
reconcilerVersion: "18.3.0-canary-554fc49f4-20240130"
91849184
};
91859185
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
91869186
var hook$jscomp$inline_1206 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -9577,7 +9577,7 @@ var devToolsConfig$jscomp$inline_1071 = {
95779577
throw Error("TestRenderer does not support findFiberByHostInstance()");
95789578
},
95799579
bundleType: 0,
9580-
version: "18.3.0-canary-1c958aa4a-20240130",
9580+
version: "18.3.0-canary-554fc49f4-20240130",
95819581
rendererPackageName: "react-test-renderer"
95829582
};
95839583
var internals$jscomp$inline_1246 = {
@@ -9608,7 +9608,7 @@ var internals$jscomp$inline_1246 = {
96089608
scheduleRoot: null,
96099609
setRefreshHandler: null,
96109610
getCurrentFiber: null,
9611-
reconcilerVersion: "18.3.0-canary-1c958aa4a-20240130"
9611+
reconcilerVersion: "18.3.0-canary-554fc49f4-20240130"
96129612
};
96139613
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
96149614
var hook$jscomp$inline_1247 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-canary-1c958aa4a-20240130";
27+
var ReactVersion = "18.3.0-canary-554fc49f4-20240130";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -545,4 +545,4 @@ exports.useSyncExternalStore = function (
545545
exports.useTransition = function () {
546546
return ReactCurrentDispatcher.current.useTransition();
547547
};
548-
exports.version = "18.3.0-canary-1c958aa4a-20240130";
548+
exports.version = "18.3.0-canary-554fc49f4-20240130";

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ exports.useSyncExternalStore = function (
541541
exports.useTransition = function () {
542542
return ReactCurrentDispatcher.current.useTransition();
543543
};
544-
exports.version = "18.3.0-canary-1c958aa4a-20240130";
544+
exports.version = "18.3.0-canary-554fc49f4-20240130";
545545
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
546546
"function" ===
547547
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1c958aa4abf9e6b638489b1d73cdb1b6dc7c3ab6
1+
554fc49f41465d914b15dc8eb2ec094f37824f7e

0 commit comments

Comments
 (0)