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 <git@andrewclark.io> DiffTrain build for [13411e4](13411e4)
1 parent c1210a1 commit d3a3f5f

34 files changed

+390
-366
lines changed

compiled/facebook-www/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
75dd053b5e83e8ae20e9f771bca7b95dba4ff881
1+
13411e4589f3d999727c5322781e2dd7bef3b256
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
75dd053b5e83e8ae20e9f771bca7b95dba4ff881
1+
13411e4589f3d999727c5322781e2dd7bef3b256

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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+14-8
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

+14-8
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 &&

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

+14-8
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,8 @@ function getNextLanes(root, wipLanes) {
601601
: ((pingedLanes &= nonIdlePendingLanes),
602602
0 !== pingedLanes
603603
? (nextLanes = getHighestPriorityLanes(pingedLanes))
604-
: root ||
604+
: enableSiblingPrerendering &&
605+
!root &&
605606
((warmLanes = nonIdlePendingLanes & ~warmLanes),
606607
0 !== warmLanes &&
607608
(nextLanes = getHighestPriorityLanes(warmLanes)))))
@@ -610,7 +611,8 @@ function getNextLanes(root, wipLanes) {
610611
? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))
611612
: 0 !== pingedLanes
612613
? (nextLanes = getHighestPriorityLanes(pingedLanes))
613-
: root ||
614+
: enableSiblingPrerendering &&
615+
!root &&
614616
((warmLanes = pendingLanes & ~warmLanes),
615617
0 !== warmLanes &&
616618
(nextLanes = getHighestPriorityLanes(warmLanes))));
@@ -727,7 +729,8 @@ function markRootFinished(
727729
remainingLanes &= ~lane;
728730
}
729731
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
730-
0 === suspendedRetryLanes ||
732+
!enableSiblingPrerendering ||
733+
0 === suspendedRetryLanes ||
731734
0 !== updatedLanes ||
732735
(disableLegacyMode && 0 === root.tag) ||
733736
(root.suspendedLanes |=
@@ -6551,7 +6554,8 @@ function scheduleRetryEffect(workInProgress, retryQueue) {
65516554
((retryQueue =
65526555
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
65536556
(workInProgress.lanes |= retryQueue),
6554-
(workInProgressSuspendedRetryLanes |= retryQueue));
6557+
enableSiblingPrerendering &&
6558+
(workInProgressSuspendedRetryLanes |= retryQueue));
65556559
}
65566560
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
65576561
switch (renderState.tailMode) {
@@ -9477,7 +9481,9 @@ function markRootSuspended(
94779481
suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
94789482
root.suspendedLanes |= suspendedLanes;
94799483
root.pingedLanes &= ~suspendedLanes;
9480-
didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes);
9484+
enableSiblingPrerendering &&
9485+
!didSkipSuspendedSiblings &&
9486+
(root.warmLanes |= suspendedLanes);
94819487
didSkipSuspendedSiblings = root.expirationTimes;
94829488
for (var lanes = suspendedLanes; 0 < lanes; ) {
94839489
var index$6 = 31 - clz32(lanes),
@@ -10829,13 +10835,13 @@ var slice = Array.prototype.slice,
1082910835
})(React.Component);
1083010836
var internals$jscomp$inline_1467 = {
1083110837
bundleType: 0,
10832-
version: "19.0.0-www-classic-75dd053b-20241014",
10838+
version: "19.0.0-www-classic-13411e45-20241014",
1083310839
rendererPackageName: "react-art",
1083410840
currentDispatcherRef: ReactSharedInternals,
1083510841
findFiberByHostInstance: function () {
1083610842
return null;
1083710843
},
10838-
reconcilerVersion: "19.0.0-www-classic-75dd053b-20241014"
10844+
reconcilerVersion: "19.0.0-www-classic-13411e45-20241014"
1083910845
};
1084010846
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1084110847
var hook$jscomp$inline_1468 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10861,4 +10867,4 @@ exports.RadialGradient = RadialGradient;
1086110867
exports.Shape = TYPES.SHAPE;
1086210868
exports.Surface = Surface;
1086310869
exports.Text = Text;
10864-
exports.version = "19.0.0-www-classic-75dd053b-20241014";
10870+
exports.version = "19.0.0-www-classic-13411e45-20241014";

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

+14-8
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,8 @@ function getNextLanes(root, wipLanes) {
518518
: ((pingedLanes &= nonIdlePendingLanes),
519519
0 !== pingedLanes
520520
? (nextLanes = getHighestPriorityLanes(pingedLanes))
521-
: root ||
521+
: enableSiblingPrerendering &&
522+
!root &&
522523
((warmLanes = nonIdlePendingLanes & ~warmLanes),
523524
0 !== warmLanes &&
524525
(nextLanes = getHighestPriorityLanes(warmLanes)))))
@@ -527,7 +528,8 @@ function getNextLanes(root, wipLanes) {
527528
? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))
528529
: 0 !== pingedLanes
529530
? (nextLanes = getHighestPriorityLanes(pingedLanes))
530-
: root ||
531+
: enableSiblingPrerendering &&
532+
!root &&
531533
((warmLanes = pendingLanes & ~warmLanes),
532534
0 !== warmLanes &&
533535
(nextLanes = getHighestPriorityLanes(warmLanes))));
@@ -644,7 +646,8 @@ function markRootFinished(
644646
remainingLanes &= ~lane;
645647
}
646648
0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);
647-
0 !== suspendedRetryLanes &&
649+
enableSiblingPrerendering &&
650+
0 !== suspendedRetryLanes &&
648651
0 === updatedLanes &&
649652
0 !== root.tag &&
650653
(root.suspendedLanes |=
@@ -6184,7 +6187,8 @@ function scheduleRetryEffect(workInProgress, retryQueue) {
61846187
((retryQueue =
61856188
22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),
61866189
(workInProgress.lanes |= retryQueue),
6187-
(workInProgressSuspendedRetryLanes |= retryQueue));
6190+
enableSiblingPrerendering &&
6191+
(workInProgressSuspendedRetryLanes |= retryQueue));
61886192
}
61896193
function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
61906194
switch (renderState.tailMode) {
@@ -9040,7 +9044,9 @@ function markRootSuspended(
90409044
suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
90419045
root.suspendedLanes |= suspendedLanes;
90429046
root.pingedLanes &= ~suspendedLanes;
9043-
didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes);
9047+
enableSiblingPrerendering &&
9048+
!didSkipSuspendedSiblings &&
9049+
(root.warmLanes |= suspendedLanes);
90449050
didSkipSuspendedSiblings = root.expirationTimes;
90459051
for (var lanes = suspendedLanes; 0 < lanes; ) {
90469052
var index$6 = 31 - clz32(lanes),
@@ -10340,13 +10346,13 @@ var slice = Array.prototype.slice,
1034010346
})(React.Component);
1034110347
var internals$jscomp$inline_1460 = {
1034210348
bundleType: 0,
10343-
version: "19.0.0-www-modern-75dd053b-20241014",
10349+
version: "19.0.0-www-modern-13411e45-20241014",
1034410350
rendererPackageName: "react-art",
1034510351
currentDispatcherRef: ReactSharedInternals,
1034610352
findFiberByHostInstance: function () {
1034710353
return null;
1034810354
},
10349-
reconcilerVersion: "19.0.0-www-modern-75dd053b-20241014"
10355+
reconcilerVersion: "19.0.0-www-modern-13411e45-20241014"
1035010356
};
1035110357
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1035210358
var hook$jscomp$inline_1461 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10372,4 +10378,4 @@ exports.RadialGradient = RadialGradient;
1037210378
exports.Shape = TYPES.SHAPE;
1037310379
exports.Surface = Surface;
1037410380
exports.Text = Text;
10375-
exports.version = "19.0.0-www-modern-75dd053b-20241014";
10381+
exports.version = "19.0.0-www-modern-13411e45-20241014";

0 commit comments

Comments
 (0)