Skip to content

Commit 4c31f94

Browse files
rubennortemeta-codesync[bot]
authored andcommitted
Remove deprecated Libraries/ReactPrivate forwarding modules (#58452)
Summary: Pull Request resolved: #58452 **Cleanup**: The `react-private-interface` entry point (D111231527) now provides the private contract between React and React Native that `Libraries/ReactPrivate/` (deprecated) forwarded to. We can now delete. **Changes** - Delete `Libraries/ReactPrivate/` — `ReactNativePrivateInterface.js`, `ReactNativePrivateInitializeCore.js`, and their `.flow`/`README` files. - Update internal module references to point to source modules. - Update xplat/js references to use new private entry point. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D114055938
1 parent 954797a commit 4c31f94

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<<cf6a759b9ae1a69151a61e1babd1abd3>>
7+
* @generated SignedSource<<2c825695cab64d93b16f592a0c976755>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -1821,7 +1821,6 @@ declare function createPublicTextInstance(
18211821
internalInstanceHandle: InternalInstanceHandle,
18221822
ownerDocument: ReactNativeDocument_default,
18231823
): ReadOnlyText_default
1824-
declare type createPublicTextInstanceT = typeof createPublicTextInstance
18251824
declare type CursorValue = "auto" | "pointer"
18261825
declare type DataDetectorTypesType =
18271826
| "address"
@@ -3703,7 +3702,7 @@ declare type ProgressBarAndroidProps =
37033702
declare type PublicRootInstance = symbol & {
37043703
__PublicRootInstance__: string
37053704
}
3706-
declare type PublicTextInstance = ReturnType<createPublicTextInstanceT>
3705+
declare type PublicTextInstance = ReturnType<typeof createPublicTextInstance>
37073706
declare interface PushNotification {
37083707
finish(result: string): void
37093708
getAlert(): (Object | undefined) | (string | undefined)
@@ -5925,7 +5924,7 @@ export {
59255924
ProgressBarAndroidInstance, // ab545ef1
59265925
ProgressBarAndroidProps, // 6484d368
59275926
PublicRootInstance, // 8040afd7
5928-
PublicTextInstance, // 6937c7bf
5927+
PublicTextInstance, // 16c26204
59295928
PushNotificationEventName, // 84e7e150
59305929
PushNotificationIOS, // b4d1fe78
59315930
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)