Skip to content

Commit f161343

Browse files
committed
[flags] Cleanup enableUseMemoCacheHook (#31767)
Based off #31766 This has already landed everywhere. DiffTrain build for [2e25ee3](2e25ee3)
1 parent e67f32f commit f161343

36 files changed

+924
-976
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4996a8fa5c5bf9e12e750c46b48f25656fb050cf
1+
2e25ee373d96a882cee9a1ee3d7fee3f498bde2d
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4996a8fa5c5bf9e12e750c46b48f25656fb050cf
1+
2e25ee373d96a882cee9a1ee3d7fee3f498bde2d

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ __DEV__ &&
19541954
exports.useTransition = function () {
19551955
return resolveDispatcher().useTransition();
19561956
};
1957-
exports.version = "19.1.0-www-classic-4996a8fa-20241213";
1957+
exports.version = "19.1.0-www-classic-2e25ee37-20241214";
19581958
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19591959
"function" ===
19601960
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ __DEV__ &&
19541954
exports.useTransition = function () {
19551955
return resolveDispatcher().useTransition();
19561956
};
1957-
exports.version = "19.1.0-www-modern-4996a8fa-20241213";
1957+
exports.version = "19.1.0-www-modern-2e25ee37-20241214";
19581958
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19591959
"function" ===
19601960
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
635635
exports.useTransition = function () {
636636
return ReactSharedInternals.H.useTransition();
637637
};
638-
exports.version = "19.1.0-www-classic-4996a8fa-20241213";
638+
exports.version = "19.1.0-www-classic-2e25ee37-20241214";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
635635
exports.useTransition = function () {
636636
return ReactSharedInternals.H.useTransition();
637637
};
638-
exports.version = "19.1.0-www-modern-4996a8fa-20241213";
638+
exports.version = "19.1.0-www-modern-2e25ee37-20241214";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
639639
exports.useTransition = function () {
640640
return ReactSharedInternals.H.useTransition();
641641
};
642-
exports.version = "19.1.0-www-classic-4996a8fa-20241213";
642+
exports.version = "19.1.0-www-classic-2e25ee37-20241214";
643643
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
644644
"function" ===
645645
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
639639
exports.useTransition = function () {
640640
return ReactSharedInternals.H.useTransition();
641641
};
642-
exports.version = "19.1.0-www-modern-4996a8fa-20241213";
642+
exports.version = "19.1.0-www-modern-2e25ee37-20241214";
643643
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
644644
"function" ===
645645
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 67 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,6 +3269,9 @@ __DEV__ &&
32693269
}
32703270
return JSCompiler_temp;
32713271
}
3272+
function createFunctionComponentUpdateQueue() {
3273+
return { lastEffect: null, events: null, stores: null, memoCache: null };
3274+
}
32723275
function useThenable(thenable) {
32733276
var index = thenableIndexCounter$1;
32743277
thenableIndexCounter$1 += 1;
@@ -15270,35 +15273,32 @@ __DEV__ &&
1527015273
currentHookNameInDev = null,
1527115274
hookTypesDev = null,
1527215275
hookTypesUpdateIndexDev = -1,
15273-
ignorePreviousDependencies = !1;
15274-
var createFunctionComponentUpdateQueue = function () {
15275-
return { lastEffect: null, events: null, stores: null, memoCache: null };
15276-
};
15277-
var ContextOnlyDispatcher = {
15278-
readContext: readContext,
15279-
use: use,
15280-
useCallback: throwInvalidHookError,
15281-
useContext: throwInvalidHookError,
15282-
useEffect: throwInvalidHookError,
15283-
useImperativeHandle: throwInvalidHookError,
15284-
useLayoutEffect: throwInvalidHookError,
15285-
useInsertionEffect: throwInvalidHookError,
15286-
useMemo: throwInvalidHookError,
15287-
useReducer: throwInvalidHookError,
15288-
useRef: throwInvalidHookError,
15289-
useState: throwInvalidHookError,
15290-
useDebugValue: throwInvalidHookError,
15291-
useDeferredValue: throwInvalidHookError,
15292-
useTransition: throwInvalidHookError,
15293-
useSyncExternalStore: throwInvalidHookError,
15294-
useId: throwInvalidHookError,
15295-
useHostTransitionStatus: throwInvalidHookError,
15296-
useFormState: throwInvalidHookError,
15297-
useActionState: throwInvalidHookError,
15298-
useOptimistic: throwInvalidHookError
15299-
};
15276+
ignorePreviousDependencies = !1,
15277+
ContextOnlyDispatcher = {
15278+
readContext: readContext,
15279+
use: use,
15280+
useCallback: throwInvalidHookError,
15281+
useContext: throwInvalidHookError,
15282+
useEffect: throwInvalidHookError,
15283+
useImperativeHandle: throwInvalidHookError,
15284+
useLayoutEffect: throwInvalidHookError,
15285+
useInsertionEffect: throwInvalidHookError,
15286+
useMemo: throwInvalidHookError,
15287+
useReducer: throwInvalidHookError,
15288+
useRef: throwInvalidHookError,
15289+
useState: throwInvalidHookError,
15290+
useDebugValue: throwInvalidHookError,
15291+
useDeferredValue: throwInvalidHookError,
15292+
useTransition: throwInvalidHookError,
15293+
useSyncExternalStore: throwInvalidHookError,
15294+
useId: throwInvalidHookError,
15295+
useHostTransitionStatus: throwInvalidHookError,
15296+
useFormState: throwInvalidHookError,
15297+
useActionState: throwInvalidHookError,
15298+
useOptimistic: throwInvalidHookError,
15299+
useMemoCache: throwInvalidHookError
15300+
};
1530015301
ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
15301-
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
1530215302
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
1530315303
enableUseResourceEffectHook &&
1530415304
(ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError);
@@ -15431,18 +15431,18 @@ __DEV__ &&
1543115431
return mountOptimistic(passthrough);
1543215432
},
1543315433
useHostTransitionStatus: useHostTransitionStatus,
15434+
useMemoCache: useMemoCache,
1543415435
useCacheRefresh: function () {
1543515436
currentHookNameInDev = "useCacheRefresh";
1543615437
mountHookTypesDev();
1543715438
return mountRefresh();
15439+
},
15440+
useEffectEvent: function (callback) {
15441+
currentHookNameInDev = "useEffectEvent";
15442+
mountHookTypesDev();
15443+
return mountEvent(callback);
1543815444
}
1543915445
};
15440-
HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache;
15441-
HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) {
15442-
currentHookNameInDev = "useEffectEvent";
15443-
mountHookTypesDev();
15444-
return mountEvent(callback);
15445-
};
1544615446
enableUseResourceEffectHook &&
1544715447
(HooksDispatcherOnMountInDEV.useResourceEffect = function (
1544815448
create,
@@ -15591,20 +15591,18 @@ __DEV__ &&
1559115591
return mountOptimistic(passthrough);
1559215592
},
1559315593
useHostTransitionStatus: useHostTransitionStatus,
15594+
useMemoCache: useMemoCache,
1559415595
useCacheRefresh: function () {
1559515596
currentHookNameInDev = "useCacheRefresh";
1559615597
updateHookTypesDev();
1559715598
return mountRefresh();
15599+
},
15600+
useEffectEvent: function (callback) {
15601+
currentHookNameInDev = "useEffectEvent";
15602+
updateHookTypesDev();
15603+
return mountEvent(callback);
1559815604
}
1559915605
};
15600-
HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache;
15601-
HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function (
15602-
callback
15603-
) {
15604-
currentHookNameInDev = "useEffectEvent";
15605-
updateHookTypesDev();
15606-
return mountEvent(callback);
15607-
};
1560815606
enableUseResourceEffectHook &&
1560915607
(HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function (
1561015608
create,
@@ -15743,18 +15741,18 @@ __DEV__ &&
1574315741
return updateOptimistic(passthrough, reducer);
1574415742
},
1574515743
useHostTransitionStatus: useHostTransitionStatus,
15744+
useMemoCache: useMemoCache,
1574615745
useCacheRefresh: function () {
1574715746
currentHookNameInDev = "useCacheRefresh";
1574815747
updateHookTypesDev();
1574915748
return updateWorkInProgressHook().memoizedState;
15749+
},
15750+
useEffectEvent: function (callback) {
15751+
currentHookNameInDev = "useEffectEvent";
15752+
updateHookTypesDev();
15753+
return updateEvent(callback);
1575015754
}
1575115755
};
15752-
HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache;
15753-
HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) {
15754-
currentHookNameInDev = "useEffectEvent";
15755-
updateHookTypesDev();
15756-
return updateEvent(callback);
15757-
};
1575815756
enableUseResourceEffectHook &&
1575915757
(HooksDispatcherOnUpdateInDEV.useResourceEffect = function (
1576015758
create,
@@ -15897,18 +15895,18 @@ __DEV__ &&
1589715895
return rerenderOptimistic(passthrough, reducer);
1589815896
},
1589915897
useHostTransitionStatus: useHostTransitionStatus,
15898+
useMemoCache: useMemoCache,
1590015899
useCacheRefresh: function () {
1590115900
currentHookNameInDev = "useCacheRefresh";
1590215901
updateHookTypesDev();
1590315902
return updateWorkInProgressHook().memoizedState;
15903+
},
15904+
useEffectEvent: function (callback) {
15905+
currentHookNameInDev = "useEffectEvent";
15906+
updateHookTypesDev();
15907+
return updateEvent(callback);
1590415908
}
1590515909
};
15906-
HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache;
15907-
HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) {
15908-
currentHookNameInDev = "useEffectEvent";
15909-
updateHookTypesDev();
15910-
return updateEvent(callback);
15911-
};
1591215910
enableUseResourceEffectHook &&
1591315911
(HooksDispatcherOnRerenderInDEV.useResourceEffect = function (
1591415912
create,
@@ -16071,16 +16069,16 @@ __DEV__ &&
1607116069
mountHookTypesDev();
1607216070
return mountOptimistic(passthrough);
1607316071
},
16072+
useMemoCache: function (size) {
16073+
warnInvalidHookAccess();
16074+
return useMemoCache(size);
16075+
},
1607416076
useHostTransitionStatus: useHostTransitionStatus,
1607516077
useCacheRefresh: function () {
1607616078
currentHookNameInDev = "useCacheRefresh";
1607716079
mountHookTypesDev();
1607816080
return mountRefresh();
1607916081
},
16080-
useMemoCache: function (size) {
16081-
warnInvalidHookAccess();
16082-
return useMemoCache(size);
16083-
},
1608416082
useEffectEvent: function (callback) {
1608516083
currentHookNameInDev = "useEffectEvent";
1608616084
warnInvalidHookAccess();
@@ -16248,16 +16246,16 @@ __DEV__ &&
1624816246
updateHookTypesDev();
1624916247
return updateOptimistic(passthrough, reducer);
1625016248
},
16249+
useMemoCache: function (size) {
16250+
warnInvalidHookAccess();
16251+
return useMemoCache(size);
16252+
},
1625116253
useHostTransitionStatus: useHostTransitionStatus,
1625216254
useCacheRefresh: function () {
1625316255
currentHookNameInDev = "useCacheRefresh";
1625416256
updateHookTypesDev();
1625516257
return updateWorkInProgressHook().memoizedState;
1625616258
},
16257-
useMemoCache: function (size) {
16258-
warnInvalidHookAccess();
16259-
return useMemoCache(size);
16260-
},
1626116259
useEffectEvent: function (callback) {
1626216260
currentHookNameInDev = "useEffectEvent";
1626316261
warnInvalidHookAccess();
@@ -16427,16 +16425,16 @@ __DEV__ &&
1642716425
updateHookTypesDev();
1642816426
return rerenderOptimistic(passthrough, reducer);
1642916427
},
16428+
useMemoCache: function (size) {
16429+
warnInvalidHookAccess();
16430+
return useMemoCache(size);
16431+
},
1643016432
useHostTransitionStatus: useHostTransitionStatus,
1643116433
useCacheRefresh: function () {
1643216434
currentHookNameInDev = "useCacheRefresh";
1643316435
updateHookTypesDev();
1643416436
return updateWorkInProgressHook().memoizedState;
1643516437
},
16436-
useMemoCache: function (size) {
16437-
warnInvalidHookAccess();
16438-
return useMemoCache(size);
16439-
},
1644016438
useEffectEvent: function (callback) {
1644116439
currentHookNameInDev = "useEffectEvent";
1644216440
warnInvalidHookAccess();
@@ -17191,10 +17189,10 @@ __DEV__ &&
1719117189
(function () {
1719217190
var internals = {
1719317191
bundleType: 1,
17194-
version: "19.1.0-www-classic-4996a8fa-20241213",
17192+
version: "19.1.0-www-classic-2e25ee37-20241214",
1719517193
rendererPackageName: "react-art",
1719617194
currentDispatcherRef: ReactSharedInternals,
17197-
reconcilerVersion: "19.1.0-www-classic-4996a8fa-20241213"
17195+
reconcilerVersion: "19.1.0-www-classic-2e25ee37-20241214"
1719817196
};
1719917197
internals.overrideHookState = overrideHookState;
1720017198
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -17228,7 +17226,7 @@ __DEV__ &&
1722817226
exports.Shape = Shape;
1722917227
exports.Surface = Surface;
1723017228
exports.Text = Text;
17231-
exports.version = "19.1.0-www-classic-4996a8fa-20241213";
17229+
exports.version = "19.1.0-www-classic-2e25ee37-20241214";
1723217230
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1723317231
"function" ===
1723417232
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)