Commit Graph

37639 Commits

Author SHA1 Message Date
Nicola Corti d74c3d1fb2 Create a debugOptimized buildType for Android (#52648)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52648

This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.

Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.

Changelog:

[ANDROID] [ADDED] - Create a debugOptimized buildType for Android

Reviewed By: cipolleschi

Differential Revision: D78425138

fbshipit-source-id: c1e9ea3608e7df10fb871a5584352f0747cf560b
2025-09-02 17:14:55 +02:00
Nicola Corti 084d878a05 Migrate RNTester to use {usesCleartextTraffic} Manifest Placeholder (#52620)
Summary:
This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.

Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.

## Changelog:

[ANDROID] [ADDED] - Create a debugOptimized buildType for Android

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

Test Plan:
Tested locally with RNTester by doing:

```
./gradlew installDebugOptimized
```

This is the output of the 3 generated .aar. The size difference is a proof that we're correctly stripping out the C++ debug symbols:

<img width="193" height="54" alt="Screenshot 2025-07-15 at 17 49 50" src="https://github.com/user-attachments/assets/584a0e8d-2d17-40d4-ac29-da09049d6554" />
<img width="235" height="51" alt="Screenshot 2025-07-15 at 17 49 39" src="https://github.com/user-attachments/assets/eda8f9e7-3509-4334-8c16-990e55caa04d" />
<img width="184" height="52" alt="Screenshot 2025-07-15 at 17 49 32" src="https://github.com/user-attachments/assets/a5c94385-bc00-4484-b43e-088ee039827f" />

Rollback Plan:

Reviewed By: cipolleschi

Differential Revision: D78351347

Pulled By: cortinico

fbshipit-source-id: 568a484ba8d2ee6e089cabc95451938e853fbc54
2025-09-02 17:14:51 +02:00
Fabrizio Cucci cc493fc8ff Update Podfile.lock
Changelog: [Internal]
2025-09-01 10:47:12 +01:00
React Native Bot 277a075b71 Release 0.81.1
#publish-packages-to-npm&latest
v0.81.1
2025-08-27 14:32:35 +00:00
Phil Pluckthun 03952ba3df Fix missing path escape patterns in Xcode scripts for projects with spaces (#53194)
Summary:
When running a project in a path that contains any spaces, the scripts have several escape patterns that don't handle this path correctly. For example, `"/absolute/path/with spaces"` may be rendered as `/absolute/path/with spaces` and this shows as an output error such as `No such file or directory /absolute/path/with`

This was likely a longstanding issue, but is unexpected for some beginners that first try out React Native. While it's not recommended to create a path like this, it's certainly not hard to make this mistake.

## Changelog:

[IOS] [FIXED] - fix scripts for paths containing whitespaces

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

Test Plan: tested locally; create a React Native or Expo project in a folder containing a space (e.g. `/my/path/with spaces/new-app` and build the project. With changes applied, the build should succeed. (There's related failures in `expo/expo` that need fixing too)

Reviewed By: robhogan

Differential Revision: D79993537

Pulled By: cipolleschi

fbshipit-source-id: b32697ce2405c403c410b3ceaed7e161e4a48537
2025-08-27 11:34:52 +00:00
riteshshukla04 8ace21f157 Fix: Setting maxLength to 0 in TextInput still allows typing on iOS (#52890)
Summary:
Trying to fix https://github.com/facebook/react-native/issues/52860
## 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
-->
[IOS][FIXED] Setting maxLength to 0 in TextInput still allows typing on iOS

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

Test Plan:
https://github.com/user-attachments/assets/56549e0f-6bbf-461e-815c-794abdee2018

Tested on Android too

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D80095701

Pulled By: cipolleschi

fbshipit-source-id: 5e76f88798e32097e6a619c44ff6240b4f01fc6f
2025-08-27 11:28:44 +00:00
Riccardo Cipolleschi dffbfe6fd9 [LOCAL] Fix Switch layout for iOS 26 (#53389)
* Fix Switch layout with iOS26 (#53247)

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

Apple changed the sizes of the UISwitchComponent and now, if you build an iOs app using the <Switch> component, the layout of the app will be broken because of wrong layout measurements.
This has been reported also by [https://github.com/facebook/react-native/issues/52823](https://github.com/facebook/react-native/issues/52823).

The `<Switch>` component was using hardcoded values for its size.
This change fixes the problem by:
- Using codegen for interface only
- Implementing a custom Sadow Node to ask the platform for the Switch measurements
- Updating the JS layout to wrap the size around the native component.

[iOS][Fixed] - Fix Switch layout to work with iOS26

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

Test Plan:
Tested locally with RNTester.

| iOS Version | Before | After |
| --- | --- | --- |
| < iOS 26 | https://github.com/user-attachments/assets/91d73ea3-30ba-4a5c-948e-ea5c63aa7c6d | https://github.com/user-attachments/assets/76061bc8-0f14-412a-a8fb-d1c3951772e6 |
| >= iOS 26 | https://github.com/user-attachments/assets/1abc477f-bc0a-4762-938e-98814fb2a054 | https://github.com/user-attachments/assets/77e562e1-b803-46ac-9cf6-102f062a1cd4 |

Rollback Plan:

Reviewed By: sammy-SC

Differential Revision: D79653120

Pulled By: cipolleschi

fbshipit-source-id: d99b353b7b7b5496b148779de4abe3e57dd38156

* feat: update js layout

* fix crash for feature flag
2025-08-27 12:27:24 +01:00
Riccardo Cipolleschi 6da5e66522 [LOCAL] Bump Podfile.lock 2025-08-27 12:26:01 +01:00
Christian Falch ba221e1015 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-27 12:22:17 +01:00
Moti Zilberman 7d4196cf05 fix(codegen): fix missing dependencies (#52884) (#53478)
Summary:
`react-native/codegen` uses `babel/parser` and `babel/core` but does not declare dependency on them. Depending on how packages are hoisted (and especially in pnpm setups), this causes crashes during codegen.

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

## Changelog:

[GENERAL] [FIXED] - Add missing Babel dependencies

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

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

Reviewed By: cortinico, christophpurrer

Differential Revision: D79103092

Pulled By: robhogan

fbshipit-source-id: ecaf690f994393a652ea7f0d4f30bbabeb23a434

Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
2025-08-27 10:55:47 +01:00
Christian Falch 495b307ad5 Use correct version of jsi.cpp (#53266)
Summary:
When building the xcframeworks on iOS we're including the file `jsi/jsi.cpp` in the Swift Package. This file is also included in Hermes and React Native should use the hermes version of these symbols. This is even described (but overlooked) in the React-jsi podspec file.

This causes the error seen in the bug addressed by this commit.

The fix is to exclude the `jsi/jsi.cpp` file from the jsi target in our swift package.

Fixes https://github.com/facebook/react-native/issues/53257

## Changelog:

[IOS] [FIXED] - Fixed wrong jsi symbols in use when using React.xcframework

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

Test Plan: Tested using a precompiled xcframework in the reproduction repository.

Reviewed By: rshest

Differential Revision: D80252131

Pulled By: cipolleschi

fbshipit-source-id: 915e94a1d80c2f45575e58d8054239484e861285
2025-08-27 09:44:34 +00:00
Christian Falch cfd06d8f08 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-27 09:44:00 +00:00
Christian Falch f21d4151d0 aligned symbol folders with RNdeps (#53354)
Summary:
After fixing an isssue with ReactnativeDependencies and how it built symbols (https://github.com/facebook/react-native/issues/53353) this commit will align the output of the Symbols folder for the two frameworks.

Previously we had an output in the Symbols folder that looked like this (from a local build on my machine)

- catalyst
- iphone
- iphonesimulator

After this we now have the more correct arcitecture names on these folders:

- ios-arm64
- ios-arm64_x86_64-simulator
- ios-arm64_x86_64-maccatalyst

This is in line with how the ReactNativeDependencies Symbol folder is set up.

## Changelog:

[IOS] [FIXED] - Aligned Symbols folder in React.xcframework symbols with ReactNativeDependencies.xcframework symbols.

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

Test Plan: Nightlies

Reviewed By: cortinico

Differential Revision: D80692098

Pulled By: cipolleschi

fbshipit-source-id: e952b087d5dbdeb929b45d9e6d3d7e077c9d05cc
2025-08-27 09:42:39 +00:00
Christian Falch fcb86cca4e add SWIFT_ENABLE_EXPLICIT_MODULES to xcode 26 (#53457)
Summary:
XCode 26 introduces building explicit swift modules turned on (SWIFT_ENABLE_EXPLICIT_MODULES). This breaks building with precompiled binaries.

This commit fixes this by adding a step when not building from source where we explicitly set the `SWIFT_ENABLE_EXPLICIT_MODULES` flag to `NO`.

## Changelog:

[IOS] [FIXED] - Added setting SWIFT_ENABLE_EXPLICIT_MODULES=NO when using precompiled to support Xcode 26

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

Test Plan:
```bash
npx react-native-community/cli init MyApp --version nightly --skip-install
cd MyApp
yarn
cd ios
bundle install
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
```

Build above app with Xcode 26 and verify that it no longer fails

Reviewed By: motiz88

Differential Revision: D81025367

Pulled By: cipolleschi

fbshipit-source-id: 1db7c4d7de07d62f43b355aa784d7d9de478023c
2025-08-27 09:42:24 +00:00
Vojtech Novak e6e814cfc5 fix cp command in ReactNativeDependencies.podspec (#53136)
Summary:
When running `RCT_USE_PREBUILT_RNCORE=1 RCT_USE_RN_DEP=1 pod install` I'm getting an error: `cp: framework/packages/react-native/..: File exists`

This is not seen consistently by everyone but I've seen in reported one more time at Expo. Could be related to running MacOS 26.

Somehow, apparently, the `..` is being treated as a literal directory name and cp is trying to create a directory named `..` inside `framework/packages/react-native/` which is not what we want. Using `/.` avoids that.

 ---
What also seemed to work(around) was to change `mkdir -p framework/packages/react-native` to `mkdir -p framework/packages/` and then `cp` can create the `framework/packages/react-native/..` folder. But this is definitely more confusing.

## Changelog:

Pick one each for the category and type tags:

[IOS] [FIXED] - fix "file exists" error in `ReactNativeDependencies.podspec`

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

Test Plan: tested locally, and in CI on older macOS: https://github.com/expo/expo/pull/38631 (the ios build succeeds)

Reviewed By: rshest

Differential Revision: D79990895

Pulled By: cipolleschi

fbshipit-source-id: 44ff9034800d3acd4e55ec39aabfb326382372cb
2025-08-27 09:34:13 +00:00
Maciej Jastrzębski 1ca723220d fix(a11y): TextInput aria-label handling (#53051)
Summary:
The `aria-label` prop was ignored on `TextInput` component. Which resulted in screen reader not able to read it.

This PR forwards `aria-label` to `accessibilityLabel` in a manner similar to e.g. `View` and `Text`

## 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
-->

[GENERAL] [FIXED] - a11y: fix `aria-label` on `TextInput`

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

Test Plan:
Run RNTester => TextInput => Accessibility section under Accessibility Inspector or screen reader.

iOS fixed:
https://github.com/user-attachments/assets/68c3a2ef-7dfe-479c-97fc-cbe72108c45c

iOS baseline:
https://github.com/user-attachments/assets/2e8372ba-10dc-47d2-b6b1-9f664000de7d

Reviewed By: andrewdacenko

Differential Revision: D79635413

Pulled By: rshest

fbshipit-source-id: dd2f583d67c6c6c6393e02c5fe534308e1e2f921
2025-08-27 09:28:29 +00:00
Sharif Mahmoud 4c781e4fbd Fix HEADER_SEARCH_PATHS for RuntimeExecutor when USE_FRAMEWORKS is enabled (#53099)
Summary:
`#include <ReactCommon/RuntimeExecutor.h>` stopped working in react-native 0.81 when using frameworks because it is not part of ReactCommon anymore when the split happened for iOS.

to fix this I am including RuntimeExecutor in search headers same way we include ReactCommon.

## Changelog:

[IOS] [FIXED] - Fix import RuntimeExecutor.h with USE_FRAMEWORKS

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

Test Plan:
You can enable USE_FRAMEWORKS and do `#include <react/renderer/uimanager/UIManager.h>` (which react-native-reanimated is doing).
Build will fail complaining that it can't find ReactCommon/RuntimeExecutor.h which is included in UIManager.h
Add my patch, it will work and build successfully

Reviewed By: cortinico

Differential Revision: D79796637

Pulled By: cipolleschi

fbshipit-source-id: f8bb669cfb9f4414653655ed98d2cc6bb431a3e5
2025-08-27 09:27:57 +00:00
Phil Pluckthun 5f7542d3a0 Mark @react-native/metro-config as optional peer to fix warning (#53314)
Summary:
The `react-native/metro-config` peer was added in https://github.com/facebook/react-native/commit/fe2bcbf4ba7ce983fac0cd09727c165517b6337f / https://github.com/facebook/react-native/issues/51836 by robhogan

Side-note: It's pulled in via `react-native/community-cli-plugin` which is a direct dependency of `react-native` for the `scripts/bundle.js` script. While, for expo, we'd love to find a way to make this an optional dependency (to avoid excessive deps that `expo` replaces otherwise), for now, it's a direct dependency.

The problem here is that this isn't optional, which means:
- with auto-installing peer dependencies it is directly fulfilled (while `react-native-community/cli` is already marked as optional and skipped)
- with legacy/non-auto peer-dependencies it is flagged as missing, but in an Expo project it wouldn't make sense to install directly

This causes a **package manager regression in the form of either a peer dependency warning**, that shouldn't be fulfilled in an Expo project, or (in the best case scenario) pulls in dependencies [that a user does not need](https://npmgraph.js.org/?q=%40react-native%2Fmetro-config#zoom=w&select=exact%3A%40react-native%2Fmetro-config%400.81.0).

An error message is already in place to inform the user of this being missing when it's not installed, so marking it as optional seems appropriate.

## Changelog:

[INTERNAL] [FIXED] Mark added `react-native/metro-config` peer dependency as optional

<!-- 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

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

Test Plan:
Warnings like the following won't occur in fresh Expo (54/preview/`next`) projects
```
warning "workspace-aggregator-484d9ec3-587b-43cb-97de-4dcce3876578 > microfoam-mobile > react-native > react-native/community-cli-plugin@0.81.0" has unmet peer dependency "react-native/metro-config@*".
```

Reviewed By: cortinico

Differential Revision: D80450287

Pulled By: robhogan

fbshipit-source-id: c622fd4c24025676c0ec74de826f863f1e291669
2025-08-27 09:26:36 +00:00
Riccardo Cipolleschi 6526a98d68 [iOS][precompile] Support dynamic static linkage with prebuilts (#53477)
* [ios][precompile] Add use_frameworks resolve method

To be able to handle cocoapods USE_FRAMEWORKS with both dynamic/static linkage and precompiled we needed a common way to resolve this.

The issue was that when using precompiled and USE_FRAMEWORKS our precompiled framework caused the resulting Pods project to only include header files - hence there where no need to change the header_mappings_dir which a lot of the podspecs did.

A method was added that handles this in a common way.

* [ios][precompile] added resolve_use_frameworks to podspecs

Replaced logic for resolving header mappings and module name using the new method `resolve_use_frameworks` in all podspecs.

Also added `React-oscompat` dependency on `React-jsiinspector_modern` which failed when linkage was "dynamic".

* [ios][precompile] added explicit handling of ReactCoden

When using precompiled and building with frameworks (USE_FRAMEWORKS) we need to explicitly add the correct path to ReactCodegen when calling `create_header_search_path_for_frameworks` to ensure libraries can access their codegen files.

This commit adds an explicit check to make sure we add the correct path when using frameworks and the pod is ReactCodegen.

Added includes in the NativeCXXModuleExample.cpp file to test this.

* Update packages/react-native/scripts/cocoapods/utils.rb

Co-authored-by: Riccardo Cipolleschi <cipolleschi@meta.com>

* codereview: removed test include files

* codereview: fixed issue in ruby.rb

After a github `suggestion` we had a superfluous `end`. Sorry for that.

---------

Co-authored-by: Christian Falch <christian.falch@gmail.com>
Co-authored-by: Christian Falch <875252+chrfalch@users.noreply.github.com>
2025-08-27 10:24:51 +01:00
React Native Bot 7404fb620b Release 0.81.0
#publish-packages-to-npm&latest
v0.81.0
2025-08-12 09:47:45 +00:00
Vitali Zaidman fc65e3e48e Update Podfile.lock
Changelog: [Internal]
2025-08-06 11:20:21 +01:00
React Native Bot 32effad946 Release 0.81.0-rc.5
#publish-packages-to-npm&next
v0.81.0-rc.5
2025-08-05 14:52:01 +00:00
React Native Bot df63c608b9 Release 0.81.0-rc.4
#publish-packages-to-npm&next
v0.81.0-rc.4
2025-08-05 11:08:36 +00:00
Vitali Zaidman 6e921b4c9c 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-08-04 16:58:58 +01:00
lukmccall 812824cc64 Fix ReactHostImpl.nativeModules always returning an empty list (#52986)
Summary:
During the Expo QA process, we discovered that `ReactContext.reactApplicationContext.nativeModules` always returns an empty list (https://github.com/expo/expo/blob/4e2bbb23edda74d0e24756fd1735b8763e38f7a7/packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/ReactExtensions.kt#L12). This happens because, during object creation, the `reactInstance` is always null.

## Changelog:

[ANDROID] [FIXED] - Fix `ReactHostImpl.nativeModules` always returning an empty list

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

Test Plan: - RN tester compiles 

Reviewed By: mdvacca

Differential Revision: D79451613

Pulled By: cortinico

fbshipit-source-id: d5341bcc1193eb948db4e99f16ba32a63073a6db
2025-08-04 14:26:00 +01:00
Alex Hunt aac7dbefe2 Pin Node.js version in GitHub Actions to 24.4.1 (#53013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53013

Quick fix to restore CI on `main`. `actions/setup-node` is now pulling Node.js `24.5.0`, which introduces a bug affecting `packages/dev-middleware/src/__tests__/` Jest tests.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D79551277

fbshipit-source-id: 51951ad8ffe376a478da268b50aa54ac2d9bba03
2025-08-04 14:23:38 +01:00
React Native Bot 4bbc344ec8 [LOCAL] Bump Podfile.lock 2025-07-29 17:25:32 +00:00
React Native Bot 0e6009eecf Release 0.81.0-rc.3
#publish-packages-to-npm&next
v0.81.0-rc.3
2025-07-29 15:42:59 +00:00
Nicola Corti bd94a13c5d RNGP - Fix a race condition with codegen libraries missing sources (#52803)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52803

I've just realized that our build suffer from a race condition. Specifically
libraries codegen needs to be executed before the app starts the evaluating CMake files.
Otherwise this could lead to a lot of missing files or folders.

Changelog:
[Android] [Fixed] - **rngp:** Fix a race condition with codegen libraries missing sources

Reviewed By: huntie

Differential Revision: D78886347

fbshipit-source-id: f59c201d2eab651bc4a08cf5a795acd379d18186
2025-07-29 13:14:26 +00:00
Riccardo Cipolleschi 5976618bf9 Properly setup headers for FBReactNativeSpec in prebuilds (#52783) (#52897)
Summary:
bypass-github-export-checks
Pull Request resolved: https://github.com/facebook/react-native/pull/52783

This change reverts D78158734 which was a patch to make the dynamic frameworks work properly because we were not exporting the FBReactNativeSpec headers in prebuilds correctly.

This change fixes this, by exposritng those headers correctly.

[Internal] -

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D78803425

fbshipit-source-id: 5613ed0c790455ea86668eeb436f7b78a0c80918
2025-07-29 10:14:18 +01:00
Nicola Corti 67f507a53f Also test node 20.19.4 in the test_js matrix (#52878)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52878

Now that Metro is bumped to also support node >= 20.19.4
we should be able to run test_js on `main` against 20.19.4

Changelog:
[Internal] [Changed] -

Reviewed By: robhogan, motiz88

Differential Revision: D79087608

fbshipit-source-id: 2161a893ab2fd88dc7eb1b35aa385704962018e8
2025-07-28 17:32:22 +01:00
Moti Zilberman b58e5facbd fix: View component does not have a displayName (#52688) (#52880)
Summary:
Hello, I work on [Radon IDE](ide.swmansion.com) I encountered an issue while adding support for react native 81, this PR solves it:
In https://github.com/facebook/react-native/issues/51023 EvanBacon removed `displayName` filed from `View` component adding the following comment:
>Remove displayName in favor of component name. I'm not 100% sure this is a full fallback but it is valid according to react/display-name eslint rule—https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md

Unfortunately the Fabric renderer uses the `displayName` property to generate the name of the component for the inspector functionality and in absence of it generates a name that might be confusing to the end user:

<img width="351" height="283" alt="Screenshot 2025-07-17 at 21 27 37" src="https://github.com/user-attachments/assets/852246aa-6586-4684-b80e-5d70b9678c6e" />

Problem is not specific to Radon and happens in chrome devtools as well:

<img width="501" height="130" alt="Screenshot 2025-07-17 at 22 16 52" src="https://github.com/user-attachments/assets/3514dd02-59f7-473a-87b1-6ed325d2034c" />

This PR brings back the `displayName` property to fix that.

[INTERNAL] [FIXED] - Bring back the displayName property to the View component

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

Test Plan:
- Run the application
- open chrome devtools and navigate to "components" tab
- before changes the View components would show up as `View_withRef` after they are named `View`

Rollback Plan:

Reviewed By: lunaleaps, cortinico

Differential Revision: D78512254

Pulled By: alanleedev

fbshipit-source-id: 46e4a224b09fe3fb938c055a675f687c86d7ddcb

Co-authored-by: filip131311 <159789821+filip131311@users.noreply.github.com>
2025-07-28 14:46:36 +01:00
Nicola Corti 2e52c1aab0 Make accessors inside HeadlessJsTaskService open again (#52660)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52660

The documentation for those methods mention that users should override them to
provide their own implementation.

However those vals are not `open` so users cannot really override them.
This fixes it.

See more context on https://github.com/facebook/react-native/pull/48800#issuecomment-3082665024

So this was practically a breaking change, that I'm attempting to mitigate.

Changelog:
[Android] [Fixed] - Make accessors inside HeadlessJsTaskService open again

Reviewed By: cipolleschi

Differential Revision: D78479162

fbshipit-source-id: eefc7332e2004198cd6bd64b60a66215f137ad4a
2025-07-28 13:40:28 +00:00
Nicola Corti cb20a1cd32 [0.81] Clean up feature flag preventShadowTreeCommitExhaustionWithLocking (#52862)
* Clean up feature flag preventShadowTreeCommitExhaustionWithLocking (#52791)

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

Changelog: [internal]

This cleans up this feature flag as it doesn't work as intended. We'll try another approach with a different flag instead.

Reviewed By: sammy-SC

Differential Revision: D78815892

fbshipit-source-id: 4c651a3a225de9cfb54d00346343c7f2e3bea1d5

* Implement solution for ShadowTree commmit exhaustion using recursive locks (behind a flag) (#52795)

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

Changelog: [internal]

This is another attempt to fix https://github.com/facebook/react-native/issues/51870, inspired by https://github.com/facebook/react-native/pull/52314 but gated behind a feature flag until we've tested it carefully.

Reviewed By: sammy-SC

Differential Revision: D78817100

fbshipit-source-id: 45e6cae019b212528f2b2e74b9f52fe43d07f537

* [LOCAL] Correctly sort preventShadowTreeCommitExhaustion after merge conflict

---------

Co-authored-by: Rubén Norte <rubennorte@meta.com>
2025-07-28 14:38:54 +01:00
Alex Hunt 5f3d297eec Restore flow dir in react-native package files (#52735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52735

Changelog: [Internal] (Follow up to keep #50784 non-breaking)

Reviewed By: cortinico

Differential Revision: D78662770

fbshipit-source-id: 03d931c904c0092481dbd03e8420244639305610
2025-07-28 13:38:37 +00:00
Moti Zilberman 225ca2b6a6 [0.81] Lower minimum Node.js version to 20.19.4 (#52879)
* Lower minimum Node.js version to 20.19.4 (#52678)

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

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

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

Reviewed By: cortinico

Differential Revision: D78494491

fbshipit-source-id: c8d9dc6250cb11f8a12ca7e761b65f4a8dae9265

* Bump Metro to ^0.83.1, lower minimum Node.js version to 20.19

Summary:
Metro release notes: https://github.com/facebook/metro/releases/tag/v0.83.1

The only public-facing change is a lowering of the minimum Node.js version from 22.14 to 20.19.

This will need picking to RN `0.81-stable`

Changelog: [General][Changed] Metro to ^0.83.1

Reviewed By: huntie

Differential Revision: D78895160

fbshipit-source-id: b9ccffe972249b73897f51c14873861e57a97161

* Do not setup-node twice in test_js (#52737)

Summary:
I've noticed that test_js (20) and test_js (24) are actually running on Node 22.
That's because the `yarn-install` action is invoking setup-node again with the default value (22).

This changes it. Also I'm cleaning up the workflows so that every `yarn-install` invocation is happening just after the `setup-node` invocation.

## Changelog:

[INTERNAL] -

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

Test Plan: CI which will most likely be red for test_js (20) so will need a follow-up

Reviewed By: cipolleschi

Differential Revision: D78664671

Pulled By: cortinico

fbshipit-source-id: c73390930d1511d1bf0f2d4ea92e83f50b10247f

---------

Co-authored-by: Alex Hunt <huntie@meta.com>
Co-authored-by: Rob Hogan <robhogan@meta.com>
Co-authored-by: Nicola Corti <ncor@meta.com>
2025-07-28 14:37:23 +01:00
React Native Bot 3695258eed [LOCAL] Bump Podfile.lock 2025-07-21 17:47:34 +00:00
React Native Bot 68ef746ec5 Release 0.81.0-rc.2
#publish-packages-to-npm&next
v0.81.0-rc.2
2025-07-21 15:42:12 +00:00
Nicola Corti dd12edf35f [0.81] Implement mechanism to prevent ShadowTree commit exhaustion (#52736)
* Implement mechanism to prevent ShadowTree commit exhaustion (#52645)

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

Changelog: [internal]

This add a new feature flag to test a fix for https://github.com/facebook/react-native/issues/51870

Reviewed By: cortinico, sammy-SC

Differential Revision: D78418504

fbshipit-source-id: 2792026b6936393d196fd1e3162f8b2c61a38ed6

* Fix incorrect locking and attempts check in ShadowTree experiment (#52681)

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

Changelog: [internal]

In the original change I made in D78418504 / https://github.com/facebook/react-native/pull/52645 I made 2 mistakes:
1. Used a lock that would try to re-lock on itself without it being recursive (which would cause a deadlock). I didn't see that because when testing I didn't hit the case where we'd exhaust the options.
2. The `attemps` variable wasn't incremented, so we never left the loop in case of exhaustion.

This propagates a flag to `tryCommit` to indicate we've already locked on the commitMutex_ so we don't need to lock again in that case and increases the counter, fixing the issue.

Reviewed By: cortinico

Differential Revision: D78497509

fbshipit-source-id: 546ccd0c84aed5416ce1aef47d79419b4fe06f66

* Rollout `preventShadowTreeCommitExhaustionWithLocking` in experimental (#52709)

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

We want to make user for folks in OSS to try
`preventShadowTreeCommitExhaustionWithLocking`. Therefore I'm updating the OSS
release channel for this flag to experimental.

Changelog:
[Internal] [Changed] - Rollout `preventShadowTreeCommitExhaustionWithLocking` in experimental

Reviewed By: rubennorte

Differential Revision: D78558655

fbshipit-source-id: 02a9d216c7b2f8f7bdc1340213f82b70c5692dc7

---------

Co-authored-by: Rubén Norte <rubennorte@meta.com>
2025-07-21 15:31:19 +01:00
Nick Gerleman d61decce15 Fix build_android GHA Job (#52694)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52694

build_android job is always failing, with this assertion. Seems like find/replace in D78484060 gone wrong?

Changelog: [Internal]

Reviewed By: sbuggay

Differential Revision: D78534334

fbshipit-source-id: 291bdd01b41fa6efea00ed63a0dee8bdb14cbc3a
2025-07-21 15:19:11 +01:00
Riccardo Cipolleschi be05c8fda8 Fix Windows CI (#52666)
Summary:
As per [this issue](https://github.com/actions/runner-images/issues/12416), Windows machine doesn't have access to D: drive anymore

## Changelog:
[Internal] -

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

Test Plan: GHA

Reviewed By: huntie

Differential Revision: D78484060

Pulled By: cipolleschi

fbshipit-source-id: 36d844f9d7d69f1d74a154b019307cc1e269ad66
2025-07-21 15:19:06 +01:00
Riccardo Cipolleschi cdd7f99581 [LOCAL][RN][Release] Fix E2E test script when the ci flag is not specified (#52609) 2025-07-21 15:04:30 +01:00
Riccardo Cipolleschi d8bf94489a [RN][Release]Fix E2E script when using CI artifacts (#52606) 2025-07-21 15:03:49 +01:00
Christian Falch ddadb2e788 resolve xcframework paths from conf switch script (#52664)
Summary:
When switching between debug/release we run a small script to make sure to copy the correct version of the RNDeps xcframework.

This script was missing a resolve function that fixed up some path issues that we do when installing in the podspec.

## Changelog:

[IOS] [FIXED] - Fixed issue with RNDeps release/debug switch failing

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

Test Plan:
- Create new RN App
- Install pod with prebuilt deps
- Build (success)
- Switch to release
- Build (success)

Reviewed By: cortinico

Differential Revision: D78481590

Pulled By: cipolleschi

fbshipit-source-id: 2d02b0bc55e8aef6f3fafb4f7aa193c4cf00414e
2025-07-21 14:03:36 +00:00
Christian Falch 828287de3c added missing script in package.json (#52663)
Summary:
When switching between release/debug we're running a script to copy the correct xcframework. This script for the React-Core prebuilts was not part of the package.json file.

This caused the build to fail after trying to switch from debug -> release.

## Changelog:
[IOS] [FIXED] - Fixed missing script for resolving prebuilt xcframework when switching between release/debug

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

Test Plan:
- Create new RN App
- Install pod with prebuilt deps and core
- Build (success)
- Switch to release
- Build (success)

Reviewed By: cortinico

Differential Revision: D78481302

Pulled By: cipolleschi

fbshipit-source-id: 1c7181e63219098ae140d77ff1cb2c0c9b9642e5
2025-07-21 14:00:14 +00:00
Tim Yung 2e1d7111dd RN: Default Hermes Parser to reactRuntimeTarget: "19" (#52625)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52625

Changes `react-native/babel-preset` so that by default, `hermes-parser` is configured with `reactRuntimeTarget: "19"`. This changes the compiled output of Component Syntax to not use `forwardRef` when a `ref` prop is present.

Additionally, this adds a new preset option property, `hermesParserOptions`. This object allows users of `react-native/babel-preset` to supply overrides for any `hermes-parser` options.

Changelog:
[General][Changed] - Configures `react-native/babel-preset` to target React 19 by default, meaning Component Syntax will not compile to `forwardRef` calls when a `ref` prop is present.
[General][Added] - Added support to `react-native/babel-preset` for a `hermesParserOptions` option, that expects an object that enables overriding `hermes-parser` options.

Reviewed By: SamChou19815

Differential Revision: D78383269

fbshipit-source-id: 1e6b66b9bfbeaf8a06fdc39031cb6de7e921765f
2025-07-21 13:58:43 +00:00
Alex Hunt 14bfad58f6 Add optional safeAreaInsets prop to NewAppScreen (replacing SafeAreaView) (#52507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52507

Resolves https://github.com/reactwg/react-native-releases/issues/1011.

Changelog:
[General][Changed] - `NewAppScreen` no longer internally handles device safe area, use optional `safeAreaInsets` prop (aligned in 0.81 template)

Reviewed By: cortinico

Differential Revision: D78006238

fbshipit-source-id: 01fb16d6754b69a722ea11838d558bebd4748026
2025-07-21 13:58:04 +00:00
React Native Bot 10b63c15b6 [LOCAL] Bump Podfile.lock 2025-07-15 12:06:48 +00:00
React Native Bot b06bb89ddd Release 0.81.0-rc.1
#publish-packages-to-npm&next
v0.81.0-rc.1
2025-07-15 09:52:01 +00:00
Nicola Corti ab73961753 Revert "Fix Dimensions window values on Android < 15 (#47554)"
This reverts commit 9c4da7b905.
2025-07-14 14:39:05 +01:00