Skip to content

Commit c237472

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 8546104 commit c237472

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

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

+5-6
Original file line numberDiff line numberDiff line change
@@ -337,16 +337,15 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
337337
// bother waiting until the root is complete.
338338
(wipLanes & suspendedLanes) === NoLanes
339339
) {
340-
const nextLane = getHighestPriorityLane(nextLanes);
341-
const wipLane = getHighestPriorityLane(wipLanes);
340+
getHighestPriorityLanes(wipLanes);
341+
const wipLanePriority = return_highestLanePriority;
342342
if (
343-
// Tests whether the next lane is equal or lower priority than the wip
344-
// one. This works because the bits decrease in priority as you go left.
345-
nextLane >= wipLane ||
343+
nextLanePriority <= wipLanePriority ||
346344
// Default priority updates should not interrupt transition updates. The
347345
// only difference between default updates and transition updates is that
348346
// default updates do not support refresh transitions.
349-
(nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes)
347+
(nextLanePriority === DefaultLanePriority &&
348+
wipLanePriority === TransitionPriority)
350349
) {
351350
// Keep working on the existing in-progress tree. Do not interrupt.
352351
return wipLanes;

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

+5-6
Original file line numberDiff line numberDiff line change
@@ -337,16 +337,15 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
337337
// bother waiting until the root is complete.
338338
(wipLanes & suspendedLanes) === NoLanes
339339
) {
340-
const nextLane = getHighestPriorityLane(nextLanes);
341-
const wipLane = getHighestPriorityLane(wipLanes);
340+
getHighestPriorityLanes(wipLanes);
341+
const wipLanePriority = return_highestLanePriority;
342342
if (
343-
// Tests whether the next lane is equal or lower priority than the wip
344-
// one. This works because the bits decrease in priority as you go left.
345-
nextLane >= wipLane ||
343+
nextLanePriority <= wipLanePriority ||
346344
// Default priority updates should not interrupt transition updates. The
347345
// only difference between default updates and transition updates is that
348346
// default updates do not support refresh transitions.
349-
(nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes)
347+
(nextLanePriority === DefaultLanePriority &&
348+
wipLanePriority === TransitionPriority)
350349
) {
351350
// Keep working on the existing in-progress tree. Do not interrupt.
352351
return wipLanes;

0 commit comments

Comments
 (0)