Skip to content

Commit f8a42d6

Browse files
committed
Delete dead variable: currentEventWipLanes (facebook#21123)
No longer used anywhere.
1 parent 814c06f commit f8a42d6

File tree

2 files changed

+16
-50
lines changed

2 files changed

+16
-50
lines changed

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

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ let spawnedWorkDuringRender: null | Array<Lane | Lanes> = null;
349349
// event times as simultaneous, even if the actual clock time has advanced
350350
// between the first and second call.
351351
let currentEventTime: number = NoTimestamp;
352-
let currentEventWipLanes: Lanes = NoLanes;
353352
let currentEventTransitionLane: Lanes = NoLanes;
354353

355354
// Dev only flag that tracks if passive effects are currently being flushed.
@@ -401,27 +400,17 @@ export function requestUpdateLane(fiber: Fiber): Lane {
401400
return pickArbitraryLane(workInProgressRootRenderLanes);
402401
}
403402

404-
// The algorithm for assigning an update to a lane should be stable for all
405-
// updates at the same priority within the same event. To do this, the inputs
406-
// to the algorithm must be the same. For example, we use the `renderLanes`
407-
// to avoid choosing a lane that is already in the middle of rendering.
408-
//
409-
// However, the "included" lanes could be mutated in between updates in the
410-
// same event, like if you perform an update inside `flushSync`. Or any other
411-
// code path that might call `prepareFreshStack`.
412-
//
413-
// The trick we use is to cache the first of each of these inputs within an
414-
// event. Then reset the cached values once we can be sure the event is over.
415-
// Our heuristic for that is whenever we enter a concurrent work loop.
416-
//
417-
// We'll do the same for `currentEventTransitionLane` below.
418-
if (currentEventWipLanes === NoLanes) {
419-
currentEventWipLanes = workInProgressRootIncludedLanes;
420-
}
421-
422403
const isTransition = requestCurrentTransition() !== NoTransition;
423404
if (isTransition) {
405+
// The algorithm for assigning an update to a lane should be stable for all
406+
// updates at the same priority within the same event. To do this, the
407+
// inputs to the algorithm must be the same.
408+
//
409+
// The trick we use is to cache the first of each of these inputs within an
410+
// event. Then reset the cached values once we can be sure the event is
411+
// over. Our heuristic for that is whenever we enter a concurrent work loop.
424412
if (currentEventTransitionLane === NoLane) {
413+
// All transitions within the same event are assigned the same lane.
425414
currentEventTransitionLane = claimNextTransitionLane();
426415
}
427416
return currentEventTransitionLane;
@@ -459,11 +448,6 @@ function requestRetryLane(fiber: Fiber) {
459448
return (SyncLane: Lane);
460449
}
461450

462-
// See `requestUpdateLane` for explanation of `currentEventWipLanes`
463-
if (currentEventWipLanes === NoLanes) {
464-
currentEventWipLanes = workInProgressRootIncludedLanes;
465-
}
466-
467451
return claimNextRetryLane();
468452
}
469453

@@ -747,7 +731,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
747731
// Since we know we're in a React event, we can clear the current
748732
// event time. The next update will compute a new event time.
749733
currentEventTime = NoTimestamp;
750-
currentEventWipLanes = NoLanes;
751734
currentEventTransitionLane = NoLanes;
752735

753736
invariant(

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

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ let spawnedWorkDuringRender: null | Array<Lane | Lanes> = null;
349349
// event times as simultaneous, even if the actual clock time has advanced
350350
// between the first and second call.
351351
let currentEventTime: number = NoTimestamp;
352-
let currentEventWipLanes: Lanes = NoLanes;
353352
let currentEventTransitionLane: Lanes = NoLanes;
354353

355354
// Dev only flag that tracks if passive effects are currently being flushed.
@@ -401,27 +400,17 @@ export function requestUpdateLane(fiber: Fiber): Lane {
401400
return pickArbitraryLane(workInProgressRootRenderLanes);
402401
}
403402

404-
// The algorithm for assigning an update to a lane should be stable for all
405-
// updates at the same priority within the same event. To do this, the inputs
406-
// to the algorithm must be the same. For example, we use the `renderLanes`
407-
// to avoid choosing a lane that is already in the middle of rendering.
408-
//
409-
// However, the "included" lanes could be mutated in between updates in the
410-
// same event, like if you perform an update inside `flushSync`. Or any other
411-
// code path that might call `prepareFreshStack`.
412-
//
413-
// The trick we use is to cache the first of each of these inputs within an
414-
// event. Then reset the cached values once we can be sure the event is over.
415-
// Our heuristic for that is whenever we enter a concurrent work loop.
416-
//
417-
// We'll do the same for `currentEventTransitionLane` below.
418-
if (currentEventWipLanes === NoLanes) {
419-
currentEventWipLanes = workInProgressRootIncludedLanes;
420-
}
421-
422403
const isTransition = requestCurrentTransition() !== NoTransition;
423404
if (isTransition) {
405+
// The algorithm for assigning an update to a lane should be stable for all
406+
// updates at the same priority within the same event. To do this, the
407+
// inputs to the algorithm must be the same.
408+
//
409+
// The trick we use is to cache the first of each of these inputs within an
410+
// event. Then reset the cached values once we can be sure the event is
411+
// over. Our heuristic for that is whenever we enter a concurrent work loop.
424412
if (currentEventTransitionLane === NoLane) {
413+
// All transitions within the same event are assigned the same lane.
425414
currentEventTransitionLane = claimNextTransitionLane();
426415
}
427416
return currentEventTransitionLane;
@@ -459,11 +448,6 @@ function requestRetryLane(fiber: Fiber) {
459448
return (SyncLane: Lane);
460449
}
461450

462-
// See `requestUpdateLane` for explanation of `currentEventWipLanes`
463-
if (currentEventWipLanes === NoLanes) {
464-
currentEventWipLanes = workInProgressRootIncludedLanes;
465-
}
466-
467451
return claimNextRetryLane();
468452
}
469453

@@ -747,7 +731,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
747731
// Since we know we're in a React event, we can clear the current
748732
// event time. The next update will compute a new event time.
749733
currentEventTime = NoTimestamp;
750-
currentEventWipLanes = NoLanes;
751734
currentEventTransitionLane = NoLanes;
752735

753736
invariant(

0 commit comments

Comments
 (0)