diff --git a/packages/react-reconciler/src/__tests__/ReactExpiration-test.js b/packages/react-reconciler/src/__tests__/ReactExpiration-test.js index 72ca257fef..beaa511f5a 100644 --- a/packages/react-reconciler/src/__tests__/ReactExpiration-test.js +++ b/packages/react-reconciler/src/__tests__/ReactExpiration-test.js @@ -508,13 +508,9 @@ describe('ReactExpiration', () => { // First demonstrate what happens when there's no starvation await act(async () => { - if (gate(flags => flags.enableSyncDefaultUpdates)) { - React.startTransition(() => { - updateNormalPri(); - }); - } else { + React.startTransition(() => { updateNormalPri(); - } + }); expect(Scheduler).toFlushAndYieldThrough(['Sync pri: 0']); updateSyncPri(); expect(Scheduler).toHaveYielded(['Sync pri: 1', 'Normal pri: 0']); @@ -532,13 +528,9 @@ describe('ReactExpiration', () => { // Do the same thing, but starve the first update await act(async () => { - if (gate(flags => flags.enableSyncDefaultUpdates)) { - React.startTransition(() => { - updateNormalPri(); - }); - } else { + React.startTransition(() => { updateNormalPri(); - } + }); expect(Scheduler).toFlushAndYieldThrough(['Sync pri: 1']); // This time, a lot of time has elapsed since the normal pri update diff --git a/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js b/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js index ac6f312e5d..8e689ce38f 100644 --- a/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js +++ b/packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js @@ -171,15 +171,10 @@ describe('ReactHooksWithNoopRenderer', () => { // Schedule some updates act(() => { - if (gate(flags => flags.enableSyncDefaultUpdates)) { - React.startTransition(() => { - counter.current.updateCount(1); - counter.current.updateCount(count => count + 10); - }); - } else { + React.startTransition(() => { counter.current.updateCount(1); counter.current.updateCount(count => count + 10); - } + }); // Partially flush without committing expect(Scheduler).toFlushAndYieldThrough(['Count: 11']); @@ -815,13 +810,9 @@ describe('ReactHooksWithNoopRenderer', () => { ReactNoop.discreteUpdates(() => { setRow(5); }); - if (gate(flags => flags.enableSyncDefaultUpdates)) { - React.startTransition(() => { - setRow(20); - }); - } else { + React.startTransition(() => { setRow(20); - } + }); }); expect(Scheduler).toHaveYielded(['Up', 'Down']); expect(root).toMatchRenderedOutput(); diff --git a/packages/react-reconciler/src/__tests__/ReactIncremental-test.js b/packages/react-reconciler/src/__tests__/ReactIncremental-test.js index 8b6226888b..0316744dde 100644 --- a/packages/react-reconciler/src/__tests__/ReactIncremental-test.js +++ b/packages/react-reconciler/src/__tests__/ReactIncremental-test.js @@ -215,17 +215,7 @@ describe('ReactIncremental', () => { ReactNoop.render(); expect(Scheduler).toFlushWithoutYielding(); - if (gate(flags => flags.enableSyncDefaultUpdates)) { - React.startTransition(() => { - inst.setState( - () => { - Scheduler.unstable_yieldValue('setState1'); - return {text: 'bar'}; - }, - () => Scheduler.unstable_yieldValue('callback1'), - ); - }); - } else { + React.startTransition(() => { inst.setState( () => { Scheduler.unstable_yieldValue('setState1'); @@ -233,24 +223,14 @@ describe('ReactIncremental', () => { }, () => Scheduler.unstable_yieldValue('callback1'), ); - } + }); // Flush part of the work expect(Scheduler).toFlushAndYieldThrough(['setState1']); // This will abort the previous work and restart ReactNoop.flushSync(() => ReactNoop.render()); - if (gate(flags => flags.enableSyncDefaultUpdates)) { - React.startTransition(() => { - inst.setState( - () => { - Scheduler.unstable_yieldValue('setState2'); - return {text2: 'baz'}; - }, - () => Scheduler.unstable_yieldValue('callback2'), - ); - }); - } else { + React.startTransition(() => { inst.setState( () => { Scheduler.unstable_yieldValue('setState2'); @@ -258,7 +238,7 @@ describe('ReactIncremental', () => { }, () => Scheduler.unstable_yieldValue('callback2'), ); - } + }); // Flush the rest of the work which now includes the low priority expect(Scheduler).toFlushAndYield([ diff --git a/packages/react-reconciler/src/__tests__/ReactSuspenseList-test.js b/packages/react-reconciler/src/__tests__/ReactSuspenseList-test.js index b7cdc19d63..cbfb8f8996 100644 --- a/packages/react-reconciler/src/__tests__/ReactSuspenseList-test.js +++ b/packages/react-reconciler/src/__tests__/ReactSuspenseList-test.js @@ -2549,13 +2549,9 @@ describe('ReactSuspenseList', () => { await act(async () => { // Add a few items at the end. - if (gate(flags => flags.enableSyncDefaultUpdates)) { - React.startTransition(() => { - updateLowPri(true); - }); - } else { + React.startTransition(() => { updateLowPri(true); - } + }); // Flush partially through. expect(Scheduler).toFlushAndYieldThrough(['B', 'C']); diff --git a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js index 9d95a57572..8652e3c3db 100644 --- a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js +++ b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js @@ -3796,7 +3796,6 @@ describe('ReactSuspenseWithNoopRenderer', () => { }); // @gate enableLegacyCache - // @gate !enableSyncDefaultUpdates it('regression: ping at high priority causes update to be dropped', async () => { const {useState, useTransition} = React; @@ -3863,10 +3862,9 @@ describe('ReactSuspenseWithNoopRenderer', () => { }); expect(Scheduler).toFlushAndYield([ - 'B', 'Suspend! [A1]', 'Loading...', - + 'B', 'Suspend! [A2]', 'Loading...', 'Suspend! [B2]', @@ -3882,6 +3880,7 @@ describe('ReactSuspenseWithNoopRenderer', () => { await resolveText('A1'); expect(Scheduler).toFlushAndYield([ 'A1', + 'B', 'Suspend! [A2]', 'Loading...', 'Suspend! [B2]', diff --git a/packages/react-reconciler/src/__tests__/useMutableSource-test.internal.js b/packages/react-reconciler/src/__tests__/useMutableSource-test.internal.js index ef452cc581..a1d5912ebc 100644 --- a/packages/react-reconciler/src/__tests__/useMutableSource-test.internal.js +++ b/packages/react-reconciler/src/__tests__/useMutableSource-test.internal.js @@ -454,13 +454,9 @@ describe('useMutableSource', () => { // Changing values should schedule an update with React. // Start working on this update but don't finish it. - if (gate(flags => flags.enableSyncDefaultUpdates)) { - React.startTransition(() => { - source.value = 'two'; - }); - } else { + React.startTransition(() => { source.value = 'two'; - } + }); expect(Scheduler).toFlushAndYieldThrough(['a:two']); // Re-renders that occur before the update is processed diff --git a/packages/react/src/__tests__/ReactProfiler-test.internal.js b/packages/react/src/__tests__/ReactProfiler-test.internal.js index 3d7e061851..197aa4100c 100644 --- a/packages/react/src/__tests__/ReactProfiler-test.internal.js +++ b/packages/react/src/__tests__/ReactProfiler-test.internal.js @@ -1065,13 +1065,9 @@ describe(`onRender`, () => { // Render a partially update, but don't finish. // This partial render will take 10ms of actual render time. - if (gate(flags => flags.enableSyncDefaultUpdates)) { - React.startTransition(() => { - first.setState({renderTime: 10}); - }); - } else { + React.startTransition(() => { first.setState({renderTime: 10}); - } + }); expect(Scheduler).toFlushAndYieldThrough(['FirstComponent:10']); expect(callback).toHaveBeenCalledTimes(0); diff --git a/packages/use-subscription/src/__tests__/useSubscription-test.js b/packages/use-subscription/src/__tests__/useSubscription-test.js index 4ce88b8134..89ec3327c7 100644 --- a/packages/use-subscription/src/__tests__/useSubscription-test.js +++ b/packages/use-subscription/src/__tests__/useSubscription-test.js @@ -439,13 +439,9 @@ describe('useSubscription', () => { // Start React update, but don't finish act(() => { - if (gate(flags => flags.enableSyncDefaultUpdates)) { - React.startTransition(() => { - renderer.update(); - }); - } else { + React.startTransition(() => { renderer.update(); - } + }); expect(Scheduler).toFlushAndYieldThrough(['Child: b-0']); expect(log).toEqual([]);