Commit Graph

1111 Commits

Author SHA1 Message Date
Marco Wang da9136f587 Turn on null strict comparison check for xplat js (#53379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53379

X-link: https://github.com/facebook/react/pull/34240

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D80648362

fbshipit-source-id: cc47ae207f29a3ddb68bc0e029b8773f89503c52
2025-08-21 16:46:23 -07:00
Sam Zhou 89fd398342 Update hermes-parser and related packages in fbsource to 0.32.0 (#53377)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53377

Bump hermes-parser and related packages to [0.32.0](https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: gkz

Differential Revision: D80622389

fbshipit-source-id: d35ad5179eacbc83132517e6b9c9436fda972d28
2025-08-20 11:45:16 -07:00
Marco Wang 8351a5d186 Pre-Suppress errors for xplat/js for general strict comparison in non-generated files (#53342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53342

Commands

```
scripts/flow/tool add-comments --comment 'Error discovered during Constant Condition roll out. See https://fburl.com/workplace/4oq3zi07.' .
```
```
arc f
```

drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D80487235

fbshipit-source-id: 9e7c1a2641ddc0da0400fa1aff598b112a0434d5
2025-08-19 01:09:22 -07:00
Sam Zhou cf664c65e2 Standardize subtyping error code into incompatible-type in react native and metro (#53312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53312

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D80400976

fbshipit-source-id: 196af69c0b9621b2a2675b232406639773e04933
2025-08-18 09:04:31 -07:00
George Zahariev c7591d9b40 Update hermes-parser and related packages in fbsource to 0.31.2 (#53313)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53313

Bump hermes-parser and related packages to [0.31.2](https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D80408745

fbshipit-source-id: 38aff450c0e44db23624f4769f1c7856440fb785
2025-08-17 21:45:53 -07:00
Sam Zhou 35bee1a857 Add annotations to fix future natural inference errors in xplat/js
Summary: Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D80207164

fbshipit-source-id: e9a786c83f89a97db8b383812767978c47d9536c
2025-08-13 18:15:27 -07:00
David Vacca 1a85185cfc Deprecate ShadowNodes on the codegen (#53184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53184

Deprecate ShadowNodes on the codegen

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D79911692

fbshipit-source-id: ad24488d186fd5b82c3953a75f52be03e4770cc2
2025-08-09 04:39:35 -07:00
Riccardo Cipolleschi e547f466ee Improve codegen to add getDebugProps to components (#53135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53135

Our Codegenerated components are not generating code for `getDebugProps`. This change modifies Codegen to add those functions for all the codegen components.

## Changelog:
[General][Added] - Added getDebugProps to codegen

## Facebook:
`getDebugProps` are required by Fantom to write tests. However, we can't generate these function for third party components, because codegen can generate arbitrary structs and we don't have a generic `toString()` method that can be used or automatically generated by C++.

By generating this function only for Core Components, we can ensure that we can write Fantom tests without breaking all the users of React Native.

Reviewed By: rubennorte

Differential Revision: D79805145

fbshipit-source-id: 0e41c65fc30eaa886a05557ca233fb0a9cb18a71
2025-08-08 06:47:23 -07:00
Tommy Nguyen bf2c3af93b fix(codegen): fix missing dependencies (#52884)
Summary:
`react-native/codegen` uses `babel/parser` and `babel/core` but does not declare dependency on them. Depending on how packages are hoisted (and especially in pnpm setups), this causes crashes during codegen.

Resolves https://github.com/facebook/react-native/issues/52883

## Changelog:

[GENERAL] [FIXED] - Add missing Babel dependencies

Pull Request resolved: https://github.com/facebook/react-native/pull/52884

Test Plan: See https://github.com/facebook/react-native/issues/52883

Reviewed By: cortinico, christophpurrer

Differential Revision: D79103092

Pulled By: robhogan

fbshipit-source-id: ecaf690f994393a652ea7f0d4f30bbabeb23a434
2025-08-06 08:19:47 -07:00
Sam Zhou af1bcb6d44 Mass replace $FlowIgnore with $FlowFixMe in react-native (#53076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53076

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79672242

fbshipit-source-id: 560f057d8658ed602cf7241e584bade70d8f3a99
2025-08-05 15:44:41 -07:00
Sam Zhou 869a976a5d Bump to prettier v3 across xplat (#52844)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52844

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78787920

fbshipit-source-id: fc2582001ee6775f53b452dd3659e37521ea6387
2025-07-27 18:50:47 -07:00
Sam Zhou f47da61e51 Bump hermes-parser related packages across fbsource (#52841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52841

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D78949440

fbshipit-source-id: 5c5015f602b9fe591aa68f179163bd37dfb0dcff
2025-07-25 10:46:51 -07:00
Sam Zhou f697b5ad5c Make functions async and add await to prepare for prettier v3 upgrade: 6/n (#52770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52770

Prettier v3 has an async API. This diff adds in async and await ahead of the upgrade to prepare for the API change.

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78752906

fbshipit-source-id: 2deeecfc283be30fd0840b2a089604f4e6804af5
2025-07-22 16:18:26 -07:00
Sam Zhou 2c3a00b7b1 Use the prettier config at the root for react-native-codegen (#52746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52746

The config is needed for build, so I renamed it. In this way, the formatting of js code in react-native repo will be consistently controlled by the prettier config in the root. This change will make prettier v3 upgrade easier.

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78700564

fbshipit-source-id: 392ed490bf814870f285c8372ff68b454e228802
2025-07-21 19:45:34 -07:00
Sam Zhou 7970ee9998 Prepare react-native for prettier v3: 2/n (#52745)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52745

Prettier v3 no longer loads plugin implicitly. This diff first configures the hermes-parser plugin explicitly to prepare for v3 rollout. D78590158 missed this config.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D78673890

fbshipit-source-id: 1931718ef2b3f011621bf4d64c8936a698506374
2025-07-21 15:22:17 -07:00
Sam Zhou 976055e52b Add annotations or make things readonly to prepare for array literal soundness fix
Summary: Changelog: [Internal]

Reviewed By: abhinayrathore, marcoww6

Differential Revision: D78689934

fbshipit-source-id: f749c4a0a6c34c80f09e4aaa05200ff282151838
2025-07-21 15:13:17 -07:00
Nicola Corti 9f0903780b Bump monorepo packages to 0.82.0-main (#52706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52706

This just prepares the repo for the next branch cut.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D78558445

fbshipit-source-id: 2132d560dad447b3685874438387a519587f8554
2025-07-18 09:23:10 -07:00
Alex Hunt e247be793c Lower minimum Node.js version to 20.19.4 (#52678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52678

From partner feedback, there's still appetite to support Node 20.x for the next <1y of life. Lower min version to `20.19.4` (Jul 2025) and widen test matrix in CI.

Changelog:
[General][Breaking] - Our new minimum Node version is Node.js 20 (Overrides #51840)

Reviewed By: cortinico

Differential Revision: D78494491

fbshipit-source-id: c8d9dc6250cb11f8a12ca7e761b65f4a8dae9265
2025-07-18 03:32:13 -07:00
David Vacca c2f39cfdd8 Revert Refactor ViewManagerInterfaces codegen to generate kotlin classes (#52593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52593

Revert Refactor ViewManagerInterfaces codegen to generate kotlin classes since commands are not respecting nullability

changelog: [internal] internal

Reviewed By: bvanderhoof

Differential Revision: D78308183

fbshipit-source-id: f3d8017d4bc6473deef0fd49c000543913905cd9
2025-07-14 21:22:21 -07:00
Pieter De Baets 2321ae17ea Cleanup react-native-codegen DEFS [reland] (#52506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52506

* Re-enable tests
* Simplify logic to avoid bypasses for arc focus

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D78000411

fbshipit-source-id: e2960a9848ce27385da00214018e7996d7c27561
2025-07-14 07:42:12 -07:00
David Vacca 79ca9036d3 Refactor ViewManagerInterfaces codegen to generate kotlin classes (#52545)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52545

Pull Request resolved: https://github.com/facebook/react-native/pull/51735

This diff refactors the ViewManagerInterfaces codegen to generate kotlin classes,

As a consequence of this change, there are some ViewManagerInterfaces that have changed their APIs

## Changelog: [Android][Breaking] - Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)

Reviewed By: cortinico

Differential Revision: D78118738

fbshipit-source-id: cdd9e660e55397bd0936efce1c5aaf90c2946b7a
2025-07-13 19:18:26 -07:00
Adan Moreno eb61e6f783 Revert D77143018: Cleanup react-native-codegen DEFS
Differential Revision:
D77143018

Original commit changeset: 06ec43ce5149

Original Phabricator Diff: D77143018

fbshipit-source-id: cec53068f88548c4494da315914763beb6730573
2025-07-08 16:29:45 -07:00
Pieter De Baets 120a417320 Cleanup react-native-codegen DEFS (#52468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52468

* Re-enable tests
* Simplify logic to avoid bypasses for arc focus

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77143018

fbshipit-source-id: 06ec43ce5149a139db78d38630191b01bc520461
2025-07-08 04:53:51 -07:00
Nick Lefever 27723c70b7 Clean up prop diffing gen (#52436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52436

Reordered the different property types in the switch/case to group similar outputs together.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D77799101

fbshipit-source-id: 5b7c6d188e9ffa0f1e41f44f82f438afeda04d74
2025-07-05 06:19:23 -07:00
Nicola Corti 2d0aa1a747 Revert Refactor ViewManagerInterfaces codegen to generate kotlin classes
Summary:
reverting Refactor ViewManagerInterfaces codegen to generate kotlin classes because of warning in OSS, we will reland after 0.81 cut

Changelog: [Android][Breaking] - Revert of Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)

Reviewed By: lenaic, mlord93

Differential Revision: D77759777

fbshipit-source-id: c24b216b231cdc53296d8c9fca8d789d80daa596
2025-07-04 02:48:42 -07:00
David Vacca 76ff1aa5c6 Refactor ViewManagerInterfaces codegen to generate kotlin classes (#51735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51735

This diff refactors the ViewManagerInterfaces codegen to generate kotlin classes,

As a consequence of this change, there are some ViewManagerInterfaces that have changed their APIs

## Changelog: [Android][Breaking] - Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)

Reviewed By: javache

Differential Revision: D75719542

fbshipit-source-id: 7e9aa7ccc24e827bd7b6df72b3302e852932e731
2025-07-03 12:19:42 -07:00
Nicola Corti b578a70bd5 Bump packages for next release (#52359)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52359

This is needed ahead of the 81 branch cut.

Changelog:
[Internal] - Bump all packages to 0.81.0-main

Reviewed By: huntie

Differential Revision: D77602196

fbshipit-source-id: 1b52a7d1577783d72aba8d20f98032f29ffcc7df
2025-07-02 03:53:34 -07:00
George Zahariev 2e6cf96e47 Update hermes-parser and related packages in xplat/arvr/socialvr to 0.29.1 (#52316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52316

Bump hermes-parser and related packages to [0.29.1](https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D77431991

fbshipit-source-id: d0ab4d7a338fdb68a529ed8151c7e1924600a809
2025-06-27 21:48:28 -07:00
Sam Zhou 505588b9aa Add annotations or make things readonly to prepare for object literal soundness fix in react-native (#52305)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52305

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77386425

fbshipit-source-id: d69184abb1c8f7c516229aafe24dd418b5dd887e
2025-06-26 13:24:24 -07:00
Nick Lefever c6608685cb Mark prop diffing availability for codegen props (#52246)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52246

This diff adds the required override to codegen props to make the `FabricMountingManager` aware of the availability of a prop diffing implementation for native components using codegen props.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234066

fbshipit-source-id: 8e95628348f491c5ee08609bc7d7b3d30bc7151b
2025-06-25 18:28:22 -07:00
Nick Lefever 53ce247dbd Add codegen for MixedType diffing (#52266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52266

Native components may use `MixedType` properties in rare cases to hold untyped data. This diff adds support for serializing and prop diffing these types of props so that all of the props and object fields would be included in prop diffing results.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77307169

fbshipit-source-id: ae6b00207ef857c9cfa4bdf9c235972915410a29
2025-06-25 18:28:22 -07:00
Nick Lefever e441954c82 Add codegen for ArrayType diffing (#52244)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52244

The ArrayType props converts to std::vector. This prompted the need for `toDynamic(const T&)` conversion functions as this breaks to potential reliance on all type instances having a `toDynamic()` function available. This includes:
- array of arrays types
- array of objects types
- object with arrays

The ArrayType conversion uses the availability of the `toDynamic` conversion methods for all supported types to convert the values stored by the `std::vector` to `folly::dynamic` values to be stored on a `folly::dynamic::array`.

The diff removes unnecessary conversion methods implemented previously for the core components prop diffing. These are now handled by the generic `toDynamic(const std::vector<T>&)` conversion method.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234065

fbshipit-source-id: 97a3b175ff07fe4a6de3adb14ee6cb42db1a2cfe
2025-06-25 18:28:22 -07:00
Nick Lefever b50ad49a4d Add codegen for ObjectType diffing (#52243)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52243

Building on the availability of `toDynamic` conversion methods for all supported property types, this diff adds support for diffing of `ObjectType` props.

The template adds the generation of a default comparator for the generated C++ struct. The struct also gains a `toDynamic` conversion method that will convert each property of the object type to a `folly::dynamic` value.

Primitive types make use of the implicit conversion supported by `folly::dynamic`, all other types are converted using `toDynamic`.

The `toDynamic` logic is implemented as a method defined on the struct to avoid increased binary size when required multiple times by the prop diffing implementation.

The external `toDynamic` conversion function calls the struct method directly. This enables support for converting object types using object types within their props.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234064

fbshipit-source-id: 21deb3104303aa374fb65b969af57a6aca6db38c
2025-06-25 18:28:22 -07:00
Nick Lefever 8c806ec31b Add codegen for DimensionType diffing (#52242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52242

Codegen supports `DimensionType` props which represents a YGValue. This diff adds a conversion to `folly::dynamic` supporting all the existing value types `YGValue` can represent.

This completes codegen support for all allowed `ReservedPropTypeAnnotation` prop types.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234061

fbshipit-source-id: 6c3aef5e3ab0459d8a68ebd8efaccfecb83b0b08
2025-06-25 18:28:22 -07:00
Nick Lefever a164874b1a Add codegen for EnumType diffing (#52241)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52241

Add support for converting string and int32 enum types to `folly::dynamic` and generating the correct property diffing for it conditionally adding the prop value to the prop diff result.

This diff updates the template to convert the enum back to the original string representation provided from the JS side based on the current generated C++ enum value.

The string enum re-uses the existing `toString` conversion. The number enum generates the switch-case mapping required to map back the C++ enum value to the original value assigned to it.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234070

fbshipit-source-id: 8c669d5b2e21bd6022c6ba36149465495e4d4bf3
2025-06-25 18:28:22 -07:00
Nick Lefever 3d97bac5f2 Add codegen for EdgeInset type diffing (#52239)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52239

Add `toDynamic` conversion function for `EdgeInset` which allowed for removing the custom conversion implemented for the `ViewProps`.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234069

fbshipit-source-id: 3aecad8a6d78468f0056167fa1523ccdfb68f369
2025-06-25 04:33:12 -07:00
Nick Lefever 9b82e706fb Add codegen for PointPrimitive prop type diffing (#52238)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52238

Add prop diffing codegen for `PointPrimitive` prop type by adding a `toDynamic` conversion for the struct and the prop diffing conditional result update.

The addition of the `toDynamic` function will allow for converting the type when used in array and object types.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234062

fbshipit-source-id: d0f52e8fd78ac7712925ea2a47cdd0fe3392d5b0
2025-06-25 04:33:12 -07:00
Nick Lefever da0938edfd Add toDynamic conversion function for ImageSource (#52237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52237

For array props conversion following later in this stack, each type should have a toDynamic conversion available that can be called upon to convert all supported types to a `folly::dynamic` result.

This diff adds the toDynamic conversion function for `ImageSource`

 Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234063

fbshipit-source-id: 392cbaf172595936f7f66faa824900dadd58bdcf
2025-06-25 04:33:12 -07:00
George Zahariev 3306691d64 Update hermes-parser and related packages in xplat and socialvr to 0.29.0 (#52211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52211

Update hermes-parser and related packages in xplat and socialvr to 0.29.0

Changelog: [Internal]

Blocked on: https://fb.workplace.com/groups/relay.support/posts/28766057099682865

Reviewed By: SamChou19815

Differential Revision: D77004095

fbshipit-source-id: 5400ac07c0cbf1f9709d374929d842af9dd15d08
2025-06-23 19:19:50 -07:00
Rubén Norte a15fc102e6 Add support for opaque types in Flow codegen for native modules (#52052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52052

Changelog: [General][Added] - Add support for Flow opaque types in codegen for native modules

This allows us to codegen native modules that expose opaque types, but the implementation sees the type the same way they're visible in the JS spec.

Reviewed By: yungsters

Differential Revision: D76741112

fbshipit-source-id: 100ca9aa7f93d35120c52153f756436c9c380b07
2025-06-17 02:24:22 -07:00
David Vacca 3a0a7b0701 Export RNCodegen types (#52048)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52048

This diff exports types defined in RNCodegen to be used by other codegens

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D76472492

fbshipit-source-id: fa236a254a9a4211d2e00ace436f55978a262a76
2025-06-16 09:46:31 -07:00
Arushi Kesarwani b417b0c2d5 Extract out FBReactNativeSpec's core components including Unimplemented from auto-generated registry (#51941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51941

Changelog:
[Android][Fixed] - Extract out FBReactNativeSpec's core components including Unimplemented from auto-generated registry

Extracting out `FBReactNativeSpec`'s core components including `UnimplementedNativeView` from auto-generated registry. Using this `libraryName` to skip merging those modules

Reviewed By: RSNara

Differential Revision: D76371796

fbshipit-source-id: 4cfee0fe80a661f159a5f17e0d4abc60f601ea74
2025-06-13 10:18:50 -07:00
David Vacca e61daa831d Introduce parameter to customize libraryGenerators used in the codegen (#51991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51991

This diff introduces a new parameter to customize libraryGenerators used in the codegen, since I'm adding a default object, this diff shoulnd't change any behavior

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D76472495

fbshipit-source-id: 50b9095c7c554e368f65e4c0b5539be0cca51a51
2025-06-12 22:22:20 -07:00
David Vacca a8386aa878 Prevent exporting internal objects of codegen (#51990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51990

In this diff I'm limiting visibility of internal objects of codegen, these objects are being exported but they are unused, let's avoid exporting them

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D76470809

fbshipit-source-id: 0e168558d2d3211ab5a3a3de05e2495d7c1ae4f5
2025-06-12 22:22:20 -07:00
David Vacca e8b55a4456 Add flowTypes for codegen LIBRARY_GENERATORS (#51987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51987

In this diff I'm adding flowTypes for codegen LIBRARY_GENERATORS

changelog: [internal] internal

Reviewed By: huntie

Differential Revision: D76470808

fbshipit-source-id: 8e2bddeda1f9175fd25fee04f8fdd3cb7c7faa49
2025-06-12 22:22:20 -07:00
David Vacca 79354eb0b5 Update documentation for codegen options interfaceOnly (#51924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51924

In this diff I'm updating the documentation for codegen options `interfaceOnly`

changelog: [internal] internal

Reviewed By: arushikesarwani94, cortinico

Differential Revision: D76293414

fbshipit-source-id: 9a8fd752302d4167c8764ce76c0038cd5cc47d7f
2025-06-10 08:03:23 -07:00
Tim Yung ad652cf99c sort-imports: Update Rule Definition (#51880)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51880

Updates the `sort-imports` lint rule.

The main change is that it enforces newlines after the last import statement.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D76149902

fbshipit-source-id: 928871655c5de0613b18334d6fc0d71b3a971a18
2025-06-09 20:30:32 -07:00
Alex Hunt 62bf92c896 Replace chalk in packages (#51905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51905

Replaces `chalk` with Node's `util.styleText` in `packages/`.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D76273412

fbshipit-source-id: edaea5896751be1252056e0858daae46e97acc46
2025-06-09 18:21:18 -07:00
Arushi Kesarwani 6104ccdc6e Correct the excludePlatforms logic in combining schema step of Codegen (#51910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51910

**Changelog:**
[Android] [Fixed] - Fix combining schema in Codegen process to exclude platforms correctly

Discovered an issue with how we are excluding platforms in processing codegen schema.

`excludedPlatforms` is a field on `OptionsShape` part of `ComponentShape` not Module

https://www.internalfb.com/code/fbsource/[153d78d4cd5d0fa652e5a0919bcdb26f32d0945e]/xplat/js/react-native-github/packages/react-native-codegen/src/CodegenSchema.js?lines=112

Hence for components modifying the script to iterate over component and for then exclude accordingly based on `platform`.

Reviewed By: cipolleschi

Differential Revision: D76158851

fbshipit-source-id: 791ec12d068794e36f34da7419082887483ce6c5
2025-06-09 16:13:46 -07:00
Pieter De Baets 198c6fc81c Make receiveCommand args non-nullable (#51806)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51806

Correct the type of args, which is always non-null. This is backwards-compatible as subclasses can override this method with a more permissive nullable type and still be substitutable.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75869317

fbshipit-source-id: 8f6c9119140794447eca55be24483a35450d7bb6
2025-06-06 22:07:09 -07:00