@@ -350,7 +350,6 @@ let spawnedWorkDuringRender: null | Array<Lane | Lanes> = null; |
350 | 350 | // event times as simultaneous, even if the actual clock time has advanced |
351 | 351 | // between the first and second call. |
352 | 352 | let currentEventTime: number = NoTimestamp; |
353 | | -let currentEventWipLanes: Lanes = NoLanes; |
354 | 353 | let currentEventTransitionLane: Lanes = NoLanes; |
355 | 354 |
|
356 | 355 | // Dev only flag that tracks if passive effects are currently being flushed. |
@@ -402,27 +401,17 @@ export function requestUpdateLane(fiber: Fiber): Lane { |
402 | 401 | return pickArbitraryLane(workInProgressRootRenderLanes); |
403 | 402 | } |
404 | 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 | | - |
423 | 404 | const isTransition = requestCurrentTransition() !== NoTransition; |
424 | 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. |
425 | 413 | if (currentEventTransitionLane === NoLane) { |
| 414 | + // All transitions within the same event are assigned the same lane. |
426 | 415 | currentEventTransitionLane = claimNextTransitionLane(); |
427 | 416 | } |
428 | 417 | return currentEventTransitionLane; |
@@ -460,11 +449,6 @@ function requestRetryLane(fiber: Fiber) { |
460 | 449 | return (SyncLane: Lane); |
461 | 450 | } |
462 | 451 |
|
463 | | - // See `requestUpdateLane` for explanation of `currentEventWipLanes` |
464 | | - if (currentEventWipLanes === NoLanes) { |
465 | | - currentEventWipLanes = workInProgressRootIncludedLanes; |
466 | | - } |
467 | | - |
468 | 452 | return claimNextRetryLane(); |
469 | 453 | } |
470 | 454 |
|
@@ -748,7 +732,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) { |
748 | 732 | // Since we know we're in a React event, we can clear the current |
749 | 733 | // event time. The next update will compute a new event time. |
750 | 734 | currentEventTime = NoTimestamp; |
751 | | - currentEventWipLanes = NoLanes; |
752 | 735 | currentEventTransitionLane = NoLanes; |
753 | 736 |
|
754 | 737 | invariant( |
|