@@ -26,7 +26,6 @@ import type {
2626import type { Lanes , Lane } from './ReactFiberLane.new' ;
2727import type { HookFlags } from './ReactHookEffectTags' ;
2828import type { FiberRoot } from './ReactInternalTypes' ;
29- import type { Cache } from './ReactFiberCacheComponent.new' ;
3029import type { Flags } from './ReactFiberFlags' ;
3130
3231import ReactSharedInternals from 'shared/ReactSharedInternals' ;
@@ -122,7 +121,7 @@ import {
122121} from './ReactMutableSource.new' ;
123122import { logStateUpdateScheduled } from './DebugTracing' ;
124123import { markStateUpdateScheduled } from './ReactFiberDevToolsHook.new' ;
125- import { createCache , CacheContext } from './ReactFiberCacheComponent.new' ;
124+ import { createCache } from './ReactFiberCacheComponent.new' ;
126125import {
127126 createUpdate as createLegacyQueueUpdate ,
128127 enqueueUpdate as enqueueLegacyQueueUpdate ,
@@ -2600,27 +2599,6 @@ function markUpdateInDevTools<A>(fiber, lane, action: A) {
26002599 }
26012600}
26022601
2603- function getCacheSignal(): AbortSignal {
2604- if ( ! enableCache ) {
2605- throw new Error ( 'Not implemented.' ) ;
2606- }
2607- const cache: Cache = readContext(CacheContext);
2608- return cache.controller.signal;
2609- }
2610-
2611- function getCacheForType < T > (resourceType: () => T ) : T {
2612- if ( ! enableCache ) {
2613- throw new Error ( 'Not implemented.' ) ;
2614- }
2615- const cache: Cache = readContext(CacheContext);
2616- let cacheForType: T | void = (cache.data.get(resourceType): any);
2617- if (cacheForType === undefined) {
2618- cacheForType = resourceType ( ) ;
2619- cache . data . set ( resourceType , cacheForType ) ;
2620- }
2621- return cacheForType;
2622- }
2623-
26242602export const ContextOnlyDispatcher: Dispatcher = {
26252603 readContext ,
26262604
@@ -2644,8 +2622,6 @@ export const ContextOnlyDispatcher: Dispatcher = {
26442622 unstable_isNewReconciler : enableNewReconciler ,
26452623} ;
26462624if (enableCache) {
2647- ( ContextOnlyDispatcher : Dispatcher ) . getCacheSignal = getCacheSignal ;
2648- ( ContextOnlyDispatcher : Dispatcher ) . getCacheForType = getCacheForType ;
26492625 ( ContextOnlyDispatcher : Dispatcher ) . useCacheRefresh = throwInvalidHookError ;
26502626}
26512627if (enableUseHook) {
@@ -2681,8 +2657,6 @@ const HooksDispatcherOnMount: Dispatcher = {
26812657 unstable_isNewReconciler : enableNewReconciler ,
26822658} ;
26832659if (enableCache) {
2684- ( HooksDispatcherOnMount : Dispatcher ) . getCacheSignal = getCacheSignal ;
2685- ( HooksDispatcherOnMount : Dispatcher ) . getCacheForType = getCacheForType ;
26862660 // $FlowFixMe[escaped-generic] discovered when updating Flow
26872661 ( HooksDispatcherOnMount : Dispatcher ) . useCacheRefresh = mountRefresh ;
26882662}
@@ -2718,8 +2692,6 @@ const HooksDispatcherOnUpdate: Dispatcher = {
27182692 unstable_isNewReconciler : enableNewReconciler ,
27192693} ;
27202694if (enableCache) {
2721- ( HooksDispatcherOnUpdate : Dispatcher ) . getCacheSignal = getCacheSignal ;
2722- ( HooksDispatcherOnUpdate : Dispatcher ) . getCacheForType = getCacheForType ;
27232695 ( HooksDispatcherOnUpdate : Dispatcher ) . useCacheRefresh = updateRefresh ;
27242696}
27252697if (enableUseMemoCacheHook) {
@@ -2755,8 +2727,6 @@ const HooksDispatcherOnRerender: Dispatcher = {
27552727 unstable_isNewReconciler : enableNewReconciler ,
27562728} ;
27572729if (enableCache) {
2758- ( HooksDispatcherOnRerender : Dispatcher ) . getCacheSignal = getCacheSignal ;
2759- ( HooksDispatcherOnRerender : Dispatcher ) . getCacheForType = getCacheForType ;
27602730 ( HooksDispatcherOnRerender : Dispatcher ) . useCacheRefresh = updateRefresh ;
27612731}
27622732if (enableUseHook) {
@@ -2935,8 +2905,6 @@ if (__DEV__) {
29352905 unstable_isNewReconciler: enableNewReconciler,
29362906 } ;
29372907 if ( enableCache ) {
2938- ( HooksDispatcherOnMountInDEV : Dispatcher ) . getCacheSignal = getCacheSignal ;
2939- ( HooksDispatcherOnMountInDEV : Dispatcher ) . getCacheForType = getCacheForType ;
29402908 ( HooksDispatcherOnMountInDEV : Dispatcher ) . useCacheRefresh = function useCacheRefresh ( ) {
29412909 currentHookNameInDev = 'useCacheRefresh' ;
29422910 mountHookTypesDev ( ) ;
@@ -3094,8 +3062,6 @@ if (__DEV__) {
30943062 unstable_isNewReconciler: enableNewReconciler,
30953063 } ;
30963064 if ( enableCache ) {
3097- ( HooksDispatcherOnMountWithHookTypesInDEV : Dispatcher ) . getCacheSignal = getCacheSignal ;
3098- ( HooksDispatcherOnMountWithHookTypesInDEV : Dispatcher ) . getCacheForType = getCacheForType ;
30993065 ( HooksDispatcherOnMountWithHookTypesInDEV : Dispatcher ) . useCacheRefresh = function useCacheRefresh ( ) {
31003066 currentHookNameInDev = 'useCacheRefresh' ;
31013067 updateHookTypesDev ( ) ;
@@ -3253,8 +3219,6 @@ if (__DEV__) {
32533219 unstable_isNewReconciler: enableNewReconciler,
32543220 } ;
32553221 if ( enableCache ) {
3256- ( HooksDispatcherOnUpdateInDEV : Dispatcher ) . getCacheSignal = getCacheSignal ;
3257- ( HooksDispatcherOnUpdateInDEV : Dispatcher ) . getCacheForType = getCacheForType ;
32583222 ( HooksDispatcherOnUpdateInDEV : Dispatcher ) . useCacheRefresh = function useCacheRefresh ( ) {
32593223 currentHookNameInDev = 'useCacheRefresh' ;
32603224 updateHookTypesDev ( ) ;
@@ -3413,8 +3377,6 @@ if (__DEV__) {
34133377 unstable_isNewReconciler: enableNewReconciler,
34143378 } ;
34153379 if ( enableCache ) {
3416- ( HooksDispatcherOnRerenderInDEV : Dispatcher ) . getCacheSignal = getCacheSignal ;
3417- ( HooksDispatcherOnRerenderInDEV : Dispatcher ) . getCacheForType = getCacheForType ;
34183380 ( HooksDispatcherOnRerenderInDEV : Dispatcher ) . useCacheRefresh = function useCacheRefresh ( ) {
34193381 currentHookNameInDev = 'useCacheRefresh' ;
34203382 updateHookTypesDev ( ) ;
@@ -3589,8 +3551,6 @@ if (__DEV__) {
35893551 unstable_isNewReconciler: enableNewReconciler,
35903552 } ;
35913553 if ( enableCache ) {
3592- ( InvalidNestedHooksDispatcherOnMountInDEV : Dispatcher ) . getCacheSignal = getCacheSignal ;
3593- ( InvalidNestedHooksDispatcherOnMountInDEV : Dispatcher ) . getCacheForType = getCacheForType ;
35943554 ( InvalidNestedHooksDispatcherOnMountInDEV : Dispatcher ) . useCacheRefresh = function useCacheRefresh ( ) {
35953555 currentHookNameInDev = 'useCacheRefresh' ;
35963556 mountHookTypesDev ( ) ;
@@ -3776,8 +3736,6 @@ if (__DEV__) {
37763736 unstable_isNewReconciler: enableNewReconciler,
37773737 } ;
37783738 if ( enableCache ) {
3779- ( InvalidNestedHooksDispatcherOnUpdateInDEV : Dispatcher ) . getCacheSignal = getCacheSignal ;
3780- ( InvalidNestedHooksDispatcherOnUpdateInDEV : Dispatcher ) . getCacheForType = getCacheForType ;
37813739 ( InvalidNestedHooksDispatcherOnUpdateInDEV : Dispatcher ) . useCacheRefresh = function useCacheRefresh ( ) {
37823740 currentHookNameInDev = 'useCacheRefresh' ;
37833741 updateHookTypesDev ( ) ;
@@ -3964,8 +3922,6 @@ if (__DEV__) {
39643922 unstable_isNewReconciler: enableNewReconciler,
39653923 } ;
39663924 if ( enableCache ) {
3967- ( InvalidNestedHooksDispatcherOnRerenderInDEV : Dispatcher ) . getCacheSignal = getCacheSignal ;
3968- ( InvalidNestedHooksDispatcherOnRerenderInDEV : Dispatcher ) . getCacheForType = getCacheForType ;
39693925 ( InvalidNestedHooksDispatcherOnRerenderInDEV : Dispatcher ) . useCacheRefresh = function useCacheRefresh ( ) {
39703926 currentHookNameInDev = 'useCacheRefresh' ;
39713927 updateHookTypesDev ( ) ;
0 commit comments