@@ -171,6 +171,7 @@ import {
171171 hasDiscreteLanes ,
172172 includesNonIdleWork ,
173173 includesOnlyRetries ,
174+ includesOnlyTransitions ,
174175 getNextLanes ,
175176 returnNextLanesPriority ,
176177 setCurrentUpdateLanePriority ,
@@ -302,7 +303,6 @@ const subtreeRenderLanesCursor: StackCursor<Lanes> = createCursor(NoLanes);
302303let workInProgressRootExitStatus: RootExitStatus = RootIncomplete;
303304// A fatal error, if one is thrown
304305let workInProgressRootFatalError: mixed = null;
305- let workInProgressRootLatestSuspenseTimeout: number = NoTimestamp;
306306// "Included" lanes refer to lanes that were worked on during this render. It's
307307// slightly different than `renderLanes` because `renderLanes` can change as you
308308// enter and exit an Offscreen tree. This value is the combination of all render
@@ -322,7 +322,6 @@ let mostRecentlyUpdatedRoot: FiberRoot | null = null;
322322// model where we don't commit new loading states in too quick succession.
323323let globalMostRecentFallbackTime: number = 0;
324324const FALLBACK_THROTTLE_MS: number = 500;
325- const DEFAULT_TIMEOUT_MS: number = 5000;
326325
327326// The absolute time for when we should start giving up on rendering
328327// more and prefer CPU suspense heuristics instead.
@@ -922,12 +921,10 @@ function finishConcurrentRender(root, exitStatus, lanes) {
922921 case RootSuspendedWithDelay : {
923922 markRootSuspended ( root , lanes ) ;
924923
925- if ( workInProgressRootLatestSuspenseTimeout !== NoTimestamp ) {
924+ if ( includesOnlyTransitions ( lanes ) ) {
926925 // This is a transition, so we should exit without committing a
927926 // placeholder and without scheduling a timeout. Delay indefinitely
928927 // until we receive more data.
929- // TODO: Check the lanes to see if it's a transition, instead of
930- // tracking the latest timeout.
931928 break ;
932929 }
933930
@@ -1344,7 +1341,6 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes) {
13441341 workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
13451342 workInProgressRootExitStatus = RootIncomplete;
13461343 workInProgressRootFatalError = null;
1347- workInProgressRootLatestSuspenseTimeout = NoTimestamp;
13481344 workInProgressRootSkippedLanes = NoLanes;
13491345 workInProgressRootUpdatedLanes = NoLanes;
13501346 workInProgressRootPingedLanes = NoLanes;
@@ -1456,29 +1452,6 @@ export function markCommitTimeOfFallback() {
14561452 globalMostRecentFallbackTime = now ( ) ;
14571453}
14581454
1459- export function markRenderEventTimeAndConfig(
1460- eventTime: number,
1461- suspenseConfig: null | SuspenseConfig,
1462- ): void {
1463- // Track the largest/latest timeout deadline in this batch.
1464- // TODO: If there are two transitions in the same batch, shouldn't we
1465- // choose the smaller one? Maybe this is because when an intermediate
1466- // transition is superseded, we should ignore its suspense config, but
1467- // we don't currently.
1468- if ( suspenseConfig !== null ) {
1469- // If `timeoutMs` is not specified, we default to 5 seconds. We have to
1470- // resolve this default here because `suspenseConfig` is owned
1471- // by userspace.
1472- // TODO: Store this on the root instead (transition -> timeoutMs)
1473- // TODO: Should this default to a JND instead?
1474- const timeoutMs = suspenseConfig . timeoutMs | 0 || DEFAULT_TIMEOUT_MS ;
1475- const timeoutTime = eventTime + timeoutMs ;
1476- if ( timeoutTime > workInProgressRootLatestSuspenseTimeout ) {
1477- workInProgressRootLatestSuspenseTimeout = timeoutTime ;
1478- }
1479- }
1480- }
1481-
14821455export function markSkippedUpdateLanes(lane: Lane | Lanes): void {
14831456 workInProgressRootSkippedLanes = mergeLanes (
14841457 lane ,
0 commit comments