Skip to content

Commit 4d28eca

Browse files
authored
Land enableNonInterruptingNormalPri (#20859)
1 parent 8af27ae commit 4d28eca

13 files changed

+14
-49
lines changed

packages/react-reconciler/src/ReactFiberLane.new.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ export type Lane = number;
3636
export type LaneMap<T> = Array<T>;
3737

3838
import invariant from 'shared/invariant';
39-
import {
40-
enableCache,
41-
enableNonInterruptingNormalPri,
42-
} from 'shared/ReactFeatureFlags';
39+
import {enableCache} from 'shared/ReactFeatureFlags';
4340

4441
import {
4542
ImmediatePriority as ImmediateSchedulerPriority,
@@ -348,8 +345,7 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
348345
// Default priority updates should not interrupt transition updates. The
349346
// only difference between default updates and transition updates is that
350347
// default updates do not support refresh transitions.
351-
(enableNonInterruptingNormalPri &&
352-
nextLanePriority === DefaultLanePriority &&
348+
(nextLanePriority === DefaultLanePriority &&
353349
wipLanePriority === TransitionPriority)
354350
) {
355351
// Keep working on the existing in-progress tree. Do not interrupt.

packages/react-reconciler/src/ReactFiberLane.old.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ export type Lane = number;
3636
export type LaneMap<T> = Array<T>;
3737

3838
import invariant from 'shared/invariant';
39-
import {
40-
enableCache,
41-
enableNonInterruptingNormalPri,
42-
} from 'shared/ReactFeatureFlags';
39+
import {enableCache} from 'shared/ReactFeatureFlags';
4340

4441
import {
4542
ImmediatePriority as ImmediateSchedulerPriority,
@@ -348,8 +345,7 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
348345
// Default priority updates should not interrupt transition updates. The
349346
// only difference between default updates and transition updates is that
350347
// default updates do not support refresh transitions.
351-
(enableNonInterruptingNormalPri &&
352-
nextLanePriority === DefaultLanePriority &&
348+
(nextLanePriority === DefaultLanePriority &&
353349
wipLanePriority === TransitionPriority)
354350
) {
355351
// Keep working on the existing in-progress tree. Do not interrupt.

packages/react-reconciler/src/__tests__/ReactTransition-test.js

+10-26
Original file line numberDiff line numberDiff line change
@@ -946,33 +946,17 @@ describe('ReactTransition', () => {
946946
updateNormalPri();
947947
});
948948

949-
if (gate(flags => flags.enableNonInterruptingNormalPri)) {
950-
expect(Scheduler).toHaveYielded([
951-
// Finish transition update.
952-
'Normal pri: 0',
953-
'Commit',
954-
955-
// Normal pri update.
956-
'Transition pri: 1',
957-
'Normal pri: 1',
958-
'Commit',
959-
]);
960-
961-
expect(root).toMatchRenderedOutput('Transition pri: 1, Normal pri: 1');
962-
} else {
963-
expect(Scheduler).toHaveYielded([
964-
// Interrupt! Render normal pri update.
965-
'Transition pri: 0',
966-
'Normal pri: 1',
967-
'Commit',
949+
expect(Scheduler).toHaveYielded([
950+
// Finish transition update.
951+
'Normal pri: 0',
952+
'Commit',
968953

969-
// Restart transition update.
970-
'Transition pri: 1',
971-
'Normal pri: 1',
972-
'Commit',
973-
]);
954+
// Normal pri update.
955+
'Transition pri: 1',
956+
'Normal pri: 1',
957+
'Commit',
958+
]);
974959

975-
expect(root).toMatchRenderedOutput('Transition pri: 1, Normal pri: 1');
976-
}
960+
expect(root).toMatchRenderedOutput('Transition pri: 1, Normal pri: 1');
977961
});
978962
});

packages/shared/ReactFeatureFlags.js

-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ export const enableRecursiveCommitTraversal = false;
147147

148148
export const disableSchedulerTimeoutInWorkLoop = false;
149149

150-
export const enableNonInterruptingNormalPri = false;
151-
152150
export const enableDiscreteEventMicroTasks = false;
153151

154152
export const enableNativeEventPriorityInference = false;

packages/shared/forks/ReactFeatureFlags.native-fb.js

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export const enableUseRefAccessWarning = false;
5757

5858
export const enableRecursiveCommitTraversal = false;
5959
export const disableSchedulerTimeoutInWorkLoop = false;
60-
export const enableNonInterruptingNormalPri = false;
6160
export const enableDiscreteEventMicroTasks = false;
6261
export const enableNativeEventPriorityInference = false;
6362

packages/shared/forks/ReactFeatureFlags.native-oss.js

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;
5656

5757
export const enableRecursiveCommitTraversal = false;
5858
export const disableSchedulerTimeoutInWorkLoop = false;
59-
export const enableNonInterruptingNormalPri = false;
6059
export const enableDiscreteEventMicroTasks = false;
6160
export const enableNativeEventPriorityInference = false;
6261

packages/shared/forks/ReactFeatureFlags.test-renderer.js

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;
5656

5757
export const enableRecursiveCommitTraversal = false;
5858
export const disableSchedulerTimeoutInWorkLoop = false;
59-
export const enableNonInterruptingNormalPri = false;
6059
export const enableDiscreteEventMicroTasks = false;
6160
export const enableNativeEventPriorityInference = false;
6261

packages/shared/forks/ReactFeatureFlags.test-renderer.native.js

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;
5656

5757
export const enableRecursiveCommitTraversal = false;
5858
export const disableSchedulerTimeoutInWorkLoop = false;
59-
export const enableNonInterruptingNormalPri = false;
6059
export const enableDiscreteEventMicroTasks = false;
6160
export const enableNativeEventPriorityInference = false;
6261

packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;
5656

5757
export const enableRecursiveCommitTraversal = false;
5858
export const disableSchedulerTimeoutInWorkLoop = false;
59-
export const enableNonInterruptingNormalPri = false;
6059
export const enableDiscreteEventMicroTasks = false;
6160
export const enableNativeEventPriorityInference = false;
6261

packages/shared/forks/ReactFeatureFlags.testing.js

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;
5656

5757
export const enableRecursiveCommitTraversal = false;
5858
export const disableSchedulerTimeoutInWorkLoop = false;
59-
export const enableNonInterruptingNormalPri = false;
6059
export const enableDiscreteEventMicroTasks = false;
6160
export const enableNativeEventPriorityInference = false;
6261

packages/shared/forks/ReactFeatureFlags.testing.www.js

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;
5656

5757
export const enableRecursiveCommitTraversal = false;
5858
export const disableSchedulerTimeoutInWorkLoop = false;
59-
export const enableNonInterruptingNormalPri = false;
6059
export const enableDiscreteEventMicroTasks = false;
6160
export const enableNativeEventPriorityInference = false;
6261

packages/shared/forks/ReactFeatureFlags.www-dynamic.js

-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,5 @@ export const enableUseRefAccessWarning = __VARIANT__;
5555

5656
export const enableProfilerNestedUpdateScheduledHook = __VARIANT__;
5757
export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
58-
export const enableNonInterruptingNormalPri = __VARIANT__;
5958
export const enableDiscreteEventMicroTasks = __VARIANT__;
6059
export const enableNativeEventPriorityInference = __VARIANT__;

packages/shared/forks/ReactFeatureFlags.www.js

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export const {
3131
enableUseRefAccessWarning,
3232
disableNativeComponentFrames,
3333
disableSchedulerTimeoutInWorkLoop,
34-
enableNonInterruptingNormalPri,
3534
enableDiscreteEventMicroTasks,
3635
enableNativeEventPriorityInference,
3736
} = dynamicFeatureFlags;

0 commit comments

Comments
 (0)