Skip to content

Commit 9133172

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Remove deprecated Libraries/ReactPrivate forwarding modules
Summary: The `react-private-interface` and `setup-env` entry points now provide the private contract between React and React Native that `Libraries/ReactPrivate/` forwarded to, so the deprecated forwarding modules can be removed. **This diff** - Delete `Libraries/ReactPrivate/` — `ReactNativePrivateInterface`, `ReactNativePrivateInitializeCore`, and their `.flow`/`README` files. - Repoint internal `packages/react-native` imports directly at their source modules instead of the `react-private-interface` aggregator: `AnimatedProps` and two integration tests now import `getNodeFromPublicInstance` from `ReactFabricPublicInstance`, and `index.js.flow` re-exports `PublicRootInstance`/`PublicTextInstance` from there (adding a `PublicTextInstance` export to that module). - Repoint the remaining consumers at the `react-native/react-private-interface` entry point. - Drop the stale `Libraries/ReactPrivate/ReactNativePrivateInterface` entries from the eslint and Flow-codemod `publicAPIMapping`s and the `rn-arch` migration-list filters. Changelog: [Internal] Differential Revision: D114055938
1 parent b8bde02 commit 9133172

12 files changed

Lines changed: 11 additions & 63 deletions

File tree

‎packages/eslint-plugin-react-native/utils.js‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,6 @@ const publicAPIMapping = {
519519
default: null,
520520
types: ['ErrorUtils'],
521521
},
522-
'Libraries/ReactPrivate/ReactNativePrivateInterface': {
523-
default: null,
524-
types: ['PublicRootInstance', 'PublicTextInstance'],
525-
},
526522
};
527523

528524
module.exports = {

‎packages/react-native/Libraries/Animated/nodes/AnimatedProps.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import type {AnimatedStyleAllowlist} from './AnimatedStyle';
1616
import NativeAnimatedHelper from '../../../src/private/animated/NativeAnimatedHelper';
1717
import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
1818
import {getFabricUIManager} from '../../ReactNative/FabricUIManager';
19+
import {getNodeFromPublicInstance} from '../../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
1920
import {findNodeHandle} from '../../ReactNative/RendererProxy';
20-
import {getNodeFromPublicInstance} from '../../ReactPrivate/ReactNativePrivateInterface';
2121
import flattenStyle from '../../StyleSheet/flattenStyle';
2222
import {AnimatedEvent} from '../AnimatedEvent';
2323
import AnimatedNode from './AnimatedNode';

‎packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ export function createPublicTextInstance(
5555
return new ReadOnlyText(internalInstanceHandle, ownerDocument);
5656
}
5757

58+
export type PublicTextInstance = ReturnType<typeof createPublicTextInstance>;
59+
5860
export function getNativeTagFromPublicInstance(
5961
publicInstance: ReactNativeElement,
6062
): number {

‎packages/react-native/Libraries/ReactPrivate/README‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore.js‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎packages/react-native/ReactNativeApi.d.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<590f18ec6caea33fef591da5d56419f4>>
7+
* @generated SignedSource<<b1273b105161b7b40e5571f4235a4812>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -1823,7 +1823,6 @@ declare function createPublicTextInstance(
18231823
internalInstanceHandle: InternalInstanceHandle,
18241824
ownerDocument: ReactNativeDocument_default,
18251825
): ReadOnlyText_default
1826-
declare type createPublicTextInstanceT = typeof createPublicTextInstance
18271826
declare type CursorValue = "auto" | "pointer"
18281827
declare type DataDetectorTypesType =
18291828
| "address"
@@ -3705,7 +3704,7 @@ declare type ProgressBarAndroidProps =
37053704
declare type PublicRootInstance = symbol & {
37063705
__PublicRootInstance__: string
37073706
}
3708-
declare type PublicTextInstance = ReturnType<createPublicTextInstanceT>
3707+
declare type PublicTextInstance = ReturnType<typeof createPublicTextInstance>
37093708
declare interface PushNotification {
37103709
finish(result: string): void
37113710
getAlert(): (Object | undefined) | (string | undefined)
@@ -5941,7 +5940,7 @@ export {
59415940
ProgressBarAndroidInstance, // ab545ef1
59425941
ProgressBarAndroidProps, // 6484d368
59435942
PublicRootInstance, // 8040afd7
5944-
PublicTextInstance, // 6937c7bf
5943+
PublicTextInstance, // 16c26204
59455944
PushNotificationEventName, // 84e7e150
59465945
PushNotificationIOS, // b4d1fe78
59475946
PushNotificationPermissions, // c2e7ae4f

‎packages/react-native/index.js.flow‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ export type {ErrorUtils} from './Libraries/vendor/core/ErrorUtils';
497497
export type {
498498
PublicRootInstance,
499499
PublicTextInstance,
500-
} from './Libraries/ReactPrivate/ReactNativePrivateInterface';
500+
} from './Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
501501

502502
export type {
503503
EventSubscription,

‎packages/react-native/src/private/__tests__/utilities/__tests__/ShadowNodeReferenceCounter-itest.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
1414
import type {Node} from '../../../../../Libraries/Renderer/shims/ReactNativeTypes';
1515
import type {HostInstance} from 'react-native';
1616

17-
import {getNodeFromPublicInstance} from '../../../../../Libraries/ReactPrivate/ReactNativePrivateInterface';
17+
import {getNodeFromPublicInstance} from '../../../../../Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
1818
import isUnreachable from '../isUnreachable';
1919
import {
2020
createShadowNodeReferenceCounter,

0 commit comments

Comments
 (0)