39974 Commits
Author SHA1 Message Date
React Native Bot 10644a0cc5 Release 0.85.0
#publish-packages-to-npm&latest
v0.85.0
2026-04-07 16:18:20 +00:00
React Native Bot b93a764b5e [LOCAL] Bump Podfile.lock 2026-03-30 17:50:06 +00:00
React Native Bot b2839b1d62 Release 0.85.0-rc.7
#publish-packages-to-npm&next
v0.85.0-rc.7
2026-03-30 16:14:50 +00:00
Christian Falch 1030a5ab37 fix(jni) ensure correct export of react/uimanager headers in prefab (#56215)
Summary:
When testing React Native nightlies, we got the following error from `react-android-0.86.0-nightly-20260325-d1809f0aa-SNAPSHOT-release`:

```
StateWrapperImpl.h:14:10: fatal error: 'react/uimanager/StateWrapper.h' file not found
```

The reason is that build.gradle.kts exports src/main/jni/react/fabric → react/fabric/ in the prefab headers, which includes StateWrapperImpl.h. That header does #include <react/uimanager/StateWrapper.h>, but src/main/jni/react/uimanager is not in the prefab export list — so the header is missing from the AAR.

This was introduced in https://github.com/facebook/react-native/issues/55288 where they modified StateWrapperImpl.h to inherit from StateWrapper and added the #include on StateWrapper.h.

This has caused Expo's nightlies to break due to the missing header file in the prefabs:

- Internally (when RN builds itself): Works fine because all JNI source dirs are on the include path
- Externally (when consumers use the published AAR): StateWrapperImpl.h is included in the prefab, it references <react/uimanager/StateWrapper.h>, but that header doesn't exist in the prefab package

## Fix

This commit fixes the above problem by including `src/main/jni/react/uimanager` in the prefab.

## Changelog
[Internal] -

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

Test Plan:
I have tested and verified this by running this in the root of the repo:

```
./gradlew :packages:react-native:ReactAndroid:preparePrefab
ls packages/react-native/ReactAndroid/build/prefab-headers/reactnative/react/uimanager/
```

Before the fix the uimanager folder was not found, with the fix it exists and contains the following files: ComponentNameResolverBinding.h  StateWrapper.h  UIConstantsProviderBinding.h

## Changelog:

[ANDROID] [FIXED] - Fixed missing StateWrapper.h header in prefabs

## Potential Issues

There might be an issue with exporting these files in addition to the missing StateWrapper.h - but it seems like this is an issue with other folders in the jni / prefab - everything in a folder is exported when included for prefab.

Reviewed By: alanleedev

Differential Revision: D98124025

Pulled By: cipolleschi

fbshipit-source-id: c8ae35e77652b90477d17ea8cab48ce3ee84d067
2026-03-30 08:31:16 +00:00
Mathieu Acthernoene fc612247e3 Add header_mappings_dir to React-Fabric.podspec animated subspec (#56151)
Summary:
When building React Native (`0.85.0-rc.5`) core from source (`RCT_USE_PREBUILT_RNCORE=0`), the `React-Fabric/animated` CocoaPods subspec flattens the `event_drivers/` subdirectory headers because `header_mappings_dir` is not set.

CocoaPods' `header_dir` without `header_mappings_dir` places all matched headers directly under the specified directory, losing any subdirectory structure. This means `event_drivers/EventAnimationDriver.h` ends up at `react/renderer/animated/EventAnimationDriver.h` instead of `react/renderer/animated/event_drivers/EventAnimationDriver.h`.

The `#include` in `NativeAnimatedNodesManager.h` expects the full path with the `event_drivers/` subdirectory, so the build fails with:

```
'react/renderer/animated/event_drivers/EventAnimationDriver.h' file not found
```

<img width="1512" height="1012" alt="Screenshot 2026-03-19 at 13 54 29" src="https://github.com/user-attachments/assets/49361c39-d48f-494f-ad7a-c9f3e9749a67" />

This doesn't affect prebuilt (`RCT_USE_PREBUILT_RNCORE=1`) builds because the xcframework ships with a VFS overlay that maps headers correctly.

The fix adds `header_mappings_dir` to the `animated` subspec in `React-Fabric.podspec`, which tells CocoaPods to preserve the directory structure relative to `react/renderer/animated`.

## Changelog:

[IOS] [FIXED] - Fix `EventAnimationDriver.h` not found when building React Native from source due to missing `header_mappings_dir` in `React-Fabric/animated` podspec

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

Test Plan:
1. Set `RCT_USE_PREBUILT_RNCORE=0` in your Podfile
2. Run `pod install`
3. Build the project — previously fails with `'react/renderer/animated/event_drivers/EventAnimationDriver.h' file not found`
4. With this fix, the build succeeds

Reviewed By: sammy-SC

Differential Revision: D97295771

Pulled By: zeyap

fbshipit-source-id: 945fbdeef1d25cedbec1e5b2d60c5a940da85840
2026-03-30 05:17:31 +00:00
Fabrizio Cucci 7a5da64f29 Fix Hermes crash from TurboModule void method NSException handling (#56265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56265

When an async void TurboModule method throws an NSException,
performVoidMethodInvocation calls convertNSExceptionToJSError which
accesses the Hermes JSI runtime from the native method call invoker
thread. Since jsi::Runtime is not thread-safe, this causes heap
corruption and EXC_BAD_ACCESS crashes across various hermes::vm::*
functions.

The sibling function performMethodInvocation was already fixed in
D71619229 to re-throw the ObjC exception instead of converting to
JSError when the call is async. This applies the same fix to
performVoidMethodInvocation, which is always async.

Related to SEV S641230 (4,550+ Hermes crashes in AMA iOS from OTA
bundle 921191722). A JS change behind a QE/MC gate is triggering an
NSException in a void TurboModule method for non-employee users, and
this bug turns that into widespread memory corruption. This fix
prevents the crash, but the triggering diff and throwing TurboModule
still need to be identified separately.

Matches upstream GitHub issue: https://github.com/facebook/hermes/issues/1957Commits affecting the React Native open source repository must have a changelog
entry in the commit summary. Every React Native release has almost 1000 commits,
and manually categorizing these commits is very time consuming.

 ---

Changelog:
[iOS][Fixed] - Fix Hermes crash when async void TurboModule method throws NSException by re-throwing instead of converting to JSError on wrong thread

Reviewed By: javache

Differential Revision: D98660782

fbshipit-source-id: bdedc769f17d9aec4156c45d0286c6c31ca006e4
2026-03-30 01:51:16 +00:00
React Native Bot b3f24a51f0 [LOCAL] Bump Podfile.lock 2026-03-23 20:24:18 +00:00
React Native Bot 8f22bbd225 Release 0.85.0-rc.6
#publish-packages-to-npm&next
v0.85.0-rc.6
2026-03-23 17:43:41 +00:00
LeoTM 506943cc9f Bump fmt to 12.1.0 to fix xcode 26.4 (#56099)
Summary:
Follow-up to
- https://github.com/facebook/react-native/pull/47033
- https://github.com/facebook/react-native/pull/50431

TODO
- [x] bump packages/react-native/third-party-podspecs/fmt.podspec
- [x] bump scripts/releases/ios-prebuild/configuration.js
- [x] packages/react-native/third-party-podspecs/RCT-Folly.podspec
- [x] packages/react-native/gradle/libs.versions.toml
- [x] packages/rn-tester/Podfile.lock
  - rn-rester (main) ios not building on Xcode 26.3, CI currently only supports Xcode 16
  - i cannot downgrade macos26.4b4 locally to macos15 to install Xcode16.4 and bump pods this way
  - so on Xcode 26.3 i've attempted to bump only fmt minimally, ignoring remaining RN 0.86 hashes

Ref: https://github.com/search?q=repo%3Afacebook%2Freact-native+%2211.0.2%22&type=code

however unable to test rn-tester, ios doesn't seem to build on Xcode 26.3 let alone 26.4b
not tested previous versions of Xcode
not tested prior branches/tags to main

rn-tester CI is passing on old macos-15 Xcode 16.4.0 only, ideally this should be extended to stable macos lts and Xcode 26.3 stable first

separate follow-ups to this minimal fmt bump
- bump CI macos-15 xcode 16.1-4 to macos-26 xcode 26.0-3
- bump rn-tester Podfile.lock from RN 0.82 to 0.86 main (aka nightly)
- bump folly to 2025.11.03.00
- bump folly to 2026.03.09.00

Resolve: https://github.com/facebook/react-native/issues/55601

[General][Changed] Bump fmt to 12.1.0 to fix Xcode 26.4

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

Test Plan: RNTester

Reviewed By: alanleedev

Differential Revision: D97358194

Pulled By: cipolleschi

fbshipit-source-id: 3eb578a99a310e3eb77433692bf35502d0d78d24
2026-03-20 11:00:34 -07:00
Christian Falch 690e281de6 fix duplicate symbols with React.XCFramework (#56139)
Summary:
When building React.XCFramework we build and link all source files in the XCFramework directly. To avoid Cocoapods to include the same files, we use a Ruby utility function called `podspec_sources` that will emit onlh header files when using (consuming) the build React.XFramework.

When running RN-Tester after building it using the following pod install command line we have effectively linked with the prebuilt XCFrameworks instead of building from source:

`# RCT_USE_RN_DEP=1  RCT_USE_PREBUILT_RNCORE=1 RCT_DEPS_VERSION=nightly RCT_TESTONLY_RNCORE_VERSION=nightly  bundle exec pod install`

The log in XCode will show an issue with duplciate symbols:

```
oobjc[2551]: Class _TtC10RCTSwiftUI23RCTSwiftUIContainerView is implemented in both xxxx/Library/Develope
r/CoreSimulator/Devices/72157AA1-8D26-424E-8C2E-62D701E70B4A/data/Containers/Bundle/Application/3C711879-443E-48F1-B422-740E7AE82A74/RNTester.app/Frameworks/React.framework/React (0x108d3fb90) and
xxx/Library/Developer/CoreSimulator/Devices/72157AA1-8D26-424E-8C2E-62D701E70B4A/data/Containers/Bundle/Application/3C711879-443E-48F1-B422-740E7AE82A74/RNTester.app/RNTester.debug.dylib
(0x1039ef780). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
objc[2551]: Class _TtC10RCTSwiftUI18ContainerViewModel is implemented in both xxx/Library/Developer/CoreSimulator/Devices/72157AA1-8D26-424E-8C2E-62D701E70B4A/data/Containers/Bundle/Applicatio
n/3C711879-443E-48F1-B422-740E7AE82A74/RNTester.app/Frameworks/React.framework/React (0x108d43b98) and
xxx/Library/Developer/CoreSimulator/Devices/72157AA1-8D26-424E-8C2E-62D701E70B4A/data/Containers/Bundle/Application/3C711879-443E-48F1-B422-740E7AE82A74/RNTester.app/RNTester.debug.dylib
(0x1039f0288). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
```

This is because the RCTSwiftUI.podspec is missing using the `podspec_sources` function when setting up its source files:

```
s.source_files = "*.{h,m,swift}"
```

This will cause Xcode to both link with the XCFramework and compile the sources for this podspec once more - causing an app with duplicate symbols.

After applying this fix, the same test as above shows no duplicate symbols.

## Changelog:

[IOS] [FIXED] - Fixed duplicate symbol error when using React.XCFramework

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

Test Plan:
Run RN-Tester using the following pod install command line, causing us to link with the prebuilt XCFrameworks instead of building from source:

`# RCT_USE_RN_DEP=1  RCT_USE_PREBUILT_RNCORE=1 RCT_DEPS_VERSION=nightly RCT_TESTONLY_RNCORE_VERSION=nightly  bundle exec pod install`

Build/run the app, observe that the duplicate symbol message is gone.

Reviewed By: alanleedev

Differential Revision: D97317019

Pulled By: cipolleschi

fbshipit-source-id: 032113ad00890f712a6c70c3bd903f545f75aba1
2026-03-20 03:10:43 +00:00
React Native Bot 5f9054b20f [LOCAL] Bump Podfile.lock 2026-03-18 18:00:33 +00:00
React Native Bot eae2c5f89d Release 0.85.0-rc.5
#publish-packages-to-npm&next
v0.85.0-rc.5
2026-03-18 16:02:12 +00:00
React Native Bot e2e415fd58 Release 0.85.0-rc.4
#publish-packages-to-npm&next
v0.85.0-rc.4
2026-03-18 09:37:27 +00:00
React Native Bot 1c7c810e94 Release 0.85.0-rc.3
#publish-packages-to-npm&next
v0.85.0-rc.3
2026-03-17 17:53:15 +00:00
React Native Bot 715336c6e1 Release 0.85.0-rc.2
#publish-packages-to-npm&next
v0.85.0-rc.2
2026-03-16 20:34:12 +00:00
Zeya Peng 85696fe116 Revert RCTAnimatedModuleProvider change from D94244698 (#56100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56100

## Changelog:

[iOS] [Fixed] - Revert RCTAnimatedModuleProvider change from D94244698

D94244698 added a guard in RCTAnimatedModuleProvider that returns nullptr
when useSharedAnimatedBackend() is true, expecting DefaultTurboModules to
handle AnimatedModule creation instead.

However, on iOS the TurboModule resolution chain in RCTReactNativeFactory
delegates to the app-provided getTurboModule:jsInvoker: and returns whatever
the delegate returns — even nullptr — without falling through to
DefaultTurboModules.

This causes `Invariant Violation: Native animated module is not available`
on any surface using Animated.View (e.g. Marketplace PDP) when
react_fabric.enable_shared_animated_backend_ios is enabled.

Revert the RCTAnimatedModuleProvider change from D94244698 so it always
provides AnimatedModule when cxxNativeAnimatedEnabled is true, regardless
of useSharedAnimatedBackend. The shared backend path in DefaultTurboModules
still exists as fallback for non-iOS platforms.

Reviewed By: christophpurrer

Differential Revision: D96611917

fbshipit-source-id: e01cf5c80dc4cbf30afac6bcf414616c15bfaddb
2026-03-16 16:19:14 +00:00
Fabrizio Cucci e4619dc8b3 Fix build_debugger_shell job by passing --prepack to yarn build (#56005)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56005

Changelog: [Internal]

The build_debugger_shell CI job was failing because build-binary.js
expects pkg.main to start with ./dist/, but without --prepack the
prepack.js script never runs, so main stays as ./src/index.js.

This was caused by a series of PRs:
- PR #54857 refactored debugger-shell/package.json to use the
  publishConfig pattern, moving main from ./dist/index.js to
  ./src/index.js.
- PR #55415 added the --prepack flag to build.js to support this.
- PR #55416 added the build_debugger_shell CI job but ran yarn build
  without --prepack.

The fix passes --prepack to yarn build so that prepack.js rewrites
package.json main to ./dist/index.js before build-binary.js runs.

Reviewed By: huntie

Differential Revision: D95818417

fbshipit-source-id: 03c8340c415960c3937b13bdea3952798d2d420e
2026-03-09 13:15:31 -07:00
React Native Bot 8f311e9159 [LOCAL] Bump Podfile.lock 2026-03-09 18:54:58 +00:00
React Native Bot 6be3604ab6 Release 0.85.0-rc.1
#publish-packages-to-npm&next
v0.85.0-rc.1
2026-03-09 17:20:48 +00:00
Alan Lee 9e1aaa8ca4 Merge branch '0.85-stable' of https://github.com/facebook/react-native into 0.85-stable 2026-03-09 00:11:54 -07:00
Riccardo Cipolleschi 410ffb04cc [0.85] Add support for custom headers in devsupport (#55976) 2026-03-09 00:10:35 -07:00
Zeya Peng f3f3506245 Add c++ AnimatedModule to DefaultTurboModules (#55729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55729

This is added so that one can easily enables c++ AnimatedModule in open source.

If an app doesn't use `RCTAnimatedModuleProvider`(ios) or `AnimatedCxxReactPackage`(android), it can fallback to this default AnimatedModule when it has both c++animated and shared backend enabled
- shared backend removes the need to pass down start/stop callbacks to NativeAnimatedNodesManagerProvider, so we can cleanly initialize it as static default
  -  RCTAnimatedModuleProvider uses the version of AnimatedModule that still relies on a dedicated CADisplayLink for start/stop
  - AnimatedCxxReactPackage also bundles internal ViewEventModule (for NativeViewEvents) that shares `NativeAnimatedNodesManagerProvider` with AnimatedModule, but NativeViewEvents is not needed for open source
    - Alternatively we could also expose `NativeAnimatedNodesManagerProvider` via UIManager so other turbomodules can also use it. However I don't think it makes sense to double down on another animation API on UIManager given we have shared backend.
- This assumes DefaultTurboModules is always the fallback module provider. So it'll not override when app already uses RCTAnimatedModuleProvider or AnimatedCxxReactPackage

[General] [Added] - Add c++ AnimatedModule to DefaultTurboModules

Reviewed By: NickGerleman

Differential Revision: D94244698

fbshipit-source-id: 09e905eb4bad7d03cdf87d5b47352060b0e6212f
2026-03-09 00:06:21 -07:00
Dawid Małecki c70f94142a Fix unsafe rawPointer access in cloneMultiple (#55613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55613

The cloneMultiple method was written in a way to accept a list of families that are presumed to be owned by the api caller. This designe was mostly aimed at reanimated, that holds refernces to ShadowNodes (that own these families). In the case of AnimationBackend this didn't work properly, as when the view is unmounted we would lose the ShadowNodeFamily shared_ptr that we hold and it could get deallocated.

Since now we can get an owning reference to ShadowNodeFamily from ShadowNode::getFamilyShared, we don't have to keep this old unsafe api. Instead we require the caller to have an owning reference with the api itself.

This `cloneMultiple` method isn't really adopted in the community, so the breaking change shouldn't be a big problem.

Changelog:
[General][Breaking] - fix unsafe rawPointer access in cloneMultiple.

Reviewed By: zeyap, javache

Differential Revision: D93596770

fbshipit-source-id: c4d99b51875968ebce50358c19502cba02c50685
2026-03-09 00:01:49 -07:00
Alex Hunt 2394ead58b Restore inspector addPage listener callback (#55925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55925

Accidentally clobbered in D93247603. This affects the `fuseboxAssertSingleHostState` feature (https://github.com/facebook/react-native-devtools-frontend/pull/218).

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D95365621

fbshipit-source-id: 0df7f7bb33bb6bf6eabe15c8ee06c1761567c84b
2026-03-08 23:57:46 -07:00
React Native Bot 2750e6038d [LOCAL] Bump Podfile.lock 2026-03-04 00:19:06 +00:00
React Native Bot 3e2367c58d Release 0.85.0-rc.0
#publish-packages-to-npm&next
v0.85.0-rc.0
2026-03-03 22:48:45 +00:00
Nicola Corti c35a22db2b [LOCAL] Do not use hermesNightly on the release branch 2026-03-03 12:46:47 +00:00
Fabrizio Cucci c447fa16e1 Revert "[rn] Use stable Hermes for dry-run builds on stable branches"
This reverts commit 9f335b00bc.
2026-03-03 12:46:11 +00:00
Fabrizio Cucci 8ae042d649 Revert "Introduce 'Determine Hermes build flag' step"
This reverts commit 111bd59db5.
2026-03-03 12:46:01 +00:00
Fabrizio Cucci 111bd59db5 Introduce 'Determine Hermes build flag' step 2026-03-03 12:17:33 +00:00
Fabrizio Cucci 9f335b00bc [rn] Use stable Hermes for dry-run builds on stable branches
The build_android workflow was incorrectly using for dry-run
builds on stable branches (e.g., 0.85-stable), causing it to append  suffix
to the Hermes version. This resulted in trying to fetch non-existent SNAPSHOT artifacts
like in https://github.com/facebook/react-native/actions/runs/22592250332/job/65471130298.
This fix adds a check to detect stable branches (via github.ref_name or github.base_ref)
and uses  instead, which fetches the stable Hermes release from
Maven Central without the -SNAPSHOT suffix.

We check both github.ref_name and github.base_ref to cover two scenarios:
ref_name: Direct pushes to stable branches (e.g. pushing to 0.85-stable)
base_ref: Pull requests targeting stable branches (e.g. cherry-pick PRs where the source branch isn't named -stable but the target isChangelog: [Internal]
2026-03-03 11:38:51 +00:00
Alan Lee 4379f21bd7 Bump hermes version 2026-03-02 09:40:44 -08:00
Samuel Susla b5c815c1ca Optimize processBoxShadow with pre-compiled regex patterns (#55825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55825

changelog: [internal]

Hoist regex patterns to module-level constants to avoid recompiling them on every function call. This optimization targets a hotspot identified via JS sampling profiler.

Benchmark results show 6-7% improvement in "views with large props and styles" tests:
- render 100 views with large props/styles: 9.48ms → 8.89ms (-6.2%)
- render 1500 views with large props/styles: 137.2ms → 127.5ms (-7.0%)

Reviewed By: javache, NickGerleman

Differential Revision: D92153667

fbshipit-source-id: d4cd98d34e968b2cea5a491ede4ed727273708cd
2026-03-02 09:09:03 -08:00
Pieter De Baets 67db89d08a Add back receiveTouches on RCTEventEmitter with default implementation (#55850)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55850

D91320248 removed `receiveTouches` from the `RCTEventEmitter` interface entirely.
This was too big of a breaking change — ecosystem libraries that implement
`RCTEventEmitter` or `RCTModernEventEmitter` and override `receiveTouches` would
fail to compile.

This brings back `receiveTouches` on `RCTEventEmitter` but with a default no-op
implementation, so existing implementers that override it continue to compile, and
new implementers don't need to provide one.

Changelog: [Android][Changed] Re-added `receiveTouches` to `RCTEventEmitter` with a default no-op implementation to avoid breaking ecosystem libraries

Reviewed By: cortinico

Differential Revision: D94903267

fbshipit-source-id: fd89da9714b02a72c6ff271375307f620f5d2e3d
2026-03-02 08:05:47 -08:00
Samuel Susla 1cd0387d97 Add tests for aria- props (#55851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55851

Changelog: [Internal]

just missing tests

Reviewed By: javache

Differential Revision: D94904120

fbshipit-source-id: fb73fc92e0ea30b3e37a1fd5725d3bec1b89fb1f
2026-03-02 07:22:41 -08:00
Samuel Susla e131561e98 Replace TinyMap with std::unordered_map in Differentiator (#55680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55680

changelog: [internal]

Replace TinyMap<Tag, X> with std::unordered_map<Tag, X>. There is no detectable regression in performance and code is simpler, let's remove TinyMap.

```
┌────────────────────────────┬──────────────────┬───────────────────────────────────┬───────────────┐
│         Benchmark          │ TinyMap (before) │ unordered_map + ctor size (after) │    Change     │
├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤
│ 100 uncollapsable views    │ 1,499,917 ns     │ 1,343,333 ns                      │ -10.4%        │
├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤
│ 1000 uncollapsable views   │ 52,148,021 ns    │ 44,131,792 ns                     │ -15.4%        │
├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤
│ 100 views large props      │ 5,131,292 ns     │ 4,529,937 ns                      │ -11.7%        │
├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤
│ 1000 views large props     │ 82,706,813 ns    │ 84,334,167 ns                     │ +2.0% (noise) │
├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤
│ 1500 views large props     │ 61,470,542 ns    │ 62,976,646 ns                     │ +2.5% (noise) │
├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤
│ deep (depth=5, breadth=4)  │ 32,672,583 ns    │ 30,700,542 ns                     │ -6.0%         │
├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤
│ deep (depth=7, breadth=3)  │ 78,523,542 ns    │ 74,121,729 ns                     │ -5.6%         │
├────────────────────────────┼──────────────────┼───────────────────────────────────┼───────────────┤
│ deep (depth=10, breadth=2) │ 48,328,562 ns    │ 45,702,188 ns                     │ -5.4%         │
└────────────────────────────┴──────────────────┴───────────────────────────────────┴───────────────┘
```

Reviewed By: NickGerleman

Differential Revision: D90346356

fbshipit-source-id: 90a26da056202d75bc74fec0ed00439a8dbf16cb
2026-03-02 07:17:15 -08:00
Samuel Susla a7fe6025ba Migrate processBoxShadow tests to Fantom (#55820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55820

changelog: [internal]

Add Fantom integration test for processBoxShadow. Uses `fantom_flags enableOptimizedBoxShadowParsing:*` to automatically test both code paths.

Reviewed By: joevilches

Differential Revision: D94796393

fbshipit-source-id: 5e56ba3c784b896575a534daf6eb05645475354b
2026-03-02 06:32:47 -08:00
Rob Hogan 8cdcdf2520 Babel transformer: Use envName to hint default value of dev, don't mutate process.env.BABEL_ENV (#55806)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55806

After https://github.com/facebook/react-native/pull/55805, the RN Babel preset no longer reads `process.env.BABEL_ENV` directly, instead using Babel's `env()` API, which is both cache-aware and properly respects explicit `envName` config.

See:
 - https://babeljs.io/docs/config-files#apienv
 - https://babeljs.io/docs/options#envname

Now, instead of mutating `process.env.BABEL_ENV` to force the environment for a transform (and having to worry about restoring it to avoid side-effects), we can just specify `envName` instead.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D94662935

fbshipit-source-id: 598a8dd53e33e4b5edfe62778a61c6bf3c48a4e7
2026-03-02 06:18:05 -08:00
Riccardo Cipolleschi aefe0f59e2 Skip set-rn-artifacts-version for PRs targeting stable branches (#55809)
Summary:
When a PR targets a `-stable` branch, `github.ref_name` is the PR branch (not ending in `-stable`), so the version script was incorrectly running. Added a check for `github.base_ref` to also skip the script when the PR target branch is a stable branch.

## Changelog:
[Internal] - Skip set-rn-artifacts-version for PRs targeting stable branches

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

Test Plan: CI should pass without running the artifacts version script on PRs targeting stable branches.

Reviewed By: cortinico

Differential Revision: D94678295

Pulled By: cipolleschi

fbshipit-source-id: 5809ec710c191075f1bc1528ecff95f8bd745257
2026-03-02 05:21:32 -08:00
Samuel Susla f66d201ed6 Optimize C++ header includes in renderer (#55788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55788

changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D90813408

fbshipit-source-id: cc1c19728a9ccae58408d8e39b83d7121712c49d
2026-03-02 00:20:35 -08:00
Nick Lefever b2efda00a8 Improve bundling error message formatting (#55794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55794

Format the error messages coming from bundling to mainting the formatting and make these easier to read.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D94611951

fbshipit-source-id: cbb8b2d1ff517b5487d4b799b1e2e3476629f84c
2026-03-01 17:49:19 -08:00
Samuel Susla d6042d2161 Add Fantom integration tests for ActivityIndicator (#55767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55767

Add new Fantom integration tests for ActivityIndicator, achieving 100% line coverage for ActivityIndicator.js (from 0%).

Changelog: [Internal]

Reviewed By: CalixTang

Differential Revision: D94360957

fbshipit-source-id: 1312e45bdf0ed9cf6c337b101b83c7b9e456c4d1
2026-02-28 13:49:08 -08:00
Nicola Corti 4d96fb5825 Fix UIManagerModule.getUIImplementation() to return a non-null UIImplementation (#55818)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55818

This unblocks the Android CI on master

The deprecated getUIImplementation() method was returning null, which could
cause NullPointerExceptions for callers that still depend on it. Return a
new UIImplementation instance instead.

Changelog: [Internal] - Fix `UIManagerModule.getUIImplementation()` to return a non-null `UIImplementation` instead of null

Reviewed By: alanleedev

Differential Revision: D94743629

fbshipit-source-id: df129f87c310a68634678ff7ed90e77275b02b51
2026-02-28 08:20:39 -08:00
Rob Hogan c5a38ab285 Babel preset: don't override dev based on omission of obsolete withDevTools, infer from env() instead. (#55805)
Summary:
Pull request resolved: https://github.com/facebook/react-native/pull/55805

Currently the RN Babel preset has this surprising bit of behaviour:

```js
module.exports = (options, babel) => {
  if (options.withDevTools == null) {
    const env = process.env.BABEL_ENV || process.env.NODE_ENV;
    if (!env || env === 'development') {
      return getPreset(null, {...options, dev: true}, babel);
    }
  }
  return getPreset(null, options, babel);
};
```

If the (undocumented, otherwise unused) `withDevTools` option is set (to anything), we will override any given value of `dev` to `true` if `BABEL_ENV` || `NODE_ENV || 'development' === 'development'`.

To put that another way, with `NODE_ENV=development` and `BABEL_ENV` unset, we would always produce a dev bundle even if `{ dev: false }`

Expo sets `withDevTools: false` to stop this happening, and always set `dev` (so this diff means **no observable change under Expo**):

https://github.com/expo/expo/blob/4a46dbff7a5a77d9fe06d30a70d7fab38cfc7f9a/packages/babel-preset-expo/build/index.js#L235-L236

This odd-looking override was introduced in 2017 in https://github.com/facebook/react-native/commit/bc22a4da7ea74d17cd701717268c8e50f001d614 / D5237158 as a way to gate `babel/plugin-transform-react-jsx-source`, *before the preset accepted any other options* - it was never intended to override `dev`. Now, we gate that same plugin under `options.dev`.

## Inferring `dev` when unspecified

The one potentially load-bearing piece of this is that, when a consumer specifies neither `withDevTools` nor `dev` (or maybe no options at all), this code serves to infer it from `process.env.BABEL_ENV || process.env.NODE_ENV`, which is reasonable and actually closer to the way typical plugins/presets work, but a better mechanism compatible with Babel's cache is to use the `env()` API (which defaults to `process.env.BABEL_ENV || process.env.NODE_ENV`, so preserves behaviour).

https://babeljs.io/docs/config-files#apienv

## This change
 - Removes the obsolete use of `withDevToolss`, and never overrides the explicitly-passed `dev`
 - Where `dev` is not specified, falls back to the Babel environment.

Changelog:
[General][Fixed] Babel-preset: Don't override explicitly-passed `dev` config if obsolete `withDevTools` is missing

Reviewed By: huntie

Differential Revision: D94660480

fbshipit-source-id: 5dfae8fb704e6881b03120cd14510795382a98ba
2026-02-28 05:00:43 -08:00
Alan Lee ca7edaf491 Guard WindowManager access in DisplayMetricsHolder for non-visual contexts (#55810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55810

`DisplayMetricsHolder.initDisplayMetrics()` calls `context.getSystemService(WINDOW_SERVICE)` which throws `IllegalAccessException` on Android 11+ (API 30+) when called from a non-visual context (e.g. Application context). Multiple callers pass non-Activity contexts (ReactHostImpl, UIManagerModule, DeviceInfoModule, ReactInstance, ReactInstanceManager).

This adds a try-catch around the WindowManager access as defense-in-depth. When it fails, `screenDisplayMetrics` retains the values already copied from resource display metrics via `setTo()`, which is a graceful degradation (only missing system decor dimensions like nav bar height).

Changelog: [Internal] - Guard WindowManager access in DisplayMetricsHolder against non-visual contexts on API 30+

Reviewed By: javache, mdvacca

Differential Revision: D94283765

fbshipit-source-id: 51c3ead60784d30d74fcb9111924aed3ca8483ec
2026-02-28 02:32:28 -08:00
Dark Knight 83d7c46f16 Revert D94052732 - S627731 (#55816)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55816

Changelog: [Internal]

Reviewed By: andra-marinescu

Differential Revision: D94756771

fbshipit-source-id: dd5cc72bc2ce65a9407ae728f149d2541d596ef9
2026-02-28 00:06:57 -08:00
Dark Knight ff67a1bea7 Revert D94052733 - S627731 (#55815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55815

Changelog: [Internal]

Reviewed By: andra-marinescu

Differential Revision: D94756759

fbshipit-source-id: bab29dc01deda3717d012f6b19717760a4d1b943
2026-02-28 00:05:01 -08:00
David Vacca 0889f7d774 Delete deprecated CatalystInstanceImpl and C++ counterparts (#55789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55789

Removes the deprecated `CatalystInstanceImpl` class (Java) and its C++ JNI
counterparts (`CatalystInstanceImpl.h` and `CatalystInstanceImpl.cpp`) as part
of the Legacy Architecture cleanup.

`CatalystInstanceImpl` was the bridge implementation for the old architecture.
Its sole consumer, `ReactInstanceManager`, is itself deprecated — its
constructor already throws `UnsupportedOperationException`. The
`createReactContext` method that instantiated `CatalystInstanceImpl` has been
stubbed to throw `UnsupportedOperationException` as well.

Changes:
- Deleted `CatalystInstanceImpl.java` (621 lines)
- Deleted `CatalystInstanceImpl.h` and `CatalystInstanceImpl.cpp` (523 lines)
- Stubbed `ReactInstanceManager.createReactContext` to throw
- Removed from BUCK and CMakeLists.txt build files
- Removed from ReactAndroid.api public API surface
- Removed from ReactNoNewJavaDetector Java allowlist
- Removed from legacy architecture tracking script
- Added direct `#include <cxxreact/MessageQueueThread.h>` to
  `JavaModuleWrapper.cpp` to replace transitive dependency

Changelog: [Android][Removed] - Remove deprecated CatalystInstanceImpl

Reviewed By: javache

Differential Revision: D94548637

fbshipit-source-id: 5c447b85c80605cff17c1555d62ede5e9e2f18a7
2026-02-27 19:47:56 -08:00
Minsik Kim 45de7109fe Fix crash in tracking spring animations when toValue node is detached (#55734)
Summary:
This PR fixes an Android Native Animated crash in tracking + spring animations when the tracked `toValue` node is detached.

In `TrackingAnimatedNode.update`, if the tracked node could not be resolved, we used to write `toValue = null` into `animationConfig`. `SpringAnimation.resetConfig` expects `toValue` to be a number, so this could crash with `NullPointerException: null cannot be cast to non-null type kotlin.Number`

This can happen in real apps during graph teardown (for example unmount/re-render/navigation transitions), where tracking may still update for a transient frame after the tracked node has been detached.

Fix:
- Do not propagate null `toValue` from `TrackingAnimatedNode`.
- If the tracked node is missing, fallback to the driven value node’s current value.
- If both nodes are unavailable, return safely.

This PR also adds a regression test.

## Changelog:

[ANDROID] [FIXED] - Prevent Native Animated tracking spring crash when tracked `toValue` node is detached.

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

Test Plan:
Added regression test `NativeAnimatedNodeTraversalTest.testTrackingSpringDoesNotCrashWhenToValueNodeIsDetached`
- On a test-only commit (without the fix), the new test fails with: `NullPointerException: null cannot be cast to non-null type kotlin.Number`
- On this PR (with the fix), test pass.

Reviewed By: christophpurrer

Differential Revision: D94697059

Pulled By: zeyap

fbshipit-source-id: c8f1f619c34ce7887d6f9bfb42a035d41d6a063a
2026-02-27 13:35:00 -08:00
Panos Vekris ee5b08904b Deploy 0.303.0 to xplat (#55791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55791

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D94566027

fbshipit-source-id: 004fe345615f2f9f22aa40cf818788e94726ed19
2026-02-27 12:14:32 -08:00