From eb86bbb3aafcb27ee640f6a8182cae0cda4d81b4 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Tue, 9 Feb 2021 15:14:55 -0600 Subject: [PATCH] Lane enableTransitionEntanglement flag --- .../src/ReactFiberLane.new.js | 109 ++++-------------- .../src/ReactFiberLane.old.js | 109 ++++-------------- .../src/ReactFiberWorkLoop.new.js | 44 +------ .../src/ReactFiberWorkLoop.old.js | 44 +------ .../__tests__/DebugTracing-test.internal.js | 51 +++----- .../ReactSuspenseWithNoopRenderer-test.js | 43 ++----- .../SchedulingProfiler-test.internal.js | 25 +--- packages/shared/ReactFeatureFlags.js | 3 - .../forks/ReactFeatureFlags.native-fb.js | 3 + .../forks/ReactFeatureFlags.native-oss.js | 1 - .../forks/ReactFeatureFlags.test-renderer.js | 1 - .../ReactFeatureFlags.test-renderer.native.js | 1 - .../ReactFeatureFlags.test-renderer.www.js | 1 - .../shared/forks/ReactFeatureFlags.testing.js | 1 - .../forks/ReactFeatureFlags.testing.www.js | 1 - .../forks/ReactFeatureFlags.www-dynamic.js | 1 - .../shared/forks/ReactFeatureFlags.www.js | 1 - 17 files changed, 87 insertions(+), 352 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberLane.new.js b/packages/react-reconciler/src/ReactFiberLane.new.js index 309a5335b14ef..01714838b0a98 100644 --- a/packages/react-reconciler/src/ReactFiberLane.new.js +++ b/packages/react-reconciler/src/ReactFiberLane.new.js @@ -38,7 +38,6 @@ export type LaneMap = Array; import invariant from 'shared/invariant'; import { enableCache, - enableTransitionEntanglement, enableNonInterruptingNormalPri, } from 'shared/ReactFeatureFlags'; @@ -509,93 +508,33 @@ export function isTransitionLane(lane: Lane) { // To ensure consistency across multiple updates in the same event, this should // be a pure function, so that it always returns the same lane for given inputs. -export function findUpdateLane( - lanePriority: LanePriority, - wipLanes: Lanes, -): Lane { - if (enableTransitionEntanglement) { - // Ignore wipLanes. Always assign to the same bit per priority. - switch (lanePriority) { - case NoLanePriority: - break; - case SyncLanePriority: - return SyncLane; - case SyncBatchedLanePriority: - return SyncBatchedLane; - case InputDiscreteLanePriority: { - return pickArbitraryLane(InputDiscreteLanes); - } - case InputContinuousLanePriority: { - return pickArbitraryLane(InputContinuousLanes); - } - case DefaultLanePriority: { - return pickArbitraryLane(DefaultLanes); - } - case TransitionPriority: // Should be handled by findTransitionLane instead - case RetryLanePriority: // Should be handled by findRetryLane instead - break; - case IdleLanePriority: - return pickArbitraryLane(IdleLanes); - default: - // The remaining priorities are not valid for updates - break; +export function findUpdateLane(lanePriority: LanePriority): Lane { + switch (lanePriority) { + case NoLanePriority: + break; + case SyncLanePriority: + return SyncLane; + case SyncBatchedLanePriority: + return SyncBatchedLane; + case InputDiscreteLanePriority: { + return pickArbitraryLane(InputDiscreteLanes); } - } else { - // Old behavior that uses wipLanes to shift interleaved updates into a - // separate lane. This is no longer needed because we put interleaved - // updates on a special queue. - switch (lanePriority) { - case NoLanePriority: - break; - case SyncLanePriority: - return SyncLane; - case SyncBatchedLanePriority: - return SyncBatchedLane; - case InputDiscreteLanePriority: { - const lane = pickArbitraryLane(InputDiscreteLanes & ~wipLanes); - if (lane === NoLane) { - // Shift to the next priority level - return findUpdateLane(InputContinuousLanePriority, wipLanes); - } - return lane; - } - case InputContinuousLanePriority: { - const lane = pickArbitraryLane(InputContinuousLanes & ~wipLanes); - if (lane === NoLane) { - // Shift to the next priority level - return findUpdateLane(DefaultLanePriority, wipLanes); - } - return lane; - } - case DefaultLanePriority: { - let lane = pickArbitraryLane(DefaultLanes & ~wipLanes); - if (lane === NoLane) { - // If all the default lanes are already being worked on, look for a - // lane in the transition range. - lane = pickArbitraryLane(TransitionLanes & ~wipLanes); - if (lane === NoLane) { - // All the transition lanes are taken, too. This should be very - // rare, but as a last resort, pick a default lane. This will have - // the effect of interrupting the current work-in-progress render. - lane = pickArbitraryLane(DefaultLanes); - } - } - return lane; - } - case TransitionPriority: // Should be handled by findTransitionLane instead - case RetryLanePriority: // Should be handled by findRetryLane instead - break; - case IdleLanePriority: - let lane = pickArbitraryLane(IdleLanes & ~wipLanes); - if (lane === NoLane) { - lane = pickArbitraryLane(IdleLanes); - } - return lane; - default: - // The remaining priorities are not valid for updates - break; + case InputContinuousLanePriority: { + return pickArbitraryLane(InputContinuousLanes); } + case DefaultLanePriority: { + return pickArbitraryLane(DefaultLanes); + } + case TransitionPriority: // Should be handled by findTransitionLane instead + case RetryLanePriority: // Should be handled by findRetryLane instead + break; + case IdleLanePriority: + return pickArbitraryLane(IdleLanes); + default: + // The remaining priorities are not valid for updates + break; } + invariant( false, 'Invalid update priority: %s. This is a bug in React.', diff --git a/packages/react-reconciler/src/ReactFiberLane.old.js b/packages/react-reconciler/src/ReactFiberLane.old.js index c62fa08c6c30b..f46ba4389454f 100644 --- a/packages/react-reconciler/src/ReactFiberLane.old.js +++ b/packages/react-reconciler/src/ReactFiberLane.old.js @@ -38,7 +38,6 @@ export type LaneMap = Array; import invariant from 'shared/invariant'; import { enableCache, - enableTransitionEntanglement, enableNonInterruptingNormalPri, } from 'shared/ReactFeatureFlags'; @@ -509,93 +508,33 @@ export function isTransitionLane(lane: Lane) { // To ensure consistency across multiple updates in the same event, this should // be a pure function, so that it always returns the same lane for given inputs. -export function findUpdateLane( - lanePriority: LanePriority, - wipLanes: Lanes, -): Lane { - if (enableTransitionEntanglement) { - // Ignore wipLanes. Always assign to the same bit per priority. - switch (lanePriority) { - case NoLanePriority: - break; - case SyncLanePriority: - return SyncLane; - case SyncBatchedLanePriority: - return SyncBatchedLane; - case InputDiscreteLanePriority: { - return pickArbitraryLane(InputDiscreteLanes); - } - case InputContinuousLanePriority: { - return pickArbitraryLane(InputContinuousLanes); - } - case DefaultLanePriority: { - return pickArbitraryLane(DefaultLanes); - } - case TransitionPriority: // Should be handled by findTransitionLane instead - case RetryLanePriority: // Should be handled by findRetryLane instead - break; - case IdleLanePriority: - return pickArbitraryLane(IdleLanes); - default: - // The remaining priorities are not valid for updates - break; +export function findUpdateLane(lanePriority: LanePriority): Lane { + switch (lanePriority) { + case NoLanePriority: + break; + case SyncLanePriority: + return SyncLane; + case SyncBatchedLanePriority: + return SyncBatchedLane; + case InputDiscreteLanePriority: { + return pickArbitraryLane(InputDiscreteLanes); } - } else { - // Old behavior that uses wipLanes to shift interleaved updates into a - // separate lane. This is no longer needed because we put interleaved - // updates on a special queue. - switch (lanePriority) { - case NoLanePriority: - break; - case SyncLanePriority: - return SyncLane; - case SyncBatchedLanePriority: - return SyncBatchedLane; - case InputDiscreteLanePriority: { - const lane = pickArbitraryLane(InputDiscreteLanes & ~wipLanes); - if (lane === NoLane) { - // Shift to the next priority level - return findUpdateLane(InputContinuousLanePriority, wipLanes); - } - return lane; - } - case InputContinuousLanePriority: { - const lane = pickArbitraryLane(InputContinuousLanes & ~wipLanes); - if (lane === NoLane) { - // Shift to the next priority level - return findUpdateLane(DefaultLanePriority, wipLanes); - } - return lane; - } - case DefaultLanePriority: { - let lane = pickArbitraryLane(DefaultLanes & ~wipLanes); - if (lane === NoLane) { - // If all the default lanes are already being worked on, look for a - // lane in the transition range. - lane = pickArbitraryLane(TransitionLanes & ~wipLanes); - if (lane === NoLane) { - // All the transition lanes are taken, too. This should be very - // rare, but as a last resort, pick a default lane. This will have - // the effect of interrupting the current work-in-progress render. - lane = pickArbitraryLane(DefaultLanes); - } - } - return lane; - } - case TransitionPriority: // Should be handled by findTransitionLane instead - case RetryLanePriority: // Should be handled by findRetryLane instead - break; - case IdleLanePriority: - let lane = pickArbitraryLane(IdleLanes & ~wipLanes); - if (lane === NoLane) { - lane = pickArbitraryLane(IdleLanes); - } - return lane; - default: - // The remaining priorities are not valid for updates - break; + case InputContinuousLanePriority: { + return pickArbitraryLane(InputContinuousLanes); } + case DefaultLanePriority: { + return pickArbitraryLane(DefaultLanes); + } + case TransitionPriority: // Should be handled by findTransitionLane instead + case RetryLanePriority: // Should be handled by findRetryLane instead + break; + case IdleLanePriority: + return pickArbitraryLane(IdleLanes); + default: + // The remaining priorities are not valid for updates + break; } + invariant( false, 'Invalid update priority: %s. This is a bug in React.', diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index 234ca61fe93f1..490a195e1b78a 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -34,7 +34,6 @@ import { disableSchedulerTimeoutInWorkLoop, enableDoubleInvokingEffects, skipUnmountedBoundaries, - enableTransitionEntanglement, enableNativeEventPriorityInference, } from 'shared/ReactFeatureFlags'; import ReactSharedInternals from 'shared/ReactSharedInternals'; @@ -455,22 +454,22 @@ export function requestUpdateLane(fiber: Fiber): Lane { (executionContext & DiscreteEventContext) !== NoContext && schedulerPriority === UserBlockingSchedulerPriority ) { - lane = findUpdateLane(InputDiscreteLanePriority, currentEventWipLanes); + lane = findUpdateLane(InputDiscreteLanePriority); } else if ( decoupleUpdatePriorityFromScheduler && getCurrentUpdateLanePriority() !== NoLanePriority ) { const currentLanePriority = getCurrentUpdateLanePriority(); - lane = findUpdateLane(currentLanePriority, currentEventWipLanes); + lane = findUpdateLane(currentLanePriority); } else { if (enableNativeEventPriorityInference) { const eventLanePriority = getCurrentEventPriority(); - lane = findUpdateLane(eventLanePriority, currentEventWipLanes); + lane = findUpdateLane(eventLanePriority); } else { const schedulerLanePriority = schedulerPriorityToLanePriority( schedulerPriority, ); - lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes); + lane = findUpdateLane(schedulerLanePriority); } } @@ -837,22 +836,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } let exitStatus = renderRootConcurrent(root, lanes); - - if ( - !enableTransitionEntanglement && - includesSomeLane( - workInProgressRootIncludedLanes, - workInProgressRootUpdatedLanes, - ) - ) { - // The render included lanes that were updated during the render phase. - // For example, when unhiding a hidden tree, we include all the lanes - // that were previously skipped when the tree was hidden. That set of - // lanes is a superset of the lanes we started rendering with. - // - // So we'll throw out the current work and restart. - prepareFreshStack(root, NoLanes); - } else if (exitStatus !== RootIncomplete) { + if (exitStatus !== RootIncomplete) { if (exitStatus === RootErrored) { executionContext |= RetryAfterError; @@ -1044,24 +1028,6 @@ function performSyncWorkOnRoot(root) { // rendering it before rendering the rest of the expired work. lanes = workInProgressRootRenderLanes; exitStatus = renderRootSync(root, lanes); - if ( - !enableTransitionEntanglement && - includesSomeLane( - workInProgressRootIncludedLanes, - workInProgressRootUpdatedLanes, - ) - ) { - // The render included lanes that were updated during the render phase. - // For example, when unhiding a hidden tree, we include all the lanes - // that were previously skipped when the tree was hidden. That set of - // lanes is a superset of the lanes we started rendering with. - // - // Note that this only happens when part of the tree is rendered - // concurrently. If the whole tree is rendered synchronously, then there - // are no interleaved events. - lanes = getNextLanes(root, lanes); - exitStatus = renderRootSync(root, lanes); - } } else { lanes = getNextLanes(root, NoLanes); exitStatus = renderRootSync(root, lanes); diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js index 242744acadd43..f7ae0f9a94019 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js @@ -34,7 +34,6 @@ import { disableSchedulerTimeoutInWorkLoop, enableDoubleInvokingEffects, skipUnmountedBoundaries, - enableTransitionEntanglement, enableNativeEventPriorityInference, } from 'shared/ReactFeatureFlags'; import ReactSharedInternals from 'shared/ReactSharedInternals'; @@ -455,22 +454,22 @@ export function requestUpdateLane(fiber: Fiber): Lane { (executionContext & DiscreteEventContext) !== NoContext && schedulerPriority === UserBlockingSchedulerPriority ) { - lane = findUpdateLane(InputDiscreteLanePriority, currentEventWipLanes); + lane = findUpdateLane(InputDiscreteLanePriority); } else if ( decoupleUpdatePriorityFromScheduler && getCurrentUpdateLanePriority() !== NoLanePriority ) { const currentLanePriority = getCurrentUpdateLanePriority(); - lane = findUpdateLane(currentLanePriority, currentEventWipLanes); + lane = findUpdateLane(currentLanePriority); } else { if (enableNativeEventPriorityInference) { const eventLanePriority = getCurrentEventPriority(); - lane = findUpdateLane(eventLanePriority, currentEventWipLanes); + lane = findUpdateLane(eventLanePriority); } else { const schedulerLanePriority = schedulerPriorityToLanePriority( schedulerPriority, ); - lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes); + lane = findUpdateLane(schedulerLanePriority); } } @@ -837,22 +836,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } let exitStatus = renderRootConcurrent(root, lanes); - - if ( - !enableTransitionEntanglement && - includesSomeLane( - workInProgressRootIncludedLanes, - workInProgressRootUpdatedLanes, - ) - ) { - // The render included lanes that were updated during the render phase. - // For example, when unhiding a hidden tree, we include all the lanes - // that were previously skipped when the tree was hidden. That set of - // lanes is a superset of the lanes we started rendering with. - // - // So we'll throw out the current work and restart. - prepareFreshStack(root, NoLanes); - } else if (exitStatus !== RootIncomplete) { + if (exitStatus !== RootIncomplete) { if (exitStatus === RootErrored) { executionContext |= RetryAfterError; @@ -1044,24 +1028,6 @@ function performSyncWorkOnRoot(root) { // rendering it before rendering the rest of the expired work. lanes = workInProgressRootRenderLanes; exitStatus = renderRootSync(root, lanes); - if ( - !enableTransitionEntanglement && - includesSomeLane( - workInProgressRootIncludedLanes, - workInProgressRootUpdatedLanes, - ) - ) { - // The render included lanes that were updated during the render phase. - // For example, when unhiding a hidden tree, we include all the lanes - // that were previously skipped when the tree was hidden. That set of - // lanes is a superset of the lanes we started rendering with. - // - // Note that this only happens when part of the tree is rendered - // concurrently. If the whole tree is rendered synchronously, then there - // are no interleaved events. - lanes = getNextLanes(root, lanes); - exitStatus = renderRootSync(root, lanes); - } } else { lanes = getNextLanes(root, NoLanes); exitStatus = renderRootSync(root, lanes); diff --git a/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js b/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js index 2cf0837cfef6f..0fd0a6722d517 100644 --- a/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js +++ b/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js @@ -276,23 +276,12 @@ describe('DebugTracing', () => { expect(Scheduler).toFlushUntilNextPaint([]); }).toErrorDev('Cannot update during an existing state transition'); - gate(flags => { - if (flags.new) { - expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', - 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', - ]); - } else { - expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000010000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000010000000000)', - 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', - ]); - } - }); + expect(logs).toEqual([ + 'group: ⚛️ render (0b0000000000000000000001000000000)', + 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', + 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', + 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', + ]); }); // @gate experimental && build === 'development' && enableDebugTracing @@ -327,9 +316,6 @@ describe('DebugTracing', () => { ]); }); - // This test is coupled to lane implementation details, so I'm disabling it - // until it stabilizes so we don't have to repeatedly update it. - // @gate !enableTransitionEntanglement // @gate experimental && build === 'development' && enableDebugTracing it('should log cascading passive updates', () => { function Example() { @@ -350,7 +336,7 @@ describe('DebugTracing', () => { }); expect(logs).toEqual([ 'group: ⚛️ passive effects (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000010000000000)', + 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', 'groupEnd: ⚛️ passive effects (0b0000000000000000000001000000000)', ]); }); @@ -374,23 +360,12 @@ describe('DebugTracing', () => { ); }); - gate(flags => { - if (flags.new) { - expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', // debugRenderPhaseSideEffectsForStrictMode - 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', - ]); - } else { - expect(logs).toEqual([ - 'group: ⚛️ render (0b0000000000000000000001000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000010000000000)', - 'log: ⚛️ Example updated state (0b0000000000000000000010000000000)', // debugRenderPhaseSideEffectsForStrictMode - 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', - ]); - } - }); + expect(logs).toEqual([ + 'group: ⚛️ render (0b0000000000000000000001000000000)', + 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', + 'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', // debugRenderPhaseSideEffectsForStrictMode + 'groupEnd: ⚛️ render (0b0000000000000000000001000000000)', + ]); }); // @gate experimental && build === 'development' && enableDebugTracing diff --git a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js index 901be8f1a6ad8..20971e9f58e91 100644 --- a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js +++ b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js @@ -589,7 +589,8 @@ describe('ReactSuspenseWithNoopRenderer', () => { // Note: This test was written to test a heuristic used in the expiration // times model. Might not make sense in the new model. - // @gate enableCache || enableTransitionEntanglement + // TODO: This test doesn't over what it was originally designed to test. + // Either rewrite or delete. it('tries each subsequent level after suspending', async () => { const root = ReactNoop.createRoot(); @@ -642,26 +643,7 @@ describe('ReactSuspenseWithNoopRenderer', () => { root.render(); }); - if (gate(flags => flags.enableTransitionEntanglement)) { - expect(Scheduler).toHaveYielded(['Sibling', 'Step 4']); - } else { - // Old implementation - expect(Scheduler).toHaveYielded([ - 'Sibling', - - // NOTE: The final of the update got pushed into a lower priority range of - // lanes, leading to the extra intermediate render. This is because when - // we schedule the fourth update, we're already in the middle of rendering - // the three others. Since there are only three lanes in the default - // range, the fourth lane is shifted to slightly lower priority. This - // could easily change when we tweak our batching heuristics. Ideally, - // they'd all have default priority and render in a single batch. - 'Suspend! [Step 3]', - 'Sibling', - - 'Step 4', - ]); - } + expect(Scheduler).toHaveYielded(['Sibling', 'Step 4']); }); // @gate enableCache @@ -2798,21 +2780,10 @@ describe('ReactSuspenseWithNoopRenderer', () => { foo.setState({suspend: false}); }); - if (gate(flags => flags.enableTransitionEntanglement)) { - expect(Scheduler).toHaveYielded([ - // First setState - 'Foo', - ]); - } else { - expect(Scheduler).toHaveYielded([ - // First setState - 'Foo', - // Second setState. This update was scheduled while we were in the - // middle of rendering the previous update, so it was pushed to a separate - // batch to avoid invalidating the work-in-progress tree. - 'Foo', - ]); - } + expect(Scheduler).toHaveYielded([ + // First setState + 'Foo', + ]); expect(root).toMatchRenderedOutput(); }); diff --git a/packages/react-reconciler/src/__tests__/SchedulingProfiler-test.internal.js b/packages/react-reconciler/src/__tests__/SchedulingProfiler-test.internal.js index 65459ecd33681..433f312fc7095 100644 --- a/packages/react-reconciler/src/__tests__/SchedulingProfiler-test.internal.js +++ b/packages/react-reconciler/src/__tests__/SchedulingProfiler-test.internal.js @@ -399,11 +399,7 @@ describe('SchedulingProfiler', () => { expect(Scheduler).toFlushUntilNextPaint([]); }).toErrorDev('Cannot update during an existing state transition'); - gate(({old}) => - old - ? expectMarksToContain('--schedule-state-update-1024-Example') - : expectMarksToContain('--schedule-state-update-512-Example'), - ); + expectMarksToContain('--schedule-state-update-512-Example'); }); // @gate enableSchedulingProfiler @@ -431,11 +427,7 @@ describe('SchedulingProfiler', () => { expect(Scheduler).toFlushUntilNextPaint([]); }).toErrorDev('Cannot update during an existing state transition'); - gate(({old}) => - old - ? expectMarksToContain('--schedule-forced-update-1024-Example') - : expectMarksToContain('--schedule-forced-update-512-Example'), - ); + expectMarksToContain('--schedule-forced-update-512-Example'); }); // @gate enableSchedulingProfiler @@ -476,7 +468,6 @@ describe('SchedulingProfiler', () => { // This test is coupled to lane implementation details, so I'm disabling it in // the new fork until it stabilizes so we don't have to repeatedly update it. - // @gate !enableTransitionEntanglement // @gate enableSchedulingProfiler it('should mark cascading passive updates', () => { function Example() { @@ -501,11 +492,11 @@ describe('SchedulingProfiler', () => { '--layout-effects-stop', '--commit-stop', '--passive-effects-start-512', - '--schedule-state-update-1024-Example', + '--schedule-state-update-512-Example', '--passive-effects-stop', - '--render-start-1024', + '--render-start-512', '--render-stop', - '--commit-start-1024', + '--commit-start-512', '--commit-stop', ]); }); @@ -524,10 +515,6 @@ describe('SchedulingProfiler', () => { ReactTestRenderer.create(, {unstable_isConcurrent: true}); }); - gate(({old}) => - old - ? expectMarksToContain('--schedule-state-update-1024-Example') - : expectMarksToContain('--schedule-state-update-512-Example'), - ); + expectMarksToContain('--schedule-state-update-512-Example'); }); }); diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 7cdc95842f31e..3d0362f4b3fcd 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -147,9 +147,6 @@ export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; -// Experiment to simplify/improve how transitions are scheduled -export const enableTransitionEntanglement = false; - export const enableNonInterruptingNormalPri = false; export const enableDiscreteEventMicroTasks = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js index f79ea1e94881b..95185dc252b54 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-fb.js +++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js @@ -57,8 +57,11 @@ export const enableUseRefAccessWarning = false; export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; +<<<<<<< current export const enableTransitionEntanglement = false; export const enableNonInterruptingNormalPri = false; +======= +>>>>>>> patched export const enableDiscreteEventMicroTasks = false; export const enableNativeEventPriorityInference = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-oss.js b/packages/shared/forks/ReactFeatureFlags.native-oss.js index cdb661749bf28..9d160790b3fec 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-oss.js +++ b/packages/shared/forks/ReactFeatureFlags.native-oss.js @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false; export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; -export const enableTransitionEntanglement = false; export const enableNonInterruptingNormalPri = false; export const enableDiscreteEventMicroTasks = false; export const enableNativeEventPriorityInference = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js index c1d46ee7cb5b9..52990e5ec7b71 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false; export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; -export const enableTransitionEntanglement = false; export const enableNonInterruptingNormalPri = false; export const enableDiscreteEventMicroTasks = false; export const enableNativeEventPriorityInference = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js index e7a7b260a5735..3c739b7bccb39 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false; export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; -export const enableTransitionEntanglement = false; export const enableNonInterruptingNormalPri = false; export const enableDiscreteEventMicroTasks = false; export const enableNativeEventPriorityInference = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js index df8da1a9f50d8..fb2211763c03d 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false; export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; -export const enableTransitionEntanglement = false; export const enableNonInterruptingNormalPri = false; export const enableDiscreteEventMicroTasks = false; export const enableNativeEventPriorityInference = false; diff --git a/packages/shared/forks/ReactFeatureFlags.testing.js b/packages/shared/forks/ReactFeatureFlags.testing.js index 48f85d5c689d5..34e6d5315742f 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.js @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false; export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; -export const enableTransitionEntanglement = false; export const enableNonInterruptingNormalPri = false; export const enableDiscreteEventMicroTasks = false; export const enableNativeEventPriorityInference = false; diff --git a/packages/shared/forks/ReactFeatureFlags.testing.www.js b/packages/shared/forks/ReactFeatureFlags.testing.www.js index db706abb2e8f5..4f0c56733eafd 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.www.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.www.js @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false; export const enableRecursiveCommitTraversal = false; export const disableSchedulerTimeoutInWorkLoop = false; -export const enableTransitionEntanglement = false; export const enableNonInterruptingNormalPri = false; export const enableDiscreteEventMicroTasks = false; export const enableNativeEventPriorityInference = false; diff --git a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js index 0d1adfc4d41db..b6e1d4260cc4a 100644 --- a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js +++ b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js @@ -55,7 +55,6 @@ export const enableUseRefAccessWarning = __VARIANT__; export const enableProfilerNestedUpdateScheduledHook = __VARIANT__; export const disableSchedulerTimeoutInWorkLoop = __VARIANT__; -export const enableTransitionEntanglement = __VARIANT__; export const enableNonInterruptingNormalPri = __VARIANT__; export const enableDiscreteEventMicroTasks = __VARIANT__; export const enableNativeEventPriorityInference = __VARIANT__; diff --git a/packages/shared/forks/ReactFeatureFlags.www.js b/packages/shared/forks/ReactFeatureFlags.www.js index 760d8ca725c11..924fd6ea9e5bd 100644 --- a/packages/shared/forks/ReactFeatureFlags.www.js +++ b/packages/shared/forks/ReactFeatureFlags.www.js @@ -31,7 +31,6 @@ export const { enableUseRefAccessWarning, disableNativeComponentFrames, disableSchedulerTimeoutInWorkLoop, - enableTransitionEntanglement, enableNonInterruptingNormalPri, enableDiscreteEventMicroTasks, enableNativeEventPriorityInference,