Skip to content

Commit 1b79911

Browse files
committed
Move useMemoCache hook to react/compiler-runtime (#28954)
Move useMemoCache hook to react/compiler-runtime For Meta-internal purposes, we keep the export on `react` itself to reduce churn. DiffTrain build for [4508873](4508873)
1 parent 9e2d714 commit 1b79911

File tree

7 files changed

+29
-19
lines changed

7 files changed

+29
-19
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
94eed63c49d989861ae7cd62e111de6d717f0a10
1+
4508873393058e86bed308b56e49ec883ece59d1

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if (
2525
) {
2626
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2727
}
28-
var ReactVersion = '19.0.0-www-classic-c72bd03a';
28+
var ReactVersion = '19.0.0-www-classic-e0403cc2';
2929

3030
// Re-export dynamic flags from the www version.
3131
var dynamicFeatureFlags = require('ReactFeatureFlags');
@@ -3458,6 +3458,7 @@ exports.StrictMode = REACT_STRICT_MODE_TYPE;
34583458
exports.Suspense = REACT_SUSPENSE_TYPE;
34593459
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
34603460
exports.act = act;
3461+
exports.c = useMemoCache;
34613462
exports.cache = cache;
34623463
exports.cloneElement = cloneElement;
34633464
exports.createContext = createContext;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if (
2525
) {
2626
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2727
}
28-
var ReactVersion = '19.0.0-www-modern-305530b5';
28+
var ReactVersion = '19.0.0-www-modern-65139682';
2929

3030
// Re-export dynamic flags from the www version.
3131
var dynamicFeatureFlags = require('ReactFeatureFlags');
@@ -3447,6 +3447,7 @@ exports.StrictMode = REACT_STRICT_MODE_TYPE;
34473447
exports.Suspense = REACT_SUSPENSE_TYPE;
34483448
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
34493449
exports.act = act;
3450+
exports.c = useMemoCache;
34503451
exports.cache = cache;
34513452
exports.cloneElement = cloneElement;
34523453
exports.createContext = createContext;

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ function lazyInitializer(payload) {
362362
if (1 === payload._status) return payload._result.default;
363363
throw payload._result;
364364
}
365+
function useMemoCache(size) {
366+
return ReactSharedInternals.H.useMemoCache(size);
367+
}
365368
var reportGlobalError =
366369
"function" === typeof reportError
367370
? reportError
@@ -436,6 +439,7 @@ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
436439
exports.act = function () {
437440
throw Error("act(...) is not supported in production builds of React.");
438441
};
442+
exports.c = useMemoCache;
439443
exports.cache = function (fn) {
440444
return function () {
441445
return fn.apply(null, arguments);
@@ -610,9 +614,7 @@ exports.unstable_getCacheForType = function (resourceType) {
610614
exports.unstable_useCacheRefresh = function () {
611615
return ReactSharedInternals.H.useCacheRefresh();
612616
};
613-
exports.unstable_useMemoCache = function (size) {
614-
return ReactSharedInternals.H.useMemoCache(size);
615-
};
617+
exports.unstable_useMemoCache = useMemoCache;
616618
exports.use = function (usable) {
617619
return ReactSharedInternals.H.use(usable);
618620
};
@@ -673,4 +675,4 @@ exports.useSyncExternalStore = function (
673675
exports.useTransition = function () {
674676
return ReactSharedInternals.H.useTransition();
675677
};
676-
exports.version = "19.0.0-www-classic-fb5ce026";
678+
exports.version = "19.0.0-www-classic-8ffd6973";

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ function lazyInitializer(payload) {
362362
if (1 === payload._status) return payload._result.default;
363363
throw payload._result;
364364
}
365+
function useMemoCache(size) {
366+
return ReactSharedInternals.H.useMemoCache(size);
367+
}
365368
var reportGlobalError =
366369
"function" === typeof reportError
367370
? reportError
@@ -436,6 +439,7 @@ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
436439
exports.act = function () {
437440
throw Error("act(...) is not supported in production builds of React.");
438441
};
442+
exports.c = useMemoCache;
439443
exports.cache = function (fn) {
440444
return function () {
441445
return fn.apply(null, arguments);
@@ -610,9 +614,7 @@ exports.unstable_getCacheForType = function (resourceType) {
610614
exports.unstable_useCacheRefresh = function () {
611615
return ReactSharedInternals.H.useCacheRefresh();
612616
};
613-
exports.unstable_useMemoCache = function (size) {
614-
return ReactSharedInternals.H.useMemoCache(size);
615-
};
617+
exports.unstable_useMemoCache = useMemoCache;
616618
exports.use = function (usable) {
617619
return ReactSharedInternals.H.use(usable);
618620
};
@@ -673,4 +675,4 @@ exports.useSyncExternalStore = function (
673675
exports.useTransition = function () {
674676
return ReactSharedInternals.H.useTransition();
675677
};
676-
exports.version = "19.0.0-www-modern-fb5ce026";
678+
exports.version = "19.0.0-www-modern-8ffd6973";

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ function lazyInitializer(payload) {
366366
if (1 === payload._status) return payload._result.default;
367367
throw payload._result;
368368
}
369+
function useMemoCache(size) {
370+
return ReactSharedInternals.H.useMemoCache(size);
371+
}
369372
var reportGlobalError =
370373
"function" === typeof reportError
371374
? reportError
@@ -440,6 +443,7 @@ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
440443
exports.act = function () {
441444
throw Error("act(...) is not supported in production builds of React.");
442445
};
446+
exports.c = useMemoCache;
443447
exports.cache = function (fn) {
444448
return function () {
445449
return fn.apply(null, arguments);
@@ -614,9 +618,7 @@ exports.unstable_getCacheForType = function (resourceType) {
614618
exports.unstable_useCacheRefresh = function () {
615619
return ReactSharedInternals.H.useCacheRefresh();
616620
};
617-
exports.unstable_useMemoCache = function (size) {
618-
return ReactSharedInternals.H.useMemoCache(size);
619-
};
621+
exports.unstable_useMemoCache = useMemoCache;
620622
exports.use = function (usable) {
621623
return ReactSharedInternals.H.use(usable);
622624
};
@@ -677,7 +679,7 @@ exports.useSyncExternalStore = function (
677679
exports.useTransition = function () {
678680
return ReactSharedInternals.H.useTransition();
679681
};
680-
exports.version = "19.0.0-www-classic-e01266be";
682+
exports.version = "19.0.0-www-classic-c1be9b80";
681683
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
682684
"function" ===
683685
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ function lazyInitializer(payload) {
366366
if (1 === payload._status) return payload._result.default;
367367
throw payload._result;
368368
}
369+
function useMemoCache(size) {
370+
return ReactSharedInternals.H.useMemoCache(size);
371+
}
369372
var reportGlobalError =
370373
"function" === typeof reportError
371374
? reportError
@@ -440,6 +443,7 @@ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
440443
exports.act = function () {
441444
throw Error("act(...) is not supported in production builds of React.");
442445
};
446+
exports.c = useMemoCache;
443447
exports.cache = function (fn) {
444448
return function () {
445449
return fn.apply(null, arguments);
@@ -614,9 +618,7 @@ exports.unstable_getCacheForType = function (resourceType) {
614618
exports.unstable_useCacheRefresh = function () {
615619
return ReactSharedInternals.H.useCacheRefresh();
616620
};
617-
exports.unstable_useMemoCache = function (size) {
618-
return ReactSharedInternals.H.useMemoCache(size);
619-
};
621+
exports.unstable_useMemoCache = useMemoCache;
620622
exports.use = function (usable) {
621623
return ReactSharedInternals.H.use(usable);
622624
};
@@ -677,7 +679,7 @@ exports.useSyncExternalStore = function (
677679
exports.useTransition = function () {
678680
return ReactSharedInternals.H.useTransition();
679681
};
680-
exports.version = "19.0.0-www-modern-e01266be";
682+
exports.version = "19.0.0-www-modern-c1be9b80";
681683
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
682684
"function" ===
683685
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)