Skip to content

Commit

Permalink
Update React Native shims to use export syntax (#31426)
Browse files Browse the repository at this point in the history
## Summary

I'm working to get the main `react-native` package parsable by modern
Flow tooling (both `flow-bundler`, `flow-api-translator`), and one
blocker is legacy `module.exports` syntax. This diff updates files which
are [synced to
`react-native`](https://github.com/facebook/react-native/tree/main/packages/react-native/Libraries/Renderer/shims)
from this repo.

## How did you test this change?

Files were pasted into `react-native-github` under fbsource, where Flow
validates ✅.

DiffTrain build for [5c56b87](5c56b87)
  • Loading branch information
sammy-SC committed Nov 7, 2024
1 parent f2a54ca commit 4cc587f
Show file tree
Hide file tree
Showing 27 changed files with 96 additions and 96 deletions.
2 changes: 1 addition & 1 deletion compiled-rn/VERSION_NATIVE_FB
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.0.0-native-fb-66855b96-20241106
19.0.0-native-fb-5c56b873-20241107
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<41e8d2e26be06713675a9eaf0808b2ad>>
* @generated SignedSource<<5c9a804b7140967367e1adde199edc5b>>
*/

"use strict";
Expand Down Expand Up @@ -420,5 +420,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<67f9de1fb639337086bdff0fcfe5c8fe>>
* @generated SignedSource<<ccd360770cecadb5ca13dc9612c85dc8>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<67f9de1fb639337086bdff0fcfe5c8fe>>
* @generated SignedSource<<ccd360770cecadb5ca13dc9612c85dc8>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<7614057aa0ac463da717b29ec88bf13e>>
* @generated SignedSource<<94fea17857c9333f3d426c5d8101ee03>>
*/

/*
Expand Down Expand Up @@ -25330,11 +25330,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-native-fb-66855b96-20241106" !== isomorphicReactPackageVersion)
if ("19.0.0-native-fb-5c56b873-20241107" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-native-fb-66855b96-20241106\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-native-fb-5c56b873-20241107\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25371,11 +25371,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-66855b96-20241106",
version: "19.0.0-native-fb-5c56b873-20241107",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-66855b96-20241106"
reconcilerVersion: "19.0.0-native-fb-5c56b873-20241107"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -25519,5 +25519,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<38668b12aae1b91e6fc1959969bfecd9>>
* @generated SignedSource<<ad55032984a8ad091176f3dcdcd4f124>>
*/

/*
Expand Down Expand Up @@ -15616,14 +15616,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1691 = React.version;
if (
"19.0.0-native-fb-66855b96-20241106" !==
"19.0.0-native-fb-5c56b873-20241107" !==
isomorphicReactPackageVersion$jscomp$inline_1691
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1691,
"19.0.0-native-fb-66855b96-20241106"
"19.0.0-native-fb-5c56b873-20241107"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15645,11 +15645,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2149 = {
bundleType: 0,
version: "19.0.0-native-fb-66855b96-20241106",
version: "19.0.0-native-fb-5c56b873-20241107",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-66855b96-20241106"
reconcilerVersion: "19.0.0-native-fb-5c56b873-20241107"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2150 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15753,4 +15753,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<60dee5299bc7a16503263a35dd60f6c3>>
* @generated SignedSource<<7ca24359ee46367021a2eb5c0094771a>>
*/

/*
Expand Down Expand Up @@ -16273,14 +16273,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1781 = React.version;
if (
"19.0.0-native-fb-66855b96-20241106" !==
"19.0.0-native-fb-5c56b873-20241107" !==
isomorphicReactPackageVersion$jscomp$inline_1781
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1781,
"19.0.0-native-fb-66855b96-20241106"
"19.0.0-native-fb-5c56b873-20241107"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16302,11 +16302,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1788 = {
bundleType: 0,
version: "19.0.0-native-fb-66855b96-20241106",
version: "19.0.0-native-fb-5c56b873-20241107",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-66855b96-20241106",
reconcilerVersion: "19.0.0-native-fb-5c56b873-20241107",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$286 = 0;
Expand Down Expand Up @@ -16425,4 +16425,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<532b066c9a1d12247edce4e991f2b6f2>>
* @generated SignedSource<<6cf36d550068fc1eff8d145f619445e6>>
*/

/*
Expand Down Expand Up @@ -25391,11 +25391,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-native-fb-66855b96-20241106" !== isomorphicReactPackageVersion)
if ("19.0.0-native-fb-5c56b873-20241107" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-native-fb-66855b96-20241106\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-native-fb-5c56b873-20241107\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25432,11 +25432,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-66855b96-20241106",
version: "19.0.0-native-fb-5c56b873-20241107",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-66855b96-20241106"
reconcilerVersion: "19.0.0-native-fb-5c56b873-20241107"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -25896,7 +25896,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<94539d5f2ac9ad00115a4aa0eff67fb8>>
* @generated SignedSource<<33e73d248be00fc8822953d7e4876584>>
*/

/*
Expand Down Expand Up @@ -15627,14 +15627,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1692 = React.version;
if (
"19.0.0-native-fb-66855b96-20241106" !==
"19.0.0-native-fb-5c56b873-20241107" !==
isomorphicReactPackageVersion$jscomp$inline_1692
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1692,
"19.0.0-native-fb-66855b96-20241106"
"19.0.0-native-fb-5c56b873-20241107"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15656,11 +15656,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2152 = {
bundleType: 0,
version: "19.0.0-native-fb-66855b96-20241106",
version: "19.0.0-native-fb-5c56b873-20241107",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-66855b96-20241106"
reconcilerVersion: "19.0.0-native-fb-5c56b873-20241107"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2153 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15918,4 +15918,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<a8ebeede504c5798cc6dac4455147324>>
* @generated SignedSource<<fe549a420e80e9ced3f8a11715c157c0>>
*/

/*
Expand Down Expand Up @@ -16288,14 +16288,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1782 = React.version;
if (
"19.0.0-native-fb-66855b96-20241106" !==
"19.0.0-native-fb-5c56b873-20241107" !==
isomorphicReactPackageVersion$jscomp$inline_1782
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1782,
"19.0.0-native-fb-66855b96-20241106"
"19.0.0-native-fb-5c56b873-20241107"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16317,11 +16317,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1789 = {
bundleType: 0,
version: "19.0.0-native-fb-66855b96-20241106",
version: "19.0.0-native-fb-5c56b873-20241107",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-66855b96-20241106",
reconcilerVersion: "19.0.0-native-fb-5c56b873-20241107",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$286 = 0;
Expand Down Expand Up @@ -16594,7 +16594,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<ba70e772a15573b287ef49ea1e302bfa>>
* @generated SignedSource<<bcffb9a209f16083ccd694533f8ed552>>
*/

"use strict";
Expand Down Expand Up @@ -15114,11 +15114,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-66855b96-20241106",
version: "19.0.0-native-fb-5c56b873-20241107",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-66855b96-20241106"
reconcilerVersion: "19.0.0-native-fb-5c56b873-20241107"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -15263,5 +15263,5 @@ __DEV__ &&
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<16d25d9766f9e175dbafcc8ba8d7118a>>
* @generated SignedSource<<88bd63cbc28ccc9f9f6fb119247414eb>>
*/

"use strict";
Expand Down Expand Up @@ -9469,14 +9469,14 @@ function wrapFiber(fiber) {
}
var internals$jscomp$inline_1348 = {
bundleType: 0,
version: "19.0.0-native-fb-66855b96-20241106",
version: "19.0.0-native-fb-5c56b873-20241107",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function (mockNode) {
mockNode = nodeToInstanceMap.get(mockNode);
return void 0 !== mockNode ? mockNode.internalInstanceHandle : null;
},
reconcilerVersion: "19.0.0-native-fb-66855b96-20241106"
reconcilerVersion: "19.0.0-native-fb-5c56b873-20241107"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1349 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -9612,4 +9612,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.0.0-native-fb-66855b96-20241106";
exports.version = "19.0.0-native-fb-5c56b873-20241107";
Loading

0 comments on commit 4cc587f

Please sign in to comment.