Skip to content

Commit

Permalink
[RN] Move definition of public instances to ReactNativePrivateInterfa…
Browse files Browse the repository at this point in the history
…ce (#32446)

## Summary

> [!NOTE]
> This only modifies types, so shouldn't have an impact at runtime.

Some time ago we moved some type definitions from React to React Native
in #26437.

This continues making progress on that so values that are created by
React Native and passed to the React renderer (in this case public
instances) are actually defined in React Native and not in React.

This will allow us to modify the definition of some of these types
without having to make changes in the React repository (in the short
term, we want to refactor PublicInstance from an object to an interface,
and then modify that interface to add all the new DOM methods).

## How did you test this change?

Manually synced `ReactNativeTypes` on top of
facebook/react-native#49602 and verified Flow
passes.

DiffTrain build for [9dd378f](9dd378f)
  • Loading branch information
rubennorte committed Feb 24, 2025
1 parent 0cf3a7f commit 66108fa
Show file tree
Hide file tree
Showing 24 changed files with 104 additions and 164 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.1.0-native-fb-70f1d766-20250220
19.1.0-native-fb-9dd378ff-20250224
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<f1ed5ad5b371cc0a68ed181603f90916>>
* @generated SignedSource<<9728716abd8fa7a6ba3e5f85b797037c>>
*/

"use strict";
Expand Down Expand Up @@ -428,5 +428,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<72d3f704544d715864166ac4b1c75da0>>
* @generated SignedSource<<da4d0d3c078718fce227ac463d401f6d>>
*/

"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.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<72d3f704544d715864166ac4b1c75da0>>
* @generated SignedSource<<da4d0d3c078718fce227ac463d401f6d>>
*/

"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.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<48efca5064ee325a05be1b5fbdf0be7a>>
* @generated SignedSource<<1bfdabbd828a9bc24d21d9b93dbb6ae5>>
*/

/*
Expand Down Expand Up @@ -25966,11 +25966,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-native-fb-70f1d766-20250220" !== isomorphicReactPackageVersion)
if ("19.1.0-native-fb-9dd378ff-20250224" !== 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.1.0-native-fb-70f1d766-20250220\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-native-fb-9dd378ff-20250224\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26007,10 +26007,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-70f1d766-20250220",
version: "19.1.0-native-fb-9dd378ff-20250224",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-70f1d766-20250220"
reconcilerVersion: "19.1.0-native-fb-9dd378ff-20250224"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26154,5 +26154,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c44047ca782aca9e0243330cff9c91c7>>
* @generated SignedSource<<9737a70fcef115b0bdca20ba8074742a>>
*/

/*
Expand Down Expand Up @@ -16001,14 +16001,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1785 = React.version;
if (
"19.1.0-native-fb-70f1d766-20250220" !==
"19.1.0-native-fb-9dd378ff-20250224" !==
isomorphicReactPackageVersion$jscomp$inline_1785
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1785,
"19.1.0-native-fb-70f1d766-20250220"
"19.1.0-native-fb-9dd378ff-20250224"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16030,10 +16030,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2245 = {
bundleType: 0,
version: "19.1.0-native-fb-70f1d766-20250220",
version: "19.1.0-native-fb-9dd378ff-20250224",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-70f1d766-20250220"
reconcilerVersion: "19.1.0-native-fb-9dd378ff-20250224"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2246 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16137,4 +16137,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<1e6e9e4ccb7333f635f86d3a0b383ed1>>
* @generated SignedSource<<709950585035b69d98367df2135ee568>>
*/

/*
Expand Down Expand Up @@ -16651,14 +16651,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1880 = React.version;
if (
"19.1.0-native-fb-70f1d766-20250220" !==
"19.1.0-native-fb-9dd378ff-20250224" !==
isomorphicReactPackageVersion$jscomp$inline_1880
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1880,
"19.1.0-native-fb-70f1d766-20250220"
"19.1.0-native-fb-9dd378ff-20250224"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16680,10 +16680,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1887 = {
bundleType: 0,
version: "19.1.0-native-fb-70f1d766-20250220",
version: "19.1.0-native-fb-9dd378ff-20250224",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-70f1d766-20250220",
reconcilerVersion: "19.1.0-native-fb-9dd378ff-20250224",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$294 = 0;
Expand Down Expand Up @@ -16802,4 +16802,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<471066554e17e344ada305ba7169bac5>>
* @generated SignedSource<<3799d5a81866bf08d1621dbb0d990782>>
*/

/*
Expand Down Expand Up @@ -26027,11 +26027,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-native-fb-70f1d766-20250220" !== isomorphicReactPackageVersion)
if ("19.1.0-native-fb-9dd378ff-20250224" !== 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.1.0-native-fb-70f1d766-20250220\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-native-fb-9dd378ff-20250224\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26068,10 +26068,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-70f1d766-20250220",
version: "19.1.0-native-fb-9dd378ff-20250224",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-70f1d766-20250220"
reconcilerVersion: "19.1.0-native-fb-9dd378ff-20250224"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26531,7 +26531,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
"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<<fd383d17c530517d8579fcf2307ddeb0>>
* @generated SignedSource<<310bc00b2161d032fd2e88ce8d8a102c>>
*/

/*
Expand Down Expand Up @@ -16012,14 +16012,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1786 = React.version;
if (
"19.1.0-native-fb-70f1d766-20250220" !==
"19.1.0-native-fb-9dd378ff-20250224" !==
isomorphicReactPackageVersion$jscomp$inline_1786
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1786,
"19.1.0-native-fb-70f1d766-20250220"
"19.1.0-native-fb-9dd378ff-20250224"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16041,10 +16041,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2248 = {
bundleType: 0,
version: "19.1.0-native-fb-70f1d766-20250220",
version: "19.1.0-native-fb-9dd378ff-20250224",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-70f1d766-20250220"
reconcilerVersion: "19.1.0-native-fb-9dd378ff-20250224"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2249 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16302,4 +16302,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<a9a3916225ae01d8d1b69b9cb1d6cebd>>
* @generated SignedSource<<06e3fe06fe06317bfa4623933475eb73>>
*/

/*
Expand Down Expand Up @@ -16666,14 +16666,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1881 = React.version;
if (
"19.1.0-native-fb-70f1d766-20250220" !==
"19.1.0-native-fb-9dd378ff-20250224" !==
isomorphicReactPackageVersion$jscomp$inline_1881
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1881,
"19.1.0-native-fb-70f1d766-20250220"
"19.1.0-native-fb-9dd378ff-20250224"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16695,10 +16695,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1888 = {
bundleType: 0,
version: "19.1.0-native-fb-70f1d766-20250220",
version: "19.1.0-native-fb-9dd378ff-20250224",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-70f1d766-20250220",
reconcilerVersion: "19.1.0-native-fb-9dd378ff-20250224",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$294 = 0;
Expand Down Expand Up @@ -16971,7 +16971,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
"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<<2c031d6875582379d6b56b2e73f68725>>
* @generated SignedSource<<6f006eb1a18533dc542cbad6323f5ad2>>
*/

"use strict";
Expand Down Expand Up @@ -15645,10 +15645,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-70f1d766-20250220",
version: "19.1.0-native-fb-9dd378ff-20250224",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-70f1d766-20250220"
reconcilerVersion: "19.1.0-native-fb-9dd378ff-20250224"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -15793,5 +15793,5 @@ __DEV__ &&
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<427b86bfb208a4f8cb7fbb90bb97fdb7>>
* @generated SignedSource<<a0d316e3b7b5ead0380e9d47c9c10302>>
*/

"use strict";
Expand Down Expand Up @@ -9784,10 +9784,10 @@ function wrapFiber(fiber) {
}
var internals$jscomp$inline_1389 = {
bundleType: 0,
version: "19.1.0-native-fb-70f1d766-20250220",
version: "19.1.0-native-fb-9dd378ff-20250224",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-70f1d766-20250220"
reconcilerVersion: "19.1.0-native-fb-9dd378ff-20250224"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1390 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -9923,4 +9923,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.1.0-native-fb-70f1d766-20250220";
exports.version = "19.1.0-native-fb-9dd378ff-20250224";
Loading

0 comments on commit 66108fa

Please sign in to comment.