Commit Graph

1274 Commits

Author SHA1 Message Date
Jakub Piasecki 3e9990f860 Allow to opt-in to use the new Hermes on Android (#53580)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53580

Changelog: [ANDROID][ADDED] Added opt-in to use the new Hermes

Reviewed By: cortinico

Differential Revision: D81035114

fbshipit-source-id: d01e44190941d161cf641ec4e03ed487aff18dd8
2025-09-04 07:42:12 -07:00
Vitali Zaidman 6e47c953d3 fix release script testing artifact for rntester (#53552)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53552

Changelog: [Internal]

Reviewed By: fabriziocucci, cortinico, hoxyq

Differential Revision: D81452967

fbshipit-source-id: 3032b49b6c7fd49901b8f47886084c98479b368f
2025-09-02 03:01:57 -07:00
Christoph Purrer c05f39ec3e Remove duplicated to_underlying helper method (#53494)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53494

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D81203760

fbshipit-source-id: 185d6b3a6cd06d58c770dd04c68cc707a7621f08
2025-08-28 09:48:57 -07:00
Moti Zilberman adf1b62c76 Normalise shell name/version strings, add commit hash when prebuilt (#53480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53480

Changelog: [Internal]

Improves the way `--version` and the User-Agent header work in `debugger-shell`.

* The same app name and version string format will be used across the `dev` and `prebuilt` flavours. Previously, `dev` would report itself as being `Electron v37.2.6` while `prebuilt` would report `react-native/debugger-shell v0.82.0-main`.
* `prebuilt` now also reports the original Meta-internal commit hash as a suffix `-rFBS..........` added to the semver string taken from `package.json`, while `dev` will have a `-dev` suffix in the same place.
  * We do **not** modify the version in `package.json` during the build, nor do we pass the commit hash to `electron/packager`, because this would impose inconvenient platform-specific restrictions on the version string's format.

Reviewed By: huntie

Differential Revision: D81120181

fbshipit-source-id: e730dd35da78dfbb8de326f9a3ab76b747fdb0b3
2025-08-27 11:05:02 -07:00
Sam Zhou 0530ea3349 Migrate to suppression with error code in xplat: 1/n (#53439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53439

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D80809220

fbshipit-source-id: 6f432d8302934b9fee9780ac1d6ba6c87c0b3899
2025-08-22 10:35:39 -07:00
Christian Falch a843119ff1 Fix copy symbol files in RNDeps precompile (#53353)
Summary:
Symbol files wasn't copied correctly when building - as with bundles we did overwrite the files and ended up with only the last symbol file.

This commit fixes this by mapping the framework build folder architecture type to the xcframework slices creating the correct file structure under the Symbols folder.

- Each slice gets a folder with the architecture name under Symbols containing the dSym folder for that slice
- Refactored getting correct architecture folder into a separate function.
- Refactored target folder lookup in copyBundles
- Removed unused async modifier on function

## Changelog:

[IOS] [FIXED] - Fixed how we copy and build the Symbols folder when precompiling ReactNativeDependencies

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

Test Plan: Run nightlies and verify that ReactNativeDependencies.framework.dSym files contains symbol files for all architectures.

Reviewed By: cortinico

Differential Revision: D80692019

Pulled By: cipolleschi

fbshipit-source-id: 77983bc29d1965edf3bc0fcbd9cb3177071991d3
2025-08-22 03:26:54 -07:00
Christian Falch e3adf47214 fixed copying bundles correctly (#53325)
Summary:
When copying bundle files from the platform folders in the .build output, the script had a bug where all bundles were copied - meaning that only the last one would be in the resulting xcframework output.

This caused an issue when we tried to publish an app built with precompiled binaries to AppStore where the field `CFBundleSupportedPlatforms` was wrong and caused the submission to be rejected. This was caused by the script copying the wrong bundle file into the final xcframework outputs.

This issue is described here:
https://github.com/react-native-community/discussions-and-proposals/discussions/923#discussioncomment-14089245

This commit fixes the above error by using the iOS 15 `vtool` to show the actual platform for a given framework and then making sure we don't copy bundles in the wrong way.

Testing this on my local machine for iOS/iOS-simulator/MacOS/catalyst yields the following results (before/after this fix):

**Before:**

```bash
Copying bundles to the framework...
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
```

  **After:**

```bash
  Copying bundles to the framework...
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
```

## Changelog:

[IOS] [FIXED] - Fixed copying bundles correctly to xcframeworks when precompiling ReactNativeDependencies.xcframework

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

Test Plan: Ensure that the info.plist files in the nightlies for the ReactNativeDepdendencies.xcframework has the correct bundles for its targets.

Reviewed By: andrewdacenko

Differential Revision: D80457335

Pulled By: cipolleschi

fbshipit-source-id: aeb4166f66218f72bdd29b6fc579fcc7b6d12844
2025-08-19 02:47:40 -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
Sam Zhou 94d260ee6a Unbreak RN CI (#53261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53261

Replace type annotation with comment syntax

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D80231004

fbshipit-source-id: a863091bec8b5521bc998b57ef08d892823238e6
2025-08-13 20:53:12 -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
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
Rubén Norte 7c1c833ee9 Remove redundant methods to mock timers from PerformanceEntryReporter and NativePerformance (#53028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53028

Changelog: [internal]

Now that we have mocking at a more fundamental level (`HighResTimeStamp` API) we can replace other timing mocks with that one.

This does it for `PerformanceEntryReporter` and the `NativePerformance` module.

Reviewed By: hoxyq

Differential Revision: D79557640

fbshipit-source-id: 86579b8bb586190ab7cc8721f30e60b3ef789798
2025-08-04 11:21:03 -07:00
Rubén Norte 5c2b9eda69 Refactor runner to use a single instance of Metro for each run (#52777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52777

Changelog: [internal]

This significantly speeds up test execution in Fantom (around 2x in OSS and 6x at Meta) by starting a Metro server before all tests runs and reusing it across all tests to build test bundles, instead of spinning up a new Metro instance every time we run each test.

The architecture change (also considering the previous change in buck prebuilds) looks like this:
{F1980689532}

This is how is impacts execution times (compared to the baseline):
* OSS
  * Before: 62s {F1980564286}
  * After: 30s (**2x faster**) {F1980564265}

Reviewed By: andrewdacenko

Differential Revision: D78741903

fbshipit-source-id: b209f88925e49cc2a2067e8df9b7fa9a29b4c8d2
2025-08-04 05:56:51 -07:00
Sam Zhou 16fa3d5da4 Update prettier-plugin-hermes-parser in fbsource to 0.31.1 (#52996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52996

Bump prettier-plugin-hermes-parser to 0.31.1.

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D79481936

fbshipit-source-id: 4decd5c92722f935a6a03b6d2205bc31b864fb5d
2025-08-01 20:18:36 -07:00
Sam Zhou c43a39925f Replace $FlowIssue with $FlowFixMe (#52976)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52976

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D79400163

fbshipit-source-id: b0c4f10b18b99550bdf95be620187f011b62f2f7
2025-08-01 07:50:00 -07:00
Christoph Purrer 0f25a354ba Simply use a std::shared_ptr in TestCallInvoker (#52771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52771

Changelog: [Internal]

It seems we can simply use a std::shared_ptr here

(This was some initial over-engineering which isn't needed as it turns out)

Reviewed By: cipolleschi

Differential Revision: D78771904

fbshipit-source-id: 2925c424d2061ca727636c683ec783ed56e3f0c9
2025-07-23 08:52:41 -07:00
Alex Hunt ec5638abd0 Expose ReactNativeVersion API (#52784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52784

Resolves https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-13860767.

**Changes**

- Formalises the design of `ReactNativeVersion` as a single object and adds a `getVersionString` accessor.
- Expose `ReactNativeVersion` as a root export on `index.js`.
- Update deep imports use in `NewAppScreen`.

**Notes**

- Subtly, we also have `Platform.constants.reactNativeVersion` in our public API already. **However**, this is the per-platform ***native-reported*** RN version, distinct from the JS version (this diff). See [`ReactNativeVersionCheck.js`](https://github.com/facebook/react-native/blob/54d733311d87e9ab4e18f947edf3f5c85f9a6275/packages/react-native/Libraries/Core/ReactNativeVersionCheck.js#L24).

Changelog:
[General][Added] - Expose `ReactNativeVersion` API as JavaScript root export

Reviewed By: cortinico

Differential Revision: D78806347

fbshipit-source-id: 974251fdaa9ab18fac8a584644fea894e4f6e083
2025-07-23 08:28:32 -07:00
Sam Zhou 6c8bcad054 Make functions async and add await to prepare for prettier v3 upgrade: 1/n (#52768)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52768

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

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78752354

fbshipit-source-id: c0d27a6c863747b71852e72a22687d1fe1d9f76f
2025-07-22 13:28:03 -07:00
Christoph Purrer 7b5307d181 Replace ContextContainer::Shared with std::shared_ptr<const ContextContainer> 2/2 (#52750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52750

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D78704833

fbshipit-source-id: 4df0029f6de860c93864e12c479e387f3981f7b5
2025-07-22 12:40:27 -07:00
Christoph Purrer ae4ce02752 Replace SharedImageManager with std::shared_ptr<ImageManager> (#52747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52747

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D78698231

fbshipit-source-id: 5da5c57237d1cc16dc3d120c7b58c44da6914d36
2025-07-22 09:36:32 -07:00
Moti Zilberman 4a1884e5e5 Exclude unimportant files from Electron build
Summary:
TSIA

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D78351935

fbshipit-source-id: 7f71f3df3ecf8ce92891109b8d9f8e0a74361f21
2025-07-17 03:13:26 -07:00
Riccardo Cipolleschi 6b550a279e Fix E2E test script when the ci flag is not specified (#52617)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52617

The `test-release-local` script was failing to execute the npx rreact-native run-ios command for some issues with cocoapods.
That command tries to reinstall the pods so there might be some issues when testing.

As an alternative, we can avoid duplicated work by dropping the npx react-native command and, instead, build the app with xcodebuild and install it in the simulator with xcrun.

This is a backport of [this PR](https://github.com/facebook/react-native/pull/52609)

## Changelog:
[Internal] -

Reviewed By: vzaidman

Differential Revision: D78344397

fbshipit-source-id: cf2d9c032966a9be05670259e9532789829349f2
2025-07-15 12:04:20 -07:00
Riccardo Cipolleschi 339dc4979c Update atrifact names to the new ones (#52618)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52618

In 0.81 we dropped the JSC configuration in CI. That means that the artifacts we generate in CI have a slightly different name. The current e2e script failed to run with the ci flag because it was still using the old artifacts name and it was not finding them.

This change adress the problem by:

- using the right artifact names
- removing the --hermes parameter which controlled the Hermes vs JSC scenario.

It is also a port to main of [this PR](https://github.com/facebook/react-native/pull/52606)

## Changelog:
[Internal] -

Reviewed By: cortinico, vzaidman

Differential Revision: D78344244

fbshipit-source-id: a658ba161b867bbad773fe093df9679ea92579b3
2025-07-15 12:04:20 -07:00
Rob Hogan cf45aa9dbc Bump Metro to 0.83.0 (#52576)
Summary:
Bump Metro to 0.83.0.

This release contains some breaking changes for integrators, and a minimum Node.js version of 22.14.

Full release notes: https://github.com/facebook/metro/releases/tag/v0.83.0

Changelog: [General][Changed] Bump Metro to ^0.83.0

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Rollback Plan:

Differential Revision: D78171925

Pulled By: robhogan

fbshipit-source-id: 7ea5e04d285632a14dd71ba00da872d60f283840
2025-07-13 15:39:46 -07:00
Ramanpreet Nara 42ea4bc594 feature-flags: Prefix "eager" to "main queue modules" flag (#52543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52543

Prefixing "eager" to the name makes it less confusing.  React native already has main queue modules: they're just lazy.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D78109287

fbshipit-source-id: 5fa6095d2dd8fcf74fdda64e05483eb487bc8f56
2025-07-11 22:47:07 -07:00
Rob Hogan ec5bde62b6 Breaking: Use named exports in metro-babel-register (#52564)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52564

Currently, `metro-babel-register` has a function as its default export, to which we've tagged on various properties.

This tidies that up to a more idiomatic object of named exports, with `register` as a new one of them.

This also serves to make it more compatible with automatic TypeScript generation.

This is semver breaking, but `metro-babel-register` has very little usage outside Meta projects so isn't expected to be disruptive.

Changelog: [Internal]

Metro changelog:
```
 - **[Breaking]**: Move metro-babel-register's main function to a named export `register`
```

Reviewed By: huntie

Differential Revision: D78157559

fbshipit-source-id: c59c9820e9895007345561fed9ccec2273b925c8
2025-07-11 11:03:29 -07:00
Vitali Zaidman 84a2765c2a renamed release testing scripts (#52541)
Summary:
Use a more suitable name for the [scripts used in the release process](https://github.com/reactwg/react-native-releases/blob/main/docs/guide-release-testing.md) to generate a testing project to test a new React Native release against.
```diff
- test-e2e-local
+ test-release-local
```
## Changelog:
[INTERNAL]

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

Test Plan:
`yarn test-release-local-clean` works the same way:
<img width="1177" height="161" alt="Screenshot 2025-07-10 at 17 54 50" src="https://github.com/user-attachments/assets/5efe30c6-a738-476e-a670-696959e9a0fc" />

`yarn test-release-local` works the same way:
<img width="1077" height="395" alt="Screenshot 2025-07-10 at 17 59 29" src="https://github.com/user-attachments/assets/fe6c6443-9316-4ed0-b6dc-51de5ffb109c" />

Reviewed By: cipolleschi

Differential Revision: D78150648

Pulled By: vzaidman

fbshipit-source-id: 471715da271d03bc2a35afbda02074bf71f62734
2025-07-11 01:57:14 -07:00
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