Skip to content

Commit b3b172a

Browse files
committed
[rcr] Re-export useMemoCache in top level React namespace (#31139)
In order to support using the compiler on versions of React prior to 19, we need the ability to statically import `c` (aka useMemoCache) or fallback to a polyfill supplied by `react-compiler-runtime` (note: this is a separate npm package, not to be confused with `react/compiler-runtime`, which is currently a part of react). To do this we first need to re-export `useMemoCache` under the top level React namespace again, which is additive and thus non-breaking. Doing so allows `react-compiler-runtime` to statically either re-export `React.__COMPILER_RUNTIME.c` or supply a polyfill, without the need for a dynamic import which is finicky to support due to returning a promise. In later PRs I will remove `react/compiler-runtime` and update the compiler to emit imports to `react-compiler-runtime` instead. DiffTrain build for [b78a7f2](b78a7f2)
1 parent 6acd66e commit b3b172a

23 files changed

+93
-87
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.0.0-native-fb-459fd418-20241001
1+
19.0.0-native-fb-b78a7f2f-20241007

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<333789674f3a865b32eba498659ac910>>
10+
* @generated SignedSource<<d5faa91f4a5f8a6940d890f72a303b54>>
1111
*/
1212

1313
"use strict";
@@ -420,5 +420,5 @@ __DEV__ &&
420420
exports.useFormStatus = function () {
421421
return resolveDispatcher().useHostTransitionStatus();
422422
};
423-
exports.version = "19.0.0-native-fb-459fd418-20241001";
423+
exports.version = "19.0.0-native-fb-b78a7f2f-20241007";
424424
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<079922b0a92a10633e0f40e43b54b735>>
10+
* @generated SignedSource<<19418ee514eca4bcaf1ba0d649a720b4>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.0.0-native-fb-459fd418-20241001";
206+
exports.version = "19.0.0-native-fb-b78a7f2f-20241007";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<079922b0a92a10633e0f40e43b54b735>>
10+
* @generated SignedSource<<19418ee514eca4bcaf1ba0d649a720b4>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.0.0-native-fb-459fd418-20241001";
206+
exports.version = "19.0.0-native-fb-b78a7f2f-20241007";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<81900bfb513fc0c38794b9e3c210915a>>
10+
* @generated SignedSource<<50538a711c0ffae7621f4907d19f5002>>
1111
*/
1212

1313
/*
@@ -25304,11 +25304,11 @@ __DEV__ &&
2530425304
};
2530525305
(function () {
2530625306
var isomorphicReactPackageVersion = React.version;
25307-
if ("19.0.0-native-fb-459fd418-20241001" !== isomorphicReactPackageVersion)
25307+
if ("19.0.0-native-fb-b78a7f2f-20241007" !== isomorphicReactPackageVersion)
2530825308
throw Error(
2530925309
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2531025310
(isomorphicReactPackageVersion +
25311-
"\n - react-dom: 19.0.0-native-fb-459fd418-20241001\nLearn more: https://react.dev/warnings/version-mismatch")
25311+
"\n - react-dom: 19.0.0-native-fb-b78a7f2f-20241007\nLearn more: https://react.dev/warnings/version-mismatch")
2531225312
);
2531325313
})();
2531425314
("function" === typeof Map &&
@@ -25345,11 +25345,11 @@ __DEV__ &&
2534525345
!(function () {
2534625346
var internals = {
2534725347
bundleType: 1,
25348-
version: "19.0.0-native-fb-459fd418-20241001",
25348+
version: "19.0.0-native-fb-b78a7f2f-20241007",
2534925349
rendererPackageName: "react-dom",
2535025350
currentDispatcherRef: ReactSharedInternals,
2535125351
findFiberByHostInstance: getClosestInstanceFromNode,
25352-
reconcilerVersion: "19.0.0-native-fb-459fd418-20241001"
25352+
reconcilerVersion: "19.0.0-native-fb-b78a7f2f-20241007"
2535325353
};
2535425354
internals.overrideHookState = overrideHookState;
2535525355
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -25493,5 +25493,5 @@ __DEV__ &&
2549325493
listenToAllSupportedEvents(container);
2549425494
return new ReactDOMHydrationRoot(initialChildren);
2549525495
};
25496-
exports.version = "19.0.0-native-fb-459fd418-20241001";
25496+
exports.version = "19.0.0-native-fb-b78a7f2f-20241007";
2549725497
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<bb77136cedd422081ff7603adc64a4d5>>
10+
* @generated SignedSource<<66c9a1a1221b0f25c3fc6b802381a71f>>
1111
*/
1212

1313
/*
@@ -15598,14 +15598,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1559815598
};
1559915599
var isomorphicReactPackageVersion$jscomp$inline_1691 = React.version;
1560015600
if (
15601-
"19.0.0-native-fb-459fd418-20241001" !==
15601+
"19.0.0-native-fb-b78a7f2f-20241007" !==
1560215602
isomorphicReactPackageVersion$jscomp$inline_1691
1560315603
)
1560415604
throw Error(
1560515605
formatProdErrorMessage(
1560615606
527,
1560715607
isomorphicReactPackageVersion$jscomp$inline_1691,
15608-
"19.0.0-native-fb-459fd418-20241001"
15608+
"19.0.0-native-fb-b78a7f2f-20241007"
1560915609
)
1561015610
);
1561115611
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -15627,11 +15627,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1562715627
};
1562815628
var internals$jscomp$inline_2144 = {
1562915629
bundleType: 0,
15630-
version: "19.0.0-native-fb-459fd418-20241001",
15630+
version: "19.0.0-native-fb-b78a7f2f-20241007",
1563115631
rendererPackageName: "react-dom",
1563215632
currentDispatcherRef: ReactSharedInternals,
1563315633
findFiberByHostInstance: getClosestInstanceFromNode,
15634-
reconcilerVersion: "19.0.0-native-fb-459fd418-20241001"
15634+
reconcilerVersion: "19.0.0-native-fb-b78a7f2f-20241007"
1563515635
};
1563615636
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1563715637
var hook$jscomp$inline_2145 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15735,4 +15735,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1573515735
listenToAllSupportedEvents(container);
1573615736
return new ReactDOMHydrationRoot(initialChildren);
1573715737
};
15738-
exports.version = "19.0.0-native-fb-459fd418-20241001";
15738+
exports.version = "19.0.0-native-fb-b78a7f2f-20241007";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<54e57ea222e9bfd9dbf750496a69abc8>>
10+
* @generated SignedSource<<0a35ca8dced5c33f584e6582ef1df166>>
1111
*/
1212

1313
/*
@@ -16255,14 +16255,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1625516255
};
1625616256
var isomorphicReactPackageVersion$jscomp$inline_1781 = React.version;
1625716257
if (
16258-
"19.0.0-native-fb-459fd418-20241001" !==
16258+
"19.0.0-native-fb-b78a7f2f-20241007" !==
1625916259
isomorphicReactPackageVersion$jscomp$inline_1781
1626016260
)
1626116261
throw Error(
1626216262
formatProdErrorMessage(
1626316263
527,
1626416264
isomorphicReactPackageVersion$jscomp$inline_1781,
16265-
"19.0.0-native-fb-459fd418-20241001"
16265+
"19.0.0-native-fb-b78a7f2f-20241007"
1626616266
)
1626716267
);
1626816268
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16284,11 +16284,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1628416284
};
1628516285
var internals$jscomp$inline_1788 = {
1628616286
bundleType: 0,
16287-
version: "19.0.0-native-fb-459fd418-20241001",
16287+
version: "19.0.0-native-fb-b78a7f2f-20241007",
1628816288
rendererPackageName: "react-dom",
1628916289
currentDispatcherRef: ReactSharedInternals,
1629016290
findFiberByHostInstance: getClosestInstanceFromNode,
16291-
reconcilerVersion: "19.0.0-native-fb-459fd418-20241001",
16291+
reconcilerVersion: "19.0.0-native-fb-b78a7f2f-20241007",
1629216292
getLaneLabelMap: function () {
1629316293
for (
1629416294
var map = new Map(), lane = 1, index$286 = 0;
@@ -16407,4 +16407,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1640716407
listenToAllSupportedEvents(container);
1640816408
return new ReactDOMHydrationRoot(initialChildren);
1640916409
};
16410-
exports.version = "19.0.0-native-fb-459fd418-20241001";
16410+
exports.version = "19.0.0-native-fb-b78a7f2f-20241007";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<ee0f9fb7d05a1c29290cae2dd15d3f4e>>
10+
* @generated SignedSource<<8c1b7dae604278006c2ff6473ace83e0>>
1111
*/
1212

1313
/*
@@ -25365,11 +25365,11 @@ __DEV__ &&
2536525365
};
2536625366
(function () {
2536725367
var isomorphicReactPackageVersion = React.version;
25368-
if ("19.0.0-native-fb-459fd418-20241001" !== isomorphicReactPackageVersion)
25368+
if ("19.0.0-native-fb-b78a7f2f-20241007" !== isomorphicReactPackageVersion)
2536925369
throw Error(
2537025370
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2537125371
(isomorphicReactPackageVersion +
25372-
"\n - react-dom: 19.0.0-native-fb-459fd418-20241001\nLearn more: https://react.dev/warnings/version-mismatch")
25372+
"\n - react-dom: 19.0.0-native-fb-b78a7f2f-20241007\nLearn more: https://react.dev/warnings/version-mismatch")
2537325373
);
2537425374
})();
2537525375
("function" === typeof Map &&
@@ -25406,11 +25406,11 @@ __DEV__ &&
2540625406
!(function () {
2540725407
var internals = {
2540825408
bundleType: 1,
25409-
version: "19.0.0-native-fb-459fd418-20241001",
25409+
version: "19.0.0-native-fb-b78a7f2f-20241007",
2541025410
rendererPackageName: "react-dom",
2541125411
currentDispatcherRef: ReactSharedInternals,
2541225412
findFiberByHostInstance: getClosestInstanceFromNode,
25413-
reconcilerVersion: "19.0.0-native-fb-459fd418-20241001"
25413+
reconcilerVersion: "19.0.0-native-fb-b78a7f2f-20241007"
2541425414
};
2541525415
internals.overrideHookState = overrideHookState;
2541625416
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -25870,7 +25870,7 @@ __DEV__ &&
2587025870
exports.useFormStatus = function () {
2587125871
return resolveDispatcher().useHostTransitionStatus();
2587225872
};
25873-
exports.version = "19.0.0-native-fb-459fd418-20241001";
25873+
exports.version = "19.0.0-native-fb-b78a7f2f-20241007";
2587425874
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2587525875
"function" ===
2587625876
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<de7905821e9bd8b0b0114678b6e7f3bf>>
10+
* @generated SignedSource<<32a7570edfe1e2a0b4a6c63c9684eea8>>
1111
*/
1212

1313
/*
@@ -15609,14 +15609,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1560915609
};
1561015610
var isomorphicReactPackageVersion$jscomp$inline_1692 = React.version;
1561115611
if (
15612-
"19.0.0-native-fb-459fd418-20241001" !==
15612+
"19.0.0-native-fb-b78a7f2f-20241007" !==
1561315613
isomorphicReactPackageVersion$jscomp$inline_1692
1561415614
)
1561515615
throw Error(
1561615616
formatProdErrorMessage(
1561715617
527,
1561815618
isomorphicReactPackageVersion$jscomp$inline_1692,
15619-
"19.0.0-native-fb-459fd418-20241001"
15619+
"19.0.0-native-fb-b78a7f2f-20241007"
1562015620
)
1562115621
);
1562215622
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -15638,11 +15638,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1563815638
};
1563915639
var internals$jscomp$inline_2147 = {
1564015640
bundleType: 0,
15641-
version: "19.0.0-native-fb-459fd418-20241001",
15641+
version: "19.0.0-native-fb-b78a7f2f-20241007",
1564215642
rendererPackageName: "react-dom",
1564315643
currentDispatcherRef: ReactSharedInternals,
1564415644
findFiberByHostInstance: getClosestInstanceFromNode,
15645-
reconcilerVersion: "19.0.0-native-fb-459fd418-20241001"
15645+
reconcilerVersion: "19.0.0-native-fb-b78a7f2f-20241007"
1564615646
};
1564715647
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1564815648
var hook$jscomp$inline_2148 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15900,4 +15900,4 @@ exports.useFormState = function (action, initialState, permalink) {
1590015900
exports.useFormStatus = function () {
1590115901
return ReactSharedInternals.H.useHostTransitionStatus();
1590215902
};
15903-
exports.version = "19.0.0-native-fb-459fd418-20241001";
15903+
exports.version = "19.0.0-native-fb-b78a7f2f-20241007";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<a8958828a6f1c9be677992cbbc2cdd34>>
10+
* @generated SignedSource<<15cc6efda2582697662984eedd53fbd5>>
1111
*/
1212

1313
/*
@@ -16270,14 +16270,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1627016270
};
1627116271
var isomorphicReactPackageVersion$jscomp$inline_1782 = React.version;
1627216272
if (
16273-
"19.0.0-native-fb-459fd418-20241001" !==
16273+
"19.0.0-native-fb-b78a7f2f-20241007" !==
1627416274
isomorphicReactPackageVersion$jscomp$inline_1782
1627516275
)
1627616276
throw Error(
1627716277
formatProdErrorMessage(
1627816278
527,
1627916279
isomorphicReactPackageVersion$jscomp$inline_1782,
16280-
"19.0.0-native-fb-459fd418-20241001"
16280+
"19.0.0-native-fb-b78a7f2f-20241007"
1628116281
)
1628216282
);
1628316283
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16299,11 +16299,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1629916299
};
1630016300
var internals$jscomp$inline_1789 = {
1630116301
bundleType: 0,
16302-
version: "19.0.0-native-fb-459fd418-20241001",
16302+
version: "19.0.0-native-fb-b78a7f2f-20241007",
1630316303
rendererPackageName: "react-dom",
1630416304
currentDispatcherRef: ReactSharedInternals,
1630516305
findFiberByHostInstance: getClosestInstanceFromNode,
16306-
reconcilerVersion: "19.0.0-native-fb-459fd418-20241001",
16306+
reconcilerVersion: "19.0.0-native-fb-b78a7f2f-20241007",
1630716307
getLaneLabelMap: function () {
1630816308
for (
1630916309
var map = new Map(), lane = 1, index$286 = 0;
@@ -16576,7 +16576,7 @@ exports.useFormState = function (action, initialState, permalink) {
1657616576
exports.useFormStatus = function () {
1657716577
return ReactSharedInternals.H.useHostTransitionStatus();
1657816578
};
16579-
exports.version = "19.0.0-native-fb-459fd418-20241001";
16579+
exports.version = "19.0.0-native-fb-b78a7f2f-20241007";
1658016580
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1658116581
"function" ===
1658216582
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)