Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Land enableNonInterruptingNormalPri #20859

Merged
merged 1 commit into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions packages/react-reconciler/src/ReactFiberLane.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ export type Lane = number;
export type LaneMap<T> = Array<T>;

import invariant from 'shared/invariant';
import {
enableCache,
enableNonInterruptingNormalPri,
} from 'shared/ReactFeatureFlags';
import {enableCache} from 'shared/ReactFeatureFlags';

import {
ImmediatePriority as ImmediateSchedulerPriority,
Expand Down Expand Up @@ -348,8 +345,7 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
// Default priority updates should not interrupt transition updates. The
// only difference between default updates and transition updates is that
// default updates do not support refresh transitions.
(enableNonInterruptingNormalPri &&
nextLanePriority === DefaultLanePriority &&
(nextLanePriority === DefaultLanePriority &&
wipLanePriority === TransitionPriority)
) {
// Keep working on the existing in-progress tree. Do not interrupt.
Expand Down
8 changes: 2 additions & 6 deletions packages/react-reconciler/src/ReactFiberLane.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ export type Lane = number;
export type LaneMap<T> = Array<T>;

import invariant from 'shared/invariant';
import {
enableCache,
enableNonInterruptingNormalPri,
} from 'shared/ReactFeatureFlags';
import {enableCache} from 'shared/ReactFeatureFlags';

import {
ImmediatePriority as ImmediateSchedulerPriority,
Expand Down Expand Up @@ -348,8 +345,7 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
// Default priority updates should not interrupt transition updates. The
// only difference between default updates and transition updates is that
// default updates do not support refresh transitions.
(enableNonInterruptingNormalPri &&
nextLanePriority === DefaultLanePriority &&
(nextLanePriority === DefaultLanePriority &&
wipLanePriority === TransitionPriority)
) {
// Keep working on the existing in-progress tree. Do not interrupt.
Expand Down
36 changes: 10 additions & 26 deletions packages/react-reconciler/src/__tests__/ReactTransition-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -946,33 +946,17 @@ describe('ReactTransition', () => {
updateNormalPri();
});

if (gate(flags => flags.enableNonInterruptingNormalPri)) {
expect(Scheduler).toHaveYielded([
// Finish transition update.
'Normal pri: 0',
'Commit',

// Normal pri update.
'Transition pri: 1',
'Normal pri: 1',
'Commit',
]);

expect(root).toMatchRenderedOutput('Transition pri: 1, Normal pri: 1');
} else {
expect(Scheduler).toHaveYielded([
// Interrupt! Render normal pri update.
'Transition pri: 0',
'Normal pri: 1',
'Commit',
expect(Scheduler).toHaveYielded([
// Finish transition update.
'Normal pri: 0',
'Commit',

// Restart transition update.
'Transition pri: 1',
'Normal pri: 1',
'Commit',
]);
// Normal pri update.
'Transition pri: 1',
'Normal pri: 1',
'Commit',
]);

expect(root).toMatchRenderedOutput('Transition pri: 1, Normal pri: 1');
}
expect(root).toMatchRenderedOutput('Transition pri: 1, Normal pri: 1');
});
});
2 changes: 0 additions & 2 deletions packages/shared/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ export const enableRecursiveCommitTraversal = false;

export const disableSchedulerTimeoutInWorkLoop = false;

export const enableNonInterruptingNormalPri = false;

export const enableDiscreteEventMicroTasks = false;

export const enableNativeEventPriorityInference = false;
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableNonInterruptingNormalPri = false;
export const enableDiscreteEventMicroTasks = false;
export const enableNativeEventPriorityInference = false;

Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableNonInterruptingNormalPri = false;
export const enableDiscreteEventMicroTasks = false;
export const enableNativeEventPriorityInference = false;

Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.test-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableNonInterruptingNormalPri = false;
export const enableDiscreteEventMicroTasks = false;
export const enableNativeEventPriorityInference = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableNonInterruptingNormalPri = false;
export const enableDiscreteEventMicroTasks = false;
export const enableNativeEventPriorityInference = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableNonInterruptingNormalPri = false;
export const enableDiscreteEventMicroTasks = false;
export const enableNativeEventPriorityInference = false;

Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableNonInterruptingNormalPri = false;
export const enableDiscreteEventMicroTasks = false;
export const enableNativeEventPriorityInference = false;

Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.testing.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableNonInterruptingNormalPri = false;
export const enableDiscreteEventMicroTasks = false;
export const enableNativeEventPriorityInference = false;

Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,5 @@ export const enableUseRefAccessWarning = __VARIANT__;

export const enableProfilerNestedUpdateScheduledHook = __VARIANT__;
export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
export const enableNonInterruptingNormalPri = __VARIANT__;
export const enableDiscreteEventMicroTasks = __VARIANT__;
export const enableNativeEventPriorityInference = __VARIANT__;
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const {
enableUseRefAccessWarning,
disableNativeComponentFrames,
disableSchedulerTimeoutInWorkLoop,
enableNonInterruptingNormalPri,
enableDiscreteEventMicroTasks,
enableNativeEventPriorityInference,
} = dynamicFeatureFlags;
Expand Down