Commit Graph
1341 Commits
Author SHA1 Message Date
Jakub Piasecki 481134aafe Unify doxygen text parsing (#55696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55696

Changelog: [Internal]

Unifies different methods of parsing doxygen text outputs into a single method, able to resolve nested references.

Reviewed By: cipolleschi

Differential Revision: D94077808

fbshipit-source-id: 494ee4da7380e17a60bbdae8e552f1c3827c1130
2026-02-25 11:16:36 -08:00
Jakub Piasecki 6ea92367e7 Handle brace initializers (#55650)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55650

Changelog: [Internal]

Updates the C++ snapshot generation script to correctly handle brace-initialized values. It also adds `STORE_INITIALIZERS_IN_SNAPSHOT` which can be used to enable/disable presence of initializers in the API snapshot.

Reviewed By: cortinico

Differential Revision: D93845131

fbshipit-source-id: 06872e705305ced0c46779f4a97c674f26417ff5
2026-02-25 11:16:36 -08:00
Jakub Piasecki de87d9989f Fix repo root resolution (#55648)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55648

Changelog: [Internal]

Updates the repository root resolution of the C++ api generation script.

Reviewed By: cortinico

Differential Revision: D93857297

fbshipit-source-id: 4c40ec2178807ddc5cae724c4233e2d029541031
2026-02-25 11:16:36 -08:00
Jakub Piasecki 03c1399163 Update sorting and grouping behavior (#55647)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55647

Changelog: [Internal]

Updates sorting and grouping behavior of C++ API snapshot.

Reviewed By: cipolleschi

Differential Revision: D93407634

fbshipit-source-id: 255deb4cec9a1b357cdfc53b804fc59a994eafe1
2026-02-25 11:16:36 -08:00
Jakub Piasecki 5e4da8410e Fix handling of unnamed template arguments (#55646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55646

Changelog: [Internal]

Updates the C++ API snapshot generator script to correctly handle unnamed template arguments.

Reviewed By: cipolleschi

Differential Revision: D93407624

fbshipit-source-id: 50928b596fe64fa3549cde5d69da7146b452d784
2026-02-25 11:16:36 -08:00
Jakub Piasecki 269a2ee0cb Fix indexed access in function arguments (#55645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55645

Changelog: [Internal]

Updates the C++ api snapshot generator to correctly handle arrays of fixed size.

Reviewed By: cipolleschi

Differential Revision: D93407605

fbshipit-source-id: b64d30db04696ea54109258d7d4c4fbf43a4cc69
2026-02-25 11:16:36 -08:00
Jakub Piasecki bf4978ef58 Fix trailing return type in virtual functions (#55644)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55644

Changelog: [Internal]

Updates the C++ api snapshot generator to correctly handle trailing return types for pure virtual functions.

Reviewed By: cipolleschi

Differential Revision: D93407597

fbshipit-source-id: c0bd00752fa69eea6c75933adba7a5782a74e90d
2026-02-25 11:16:36 -08:00
Jakub Piasecki f013533487 Qualify type arguments based on scope context (#55697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55697

Changelog: [Internal]

Implements fallback name qualification for cases where doxygen doesn't extract the full qualified name, and instead passes on the string it found in the header file.

- Adds type_qualification.py with qualify_type_str(), qualify_arguments(), and qualify_parsed_type()
- Updates member.py with close() methods for VariableMember, FunctionMember, and TypedefMember to apply type qualification
- Updates main.py with get_doxygen_params() to extract structured parameter info

Reviewed By: cipolleschi

Differential Revision: D94077825

fbshipit-source-id: 2265f5573164af1af129014082fc44fb8fceb135
2026-02-25 11:16:36 -08:00
Jakub Piasecki 357dd6b3ec Reorganize utils and add generalize type string parsing (#55698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55698

Changelog: [Internal]

Refactors utils.py into a proper package structure and adds comprehensive argument string parsing utilities.

- Converts utils.py to utils/ package with submodules
- Adds argument_parsing.py with parse_arg_string() and related utilities
- Adds qualified_path.py with parse_qualified_path moved from old utils.py
- Renames test_member.py to test_parse_arg_string.py with updated tests for the new 4-tuple Argument format

Reviewed By: cipolleschi

Differential Revision: D94077819

fbshipit-source-id: 460d7a44e6d3e55580d996877ca63fa0c777bc23
2026-02-25 11:16:36 -08:00
Samuel Susla 677330a6d6 Exclude benchmark tests by default, add --benchmarks flag (#55725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55725

changelog: [internal]

By default, `yarn fantom` now excludes benchmark tests (`*-benchmark-itest.js` files) to speed up regular test runs.

Benchmark tests are typically slower and used for performance analysis rather than correctness testing. Excluding them by default improves the developer experience for everyday test runs.

To run benchmark tests, use the new `--benchmarks` flag:
```
yarn fantom --benchmarks
```

Reviewed By: andrewdacenko

Differential Revision: D92150163

fbshipit-source-id: 4c40ef1ba542c4856221373d8239ba603e8f6620
2026-02-25 03:17:00 -08:00
Jakub Piasecki e0b90549e7 Integrate codegen into the api snapshot and allow configuration (#55642)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55642

Changelog: [Internal]

Adds a configuration file for the snapshot generation, allowing to create multiple views of the API and different flavors.

It also adds option to include codegen in the snapshot generation. Codegen needs to be executed first, and the path to its output needs to be passed when running the generation.

Reviewed By: cipolleschi

Differential Revision: D92958731

fbshipit-source-id: 42780d25b2bc04f213e697cca0b6bde07d94ca59
2026-02-25 01:12:30 -08:00
Jakub Piasecki f9db851a8d Handle concepts in the C++ API snapshot (#55695)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55695

Changelog: [Internal]

Adds support for handling concepts in the C++ API parser.

Reviewed By: NickGerleman

Differential Revision: D94074054

fbshipit-source-id: 5e8ef0b0d4d1eeb93554558bb7f80cd67d622a72
2026-02-25 01:12:30 -08:00
Jakub Piasecki e4ded3b9c0 Handle templates in the C++ API snapshot (#55693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55693

Changelog: [Internal]

Adds support for handling template params in the C++ API parser.

Reviewed By: cipolleschi

Differential Revision: D94074045

fbshipit-source-id: b758a8ceb7f95e8a1acf0983afa0c65aeec6b756
2026-02-25 01:12:30 -08:00
Jakub Piasecki 2246457065 Handle type aliases in C++ API snapshot (#55694)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55694

Changelog: [Internal]

Adds support for handling type aliases in the c++ API snapshot

Reviewed By: cipolleschi

Differential Revision: D94074032

fbshipit-source-id: 8af8bc88e884f4b1b7f7394d1316776cc9d50d6b
2026-02-25 01:12:30 -08:00
Jakub Piasecki efc15289be Handle functions in C++ API snapshot (#55692)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55692

Changelog: [Internal]

Adds support for handling functions and methods in the C++ API parser

Reviewed By: cipolleschi

Differential Revision: D94073981

fbshipit-source-id: 1c22a8cd4584868a220974335b321d523e6a3dc2
2026-02-25 01:12:30 -08:00
Jakub Piasecki e69c08bf04 Handle enums in C++ API snapshot (#55691)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55691

Changelog: [Internal]

Adds support for handling enums in the C++ API parser.

Reviewed By: cipolleschi

Differential Revision: D94073960

fbshipit-source-id: 2c726f5ac5c33c66950463760e2592064d812400
2026-02-25 01:12:30 -08:00
Jakub Piasecki 25e402587a Add basic test cases and parser implementation (#55641)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55641

Changelog: [Internal]

Adds basic implementation of C++ API snapshot generation and snapshot tests covering the functionality.

Reviewed By: cipolleschi

Differential Revision: D90987176

fbshipit-source-id: 4243b054f98af49d49e8ce174999b44196ed3444
2026-02-25 01:12:30 -08:00
Jakub Piasecki a65d8848f2 Add basic doxygen wrapper and setup tests (#55640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55640

Changelog: [Internal]

Adds a simple script going over the doxygen output and a test harness for snapshot testing.

Reviewed By: cipolleschi

Differential Revision: D90959837

fbshipit-source-id: fde0c1116b7c0fc10e43484e2b57ead79af706b8
2026-02-25 01:12:30 -08:00
Maciej Jastrzębski 8a740acdbc Fix updating peerDependencies for releases (#55630)
Summary:
Recently added `react-native/jest-preset` package is an optional peer dep to the main `react-native` package. However, it's version dep is not updated correctly for nightly builds.

Peer dep version for [latest nightly](https://www.npmjs.com/package/react-native/v/0.85.0-nightly-20260219-44901aaf9?activeTab=code) is :
```
"peerDependencies": {
    "eact-native/jest-preset": "0.84.0-main",
    // ....
  },
```

From my analysis this is because publishing scripts only update `deps` and `devDeps` but not `peerDeps`. Proposed change adds `peerDeps` to the list of potential deps locations to update

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [FIXED] - Fix peer deps version to `react-native/jest-preset`.

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

Reviewed By: cipolleschi

Differential Revision: D93850121

Pulled By: huntie

fbshipit-source-id: 9f24cf302aa93c5b3721ebfd571171ee9e5af712
2026-02-20 03:07:00 -08:00
Alex Hunt b97ca6eacf Update build to better locate prepack script (#55536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55536

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D92831007

fbshipit-source-id: 60089442334ca5be6046bfd7f16c816d57e62408
2026-02-12 09:38:27 -08:00
Alex Hunt a25049b8dd Remove build package.json dirty state check (#55420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55420

After https://github.com/facebook/react-native/pull/54857 (use of the "publishConfig" field), this check is no longer necessary, since `yarn build` will no longer make changes to any checked in files.

In the (expectedly) rare case that `yarn build --prepack` changes are committed (only intended for CI), Flow will also fail independently.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D92397786

fbshipit-source-id: 872cc91b62295cdb6d8c2799cffb8a4cadc4106e
2026-02-05 09:14:33 -08:00
Alex Hunt 141e021509 Add --prepack flag to build script (#55415)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55415

Add optional flag to JS build setup that includes running the `"prepack"` script step after build — allowing the net behaviour before https://github.com/facebook/react-native/pull/54857 to be conveninently switched to if needed.

This is motivated by fixing our internal CI action for `xplat/js/react-native-github/scripts/debugger-shell/build-binary.js` — which depends on a locally built + package.json-written package state (the latter of which no longer happened for `yarn build` by default).

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D92395174

fbshipit-source-id: 28806b3f3872306f2529d4bb5870acde584caf10
2026-02-05 07:47:43 -08:00
Pieter De Baets 7ff4c218cf Remove references to integration/runner (#55342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55342

This was the old fantom location and no longer used.

Changelog: [Internal]

Reviewed By: zeyap

Differential Revision: D91680127

fbshipit-source-id: d0015ed1668065487c156eabe535e35e75c52d3f
2026-02-02 15:48:22 -08:00
Jakub Piasecki 589547ab61 Update ReactNativeVersion.h not to rely on an anonymous struct (#55271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55271

Changelog: [Internal]

During research for the Stable C++ Api project, I've noticed that doxygen isn't able to handle anonymous structs, producing weird results.

The only occurence of this pattern in the codebase was in the `ReactNativeVersion.h` file. This diff updates this file not to use that pattern.

Reviewed By: cortinico

Differential Revision: D91220998

fbshipit-source-id: 9fd2ec5fb811111a0f3c75bf442f95df4b06a04b
2026-01-22 07:59:01 -08:00
Rob Hogan 2d4ee26e57 Sync generated Babel Flow types, yarn-deduplicate (#55233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55233

X-link: https://github.com/facebook/metro/pull/1640

Re-sync Flow Babel types with the latest version from npm to unbreak no-lockfile CI.

Metro only: Also `yarn-deduplicate` other deps

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D90986684

fbshipit-source-id: 332acd66c2ca1b3396388b383f1c940b19b899ce
2026-01-19 14:15:52 -08:00
Rob Hogan 2e9b7fb2ad Align Flow lib defs for Node.js child_process with v24 (#55186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55186

This is an AI-assisted change to align the Flow definitions for the `child_process` module with the Node.js docs as at v24.

**New v18+ Features:**

1. **AbortSignal Support** (v18.0.0) - Process cancellation
   - Added `signal?: AbortSignal` option to all async functions (exec, execFile, fork, spawn)
   - Enables cancellation of child processes using `AbortController`
   - Example: `const controller = new AbortController(); spawn('cmd', [], {signal: controller.signal}); controller.abort();`
   - https://nodejs.org/api/child_process.html#child_processexeccommand-options-callback

2. **Enhanced Process Properties** (v20.x)
   - `spawnargs: Array<string>` - Full command-line arguments used to launch the process
   - `spawnfile: string` - Executable file name of the child process
   - `signalCode: string | null` - Signal that terminated the child process
   - https://nodejs.org/api/child_process.html#subprocessspawnargs

**ChildProcess Class Updates:**

3. **Improved Property Types**
   - `stdio` is now a properly typed tuple array with readonly modifier
   - `channel` changed from `Object` to `mixed` for better type safety

4. **Enhanced Method Signatures**
   - `kill(signal?: string | number): boolean` - Now returns boolean and accepts numeric signals
   - `send()` overloads properly typed with `child_process$Serializable` messages
   - `send()` accepts `keepOpen` option: `Readonly<{keepOpen?: boolean}>`
   - https://nodejs.org/api/child_process.html#subprocesskillsignal

**Option Type Improvements:**

6. **Modern Readonly Syntax** - All input options use `Readonly<{...}>`
   - `execOpts`, `execFileOpts`, `forkOpts`, `spawnOpts`, `spawnSyncOpts`, etc.
   - Allows passing readonly types safely

7. **Enhanced Environment Variables**
   - Changed `env?: Object` to `env?: {[key: string]: string | void}`
   - More precise typing for environment variable dictionaries

8. **New Fork Options** (IPC enhancements)
   - `serialization?: 'json' | 'advanced'` - IPC serialization format
   - `killSignal` and `timeout` options added to fork
   - https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options

9. **Enhanced Spawn Options**
   - Added `killSignal`, `timeout`, `serialization` to `spawnOpts`
   - Better consistency across all spawn functions

**Return Type Fixes:**

10. **spawnRet/spawnSyncRet** - Made fields properly nullable:
    - `status: number | null` - null if process never exited
    - `signal: string | null` - null if not terminated by signal
    - `error: Error | void` - void if no error occurred
    - Removed spread operator for exact types

**Helper Types:**

11. **`child_process$Serializable`** - Union type for IPC messages:
    - `string | number | boolean | bigint | {...} | Array<mixed>`
    - Used in send() method signatures

12. **`child_process$SendHandle`** - Type for handle passing:
    - `net$Server | net$Socket`
    - Used for passing server/socket handles to child processes

**References:**
- Node.js child_process module docs: https://nodejs.org/api/child_process.html
- AbortSignal integration: https://nodejs.org/api/child_process.html#child_processexeccommand-options-callback

Changelog: [Internal]
 ---
> Generated by [Confucius Code Assist (CCA)](https://www.internalfb.com/wiki/Confucius/Analect/Shared_Analects/Confucius_Code_Assist_(CCA)/)
[Confucius Session](https://www.internalfb.com/confucius?host=devvm45708.cln0.facebook.com&port=8086&tab=Chat&session_id=1a3aa26e-e5a9-11f0-8d47-71a4a90f0494&entry_name=Code+Assist), [Trace](https://www.internalfb.com/confucius?session_id=1a3aa26e-e5a9-11f0-8d47-71a4a90f0494&tab=Trace)

Reviewed By: vzaidman

Differential Revision: D89944331

fbshipit-source-id: 744ae04051c2214d97269c48c115060f5f30fb1f
2026-01-18 12:52:52 -08:00
Marco Wang cd3a9c55c1 Transform all remaining utility types (#55178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55178

We are transforming the following utility types to be more consistent with typescript and better AI integration:

* `$NonMaybeType` -> `NonNullable`
* `$ReadOnly` -> `Readonly`
* `$ReadOnlyArray` -> `ReadonlyArray`
* `$ReadOnlyMap` -> `ReadonlyMap`
* `$ReadOnlySet` -> `ReadonlySet`
* `$Keys` -> `keyof`
* `$Values` -> `Values`
* `mixed` -> `unknown`

See details in https://fb.workplace.com/groups/flowlang/permalink/1837907750148213/.

drop-conflicts

Command:

`js1 flow-runner codemod flow/transformUtilityType --format-files=false --legacy-type='ALL'`

Reviewed By: SamChou19815

Differential Revision: D90728908

fbshipit-source-id: a8a1a06eb274cc32b12e893679aa92034eb962c4
2026-01-15 16:02:51 -08:00
Jakub Piasecki d1fb556968 Remove scripts/cxx-api (#55162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55162

Changelog: [Internal]

Removes `scripts/cxx-api`, containing the legacy C++ API tracking code.

Reviewed By: cortinico

Differential Revision: D90675176

fbshipit-source-id: ed920f3e19a302f8451bcc0c2a827c99570d6cb8
2026-01-15 00:33:52 -08:00
Marco Wang 92c32780f1 Transform $ReadOnlyArray to ReadonlyArray 18/n (#55152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55152

We are transforming the following utility types to be more consistent with typescript and better AI integration:

* `$NonMaybeType` -> `NonNullable`
* `$ReadOnly` -> `Readonly`
* `$ReadOnlyArray` -> `ReadonlyArray`
* `$ReadOnlyMap` -> `ReadonlyMap`
* `$ReadOnlySet` -> `ReadonlySet`
* `$Keys` -> `keyof`
* `$Values` -> `Values`
* `mixed` -> `unknown`

See details in https://fb.workplace.com/groups/flowlang/permalink/1837907750148213/.

drop-conflicts

Command:

`js1 flow-runner codemod flow/transformUtilityType --legacy-type='$ReadOnlyArray'`

Reviewed By: SamChou19815

Differential Revision: D90424826

fbshipit-source-id: 207e1abebb50671e8eb2a7f79ecfeaf4569b5b3e
2026-01-13 21:59:05 -08:00
Marco Wang 94383613d8 Transform $Values to Values (#55136)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55136

Stacking another diff on top of hermes release. Let's see if there's still any CI failures.

` js1 flow-runner codemod flow/transformUtilityType --format-files=false --legacy-type='$Values' xplat/js`

drop-conflicts

Reviewed By: gkz

Differential Revision: D90549059

fbshipit-source-id: e07faa80b5ed0a675a2bc9bcc45d4084aaae9eda
2026-01-13 13:47:19 -08:00
Alex Hunt 24c126da9f Fix set-version script not updating dependencies under private/ (#55083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55083

D86534510 broke our release workflow, as the intentionally narrowed package set for `set-version` unintentionally meant that `dependencies`/`devDependencies` were no longer completely applied — breaking `yarn` install.

Fix and add clarification comments.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D90268470

fbshipit-source-id: ba731edc0f248cccf44b34f746236d383c318768
2026-01-08 02:25:26 -08:00
Riccardo Cipolleschi f140c4906b Use Hermes V1 as default engine (#54989)
Summary:
This change makes Hermes V1 the default engine for React Native for both platforms. This change needs to land before the branch cut of react native 0.84

bypass-github-export-checks

## Changelog:
[iOS][Changed] - Make Hermes V1 the default engine for iOS

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

Test Plan:
1. Run `bundle exec pod install` and verified that Hermes V1 is used when building from source
<img height="480" alt="Simulator Screenshot - iPhone 17 Pro - 2025-12-29 at 11 28 44" src="https://github.com/user-attachments/assets/0889f16c-f2ee-4a0e-9a4d-529dd82c8283" />
2. Run `prebuild-ios -s` and verified that the scripts downloads the Hermes V1 tarball
<img width="831" height="324" alt="Screenshot 2025-12-29 at 10 37 53" src="https://github.com/user-attachments/assets/9a60565e-1e13-4967-a4a4-dd079e6b040f" />
3. GHA and nightlies

Reviewed By: vzaidman, cortinico, huntie

Differential Revision: D89881943

Pulled By: cipolleschi

fbshipit-source-id: 958b6d31bd4230ba4a5c7fee2bffc19e03dcbc89
2026-01-07 05:34:12 -08:00
Marco Wang 41efc3b588 Transform $ReadOnly to Readonly 38/n (#55067)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55067

Differential Revision: D90146229

fbshipit-source-id: 62733ba51fd0c318140b7a76b499b1a7ac1f7853
2026-01-06 20:23:03 -08:00
Alex Hunt f2948fb2ad Remove unused code from scm-utils (#55036)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55036

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D90107033

fbshipit-source-id: 701b02801a59ee0c910de772dfa75d924e78860b
2026-01-05 04:05:34 -08:00
Alex Hunt a1e434318a Delete print-packages script (#55034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55034

Delete the `yarn print-packages` script.

- `yarn workspaces info` already exists.
- Since implementing lockstep versioning, all pkg versions are at a single version string (or `0.0.0` for private).
    - This script also offers npm lookups for older versions — same assertion goes.
- Since adding the `private/` directory, the public/private package delineation is increasingly clear on its own (remaining exception: RNTester).

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D90106362

fbshipit-source-id: bbba97984a80473f92b331cb68d01b5ad00a2b55
2026-01-05 04:05:34 -08:00
Simek 65cc2e5a6f fix print-packages script (#55019)
Summary:
Running `print-packages` script from monorepo root results in a require error.

This PR updates the import path for `getPackages` utit to fix the script, which now output correct data.

## Changelog:

[INTERNAL] [FIXED] - Fix `print-packages` script

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

Test Plan: <img width="1344" height="602" alt="Screenshot 2026-01-02 at 19 58 51" src="https://github.com/user-attachments/assets/d6dd1ab5-e0da-4878-b622-7e5f5aa0865b" />

Reviewed By: cipolleschi

Differential Revision: D90104112

Pulled By: cortinico

fbshipit-source-id: a44115bf44725eaa8935568706981fe6a3826940
2026-01-05 03:03:47 -08:00
Marco Wang 894a1f16ef Transform mixed to unknown in xplat/js (#54954)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54954

We are transforming the following utility types to be more consistent with typescript and better AI integration:

* `$NonMaybeType` -> `NonNullable`
* `$ReadOnly` -> `Readonly`
* `$ReadOnlyArray` -> `ReadonlyArray`
* `$ReadOnlyMap` -> `ReadonlyMap`
* `$ReadOnlySet` -> `ReadonlySet`
* `$Keys` -> `keyof`
* `$Values` -> `Values`
* `mixed` -> `unknown`

See details in https://fb.workplace.com/groups/flowlang/permalink/1837907750148213/.
drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D89581744

fbshipit-source-id: 58a6c246629bbe4fb5c0af447dc002c48e10c342
2025-12-22 12:25:44 -08:00
Alex Hunt 0c947c8d94 Fix diffApiSnapshot-test (#54903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54903

A bit too trigger happy on D89287801(!)

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D89292895

fbshipit-source-id: 793d984253dcf24c394adc8c8646992caf17805d
2025-12-16 10:04:16 -08:00
Alex Hunt a22ab422e8 Loosen JS API breaking change detection, improve Danger message (#54901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54901

At present, we're only using a rough heuristic for whether a code change to `ReactNativeApi.d.ts` is a breaking change. Introduce `POTENTIALLY_BREAKING` result level and update Danger warnings box.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D89287801

fbshipit-source-id: aced7911ecde37a1ad2c355d56ef0f0edde88fd4
2025-12-16 08:14:38 -08:00
Panos Vekris c16eb23a1a make run-ci-javascript-tests.js use flow full-check (#54883)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54883

`flow full-check` has been available since Flow v0.292.0

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D89097999

fbshipit-source-id: a4e7de0cfe4ac9c52eb067f06b127fb3f3efd0b9
2025-12-15 15:41:33 -08:00
Jakub Piasecki 076e6a1d53 Use prebuilt Hermes by default when building Android (#54707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54707

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D87929652

fbshipit-source-id: 439eef5eea9b9203cf2a7b5a8eae38d83e192bd5
2025-12-15 08:13:16 -08:00
Alex Hunt cc9164c337 Move JavaScript exports rewrites to publishConfig/prepack (#54857)
Summary:
### Motivation

Updates the shared JavaScript build setup to use the modern `publishConfig` convention.

This:

- Simplifies the build script.
- Makes the production values for `"exports"` more understandable in place (especially by separating from exports conditions).
- Prevents us from creating a dirty file state when running `yarn build`.

### Changes

- Add `publishConfig` to each `package.json` listing production `"exports"` targets.
- Add `scripts/build/prepack.js` script to action `publishConfig` (now on `npm pack`, `npm publish` exclusively).
- Remove `"exports"` rewriting (and un-rewriting safeguards) from build script.

**Note on `"prepack"`**

Slightly unfortunately, `publishConfig` doesn't work consistently between package managers currently, including npm — so this does not work implicitly (but may in future).

We're instead following `publishConfig` as a convention, and explicitly implementing a full copy (theoretically forking us towards pnpm and Yarn v4's approach).

However, I believe this is:

- Worthwhile, for the motivations above — and in particular being able to understand the final shape of `"exports"` (independent from the dimension of conditional exports, which may come into play later).
- Completely inspectable/maintainable as an explicit implementation (`scripts/build/prepack.js`).

Changelog: [Internal]

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

Test Plan:
### CI

✅ GitHub Actions

### End-to-end release test script

(Note: Rebased on `0.83-stable` when tested)

```
yarn test-release-local -t "RNTestProject" -p "iOS" -c $GITHUB_TOKEN
```

{F1984106139}

✅ Test script runs `npm publish` on packages to a local proxy.

{F1984106146}

✅ Installed packages have `publishConfig` `"exports"` values applied

NOTE: ⬆️ This is **exactly** the same output as before.

 {F1984106148}

✅ `/tmp/RNTestProject` runs using built + proxy-published + proxy-installed packages

Reviewed By: cipolleschi

Differential Revision: D88963450

Pulled By: huntie

fbshipit-source-id: f328252cf93a1f1039b79d7f369d1e6e7e5b4b52
2025-12-12 04:08:59 -08:00
artus9033 2ce368604a fix(test): fix RNTester iOS unit and integration tests (#53848)
Summary:
This PR fixes problems with unit & integration tests in the iOS RNTester project, related to: compilation errors, JS problems, missing mocks & outdated baselines.

## Changelog:

[Internal] - Re-enabled iOS unit & integration tests, Ruby tests on CI, stripped obsolete build part before running tests, renamed uploaded xcresult artifacts

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

Test Plan:
1. iOS tests pass:

- When run from dedicated xcschemes:

<img width="596" height="388" alt="image" src="https://github.com/user-attachments/assets/9f3a038b-f12e-4b12-ab95-93d55eb60d63" />

<img width="611" height="381" alt="image" src="https://github.com/user-attachments/assets/27ff3a6f-57da-4842-a96c-db569e417dc3" />

- When run from the RNTester scheme (command + U):

<img width="754" height="384" alt="image" src="https://github.com/user-attachments/assets/0b4a6e70-56da-40c1-b019-b1e87d8df591" />

2. Ruby scripting tests pass:

<img width="655" height="349" alt="image" src="https://github.com/user-attachments/assets/a6a41d16-2744-44c9-bf87-e4a06f228cfb" />

3. CI - green
4. xcresult artifacts are uploaded
<img width="1370" height="478" alt="image" src="https://github.com/user-attachments/assets/1bd0638d-f215-48f7-b798-fadb8799c5f7" />

Reviewed By: huntie

Differential Revision: D88733170

Pulled By: cipolleschi

fbshipit-source-id: e14c69bede1db34461926726bc796804b365a7a9
2025-12-10 08:47:16 -08:00
Emily Brown c36665f7c6 Fix hash generation for declare const types in API snapshot #54818 (#54822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54822

Updates hash generation in `versionExportedApis.js` to track changes to `declare const` type declarations like `AccessibilityInfo_default`.

Previously, changes to APIs (e.g., `AccessibilityInfo`) would not always update their hashes in `ReactNativeApi.d.ts`, causing the breaking change detection to miss actual API changes.

Three issues prevented proper hash tracking:

1. **`VariableDeclaration` types weren't tracked** - `declare const X: {...}` was not in the list of tracked declaration types
2. **Duplicate declarations caused overwrites** - `declare type X = typeof X` would overwrite `declare const X: typeof X_default` in the declarations map, losing the dependency on `X_default`
3. **`typeof X` queries weren't extracting dependencies** - references via `typeof` weren't being added to the dependency graph

## Fix

- Add `t.isVariableDeclaration(node)` to tracked types with proper name extraction
- Prevent overwriting existing declarations (first declaration wins)
- Handle `TSTypeQuery` nodes to extract `typeof X` dependencies

### Note on Hash Changes

This PR causes many hashes to change, even for types that haven't been modified. This is expected because the hash computation now includes `declare const` dependencies that were previously ignored.

**Before:** `AccessibilityInfo` hash only included `declare type AccessibilityInfo = typeof AccessibilityInfo` (self-reference)
**After:** Hash now includes `declare const AccessibilityInfo: typeof AccessibilityInfo_default` + the full `AccessibilityInfo_default` type

## Changelog:
[GENERAL] [FIXED] - hash generation includes `declare const` types in API snapshot

Reviewed By: huntie

Differential Revision: D88653322

fbshipit-source-id: abdf9c5e11bf8ff9e6e2f17a743a2d5aa213ae1c
2025-12-10 03:10:32 -08:00
Phil Pluckthun 41eace0093 Replace glob@^7.0.0 with tinyglobby@^0.2.15 (#54737)
Summary:
This replaces `glob@^7.0.0` with `tinyglobby@^0.2.15`. `glob@7` has been deprecated for a while and some versions after had security notices released for them. The plan is to backport this PR to `0.81.x` and onwards.

> [!NOTE]
> This is a stopgap solution until `fs.glob` becomes generally available with the EOL of Node v20

Succeeds:
- https://github.com/facebook/react-native/issues/54669
- https://github.com/facebook/react-native/issues/48875

## Changelog:

[GENERAL] [SECURITY] - Replace `glob@^7.0.0` with `tinyglobby@^0.2.15`

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

Test Plan:
- Ran all modified commands manually and `pod install in `rn-tester`
- NOTE: `ios-prebuild`-related scripts haven't been run manually yet

Reviewed By: robhogan

Differential Revision: D88069145

Pulled By: huntie

fbshipit-source-id: 0c455342a4c6d1d6605fd09fe47b418e5d751491
2025-12-03 05:45:48 -08:00
Nicola Corti dba18bbc50 Remove unnecessary ReactCxxErrorHandler (#54704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54704

This class is coming from Legacy Architecture and is no longer used so can be cleaned up.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D87925037

fbshipit-source-id: 30faffef0da2b7055a6d381b41dc72bead2dd8de
2025-11-27 11:17:22 -08:00
Pieter De Baets a540b903f9 Remove RCTTurboModuleSyncVoidMethodsEnabled feature flag and related code (#54684)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54684

This diff removes the `RCTTurboModuleSyncVoidMethodsEnabled` feature flag and all related code that allowed TurboModule void methods to execute synchronously.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D87865883

fbshipit-source-id: fa64e8105e8329a0b20bb1718dbc01b17464cd06
2025-11-26 06:06:01 -08:00
Christian Falch 7a66582f60 added readme/doc files for precompile (#54137)
Summary:
Added readme files for both RN dependencies and RN Core precompiled

## Changelog:

[IOS] [FIXED] - Added documentation for the prebuild scripts for precompiling React Native Core and React Native Dependencies.

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

Reviewed By: cipolleschi

Differential Revision: D84506769

Pulled By: cortinico

fbshipit-source-id: 628f5b335619f67637f582f45180fd0d16e872c4
2025-11-20 03:20:36 -08:00
Christoph Purrer 2d6a3236ed Remove TurboCxxModule (#54544)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54544

Changelog: [General][Breaking] Remove TurboCxxModule

Reviewed By: shwanton

Differential Revision: D87082461

fbshipit-source-id: 15c71b88272fa591e69e803dfec14176585a2d6f
2025-11-15 05:57:02 -08:00
Riccardo Cipolleschi aab370b67f Back out "Remove name and metadata from root package.json" (#54536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54536

Original commit changeset: dcc5fd33bb8c

Original Phabricator Diff: D86869720

The original stack broke
```
buck test fbsource//xplat/js:xplat-jest -- fbsource//xplat/js:xplat-jest - main
```

## Changelog:
[Internal] -

Reviewed By: AnuarNav

Differential Revision: D86983432

fbshipit-source-id: 203f9e18121bcaa1c864d8b555dd000a93d8745f
2025-11-13 10:13:42 -08:00