Skip to content

Commit f71e333

Browse files
committed
Remove vestigial Suspense batching logic (#25861)
This code was originally added in the old ExpirationTime implementation of Suspense. The idea is that if multiple updates suspend inside the same Suspense boundary, and both of them resolve, we should render both results in the same batch, to reduce jank. This was an incomplete idea, though. We later discovered a stronger requirement — once we show a fallback, we cannot fill in that fallback without completing _all_ the updates that were previously skipped over. Otherwise you get tearing. This was fixed by #18411, then we discovered additional related flaws that were addressed in #24685. See those PR descriptions for additional context. So I believe this older code is no longer necessary. DiffTrain build for [48274a4](48274a4) [View git log for this commit](https://github.com/facebook/react/commits/48274a43aa708f63a7580142a4c1c1a47f31c1ac)
1 parent f96c1b8 commit f71e333

28 files changed

+166
-326
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
de7d1c90718ea8f4844a2219991f7115ef2bd2c5
1+
48274a43aa708f63a7580142a4c1c1a47f31c1ac
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
de7d1c90718ea8f4844a2219991f7115ef2bd2c5
1+
48274a43aa708f63a7580142a4c1c1a47f31c1ac

compiled/facebook-www/React-dev.classic.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-www-classic-de7d1c907-20221223";
30+
var ReactVersion = "18.3.0-www-classic-48274a43a-20230104";
3131

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

compiled/facebook-www/React-dev.modern.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-www-modern-de7d1c907-20221223";
30+
var ReactVersion = "18.3.0-www-modern-48274a43a-20230104";
3131

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,4 +643,4 @@ exports.useSyncExternalStore = function(
643643
);
644644
};
645645
exports.useTransition = useTransition;
646-
exports.version = "18.3.0-www-classic-de7d1c907-20221223";
646+
exports.version = "18.3.0-www-classic-48274a43a-20230104";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function(
635635
);
636636
};
637637
exports.useTransition = useTransition;
638-
exports.version = "18.3.0-www-modern-de7d1c907-20221223";
638+
exports.version = "18.3.0-www-modern-48274a43a-20230104";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ exports.useSyncExternalStore = function(
654654
);
655655
};
656656
exports.useTransition = useTransition;
657-
exports.version = "18.3.0-www-classic-de7d1c907-20221223";
657+
exports.version = "18.3.0-www-classic-48274a43a-20230104";
658658

659659
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
660660
if (

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ exports.useSyncExternalStore = function(
646646
);
647647
};
648648
exports.useTransition = useTransition;
649-
exports.version = "18.3.0-www-modern-de7d1c907-20221223";
649+
exports.version = "18.3.0-www-modern-48274a43a-20230104";
650650

