From 86f3385d9ae12fe7ff233fdb5a2b46f63095a75c Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Fri, 23 Apr 2021 11:55:11 -0500 Subject: [PATCH] Revert "Use highest priority lane to detect interruptions (#21088)" This reverts commit b4044f8a07323bcad7d55cbaedc35c35b4acf7e0. Instead of LanePriority. I'm removing all uses of LanePriority so I can delete it. --- packages/react-reconciler/src/ReactFiberLane.new.js | 11 +++++------ packages/react-reconciler/src/ReactFiberLane.old.js | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberLane.new.js b/packages/react-reconciler/src/ReactFiberLane.new.js index c5aef527a422a..64a3bc312cda2 100644 --- a/packages/react-reconciler/src/ReactFiberLane.new.js +++ b/packages/react-reconciler/src/ReactFiberLane.new.js @@ -300,16 +300,15 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes { // bother waiting until the root is complete. (wipLanes & suspendedLanes) === NoLanes ) { - const nextLane = getHighestPriorityLane(nextLanes); - const wipLane = getHighestPriorityLane(wipLanes); + getHighestPriorityLanes(wipLanes); + const wipLanePriority = return_highestLanePriority; if ( - // Tests whether the next lane is equal or lower priority than the wip - // one. This works because the bits decrease in priority as you go left. - nextLane >= wipLane || + nextLanePriority <= wipLanePriority || // 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. - (nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) + (nextLanePriority === DefaultLanePriority && + wipLanePriority === TransitionPriority) ) { // Keep working on the existing in-progress tree. Do not interrupt. return wipLanes; diff --git a/packages/react-reconciler/src/ReactFiberLane.old.js b/packages/react-reconciler/src/ReactFiberLane.old.js index 926a3da32cbab..69c811a80e9b5 100644 --- a/packages/react-reconciler/src/ReactFiberLane.old.js +++ b/packages/react-reconciler/src/ReactFiberLane.old.js @@ -300,16 +300,15 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes { // bother waiting until the root is complete. (wipLanes & suspendedLanes) === NoLanes ) { - const nextLane = getHighestPriorityLane(nextLanes); - const wipLane = getHighestPriorityLane(wipLanes); + getHighestPriorityLanes(wipLanes); + const wipLanePriority = return_highestLanePriority; if ( - // Tests whether the next lane is equal or lower priority than the wip - // one. This works because the bits decrease in priority as you go left. - nextLane >= wipLane || + nextLanePriority <= wipLanePriority || // 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. - (nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) + (nextLanePriority === DefaultLanePriority && + wipLanePriority === TransitionPriority) ) { // Keep working on the existing in-progress tree. Do not interrupt. return wipLanes;