Compare commits

...
Author SHA1 Message Date
React Native Bot 57ff54492f Release 0.81.5
#publish-packages-to-npm&0.81-stable
2025-10-21 16:14:43 +00:00
Janic DuplessisandGitHub 34137a82ca Allow extending ReactTextViewManager (#53980) 2025-10-21 15:22:09 +02:00
25harshandReact Native Bot cf598f523b fix(iOS): Fix RCTDeviceInfo crash when application.delegate.window is nil (#53645)
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

Fixes a crash in `RCTDeviceInfo.interfaceOrientationDidChange` when `application.delegate.window` is nil. This crash affects multiple modern iOS app architectures where the traditional window property may not be set:

- **SwiftUI apps using `main`** instead of traditional AppDelegate
- **Brownfield React Native integrations** where the host app manages windows
- **Scene-based lifecycle apps** (iOS 13+) using SceneDelegate
- **Custom window management** setups

**The Problem:**
```
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[MyApp.AppDelegate window]: unrecognized selector sent to instance'
```

This occurs when trying to access `.frame` on a nil window object during orientation changes. Modern iOS development patterns don't always require setting `application.delegate.window`, but React Native's RCTDeviceInfo assumes this property exists.

**The Solution:**
Replace direct `application.delegate.window` access with `RCTKeyWindow()` and add nil-safe fallback:

```objc
// Before (crashes in modern apps)
BOOL isRunningInFullScreen =
    CGRectEqualToRect(application.delegate.window.frame, application.delegate.window.screen.bounds);

// After (safe for all app configurations)
UIWindow *delegateWindow = RCTKeyWindow();
BOOL isRunningInFullScreen = delegateWindow ?
    CGRectEqualToRect(delegateWindow.frame, delegateWindow.screen.bounds) : YES;
```

This approach:
- Uses `RCTKeyWindow()` pattern already established elsewhere in RCTDeviceInfo
- Provides safe fallback defaulting to fullscreen when window state is unknown
- Maintains existing multitasking detection behavior (Split View, Slide Over)
- Is backward compatible with traditional React Native apps

## 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] - Fix RCTDeviceInfo crash when application.delegate.window is nil in modern iOS app architectures

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

Test Plan:
### Manual Testing

**1. SwiftUI main App Test:**
```bash
# Created SwiftUI app with main lifecycle
# Integrated React Native component
# Result: No crash during orientation changes, fullscreen detection works
 PASS: Orientation changes handled safely
 PASS: Multitasking detection stable
```

**2. Traditional React Native App:**
```bash
# Tested with standard RN template app
# Verified existing behavior unchanged
 PASS: Existing functionality preserved
 PASS: No regressions in dimension reporting
```

**3. Brownfield Integration:**
```bash
# Integrated RN in existing iOS app without window property
# Triggered orientation changes and multitasking transitions
 PASS: No crashes during orientation events
 PASS: Split View and Slide Over work correctly
```

**4. Scene-based Lifecycle App:**
```bash
# Created app using SceneDelegate for window management
# Tested orientation and multitasking scenarios
 PASS: Proper handling when SceneDelegate manages windows
 PASS: No crashes during app lifecycle transitions
```

### Edge Case Testing

**RCTKeyWindow() Returns Nil:**
- Confirmed defaults to `YES` (fullscreen)
- No crashes when no key window available
- Multitasking detection remains stable

**Multiple Window Scenarios:**
- Tested with iPad multiple windows
- Uses correct key window for measurements
- Proper behavior in complex window hierarchies

**Orientation During Transitions:**
- App backgrounding/foregrounding during orientation
- Multitasking mode changes during rotation
- No crashes or inconsistent states

### Automated Testing

```bash
# All existing tests pass
yarn test
 RCTDeviceInfoTests pass

# Code style compliance
yarn lint
 Follows React Native Objective-C guidelines
```

### Impact Verification

**Before Fix:**
- Crash in SwiftUI apps using main
- Crash in Scene-based lifecycle apps
- Crash in brownfield integrations

**After Fix:**
- All app architectures work safely
- Multitasking detection preserved
- Backward compatibility maintained
- No performance impact

Rollback Plan:

Reviewed By: javache

Differential Revision: D81931754

Pulled By: cipolleschi

fbshipit-source-id: c3ea1a2922b1d48ca6bc1fc32861b490322fd254
2025-10-20 13:41:47 +00:00
lukmccallandReact Native Bot 447a7a3527 Fix request permission is not always resolving in Android 16 (#53898)
Summary:
Fixes: https://github.com/facebook/react-native/issues/53887
Fixes: https://github.com/expo/expo/issues/39480

In the latest Android 16 update, requesting permissions does not always change the app's state (the `onPause` and `onResume` functions aren't called). For instance, when you deny permission 3 times, the last promise won't resolve until you move the app to the background. The current logic inside the `ReactActivityDelegate` assumes that Android will call `onResume` after receiving permission state information from the system, which is no longer the case.

Probably connected with [this commit](https://android.googlesource.com/platform/packages/modules/Permission/%2B/5dca0ccb26f2b99d706a1d3e9402f851e849c913)

## Changelog:

[ANDROID] [FIXED] - Fix request permission not always resolving in Android 16

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

Test Plan:
- I've tested it in the RNTester by denying the camera permission three times.
- I've also checked if the patch works with the Expo permissions code.

Reviewed By: javache

Differential Revision: D83059478

Pulled By: cortinico

fbshipit-source-id: 7bf33b379a1b6606ad2da2f75d337bf951e3986b
2025-10-20 13:33:57 +00:00
Riccardo CipolleschiandGitHub 4106d54a6d fixed switch (#54155) 2025-10-20 15:28:01 +02:00
Christian FalchandReact Native Bot 779c768b6e fixed cp command to work with gnu coreutils (#54063)
Summary:
When using gnu coreutils, installation of ReactNativeDependenices on iOS fails at compile time with errors like in the following issue (in the Expo repo):

https://github.com/expo/expo/issues/38992

This is caused by a missing `.` in the end of the path name that the built-in MacOS cp command handles well, but that will create an extra Headers folder when using cp from gnu coreutils.

This commit fixes this by adding the missing `.`

## Changelog:

[IOS] [FIXED] - Fixed issue when using gnu coreutils cp command when using precompiled binaries causing compilation error

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

Test Plan:
- Verify that you're running gnu coreutils (`cp --version`)
- Create new expo app `npx create-expo-app`
- Build on iOS - should error without this fix, should work with the fix.

Reviewed By: christophpurrer

Differential Revision: D83964083

Pulled By: javache

fbshipit-source-id: 46dc074ca9b7fc97fa5a37ef48d68a895e3310ff
2025-10-20 13:24:07 +00:00
Pieter De BaetsandReact Native Bot 20e8bf3950 Fix useNativeTransformHelper behaviour when frame size is 0 (#53978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53978

Inconsistency between the previous and old version of `processTransform` - if frameSize is 0, the transform was being ignored, which is not correct when considering a fixed transform origin and a rotation animation for example. Instead, always apply the transform origin if it's set.

Changelog: [Android][Fixed] Fixed representation of transforms when view is originally zero-sized

Reviewed By: mdvacca

Differential Revision: D83469083

fbshipit-source-id: e9ae1500f64c700708edb00b2d5871e3f224fb07
2025-10-20 13:20:31 +00:00
Nicola Corti e7e32f70b0 [LOCAL] Use REACT_NATIVE_BOT_GITHUB_TOKEN token for changelog and bump lockfiles 2025-09-17 11:45:38 +01:00
Gabriel Donadel 4a27725362 Update Podfile.lock
Changelog: [Internal]
2025-09-10 15:33:11 -03:00
React Native Bot 5cb9187034 Release 0.81.4
#publish-packages-to-npm&0.81-stable
2025-09-10 13:51:32 +00:00
Phil PluckthunandReact Native Bot c3149f22a0 Remove outdated artifacts codegen early return (#53690)
Summary:
Follow-up to https://github.com/facebook/react-native/issues/53503 for a regression

When no React Native module is present this bail condition stops us from generating the artifacts podspec that's needed to complete build.

## Changelog:

[IOS] [FIXED] - Fix regression that skips artifacts code generation

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

Test Plan:
- Create an app **without** any React Native modules, run `pod install`; without this fix the podspec will be missing and the build will fail
  - With expo this can be reproduced using `create-expo-app --template blank-typescript@next` on `react-native@0.81.2`
  - With the community CLI this can be reproduced using `npx react-native-community/cli@latest init test --skip-install --version 0.81.2` and uninstalling `react-native-safe-area-context`

Reviewed By: javache

Differential Revision: D82103491

Pulled By: cipolleschi

fbshipit-source-id: 3d9619b5a935ca920220824b3963a9a107f926ca
2025-09-10 12:30:45 +00:00
Phil PluckthunandReact Native Bot bb73315a3f Use autolinking react-native-config output in iOS artifacts generator (#53503)
Summary:
Resolves https://github.com/facebook/react-native/issues/53501

This is a pretty major oversight of (presumably) the old autolinking refactor. The iOS autolinking's second stage, invoked in `use_react_native!` does not accept the `react-native-config` sub-command's `react-native-config` output. This is only invoked and used in the prior step, `use_native_modules`.

The second step instead invokes old code that does something _similar_ to the new autolinking in `scripts/generate-artifacts-executor`, and happens to align in most cases. (But it does "autolinking" from scratch). tl;dr: When the results don't match up, things go wrong.

Instead, we now write the autolinking (react native config) results to a file, then read the output back in the second step.

This doesn't affect Android/Gradle, which are implemented correctly.

[IOS] [FIXED] - Use autolinking-generated react-native-config output in second step of cocoapods linking that generates artifacts and generated source

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

Test Plan:
- See https://github.com/facebook/react-native/issues/53501 for failing repro
- Clone for working repro: https://github.com/byCedric/react-native-codegen-ios-autolinking/tree/fix-54503
  - Note: Contains this PR's changes as a patch
  - `bun install`
  - `bun expo run:ios`

Reviewed By: cortinico

Differential Revision: D81490755

Pulled By: cipolleschi

fbshipit-source-id: eefe786a116404f4ed24bd7125dfb108a811f71e
2025-09-10 11:59:04 +00:00
Gabriel Donadel 97b23a3462 Update Podfile.lock
Changelog: [Internal]
2025-09-09 23:54:29 -03:00
React Native Bot 503f0e9ec9 Release 0.81.3
#publish-packages-to-npm&0.81-stable
2025-09-10 00:51:28 +00:00
Gabriel Donadel 537e3ad930 Revert "Use autolinking react-native-config output in iOS artifacts generator (#53503)"
This reverts commit a2eb29e5e7.
2025-09-09 19:14:11 -03:00
Gabriel Donadel 63619bcbad Update Podfile.lock
Changelog: [Internal]
2025-09-09 19:13:29 -03:00
React Native Bot 65119b0107 Release 0.81.2
#publish-packages-to-npm&0.81-stable
2025-09-09 16:43:27 +00:00
a346096da8 [0.81] Backport useNativeEqualsInNativeReadableArrayAndroid and useNativeTransformHelperAndroid in the experimental channel (#53567)
* Use native implementation of equals in ReadableNativeArray (#52611)

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

We compare the current transform (represented as a ReadableArray) with the incoming one to know whether to invalidate. This can be expensive as it requires to materialize the entire transform data structure over JNI. Instead, we can delegate this comparison to native code, which can compare the underlying folly::dynamic directly.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D78340288

fbshipit-source-id: f44a054e234694c316fb080fe2dbc2017780123a

* Use native helpers to accelerate transform processing (#52603)

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

Processing transforms is expensive in Java, as it requires bridging the entire ReadableNativeArray/Map. Instead, we can use the existing parser logic `resolveTransform` logic to perform this operation in C++.

Ideally, we actually re-use the existing parsed transform from Props, that could be something we revisit after Props 2.0.

As a follow-up, we should consider also moving the matrix decomposition logic from MatrixMathHelper here, and make that the only information we send back to Java.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D78298588

fbshipit-source-id: a698ac8587ccfb2be04665747082398ccdde9294

* Add TransformHelper.cpp to `reactnativejni_common` (#52640)

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

Not having `TransformHelper.cpp` included in CMake is causing the C++ code to fail compiling.
This diff fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi, javache

Differential Revision: D78414015

fbshipit-source-id: 4900427a86eb38bfec10e5e385296d89c73e9051

* [LOCAL] Unbreak compilation due to CMake dependencies

---------

Co-authored-by: Pieter De Baets <pieterdb@meta.com>
2025-09-09 15:25:02 +02:00
Nicola CortiandGitHub ed92bd67f4 [0.81] Backport: Create a debugOptimized buildType for Android (#53568)
* 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

* 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-09 15:22:13 +02:00
Phil PluckthunandReact Native Bot 366f2ad505 Replace execSync with spawnSync for tarball extraction paths that need to be escaped (#53540)
Summary:
Follow-up to https://github.com/facebook/react-native/issues/53194

This wasn't previously visible in testing without prebuilds and without a release build. This doesn't show up in debug builds.

When testing more against paths that contain spaces, I noticed that release builds can still run into trouble due to the use of `execSync` without escaping paths. While, in other scripts that aren't used in user-projects (afaict), we often escape with quotes and rely on `execSync` calling the shell (due to its `shell: true` default), in some scripts we don't have quote escapes.

That said, since paths could in theory contain quotes, adding quotes wouldn't be sufficient. Instead, since the affected `tar` calls are really trivial, we can instead use `spawnSync` with the `shell: false` default, which escapes arguments automatically.

## Changelog:

[IOS] [FIXED] - fix Node scripts related to prebuilt tarball extraction for paths containing whitespaces

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

Test Plan: - Create a project in a folder `with spaces` and build a release build

Reviewed By: cipolleschi, cortinico

Differential Revision: D81406841

Pulled By: robhogan

fbshipit-source-id: 08bb06b2cd2b15dc17c2f95fab9024129deca6f3
2025-09-09 13:09:05 +00:00
Phil PluckthunandGabriel Donadel a2eb29e5e7 Use autolinking react-native-config output in iOS artifacts generator (#53503)
Summary:
Resolves https://github.com/facebook/react-native/issues/53501

This is a pretty major oversight of (presumably) the old autolinking refactor. The iOS autolinking's second stage, invoked in `use_react_native!` does not accept the `react-native-config` sub-command's `react-native-config` output. This is only invoked and used in the prior step, `use_native_modules`.

The second step instead invokes old code that does something _similar_ to the new autolinking in `scripts/generate-artifacts-executor`, and happens to align in most cases. (But it does "autolinking" from scratch). tl;dr: When the results don't match up, things go wrong.

Instead, we now write the autolinking (react native config) results to a file, then read the output back in the second step.

This doesn't affect Android/Gradle, which are implemented correctly.

[IOS] [FIXED] - Use autolinking-generated react-native-config output in second step of cocoapods linking that generates artifacts and generated source

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

Test Plan:
- See https://github.com/facebook/react-native/issues/53501 for failing repro
- Clone for working repro: https://github.com/byCedric/react-native-codegen-ios-autolinking/tree/fix-54503
  - Note: Contains this PR's changes as a patch
  - `bun install`
  - `bun expo run:ios`

Reviewed By: cortinico

Differential Revision: D81490755

Pulled By: cipolleschi

fbshipit-source-id: eefe786a116404f4ed24bd7125dfb108a811f71e
2025-09-09 10:05:03 -03: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
2025-08-27 14:32:35 +00:00
Phil PluckthunandReact Native Bot 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
riteshshukla04andReact Native Bot 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 CipolleschiandGitHub 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 FalchandRiccardo Cipolleschi 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
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 FalchandReact Native Bot 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 FalchandReact Native Bot 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 FalchandReact Native Bot 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 FalchandReact Native Bot 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 NovakandReact Native Bot 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ębskiandReact Native Bot 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 MahmoudandReact Native Bot 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 PluckthunandReact Native Bot 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
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
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
2025-08-05 14:52:01 +00:00
React Native Bot df63c608b9 Release 0.81.0-rc.4
#publish-packages-to-npm&next
2025-08-05 11:08:36 +00:00
Vitali ZaidmanandVitali 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
lukmccallandVitali Zaidman 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 HuntandVitali Zaidman 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
2025-07-29 15:42:59 +00:00
Nicola CortiandReact Native Bot 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 CipolleschiandGitHub 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 CortiandMoti Zilberman 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
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 CortiandReact Native Bot 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
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 HuntandReact Native Bot 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
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
2025-07-21 15:42:12 +00:00
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 GerlemanandMoti Zilberman 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 CipolleschiandMoti Zilberman 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 CipolleschiandGitHub 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 CipolleschiandGitHub d8bf94489a [RN][Release]Fix E2E script when using CI artifacts (#52606) 2025-07-21 15:03:49 +01:00
Christian FalchandReact Native Bot 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 FalchandReact Native Bot 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 YungandReact Native Bot 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 HuntandReact Native Bot 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
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
Jakub PiaseckiandMoti Zilberman c7cd66c64e Fix display: contents nodes not being cloned with the wrong owner (#52530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52530

This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: https://github.com/Expensify/App/issues/65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.

Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner

X-link: https://github.com/facebook/yoga/pull/1826

Reviewed By: adityasharat, NickGerleman

Differential Revision: D78084270

Pulled By: j-piasecki

fbshipit-source-id: eb81f6d7dcd1665974d07261ba693e2abea239bb
2025-07-14 11:56:48 +01:00
Nicola CortiandMoti Zilberman 2b13f47ff9 Gradle to 8.14.3 (#52466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52466

Just another patch bump of Gradle 8.14

Changelog:
[Android] [Changed] - Gradle to 8.14.3

Reviewed By: NickGerleman

Differential Revision: D77865220

fbshipit-source-id: 450d175242f046909ab1984654d24e92a2536d5d
2025-07-14 11:50:00 +01:00
Christian FalchandMoti Zilberman 75dcb5fc79 fix wrong use of return in header file generation loop (#52490)
Summary:
Instead of returning when creating the list of header files from our podspecs, we now call `continue`. This is a bug that causes all subsequent globs in the header file list to be omitted after the first omitted glob.

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - Fixed premature return in header file generation from podspec globs

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

Test Plan: Run prebuild scripts and verify that React-Fabric podspec headers are included in the resulting xcframework.

Reviewed By: mdvacca

Differential Revision: D78012399

Pulled By: cipolleschi

fbshipit-source-id: 2d334f4f7ff966ea4c778786a7056e13a255a708
2025-07-14 11:48:00 +01:00
Mathieu ActhernoeneandMoti Zilberman 9c4da7b905 Fix Dimensions window values on Android < 15 (#47554)
Summary:
This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the `Dimensions` API `window` values on Android < 15, when edge-to-edge is enabled.

Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):

<img width="300" alt="Screenshot 2025-06-27 at 16 23 02" src="https://github.com/user-attachments/assets/c7d11334-9298-4f7f-a75c-590df8cc2d8a" />

Using `WindowMetricsCalculator` from AndroidX:

<img width="300" alt="Screenshot 2025-06-27 at 16 34 01" src="https://github.com/user-attachments/assets/7a4e3dc7-a83b-421b-8f6d-fd1344f5fe81" />

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

## Changelog:

[Android] [Fixed] Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled

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

Test Plan:
Run the example app on an Android < 15 device.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D77547628

Pulled By: alanleedev

fbshipit-source-id: 9d841f642d5b7ef3294dfbf3868137087a672ad6
2025-07-14 11:47:46 +01:00
Riccardo CipolleschiandMoti Zilberman bb27a16d84 Fix RCTPushNotification podspec to work with prebuilds (#52531)
Summary:
This change tries to use the prebuilds we build in CI i other iOS jobs to speed-up the iOS CI

bypass-github-export-checks

## Changelog:
[Internal] -

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

Test Plan:
Build rntester using prebuilds:

```
# after downloading the prebuilds from CI and unzipping them
export HERMES_ENGINE_TARBALL_PATH=~/Downloads/hermes-ios-Debug.tar.gz
export RCT_USE_LOCAL_RN_DEP=~/Downloads/reactnative-dependencies-debug.tar.gz
export RCT_TESTONLY_RNCORE_TARBALL_PATH=~/Downloads/React.xcframework.tar.gz

USE_FRAMEWORKS=dynamic bundle exec pod install
open RNTesterPods.xcworkspace
```
And then build from Xcode.

Reviewed By: rshest

Differential Revision: D78158734

Pulled By: cipolleschi

fbshipit-source-id: 43cbb66bd44fa621292b69de0dadde5ed20c4574
2025-07-14 11:47:30 +01:00
Tomasz ZawadzkiandMoti Zilberman 6b8d1a07d9 Expose react_renderer_bridging headers via prefab (#52529)
Summary:
This PR fixes the following build error while trying to build `react-native@0.81.0-rc.0` app with `react-native-screens@4.10.0` installed using react-native prebuilds (AAR) due to a missing `react/renderer/bridging/bridging.h` file in `prefab/modules/` inside `react-android-0.81.0-rc.0-debug.aar`.

```
In file included from /Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp:2:
  In file included from /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/Binding.h:12:
  In file included from /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/FabricUIManagerBinding.h:22:
  /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/renderer/uimanager/primitives.h:14:10: fatal error: 'react/renderer/bridging/bridging.h' file not found
     14 | #include <react/renderer/bridging/bridging.h>
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.
```

## Changelog:

[ANDROID] [CHANGED] - Expose `react_renderer_bridging` headers via prefab

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

Reviewed By: cipolleschi

Differential Revision: D78092428

Pulled By: cortinico

fbshipit-source-id: de8208ae7545201f600c277a0c8907575c310c58
2025-07-14 11:46:59 +01:00
Nicola CortiandMoti Zilberman d9bf351b12 Back out "Remove ShadowNodeTraits::Trait::DirtyYogaNode" (#52528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52528

This was a breaking change that is currently breaking `react-native-safe-area-context` so we can't ship it as it is, especially because all the apps in OSS will be affected by this.

Changelog:
[General] [Changed] - Revert breaking change due to the removal of `ShadowNodeTraits::Trait::DirtyYogaNode`

Original commit changeset: 869e81f0ae00

Original Phabricator Diff: D75324251

Reviewed By: huntie

Differential Revision: D78085848

fbshipit-source-id: f7fcc5e33d59cc966a4ee88dfdbedca4f4c580e0
2025-07-14 11:46:27 +01:00
Christian FalchandMoti Zilberman c665a96939 add release/debug switch script (#52498)
Summary:
Fixes #T228219721

This commit adds the debug/release switch script like we have for rn deps and hermes for react-core prebuilt:

- Added script: replace-rncore-version-js
- Inserted script into React-Core-prebuilt podspec
- Updated rncore.rb with correct filenames

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - add release/debug switch script for React-Core-prebuilt

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

Test Plan: Run in RNTester and switch between release/debug

Reviewed By: rshest

Differential Revision: D78012917

Pulled By: cipolleschi

fbshipit-source-id: 71cad23cd41484a8253fc89d5dce8653649657a0
2025-07-14 11:46:05 +01:00
Christian FalchandMoti Zilberman c9263e71e1 add support for USE_FRAMEWORKS when using prebuilt React Native Core (#52489)
Summary:
When using prebuilts the USE_FRAMEWORKS setting is not really relevant for the React Native code, since there will not be any source code to build frameworks for - and because we already have a framework for the code in React.XCFramework.

This commit adds a new command to the React Native podspecs like we did with the ReactNativeDependencies framework. The method is called `add_rncore_dependency` and it does nothing when building from source - but when linking with the React.XCFramework it explicitly adds linking with the framework.

In addition there are a few places in the ruby code where we check for the USE_FRAMEWORK value and changes some settings - where needed this commit will add a separate check to ensure we're building from source when making these changes.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Added support for using USE_FRAMEWORKS with prebuilt React Native Core

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

Test Plan:
RNTester:

- Builds without USE_FRAMEWORKS as before with/without prebuilt
- Builds with USE_FRAMEWORKS=dynamic as before with source - and now also with prebuilt code.
- Same goes for the static variant.

Reviewed By: mdvacca

Differential Revision: D78012332

Pulled By: cipolleschi

fbshipit-source-id: ea942738ae52b9dceae48fb78a5026f04b7545b8
2025-07-14 11:45:03 +01:00
Riccardo CipolleschiandMoti Zilberman bbb322b4f4 Fix bump-podfile-lock job by using Xcode 16.2 (#52513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52513

We bumped the requirement for cocoapods to use Xcode 16.1 or greater.
This job was not update and therefore it failed when releasing 0.81.0-rc.0.

This change should fix it and it should be cherry picked in the release branch too.
By default, the macos executor in github actions are using Xcode 15.2

## Changelog
[Internal] -

Reviewed By: cortinico, fabriziocucci

Differential Revision: D78008316

fbshipit-source-id: 4d05233ca3b936cf128400030328124c453963ea
2025-07-14 11:44:49 +01:00
Riccardo CipolleschiandMoti Zilberman 528173eb96 Change polling to try and download the pom manifest (#52512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52512

The way Maven works is that the artifacts are uploaded and available way before the browsing UI will allow us to browse them.

By trying to download the `.pom` file instead of checking for the browsing website to be visible, we can shave some minutes during the release

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D78008635

fbshipit-source-id: 96516163628d6d25db385d996a11b4af78db764a
2025-07-14 11:44:13 +01:00
Riccardo CipolleschiandMoti Zilberman 5d779bd60b Fix ENTERPRISE_REPOSITORY usage (#52553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52553

This change fixes the usage of `ENTERPRISE_REPOSITORY` in Ruby

## Changelog
[Internal] -

Reviewed By: cortinico

Differential Revision: D78152641

fbshipit-source-id: e4ace014f1b7cbeb1ec5a0dea955d1fc2bae5b67
2025-07-14 11:43:39 +01:00
Riccardo CipolleschiandMoti Zilberman 31fdd536ca Add the ENTERPRISE_REPOSITORY env var to let user consume artifacts from their personal maven mirror (#52514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52514

As per title, this change add the `ENTERPRISE_REPOSITORY` env variable so that users can use their owm maven mirror to consume artifacts rather than the official url.

This is helpful as:
- we can reduce the traffic toward maven central
- companies can speed up their builds by relying on local/closer replicas

## Changelog:
[iOS][Added] - Add the `ENTERPRISE_REPOSITORY` env variable to cocopaods infra

Reviewed By: cortinico

Differential Revision: D78011424

fbshipit-source-id: 24b83b4866095d7fe3318362afc5075b99b146e7
2025-07-14 11:43:20 +01:00
Nicola CortiandMoti Zilberman 3a99e31e56 @DeprecatedInNewArchitecture -> @Deprecated (#52399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52399

I'm raising the deprecation warnings for those methods that are using legacy arch.
Previously the `DeprecatedInNewArchitecture` was not generating warnings for user in their builds, while now the Kotlin's/Java's `DeprecatedInNewArchitecture` it will.

Changelog:
[Android] [Changed] - Introduce more deprecation warnings for Legacy Arch classes

Reviewed By: mdvacca

Differential Revision: D77736713

fbshipit-source-id: bc21729ed8253d3ec6b6a40577bcd76622c3f8a6
2025-07-14 11:42:21 +01:00
Rob HoganandGitHub 6b9f5d622f Bump Metro to 0.83.0 (#52577) 2025-07-14 08:51:12 +02:00
Riccardo Cipolleschi 87c8e687d9 [LOCAL] Bump podfile.lock 2025-07-09 14:34:56 +01:00
React Native Bot 1fc81fe216 Release 0.81.0-rc.0
#publish-packages-to-npm&next
2025-07-09 11:08:15 +00:00
Riccardo CipolleschiandGitHub 918e422620 [RN][CI]Fix prebuilds for stable releases (#52503) 2025-07-09 12:05:13 +01:00
Riccardo Cipolleschi bce7f544ac Revert "[LOCAL] Add more logging around computeNightlyTarballURL"
This reverts commit 1a6887bd70.
2025-07-09 12:00:37 +01:00
Riccardo Cipolleschi b22bed22b4 Revert "Release 0.81.0-rc.0"
This reverts commit b52ecff628.
2025-07-09 12:00:18 +01:00
React Native Bot b52ecff628 Release 0.81.0-rc.0
#publish-packages-to-npm&next
2025-07-09 09:03:09 +00:00
Nicola Corti 1a6887bd70 [LOCAL] Add more logging around computeNightlyTarballURL 2025-07-09 09:59:38 +01:00
Nicola Corti e01cbf95e4 Revert "Release 0.81.0-rc.0"
This reverts commit 9879028183.
2025-07-09 09:59:01 +01:00
React Native Bot 9879028183 Release 0.81.0-rc.0
#publish-packages-to-npm&next
2025-07-08 16:14:15 +00:00
Fabrizio CucciandMoti Zilberman de8aeb658e Fix all workflows to use node 22.14.0
Summary:
We hit this error when trying to release 0.81.0 (see [action run](https://github.com/facebook/react-native/actions/runs/16147471618/job/45570030039)):

> error react-native/metro-babel-transformer@0.81.0-main: The engine "node" is incompatible with this module. Expected version ">= 22.14.0". Got "20.19.2"

This should fix the issue.

Changelog: [Internal]

Reviewed By: motiz88, cortinico

Differential Revision: D77938906
2025-07-08 17:10:54 +01:00
Moti Zilberman 07579d4945 Bump hermes version for 0.81.0 2025-07-07 14:42:52 +01:00
264 changed files with 2964 additions and 1099 deletions
@@ -15,8 +15,6 @@ runs:
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore Cached Artifacts
@@ -45,6 +43,8 @@ runs:
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Yarn- Install Dependencies
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: ./.github/actions/yarn-install
@@ -14,23 +14,23 @@ runs:
uses: actions/download-artifact@v4
with:
name: hermes-workspace
path: 'D:\tmp\hermes'
path: 'C:\tmp\hermes'
- name: Set up workspace
shell: powershell
run: |
mkdir -p D:\tmp\hermes\osx-bin
mkdir -p C:\tmp\hermes\osx-bin
mkdir -p .\packages\react-native\sdks\hermes
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
cp -r -Force C:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
- name: Windows cache
uses: actions/cache@v4
with:
key: v3-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
path: |
D:\tmp\hermes\win64-bin\
D:\tmp\hermes\hermes\icu\
D:\tmp\hermes\hermes\deps\
D:\tmp\hermes\hermes\build_release\
C:\tmp\hermes\win64-bin\
C:\tmp\hermes\hermes\icu\
C:\tmp\hermes\hermes\deps\
C:\tmp\hermes\hermes\build_release\
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.3.2
- name: Set up workspace
@@ -83,4 +83,4 @@ runs:
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
path: C:\tmp\hermes\win64-bin\
+2 -2
View File
@@ -116,12 +116,12 @@ runs:
- name: Print Artifacts Directory
shell: bash
run: ls -lR ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup gradle
uses: ./.github/actions/setup-gradle
with:
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
uses: ./.github/actions/yarn-install
- name: Build packages
@@ -14,6 +14,8 @@ inputs:
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Yarn install
uses: ./.github/actions/yarn-install
- name: Configure Git
+2
View File
@@ -35,6 +35,8 @@ runs:
with:
java-version: '17'
distribution: 'zulu'
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Start Metro in Debug
@@ -17,9 +17,6 @@ outputs:
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
shell: bash
id: hermes-version
@@ -67,6 +64,8 @@ runs:
echo "HERMES_CACHED=true" >> "$GITHUB_OUTPUT"
fi
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Yarn- Install Dependencies
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
uses: ./.github/actions/yarn-install
+1 -1
View File
@@ -4,7 +4,7 @@ inputs:
node-version:
description: 'The node.js version to use'
required: false
default: '22'
default: '22.14.0'
runs:
using: "composite"
steps:
@@ -23,6 +23,8 @@ runs:
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Create Hermes folder
shell: bash
run: mkdir -p "$HERMES_WS_DIR"
@@ -34,8 +36,6 @@ runs:
- name: Print Downloaded hermes
shell: bash
run: ls -lR "$HERMES_WS_DIR"
- name: Run yarn
uses: ./.github/actions/yarn-install
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
@@ -38,7 +38,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(1);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
@@ -55,7 +55,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(1);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
@@ -67,7 +67,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(0);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
@@ -81,7 +81,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(90);
expect(mockExit).toHaveBeenCalledWith(1);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
});
@@ -13,13 +13,14 @@ const SLEEP_S = 60; // 1 minute
const MAX_RETRIES = 90; // 90 attempts. Waiting between attempt: 1 min. Total time: 90 min.
const ARTIFACT_URL =
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/';
const ARTIFACT_NAME = 'react-native-artifacts-';
async function verifyArtifactsAreOnMaven(version, retries = MAX_RETRIES) {
if (version.startsWith('v')) {
version = version.substring(1);
}
const artifactUrl = `${ARTIFACT_URL}${version}`;
const artifactUrl = `${ARTIFACT_URL}${version}/${ARTIFACT_NAME}${version}.pom`;
for (let currentAttempt = 1; currentAttempt <= retries; currentAttempt++) {
const response = await fetch(artifactUrl);
+5
View File
@@ -10,6 +10,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
fetch-depth: 0
fetch-tags: true
- name: Install dependencies
@@ -18,6 +19,10 @@ jobs:
run: |
git config --local user.email "bot@reactnative.dev"
git config --local user.name "React Native Bot"
- name: Setup xcode
uses: ./.github/actions/setup-xcode
with:
xcode-version: '16.2.0'
- name: Extract branch name
run: |
TAG="${{ github.ref_name }}";
+2
View File
@@ -10,6 +10,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
fetch-depth: 0
fetch-tags: true
- name: Install dependencies
@@ -22,6 +23,7 @@ jobs:
- name: Generate Changelog
uses: actions/github-script@v6
with:
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
script: |
const {generateChangelog} = require('./.github/workflow-scripts/generateChangelog');
const version = '${{ github.ref_name }}';
+3 -3
View File
@@ -128,9 +128,9 @@ jobs:
runs-on: windows-2025
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
HERMES_WS_DIR: 'C:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
+5 -5
View File
@@ -23,7 +23,7 @@ jobs:
id: restore-ios-slice
uses: actions/cache/restore@v4
with:
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: packages/react-native/
- name: Setup node.js
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
@@ -83,7 +83,7 @@ jobs:
# Move the XCFramework in the destination directory
mv /tmp/third-party/packages/react-native/third-party/ReactNativeDependencies.xcframework packages/react-native/third-party/ReactNativeDependencies.xcframework
VERSION=$(jq -r '.version' package.json)
VERSION=$(jq -r '.version' packages/react-native/package.json)
echo "$VERSION-${{matrix.flavor}}" > "packages/react-native/third-party/version.txt"
cat "packages/react-native/third-party/version.txt"
# Check destination directory
@@ -117,7 +117,7 @@ jobs:
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
with:
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: |
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
packages/react-native/.build/headers
@@ -140,7 +140,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: packages/react-native/.build/output/xcframeworks
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
- name: Setup node.js
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-node
@@ -209,4 +209,4 @@ jobs:
path: |
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
@@ -179,8 +179,9 @@ jobs:
- name: Compress and Rename dSYM
if: steps.restore-xcframework.outputs.cache-hit != 'true'
run: |
tar -cz -f packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz \
packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM
cd packages/react-native/third-party/Symbols/
tar -cz -f ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz .
mv ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz ./ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
- name: Upload XCFramework Artifact
uses: actions/upload-artifact@v4
with:
+3 -3
View File
@@ -125,9 +125,9 @@ jobs:
runs-on: windows-2025
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
HERMES_WS_DIR: 'C:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
+4 -4
View File
@@ -392,9 +392,9 @@ jobs:
runs-on: windows-2025
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
HERMES_WS_DIR: 'C:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
@@ -593,7 +593,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: ["24", "22"]
node-version: ["24.4.1", "22", "20.19.4"]
steps:
- name: Checkout
uses: actions/checkout@v4
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+6 -6
View File
@@ -26,8 +26,8 @@
"set-version": "node ./scripts/releases/set-version.js",
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
"test-ci": "jest --maxWorkers=2 --ci --reporters=\"default\" --reporters=\"jest-junit\"",
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
"test-release-local-clean": "node ./scripts/release-testing/test-release-local-clean.js",
"test-release-local": "node ./scripts/release-testing/test-release-local.js",
"test-ios": "./scripts/objc-test.sh test",
"test-typescript": "tsc -p packages/react-native/types/tsconfig.json",
"test-generated-typescript": "tsc -p packages/react-native/types_generated/tsconfig.test.json",
@@ -52,8 +52,8 @@
"@electron/packager": "^18.3.6",
"@jest/create-cache-key-function": "^29.7.0",
"@microsoft/api-extractor": "^7.52.2",
"@react-native/metro-babel-transformer": "0.81.0-main",
"@react-native/metro-config": "0.81.0-main",
"@react-native/metro-babel-transformer": "0.81.5",
"@react-native/metro-config": "0.81.5",
"@tsconfig/node22": "22.0.2",
"@types/react": "^19.1.0",
"@typescript-eslint/parser": "^7.1.1",
@@ -90,9 +90,9 @@
"jest-snapshot": "^29.7.0",
"markdownlint-cli2": "^0.17.2",
"markdownlint-rule-relative-links": "^3.0.0",
"metro-babel-register": "^0.82.5",
"metro-babel-register": "^0.83.1",
"metro-memory-fs": "^0.82.5",
"metro-transform-plugins": "^0.82.5",
"metro-transform-plugins": "^0.83.1",
"micromatch": "^4.0.4",
"node-fetch": "^2.2.0",
"nullthrows": "^1.1.1",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/assets-registry",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Asset support code for React Native.",
"license": "MIT",
"repository": {
@@ -17,7 +17,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"files": [
"path-support.js",
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-plugin-codegen",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Babel plugin to generate native module and view manager code for React Native.",
"license": "MIT",
"repository": {
@@ -19,14 +19,14 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"files": [
"index.js"
],
"dependencies": {
"@babel/traverse": "^7.25.3",
"@react-native/codegen": "0.81.0-main"
"@react-native/codegen": "0.81.5"
},
"devDependencies": {
"@babel/core": "^7.25.2"
+10 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/community-cli-plugin",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Core CLI commands for React Native",
"keywords": [
"react-native",
@@ -22,16 +22,16 @@
"dist"
],
"dependencies": {
"@react-native/dev-middleware": "0.81.0-main",
"@react-native/dev-middleware": "0.81.5",
"debug": "^4.4.0",
"invariant": "^2.2.4",
"metro": "^0.82.5",
"metro-config": "^0.82.5",
"metro-core": "^0.82.5",
"metro": "^0.83.1",
"metro-config": "^0.83.1",
"metro-core": "^0.83.1",
"semver": "^7.1.3"
},
"devDependencies": {
"metro-resolver": "^0.82.5"
"metro-resolver": "^0.83.1"
},
"peerDependencies": {
"@react-native-community/cli": "*",
@@ -40,9 +40,12 @@
"peerDependenciesMeta": {
"@react-native-community/cli": {
"optional": true
},
"@react-native/metro-config": {
"optional": true
}
},
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
}
}
@@ -147,7 +147,7 @@ async function runServer(
// $FlowIgnore[cannot-write] Assigning to readonly property
metroConfig.reporter = reporter;
const serverInstance = await Metro.runServer(metroConfig, {
const {httpServer: serverInstance} = await Metro.runServer(metroConfig, {
host: args.host,
secure: args.https,
secureCert: args.cert,
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/core-cli-utils",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "React Native CLI library for Frameworks to build on",
"license": "MIT",
"main": "./src/index.flow.js",
@@ -21,7 +21,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"files": [
"dist"
+2 -3
View File
@@ -76,9 +76,8 @@ function getNodePackagePath(packageName: string): string {
}
function metro(...args: $ReadOnlyArray<string>): ExecaPromise {
const metroPath = getNodePackagePath(path.join('metro', 'src', 'cli.js'));
log(`🚇 ${metroPath} ${args.join(' ')} `);
return execa('node', [metroPath, ...args]);
log(`🚇 metro ${args.join(' ')} `);
return execa('npx', ['--offline', 'metro', ...args]);
}
export const tasks = {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-frontend",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Debugger frontend for React Native based on Chrome DevTools",
"keywords": [
"react-native",
@@ -20,6 +20,6 @@
"BUILD_INFO"
],
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/debugger-shell",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend",
"keywords": [
"react-native",
@@ -26,7 +26,7 @@
},
"license": "MIT",
"engines": {
"node": ">= 22.14.0",
"node": ">= 20.19.4",
"electron": ">=36.3.0"
},
"dependencies": {
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/dev-middleware",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Dev server middleware for React Native",
"keywords": [
"react-native",
@@ -23,7 +23,7 @@
],
"dependencies": {
"@isaacs/ttlcache": "^1.4.1",
"@react-native/debugger-frontend": "0.81.0-main",
"@react-native/debugger-frontend": "0.81.5",
"chrome-launcher": "^0.15.2",
"chromium-edge-launcher": "^0.2.0",
"connect": "^3.6.5",
@@ -35,7 +35,7 @@
"ws": "^6.2.3"
},
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"devDependencies": {
"selfsigned": "^2.4.1",
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-config",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "ESLint config for React Native",
"license": "MIT",
"repository": {
@@ -16,13 +16,13 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"main": "index.js",
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@react-native/eslint-plugin": "0.81.0-main",
"@react-native/eslint-plugin": "0.81.5",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"eslint-config-prettier": "^8.5.0",
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "ESLint rules for @react-native/eslint-config",
"license": "MIT",
"repository": {
@@ -22,6 +22,6 @@
"hermes-eslint": "0.29.1"
},
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
}
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/eslint-plugin-specs",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "ESLint rules to validate NativeModule and Component Specs",
"license": "MIT",
"repository": {
@@ -26,7 +26,7 @@
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
"@react-native/codegen": "0.81.0-main",
"@react-native/codegen": "0.81.5",
"make-dir": "^2.1.0",
"pirates": "^4.0.1",
"source-map-support": "0.5.0"
@@ -36,6 +36,6 @@
"hermes-eslint": "0.29.1"
},
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
}
}
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/gradle-plugin",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Gradle Plugin for React Native",
"license": "MIT",
"repository": {
@@ -16,7 +16,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"scripts": {
"build": "./gradlew build",
@@ -100,10 +100,10 @@ abstract class ReactExtension @Inject constructor(val project: Project) {
* Allows to specify the debuggable variants (by default just 'debug'). Variants in this list will
* not be bundled (the bundle file will not be created and won't be copied over).
*
* Default: ['debug']
* Default: ['debug', 'debugOptimized']
*/
val debuggableVariants: ListProperty<String> =
objects.listProperty(String::class.java).convention(listOf("debug"))
objects.listProperty(String::class.java).convention(listOf("debug", "debugOptimized"))
/** Hermes Config */
@@ -18,6 +18,7 @@ import com.facebook.react.tasks.GenerateEntryPointTask
import com.facebook.react.tasks.GeneratePackageListTask
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFieldsForApp
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFieldsForLibraries
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildTypesForApp
import com.facebook.react.utils.AgpConfiguratorUtils.configureDevServerLocation
import com.facebook.react.utils.AgpConfiguratorUtils.configureNamespaceForLibraries
import com.facebook.react.utils.BackwardCompatUtils.configureBackwardCompatibilityReactMap
@@ -84,6 +85,7 @@ class ReactPlugin : Plugin<Project> {
configureAutolinking(project, extension)
configureCodegen(project, extension, rootExtension, isLibrary = false)
configureResources(project, extension)
configureBuildTypesForApp(project)
}
// Library Only Configuration
@@ -26,5 +26,21 @@ class ReactRootProjectPlugin : Plugin<Project> {
it.evaluationDependsOn(":app")
}
}
// We need to make sure that `:app:preBuild` task depends on all other subprojects' preBuild
// tasks. This is necessary in order to have all the codegen generated code before the CMake
// configuration build kicks in.
project.gradle.projectsEvaluated {
val appProject = project.rootProject.subprojects.find { it.name == "app" }
val appPreBuild = appProject?.tasks?.findByName("preBuild")
if (appPreBuild != null) {
// Find all other subprojects' preBuild tasks
val otherPreBuildTasks =
project.rootProject.subprojects
.filter { it != appProject }
.mapNotNull { it.tasks.findByName("preBuild") }
// Make :app:preBuild depend on all others
appPreBuild.dependsOn(otherPreBuildTasks)
}
}
}
}
@@ -148,6 +148,7 @@ abstract class GeneratePackageListTask : DefaultTask() {
{{ packageImports }}
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
@@ -19,6 +19,7 @@ import java.net.Inet4Address
import java.net.NetworkInterface
import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
import kotlin.plus
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.plugins.AppliedPlugin
@@ -27,6 +28,36 @@ import org.w3c.dom.Element
@Suppress("UnstableApiUsage")
internal object AgpConfiguratorUtils {
fun configureBuildTypesForApp(project: Project) {
val action =
Action<AppliedPlugin> {
project.extensions
.getByType(ApplicationAndroidComponentsExtension::class.java)
.finalizeDsl { ext ->
ext.buildTypes {
val debug =
getByName("debug").apply {
manifestPlaceholders["usesCleartextTraffic"] = "true"
}
getByName("release").apply {
manifestPlaceholders["usesCleartextTraffic"] = "false"
}
maybeCreate("debugOptimized").apply {
manifestPlaceholders["usesCleartextTraffic"] = "true"
initWith(debug)
externalNativeBuild {
cmake {
arguments("-DCMAKE_BUILD_TYPE=Release")
matchingFallbacks += listOf("release")
}
}
}
}
}
}
project.pluginManager.withPlugin("com.android.application", action)
}
fun configureBuildConfigFieldsForApp(project: Project, extension: ReactExtension) {
val action =
Action<AppliedPlugin> {
@@ -233,6 +233,7 @@ class GeneratePackageListTaskTest {
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
@@ -311,7 +312,8 @@ class GeneratePackageListTaskTest {
import com.facebook.react.aPackage;
// @react-native/another-package
import com.facebook.react.anotherPackage;
@SuppressWarnings("deprecation")
public class PackageList {
private Application application;
private ReactNativeHost reactNativeHost;
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-config",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Metro configuration for React Native.",
"license": "MIT",
"repository": {
@@ -16,7 +16,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"exports": {
".": "./src/index.js",
@@ -26,9 +26,9 @@
"dist"
],
"dependencies": {
"@react-native/js-polyfills": "0.81.0-main",
"@react-native/metro-babel-transformer": "0.81.0-main",
"metro-config": "^0.82.5",
"metro-runtime": "^0.82.5"
"@react-native/js-polyfills": "0.81.5",
"@react-native/metro-babel-transformer": "0.81.5",
"metro-config": "^0.83.1",
"metro-runtime": "^0.83.1"
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/new-app-screen",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "NewAppScreen component for React Native",
"keywords": [
"react-native"
@@ -30,6 +30,6 @@
}
},
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
}
}
+17 -12
View File
@@ -13,10 +13,7 @@ import {ThemedText, useTheme} from './Theme';
import * as React from 'react';
import {
Image,
Platform,
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
TouchableHighlight,
@@ -29,24 +26,32 @@ import {version as ReactNativeVersion} from 'react-native/Libraries/Core/ReactNa
export type NewAppScreenProps = $ReadOnly<{
templateFileName?: string,
safeAreaInsets?: $ReadOnly<{
top: number,
bottom: number,
left: number,
right: number,
}>,
}>;
const statusBarHeightOffset = Platform.select({
android: StatusBar.currentHeight || 0,
default: 0,
});
export default function NewAppScreen({
templateFileName = 'App.tsx',
safeAreaInsets = {top: 0, bottom: 0, left: 0, right: 0},
}: NewAppScreenProps): React.Node {
const {colors} = useTheme();
const isDarkMode = useColorScheme() === 'dark';
const isLargeScreen = useWindowDimensions().width > 600;
return (
<SafeAreaView style={{backgroundColor: colors.background}}>
<ScrollView>
<View style={[styles.container, {paddingTop: statusBarHeightOffset}]}>
<View
style={{
backgroundColor: colors.background,
paddingTop: safeAreaInsets.top,
paddingLeft: safeAreaInsets.left,
paddingRight: safeAreaInsets.right,
}}>
<ScrollView style={{paddingBottom: safeAreaInsets.bottom}}>
<View style={styles.container}>
<View style={styles.header}>
<Image
style={styles.logo}
@@ -99,7 +104,7 @@ export default function NewAppScreen({
</View>
</View>
</ScrollView>
</SafeAreaView>
</View>
);
}
+8
View File
@@ -11,6 +11,14 @@ import type * as React from 'react';
export type NewAppScreenProps = Readonly<{
templateFileName?: string | undefined;
safeAreaInsets?:
| Readonly<{
top: number;
bottom: number;
left: number;
right: number;
}>
| undefined;
}>;
export function NewAppScreen(props: NewAppScreenProps): React.ReactNode;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/normalize-colors",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Color normalization for React Native.",
"license": "MIT",
"repository": {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/js-polyfills",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Polyfills for React Native.",
"license": "MIT",
"repository": {
@@ -18,7 +18,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"files": [
"console.js",
@@ -1,6 +1,6 @@
{
"name": "@react-native/babel-preset",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Babel preset for React Native applications",
"repository": {
"type": "git",
@@ -13,7 +13,7 @@
],
"license": "MIT",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"main": "src/index.js",
"files": [
@@ -66,7 +66,7 @@
"@babel/plugin-transform-typescript": "^7.25.2",
"@babel/plugin-transform-unicode-regex": "^7.24.7",
"@babel/template": "^7.25.0",
"@react-native/babel-plugin-codegen": "0.81.0-main",
"@react-native/babel-plugin-codegen": "0.81.5",
"babel-plugin-syntax-hermes-parser": "0.29.1",
"babel-plugin-transform-flow-enums": "^0.0.2",
"react-refresh": "^0.14.0"
+22 -14
View File
@@ -38,19 +38,6 @@ function isFirstParty(fileName) {
// use `this.foo = bar` instead of `this.defineProperty('foo', ...)`
const loose = true;
const defaultPlugins = [
[require('babel-plugin-syntax-hermes-parser'), {parseLangTypes: 'flow'}],
[require('babel-plugin-transform-flow-enums')],
[require('@babel/plugin-transform-block-scoping')],
[require('@babel/plugin-transform-class-properties'), {loose}],
[require('@babel/plugin-transform-private-methods'), {loose}],
[require('@babel/plugin-transform-private-property-in-object'), {loose}],
[require('@babel/plugin-syntax-dynamic-import')],
[require('@babel/plugin-syntax-export-default-from')],
...passthroughSyntaxPlugins,
[require('@babel/plugin-transform-unicode-regex')],
];
// For Static Hermes testing (experimental), the hermes-canary transformProfile
// is used to enable regenerator (and some related lowering passes) because SH
// requires more Babel lowering than Hermes temporarily.
@@ -234,7 +221,28 @@ const getPreset = (src, options) => {
plugins: [require('@babel/plugin-transform-flow-strip-types')],
},
{
plugins: defaultPlugins,
plugins: [
[
require('babel-plugin-syntax-hermes-parser'),
{
parseLangTypes: 'flow',
reactRuntimeTarget: '19',
...options.hermesParserOptions,
},
],
[require('babel-plugin-transform-flow-enums')],
[require('@babel/plugin-transform-block-scoping')],
[require('@babel/plugin-transform-class-properties'), {loose}],
[require('@babel/plugin-transform-private-methods'), {loose}],
[
require('@babel/plugin-transform-private-property-in-object'),
{loose},
],
[require('@babel/plugin-syntax-dynamic-import')],
[require('@babel/plugin-syntax-export-default-from')],
...passthroughSyntaxPlugins,
[require('@babel/plugin-transform-unicode-regex')],
],
},
{
test: isTypeScriptSource,
@@ -1,6 +1,6 @@
{
"name": "@react-native/metro-babel-transformer",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Babel transformer for React Native applications.",
"repository": {
"type": "git",
@@ -14,7 +14,7 @@
],
"license": "MIT",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"main": "src/index.js",
"files": [
@@ -27,7 +27,7 @@
],
"dependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.81.0-main",
"@react-native/babel-preset": "0.81.5",
"hermes-parser": "0.29.1",
"nullthrows": "^1.1.1"
},
+4 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/codegen",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Code generation tools for React Native",
"license": "MIT",
"repository": {
@@ -18,7 +18,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"scripts": {
"build": "yarn clean && node scripts/build.js --verbose",
@@ -29,6 +29,8 @@
"lib"
],
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/parser": "^7.25.3",
"glob": "^7.1.1",
"hermes-parser": "0.29.1",
"invariant": "^2.2.4",
@@ -1,6 +1,6 @@
{
"name": "@react-native/compatibility-check",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "Check a React Native app's boundary between JS and Native for incompatibilities",
"license": "MIT",
"repository": {
@@ -19,7 +19,7 @@
],
"bugs": "https://github.com/facebook/react-native/issues",
"engines": {
"node": ">= 22.14.0"
"node": ">= 20.19.4"
},
"exports": {
".": "./src/index.js",
@@ -29,7 +29,7 @@
"dist"
],
"dependencies": {
"@react-native/codegen": "0.81.0-main"
"@react-native/codegen": "0.81.5"
},
"devDependencies": {
"flow-remove-types": "^2.237.2",
@@ -1,6 +1,6 @@
{
"name": "@react-native/popup-menu-android",
"version": "0.81.0-main",
"version": "0.81.5",
"description": "PopupMenu for the Android platform",
"main": "index.js",
"files": [
@@ -21,7 +21,7 @@
},
"license": "MIT",
"devDependencies": {
"@react-native/codegen": "0.81.0-main"
"@react-native/codegen": "0.81.5"
},
"peerDependencies": {
"@types/react": "^19.1.0",
@@ -12,7 +12,9 @@ import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
@Suppress("DEPRECATION")
public class OSSLibraryExamplePackage : ReactPackage {
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
listOf(NativeSampleModule(reactContext))
@@ -26,8 +26,8 @@
],
"devDependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.81.0-main",
"react-native": "1000.0.0"
"@react-native/babel-preset": "0.81.5",
"react-native": "0.81.5"
},
"peerDependencies": {
"react": "*",
@@ -84,4 +84,5 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -55,4 +55,5 @@ Pod::Spec.new do |s|
end
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -264,7 +264,7 @@ const Switch: component(
disabled,
onTintColor: trackColorForTrue,
style: StyleSheet.compose(
{height: 31, width: 51},
{alignSelf: 'flex-start' as const},
StyleSheet.compose(
style,
ios_backgroundColor == null
@@ -618,6 +618,9 @@ function InternalTextInput(props: TextInputProps): React.Node {
// so omitting onBlur and onFocus pressability handlers here.
const {onBlur, onFocus, ...eventHandlers} = usePressability(config);
const _accessibilityLabel =
props?.['aria-label'] ?? props?.accessibilityLabel;
let _accessibilityState;
if (
accessibilityState != null ||
@@ -681,6 +684,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
{...otherProps}
{...eventHandlers}
acceptDragAndDropTypes={props.experimental_acceptDragAndDropTypes}
accessibilityLabel={_accessibilityLabel}
accessibilityState={_accessibilityState}
accessible={accessible}
submitBehavior={submitBehavior}
@@ -744,8 +748,9 @@ function InternalTextInput(props: TextInputProps): React.Node {
{...otherProps}
{...colorProps}
{...eventHandlers}
accessibilityState={_accessibilityState}
accessibilityLabel={_accessibilityLabel}
accessibilityLabelledBy={_accessibilityLabelledBy}
accessibilityState={_accessibilityState}
accessible={accessible}
acceptDragAndDropTypes={props.experimental_acceptDragAndDropTypes}
autoCapitalize={autoCapitalize}
@@ -432,6 +432,7 @@ jest.unmock('../TextInput');
expect(instance.toJSON()).toMatchInlineSnapshot(`
<RCTSinglelineTextInputView
accessibilityLabel="label"
accessibilityState={
Object {
"busy": true,
+5 -1
View File
@@ -23,7 +23,7 @@ import {use} from 'react';
*
* @see https://reactnative.dev/docs/view
*/
export default component View(
component View(
ref?: React.RefSetter<React.ElementRef<typeof ViewNativeComponent>>,
...props: ViewProps
) {
@@ -213,3 +213,7 @@ export default component View(
}
return actualView;
}
View.displayName = 'View';
export default View;
+3 -3
View File
@@ -15,8 +15,8 @@ export const version: $ReadOnly<{
patch: number,
prerelease: string | null,
}> = {
major: 1000,
minor: 0,
patch: 0,
major: 0,
minor: 81,
patch: 5,
prerelease: null,
};
@@ -53,4 +53,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-NativeModulesApple")
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -50,4 +50,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-featureflags")
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -52,4 +52,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -48,4 +48,6 @@ Pod::Spec.new do |s|
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
add_rncore_dependency(s)
end
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-NativeModulesApple")
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
+6 -2
View File
@@ -84,7 +84,10 @@ let reactDebug = RNTarget(
let jsi = RNTarget(
name: .jsi,
path: "ReactCommon/jsi",
excludedPaths: ["jsi/test", "CMakeLists.txt", "jsi/CMakeLists.txt"],
// JSI is a part of hermes-engine. Including them also in react-native will violate the One Definition Rule.
// Precompiled binaries are only supported with hermes - so we can safely exclude the jsi.cpp file.
// https://github.com/facebook/react-native/issues/53257
excludedPaths: ["jsi/test", "jsi/jsi.cpp", "CMakeLists.txt", "jsi/CMakeLists.txt"],
dependencies: [.reactNativeDependencies]
)
@@ -421,6 +424,7 @@ let reactFabricComponents = RNTarget(
"components/view/platform/android",
"components/view/platform/windows",
"components/view/platform/macos",
"components/switch/iosswitch/react/renderer/components/switch/MacOSSwitchShadowNode.mm",
"components/textinput/platform/android",
"components/text/platform/android",
"components/textinput/platform/macos",
@@ -433,7 +437,7 @@ let reactFabricComponents = RNTarget(
"conponents/rncore", // this was the old folder where RN Core Components were generated. If you ran codegen in the past, you might have some files in it that might make the build fail.
],
dependencies: [.reactNativeDependencies, .reactCore, .reactJsiExecutor, .reactTurboModuleCore, .jsi, .logger, .reactDebug, .reactFeatureFlags, .reactUtils, .reactRuntimeScheduler, .reactCxxReact, .yoga, .reactRendererDebug, .reactGraphics, .reactFabric, .reactTurboModuleBridging],
sources: ["components/inputaccessory", "components/modal", "components/safeareaview", "components/text", "components/text/platform/cxx", "components/textinput", "components/textinput/platform/ios/", "components/unimplementedview", "components/virtualview", "textlayoutmanager", "textlayoutmanager/platform/ios"]
sources: ["components/inputaccessory", "components/modal", "components/safeareaview", "components/text", "components/text/platform/cxx", "components/textinput", "components/textinput/platform/ios/", "components/unimplementedview", "components/virtualview", "textlayoutmanager", "textlayoutmanager/platform/ios", "components/switch/iosswitch"]
)
/// React-FabricImage.podspec
@@ -62,8 +62,7 @@ Pod::Spec.new do |s|
CONFIG="Debug"
fi
# TODO(T228219721): Add this for React Native Core as well
##### "$NODE_BINARY" "$REACT_NATIVE_PATH/third-party-podspecs/replace_dependencies_version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT"
"$NODE_BINARY" "$REACT_NATIVE_PATH/scripts/replace-rncore-version.js" -c "$CONFIG" -r "#{version}" -p "$PODS_ROOT"
EOS
}
@@ -73,7 +72,7 @@ Pod::Spec.new do |s|
# always run the script without warning
script_phase[:always_out_of_date] = "1"
end
s.script_phase = script_phase
end
end
+1 -4
View File
@@ -83,10 +83,6 @@ Pod::Spec.new do |s|
ss.exclude_files = exclude_files
ss.private_header_files = "React/Cxx*/*.h"
# Include prebuilt if we're not building from source
if !ReactNativeCoreUtils.build_rncore_from_source()
ss.dependency "React-Core-prebuilt", version
end
end
s.subspec "DevSupport" do |ss|
@@ -137,4 +133,5 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -54,6 +54,7 @@ RCT_EXTERN CGFloat RCTScreenScale(void);
RCT_EXTERN CGFloat RCTFontSizeMultiplier(void);
RCT_EXTERN CGSize RCTScreenSize(void);
RCT_EXTERN CGSize RCTViewportSize(void);
RCT_EXTERN CGSize RCTSwitchSize(void);
// Round float coordinates to nearest whole screen pixel (not point)
RCT_EXTERN CGFloat RCTRoundPixelValue(CGFloat value);
@@ -426,6 +426,22 @@ CGSize RCTViewportSize(void)
return window ? window.bounds.size : RCTScreenSize();
}
CGSize RCTSwitchSize(void)
{
static CGSize rctSwitchSize;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
RCTUnsafeExecuteOnMainQueueSync(^{
CGSize switchSize = [UISwitch new].intrinsicContentSize;
// Apple does not take into account the thumb border when returning the
// width of the UISwitch component, so we are adding 2 pixels for the border
// which is not customizable and it is the same for legacy and liquid glass.
rctSwitchSize = CGSizeMake(switchSize.width + 2, switchSize.height);
});
});
return rctSwitchSize;
}
CGFloat RCTRoundPixelValue(CGFloat value)
{
CGFloat scale = RCTScreenScale();
@@ -21,9 +21,9 @@ NSDictionary* RCTGetReactNativeVersion(void)
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^(void){
__rnVersion = @{
RCTVersionMajor: @(1000),
RCTVersionMinor: @(0),
RCTVersionPatch: @(0),
RCTVersionMajor: @(0),
RCTVersionMinor: @(81),
RCTVersionPatch: @(5),
RCTVersionPrerelease: [NSNull null],
};
});
@@ -238,11 +238,10 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
- (void)interfaceOrientationDidChange
{
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
UIApplication *application = RCTSharedApplication();
UIInterfaceOrientation nextOrientation = RCTKeyWindow().windowScene.interfaceOrientation;
UIWindow *window = RCTKeyWindow();
UIInterfaceOrientation nextOrientation = window.windowScene.interfaceOrientation;
BOOL isRunningInFullScreen =
CGRectEqualToRect(application.delegate.window.frame, application.delegate.window.screen.bounds);
BOOL isRunningInFullScreen = window ? CGRectEqualToRect(window.frame, window.screen.bounds) : YES;
// We are catching here two situations for multitasking view:
// a) The app is in Split View and the container gets resized -> !isRunningInFullScreen
// b) The app changes to/from fullscreen example: App runs in slide over mode and goes into fullscreen->
@@ -63,4 +63,5 @@ Pod::Spec.new do |s|
add_dependency(s, "React-NativeModulesApple")
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -96,6 +96,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
@interface RCTModalHostViewComponentView () <RCTFabricModalHostViewControllerDelegate>
@property (nonatomic, weak) UIView *accessibilityFocusedView;
@end
@implementation RCTModalHostViewComponentView {
@@ -148,6 +150,7 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
{
BOOL shouldBePresented = !_isPresented && _shouldPresent && self.window;
if (shouldBePresented) {
[self saveAccessibilityFocusedView];
self.viewController.presentationController.delegate = self;
_isPresented = YES;
@@ -179,6 +182,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
if (eventEmitter) {
eventEmitter->onDismiss(ModalHostViewEventEmitter::OnDismiss{});
}
[self restoreAccessibilityFocusedView];
}];
}
}
@@ -207,6 +212,23 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
[self ensurePresentedOnlyIfNeeded];
}
- (void)saveAccessibilityFocusedView
{
id focusedElement = UIAccessibilityFocusedElement(nil);
if (focusedElement && [focusedElement isKindOfClass:[UIView class]]) {
self.accessibilityFocusedView = (UIView *)focusedElement;
}
}
- (void)restoreAccessibilityFocusedView
{
id viewToFocus = self.accessibilityFocusedView;
if (viewToFocus) {
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, viewToFocus);
self.accessibilityFocusedView = nil;
}
}
#pragma mark - RCTFabricModalHostViewControllerDelegate
- (void)boundsDidChange:(CGRect)newBounds
@@ -9,10 +9,10 @@
#import <React/RCTConversions.h>
#import <react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h>
#import <react/renderer/components/FBReactNativeSpec/EventEmitters.h>
#import <react/renderer/components/FBReactNativeSpec/Props.h>
#import <react/renderer/components/FBReactNativeSpec/RCTComponentViewHelpers.h>
#import <react/renderer/components/switch/AppleSwitchComponentDescriptor.h>
#import "RCTFabricComponentsPlugins.h"
@@ -22,6 +22,7 @@
#import "RCTTextInputNativeCommands.h"
#import "RCTTextInputUtils.h"
#import <limits>
#import "RCTFabricComponentsPlugins.h"
/** Native iOS text field bottom keyboard offset amount */
@@ -447,7 +448,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
}
}
if (props.maxLength) {
if (props.maxLength < std::numeric_limits<int>::max()) {
NSInteger allowedLength = props.maxLength - _backedTextInputView.attributedText.string.length + range.length;
if (allowedLength > 0 && text.length > allowedLength) {
@@ -45,10 +45,7 @@ Pod::Spec.new do |s|
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
}
if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = 'FBReactNativeSpec'
s.module_name = 'React_RCTFBReactNativeSpec'
end
resolve_use_frameworks(s, header_mappings_dir: 'FBReactNativeSpec', module_name: "React_RCTFBReactNativeSpec")
s.dependency "React-jsi"
s.dependency "RCTRequired"
@@ -61,6 +58,7 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
s.subspec "components" do |ss|
ss.source_files = podspec_sources("FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/**/*.{m,mm,cpp,h}", "FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/**/*.{h}")
@@ -75,6 +75,7 @@ Pod::Spec.new do |s|
"react/renderer/components/scrollview/platform/cxx",
"react/renderer/components/text/platform/cxx",
"react/renderer/components/textinput/platform/ios",
"react/renderer/components/switch/iosswitch",
]);
add_dependency(s, "React-graphics", :additional_framework_paths => ["react/renderer/graphics/platform/ios"])
@@ -97,6 +98,7 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
s.test_spec 'Tests' do |test_spec|
test_spec.source_files = podspec_sources("Tests/**/*.{mm}", "")
@@ -35,9 +35,7 @@ Pod::Spec.new do |s|
s.header_dir = header_dir
s.module_name = module_name
if ENV['USE_FRAMEWORKS']
s.header_mappings_dir = "./"
end
resolve_use_frameworks(s, header_mappings_dir: "./")
s.pod_target_xcconfig = {
"OTHER_CFLAGS" => "$(inherited) " + new_arch_flags,
@@ -68,4 +66,5 @@ Pod::Spec.new do |s|
depend_on_js_engine(s)
add_rn_third_party_dependencies(s)
add_rncore_dependency(s)
end
@@ -8,10 +8,29 @@
#import "RCTSwitchManager.h"
#import <React/RCTUIManager.h>
#import <React/RCTUtils.h>
#import "RCTBridge.h"
#import "RCTShadowView.h"
#import "RCTSwitch.h"
#import "UIView+React.h"
@interface RCTSwitchShadowView : RCTShadowView
@end
@implementation RCTSwitchShadowView
- (instancetype)init
{
if (self = [super init]) {
self.intrinsicContentSize = RCTSwitchSize();
}
return self;
}
@end
@implementation RCTSwitchManager
RCT_EXPORT_MODULE()
@@ -33,6 +52,11 @@ RCT_EXPORT_MODULE()
}
}
- (RCTShadowView *)shadowView
{
return [RCTSwitchShadowView new];
}
RCT_EXPORT_METHOD(setValue : (nonnull NSNumber *)viewTag toValue : (BOOL)value)
{
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
@@ -31,8 +31,8 @@ public abstract class com/facebook/react/HeadlessJsTaskService : android/app/Ser
public fun <init> ()V
public static final fun acquireWakeLockNow (Landroid/content/Context;)V
protected final fun getReactContext ()Lcom/facebook/react/bridge/ReactContext;
protected final fun getReactHost ()Lcom/facebook/react/ReactHost;
protected final fun getReactNativeHost ()Lcom/facebook/react/ReactNativeHost;
protected fun getReactHost ()Lcom/facebook/react/ReactHost;
protected fun getReactNativeHost ()Lcom/facebook/react/ReactNativeHost;
protected fun getTaskConfig (Landroid/content/Intent;)Lcom/facebook/react/jstasks/HeadlessJsTaskConfig;
public fun onBind (Landroid/content/Intent;)Landroid/os/IBinder;
public fun onDestroy ()V
@@ -353,7 +353,7 @@ public abstract class com/facebook/react/ReactNativeHost {
}
public abstract interface class com/facebook/react/ReactPackage {
public abstract fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
public fun createNativeModules (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
public abstract fun createViewManagers (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/List;
public fun getModule (Ljava/lang/String;Lcom/facebook/react/bridge/ReactApplicationContext;)Lcom/facebook/react/bridge/NativeModule;
}
@@ -112,6 +112,8 @@ val preparePrefab by
Pair(
"../ReactCommon/react/renderer/animations/",
"react/renderer/animations/"),
// react_renderer_bridging
Pair("../ReactCommon/react/renderer/bridging/", "react/renderer/bridging/"),
// react_renderer_componentregistry
Pair(
"../ReactCommon/react/renderer/componentregistry/",
@@ -596,7 +598,7 @@ android {
publishing {
multipleVariants {
withSourcesJar()
includeBuildTypeValues("debug", "release")
includeBuildTypeValues("debug", "release", "debugOptimized")
}
}
@@ -604,6 +606,15 @@ android {
unitTests { isIncludeAndroidResources = true }
targetSdk = libs.versions.targetSdk.get().toInt()
}
buildTypes {
create("debugOptimized") {
initWith(getByName("debug"))
externalNativeBuild {
cmake { arguments("-DCMAKE_BUILD_TYPE=Release", "-DREACT_NATIVE_DEBUG_OPTIMIZED=True") }
}
}
}
}
tasks.withType<KotlinCompile>().configureEach {
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0
VERSION_NAME=0.81.5
react.internal.publishingGroup=com.facebook.react
android.useAndroidX=true
@@ -306,6 +306,12 @@ android {
}
}
}
buildTypes {
create("debugOptimized") {
initWith(getByName("debug"))
externalNativeBuild { cmake { arguments("-DCMAKE_BUILD_TYPE=Release") } }
}
}
}
sourceSets.getByName("main") {
@@ -22,6 +22,7 @@ import javax.inject.Provider
/** Abstract class that supports lazy loading of NativeModules by default. */
public abstract class BaseReactPackage : ReactPackage {
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
throw UnsupportedOperationException(
"createNativeModules method is not supported. Use getModule() method instead.")
@@ -112,7 +112,8 @@ public abstract class HeadlessJsTaskService : Service(), HeadlessJsTaskEventList
* simply have a different mechanism for storing a `ReactNativeHost`, e.g. as a static field
* somewhere.
*/
protected val reactNativeHost: ReactNativeHost
@Suppress("DEPRECATION")
protected open val reactNativeHost: ReactNativeHost
get() = (application as ReactApplication).reactNativeHost
/**
@@ -120,7 +121,7 @@ public abstract class HeadlessJsTaskService : Service(), HeadlessJsTaskEventList
* [ReactApplication] and calls [ReactApplication.reactHost]. This method assumes it is called in
* new architecture and returns null if not.
*/
protected val reactHost: ReactHost?
protected open val reactHost: ReactHost?
get() = (application as ReactApplication).reactHost
protected val reactContext: ReactContext?
@@ -92,6 +92,8 @@ public abstract class LazyReactPackage : ReactPackage {
* @param reactContext react application context that can be used to create modules
* @return A [List]<[NativeModule]> to register
*/
@Suppress("DEPRECATION")
@Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
buildList {
for (holder in getNativeModules(reactContext)) {
@@ -18,20 +18,23 @@ import android.view.KeyEvent;
import android.view.Window;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.LifecycleState;
import com.facebook.react.interfaces.fabric.ReactSurface;
import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatureFlags;
import com.facebook.react.modules.core.PermissionListener;
import com.facebook.react.views.view.WindowUtilKt;
import com.facebook.systrace.Systrace;
import java.util.Objects;
/**
* Delegate class for {@link ReactActivity}. You can subclass this to provide custom implementations
* for e.g. {@link #getReactNativeHost()}, if your Application class doesn't implement {@link
* ReactApplication}.
*/
@Nullsafe(Nullsafe.Mode.LOCAL)
public class ReactActivityDelegate {
private final @Nullable Activity mActivity;
@@ -86,8 +89,11 @@ public class ReactActivityDelegate {
* ReactApplication#getReactNativeHost()}. Override this method if your application class does not
* implement {@code ReactApplication} or you simply have a different mechanism for storing a
* {@code ReactNativeHost}, e.g. as a static field somewhere.
*
* @deprecated "Do not access {@link ReactNativeHost} directly. This class is going away in the
* New Architecture. You should access {@link ReactHost} instead."
*/
@DeprecatedInNewArchitecture(message = "Use getReactHost()")
@Deprecated
protected ReactNativeHost getReactNativeHost() {
return ((ReactApplication) getPlainActivity().getApplication()).getReactNativeHost();
}
@@ -107,16 +113,21 @@ public class ReactActivityDelegate {
return mReactDelegate;
}
@DeprecatedInNewArchitecture(message = "Use getReactHost()")
/**
* @deprecated @deprecated "Do not access {@link ReactInstanceManager} directly. This class is
* going away in the New Architecture. You should access {@link ReactHost} instead."
* @noinspection deprecation
*/
public ReactInstanceManager getReactInstanceManager() {
return mReactDelegate.getReactInstanceManager();
return Objects.requireNonNull(mReactDelegate).getReactInstanceManager();
}
@Nullable
public String getMainComponentName() {
return mMainComponentName;
}
public void onCreate(Bundle savedInstanceState) {
public void onCreate(@Nullable Bundle savedInstanceState) {
Systrace.traceSection(
Systrace.TRACE_TAG_REACT,
"ReactActivityDelegate.onCreate::init",
@@ -147,6 +158,7 @@ public class ReactActivityDelegate {
launchOptions,
isFabricEnabled()) {
@Override
@Nullable
protected ReactRootView createRootView() {
ReactRootView rootView = ReactActivityDelegate.this.createRootView();
if (rootView == null) {
@@ -162,31 +174,29 @@ public class ReactActivityDelegate {
});
}
protected void loadApp(String appKey) {
mReactDelegate.loadApp(appKey);
protected void loadApp(@Nullable String appKey) {
Objects.requireNonNull(mReactDelegate).loadApp(Objects.requireNonNull(appKey));
getPlainActivity().setContentView(mReactDelegate.getReactRootView());
}
public void setReactSurface(ReactSurface reactSurface) {
mReactDelegate.setReactSurface(reactSurface);
Objects.requireNonNull(mReactDelegate).setReactSurface(reactSurface);
}
public void setReactRootView(ReactRootView reactRootView) {
mReactDelegate.setReactRootView(reactRootView);
Objects.requireNonNull(mReactDelegate).setReactRootView(reactRootView);
}
public void onUserLeaveHint() {
if (mReactDelegate != null) {
mReactDelegate.onUserLeaveHint();
}
Objects.requireNonNull(mReactDelegate).onUserLeaveHint();
}
public void onPause() {
mReactDelegate.onHostPause();
Objects.requireNonNull(mReactDelegate).onHostPause();
}
public void onResume() {
mReactDelegate.onHostResume();
Objects.requireNonNull(mReactDelegate).onHostResume();
if (mPermissionsCallback != null) {
mPermissionsCallback.invoke();
@@ -195,50 +205,50 @@ public class ReactActivityDelegate {
}
public void onDestroy() {
mReactDelegate.onHostDestroy();
Objects.requireNonNull(mReactDelegate).onHostDestroy();
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
mReactDelegate.onActivityResult(requestCode, resultCode, data, true);
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
Objects.requireNonNull(mReactDelegate).onActivityResult(requestCode, resultCode, data, true);
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
return mReactDelegate.onKeyDown(keyCode, event);
return Objects.requireNonNull(mReactDelegate).onKeyDown(keyCode, event);
}
public boolean onKeyUp(int keyCode, KeyEvent event) {
return mReactDelegate.shouldShowDevMenuOrReload(keyCode, event);
return Objects.requireNonNull(mReactDelegate).shouldShowDevMenuOrReload(keyCode, event);
}
public boolean onKeyLongPress(int keyCode, KeyEvent event) {
return mReactDelegate.onKeyLongPress(keyCode);
return Objects.requireNonNull(mReactDelegate).onKeyLongPress(keyCode);
}
public boolean onBackPressed() {
return mReactDelegate.onBackPressed();
return Objects.requireNonNull(mReactDelegate).onBackPressed();
}
public boolean onNewIntent(Intent intent) {
return mReactDelegate.onNewIntent(intent);
public boolean onNewIntent(@Nullable Intent intent) {
return Objects.requireNonNull(mReactDelegate).onNewIntent(Objects.requireNonNull(intent));
}
public void onWindowFocusChanged(boolean hasFocus) {
mReactDelegate.onWindowFocusChanged(hasFocus);
Objects.requireNonNull(mReactDelegate).onWindowFocusChanged(hasFocus);
}
public void onConfigurationChanged(Configuration newConfig) {
mReactDelegate.onConfigurationChanged(newConfig);
Objects.requireNonNull(mReactDelegate).onConfigurationChanged(newConfig);
}
public void requestPermissions(
String[] permissions, int requestCode, PermissionListener listener) {
String[] permissions, int requestCode, @Nullable PermissionListener listener) {
mPermissionListener = listener;
getPlainActivity().requestPermissions(permissions, requestCode);
}
public void onRequestPermissionsResult(
final int requestCode, final String[] permissions, final int[] grantResults) {
mPermissionsCallback =
Callback permissionsCallback =
args -> {
if (mPermissionListener != null
&& mPermissionListener.onRequestPermissionsResult(
@@ -246,6 +256,29 @@ public class ReactActivityDelegate {
mPermissionListener = null;
}
};
LifecycleState lifecycle;
if (isFabricEnabled()) {
ReactHost reactHost = getReactHost();
lifecycle = reactHost != null ? reactHost.getLifecycleState() : LifecycleState.BEFORE_CREATE;
} else {
ReactNativeHost reactNativeHost = getReactNativeHost();
if (!reactNativeHost.hasInstance()) {
lifecycle = LifecycleState.BEFORE_CREATE;
} else {
lifecycle = reactNativeHost.getReactInstanceManager().getLifecycleState();
}
}
// If the permission request didn't show a dialog to the user, we can call the callback
// immediately.
// Otherwise, we need to wait until onResume to call it.
if (lifecycle == LifecycleState.RESUMED) {
permissionsCallback.invoke();
return;
}
mPermissionsCallback = permissionsCallback;
}
protected Context getContext() {
@@ -267,7 +300,7 @@ public class ReactActivityDelegate {
* context will no longer be valid.
*/
public @Nullable ReactContext getCurrentReactContext() {
return mReactDelegate.getCurrentReactContext();
return Objects.requireNonNull(mReactDelegate).getCurrentReactContext();
}
/**
@@ -10,6 +10,10 @@ package com.facebook.react
/** Interface that represents an instance of a React Native application */
public interface ReactApplication {
/** Get the default [ReactNativeHost] for this app. */
@Suppress("DEPRECATION")
@Deprecated(
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
ReplaceWith("reactHost"))
public val reactNativeHost: ReactNativeHost
/**
@@ -14,7 +14,6 @@ import android.os.Bundle
import android.view.KeyEvent
import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.devsupport.DoubleTapReloadRecognizer
import com.facebook.react.devsupport.ReleaseDevSupportManager
import com.facebook.react.devsupport.interfaces.DevSupportManager
@@ -26,12 +25,17 @@ import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
* A delegate for handling React Application support. This delegate is unaware whether it is used in
* an [Activity] or a [android.app.Fragment].
*/
@Suppress("DEPRECATION")
public open class ReactDelegate {
private val activity: Activity
private var internalReactRootView: ReactRootView? = null
private val mainComponentName: String?
private var launchOptions: Bundle?
private var doubleTapReloadRecognizer: DoubleTapReloadRecognizer?
@Deprecated(
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
ReplaceWith("reactHost"))
private var reactNativeHost: ReactNativeHost? = null
public var reactHost: ReactHost? = null
private set
@@ -380,7 +384,8 @@ public open class ReactDelegate {
return false
}
@DeprecatedInNewArchitecture(message = "Use reactHost")
@Deprecated(
"Do not access [ReactInstanceManager] directly. This class is going away in the New Architecture. You should use [ReactHost] instead.")
public fun getReactInstanceManager(): ReactInstanceManager {
val nonNullReactNativeHost =
checkNotNull(reactNativeHost) {
@@ -58,6 +58,10 @@ public open class ReactFragment : Fragment(), PermissionAwareActivity {
* method if your application class does not implement `ReactApplication` or you simply have a
* different mechanism for storing a `ReactNativeHost`, e.g. as a static field somewhere.
*/
@Suppress("DEPRECATION")
@Deprecated(
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
ReplaceWith("reactHost"))
protected open val reactNativeHost: ReactNativeHost?
get() = (activity?.application as ReactApplication?)?.reactNativeHost
@@ -10,6 +10,7 @@ package com.facebook.react;
import android.app.Application;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.bridge.JSExceptionHandler;
import com.facebook.react.bridge.JavaScriptExecutorFactory;
import com.facebook.react.bridge.ReactMarker;
@@ -18,7 +19,6 @@ import com.facebook.react.bridge.UIManagerProvider;
import com.facebook.react.common.LifecycleState;
import com.facebook.react.common.SurfaceDelegate;
import com.facebook.react.common.SurfaceDelegateFactory;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.internal.LegacyArchitecture;
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel;
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
@@ -32,12 +32,12 @@ import java.util.List;
/**
* Simple class that holds an instance of {@link ReactInstanceManager}. This can be used in your
* {@link Application class} (see {@link ReactApplication}), or as a static field.
*
* @deprecated This class will be replaced by com.facebook.react.ReactHost in the New Architecture.
*/
@DeprecatedInNewArchitecture(
message =
"This class will be replaced by com.facebook.react.ReactHost in the new architecture of"
+ " React Native.")
@Deprecated
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
@Nullsafe(Nullsafe.Mode.LOCAL)
public abstract class ReactNativeHost {
static {
@@ -10,7 +10,6 @@ package com.facebook.react
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.UIManager
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.common.annotations.StableReactNativeAPI
import com.facebook.react.uimanager.ViewManager
@@ -34,8 +33,9 @@ public interface ReactPackage {
* @return list of native modules to register with the newly created catalyst instance This method
* is deprecated in the new Architecture of React Native.
*/
@DeprecatedInNewArchitecture(message = "Migrate to BaseReactPackage and implement getModule")
public fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule>
@Deprecated(message = "Migrate to [BaseReactPackage] and implement [getModule] instead.")
public fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> =
emptyList()
/** @return a list of view managers that should be registered with [UIManager] */
public fun createViewManagers(
@@ -28,6 +28,7 @@ internal object ReactPackageHelper {
FLog.d(
ReactConstants.TAG,
"${reactPackage.javaClass.simpleName} is not a LazyReactPackage, falling back to old version.")
@Suppress("DEPRECATION")
val nativeModules = reactPackage.createNativeModules(reactApplicationContext)
return Iterable {
object : Iterator<ModuleHolder> {
@@ -83,6 +83,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage
if (shouldSupportLegacyPackages()) {
// TODO(T145105887): Output warnings that ReactPackage was used
@Suppress("DEPRECATION")
val nativeModules = reactPackage.createNativeModules(reactApplicationContext)
val moduleMap: MutableMap<String, NativeModule> = mutableMapOf()
@@ -94,6 +95,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage
val moduleName = reactModule?.name ?: module.name
@Suppress("DEPRECATION")
val moduleInfo: ReactModuleInfo =
if (reactModule != null)
ReactModuleInfo(
@@ -16,7 +16,6 @@ import com.facebook.infer.annotation.Nullsafe;
import com.facebook.infer.annotation.ThreadConfined;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.StableReactNativeAPI;
import com.facebook.react.common.build.ReactBuildConfig;
import java.util.Map;
@@ -72,7 +71,6 @@ public abstract class BaseJavaModule implements NativeModule {
/**
* @return a map of constants this module exports to JS. Supports JSON types.
*/
@DeprecatedInNewArchitecture()
public @Nullable Map<String, Object> getConstants() {
return null;
}
@@ -14,11 +14,11 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.infer.annotation.ThreadConfined;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.common.annotations.FrameworkAPI;
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
import com.facebook.react.common.annotations.VisibleForTesting;
@@ -27,16 +27,21 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
import java.util.Collection;
import java.util.Objects;
/**
* This is the bridge-specific concrete subclass of ReactContext. ReactContext has many methods that
* delegate to the react instance. This subclass implements those methods, by delegating to the
* CatalystInstance. If you need to create a ReactContext within an "bridge context", please create
* BridgeReactContext.
*
* @deprecated This class is deprecated in the New Architecture and will be replaced by {@link
* com.facebook.react.runtime.BridgelessReactContext}
*/
@DeprecatedInNewArchitecture
@VisibleForTesting
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
@Deprecated
@Nullsafe(Nullsafe.Mode.LOCAL)
public class BridgeReactContext extends ReactApplicationContext {
static {
LegacyArchitectureLogger.assertLegacyArchitecture(
@@ -119,6 +124,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.hasNativeModule(nativeModuleInterface);
}
@@ -127,6 +133,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.getNativeModules();
}
@@ -139,6 +146,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.getNativeModule(nativeModuleInterface);
}
@@ -147,6 +155,7 @@ public class BridgeReactContext extends ReactApplicationContext {
if (mCatalystInstance == null) {
raiseCatalystInstanceMissingException();
}
Assertions.assertNotNull(mCatalystInstance);
return mCatalystInstance.getNativeModule(moduleName);
}
@@ -210,8 +219,7 @@ public class BridgeReactContext extends ReactApplicationContext {
@Override
public void handleException(Exception e) {
boolean catalystInstanceVariableExists = mCatalystInstance != null;
boolean isCatalystInstanceAlive =
catalystInstanceVariableExists && !mCatalystInstance.isDestroyed();
boolean isCatalystInstanceAlive = mCatalystInstance != null && !mCatalystInstance.isDestroyed();
boolean hasExceptionHandler = getJSExceptionHandler() != null;
if (isCatalystInstanceAlive && hasExceptionHandler) {
@@ -268,18 +276,19 @@ public class BridgeReactContext extends ReactApplicationContext {
return null;
}
@DeprecatedInNewArchitecture(
message =
"This method will be deprecated later as part of Stable APIs with bridge removal and not"
+ " encouraged usage.")
/**
* Get the UIManager for Fabric from the CatalystInstance.
*
* @return The UIManager when CatalystInstance is active.
* @deprecated Do not use this method. Instead use {@link
* com.facebook.react.uimanager.UIManagerHelper} method {@code getUIManager} to get the
* UIManager instance from the current ReactContext.
*/
@Override
@Deprecated
public @Nullable UIManager getFabricUIManager() {
return mCatalystInstance.getFabricUIManager();
//noinspection deprecation
return Objects.requireNonNull(mCatalystInstance).getFabricUIManager();
}
/**
@@ -32,6 +32,8 @@ protected constructor(
// do nothing
}
@Deprecated(
"The method canOverrideExistingModule is not used in the New Architecture and will be removed in a future release.")
override fun canOverrideExistingModule(): Boolean = false
override fun invalidate() {
@@ -53,6 +53,7 @@ public class ModuleHolder {
public constructor(nativeModule: NativeModule) {
name = nativeModule.name
@Suppress("DEPRECATION")
reactModuleInfo =
ReactModuleInfo(
nativeModule.name,

Some files were not shown because too many files have changed in this diff Show More