dillon1000/react

Commit

Don't shift interleaved updates to separate lane (#20681)

Now that interleaved updates are added to a special queue, we no longer
need to shift them into their own lane. We can add to a lane that's
already in the middle of rendering without risk of tearing.

See #20615 for more background.

I've only changed this in the new fork, and only behind the
enableTransitionEntanglements flag.

Most of this commit involves updating tests. The "shift-to-a-new" lane
trick was intentionally used in a handful of tests where two or more
updates need to be scheduled in different lanes. Most of these tests
were written before `startTransition` existed, and all of them were
written before transitions were assigned arbitrary lanes.

So I ported these tests to use `startTransition` instead, which is the
idiomatic way to mark an update as parallel.

I didn't change the old fork at all. Writing these tests in such a way
that they also pass in the old fork actually revealed a few flaws in the
current implementation regarding interrupting a suspended refresh
transition early, which is a good reminder that we should be writing our
tests using idiomatic patterns as much as we possibly can.
Browse files
Changed paths15 files
First-parent comparison
M packages/react-reconciler/src/ReactFiberHooks.new.js ModifiedM packages/react-reconciler/src/ReactFiberHooks.old.js ModifiedM packages/react-reconciler/src/ReactFiberLane.new.js ModifiedM packages/react-reconciler/src/ReactFiberLane.old.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.new.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.old.js ModifiedM packages/react-reconciler/src/ReactUpdateQueue.new.js ModifiedM packages/react-reconciler/src/ReactUpdateQueue.old.js ModifiedM packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js ModifiedM packages/react-reconciler/src/__tests__/ReactExpiration-test.js ModifiedM packages/react-reconciler/src/__tests__/ReactSchedulerIntegration-test.js ModifiedM packages/react-reconciler/src/__tests__/ReactSuspense-test.internal.js ModifiedM packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js ModifiedM packages/react-reconciler/src/__tests__/ReactTransition-test.js ModifiedM packages/react-reconciler/src/__tests__/SchedulingProfiler-test.internal.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…