Commit Graph

12270 Commits

Author SHA1 Message Date
Nicola Corti 33aa7b9161 Remove unreferenced CMakeLists.txt for ReactCommon/jsc (#52078)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52078

This Cmake file is not imported anymore and can be removed now.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D76808417

fbshipit-source-id: 81824c7c46080bc16c891b5c11c3a8946f16c1b9
2025-06-17 06:26:18 -07:00
Christian Falch 560ac23001 Added missing define to target .reactRuntime (#52082)
Summary:
The target needs the HERMES_ENABLE_DEBUGGER flag in debug just like .reactHermes does.

This commit fixes this by adding the define to the reactRuntime target.

## Changelog:

[IOS] [FIXED] - Added HERMES_ENABLE_DEBUGGER to debug configuration for the reactRuntime target.

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

Test Plan: Prebuild React Core

Reviewed By: robhogan

Differential Revision: D76813200

Pulled By: cipolleschi

fbshipit-source-id: cb81a40fb9c5a91ca40c3a27ae4ccdf043186bac
2025-06-17 06:21:19 -07:00
Pieter De Baets 87cd1c0a0a Add rncore stub headers for backwards-compat (#52083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52083

These headers were removed in D55037569 but we may have some targets still depending on them. Add redirection headers with warnings to help users migrate without this being a breaking change.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D76810433

fbshipit-source-id: 43cddcc69eefbcff0c0140e165fb893bee493c79
2025-06-17 06:18:49 -07:00
Riccardo Cipolleschi 3ea4f156c9 Change imports from jsireact to reacthermes (#52011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52011

This change aligns the import path of `jsireact/HermesExecutorFactory` to the OSS one: `reacthermes/HermesExecutorFactory`

## Changelog:
[Internal] -

Reviewed By: javache

Differential Revision: D76600638

fbshipit-source-id: d9ae35dec000196e4a51668c482fc27f3e6018b4
2025-06-17 05:51:02 -07:00
Nicola Corti 5e1768746a Unblock RNTester which is currently instacrashing. (#52077)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52077

RNTester is currently crashing on release due to a stripped `mHybridData` field.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D76808165

fbshipit-source-id: 049cca49f683c5dc92aa1f9a37dd7b4371dcbfd6
2025-06-17 04:54:47 -07:00
Samuel Susla e259961e8b return object with string keys from getDirectManipulationProps
Summary:
changelog: [internal]

make API getDirectManipulationProps slightly nicer by returning `[string]: mixed` instead of mixed.

Reviewed By: rubennorte

Differential Revision: D76763893

fbshipit-source-id: 56c56578251b991f5fb3e68d44e834da17fc4a3b
2025-06-17 04:49:44 -07:00
Andrew Datsenko aeaae4294f Add hermes and jsi (#52060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52060

Changelog: [Internal]

Add hermes and jsi so we can evaluate JS.

Reviewed By: christophpurrer

Differential Revision: D76746362

fbshipit-source-id: a5fbb90d06a8608154b6ae80242b969e7cb03cea
2025-06-17 04:18:08 -07:00
Andrew Datsenko 74b6acb1f0 Add gflags (#52015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52015

Changelog: [Internal]
Add gflags to fantom_tester so we can pass in data like featureFlags

Reviewed By: cortinico

Differential Revision: D76618409

fbshipit-source-id: a18e642a02c405eef972a7418a606a5980253b6a
2025-06-17 04:18:08 -07:00
Fabrizio Cucci a91e598e6a Minor renaming in ViewManagerRegistry (#52079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52079

After the conversion to Kotlin (D74571782), there seems to be a synchronization issue when iterating on `viewManagers` (see T226095884).

There could a shadowing problem kicking in in a few places due to the fact that we are declaring a `viewManagers` local variable when there is already a `viewManagers` instance variable within `ViewManagerRegistry`.

To remove any ambiguity, here we are renaming the instance variable `viewManagers` as `viewManagersMap` (which also makes more sense).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D76807070

fbshipit-source-id: 4f598700e04251409ee19b60515639e90699cc9e
2025-06-17 04:12:54 -07:00
Rubén Norte 10cabcc0a7 Refactor surface creation in Fantom (#52076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52076

Changelog: [internal]

This refactors the implementation of surface creation in Fantom to make the surface ID handled in native, and treated as an opaque type the same way we do at runtime in RN.

Reviewed By: andrewdacenko

Differential Revision: D76744096

fbshipit-source-id: 1b49a1cbdf0a8d6804de3b87ede727207bc662d9
2025-06-17 03:52:09 -07:00
zhongwuzw 3bfbaa8455 Fabric: Only add selection of textinput payload when event is selectionChange (#51051)
Summary:
Fixes https://github.com/facebook/react-native/issues/51020: TextInputChangeEventData does not contain selection (see [here](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts#L515-L518)). Additionally, Android does not have selection either (see [here](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.kt#L33-L37)) (iOS old arch also not contains it). We can consolidate these to prevent any misleading information.

## Changelog:

[IOS] [FIXED] -  Fabric: Only add selection of textinput payload when event is selectionChange

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

Test Plan: TextInput `onChange`'s event should not contains `selection`.

Reviewed By: javache

Differential Revision: D76253999

Pulled By: cipolleschi

fbshipit-source-id: 8a889cce4998be0e31f4aa33961759e7d228e06f
2025-06-17 03:23:48 -07:00
Tim Yung 742ffa39fb RN: Update Fantom Path in EXCLUDED_FIRST_PARTY_PATHS (#52051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52051

In {D76368959}, I moved `react-native-fantom` from `packages/` to `private/` and missed this reference.

Changelog:
[Internal]

Reviewed By: rubennorte

Differential Revision: D76743071

fbshipit-source-id: f99d3f2ac5e14fd23f7cf208ca030541844dddc6
2025-06-17 02:59:42 -07:00
Rubén Norte 4556bdf4fc Make OpaqueNativeObserverHandle really opaque (#52054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52054

Changelog: [internal]

This makes `OpaqueNativeObserverHandle` really opaque and fixes the problems in the observer implementation caused by it.

Reviewed By: yungsters

Differential Revision: D76744094

fbshipit-source-id: a8b6fa43ee8a5ee9d15f0171a83fe0badd46d9c3
2025-06-17 02:24:22 -07:00
Rubén Norte 98fdc965b9 Make IdleCallbackID opaque in NativeIdleCallbacks implementation (#52055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52055

Changelog: [internal]

This migrates NativeIdleCallbacks to use opaque types now that they're supported in the codegen

Reviewed By: yungsters

Differential Revision: D76744095

fbshipit-source-id: d9d1beea8df7f5635fc531a2cef001ea0aed38b4
2025-06-17 02:24:22 -07:00
Rubén Norte e8cdb99baa Make NativeIntersectionObserverToken opaque in NativeIntersectionObserver implementation (#52053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52053

Changelog: [internal]

The codegen allows us to do this already! :D

Reviewed By: yungsters

Differential Revision: D76741113

fbshipit-source-id: d460685bc6ad6ba11f7132136e8603bd57488014
2025-06-17 02:24:22 -07:00
Rubén Norte a15fc102e6 Add support for opaque types in Flow codegen for native modules (#52052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52052

Changelog: [General][Added] - Add support for Flow opaque types in codegen for native modules

This allows us to codegen native modules that expose opaque types, but the implementation sees the type the same way they're visible in the JS spec.

Reviewed By: yungsters

Differential Revision: D76741112

fbshipit-source-id: 100ca9aa7f93d35120c52153f756436c9c380b07
2025-06-17 02:24:22 -07:00
Samuel Susla 6ddfa708b0 small adjustments to when value listener is fired (#52063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52063

changelog: [internal]

`addListener` API shouldn't fire when offset for node changes. Check https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.mm for reference.

Reviewed By: mdvacca

Differential Revision: D76740873

fbshipit-source-id: 04fb59ee9b630402803c4741f501d9d10591fa71
2025-06-17 02:16:32 -07:00
Samuel Susla 1456d06c86 add comment explaining why addListener and removeListeners are not needed (#52062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52062

changelog: [internal]

- update comments to be more descriptive.
- use `#pragma mark -` to better group methods in `NativeAnimatedNodesManager`. It is nicely formatted in VSCode.

{F1979345410}

Reviewed By: mdvacca

Differential Revision: D76737257

fbshipit-source-id: c4b22ca45cd5dec2c72e7931bfec4466cda3070c
2025-06-17 02:16:32 -07:00
Nick Gerleman 64ce7695f5 Fix Facsimile Hit Testing Bugs (#52065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52065

1. We can crash when tapping at the boundary between two spans. Previous ReactTextView had some custom heuristic for overlapping ReactTags, assuming they could be nested, which never happens (We only have a single tag per AttributedString fragment), but spans may overlap at a single character, where one is meant to be exclusive, and the other inclusive. We add logic for that.
2. We don't incorporate the offset of the text layout within the view for hit testing, needed for padding or `textAlignVertical`.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D76764051

fbshipit-source-id: 308756c45d8ff574420dfc1c88678bae7e03e767
2025-06-16 20:51:23 -07:00
Gabriel Donadel 3ae9328571 Bump @types/react to 19.1 (#52059)
Summary:
While testing I notice that `types/react` was not updated in some peer depencies

## Changelog:

[GENERAL] [CHANGED] - Bump types/react to 19.1

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

Test Plan: CI should be green

Reviewed By: christophpurrer

Differential Revision: D76763084

Pulled By: sbuggay

fbshipit-source-id: c078c03aa57ca04040c64986dd7957da8a6f2c2d
2025-06-16 17:45:11 -07:00
Christoph Purrer 089fb10740 Remove folly::EvictingCacheMap (#52019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52019

Replace folly::EvictionMap with pure std implementation

changelog: [internal][Breaking] Remove unused set() method of SimpleThreadSafeCache

Reviewed By: javache, sammy-SC

Differential Revision: D76631579

fbshipit-source-id: 15dfa8a8c0d2809440c214a72e48def6e1dba2f0
2025-06-16 15:06:17 -07:00
Samuel Susla 2528e48e93 implement Value.extractOffset in C++ Animated (#52049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52049

changelog: [internal]

As title says, add implementation of [Value.extractOffset](https://reactnative.dev/docs/animatedvalue#extractoffset)

Reviewed By: zeyap

Differential Revision: D76735003

fbshipit-source-id: db09e2ed1c8b540d911970d2268fcd0374717e96
2025-06-16 14:30:19 -07:00
Samuel Susla cb24596c33 add Value.flattenOffset to C++ Animated (#52047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52047

changelog: [internal]

implement AnimatedValue.[flattenOffset](https://reactnative.dev/docs/animatedvalue#flattenoffset) in C++ Animated.

Reviewed By: javache

Differential Revision: D76733524

fbshipit-source-id: df969cf8be421dd6fa22c4100ccd2c33aa7c91d8
2025-06-16 14:30:19 -07:00
Peter Abbondanzo cfb6c968dd Mark hasTVPreferredFocus as deprecated (#52043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52043

The `hasTVPreferredFocus` prop is functionally similar to the `focusable` prop. On iOS, the props are identical. The primary difference appears on Android, where the prop attempts to request focus when set to true. Attempting to invoke imperative API calls through declarative means has been [a source of confusion](https://github.com/react-native-tvos/react-native-tvos/issues/237) and we should instead recommend requesting focus through imperative means, like calling `focus()` on a specific view's ref instead. Workarounds presented rely on lifecycle methods to request focus natively.

This change only marks these methods as deprecated on JS. In the following version, they will be removed from the public API.

Changelog: [General][Deprecated] - Deprecate `hasTVPreferredFocus`

Reviewed By: andrewdacenko

Differential Revision: D76732539

fbshipit-source-id: 64912b4dacb76cd40e79148c1082d8ed8f573879
2025-06-16 12:05:47 -07:00
Mathieu Acthernoene 3c17e101ee Add UiModeUtils.isDarkMode helper (#51925)
Summary:
This PR is part of the [edge-to-edge core implementation effort](https://github.com/facebook/react-native/pull/47554). It adds a helper to `ContextUtils`, called `isDarkMode` in order to be reused accross the Android codebase.

## Changelog:

- [Internal] [Added] - Add `UiModeUtils.isDarkMode` helper

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

Test Plan:
<img width="300" alt="Screenshot 2025-06-10 at 17 50 19" src="https://github.com/user-attachments/assets/48795406-e852-486a-bae8-54507ad769ee" />

<img width="300" alt="Screenshot 2025-06-10 at 17 50 42" src="https://github.com/user-attachments/assets/0dbdece9-04f7-487b-ace8-4786c8da381d" />

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76352849

Pulled By: alanleedev

fbshipit-source-id: fbbc772d1dfa3e30e62a71a711de11b85cdec446
2025-06-16 10:35:35 -07:00
Nicola Corti 8174d02811 Cleanup all the JSC 1st party code. (#51949)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51949

This code is no longer necessary now that JSC support is offered via
https://github.com/react-native-community/javascriptcore

Instructions for users on how to continue using JSC are available in the README of such library.

Changelog:
[Android] [Removed] - Remove 1st party JSC support

Reviewed By: javache

Differential Revision: D76420382

fbshipit-source-id: f8e61556bb02fe4d5b34f89b40f8e5e38ac1c8d6
2025-06-16 10:30:39 -07:00
Janic Duplessis 7e2f17ffe2 Only generate recursive accessibility label for accessible elements (#51988)
Summary:
When trying to implement e2e tests using maestro in a large app I ran into major performance issues. I tracked it down to the generation of recursive accessibility labels.

The maestro iOS driver uses [XCUIElement snapshot dictionaryRepresentation](https://developer.apple.com/documentation/xctest/xcuielementsnapshot/dictionaryrepresentation) [here](https://github.com/mobile-dev-inc/Maestro/blob/96e8c9a2be3430be991c13d033486d52d2001334/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/ViewHierarchyHandler.swift#L234) to get a representation of the view hierarchy. The problem is that will query the accessibilityLabel for every single view, starting from the root of the app. It goes without saying that this is extremely slow since it traverses the view hierarchy, executing a recursive function on each one.

I think the only way to fix this is to avoid generating these recursive labels when not needed. From my understanding these should only be needed for accessible views.

## Changelog:

[IOS] [CHANGED] - Only generate recursive accessibility label for accessible elements

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

Test Plan:
- Tested using VoiceOver in RN tester to make sure it works exactly the same.
- Tested in an app using Maestro to make sure this fixes the performance issue.
- Tested in RNTester running Maestro e2e test by creating a larger view hierarchy to make the problem more apparent, and simulate a real app. Using [this code](https://gist.github.com/janicduplessis/9f6b302d92b4e22ff5e8462a8a84e237) in RNTesterAppShared.js

Before:

```
❯ yarn e2e-test-ios
yarn run v1.22.22
$ ./scripts/maestro-test-ios.sh

Waiting for flows to complete...
[Passed] flatlist (14s)
[Passed] text (28s)
[Passed] modal (16s)
[Passed] image (8s)
[Passed] button (10s)
[Passed] legacy-native-module (32s)
[Passed] pressable (32s)
[Passed] new-arch-examples (35s)

8/8 Flows Passed in 2m 55s

  Done in 180.26s.
```

After:

```
❯ yarn e2e-test-ios
yarn run v1.22.22
$ ./scripts/maestro-test-ios.sh

Waiting for flows to complete...
[Passed] flatlist (7s)
[Passed] text (15s)
[Passed] modal (10s)
[Passed] image (4s)
[Passed] button (6s)
[Passed] legacy-native-module (16s)
[Passed] pressable (16s)
[Passed] new-arch-examples (17s)

8/8 Flows Passed in 1m 31s

  Done in 97.53s.
```

Reviewed By: christophpurrer, joevilches

Differential Revision: D76581949

Pulled By: cipolleschi

fbshipit-source-id: 0689c7d43a0c865572c4ee5ea32ee9b2dcb33ad5
2025-06-16 10:30:33 -07:00
Jorge Cabiedes Acosta e13ee7a3d0 Fix accessibilityRespondsToUserInteraction not setting on first render (#51986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51986

"{}" defaults to false on C++ but the prop is not initialized which means that if accessibilityEnablesUserInteraction is set to false it will not be applied on first render. setting the default to true fixes that issue

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D76532158

fbshipit-source-id: 51cba8b89eb239e01db985d412dd2b19e482f068
2025-06-16 10:22:05 -07:00
Alan Lee 9613d377de Fix Type comparison (v2) in TurboModuleInteropUtils.kt (2/2) (#51979)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51979

Fix type checking that was left out from the last diff; D73224138

We should unify the type checking so remove uses of `java.lang.Boolean` and just use Kotlin version of `Boolean`.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D76523674

fbshipit-source-id: 293ae5998c78c98a20c7d6cf962ab7b19087fd9c
2025-06-16 09:48:44 -07:00
David Vacca 3a0a7b0701 Export RNCodegen types (#52048)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52048

This diff exports types defined in RNCodegen to be used by other codegens

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D76472492

fbshipit-source-id: fa236a254a9a4211d2e00ace436f55978a262a76
2025-06-16 09:46:31 -07:00
Riccardo Cipolleschi c777ad0b84 Fix nightlies artefacts download (#52041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52041

After changing the publishing logic on Maven, the download logic for the artefacts published in a Snapshot was broken, because Maven does not support the redirect anymore.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76725418

fbshipit-source-id: 8bad88915d9bad96355a048486972a55f232d109
2025-06-16 09:26:41 -07:00
Mateo Guzmán 3412215e3a Kotlin: clean up some unused symbols (#52029)
Summary:
Static code analysis reports numerous unused symbols across the codebase, which accounts for several static code analysis warnings. I've cleaned up some of them (not all of them because many of them are false positives from testing files)

The cleaned-up symbols are mostly private and from internal classes, so this should not impact users (unless they are used internally at Meta – in that case, let me know so I can revert accordingly)

## Changelog:

[INTERNAL] - Kotlin: clean up some unused symbols

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

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D76722313

Pulled By: cortinico

fbshipit-source-id: 8c7dfe204fa7c457b7484a7edd120ae45e1d604d
2025-06-16 09:04:51 -07:00
Nicola Corti 19fd1536a4 Clarify JS documentation for StatusBar on Android 15+ (#52044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52044

This clarifies that some props on `StatusBar` are not working on Android 15+
See https://github.com/facebook/react-native/issues/51928

Changelog:
[Internal] [Changed] -

Reviewed By: yungsters

Differential Revision: D76734324

fbshipit-source-id: 88b6f30f63ca0e269d5115e69a8a2b0ca222c2f4
2025-06-16 08:56:27 -07:00
Nicola Corti f6b7bd93d8 Fix crash on ReactInstance due to null returned for getViewManagerNames (#52035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52035

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

Some OSS library is still returning null for `getViewManagerNames` especially if they're
implementing the `ViewManagerOnDemandReactPackage` in Java.
I'm adding a try-catch here so that we prevent the NPE for those scenarios.

Changelog:
[Android] [Fixed] - Fix crash on ReactInstance due to null returned for getViewManagerNames

Reviewed By: javache

Differential Revision: D76723826

fbshipit-source-id: cc159dee389257c6877b03a67840a45ee5bec165
2025-06-16 07:49:11 -07:00
Riccardo Cipolleschi 2ade12d747 Fix OSS CI (#52042)
Summary:
The OSS CI for iOS is broken because of a couple of commit that landed:
- Commit 05a61e8161 : dynamic frameworks are broken
- Commit abc8fe1c92 : pod donwload is broken

This change fixes both of them

## Changelog:
[Internal] - Fix OSS CI

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

Test Plan:
Tested locally by building RNTester with Dynamic frameworks

```
USE_FRAMEWORKS=dynamic bundle exec pod install
```

Reviewed By: rshest, lenaic, GijsWeterings

Differential Revision: D76730331

Pulled By: cipolleschi

fbshipit-source-id: 71cca1f50763d24773dedcd8267130df261b01dc
2025-06-16 07:29:00 -07:00
Tim Yung f53f6137e6 RN: Migrate View to Component Syntax (#52018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52018

Migrates `View` to use Flow's [Component Syntax](https://flow.org/en/docs/react/component-syntax/).

Component Syntax offers more concise syntax for expressing component definitions and eliminates the need for `View` to be cast as a component type. Component types improve type safety by more accurately modeling `ref` as props and enabling the use of modern type utilities such as `React.PropsOf<Component>` and `React.RefOf<Component>`.

This represents the first introduction of Component Syntax in the open source React Native repository, which is lowered to standard JavaScript through the use of [`hermes-parser`](https://www.npmjs.com/package/hermes-parser) and the following supporting packages:

- [`babel-plugin-syntax-hermes-parser`](https://www.npmjs.com/package/babel-plugin-syntax-hermes-parser)
- [`hermes-eslint`](https://www.npmjs.com/package/hermes-eslint)
- [`prettier-plugin-hermes-parser`](https://www.npmjs.com/package/prettier-plugin-hermes-parser)

By default, [`react-native/babel-preset`](https://www.npmjs.com/package/react-native/babel-preset) already provides configuration for `babel-plugin-syntax-hermes-parser`.

Although this is the first usage of Component Syntax, there are already Flow syntax features used in React Native that have required `hermes-parser` (e.g. [type casting expressions](https://flow.org/en/docs/types/casting/), [type guards](https://flow.org/en/docs/types/type-guards/), [const expressions](https://flow.org/en/docs/types/const-expression/)). As such, we do not anticipate this to introduce new build configuration problems for developers.

Changelog:
[Internal]

Reviewed By: javache, NickGerleman

Differential Revision: D76632879

fbshipit-source-id: e0a83dfc2e2014933000083de1825a311faad707
2025-06-16 06:52:07 -07:00
Samuel Susla ffe928ce50 pass config in C++ Animated with std::move (#52039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52039

changelog: [internal]

config can be passed with std::move to avoid copy.

Reviewed By: rshest, javache

Differential Revision: D76628921

fbshipit-source-id: 82a90ce604d2a82a388eb4fa63f22deda6ec92ed
2025-06-16 04:50:47 -07:00
Samuel Susla d20b9cfdf0 Fix value passed to animation's endCallback (#52038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52038

changelog: [internal]

The changes in this diff include:
- pass endCallback with std::move to avoid copy.
- call endCallback with rawValue instead of rawValue + offset.
- remove unused method AnimationDriver::endCallback.

Reviewed By: javache

Differential Revision: D76627693

fbshipit-source-id: 8653ed3ec59b3629ad3956323b73f02a1bbd9c48
2025-06-16 04:50:47 -07:00
Samuel Susla b6e1938959 make style.transform testable in Fantom (#52037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52037

changelog: [internal]

Reviewed By: javache

Differential Revision: D76606386

fbshipit-source-id: 87321f75803d9e6080d5345021aca9c56b6d2ecf
2025-06-16 04:50:47 -07:00
Samuel Susla ddafd94124 implement setOffset (#52034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52034

changelog: [internal]

implement `setAnimatedNodeOffset`.

Reviewed By: christophpurrer

Differential Revision: D76604263

fbshipit-source-id: 36b86aada836098f502f8d24af07e2a98adf0446
2025-06-16 04:50:47 -07:00
Samuel Susla eecd07c58b Set final value via direct manipulation to fix animation glitches (#52012)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52012

changelog: [internal]

On iOS, once a prop on a view is controlled by animated, the control is never released to Fabric or React. That's why it is important to use direct manipulation to commit even final value.

Reviewed By: lenaic

Differential Revision: D76601913

fbshipit-source-id: ea02219e158f28977018b34ac7152b899723b35a
2025-06-16 04:50:47 -07:00
Pieter De Baets 0e42d33cbc Sync ReactNativeAttributePayload with upstream (#51998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51998

Sync with https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactNativeAttributePayloadFabric.js

Next step is to remove the copy in React upstream and consume it from ReactNativePrivateInterface, so I've copied over the tests as well.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75943237

fbshipit-source-id: c89c8711b55882f7069c54f6c1ce389f46760089
2025-06-16 04:35:17 -07:00
Riccardo Cipolleschi abc8fe1c92 Fix nightly download of Hermes and react-native-dependencies (#52033)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52033

This change fixes the download of the artefacts for the nightlies of Hermes and React Native Dependencies after we changed the publishing logic for Maven

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76723289

fbshipit-source-id: 6b0ea6a6c35125e6fb03cecc6be893bd02abdad8
2025-06-16 03:32:46 -07:00
Riccardo Cipolleschi a6ea626255 Remove the option to use JSC from core (#51946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51946

This change simplified the setp disallowing to use JSC from core.
As a side effect, it simplified the setup by always falling back to hermes if the users decides not to use the third party JSC

## Changelog:
[iOS][Removed] - remove the option to use JSC from core

Reviewed By: cortinico

Differential Revision: D76342625

fbshipit-source-id: c925ab4fab1e171e289a1c5f75890c92da1b3f08
2025-06-16 02:36:45 -07:00
Janic Duplessis 1da608f6f1 Fix RNTester hermesc build issue on iOS (#51989)
Summary:
I am not sure exactly why, but I've been getting this error when running RNTester on iOS, when it tries to build hermesc from source. We're clearing the env using `env -i` which seems to cause the issue. If I add PATH to the env we set then it builds fine.

```
++ hermesc_dir_path=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine/build_host_hermesc
++ shift
++ jsi_path=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/../../react-native/ReactCommon/jsi
+++ xcode-select -p
++ SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
++ env -i SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk /opt/homebrew/bin/cmake -S /Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine -B /Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine/build_host_hermesc -DJSI_DIR=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/../../react-native/ReactCommon/jsi
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Command PhaseScriptExecution failed with a nonzero exit code
```

## Changelog:

[INTERNAL] [FIXED] - Fix RNTester hermesc build issue on iOS

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

Test Plan: Build RN tester locally

Reviewed By: cortinico

Differential Revision: D76606335

Pulled By: cipolleschi

fbshipit-source-id: f442b77aefb3afacd6d9fb1f3d515b8d63c526ba
2025-06-16 02:05:30 -07:00
Tim Yung 92af97591b RN: Align ReportFullyDrawnView Type Exports (#52020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52020

Aligns the type exports of `ReportFullyDrawnView` across platforms, so that they are resilient to any changes made to `View` itself.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D76638685

fbshipit-source-id: 612b2bcd76e70751aec691a24f31beca453cea35
2025-06-13 19:26:26 -07:00
Ramanpreet Nara 05a61e8161 Introduce main queue coordinator (#51425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51425

# Problem

React native's new architecture will allow components to do sync render/events. That means they'll makes synchronous dispatches from main thread to the js thread, to capture the runtime so that they can execute js on the main thread.

But, the js thread already as a bunch of synchronous calls to the main thread. So, if any of those js -> ui sync calls happen concurrently with a synchronous render, the application will deadlock.

This diff is an attempt to mitigate all those deadlocks.

## Context
How js execution from the main thread works:

* Main thread puts a block on the js thread, to capture the js runtime. Main thread is put to sleep.
* Js thread executes "runtime capture block". The runtime is captured for the main thread. The js thread is put to sleep.
* Main thread wakes up, noticing that the runtime is captured. It executes its js code with the captured runtime. Then, it releases the runtime, which wakes up the js thread. Both the main and js thread move on to other tasks.

How synchronous js -> main thread calls work:
* Js thread puts a ui block on the main queue.
* Js thread goes to sleep until that ui block executes on the main thread.

## Deadlock #1
**Main thread**: execute js now:
  * Main thread puts a block on the js queue, to capture the runtime.
 * Main thread then then goes to sleep, waiting for runtime to be captured

**JS thread**: execute ui code synchronously:
* Js thread schedules a block on the ui thread
* Js thread then goes to sleep, waiting for that block to execute.

**Result:** The application deadlocks

| {F1978009555} |  {F1978009612} |

![image](https://github.com/user-attachments/assets/325a62f4-d5b7-492d-a114-efb738556239)

## Deadlock #2
**JS thread**: execute ui code synchronously:
* Js thread schedules a block on the ui thread
* Js thread then goes to sleep waiting for that block to execute.

**Main thread**: execute js now:
* Main thread puts a block on the js queue, to capture the runtime.
* Main thread then then goes to sleep, waiting for runtime to be captured

**Result:** The application deadlocks

|  {F1978009690}  | {F1978009701} |

![image](https://github.com/user-attachments/assets/13a6ea17-a55d-453d-9291-d1c8007ecffa)

# Changes
This diff attempts to fix those deadlocks. How:
* In "execute ui code synchronously" (js thread):
   * Before going to sleep, the js thread schedules the ui work on the main queue, **and** it  posts the ui work to "execute js now".
* In "execute js now" (main thread):
   * This diff makes "execute js now" stateful: it keeps a "pending ui block."
   * Before capturing the runtime, the "execute js now" executes "pending ui work", if it exists.
   * While sleeping waiting for runtime capture, "execute js now" can wake up, and execute "pending ui work." It goes back to sleep afterwards, waiting for runtime capture.

## Mitigation: Deadlock #1
**Main thread**: execute js now:
* Main thread puts a block on the js queue, to capture the runtime.
* Main thread then then goes to sleep, waiting for runtime capture

**JS Thread**: execute ui code synchronously:
* Js thread puts its ui block on the ui queue.
* ***New***: Js thread also posts that ui block to "execute js now". Main thread was sleeping waiting for runtime to be captured. It now wakes up.
* Js thread goes to sleep.

The main thread wakes up in "execute js now":
* Main thread sees that a "pending ui block" is posted. It executes the "pending ui block." The block, also scheduled on the main thread, noops henceforth.
* Main thread goes back to sleep, waiting for runtime capture.
* The js thread wakes up, moves on to the next task.

**Result:** The runtime is captured by the main thread.

| {F1978010383} | {F1978010363} |  {F1978010371} |  {F1978010379} |

![image](https://github.com/user-attachments/assets/f53cb10c-7801-46be-934a-96af7d5f5fab)

## Mitigation: Deadlock #2
**JS Thread**: execute ui code synchronously:
* Js thread puts its ui block on the ui queue.
* ***New***: Js thread also posts that ui block to "execute js now". Main thread was sleeping waiting for runtime to be captured. It now wakes up.
* Js thread goes to sleep.

**Main thread**: execute js now
* Main thread sees that a "pending ui block" is posted. It executes the "pending ui block" immediately. The block, also scheduled on the main thread, noops henceforth.
* Js thread wakes up and moves onto the next task.

**Result:** Main thread captures the runtime.

|  {F1978010525}  |  {F1978010533} |  {F1978010542} |

![image](https://github.com/user-attachments/assets/9e0ca5ef-fab6-4a26-bcca-d79d36624d5d)

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74769326

fbshipit-source-id: 854b83ce4e482a4030dc711834ea6c5613091537
2025-06-13 16:32:03 -07:00
Nicola Corti feec8d0148 Hide JS FPS on performance overlay as not accurate (#52000)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52000

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

The current JS FPS value is incorrect because the frame skipping logic hasn't been reimplemented in Fabric.
As we're looking into moving this into the performance panel, I've discussed with huntie
and agreed we'll just remove the value for now to don't show inaccurate informations.

Changelog:
[Android] [Changed] - Hide JS FPS on performance overlay as not accurate

Reviewed By: huntie

Differential Revision: D76590909

fbshipit-source-id: 90b0d9c84f9aefa9197243ebb57f4e86107d6c01
2025-06-13 14:08:01 -07:00
Nicola Corti cf6569bc18 Cleanup and internalize FpsDebugFrameCallback (#51982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51982

This class should not be accessed externally. I'm making it internal.
On top of this, it was not fully reimplemented on NewArch so is not working consistently.

This is gonna break one library which is unmaintained and not properly udpated to work with NewArch
https://github.com/hannojg/react-native-performance-stats

Changelog:
[Android] [Breaking] - Cleanup and internalize FpsDebugFrameCallback

Reviewed By: huntie

Differential Revision: D76531175

fbshipit-source-id: 25598eb7c1ecf476b69bb6a2f2f8088a57b9fbc2
2025-06-13 12:23:05 -07:00
Mateo Guzmán c64f698e5f Migrate JavaMethodWrapper to Kotlin (#51930)
Summary:
Migrate com.facebook.react.bridge.JavaMethodWrapper to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.JavaMethodWrapper to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
```

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76377903

Pulled By: alanleedev

fbshipit-source-id: 4df257639992304a6ff3ed9abf499d8ed0b6aac7
2025-06-13 11:40:56 -07:00