Skip to content

Commit

Permalink
Remove vestigial Suspense batching logic
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
acdlite committed Jan 4, 2023
1 parent de7d1c9 commit 652533d
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1300,16 +1300,6 @@ function finishConcurrentRender(root, exitStatus, lanes) {
// There's additional work on this root.
break;
}
const suspendedLanes = root.suspendedLanes;
if (!isSubsetOfLanes(suspendedLanes, lanes)) {
// We should prefer to render the fallback of at the last
// suspended level. Ping the last suspended level to try
// rendering it again.
// FIXME: What if the suspended lanes are Idle? Should not restart.
const eventTime = requestEventTime();
markRootPinged(root, suspendedLanes, eventTime);
break;
}

// The render is suspended, it hasn't timed out, and there's no
// lower priority work to do. Instead of committing the fallback
Expand Down

0 comments on commit 652533d

Please sign in to comment.