@samitouri / QOS-React / commits / 634cc52e61

Delete dead variable: currentEventWipLanes (#21123)

No longer used anywhere.

Andrew Clark committed Mar 28, 2021 at 18:51 UTC 634cc52e6174b506dee79d908f50ce1ee19f4fbf
2 files changed +16 -50
packages/react-reconciler/src/ReactFiberWorkLoop.new.js
+8 -25
@@ -350,7 +350,6 @@ let spawnedWorkDuringRender: null | Array<Lane | Lanes> = null;
350 // event times as simultaneous, even if the actual clock time has advanced
351 // between the first and second call.
352 let currentEventTime: number = NoTimestamp;
353 -let currentEventWipLanes: Lanes = NoLanes;
353 let currentEventTransitionLane: Lanes = NoLanes;
354
355 // Dev only flag that tracks if passive effects are currently being flushed.
@@ -402,27 +401,17 @@ export function requestUpdateLane(fiber: Fiber): Lane {
401 return pickArbitraryLane(workInProgressRootRenderLanes);
402 }
403
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 inputs
407 - // to the algorithm must be the same. For example, we use the `renderLanes`
408 - // to avoid choosing a lane that is already in the middle of rendering.
409 - //
410 - // However, the "included" lanes could be mutated in between updates in the
411 - // same event, like if you perform an update inside `flushSync`. Or any other
412 - // code path that might call `prepareFreshStack`.
413 - //
414 - // The trick we use is to cache the first of each of these inputs within an
415 - // event. Then reset the cached values once we can be sure the event is over.
416 - // Our heuristic for that is whenever we enter a concurrent work loop.
417 - //
418 - // We'll do the same for `currentEventTransitionLane` below.
419 - if (currentEventWipLanes === NoLanes) {
420 - currentEventWipLanes = workInProgressRootIncludedLanes;
421 - }
422 -
404 const isTransition = requestCurrentTransition() !== NoTransition;
405 if (isTransition) {
406 + // The algorithm for assigning an update to a lane should be stable for all
407 + // updates at the same priority within the same event. To do this, the
408 + // inputs to the algorithm must be the same.
409 + //
410 + // The trick we use is to cache the first of each of these inputs within an
411 + // event. Then reset the cached values once we can be sure the event is
412 + // over. Our heuristic for that is whenever we enter a concurrent work loop.
413 if (currentEventTransitionLane === NoLane) {
414 + // All transitions within the same event are assigned the same lane.
415 currentEventTransitionLane = claimNextTransitionLane();
416 }
417 return currentEventTransitionLane;
@@ -460,11 +449,6 @@ function requestRetryLane(fiber: Fiber) {
449 return (SyncLane: Lane);
450 }
451
463 - // See `requestUpdateLane` for explanation of `currentEventWipLanes`
464 - if (currentEventWipLanes === NoLanes) {
465 - currentEventWipLanes = workInProgressRootIncludedLanes;
466 - }
467 -
452 return claimNextRetryLane();
453 }
454
@@ -748,7 +732,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
732 // Since we know we're in a React event, we can clear the current
733 // event time. The next update will compute a new event time.
734 currentEventTime = NoTimestamp;
751 - currentEventWipLanes = NoLanes;
735 currentEventTransitionLane = NoLanes;
736
737 invariant(
packages/react-reconciler/src/ReactFiberWorkLoop.old.js
+8 -25
@@ -350,7 +350,6 @@ let spawnedWorkDuringRender: null | Array<Lane | Lanes> = null;
350 // event times as simultaneous, even if the actual clock time has advanced
351 // between the first and second call.
352 let currentEventTime: number = NoTimestamp;
353 -let currentEventWipLanes: Lanes = NoLanes;
353 let currentEventTransitionLane: Lanes = NoLanes;
354
355 // Dev only flag that tracks if passive effects are currently being flushed.
@@ -402,27 +401,17 @@ export function requestUpdateLane(fiber: Fiber): Lane {
401 return pickArbitraryLane(workInProgressRootRenderLanes);
402 }
403
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 inputs
407 - // to the algorithm must be the same. For example, we use the `renderLanes`
408 - // to avoid choosing a lane that is already in the middle of rendering.
409 - //
410 - // However, the "included" lanes could be mutated in between updates in the
411 - // same event, like if you perform an update inside `flushSync`. Or any other
412 - // code path that might call `prepareFreshStack`.
413 - //
414 - // The trick we use is to cache the first of each of these inputs within an
415 - // event. Then reset the cached values once we can be sure the event is over.
416 - // Our heuristic for that is whenever we enter a concurrent work loop.
417 - //
418 - // We'll do the same for `currentEventTransitionLane` below.
419 - if (currentEventWipLanes === NoLanes) {
420 - currentEventWipLanes = workInProgressRootIncludedLanes;
421 - }
422 -
404 const isTransition = requestCurrentTransition() !== NoTransition;
405 if (isTransition) {
406 + // The algorithm for assigning an update to a lane should be stable for all
407 + // updates at the same priority within the same event. To do this, the
408 + // inputs to the algorithm must be the same.
409 + //
410 + // The trick we use is to cache the first of each of these inputs within an
411 + // event. Then reset the cached values once we can be sure the event is
412 + // over. Our heuristic for that is whenever we enter a concurrent work loop.
413 if (currentEventTransitionLane === NoLane) {
414 + // All transitions within the same event are assigned the same lane.
415 currentEventTransitionLane = claimNextTransitionLane();
416 }
417 return currentEventTransitionLane;
@@ -460,11 +449,6 @@ function requestRetryLane(fiber: Fiber) {
449 return (SyncLane: Lane);
450 }
451
463 - // See `requestUpdateLane` for explanation of `currentEventWipLanes`
464 - if (currentEventWipLanes === NoLanes) {
465 - currentEventWipLanes = workInProgressRootIncludedLanes;
466 - }
467 -
452 return claimNextRetryLane();
453 }
454
@@ -748,7 +732,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
732 // Since we know we're in a React event, we can clear the current
733 // event time. The next update will compute a new event time.
734 currentEventTime = NoTimestamp;
751 - currentEventWipLanes = NoLanes;
735 currentEventTransitionLane = NoLanes;
736
737 invariant(