651651
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
652652
if (

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-classic-de7d1c907-20221223";
72+
var ReactVersion = "18.3.0-www-classic-48274a43a-20230104";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -23840,18 +23840,6 @@ function finishConcurrentRender(root, exitStatus, lanes) {
2384023840
if (nextLanes !== NoLanes) {
2384123841
// There's additional work on this root.
2384223842
break;
23843-
}
23844-
23845-
var suspendedLanes = root.suspendedLanes;
23846-
23847-
if (!isSubsetOfLanes(suspendedLanes, lanes)) {
23848-
// We should prefer to render the fallback of at the last
23849-
// suspended level. Ping the last suspended level to try
23850-
// rendering it again.
23851-
// FIXME: What if the suspended lanes are Idle? Should not restart.
23852-
var eventTime = requestEventTime();
23853-
markRootPinged(root, suspendedLanes);
23854-
break;
2385523843
} // The render is suspended, it hasn't timed out, and there's no
2385623844
// lower priority work to do. Instead of committing the fallback
2385723845
// immediately, wait for more data to arrive.

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-modern-de7d1c907-20221223";
72+
var ReactVersion = "18.3.0-www-modern-48274a43a-20230104";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;
@@ -23529,18 +23529,6 @@ function finishConcurrentRender(root, exitStatus, lanes) {
2352923529
if (nextLanes !== NoLanes) {
2353023530
// There's additional work on this root.
2353123531
break;
23532-
}
23533-
23534-
var suspendedLanes = root.suspendedLanes;
23535-
23536-
if (!isSubsetOfLanes(suspendedLanes, lanes)) {
23537-
// We should prefer to render the fallback of at the last
23538-
// suspended level. Ping the last suspended level to try
23539-
// rendering it again.
23540-
// FIXME: What if the suspended lanes are Idle? Should not restart.
23541-
var eventTime = requestEventTime();
23542-
markRootPinged(root, suspendedLanes);
23543-
break;
2354423532
} // The render is suspended, it hasn't timed out, and there's no
2354523533
// lower priority work to do. Instead of committing the fallback
2354623534
// immediately, wait for more data to arrive.

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

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7923,25 +7923,17 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
79237923
markRootSuspended$1(root, lanes);
79247924
if (
79257925
(lanes & 125829120) === lanes &&
7926-
((didTimeout = globalMostRecentFallbackTime + 500 - now()),
7927-
10 < didTimeout)
7926+
((lanes = globalMostRecentFallbackTime + 500 - now()), 10 < lanes)
79287927
) {
79297928
if (0 !== getNextLanes(root, 0)) break;
7930-
originallyAttemptedLanes = root.suspendedLanes;
7931-
if ((originallyAttemptedLanes & lanes) !== lanes) {
7932-
requestEventTime();
7933-
root.pingedLanes |=
7934-
root.suspendedLanes & originallyAttemptedLanes;
7935-
break;
7936-
}
79377929
root.timeoutHandle = scheduleTimeout(
79387930
commitRoot.bind(
79397931
null,
79407932
root,
79417933
workInProgressRootRecoverableErrors,
79427934
workInProgressTransitions
79437935
),
7944-
didTimeout
7936+
lanes
79457937
);
79467938
break;
79477939
}
@@ -9822,19 +9814,19 @@ var slice = Array.prototype.slice,
98229814
};
98239815
return Text;
98249816
})(React.Component),
9825-
devToolsConfig$jscomp$inline_1165 = {
9817+
devToolsConfig$jscomp$inline_1167 = {
98269818
findFiberByHostInstance: function() {
98279819
return null;
98289820
},
98299821
bundleType: 0,
9830-
version: "18.3.0-www-classic-de7d1c907-20221223",
9822+
version: "18.3.0-www-classic-48274a43a-20230104",
98319823
rendererPackageName: "react-art"
98329824
};
9833-
var internals$jscomp$inline_1338 = {
9834-
bundleType: devToolsConfig$jscomp$inline_1165.bundleType,
9835-
version: devToolsConfig$jscomp$inline_1165.version,
9836-
rendererPackageName: devToolsConfig$jscomp$inline_1165.rendererPackageName,
9837-
rendererConfig: devToolsConfig$jscomp$inline_1165.rendererConfig,
9825+
var internals$jscomp$inline_1334 = {
9826+
bundleType: devToolsConfig$jscomp$inline_1167.bundleType,
9827+
version: devToolsConfig$jscomp$inline_1167.version,
9828+
rendererPackageName: devToolsConfig$jscomp$inline_1167.rendererPackageName,
9829+
rendererConfig: devToolsConfig$jscomp$inline_1167.rendererConfig,
98389830
overrideHookState: null,
98399831
overrideHookStateDeletePath: null,
98409832
overrideHookStateRenamePath: null,
@@ -9851,26 +9843,26 @@ var internals$jscomp$inline_1338 = {
98519843
return null === fiber ? null : fiber.stateNode;
98529844
},
98539845
findFiberByHostInstance:
9854-
devToolsConfig$jscomp$inline_1165.findFiberByHostInstance ||
9846+
devToolsConfig$jscomp$inline_1167.findFiberByHostInstance ||
98559847
emptyFindFiberByHostInstance,
98569848
findHostInstancesForRefresh: null,
98579849
scheduleRefresh: null,
98589850
scheduleRoot: null,
98599851
setRefreshHandler: null,
98609852
getCurrentFiber: null,
9861-
reconcilerVersion: "18.3.0-next-de7d1c907-20221223"
9853+
reconcilerVersion: "18.3.0-next-48274a43a-20230104"
98629854
};
98639855
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
9864-
var hook$jscomp$inline_1339 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
9856+
var hook$jscomp$inline_1335 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
98659857
if (
9866-
!hook$jscomp$inline_1339.isDisabled &&
9867-
hook$jscomp$inline_1339.supportsFiber
9858+
!hook$jscomp$inline_1335.isDisabled &&
9859+
hook$jscomp$inline_1335.supportsFiber
98689860
)
98699861
try {
9870-
(rendererID = hook$jscomp$inline_1339.inject(
9871-
internals$jscomp$inline_1338
9862+
(rendererID = hook$jscomp$inline_1335.inject(
9863+
internals$jscomp$inline_1334
98729864
)),
9873-
(injectedHook = hook$jscomp$inline_1339);
9865+
(injectedHook = hook$jscomp$inline_1335);
98749866
} catch (err) {}
98759867
}
98769868
var Path = Mode$1.Path;

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

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7657,25 +7657,17 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
76577657
markRootSuspended$1(root, lanes);
76587658
if (
76597659
(lanes & 125829120) === lanes &&
7660-
((didTimeout = globalMostRecentFallbackTime + 500 - now()),
7661-
10 < didTimeout)
7660+
((lanes = globalMostRecentFallbackTime + 500 - now()), 10 < lanes)
76627661
) {
76637662
if (0 !== getNextLanes(root, 0)) break;
7664-
originallyAttemptedLanes = root.suspendedLanes;
7665-
if ((originallyAttemptedLanes & lanes) !== lanes) {
7666-
requestEventTime();
7667-
root.pingedLanes |=
7668-
root.suspendedLanes & originallyAttemptedLanes;
7669-
break;
7670-
}
76717663
root.timeoutHandle = scheduleTimeout(
76727664
commitRoot.bind(
76737665
null,
76747666
root,
76757667
workInProgressRootRecoverableErrors,
76767668
workInProgressTransitions
76777669
),
7678-
didTimeout
7670+
lanes
76797671
);
76807672
break;
76817673
}
@@ -9489,19 +9481,19 @@ var slice = Array.prototype.slice,
94899481
};
94909482
return Text;
94919483
})(React.Component),
9492-
devToolsConfig$jscomp$inline_1154 = {
9484+
devToolsConfig$jscomp$inline_1156 = {
94939485
findFiberByHostInstance: function() {
94949486
return null;
94959487
},
94969488
bundleType: 0,
9497-
version: "18.3.0-www-modern-de7d1c907-20221223",
9489+
version: "18.3.0-www-modern-48274a43a-20230104",
94989490
rendererPackageName: "react-art"
94999491
};
9500-
var internals$jscomp$inline_1329 = {
9501-
bundleType: devToolsConfig$jscomp$inline_1154.bundleType,
9502-
version: devToolsConfig$jscomp$inline_1154.version,
9503-
rendererPackageName: devToolsConfig$jscomp$inline_1154.rendererPackageName,
9504-
rendererConfig: devToolsConfig$jscomp$inline_1154.rendererConfig,
9492+
var internals$jscomp$inline_1325 = {
9493+
bundleType: devToolsConfig$jscomp$inline_1156.bundleType,
9494+
version: devToolsConfig$jscomp$inline_1156.version,
9495+
rendererPackageName: devToolsConfig$jscomp$inline_1156.rendererPackageName,
9496+
rendererConfig: devToolsConfig$jscomp$inline_1156.rendererConfig,
95059497
overrideHookState: null,
95069498
overrideHookStateDeletePath: null,
95079499
overrideHookStateRenamePath: null,
@@ -9518,26 +9510,26 @@ var internals$jscomp$inline_1329 = {
95189510
return null === fiber ? null : fiber.stateNode;
95199511
},
95209512
findFiberByHostInstance:
9521-
devToolsConfig$jscomp$inline_1154.findFiberByHostInstance ||
9513+
devToolsConfig$jscomp$inline_1156.findFiberByHostInstance ||
95229514
emptyFindFiberByHostInstance,
95239515
findHostInstancesForRefresh: null,
95249516
scheduleRefresh: null,
95259517
scheduleRoot: null,
95269518
setRefreshHandler: null,
95279519
getCurrentFiber: null,
9528-
reconcilerVersion: "18.3.0-next-de7d1c907-20221223"
9520+
reconcilerVersion: "18.3.0-next-48274a43a-20230104"
95299521
};
95309522
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
9531-
var hook$jscomp$inline_1330 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
9523+
var hook$jscomp$inline_1326 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
95329524
if (
9533-
!hook$jscomp$inline_1330.isDisabled &&
9534-
hook$jscomp$inline_1330.supportsFiber
9525+
!hook$jscomp$inline_1326.isDisabled &&
9526+
hook$jscomp$inline_1326.supportsFiber
95359527
)
95369528
try {
9537-
(rendererID = hook$jscomp$inline_1330.inject(
9538-
internals$jscomp$inline_1329
9529+
(rendererID = hook$jscomp$inline_1326.inject(
9530+
internals$jscomp$inline_1325
95399531
)),
9540-
(injectedHook = hook$jscomp$inline_1330);
9532+
(injectedHook = hook$jscomp$inline_1326);
95419533
} catch (err) {}
95429534
}
95439535
var Path = Mode$1.Path;

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38776,18 +38776,6 @@ function finishConcurrentRender(root, exitStatus, lanes) {
3877638776
if (nextLanes !== NoLanes) {
3877738777
// There's additional work on this root.
3877838778
break;
38779-
}
38780-
38781-
var suspendedLanes = root.suspendedLanes;
38782-
38783-
if (!isSubsetOfLanes(suspendedLanes, lanes)) {
38784-
// We should prefer to render the fallback of at the last
38785-
// suspended level. Ping the last suspended level to try
38786-
// rendering it again.
38787-
// FIXME: What if the suspended lanes are Idle? Should not restart.
38788-
var eventTime = requestEventTime();
38789-
markRootPinged(root, suspendedLanes);
38790-
break;
3879138779
} // The render is suspended, it hasn't timed out, and there's no
3879238780
// lower priority work to do. Instead of committing the fallback
3879338781
// immediately, wait for more data to arrive.
@@ -42647,7 +42635,7 @@ function createFiberRoot(
4264742635
return root;
4264842636
}
4264942637

42650-
var ReactVersion = "18.3.0-www-classic-de7d1c907-20221223";
42638+
var ReactVersion = "18.3.0-www-classic-48274a43a-20230104";
4265142639

4265242640
function createPortal(
4265342641
children,

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38500,18 +38500,6 @@ function finishConcurrentRender(root, exitStatus, lanes) {
3850038500
if (nextLanes !== NoLanes) {
3850138501
// There's additional work on this root.
3850238502
break;
38503-
}
38504-
38505-
var suspendedLanes = root.suspendedLanes;
38506-
38507-
if (!isSubsetOfLanes(suspendedLanes, lanes)) {
38508-
// We should prefer to render the fallback of at the last
38509-
// suspended level. Ping the last suspended level to try
38510-
// rendering it again.
38511-
// FIXME: What if the suspended lanes are Idle? Should not restart.
38512-
var eventTime = requestEventTime();
38513-
markRootPinged(root, suspendedLanes);
38514-
break;
3851538503
} // The render is suspended, it hasn't timed out, and there's no
3851638504
// lower priority work to do. Instead of committing the fallback
3851738505
// immediately, wait for more data to arrive.
@@ -42371,7 +42359,7 @@ function createFiberRoot(
4237142359
return root;
4237242360
}
4237342361

42374-
var ReactVersion = "18.3.0-www-modern-de7d1c907-20221223";
42362+
var ReactVersion = "18.3.0-www-modern-48274a43a-20230104";
4237542363

4237642364
function createPortal(
4237742365
children,

0 commit comments

Comments
 (0)