@@ -229,15 +229,7 @@ import {
229
229
getWorkInProgressTransitions ,
230
230
} from './ReactFiberWorkLoop.new' ;
231
231
import { setWorkInProgressVersion } from './ReactMutableSource.new' ;
232
- import {
233
- requestCacheFromPool ,
234
- pushCacheProvider ,
235
- pushRootCachePool ,
236
- CacheContext ,
237
- getSuspendedCachePool ,
238
- pushSpawnedCachePool ,
239
- getOffscreenDeferredCachePool ,
240
- } from './ReactFiberCacheComponent.new' ;
232
+ import { pushCacheProvider , CacheContext } from './ReactFiberCacheComponent.new' ;
241
233
import { createCapturedValue } from './ReactCapturedValue' ;
242
234
import { createClassErrorUpdate } from './ReactFiberThrow.new' ;
243
235
import { completeSuspendedOffscreenHostContainer } from './ReactFiberCompleteWork.new' ;
@@ -248,6 +240,13 @@ import {
248
240
pushTreeId ,
249
241
pushMaterializedTreeId ,
250
242
} from './ReactFiberTreeContext.new' ;
243
+ import {
244
+ requestCacheFromPool ,
245
+ pushRootTransition ,
246
+ getSuspendedCache ,
247
+ pushTransition ,
248
+ getOffscreenDeferredCache ,
249
+ } from './ReactFiberTransition.new' ;
251
250
252
251
const ReactCurrentOwner = ReactSharedInternals . ReactCurrentOwner ;
253
252
@@ -652,7 +651,7 @@ function updateOffscreenComponent(
652
651
// push the cache pool even though we're going to bail out
653
652
// because otherwise there'd be a context mismatch
654
653
if ( current !== null ) {
655
- pushSpawnedCachePool ( workInProgress , null ) ;
654
+ pushTransition ( workInProgress , null ) ;
656
655
}
657
656
}
658
657
pushRenderLanes ( workInProgress , renderLanes ) ;
@@ -666,7 +665,7 @@ function updateOffscreenComponent(
666
665
nextBaseLanes = mergeLanes ( prevBaseLanes , renderLanes ) ;
667
666
if ( enableCache ) {
668
667
// Save the cache pool so we can resume later.
669
- spawnedCachePool = getOffscreenDeferredCachePool ( ) ;
668
+ spawnedCachePool = getOffscreenDeferredCache ( ) ;
670
669
}
671
670
} else {
672
671
nextBaseLanes = renderLanes ;
@@ -686,7 +685,7 @@ function updateOffscreenComponent(
686
685
// push the cache pool even though we're going to bail out
687
686
// because otherwise there'd be a context mismatch
688
687
if ( current !== null ) {
689
- pushSpawnedCachePool ( workInProgress , null ) ;
688
+ pushTransition ( workInProgress , null ) ;
690
689
}
691
690
}
692
691
@@ -724,7 +723,7 @@ function updateOffscreenComponent(
724
723
// using the same cache. Unless the parent changed, since that means
725
724
// there was a refresh.
726
725
const prevCachePool = prevState !== null ? prevState . cachePool : null ;
727
- pushSpawnedCachePool ( workInProgress , prevCachePool ) ;
726
+ pushTransition ( workInProgress , prevCachePool ) ;
728
727
}
729
728
730
729
pushRenderLanes ( workInProgress , subtreeRenderLanes ) ;
@@ -742,7 +741,7 @@ function updateOffscreenComponent(
742
741
// using the same cache. Unless the parent changed, since that means
743
742
// there was a refresh.
744
743
const prevCachePool = prevState . cachePool ;
745
- pushSpawnedCachePool ( workInProgress , prevCachePool ) ;
744
+ pushTransition ( workInProgress , prevCachePool ) ;
746
745
}
747
746
748
747
// Since we're not hidden anymore, reset the state
@@ -758,7 +757,7 @@ function updateOffscreenComponent(
758
757
// using the same cache. Unless the parent changed, since that means
759
758
// there was a refresh.
760
759
if ( current !== null ) {
761
- pushSpawnedCachePool ( workInProgress , null ) ;
760
+ pushTransition ( workInProgress , null ) ;
762
761
}
763
762
}
764
763
}
@@ -1329,7 +1328,7 @@ function updateHostRoot(current, workInProgress, renderLanes) {
1329
1328
1330
1329
if ( enableCache ) {
1331
1330
const nextCache : Cache = nextState . cache ;
1332
- pushRootCachePool ( root ) ;
1331
+ pushRootTransition ( root ) ;
1333
1332
pushCacheProvider ( workInProgress , nextCache ) ;
1334
1333
if ( nextCache !== prevState . cache ) {
1335
1334
// The root cache refreshed.
@@ -1910,7 +1909,7 @@ const SUSPENDED_MARKER: SuspenseState = {
1910
1909
function mountSuspenseOffscreenState ( renderLanes : Lanes ) : OffscreenState {
1911
1910
return {
1912
1911
baseLanes : renderLanes ,
1913
- cachePool : getSuspendedCachePool ( ) ,
1912
+ cachePool : getSuspendedCache ( ) ,
1914
1913
} ;
1915
1914
}
1916
1915
@@ -1939,7 +1938,7 @@ function updateSuspenseOffscreenState(
1939
1938
}
1940
1939
} else {
1941
1940
// If there's no previous cache pool, grab the current one.
1942
- cachePool = getSuspendedCachePool ( ) ;
1941
+ cachePool = getSuspendedCache ( ) ;
1943
1942
}
1944
1943
}
1945
1944
return {
@@ -3504,7 +3503,7 @@ function attemptEarlyBailoutIfNoScheduledUpdate(
3504
3503
if ( enableCache ) {
3505
3504
const cache : Cache = current . memoizedState . cache ;
3506
3505
pushCacheProvider ( workInProgress , cache ) ;
3507
- pushRootCachePool ( root ) ;
3506
+ pushRootTransition ( root ) ;
3508
3507
}
3509
3508
if ( enableTransitionTracing ) {
3510
3509
workInProgress . memoizedState . transitions = getWorkInProgressTransitions ( ) ;
0 commit comments