From 61cb13488dc6f861d1ef08044fa1a99cd0fad7cd Mon Sep 17 00:00:00 2001 From: Marco Wang Date: Fri, 16 Jan 2026 15:15:41 -0800 Subject: [PATCH] Fix react-native-github/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__ Summary: codemoded. Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D90895159 --- .../components/ArrayPropsNativeComponent.js | 28 +++++++++---------- .../components/BooleanPropNativeComponent.js | 2 +- .../components/ColorPropNativeComponent.js | 2 +- .../DimensionPropNativeComponent.js | 2 +- .../EdgeInsetsPropNativeComponent.js | 2 +- .../components/EnumPropNativeComponent.js | 2 +- .../EventNestedObjectPropsNativeComponent.js | 6 ++-- .../components/EventPropsNativeComponent.js | 8 +++--- .../components/FloatPropsNativeComponent.js | 2 +- .../components/ImagePropNativeComponent.js | 2 +- .../components/IntegerPropNativeComponent.js | 2 +- .../InterfaceOnlyNativeComponent.js | 4 +-- .../components/MixedPropNativeComponent.js | 2 +- .../MultiNativePropNativeComponent.js | 2 +- .../NoPropsNoEventsNativeComponent.js | 2 +- .../components/ObjectPropsNativeComponent.js | 10 +++---- .../components/PointPropNativeComponent.js | 2 +- .../components/StringPropNativeComponent.js | 2 +- .../modules/NativeArrayTurboModule.js | 2 +- .../modules/NativeObjectTurboModule.js | 2 +- 20 files changed, 43 insertions(+), 43 deletions(-) diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ArrayPropsNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ArrayPropsNativeComponent.js index 515f4d7b51f..f8146d165da 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ArrayPropsNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ArrayPropsNativeComponent.js @@ -26,23 +26,23 @@ import type { import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props - names?: $ReadOnlyArray, - disableds?: $ReadOnlyArray, - progress?: $ReadOnlyArray, - radii?: $ReadOnlyArray, - colors?: $ReadOnlyArray, - srcs?: $ReadOnlyArray, - points?: $ReadOnlyArray, - edgeInsets?: $ReadOnlyArray, - dimensions?: $ReadOnlyArray, - sizes?: WithDefault<$ReadOnlyArray<'small' | 'large'>, 'small'>, - object?: $ReadOnlyArray<$ReadOnly<{prop: string}>>, - arrayOfObjects?: $ReadOnlyArray<$ReadOnly<{prop1: Float, prop2: Int32}>>, - arrayOfMixed?: $ReadOnlyArray, + names?: ReadonlyArray, + disableds?: ReadonlyArray, + progress?: ReadonlyArray, + radii?: ReadonlyArray, + colors?: ReadonlyArray, + srcs?: ReadonlyArray, + points?: ReadonlyArray, + edgeInsets?: ReadonlyArray, + dimensions?: ReadonlyArray, + sizes?: WithDefault, 'small'>, + object?: ReadonlyArray>, + arrayOfObjects?: ReadonlyArray>, + arrayOfMixed?: ReadonlyArray, }>; export default (codegenNativeComponent( diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/BooleanPropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/BooleanPropNativeComponent.js index d3de90da216..7da5395aec1 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/BooleanPropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/BooleanPropNativeComponent.js @@ -14,7 +14,7 @@ import type {WithDefault} from 'react-native/Libraries/Types/CodegenTypes'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ColorPropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ColorPropNativeComponent.js index 0a5afab7d14..ddd5effa319 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ColorPropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ColorPropNativeComponent.js @@ -14,7 +14,7 @@ import type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheet'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/DimensionPropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/DimensionPropNativeComponent.js index 167b8c9feb2..6aaa581eb55 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/DimensionPropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/DimensionPropNativeComponent.js @@ -14,7 +14,7 @@ import type {DimensionValue} from 'react-native/Libraries/StyleSheet/StyleSheetT import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EdgeInsetsPropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EdgeInsetsPropNativeComponent.js index 2b803dcd72f..a29b93782a3 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EdgeInsetsPropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EdgeInsetsPropNativeComponent.js @@ -13,7 +13,7 @@ import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTyp import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EnumPropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EnumPropNativeComponent.js index cb496d82756..9d0addfec50 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EnumPropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EnumPropNativeComponent.js @@ -14,7 +14,7 @@ import type {WithDefault} from 'react-native/Libraries/Types/CodegenTypes'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EventNestedObjectPropsNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EventNestedObjectPropsNativeComponent.js index 72d4edf6147..23a2c5da3f4 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EventNestedObjectPropsNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EventNestedObjectPropsNativeComponent.js @@ -18,17 +18,17 @@ import type { import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type OnChangeEvent = $ReadOnly<{ +type OnChangeEvent = Readonly<{ location: { source: {url: string, ...}, x: Int32, y: Int32, - arrayOfObjects: $ReadOnlyArray<{value: $ReadOnly<{str: string}>}>, + arrayOfObjects: ReadonlyArray<{value: Readonly<{str: string}>}>, ... }, }>; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EventPropsNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EventPropsNativeComponent.js index 6e53273df90..9de00b0d1a3 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EventPropsNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/EventPropsNativeComponent.js @@ -20,22 +20,22 @@ import type { import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type OnChangeEvent = $ReadOnly<{ +type OnChangeEvent = Readonly<{ value: boolean, source?: string, progress: ?Int32, scale?: ?Float, }>; -type OnEventDirect = $ReadOnly<{ +type OnEventDirect = Readonly<{ value: boolean, }>; -type OnOrientationChangeEvent = $ReadOnly<{ +type OnOrientationChangeEvent = Readonly<{ orientation: 'landscape' | 'portrait', }>; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/FloatPropsNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/FloatPropsNativeComponent.js index ad649eb7cf8..457b61440d1 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/FloatPropsNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/FloatPropsNativeComponent.js @@ -17,7 +17,7 @@ import type { import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ImagePropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ImagePropNativeComponent.js index 71bf1ee5b9d..f1990287e9b 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ImagePropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ImagePropNativeComponent.js @@ -14,7 +14,7 @@ import type {ImageSource} from 'react-native/Libraries/Image/ImageSource'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/IntegerPropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/IntegerPropNativeComponent.js index 76072895ded..65d5758daaa 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/IntegerPropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/IntegerPropNativeComponent.js @@ -17,7 +17,7 @@ import type { import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/InterfaceOnlyNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/InterfaceOnlyNativeComponent.js index 52de6cb1888..e64a78db992 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/InterfaceOnlyNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/InterfaceOnlyNativeComponent.js @@ -17,14 +17,14 @@ import type { import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props title?: WithDefault, // Events - onChange?: ?BubblingEventHandler<$ReadOnly<{value: boolean}>>, + onChange?: ?BubblingEventHandler>, }>; export default (codegenNativeComponent( diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/MixedPropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/MixedPropNativeComponent.js index 09eae0ae32d..4737d428c9e 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/MixedPropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/MixedPropNativeComponent.js @@ -14,7 +14,7 @@ import type {UnsafeMixed} from 'react-native/Libraries/Types/CodegenTypes'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/MultiNativePropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/MultiNativePropNativeComponent.js index 59f85ce698c..ff99793531c 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/MultiNativePropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/MultiNativePropNativeComponent.js @@ -16,7 +16,7 @@ import type {PointValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/NoPropsNoEventsNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/NoPropsNoEventsNativeComponent.js index 88eb670d4c1..82d817e34dc 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/NoPropsNoEventsNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/NoPropsNoEventsNativeComponent.js @@ -13,7 +13,7 @@ import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTyp import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // No Props or events diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ObjectPropsNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ObjectPropsNativeComponent.js index c74004a9be4..2446cf4ffde 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ObjectPropsNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/ObjectPropsNativeComponent.js @@ -21,15 +21,15 @@ import type { import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type ObjectArrayPropType = $ReadOnly<{ - array: $ReadOnlyArray, +type ObjectArrayPropType = Readonly<{ + array: ReadonlyArray, }>; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props - objectProp?: $ReadOnly<{ + objectProp?: Readonly<{ stringProp?: WithDefault, booleanProp: boolean, floatProp: Float, @@ -38,7 +38,7 @@ type NativeProps = $ReadOnly<{ intEnumProp?: WithDefault<0 | 1, 0>, }>, objectArrayProp: ObjectArrayPropType, - objectPrimitiveRequiredProp: $ReadOnly<{ + objectPrimitiveRequiredProp: Readonly<{ image: ImageSource, color?: ColorValue, point: ?PointValue, diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/PointPropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/PointPropNativeComponent.js index eae50a57c01..c0b4266b77f 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/PointPropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/PointPropNativeComponent.js @@ -14,7 +14,7 @@ import type {PointValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/StringPropNativeComponent.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/StringPropNativeComponent.js index 80c6d5b622e..76c69fa2ecf 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/StringPropNativeComponent.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/components/StringPropNativeComponent.js @@ -14,7 +14,7 @@ import type {WithDefault} from 'react-native/Libraries/Types/CodegenTypes'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; -type NativeProps = $ReadOnly<{ +type NativeProps = Readonly<{ ...ViewProps, // Props diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/modules/NativeArrayTurboModule.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/modules/NativeArrayTurboModule.js index c132fce4776..4602e22cc72 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/modules/NativeArrayTurboModule.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/modules/NativeArrayTurboModule.js @@ -17,7 +17,7 @@ type AnotherArray = Array; export interface Spec extends TurboModule { +getArray: (a: Array) => Array; - +getReadOnlyArray: (a: Array) => $ReadOnlyArray; + +getReadOnlyArray: (a: Array) => ReadonlyArray; +getArrayWithAlias: (a: AnotherArray, b: Array) => AnotherArray; } diff --git a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/modules/NativeObjectTurboModule.js b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/modules/NativeObjectTurboModule.js index e6137d7b1c9..74f36846727 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/modules/NativeObjectTurboModule.js +++ b/packages/react-native-codegen/e2e/deep_imports/__test_fixtures__/modules/NativeObjectTurboModule.js @@ -17,7 +17,7 @@ type AnotherGenericObject = GenericObject; export interface Spec extends TurboModule { +getGenericObject: (arg: Object) => Object; - +getGenericObjectReadOnly: (arg: Object) => $ReadOnly<{a: string}>; + +getGenericObjectReadOnly: (arg: Object) => Readonly<{a: string}>; +getGenericObjectWithAlias: (arg: GenericObject) => AnotherGenericObject; +difficultObject: (A: { D: boolean,