Skip to content

Commit d3a3f5f

Browse files
committed
[Re-land] Make prerendering always non-blocking: Add missing feature flag checks (#31238)
This is a partial re-land of #31056. We saw breakages surface after the original land and had to revert. Now that they've been fixed, let's try this again. This time we'll split up the commits to give us more control of testing and rollout internally. Original PR: #31056 Original Commit: 2a9fb44 Revert PR: #31080 Commit description: ``` Neglected to wrap some places in the enableSiblingPrerendering flag. ``` Co-authored-by: Andrew Clark <[email protected]> DiffTrain build for [13411e4](13411e4)
1 parent c1210a1 commit d3a3f5f

34 files changed

+390
-366
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
75dd053b5e83e8ae20e9f771bca7b95dba4ff881
1+
13411e4589f3d999727c5322781e2dd7bef3b256
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
75dd053b5e83e8ae20e9f771bca7b95dba4ff881
1+
13411e4589f3d999727c5322781e2dd7bef3b256

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,7 @@ __DEV__ &&
20172017
exports.useTransition = function () {
20182018
return resolveDispatcher().useTransition();
20192019
};
2020-
exports.version = "19.0.0-www-classic-75dd053b-20241014";
2020+
exports.version = "19.0.0-www-classic-13411e45-20241014";
20212021
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
20222022
"function" ===
20232023
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,7 @@ __DEV__ &&
19971997
exports.useTransition = function () {
19981998
return resolveDispatcher().useTransition();
19991999
};
2000-
exports.version = "19.0.0-www-modern-75dd053b-20241014";
2000+
exports.version = "19.0.0-www-modern-13411e45-20241014";
20012001
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
20022002
"function" ===
20032003
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,4 +824,4 @@ exports.useSyncExternalStore = function (
824824
exports.useTransition = function () {
825825
return ReactSharedInternals.H.useTransition();
826826
};
827-
exports.version = "19.0.0-www-classic-75dd053b-20241014";
827+
exports.version = "19.0.0-www-classic-13411e45-20241014";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,4 +820,4 @@ exports.useSyncExternalStore = function (
820820
exports.useTransition = function () {
821821
return ReactSharedInternals.H.useTransition();
822822
};
823-
exports.version = "19.0.0-www-modern-75dd053b-20241014";
823+
exports.version = "19.0.0-www-modern-13411e45-20241014";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ exports.useSyncExternalStore = function (
828828
exports.useTransition = function () {
829829
return ReactSharedInternals.H.useTransition();
830830
};
831-
exports.version = "19.0.0-www-classic-75dd053b-20241014";
831+
exports.version = "19.0.0-www-classic-13411e45-20241014";
832832
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
833833
"function" ===
834834
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ exports.useSyncExternalStore = function (
824824
exports.useTransition = function () {
825825
return ReactSharedInternals.H.useTransition();
826826
};
827-
exports.version = "19.0.0-www-modern-75dd053b-20241014";
827+
exports.version = "19.0.0-www-modern-13411e45-20241014";
828828
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
829829
"function" ===
830830
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,8 @@ __DEV__ &&
857857
: ((pingedLanes &= nonIdlePendingLanes),
858858
0 !== pingedLanes
859859
? (nextLanes = getHighestPriorityLanes(pingedLanes))
860-
: root ||
860+
: enableSiblingPrerendering &&
861+
!root &&
861862
((warmLanes = nonIdlePendingLanes & ~warmLanes),
862863
0 !== warmLanes &&
863864
(nextLanes = getHighestPriorityLanes(warmLanes)))))
@@ -866,7 +867,8 @@ __DEV__ &&
866867
? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))
867868
: 0 !== pingedLanes
868869
? (nextLanes = getHighestPriorityLanes(pingedLanes))
869-
: root ||
870+
: enableSiblingPrerendering &&
871+
!root &&
870872
((warmLanes = pendingLanes & ~warmLanes),
871873
0 !== warmLanes &&
872874
(nextLanes = getHighestPriorityLanes(warmLanes))));
@@ -988,7 +990,8 @@ __DEV__ &&
988990
remainingLanes &= ~lane;
989991
}
990992
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
991-
0 === suspendedRetryLanes ||
993+
!enableSiblingPrerendering ||
994+
0 === suspendedRetryLanes ||
992995
0 !== updatedLanes ||
993996
(disableLegacyMode && 0 === root.tag) ||
994997
(root.suspendedLanes |=
@@ -8992,7 +8995,8 @@ __DEV__ &&
89928995
((retryQueue =
89938996
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
89948997
(workInProgress.lanes |= retryQueue),
8995-
(workInProgressSuspendedRetryLanes |= retryQueue));
8998+
enableSiblingPrerendering &&
8999+
(workInProgressSuspendedRetryLanes |= retryQueue));
89969000
}
89979001
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
89989002
switch (renderState.tailMode) {
@@ -12797,7 +12801,9 @@ __DEV__ &&
1279712801
suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
1279812802
root.suspendedLanes |= suspendedLanes;
1279912803
root.pingedLanes &= ~suspendedLanes;
12800-
didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes);
12804+
enableSiblingPrerendering &&
12805+
!didSkipSuspendedSiblings &&
12806+
(root.warmLanes |= suspendedLanes);
1280112807
didSkipSuspendedSiblings = root.expirationTimes;
1280212808
for (var lanes = suspendedLanes; 0 < lanes; ) {
1280312809
var index = 31 - clz32(lanes),
@@ -17018,11 +17024,11 @@ __DEV__ &&
1701817024
(function () {
1701917025
var internals = {
1702017026
bundleType: 1,
17021-
version: "19.0.0-www-classic-75dd053b-20241014",
17027+
version: "19.0.0-www-classic-13411e45-20241014",
1702217028
rendererPackageName: "react-art",
1702317029
currentDispatcherRef: ReactSharedInternals,
1702417030
findFiberByHostInstance: getInstanceFromNode,
17025-
reconcilerVersion: "19.0.0-www-classic-75dd053b-20241014"
17031+
reconcilerVersion: "19.0.0-www-classic-13411e45-20241014"
1702617032
};
1702717033
internals.overrideHookState = overrideHookState;
1702817034
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -17056,7 +17062,7 @@ __DEV__ &&
1705617062
exports.Shape = Shape;
1705717063
exports.Surface = Surface;
1705817064
exports.Text = Text;
17059-
exports.version = "19.0.0-www-classic-75dd053b-20241014";
17065+
exports.version = "19.0.0-www-classic-13411e45-20241014";
1706017066
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1706117067
"function" ===
1706217068
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,8 @@ __DEV__ &&
840840
: ((pingedLanes &= nonIdlePendingLanes),
841841
0 !== pingedLanes
842842
? (nextLanes = getHighestPriorityLanes(pingedLanes))
843-
: root ||
843+
: enableSiblingPrerendering &&
844+
!root &&
844845
((warmLanes = nonIdlePendingLanes & ~warmLanes),
845846
0 !== warmLanes &&
846847
(nextLanes = getHighestPriorityLanes(warmLanes)))))
@@ -849,7 +850,8 @@ __DEV__ &&
849850
? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))
850851
: 0 !== pingedLanes
851852
? (nextLanes = getHighestPriorityLanes(pingedLanes))
852-
: root ||
853+
: enableSiblingPrerendering &&
854+
!root &&
853855
((warmLanes = pendingLanes & ~warmLanes),
854856
0 !== warmLanes &&
855857
(nextLanes = getHighestPriorityLanes(warmLanes))));
@@ -971,7 +973,8 @@ __DEV__ &&
971973
remainingLanes &= ~lane;
972974
}
973975
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
974-
0 !== suspendedRetryLanes &&
976+
enableSiblingPrerendering &&
977+
0 !== suspendedRetryLanes &&
975978
0 === updatedLanes &&
976979
0 !== root.tag &&
977980
(root.suspendedLanes |=
@@ -8647,7 +8650,8 @@ __DEV__ &&
86478650
((retryQueue =
86488651
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
86498652
(workInProgress.lanes |= retryQueue),
8650-
(workInProgressSuspendedRetryLanes |= retryQueue));
8653+
enableSiblingPrerendering &&
8654+
(workInProgressSuspendedRetryLanes |= retryQueue));
86518655
}
86528656
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
86538657
switch (renderState.tailMode) {
@@ -12342,7 +12346,9 @@ __DEV__ &&
1234212346
suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
1234312347
root.suspendedLanes |= suspendedLanes;
1234412348
root.pingedLanes &= ~suspendedLanes;
12345-
didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes);
12349+
enableSiblingPrerendering &&
12350+
!didSkipSuspendedSiblings &&
12351+
(root.warmLanes |= suspendedLanes);
1234612352
didSkipSuspendedSiblings = root.expirationTimes;
1234712353
for (var lanes = suspendedLanes; 0 < lanes; ) {
1234812354
var index = 31 - clz32(lanes),
@@ -16461,11 +16467,11 @@ __DEV__ &&
1646116467
(function () {
1646216468
var internals = {
1646316469
bundleType: 1,
16464-
version: "19.0.0-www-modern-75dd053b-20241014",
16470+
version: "19.0.0-www-modern-13411e45-20241014",
1646516471
rendererPackageName: "react-art",
1646616472
currentDispatcherRef: ReactSharedInternals,
1646716473
findFiberByHostInstance: getInstanceFromNode,
16468-
reconcilerVersion: "19.0.0-www-modern-75dd053b-20241014"
16474+
reconcilerVersion: "19.0.0-www-modern-13411e45-20241014"
1646916475
};
1647016476
internals.overrideHookState = overrideHookState;
1647116477
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16499,7 +16505,7 @@ __DEV__ &&
1649916505
exports.Shape = Shape;
1650016506
exports.Surface = Surface;
1650116507
exports.Text = Text;
16502-
exports.version = "19.0.0-www-modern-75dd053b-20241014";
16508+
exports.version = "19.0.0-www-modern-13411e45-20241014";
1650316509
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1650416510
"function" ===
1650516511
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)