[react-native] Consume ReactNativeAttributePayloadFabric from ReactNativePrivateInterface (#33616)

## Summary

ReactNativeAttributePayloadFabric was synced to react-native in
0e42d33cbc.
We should now consume these methods from the
ReactNativePrivateInterface.

Moving these methods to the React Native repo gives us more flexibility
to experiment with new techniques for bridging and diffing props
payloads.

I did have to leave some stub implementations for existing unit tests,
but moved all detailed tests to the React Native repo.

## How did you test this change?

* `yarn prettier`
* `yarn test ReactFabric-test`
This commit is contained in:
Pieter De Baets
2025-06-25 10:23:36 +01:00
committed by GitHub
parent e67b4fe22e
commit 7a3ffef703
9 changed files with 82 additions and 1014 deletions

View File

@@ -32,6 +32,7 @@ type __MeasureLayoutOnSuccessCallback = (
type __ReactNativeBaseComponentViewConfig = any;
type __ViewConfigGetter = any;
type __ViewConfig = any;
type __AttributeConfiguration = any;
// libdefs cannot actually import. This is supposed to be the type imported
// from 'react-native-renderer/src/legacy-events/TopLevelEventTypes';
@@ -203,6 +204,15 @@ declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface'
declare export function getInternalInstanceHandleFromPublicInstance(
publicInstance: PublicInstance,
): ?Object;
declare export function createAttributePayload(
props: Object,
validAttributes: __AttributeConfiguration,
): null | Object;
declare export function diffAttributePayloads(
prevProps: Object,
nextProps: Object,
validAttributes: __AttributeConfiguration,
): null | Object;
}
declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore' {