Skip to content

Commit

Permalink
[flags] Cleanup enableUseMemoCacheHook (#31767)
Browse files Browse the repository at this point in the history
Based off #31766

This has already landed everywhere.

DiffTrain build for [2e25ee3](2e25ee3)
  • Loading branch information
rickhanlonii committed Dec 14, 2024
1 parent e67f32f commit f161343
Show file tree
Hide file tree
Showing 36 changed files with 924 additions and 976 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4996a8fa5c5bf9e12e750c46b48f25656fb050cf
2e25ee373d96a882cee9a1ee3d7fee3f498bde2d
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4996a8fa5c5bf9e12e750c46b48f25656fb050cf
2e25ee373d96a882cee9a1ee3d7fee3f498bde2d
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-classic-4996a8fa-20241213";
exports.version = "19.1.0-www-classic-2e25ee37-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-modern-4996a8fa-20241213";
exports.version = "19.1.0-www-modern-2e25ee37-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-4996a8fa-20241213";
exports.version = "19.1.0-www-classic-2e25ee37-20241214";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-4996a8fa-20241213";
exports.version = "19.1.0-www-modern-2e25ee37-20241214";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-4996a8fa-20241213";
exports.version = "19.1.0-www-classic-2e25ee37-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-4996a8fa-20241213";
exports.version = "19.1.0-www-modern-2e25ee37-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
136 changes: 67 additions & 69 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3269,6 +3269,9 @@ __DEV__ &&
}
return JSCompiler_temp;
}
function createFunctionComponentUpdateQueue() {
return { lastEffect: null, events: null, stores: null, memoCache: null };
}
function useThenable(thenable) {
var index = thenableIndexCounter$1;
thenableIndexCounter$1 += 1;
Expand Down Expand Up @@ -15270,35 +15273,32 @@ __DEV__ &&
currentHookNameInDev = null,
hookTypesDev = null,
hookTypesUpdateIndexDev = -1,
ignorePreviousDependencies = !1;
var createFunctionComponentUpdateQueue = function () {
return { lastEffect: null, events: null, stores: null, memoCache: null };
};
var ContextOnlyDispatcher = {
readContext: readContext,
use: use,
useCallback: throwInvalidHookError,
useContext: throwInvalidHookError,
useEffect: throwInvalidHookError,
useImperativeHandle: throwInvalidHookError,
useLayoutEffect: throwInvalidHookError,
useInsertionEffect: throwInvalidHookError,
useMemo: throwInvalidHookError,
useReducer: throwInvalidHookError,
useRef: throwInvalidHookError,
useState: throwInvalidHookError,
useDebugValue: throwInvalidHookError,
useDeferredValue: throwInvalidHookError,
useTransition: throwInvalidHookError,
useSyncExternalStore: throwInvalidHookError,
useId: throwInvalidHookError,
useHostTransitionStatus: throwInvalidHookError,
useFormState: throwInvalidHookError,
useActionState: throwInvalidHookError,
useOptimistic: throwInvalidHookError
};
ignorePreviousDependencies = !1,
ContextOnlyDispatcher = {
readContext: readContext,
use: use,
useCallback: throwInvalidHookError,
useContext: throwInvalidHookError,
useEffect: throwInvalidHookError,
useImperativeHandle: throwInvalidHookError,
useLayoutEffect: throwInvalidHookError,
useInsertionEffect: throwInvalidHookError,
useMemo: throwInvalidHookError,
useReducer: throwInvalidHookError,
useRef: throwInvalidHookError,
useState: throwInvalidHookError,
useDebugValue: throwInvalidHookError,
useDeferredValue: throwInvalidHookError,
useTransition: throwInvalidHookError,
useSyncExternalStore: throwInvalidHookError,
useId: throwInvalidHookError,
useHostTransitionStatus: throwInvalidHookError,
useFormState: throwInvalidHookError,
useActionState: throwInvalidHookError,
useOptimistic: throwInvalidHookError,
useMemoCache: throwInvalidHookError
};
ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
enableUseResourceEffectHook &&
(ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError);
Expand Down Expand Up @@ -15431,18 +15431,18 @@ __DEV__ &&
return mountOptimistic(passthrough);
},
useHostTransitionStatus: useHostTransitionStatus,
useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
mountHookTypesDev();
return mountRefresh();
},
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
mountHookTypesDev();
return mountEvent(callback);
}
};
HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache;
HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) {
currentHookNameInDev = "useEffectEvent";
mountHookTypesDev();
return mountEvent(callback);
};
enableUseResourceEffectHook &&
(HooksDispatcherOnMountInDEV.useResourceEffect = function (
create,
Expand Down Expand Up @@ -15591,20 +15591,18 @@ __DEV__ &&
return mountOptimistic(passthrough);
},
useHostTransitionStatus: useHostTransitionStatus,
useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return mountRefresh();
},
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
updateHookTypesDev();
return mountEvent(callback);
}
};
HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache;
HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function (
callback
) {
currentHookNameInDev = "useEffectEvent";
updateHookTypesDev();
return mountEvent(callback);
};
enableUseResourceEffectHook &&
(HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function (
create,
Expand Down Expand Up @@ -15743,18 +15741,18 @@ __DEV__ &&
return updateOptimistic(passthrough, reducer);
},
useHostTransitionStatus: useHostTransitionStatus,
useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
updateHookTypesDev();
return updateEvent(callback);
}
};
HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache;
HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) {
currentHookNameInDev = "useEffectEvent";
updateHookTypesDev();
return updateEvent(callback);
};
enableUseResourceEffectHook &&
(HooksDispatcherOnUpdateInDEV.useResourceEffect = function (
create,
Expand Down Expand Up @@ -15897,18 +15895,18 @@ __DEV__ &&
return rerenderOptimistic(passthrough, reducer);
},
useHostTransitionStatus: useHostTransitionStatus,
useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
updateHookTypesDev();
return updateEvent(callback);
}
};
HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache;
HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) {
currentHookNameInDev = "useEffectEvent";
updateHookTypesDev();
return updateEvent(callback);
};
enableUseResourceEffectHook &&
(HooksDispatcherOnRerenderInDEV.useResourceEffect = function (
create,
Expand Down Expand Up @@ -16071,16 +16069,16 @@ __DEV__ &&
mountHookTypesDev();
return mountOptimistic(passthrough);
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
useHostTransitionStatus: useHostTransitionStatus,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
mountHookTypesDev();
return mountRefresh();
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
warnInvalidHookAccess();
Expand Down Expand Up @@ -16248,16 +16246,16 @@ __DEV__ &&
updateHookTypesDev();
return updateOptimistic(passthrough, reducer);
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
useHostTransitionStatus: useHostTransitionStatus,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
warnInvalidHookAccess();
Expand Down Expand Up @@ -16427,16 +16425,16 @@ __DEV__ &&
updateHookTypesDev();
return rerenderOptimistic(passthrough, reducer);
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
useHostTransitionStatus: useHostTransitionStatus,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
warnInvalidHookAccess();
Expand Down Expand Up @@ -17191,10 +17189,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-4996a8fa-20241213",
version: "19.1.0-www-classic-2e25ee37-20241214",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-4996a8fa-20241213"
reconcilerVersion: "19.1.0-www-classic-2e25ee37-20241214"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -17228,7 +17226,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-4996a8fa-20241213";
exports.version = "19.1.0-www-classic-2e25ee37-20241214";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit f161343

Please sign in to comment.