Commit Graph

38536 Commits

Author SHA1 Message Date
Nicola Corti 691d4744b3 Mark NotThreadSafeBridgeIdleDebugListener as LegacyArchitecture (#52988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52988

This class should be marked as `LegacyArchitecture` while it was not.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D79451041

fbshipit-source-id: 62c5d35821e354ea851eaccac909bf6bd9157f09
2025-08-04 03:51:08 -07:00
Alex Hunt bbcafbbffe 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 03:33:14 -07:00
Rubén Norte c535e7c1c9 Make TextInput test follow convention and add tests for all methods (#53011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53011

Changelog: [internal]

This restructures the test for `TextInput` to follow the convention:

```
describe('<TextInput>', () => {
  describe('props', () => {
    /* ... */
  });

  describe('ref', () => {
    /* ... */
  });
});
```

It also adds tests for all methods.

Reviewed By: sammy-SC

Differential Revision: D79511032

fbshipit-source-id: 118198bdb1a86c2a9e0f41ff0b81bcd62b535d9f
2025-08-04 03:17:11 -07:00
Nicola Corti 742ef3d661 AGP to 8.12.0 (#52973)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52973

This bumps AGP to the latest stable version.

Changelog:
[Android] [Changed] - AGP to 8.12.0

Reviewed By: rshest

Differential Revision: D79436778

fbshipit-source-id: 3071c0108af064573c087aaf7b92d0b10c1adc6a
2025-08-04 02:55:55 -07:00
Nicola Corti d42335007b Update debugger_bug_report.yml (#52981)
Summary:
This label was renamed at some point and it broke the issue template. This fixes it.

## Changelog:

[INTERNAL] -

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

Test Plan: N/A

Reviewed By: mdvacca

Differential Revision: D79448155

Pulled By: cortinico

fbshipit-source-id: 2312fc5a0a82a65ca908af58dc74348141c16ca2
2025-08-04 02:30:24 -07:00
Peter Abbondanzo 87749470cc Ensure active touches are swept before accepting a child native gesture (#52995)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52995

Fabric retains views by ID when `JSTouchDispatcher` receives a touch event, but does not sweep these same views if a child native gesture is started between the `ACTION_DOWN` and `ACTION_UP` actions of the touch. As a result, we never end up calling into that view's manager's `onDropViewInstance` method and can't perform reliable teardown of the view since it's stuck in this "touched" state.

This is change adds a new condition to check if `JSTouchDispatcher` should sweep active touches when a child native gesture is started, and only applies the check to `ReactSurfaceView` to start. The check is also only enabled if the `sweepActiveTouchOnChildNativeGesturesAndroid` flag is set.

Changelog: [Internal]

Reviewed By: jehartzog

Differential Revision: D79230277

fbshipit-source-id: c15b888ec932319f1bda05b8ef5eec39e5d08710
2025-08-03 18:04:43 -07:00
Peter Abbondanzo f2964e17cd Add feature flag to perform gesture sweep in JSTouchDispatcher (#52972)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52972

Fabric retains views by ID when `JSTouchDispatcher` receives a touch event, but does not sweep these same views if a child native gesture is started between the `ACTION_DOWN` and `ACTION_UP` actions of the touch. As a result, we never end up calling into that view's manager's `onDropViewInstance` method and can't perform reliable teardown of the view since it's stuck in this "touched" state.

This is the first of a few changes to add a new feature flag `sweepActiveTouchOnChildNativeGesturesAndroid` to allow the `JSTouchDispatcher` to sweep active touches when a child native gesture is started. Running experiments internally to confirm that there are no unintended side effects from flushing the active touch.

Changelog: [Internal]

Reviewed By: jehartzog

Differential Revision: D79257465

fbshipit-source-id: 1ca79e77b21d8086c4df6753b16b1d8d922cd8d5
2025-08-03 18:04:43 -07:00
Sam Zhou 1b62d55ffb Unbreak react-native CI (#52997)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52997

Quick followup of D79481936

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79495826

fbshipit-source-id: e133cf31800455eb4f4968d6995525fa8a843a77
2025-08-01 22:31:37 -07:00
Sam Zhou 16fa3d5da4 Update prettier-plugin-hermes-parser in fbsource to 0.31.1 (#52996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52996

Bump prettier-plugin-hermes-parser to 0.31.1.

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D79481936

fbshipit-source-id: 4decd5c92722f935a6a03b6d2205bc31b864fb5d
2025-08-01 20:18:36 -07:00
Pieter Vanderwerff 4c7d7a903e Deploy 0.278.0 to xplat (#52994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52994

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

Reviewed By: SamChou19815

Differential Revision: D79463433

fbshipit-source-id: c6f24199c7899dd618e807b2cd65b0b3673c92ce
2025-08-01 16:51:38 -07:00
Samuel Susla 597fe66a75 avoid excessive logs in C++ Animated (#52992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52992

changelog: [internal]

do not log on every frame to make logs more readable. The callbacks are only set during construction and there is no value in logging on every commit props.

Reviewed By: rshest

Differential Revision: D79436988

fbshipit-source-id: 26c6cbadd5ae0efa8575c7f85e4c0d90e2ef6215
2025-08-01 16:07:33 -07:00
Ramanpreet Nara 9c8a4c2297 core: Remove legacy components (#52118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52118

This diff aims to remove all legacy components from react native core.

Reviewed By: mdvacca

Differential Revision: D72733503

fbshipit-source-id: 3ed28c252c79b5a1ead794d758d1cf5bc265f265
2025-08-01 15:43:55 -07:00
Rubén Norte c5fb371061 Add test for View refs (#52982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52982

Changelog: [internal]

Just adding a few tests for `View` refs, to show as an example of what a test for a public component should have.

Reviewed By: rshest

Differential Revision: D79447449

fbshipit-source-id: 75b9dbb45824d927bcf63472da25c7c5a52c7eb6
2025-08-01 10:33:01 -07:00
Rubén Norte 68e5a24ef7 Restructure Fantom test for View to follow convention (#52983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52983

Changelog: [internal]

Just moving some tests that were defined under `<View>` that were related to styles, to under `<View> > props > style`.

Reviewed By: rshest

Differential Revision: D79447450

fbshipit-source-id: e97cc4e058ffc8170b7fa74176cc8dc27e26cfde
2025-08-01 10:33:01 -07:00
Rubén Norte c28a601d80 Add tests for refs in Text (#52980)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52980

Changelog: [internal]

Adds Fantom tests for the behavior of `refs` in `Text` components.

Reviewed By: rshest

Differential Revision: D79436148

fbshipit-source-id: 6d357740303f4868d176af7b4559891af77b79f8
2025-08-01 10:33:01 -07:00
Artem Kholodnyi e8c6a5397b Fix react-native build
Summary:
bypass-github-export-checks

Changelog: [internal]

Reviewed By: Abbondanzo

Differential Revision: D79441010

fbshipit-source-id: 249912a6cf3350b98af6cf910151fc5a95edce2d
2025-08-01 10:17:47 -07:00
Samuel Susla 310bd4e5bb Back out "move C++ Animated to ReactCommon" (#52984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52984

changelog: [internal]

breaks Github CI, let's back it out for now.

Original commit changeset: 141f0ce7b993

Original Phabricator Diff: D79184118

Reviewed By: rubennorte

Differential Revision: D79444246

fbshipit-source-id: 8aa35ed450804c77389601a4ea820b1dd552ad98
2025-08-01 10:10:10 -07:00
Rubén Norte f497259901 Remove flakiness in LongTasksAPI test (#52974)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52974

Changelog: [internal]

The test for LongTasks is flaky on Github and I made a change to figure out why (D79366370 / https://github.com/facebook/react-native/pull/52948). It seems that the long task happens before the artificial task we're using for testing, so we can update the test to filter those out.

Reviewed By: cortinico

Differential Revision: D79441987

fbshipit-source-id: 99296d704cfec2e61ca29d06878df171231f4e78
2025-08-01 07:54:28 -07:00
Sam Zhou c43a39925f Replace $FlowIssue with $FlowFixMe (#52976)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52976

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D79400163

fbshipit-source-id: b0c4f10b18b99550bdf95be620187f011b62f2f7
2025-08-01 07:50:00 -07:00
generatedunixname537391475639613 e1f6a19d38 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp (#52956)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52956

Reviewed By: rshest

Differential Revision: D79335606

fbshipit-source-id: c6aca07f135aab62e0dbda352d4bdc4e81bdc59e
2025-08-01 06:13:34 -07:00
Artem Kholodnyi f70c39d836 Fix obfuscated scale type names (#52958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52958

Changelog: [Internal]

Reviewed By: kartavya-ramnani, oprisnik, rshest

Differential Revision: D79354202

fbshipit-source-id: d4e84749324ff75a283c940631ac1199694bc92e
2025-08-01 06:07:14 -07:00
Samuel Susla 8c305a0b64 move C++ Animated to ReactCommon (#52944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52944

changelog: [internal]

this should be in ReactCommon, not in cxx platform as it is not platform specific.

Reviewed By: rubennorte, christophpurrer

Differential Revision: D79184118

fbshipit-source-id: 141f0ce7b993d229c5d832d22c54471d32681173
2025-08-01 04:56:48 -07:00
Mateo Guzmán 77be1a3dc4 Kotlin: accessor call can be replaced with property access syntax (#52950)
Summary:
Fixing a few warnings from static code analysis regarding the [accessor call can be replaced with property access](https://www.jetbrains.com/help/inspectopedia/UsePropertyAccessSyntax.html) rule

## Changelog:

[INTERNAL] - Kotlin: accessor call can be replaced with property access syntax

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

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

Reviewed By: cortinico

Differential Revision: D79431292

Pulled By: rshest

fbshipit-source-id: 09ad40c09512def9ab33eaeb70da057f742ae4a1
2025-08-01 04:33:29 -07:00
Zeya Peng 504cf3e933 cleanup TODOs in fantom tests around cxxNativeAnimatedRemoveJsSync (#52949)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52949

## Changelog:

[Internal] [Changed] - cleanup TODOs in fantom tests around cxxNativeAnimatedRemoveJsSync

Previous attempt to remove js sync so far is working expectedly since https://github.com/facebook/react-native/pull/52904 / D79080739

Reviewed By: sammy-SC

Differential Revision: D79373130

fbshipit-source-id: e310b9250ba5da2e55435468f46b75977e46f111
2025-07-31 15:20:54 -07:00
Rubén Norte 707a8631ca Implement maxDuration option for PerformanceTracer (#52935)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52935

Changelog: [internal]

This implements a new option for `PerformanceTracer::startTracing` to specify a maximum duration for the recording, keeping only the last record events.

This will allow us to implement an "always-on" profiling mode for RN with a low overhead. In the future, we can extend this with a `maxBufferSize` option.

See the comment in `PerformanceTracer.cpp` for implementation details.

Reviewed By: hoxyq

Differential Revision: D79340014

fbshipit-source-id: 3260724a775a574fe5e52d47358a3a5abd0d2ee7
2025-07-31 14:29:24 -07:00
Rubén Norte 30e2b35d2d Extract logic to enqueue trace event to its own method (#52938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52938

Changelog: [internal]

Minor refactor to simplify changing the logic for how events are buffered.

Reviewed By: hoxyq

Differential Revision: D79340013

fbshipit-source-id: efd295b1583929580fbe7441ec7eb06e828ca514
2025-07-31 14:29:24 -07:00
Rubén Norte 00debea508 Log synthetic events for trace start/end when the trace finishes (#52937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52937

Changelog: [internal]

Minor refactor to log the synthetic events for trace start when the trace finishes. This is to simplify future work to implement a sliding window for trace events.

Reviewed By: hoxyq

Differential Revision: D79271692

fbshipit-source-id: 9e923ac36fff850a3aeede7304fb2d721bb9f16c
2025-07-31 14:29:24 -07:00
Rubén Norte 9f6440d8c8 Simplify PerformanceTracer API and move processing to TracingAgent (#52934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52934

Changelog: [internal]

Right now, the `PerformanceTracer` API has a method to stop the trace and a separate one to collect serialized events. This refactors the API to return the collected events when calling `stopTracing` instead.

The caller (in this case `TracingAgent`) is responsible for serializing and sending the events in chunks through CDP.

Reviewed By: hoxyq

Differential Revision: D79271690

fbshipit-source-id: bdb48c80be4fd07d96e381e6bb4d099cae91f8de
2025-07-31 14:29:24 -07:00
Rubén Norte f7185715df Remove unnecessary collectEvents method from PerformanceTracer (#52936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52936

Changelog: [internal]

This method is unused and we're no longer planning to use it.

Reviewed By: hoxyq

Differential Revision: D79271691

fbshipit-source-id: 1a0be464928a199cfe4a57cb5c44255b127264c2
2025-07-31 14:29:24 -07:00
Rubén Norte 384fc5447d Make observer go through Fanton.runTask in LongTasksAPI test (#52948)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52948

Changelog: [internal]

Not sure why this test is flaky, but this tries to add some more assertions to see where the problem comes from.

Reviewed By: hoxyq

Differential Revision: D79366370

fbshipit-source-id: d66b30e502dbc80d3e972ed93a91bb7f703de9c4
2025-07-31 11:28:57 -07:00
Ruslan Shestopalyuk 9d6d8a6e65 Add Text benchmark clause for elements without props (#52942)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52942

# Changelog:
[Internal] -

Adds another test clause to the Text benchmark test, to test the case when the component doesn't have any props altogether, which can be useful to establish a baseline.

Reviewed By: rubennorte

Differential Revision: D79352849

fbshipit-source-id: fbfeb53d3ede59631548eb2fe76a4debd5927900
2025-07-31 10:50:31 -07:00
Wandji Emmanuel junior 626568f9a3 fix(android): Stabilize custom accessibility action IDs for TalkBack (#52724)
Summary:
This pull request resolves a critical accessibility bug on Android where custom `accessibilityActions` fail to execute when activated via TalkBack's swipe gestures.

**The Problem:**
- When a user focuses a component with custom `accessibilityActions` (like a `TouchableOpacity`), TalkBack correctly announces the action labels as the user swipes up or down.
- However, when the user double-taps to activate the selected action, TalkBack reports an "incompatible action," and the `onAccessibilityAction` event is never triggered.

**The Root Cause:**
The investigation revealed that the `ReactAccessibilityDelegate` was generating **new, unstable IDs** for custom actions on every UI update. This instability prevents the Android accessibility service from reliably tracking and invoking the selected action.

**The Solution:**
This change introduces a static, thread-safe cache (`ConcurrentHashMap`) within `ReactAccessibilityDelegate`. This ensures that each unique action name is mapped to a single, stable ID for the entire lifecycle of the application. This provides the consistency required by TalkBack to function correctly.

This addresses the issue described in https://github.com/facebook/react-native/issues/47268.

 ---

## Changelog:

[Android] [Fixed] - Stabilize custom accessibility action IDs to prevent "incompatible action" errors in TalkBack.
 ---

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

Test Plan:
The fix was validated extensively using the RNTester app on a physical Android device and an Android emulator.

### Steps to Reproduce (Before Fix)

1.  Enable TalkBack on an Android device.
2.  Navigate to a `TouchableOpacity` component with several custom `accessibilityActions`.
3.  Swipe up or down to cycle through the actions. TalkBack correctly announces them (e.g., "add to cart").
4.  Double-tap to execute the selected action.
5.  **Result (Bug):** TalkBack announces *"incompatible action"*, and the `onAccessibilityAction` event is not triggered.

### Validation Steps (After Fix)

1.  Follow the same steps as above on the patched version.
2.  **Result (Fixed):** After double-tapping, the `onAccessibilityAction` event is **correctly triggered** with the appropriate action name. The "incompatible action" issue is fully resolved.

*A screen recording demonstrating the successful fix can be provided if needed.*

Uploading fixed bugs view problems (1).mp4…

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

Reviewed By: jorge-cab

Differential Revision: D78737471

Pulled By: cipolleschi

fbshipit-source-id: 877b196597472ac6a4f6df81a05a43956fb34629
2025-07-31 10:28:28 -07:00
Ruslan Lesiutin 2c540ac35a Add a method for transfering an ownership of captured TraceEvents (#52940)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52940

# Changelog: [Internal]

This is required for storing these Trace Events somewhere outside of PerformanceTracer, in case these events will be dispatched later.

Reviewed By: rubennorte

Differential Revision: D78741192

fbshipit-source-id: 3cc2eacd922855231fafb93c32d326b150b3c19b
2025-07-31 07:43:31 -07:00
Ruslan Lesiutin b58c2ffd72 refactor RuntimeSamplingProfile serializer (#52916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52916

# Changelog: [Internal]

Align with other serializers in `jsinspector-modern` to have just static public method.

Reviewed By: rubennorte

Differential Revision: D79131985

fbshipit-source-id: 3f1f08641bb96a9fbd067992b8ce294af9d27688
2025-07-31 07:43:31 -07:00
Ruslan Lesiutin a8f6c96bc2 Static generators for Profile Trace Events (#52915)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52915

# Changelog: [Internal]

This removes the use of `PerformanceTracer` instance in a serialization logic.

Reviewed By: rubennorte

Differential Revision: D78919220

fbshipit-source-id: 5c663ea77eb36eb7664623c1595308a9450f7825
2025-07-31 07:43:31 -07:00
Ruslan Lesiutin 3ed6def874 Create aliases for ProcessId, ThreadId, RuntimeProfileId (#52917)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52917

# Changelog: [Internal]

Just an aliases for referencing these ids, instead of raw uint64_t.

Reviewed By: rubennorte

Differential Revision: D78741191

fbshipit-source-id: 1ee403ff19ed95361366c76c1fb52e70ec67f16e
2025-07-31 07:43:31 -07:00
Ruslan Lesiutin f1e5c84ea7 Remove methods for capturing Processes and Threads (#52914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52914

# Changelog: [Internal]

We can't rely on RuntimeExecutor to actually tell us what JavaScript thread number is. Although this would work correct in most of the cases, this is not the solution we should go with.

Instead, we should fetch a map <id, name> of threads from the Host. This is what we will lazily call at the start of the Trace. I will add later on top of the stack.

Reviewed By: rubennorte

Differential Revision: D78990872

fbshipit-source-id: e41ebd35273c6741ebbc3fe3b851018c9f3275dc
2025-07-31 07:43:31 -07:00
generatedunixname89002005287564 5f3eccb04f Fix CQS signal readability-redundant-control-flow in xplat/js/react-native-github/packages (#52931)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52931

Reviewed By: dtolnay

Differential Revision: D79327593

fbshipit-source-id: 39e2b3e54f156199fc12b9633ffafeeef8343caa
2025-07-31 05:29:11 -07:00
Devan Buggay 15373218ec Add granular control with pragma modes (#52894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52894

Adds the following boolean pragma modes for more granular control:

```
fantom_native_opt true|false
fantom_js_opt true|false
fantom_js_bytecode true|false
```

Previously these were all set together with `fantom_mode`. These modes are mutually exclusive with `fantom_mode`.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D79151687

fbshipit-source-id: 59c3f20bccb570c0293ffd037609946a1a9bbb8f
2025-07-30 14:22:22 -07:00
Devan Buggay 6d51bce9ed Refactor native/js modes (#52822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52822

Refactors underlying modes by adding `isNativeOpt`, `isJsOpt`, and `isJsBytecode` to allow for more granular control in a future diff.

### View ###

| (index) | Task name                                                 | Latency average (ns)   | Latency median (ns)       | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | ---------------------- | ------------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'render 100 uncollapsable views'                          | '23005778.16 ± 0.53%'  | '22877194.50 ± 11607.50'  | '43 ± 0.50%'               | '44'                      | 64      |
| 1       | 'render 1000 uncollapsable views'                         | '271276451.70 ± 0.61%' | '268378201.00 ± 9925.00'  | '4 ± 0.59%'                | '4'                       | 64      |
| 2       | 'render 100 views with large amount of props and styles'  | '47580650.91 ± 1.21%'  | '47212012.00 ± 2979.00'   | '21 ± 0.89%'               | '21'                      | 64      |
| 3       | 'render 1000 views with large amount of props and styles' | '521237370.22 ± 1.09%' | '516142815.00 ± 41682.00' | '2 ± 0.84%'                | '2'                       | 64      |
| 4       | 'render 1500 views with large amount of props and styles' | '828143691.48 ± 0.94%' | '824723257.50 ± 11331.50' | '1 ± 0.73%'                | '1'                       | 64      |

### View (mode 🚀, jsMode 🚀, bytecode) ###

| (index) | Task name                                                 | Latency average (ns)   | Latency median (ns)        | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | ---------------------- | -------------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'render 100 uncollapsable views'                          | '4051033.45 ± 2.01%'   | '3876618.00'               | '251 ± 1.29%'              | '258'                     | 247     |
| 1       | 'render 1000 uncollapsable views'                         | '86134420.23 ± 1.38%'  | '85815369.50 ± 281477.50'  | '12 ± 1.38%'               | '12'                      | 64      |
| 2       | 'render 100 views with large amount of props and styles'  | '13921817.92 ± 2.57%'  | '13474963.50 ± 4977.50'    | '72 ± 1.62%'               | '74'                      | 72      |
| 3       | 'render 1000 views with large amount of props and styles' | '182664526.31 ± 0.74%' | '181872565.00 ± 10281.00'  | '5 ± 0.73%'                | '5'                       | 64      |
| 4       | 'render 1500 views with large amount of props and styles' | '313110386.45 ± 1.13%' | '307934163.50 ± 156920.50' | '3 ± 1.07%'                | '3'                       | 64      |

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78912257

fbshipit-source-id: 16fd0301af98159dbb9818cb8092bd4416ef2559
2025-07-30 14:22:22 -07:00
Devan Buggay 807f0b6882 Isolate NativeDevSettings load (#52821)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52821

Hardens RN to running in mismatched opt/dev modes.

While adding an opt native/dev js mode to fantom, LogBox was trying to load NativeDevSettings when it didn't exist because of mode mismatch.

This is the only location it's happening, so this just moves the NativeDevSettings load into the one function that needs it.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78952284

fbshipit-source-id: e68667cb28fae7cb6f985305e8885f271ef5d3af
2025-07-30 14:22:22 -07:00
Alex Hunt 364e71b159 Fix CMake dependency error (#52923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52923

Follow-up to D78904748, where CI was broken on `main` for the `run_fantom_tests` job. It turns out this Android build uniquely included the new `react_performance_cdpmetrics` dependency, and this had an incorrect dep.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D79263124

fbshipit-source-id: 3e38e0cebe53520ea50e6d11a571e01c52e34874
2025-07-30 10:30:08 -07:00
Zeya Peng 5b38bb4745 Avoid unnecessary copy of view props map in UIManager::updateShadowTree (#52908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52908

## Changelog:

[General] [Changed] - Avoid unnecessary copy of view props map in UIManager::updateShadowTree

Reviewed By: christophpurrer

Differential Revision: D79193215

fbshipit-source-id: 6a55dc2bf3bcf95eebeeddf2d747fe11ae56bf78
2025-07-30 08:58:11 -07:00
Alex Hunt 2dd72f956b Align InteractionEntry payload to match Chrome (#52840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52840

**Context**

Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.

**This diff**

Completes populating a full `InteractionEntry` Live Event payload by implementing remaining fields sufficient to be rendered by Chrome DevTools.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78904747

fbshipit-source-id: 7473602f6f1efe3ac71e07a2b88e6ad7020dcbbf
2025-07-30 07:13:58 -07:00
Alex Hunt a3bf989450 Implement reporting InteractionEntry live metrics to runtime (#52839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52839

**Context**

Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.

**This diff**

Adds and configures a `CdpMetricsReporter` class to report `InteractionEntry` live metrics over CDP via the `"__chromium_devtools_metrics_reporter"` runtime binding.

**Notes**

- Introduces a new `react/performance/cdpmetrics` package, and a listener API on `PerformanceEntryReporter` (both to avoid a `jni` dependency in `react/performance/timeline`).

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78904748

fbshipit-source-id: c75971aba43d9929912b3d1dba7576c2a2342214
2025-07-30 07:13:58 -07:00
Samuel Susla f711d1776c Micro-optimise JavaScript part of Animated (#52906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52906

changelog: [internal]

Micro-optimise JavaScript part of Animated by avoiding JS syntax for private variable/method - #foo. Instead, use double underscores. Benchmarks indicate ~10% improvement.

# Before
### Animated (mode 🚀) ###

| (index) | Task name                                                                    | Latency average (ns)  | Latency median (ns)      | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | ---------------------------------------------------------------------------- | --------------------- | ------------------------ | -------------------------- | ------------------------- | ------- |
| 0       | 'render 1 views'                                                             | '84990.06 ± 1.49%'    | '80691.00'               | '12164 ± 0.14%'            | '12393'                   | 11767   |
| 1       | 'render 10 views'                                                            | '373372.50 ± 1.00%'   | '363786.00'              | '2727 ± 0.26%'             | '2749'                    | 2679    |
| 2       | 'render 100 views'                                                           | '3099588.37 ± 0.92%'  | '3017559.00'             | '324 ± 0.74%'              | '331'                     | 323     |
| 3       | 'render 1 animated views (without animations set up)'                        | '174636.87 ± 0.67%'   | '168783.00'              | '5808 ± 0.17%'             | '5925'                    | 5727    |
| 4       | 'render 10 animated views (without animations set up)'                       | '1054481.51 ± 0.61%'  | '1036686.00'             | '953 ± 0.37%'              | '965'                     | 949     |
| 5       | 'render 100 animated views (without animations set up)'                      | '9176283.60 ± 1.12%'  | '8932316.00'             | '109 ± 0.95%'              | '112'                     | 109     |
| 6       | 'render 1 animated views (with a single animation set up - JS driven)'       | '204383.77 ± 0.52%'   | '199109.00'              | '4943 ± 0.17%'             | '5022'                    | 4893    |
| 7       | 'render 10 animated views (with a single animation set up - JS driven)'      | '1315894.97 ± 0.36%'  | '1300562.00 ± 40.00'     | '762 ± 0.30%'              | '769'                     | 760     |
| 8       | 'render 100 animated views (with a single animation set up - JS driven)'     | '11924031.45 ± 1.36%' | '11753334.50 ± 30040.50' | '84 ± 1.18%'               | '85'                      | 84      |
| 9       | 'render 1 animated views (with a single animation set up - native driven)'   | '318103.70 ± 0.37%'   | '311657.50 ± 0.50'       | '3162 ± 0.20%'             | '3209'                    | 3144    |
| 10      | 'render 10 animated views (with a single animation set up - native driven)'  | '2230305.96 ± 0.51%'  | '2191890.00'             | '449 ± 0.41%'              | '456'                     | 449     |
| 11      | 'render 100 animated views (with a single animation set up - native driven)' | '21983695.16 ± 0.75%' | '21945687.00 ± 17186.00' | '46 ± 0.74%'               | '46'                      | 64      |

# After

### Animated (mode 🚀) ###

| (index) | Task name                                                                    | Latency average (ns)  | Latency median (ns)     | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | ---------------------------------------------------------------------------- | --------------------- | ----------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'render 1 views'                                                             | '82684.75 ± 1.11%'    | '80231.00'              | '12331 ± 0.08%'            | '12464'                   | 12095   |
| 1       | 'render 10 views'                                                            | '378798.65 ± 1.16%'   | '365378.50 ± 9.50'      | '2703 ± 0.31%'             | '2737'                    | 2640    |
| 2       | 'render 100 views'                                                           | '3124253.51 ± 0.95%'  | '3039842.00'            | '322 ± 0.76%'              | '329'                     | 321     |
| 3       | 'render 1 animated views (without animations set up)'                        | '165580.70 ± 0.73%'   | '161562.00'             | '6131 ± 0.14%'             | '6190'                    | 6040    |
| 4       | 'render 10 animated views (without animations set up)'                       | '979127.10 ± 0.60%'   | '962509.50 ± 5.50'      | '1027 ± 0.36%'             | '1039'                    | 1022    |
| 5       | 'render 100 animated views (without animations set up)'                      | '8487740.98 ± 1.32%'  | '8235139.50 ± 3244.50'  | '118 ± 1.05%'              | '121'                     | 118     |
| 6       | 'render 1 animated views (with a single animation set up - JS driven)'       | '185333.93 ± 0.52%'   | '181582.00'             | '5451 ± 0.15%'             | '5507'                    | 5396    |
| 7       | 'render 10 animated views (with a single animation set up - JS driven)'      | '1145679.81 ± 0.37%'  | '1131668.00'            | '875 ± 0.29%'              | '884'                     | 873     |
| 8       | 'render 100 animated views (with a single animation set up - JS driven)'     | '10451056.69 ± 1.60%' | '10064069.50 ± 826.50'  | '96 ± 1.39%'               | '99'                      | 96      |
| 9       | 'render 1 animated views (with a single animation set up - native driven)'   | '292243.89 ± 0.40%'   | '286740.00'             | '3447 ± 0.21%'             | '3487'                    | 3422    |
| 10      | 'render 10 animated views (with a single animation set up - native driven)'  | '1993053.78 ± 0.47%'  | '1958960.00 ± 20.00'    | '503 ± 0.39%'              | '510'                     | 502     |
| 11      | 'render 100 animated views (with a single animation set up - native driven)' | '19528221.48 ± 0.95%' | '19383511.00 ± 7431.00' | '51 ± 0.92%'               | '52'                      | 64      |

Reviewed By: rubennorte

Differential Revision: D79179369

fbshipit-source-id: e641be0e8ec313b58bcae8330f127e707cd4fffc
2025-07-30 02:49:37 -07:00
David Vacca 0d3791ca0a Throw Exception if ReactApplication.reactNativeHost is not overriden (#52912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52912

This diff throws an Exception if ReactApplication.reactNativeHost is not overriden. This field is deprecated and it will be deleted in the near future.
The goal of this diff is to be able to remove usages of reactNativeHost for classes that implement ReactApplication

changelog: [Android][Breaking] Throw Exception if ReactApplication.reactNativeHost is not overriden

Reviewed By: mlord93

Differential Revision: D79186336

fbshipit-source-id: 9f8f34739c0f04056ff3d795bda45bc0dbca7624
2025-07-29 18:22:53 -07:00
Samuel Susla 4614a0bc17 move fabric sync in C++ Animated to JS thread (#52904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52904

changelog: [internal]

There is a race condition in `FabricUIManagerBinding::schedulerDidFinishTransaction`. Until it is addressed properly, let's do synchronisation Fabric commits through JavaScript thread.

It can have pretty serious consequences: a crash in better case and undefined behaviour in worse case.

The race is between acquiring two mutexes:
1. One inside of `MountingCoordinator::pullTransaction`
2. Second one inside of `FabricMountingManager::executeMount`

The logic inside of `FabricUIManagerBinding::schedulerDidFinishTransaction` depends on the fact that whichever thread acquires mutex number 1, will acquire mutex number 2 without interruption. But that is not always the case as threads may be interrupted.

Reviewed By: zeyap

Differential Revision: D79080739

fbshipit-source-id: c86885aba25825030dc44b60144beb3e3ba18306
2025-07-29 14:26:09 -07:00
React Native Bot 170ed501f0 Add changelog for v0.81.0-rc.3 (#52907)
Summary:
Add Changelog for 0.81.0-rc.3

## Changelog:
[Internal] - Add Changelog for 0.81.0-rc.3

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D79186289

Pulled By: lunaleaps

fbshipit-source-id: eae000134c294b47be906f5803c618fb997e1011
2025-07-29 13:10:31 -07:00
Samuel Susla 7afb8ab305 disable subview clipping traversal when view culling is enabled (#52903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52903

changelog: [internal]

disable subview clipping traversal when view culling is enabled.
Subview clipping is already disabled by preventing prop from being set to true: https://fburl.com/code/bynvtwfs but we found a crash where the traversal leads to memory corruption with view culling enabled.

Reviewed By: lenaic

Differential Revision: D79168116

fbshipit-source-id: 9dcb624ca12bc2d94b265681795604ee0ac3fe00
2025-07-29 09:43:44 -07:00