Skip to content

Commit 8af92da

Browse files
committed
Revert "Use highest priority lane to detect interruptions (facebook#21088)"
This reverts commit b4044f8. Instead of LanePriority. I'm removing all uses of LanePriority so I can delete it.
1 parent 3c69f64 commit 8af92da

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,16 +340,15 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
340340
// bother waiting until the root is complete.
341341
(wipLanes & suspendedLanes) === NoLanes
342342
) {
343-
const nextLane = getHighestPriorityLane(nextLanes);
344-
const wipLane = getHighestPriorityLane(wipLanes);
343+
getHighestPriorityLanes(wipLanes);
344+
const wipLanePriority = return_highestLanePriority;
345345
if (
346-
// Tests whether the next lane is equal or lower priority than the wip
347-
// one. This works because the bits decrease in priority as you go left.
348-
nextLane >= wipLane ||
346+
nextLanePriority <= wipLanePriority ||
349347
// Default priority updates should not interrupt transition updates. The
350348
// only difference between default updates and transition updates is that
351349
// default updates do not support refresh transitions.
352-
(nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes)
350+
(nextLanePriority === DefaultLanePriority &&
351+
wipLanePriority === TransitionPriority)
353352
) {
354353
// Keep working on the existing in-progress tree. Do not interrupt.
355354
return wipLanes;

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,16 +340,15 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
340340
// bother waiting until the root is complete.
341341
(wipLanes & suspendedLanes) === NoLanes
342342
) {
343-
const nextLane = getHighestPriorityLane(nextLanes);
344-
const wipLane = getHighestPriorityLane(wipLanes);
343+
getHighestPriorityLanes(wipLanes);
344+
const wipLanePriority = return_highestLanePriority;
345345
if (
346-
// Tests whether the next lane is equal or lower priority than the wip
347-
// one. This works because the bits decrease in priority as you go left.
348-
nextLane >= wipLane ||
346+
nextLanePriority <= wipLanePriority ||
349347
// Default priority updates should not interrupt transition updates. The
350348
// only difference between default updates and transition updates is that
351349
// default updates do not support refresh transitions.
352-
(nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes)
350+
(nextLanePriority === DefaultLanePriority &&
351+
wipLanePriority === TransitionPriority)
353352
) {
354353
// Keep working on the existing in-progress tree. Do not interrupt.
355354
return wipLanes;

0 commit comments

Comments
 (0)