Commit Graph

1246 Commits

Author SHA1 Message Date
Alex Hunt fc5e33b582 Reorganise shared script utils (#52473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52473

Shared utils that were located in the root of `scripts/` are now colocated closer to their dependencies or moved to `scripts/shared/` — simplifying the root directory layout.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77873875

fbshipit-source-id: e04dba41a1ef811d32793931033fdfa93afad0cd
2025-07-08 06:10:36 -07:00
Alex Hunt 918f02dcc3 Consolidate JS API scripts under scripts/js-api/, update docs (#52469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52469

Organise `scripts/build-types/` and `scripts/diff-api-snapshot/` into a single grouping `scripts/js-api/` parent dir — matching the newly relocated `scripts/cxx-api/`.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77865488

fbshipit-source-id: 33754d9275e65c3bda686294f18d855221ec7bff
2025-07-07 15:04:37 -07:00
Alex Hunt 5fe782a800 Move cxx-api scripts under scripts/, add README (#52467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52467

Moves the WIP `cxx-public-api` project under `scripts/cxx-api/`, add minimal README docs.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D77865490

fbshipit-source-id: ce49845386c468ee7422b864c49f2a8c9eed5a70
2025-07-07 15:04:37 -07:00
Sam Zhou 0666885f6a Deploy 0.275.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77800436

fbshipit-source-id: ff5a6a629c950959678d6a6311cda053f6b5dd4c
2025-07-04 11:55:28 -07:00
Moti Zilberman bf51035e04 Scaffolding for custom RNDT shell binary (#52357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52357

Changelog: [Internal]

Adds a hyper-minimal build script using `electron/packager` that produces custom binaries for the experimental React Native DevTools standalone shell. The main user-facing benefit of this is replacing the Electron name and icon with our own branding.

NOTE: `electron/packager` is designed to include the application code in the resulting binary. This is arguably overkill for us - the current launch model of `electron src/electron/index.js` is actually wholly sufficient for what we need - but I decided to go with the grain of the available tooling for simplicity.

Icon design courtesy of huntie. 🙏

Reviewed By: huntie

Differential Revision: D77591742

fbshipit-source-id: a968465df4f54fba54c874b6300788e151600ed7
2025-07-02 03:48:51 -07:00
Moti Zilberman 2d68a733f8 Fix run-ci-javascript-tests script (#52364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52364

Changelog: [Internal]

D76512374 broke error reporting in `run-ci-javascript-tests.js`. This is partly because the file was untyped and we missed that the `.code` check on the result of `execSync` was always going to be falsy. Also, `execSync`'s default error handling mechanism is not human-friendly - it throws an `Error` with `Buffer`s for stdout and stderr (see [example](https://github.com/facebook/react-native/actions/runs/16003656383/job/45144825919?pr=52357&fbclid=IwY2xjawLRyfpleHRuA2FlbQIxMQBicmlkETFZSG1xeWhTWWczR1paS0lKAR4pF46Z-J2CbSk7YdHZJ-N3F9eQJ7hR4EowfLV6mUtzMLg8j-EWdZiGY1la6A_aem_1Zbvn6fD5NS9YO-B7QJssg)).

Here, I'm adding types, removing dead code and preserving stdout and stderr from all child processes in a human-readable format.

Reviewed By: huntie

Differential Revision: D77648312

fbshipit-source-id: c6d98e668d6edf15729fa02fecb3408b9dd6debc
2025-07-02 03:09:18 -07:00
Dawid Małecki 71f2f05f03 Align breaking change detection with new snapshot format (#52353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52353

This diff aligns breaking change detection script with new snapshot format. It compares hashes to determine if the API changed for each specifier.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D77377762

fbshipit-source-id: e1c69692ace389fb08ae9470b9f9631e53834206
2025-07-01 08:58:15 -07:00
Dawid Małecki 128f5eb9ac Validate RN JS API snapshot on CI (#52352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52352

This diff adds excution of `yarn build-types --validate` to run RN JS API snapshot validation on CI.

### Motivation

Detect react-native public API changes before they land.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76340729

fbshipit-source-id: 10c465418e0ba4eb05cf557a16119f9756843d9e
2025-07-01 08:58:15 -07:00
Jakub Piasecki 55d8581584 Cover versionExportedApis transform with tests (#52311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52311

Changelog: [Internal]

Adds test coverage for `versionExportedApis` transform

Reviewed By: huntie

Differential Revision: D77427733

fbshipit-source-id: 7bc6279602ce6a4194930fdaf0eb790c88425cd5
2025-06-27 07:00:39 -07:00
Jakub Piasecki 5723de58b8 Explicitly cover more node types in versionExportedApis (#52310)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52310

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77427734

fbshipit-source-id: d9b8caee508166b2d47d5a160b0e326c4cd7783e
2025-06-27 07:00:39 -07:00
Alex Hunt d4bf1b7af0 Remove experimental notice from V2 API snapshot and build by default (#52301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52301

Readying for imminent productionisation.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77386064

fbshipit-source-id: 2769545eace4e6c09da0b2f0f34cf74b2fdcb730
2025-06-27 04:49: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
Andrew Datsenko d0770ce425 Introduce isOSS (#52222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52222

Changelog: [Internal]
Introduce environment option to force usage of OSS fantom test runner.
If env is not set - check for BUCK file in tester which is checked in for FB but not for OSS.

Reviewed By: rubennorte

Differential Revision: D77160761

fbshipit-source-id: 1701ff140ff2be1bbeacfb4305e9f89089cacb42
2025-06-26 11:03:20 -07:00
Alex Hunt 895f9b444a Improve stable hash input for local type names (#52300)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52300

Targeted improvement to `versionExportedApis` (D77303917) to reduce noise.

This eliminates the false positive from a rename to a local (unexported) type, that does not structurally change the shape of exported types.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D77314292

fbshipit-source-id: 4de90f5b5f1b622225762b2a73e386538000d54a
2025-06-26 10:46:23 -07:00
Alex Hunt e50133a43d Support namespaced references in snapshot type versioning (#52299)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52299

Correctness improvement to the `versionExportedApis` transform (D77303917). Now handles namespaced references (e.g. `Animated.Value`) by redirecting to the locally defined type name.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D77314293

fbshipit-source-id: 6442d3ab0a3c8bebf6593455b1c2fb74266e657f
2025-06-26 10:46:23 -07:00
Alex Hunt 050fb25c14 Add debug flag to show versionExportedApis graph in output (#52298)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52298

Exposes the ability to output inline debug annotations for the `versionExportedApis` transform (D77303917) as a formalised `--debug-version-annotations` CLI flag.

This is helpful for debugging and future maintenance, and will be used to show the effect of the next diffs.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D77373723

fbshipit-source-id: 91c91abcb657ab88ee2f8209efccb4024602acc7
2025-06-26 10:46:23 -07:00
Alex Hunt 94987205de Add versionExportedApis transform to JS API snapshot (#52292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52292

Adds a new transform that annotates all exported symbols in our V2 JS API snapshot with a version hash based on the shape of all input types.

This intends to be a reliable mechanism to indicate how changes to local types will ultimately affect exported types.

**Advantages** (over our alternative type inlining prototype)

- More intuitive to developers — in that source type changes are preserved closer to their original source code shapes.
- Enables useful Git blaming of individual exported APIs — hash for each export line will change every time a type is affected, and relevant commits can be looked up based on this.
- Handles recursive types.
- Can be **best-effort** with minimal structural effect over time. We are okay with false positives that over-match input type changes (these are refined later in the stack).
- Similar to this, is **lower risk** in terms of requiring future updates that may pollute the diff of the body of the API snapshot structurally.

**Example change**

Example type change with multiple references: D77378010

{F1979784798}

 8 char hash based on input type shapes printed next to each root-exported identifier
 For a source change to the `AccessibilityProps` type, 33 dependent exported types are updated with a new hash

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D77303917

fbshipit-source-id: 9d43a617697418218eb4951e8e9858d125e222b3
2025-06-26 10:46:23 -07:00
Jakub Piasecki df5cd55cdb Flatten built-in utility types in the API snapshot (#52280)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52280

Changelog: [Internal]

Adds a type-simplifyng transform for the API snapshot, with the goal of resolving some built-in TS types during build time. Most notably, it's able to simplify `Omit` structures emitted by the `flow-api-translator` when translating Flow's type spread operator.

It builds upon a simplified type inlining transform from the previous approach. The type inlining transform is able to handle inlining type references and resolution of built-in TS types on literal types:
- `Omit`
- `Readonly`
- `Partial`
- `keyof`

Reference inlining is performed top-down and built-in type resolution is performed bottom-up, which makes it possible for the second step to assume working on type literals.

Type simplifying transform uses the type inlining to reduce type references encountered inside `Omits` to their literal shapes, which makes possible to determine whether `Omit` is neccessary case-by-case. If `Omit` is redundant, it can be safely removed. If it's not, the omitted keys can be reduced to represent a subset of keys existing in the target type.

It also keeps the ability to resolve `Partial` and `Readonly` types on type literals, simplifying the snapshot further.

An example diff the transform can handle:
Before:
```
export declare type AccessibilityProps = Readonly<
  Omit<
    AccessibilityPropsAndroid,
    | keyof {
        accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
        accessibilityHint?: string
        accessibilityLabel?: string
        accessibilityRole?: AccessibilityRole
        accessibilityState?: AccessibilityState
        accessibilityValue?: AccessibilityValue
        accessible?: boolean
        "aria-busy"?: boolean
        "aria-checked"?: "mixed" | (boolean | undefined)
        "aria-disabled"?: boolean
        "aria-expanded"?: boolean
        "aria-hidden"?: boolean
        "aria-label"?: string
        "aria-selected"?: boolean
        "aria-valuemax"?: AccessibilityValue["max"]
        "aria-valuemin"?: AccessibilityValue["min"]
        "aria-valuenow"?: AccessibilityValue["now"]
        "aria-valuetext"?: AccessibilityValue["text"]
        role?: Role
      }
    | keyof AccessibilityPropsIOS
  > &
    Omit<
      AccessibilityPropsIOS,
      keyof {
        accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
        accessibilityHint?: string
        accessibilityLabel?: string
        accessibilityRole?: AccessibilityRole
        accessibilityState?: AccessibilityState
        accessibilityValue?: AccessibilityValue
        accessible?: boolean
        "aria-busy"?: boolean
        "aria-checked"?: "mixed" | (boolean | undefined)
        "aria-disabled"?: boolean
        "aria-expanded"?: boolean
        "aria-hidden"?: boolean
        "aria-label"?: string
        "aria-selected"?: boolean
        "aria-valuemax"?: AccessibilityValue["max"]
        "aria-valuemin"?: AccessibilityValue["min"]
        "aria-valuenow"?: AccessibilityValue["now"]
        "aria-valuetext"?: AccessibilityValue["text"]
        role?: Role
      }
    > & {
      accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
      accessibilityHint?: string
      accessibilityLabel?: string
      accessibilityRole?: AccessibilityRole
      accessibilityState?: AccessibilityState
      accessibilityValue?: AccessibilityValue
      accessible?: boolean
      "aria-busy"?: boolean
      "aria-checked"?: "mixed" | (boolean | undefined)
      "aria-disabled"?: boolean
      "aria-expanded"?: boolean
      "aria-hidden"?: boolean
      "aria-label"?: string
      "aria-selected"?: boolean
      "aria-valuemax"?: AccessibilityValue["max"]
      "aria-valuemin"?: AccessibilityValue["min"]
      "aria-valuenow"?: AccessibilityValue["now"]
      "aria-valuetext"?: AccessibilityValue["text"]
      role?: Role
    }
>
```

After:
```
export declare type AccessibilityProps = Readonly<
  AccessibilityPropsAndroid &
    AccessibilityPropsIOS & {
      accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
      accessibilityHint?: string
      accessibilityLabel?: string
      accessibilityRole?: AccessibilityRole
      accessibilityState?: AccessibilityState
      accessibilityValue?: AccessibilityValue
      accessible?: boolean
      "aria-busy"?: boolean
      "aria-checked"?: "mixed" | (boolean | undefined)
      "aria-disabled"?: boolean
      "aria-expanded"?: boolean
      "aria-hidden"?: boolean
      "aria-label"?: string
      "aria-selected"?: boolean
      "aria-valuemax"?: AccessibilityValue["max"]
      "aria-valuemin"?: AccessibilityValue["min"]
      "aria-valuenow"?: AccessibilityValue["now"]
      "aria-valuetext"?: AccessibilityValue["text"]
      role?: Role
    }
>
```

Reviewed By: huntie

Differential Revision: D77295302

fbshipit-source-id: 213aef46035bde4f9783353b5344a6986a418399
2025-06-26 03:05:27 -07:00
Jakub Piasecki 482f737ee1 Move stripping unstable identifiers earlier in the API Snapshot pipeline (#52260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52260

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77304456

fbshipit-source-id: 2c623fa6d5b6c75e985dc8aa79872019582c50d5
2025-06-25 07:47:38 -07:00
Jakub Piasecki dca83bc158 Move remaining transform to the typescript dir (#52247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52247

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77284561

fbshipit-source-id: 46a5a9d00223283423b791456db3613abfc063aa
2025-06-25 04:17:28 -07:00
Alex Hunt ece8ca82cd Update JS API snapshot to group exports in single block (#52235)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52235

Adds `organizeDeclarations` transform, replacing `sortTypeDefinitions`.

All `export declare ...` statements are now collected and represented at the end of the snapshot in a single `export {}` block — significantly improving readability and diffing.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77150017

fbshipit-source-id: 1bd451c0e2a18fd6fc0504970b10a5d2502ac872
2025-06-25 02:55:42 -07:00
Alex Hunt d012b2c19b Fix stripUnstableApis to match type alias declarations (#52229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52229

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77148443

fbshipit-source-id: 423da38dfe5ca42e639e274461868a51e9987384
2025-06-24 09:15:53 -07:00
Alex Hunt cfc6960bc4 Update all transforms to apply sequentially (#52228)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52228

To avoid unexpected behaviour, apply all Babel transforms within `build-types` sequentially, so that each transform plugin has an accurate starting AST.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77148444

fbshipit-source-id: f86beac12b7a08ef800e28db1ff88755970cf64e
2025-06-24 09:15:53 -07:00
Alex Hunt ef742dbc68 Subfolder build-types transforms by language (#52230)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52230

Reorganisation/refactoring.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77148446

fbshipit-source-id: fd29c6d47347efd5ad3da933b2112e864064dba7
2025-06-24 09:15:53 -07:00
Alex Hunt 03ab6a3098 Add nocommit to V2 JS API snapshot (#52200)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52200

Remains in an experimental format. Add `\nocommit` to prevent accidental inclusion in the repo right now.

Also disable ESLint rule `redundant-undefined/redundant-undefined`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77150743

fbshipit-source-id: 645e7db5af2c2a648eef7c8f7e324bc1264b8065
2025-06-24 06:31:04 -07:00
Dawid Małecki 76e04fac82 Replace shelljs in run-ci-javascript-tests.js (#52095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52095

This diff removes `shelljs` from `run-ci-javascript-tests.js` and replaces `echo, exec, and exit` methods.

### Motivation

Decrease number of references to `shelljs` across the react-native-github.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D76512374

fbshipit-source-id: 6e02901b570cf9a36bd13a075106a7066a85a2d9
2025-06-23 09:39:44 -07:00
Jakub Piasecki bc093b8fa9 Remove undefined from optional type members in the API snapshot (#52009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52009

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76596252

fbshipit-source-id: 3d6c0ee10cbbb71435933e2ad74f1acc962f14b4
2025-06-22 23:29:29 -07:00
Alex Hunt e297fe1582 Improve CLI output for build-types (#52151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52151

Update `yarn build-types` with incremental progress output in the terminal. Minor refactoring.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D77022957

fbshipit-source-id: d4a000a85c779fbdcda317164413b29674474178
2025-06-20 08:21:29 -07:00
Mateo Guzmán ccc8ce0d01 Remove lint-java (#52092)
Summary:
Following up from https://github.com/facebook/react-native/pull/52064#discussion_r2151906096, this PR removes lint-java and its related files.

The codebase is moving entirely to Kotlin and a Kotlin linter is being setup as well, the usage of the Java linter will become unnecessary.

## Changelog:

[INTERNAL] - Remove lint-java

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

Test Plan: Relying on CI here to be green.

Reviewed By: cortinico

Differential Revision: D76880712

Pulled By: sbuggay

fbshipit-source-id: 2736772e7347f435b17d007e0322e1afc2fb2d7b
2025-06-18 08:22:04 -07:00
Nicola Corti 9258e90c92 Publish, Close and Release the Maven repository during build_npm_package
Summary:
Due to us moving to central.sonatype.com for publishing, we cannot publish and release the Maven repository in 2 distinct invocations.
This consolidates all the publishing job to happen during build_npm_package

Changelog:
[Internal] [Changed] -

Reviewed By: fabriziocucci

Differential Revision: D76888543

fbshipit-source-id: 3cb0db6176ed2221a12b4f3f1f575232aa006a6c
2025-06-18 04:02:28 -07:00
Dawid Małecki 6b40f35032 Add diff-api-snapshot for public API breaking change detection (#51972)
Summary:
This diff adds snapshot `diff-api-snapshot` script for public JS API breaking change detection.

### Motivation
Detecting if there are any breaking changes introduced in the commit. It is achieved by comparing `ReactNativeApi.d.ts` rollup from the current and previous revision.

This is a naive implementation with a three possible outcomes:
- BREAKING
- POTENTIALLY_NOT_BREAKING,
- NOT_BREAKING

The algorithm analyses exported top-level statements (after inlining) in both rollups and tries to create a mapping between them by name.

The **BREAKING** outcome happens whenever the statement is:
- removed
- renamed
- changed
- not exported anymore (private)

The **POTENTIALLY_NOT_BREAKING** outcome  happens if it's not BREAKING and the new statement is added.

The **NOT_BREAKING** outcome happens if public API snapshot doesn't change.

Changelog:
[General][Added] - Add public JS API breaking change detection under `yarn diff-api-snapshot` script.

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

Test Plan:
Signals, added tests.

In `react-native-github` run:
`yarn test scripts/diff-api-snapshot/__tests__/diffApiSnapshot-test.js`

Rollback Plan:

Reviewed By: j-piasecki

Differential Revision: D76430965

Pulled By: coado

fbshipit-source-id: 095a196aa4f643501db0af9262556ddefff5d30d
2025-06-17 02:27:53 -07:00
Jakub Piasecki 7bfadb429c Update prettier config for the API Snapshot (#52031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52031

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D76710754

fbshipit-source-id: 36a07a2797b1270681420471aa66987163269a11
2025-06-17 00:06:13 -07:00
Jakub Piasecki faaec467b9 Strip unstable/experimental identifiers from the API snapshot (#52008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52008

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D73102445

fbshipit-source-id: fe2ce04b32c9d839fec8b33eda9c67e551918ba3
2025-06-17 00:06:13 -07:00
Gabriel Donadel 3ae9328571 Bump @types/react to 19.1 (#52059)
Summary:
While testing I notice that `types/react` was not updated in some peer depencies

## Changelog:

[GENERAL] [CHANGED] - Bump types/react to 19.1

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

Test Plan: CI should be green

Reviewed By: christophpurrer

Differential Revision: D76763084

Pulled By: sbuggay

fbshipit-source-id: c078c03aa57ca04040c64986dd7957da8a6f2c2d
2025-06-16 17:45:11 -07:00
Riccardo Cipolleschi a6ea626255 Remove the option to use JSC from core (#51946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51946

This change simplified the setp disallowing to use JSC from core.
As a side effect, it simplified the setup by always falling back to hermes if the users decides not to use the third party JSC

## Changelog:
[iOS][Removed] - remove the option to use JSC from core

Reviewed By: cortinico

Differential Revision: D76342625

fbshipit-source-id: c925ab4fab1e171e289a1c5f75890c92da1b3f08
2025-06-16 02:36:45 -07:00
Tim Yung 1b0851515e RN: Move {packages => private}/react-native-codegen-typescript-test (#51936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51936

Moves `packages/react-native-codegen-typescript-test` to `private/react-native-codegen-typescript-test`.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76357099

fbshipit-source-id: c00d19d1393aa9bc8059e30f837a045169776b50
2025-06-11 17:39:26 -07:00
Tim Yung f0f71ea914 RN: Move {packages => private}/helloworld (#51934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51934

Moves `packages/helloworld` to `private/helloworld`.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76356557

fbshipit-source-id: 92b20d75a8f2badb3c685d4918fe692623d9c04d
2025-06-11 17:39:26 -07:00
Dawid Małecki f529fd6ba5 Add snapshot validation to build-types (#51893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51893

This diff adds `--validate` flag that runs snapshot validation to determine if the `ReactNativeApi.d.ts` rollup has been changed (if JS public API has been touched). There was also an issue with `sortProperties` that reordered some properties (ex. in ImagePropsBase) after removing one of them (ex. accessible) which had negative impact on the displayed result.

### Motivation
Compare previous snapshot with the one built on the current revision to determine the impact of made changes on the public API surface. Display differences in human readable format using `diff` method from the `jest-diff` library.

For now `--validate` flag is not useful on its own. It should be used with `--withSnapshot` flag (which will be removed shortly and generating snapshot will be a default mechanism).

Changelog:
[General][Added] - Add `--validate` flag to `build-types` script for JS API snapshot validation.

Reviewed By: huntie

Differential Revision: D76135158

fbshipit-source-id: 53f5b142c66e3e3931961f741c3f2fab8ccdc228
2025-06-11 09:06:39 -07:00
Tim Yung df52bbe649 RN: Update set-versions for private/ Packages (#51937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51937

Updates the `set-versions` script to also update workspace packages in `private/*`. Unlike with packages in `packages/*`, this does not change their `"version"` fields, though. It only updates their dependencies.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76358273

fbshipit-source-id: d0e0557d17c355828020a218083b98dd177a6732
2025-06-10 16:37:49 -07:00
Dawid Małecki beb3d49a1b Fix sorting string literals in React Native API snapshot (#51916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51916

String literals were not sorted in React Native API Snapshot. This diff fixes the issue by retrieving the value from the string literal.

Before:

```ts
type A = {
  a: string;
  b: string;
  \"ba\": string;
  \"ab\": string;
  aFn: () => void;
  bFn: () => void;
  aMethod(): void;
  bMethod(): void;
};
```

After:

```ts
type A = {
  a: string;
  \"ab\": string;
  b: string;
  \"ba\": string;
  aFn: () => void;
  bFn: () => void;
  aMethod(): void;
  bMethod(): void;
};
```

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D76329242

fbshipit-source-id: 9645b82cbd22e2d3acef1376a9ffefa3646457d9
2025-06-10 05:46:40 -07:00
Nicola Corti 10aef584d9 Cleanup JSC infrastructure inside test-e2e-local.js (#51894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51894

This code is no longer needed so let's clean it up.

Changelog:
[Internal] [Changed] -

Reviewed By: yungsters

Differential Revision: D76264885

fbshipit-source-id: f28e7aba5da0a4f0981a642d9824af71004593f1
2025-06-10 05:42:18 -07:00
Jakub Piasecki daff0c99d5 Disallow usage of "NativeProps" symbol in internal components (#51889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51889

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76244543

fbshipit-source-id: 0ccbc29f99e3fac992b8f0040e16a73f72350969
2025-06-09 23:14:38 -07:00
Jakub Piasecki 6fff197006 Update the transform not to rename member expression fragments (#51891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51891

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76258179

fbshipit-source-id: e45545ded17d95422625ce5ca6c232a6e78ab9d2
2025-06-09 22:50:20 -07:00
Alex Hunt 89cb7ea600 Replace remaining uses of chalk (#51906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51906

Replaces `chalk` with Node's `util.styleText` in all remaining files, removing this dependency from our repo.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D76273414

fbshipit-source-id: 401f338e55c6f7abb38ee72d45b921f686440663
2025-06-09 18:21:18 -07:00
Alex Hunt 26c042724c Replace chalk in build scripts (#51904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51904

Replaces `chalk` with Node's `util.styleText` in `scripts/build/` and `scripts/build-types/`.

Will follow up with replacing across the entire repo at a later point.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D76037191

fbshipit-source-id: c28352853f22d455a709f4b752f566626e6fb3fe
2025-06-09 18:21:18 -07:00
Alex Hunt df39eadc03 Bump minimum Node.js version to 22.14.0 (#51840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51840

Bumps the minimum version of Node.js in React Native to the current active LTS release (22.x, upgraded from 18.x which is now out of support).

- CI configurations are reduced from `[22, 20, 18]` to `[24, 22]`.

{F1978909878}

See https://nodejs.org/en/about/previous-releases.

Changelog:
[General][Breaking] - Our new minimum Node version is Node.js 22

Reviewed By: yungsters, cortinico

Differential Revision: D76037015

fbshipit-source-id: b6e4b3ee279a9a93d716a13297420bba73f45250
2025-06-06 05:21:39 -07:00
Nicola Corti be113b4406 Stop building JSC inside RN-Tester (#51865)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51865

As in 0.81 we're stopping 1st party support for JSC, we can now cleanup the RNTester
flavor for JSC and simplify the setup here.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest

Differential Revision: D76051319

fbshipit-source-id: 79b01cc64af2466a0be47ceaa0cd211cb6b02f53
2025-06-06 04:54:44 -07:00
Jakub Piasecki 17466a07a5 Rename local symbols exported by default before generating the snapshot (#51864)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51864

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76109534

fbshipit-source-id: d1b5d6016d16dab36c1872e85e8a1efcb2c89c7c
2025-06-06 03:54:43 -07:00
Alex Hunt e17eab4947 Add docs for build-types (#51852)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51852

- Add README for `yarn build-types`.
- Populate command `--help` output.

Changelog: [Internal]

Reviewed By: coado

Differential Revision: D72168391

fbshipit-source-id: d822333d6013bd2ada244e45589f6424191a69d5
2025-06-06 01:14:43 -07:00
Alex Hunt 9616a83c8b Rename --validate arg on yarn build (#51834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51834

Aligning with incoming flag on `yarn build-types`.

Changelog: [Internal]

Reviewed By: coado

Differential Revision: D76034414

fbshipit-source-id: 726858145811227efe23bc2f8344dceeb69944b2
2025-06-06 01:14:43 -07:00