Commit Graph

12270 Commits

Author SHA1 Message Date
generatedunixname89002005287564 aa5b8551ce Fix CQS signal modernize-use-using in xplat/js/react-native-github/packages/react-native/React/Fabric (#52523)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52523

Reviewed By: dtolnay

Differential Revision: D77993027

fbshipit-source-id: 2cf11338360613206a91a9acbeabbfa45934b98f
2025-07-09 20:43:05 -07:00
Eric Rozell 57c5eee51f Delete animatedShouldSignalBatch feature flag (#52521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52521

Progress is moving quickly on the cxxNativeAnimatedEnabled flag, which this animatedShouldSignalBatch was intended to de-risk. We no longer need this flag to de-risk issues with animated batch flushing.

## Changelog

[Internal]

Reviewed By: christophpurrer

Differential Revision: D78005971

fbshipit-source-id: 719f1dfb0594fbe90dd6f08dea21ad20665832df
2025-07-09 20:15:57 -07:00
Vineeth K 586f5ba89c Added fix to use accessibility source props (#52397)
Summary:
accessibilityRole is not getting the default value from sourceProps.

This change will fix https://github.com/facebook/react-native/issues/52396

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Fixed accessibilityRole parsing.
Pick one each for the category and type tags:

[GENERAL] [FIXED] - Added fix for setting the default value for accessibility props

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Test Plan: After this change accessibilityRole will get the default value from sourceProps.

Reviewed By: joevilches

Differential Revision: D77879025

Pulled By: NickGerleman

fbshipit-source-id: c2fd10dd34462e2cd01488b720ba91e4f1998000
2025-07-09 18:33:59 -07:00
Joe Vilches 384bd214ff Back out "Implement accessibilityOrder by building the accessibilityTree through addChildrenForAccessibility" (#52516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52516

Original commit changeset: 767ebc880a2e

Original Phabricator Diff: D77258926

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D78016839

fbshipit-source-id: 4f71764d5885c227b92840fc9191d0f3b86f6278
2025-07-09 18:10:56 -07:00
Jack Pope d18f1f7ca3 Enable Fragment Refs for intersection observers on Fabric (#52474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52474

1. Enables the feature flags for fragment refs on fbsource
2. Adds a test with Fantom for usage of `FragmentInstance#observeUsing` and `FragmentInstance#unobserveUsing`.
3. Exposes the `ReactFragmentInstance` type with the common methods that are used on native. We can override the DOM only methods in www libdefs.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D74326262

fbshipit-source-id: e35ee45b23179ad3ba5527763567c9b04c127eff
2025-07-09 16:03:25 -07:00
Riccardo Cipolleschi 23f3bf9239 Add the ENTERPRISE_REPOSITORY env var to let user consume artifacts from their personal maven mirror (#52514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52514

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

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

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

Reviewed By: cortinico

Differential Revision: D78011424

fbshipit-source-id: 24b83b4866095d7fe3318362afc5075b99b146e7
2025-07-09 10:14:41 -07:00
Ruslan Lesiutin dfce5c7180 console.timeStamp: support warning color (#52511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52511

# Changelog: [Internal]

This is actually used in React for logging triggers, like Mount / Unmount / Reconnect / Disconnect.

Reviewed By: huntie

Differential Revision: D78008351

fbshipit-source-id: 9d39d45da499ce78172531c00cc7465b985c2646
2025-07-09 09:26:47 -07:00
Christoph Purrer 52815c2724 Improve NativeDOM Turbo Module typing (#52494)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52494

Changelog: [Internal]

- Use C++ private namespace instead of C static methods
- Strongly type C++ TM functions via AsyncCallback

Reviewed By: javache

Differential Revision: D77978354

fbshipit-source-id: 2274b95cfc5b65392fc3c808bbdf54ec4ab3a37e
2025-07-09 08:40:25 -07:00
Alex Hunt 732bd12dc2 Add optional safeAreaInsets prop to NewAppScreen (replacing SafeAreaView) (#52507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52507

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

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

Reviewed By: cortinico

Differential Revision: D78006238

fbshipit-source-id: 01fb16d6754b69a722ea11838d558bebd4748026
2025-07-09 08:26:19 -07:00
Riccardo Cipolleschi f37e983255 Back out "Add more logging around computeNightlyTarballURL" (#52510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52510

We reverted this change in the 0.81 release branch

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D78007905

fbshipit-source-id: fec3df04423300571f629da19bf95cd82c952f12
2025-07-09 08:12:58 -07:00
Samuel Susla daf6ebd7b5 fix race condition in C++ Animated (#52505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52505

changelog: [internal]

there is a race condition where `startRenderCallbackIfNeeded` may be called from JS thread and the main thread at the same time, leading to a crash. To address this, this diff adds uses a boolean to make sure `startOnRenderCallback_` is only called once and `stopOnRenderCallback_` is only called after start was called.

Reviewed By: javache

Differential Revision: D77871230

fbshipit-source-id: 6d7fba596e7146adaff6f8dbe1f436ddd59950c6
2025-07-09 07:19:30 -07:00
Rubén Norte f578038cb2 Add test to show Fabric bug with intermediate states in JS and sync updates in UI (#52502)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52502

Changelog: [internal]

This is just a test to show the bug reported in https://github.com/facebook/react-native/issues/52373

Reviewed By: javache

Differential Revision: D78000010

fbshipit-source-id: 5f53a02eb875255f5e384a748057997491518adc
2025-07-09 05:59:27 -07:00
Anupriya Verma 2ca88a0069 'return': conversion from 'int' to 'uint8_t', possible loss of data in CSSHexColor (#52496)
Summary:
Resolves https://github.com/microsoft/react-native-windows/issues/14666
We faced this issue while integrating [0.79.0-nightly-20250220-41b597c73](https://github.com/microsoft/react-native-windows/pull/14662/files#top)

This warning is treated as error and should be fixed here as well.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [FIXED] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Test Plan:
Fixed error:
##[error]node_modules\react-native\ReactCommon\react\renderer\css\CSSHexColor.h(39,12): Error C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data
2>D:\a_work\1\s\node_modules\react-native\ReactCommon\react\renderer\css\CSSHexColor.h(39,12): error C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data [D:\a_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
(compiling source file '../../node_modules/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp')

Tested E2E in RNW

Reviewed By: javache

Differential Revision: D78000818

Pulled By: rshest

fbshipit-source-id: 5caafc5e92540f722b009480f030276e526355af
2025-07-09 05:05:52 -07:00
generatedunixname89002005287564 47957f9adc 60 (#52493)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52493

Reviewed By: dtolnay

Differential Revision: D77920274

fbshipit-source-id: 42a68d5666f43f606ebcbbe4d207bb9b299760e7
2025-07-09 04:56:35 -07:00
Nicola Corti 9c172fbba3 Add more logging around computeNightlyTarballURL
Summary:
This is a backport of a fix we applied to the 0.81 branch.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: vzaidman

Differential Revision: D78000573

fbshipit-source-id: 64a4e90632158c1f52c45f9fbc3452e848271e94
2025-07-09 04:50:29 -07:00
generatedunixname89002005287564 7725a0aee3 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/rn-tester/android/app/src/main/jni (#52501)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52501

Reviewed By: javache, cortinico

Differential Revision: D77990137

fbshipit-source-id: 1fe4b7a0a821cf9bff5b21d38b6e78a3b164211d
2025-07-09 03:03:48 -07:00
Christoph Purrer b5329ecd6d NativeCxxModuleExample test for testing C++ TM E2E (#52477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52477

Changelog: [Internal]

This adds a Fantom test for

https://github.com/facebook/react-native/blob/main/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.js

to test a C++ Turbo Module End 2 End (loading the C++ implementation in native code, accessing in JavaScript via Hermes VM and verifying the results of the API calls)

Reviewed By: rshest

Differential Revision: D77848654

fbshipit-source-id: 48a4ab88a330e9282ae8dab589743eaace62d124
2025-07-08 21:10:36 -07:00
Nicola Corti 6892dde363 Gradle to 8.14.3 (#52466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52466

Just another patch bump of Gradle 8.14

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

Reviewed By: NickGerleman

Differential Revision: D77865220

fbshipit-source-id: 450d175242f046909ab1984654d24e92a2536d5d
2025-07-08 16:33:18 -07:00
Adan Moreno eb61e6f783 Revert D77143018: Cleanup react-native-codegen DEFS
Differential Revision:
D77143018

Original commit changeset: 06ec43ce5149

Original Phabricator Diff: D77143018

fbshipit-source-id: cec53068f88548c4494da315914763beb6730573
2025-07-08 16:29:45 -07:00
Marco Wang df6ba3f155 Pre-suppress errors for boolean literals for xplat js (#52482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52482

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D77915593

fbshipit-source-id: 9238b89e92410cea350c6057044167727de3601a
2025-07-08 12:50:53 -07:00
Alex Hunt fc5e33b582 Reorganise shared script utils (#52473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52473

Shared utils that were located in the root of `scripts/` are now colocated closer to their dependencies or moved to `scripts/shared/` — simplifying the root directory layout.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77873875

fbshipit-source-id: e04dba41a1ef811d32793931033fdfa93afad0cd
2025-07-08 06:10:36 -07:00
Pieter De Baets 6dfe59e1df Fix missing bundle errors not correctly reported on Android (#52441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52441

When an error is thrown using `handleHostException` from within the (immediate) execution of a `Task`, the `Task` will capture the error. If those errors are never consumed, the error is just silently swallowed. Instead we should make sure that this is raised outside of the context of a `Task` so the error correctly bubbles up and crashes the app (in release).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D77798248

fbshipit-source-id: 41803aba0cace0e364a235501cf34bb946e7ff51
2025-07-08 05:58:56 -07:00
Moti Zilberman db65cb70de Fix typo in new app screen
Summary:
TSIA

bypass-github-export-checks

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D77928389

fbshipit-source-id: 038d11bed3fbbb96c97b7e2c5727e91973de9078
2025-07-08 05:48:00 -07:00
Mateo Guzmán a0e11904d6 Clean up unnecessary test setup for Android tests (#52471)
Summary:
This came out of https://github.com/facebook/react-native/issues/52457 as I had to fix some tests and realised there is a lot of setup that could be shadow and other things that are not needed at all.

## Changelog:

[INTERNAL] - Clean up unnecessary test setup for Android tests

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

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

Reviewed By: cortinico

Differential Revision: D77926887

Pulled By: javache

fbshipit-source-id: ff493d87633fcb4c4194b50cd374ad2e8acda974
2025-07-08 05:31:11 -07:00
Pieter De Baets 120a417320 Cleanup react-native-codegen DEFS (#52468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52468

* Re-enable tests
* Simplify logic to avoid bypasses for arc focus

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77143018

fbshipit-source-id: 06ec43ce5149a139db78d38630191b01bc520461
2025-07-08 04:53:51 -07:00
Rubén Norte 5a79ece192 Use structuredClone to copy detail field in performance.mark and performance.measure (#52483)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52483

Changelog: [internal]

This is a small refinement for `performance.mark` and `performance.measure` to use `structuredClone` to copy the value of the `detail` field, instead of assigning it by reference.

This still doesn't completely fix the semantics of `performance.mark` and `performance.measure`, as the entries returned by those methods aren't referentially equal to the entries reported by `PerformanceObserver` (and the latter don't have the `detail` field yet).

Reviewed By: huntie

Differential Revision: D77863037

fbshipit-source-id: 54d959612ecd560250e49bb0887bb12112a0142f
2025-07-08 04:40:49 -07:00
Ruslan Lesiutin f000116197 Fix Timestamps conversion for Custom Tracks (#52479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52479

# Changelog: [Internal]

The previous cast is incorrect.

Reviewed By: javache

Differential Revision: D77894512

fbshipit-source-id: 67e6b9a4ed43020a343a2a9b5d702509c34ae41a
2025-07-08 04:34:14 -07:00
Vitali Zaidman 5cf4d0899f Update debugger-frontend from 51a91a2...844f225 (#52486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52486

Changelog: [Internal] - Update `react-native/debugger-frontend` from 51a91a2...844f225

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/51a91a2ad62e7f585912ed314a350a72de84d6ed...844f225009e6445d088ed0e431d1fc430325ed95).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [844f22500](https://github.com/facebook/react-native-devtools-frontend/commit/844f22500) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-08T10:16:09+01:00 | [Track when the stack trace symbolication succeeds (#187)](https://github.com/facebook/react-native-devtools-frontend/commit/844f22500) |
| [ffa6bb6af](https://github.com/facebook/react-native-devtools-frontend/commit/ffa6bb6af) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-07T16:21:55+01:00 | [parse "empty url" and "address at" frames as non-hyperlinked text (#188)](https://github.com/facebook/react-native-devtools-frontend/commit/ffa6bb6af) |

Reviewed By: robhogan

Differential Revision: D77926362

fbshipit-source-id: cbcf8b17cd175400d3d027ce2e8ebefa497f5d79
2025-07-08 04:15:32 -07:00
Marco Wang 68650badd2 Pre-suppress errors for null_void for xplat js (#52480)
Summary:
Changelog: [Internal]

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

Reviewed By: SamChou19815

Differential Revision: D77890434

fbshipit-source-id: cc0571e0ff1c7cec3fff8614f688d46e46970cc4
2025-07-07 20:35:08 -07:00
Luna Wei 5ec8e60581 Refactor VirtualView target structure on Android (#52476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52476

Changelog: [Internal] - Refactor package structure on Android to prepare for experimental VirtualView so that non-view related objects go under `virtual` and the native view goes under `view`.
This breaks dependency circles for experimental VirtualView in upcoming change.

Reviewed By: yungsters

Differential Revision: D77335426

fbshipit-source-id: 3b978e9cc5ad376c71aebc039cfc74d2515d2cfa
2025-07-07 16:00:13 -07:00
Alex Hunt 918f02dcc3 Consolidate JS API scripts under scripts/js-api/, update docs (#52469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52469

Organise `scripts/build-types/` and `scripts/diff-api-snapshot/` into a single grouping `scripts/js-api/` parent dir — matching the newly relocated `scripts/cxx-api/`.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77865488

fbshipit-source-id: 33754d9275e65c3bda686294f18d855221ec7bff
2025-07-07 15:04:37 -07:00
Pieter De Baets 3bf5cb3d0e Deprecate MessageQueueThreadPerfStats (#52470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52470

These metrics are not actively consumed and are highly noisy.

Changelog: [Android][Removed] Deprecated MessageQueueThreadPerfStats API and replaced with stub.

Reviewed By: cortinico

Differential Revision: D77867087

fbshipit-source-id: 8bf7423ad60cb3bb21a5dbe94771d5a71832633d
2025-07-07 11:29:01 -07:00
Christoph Purrer ead669ade3 Remove unused ReactCommon/TurboModuleUtils functions #deepCopyJSIObject and #deepCopyJSIArray (#52443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52443

Changelog: [General][Breaking] Remove unused ReactCommon/TurboModuleUtils functions #deepCopyJSIObject and #deepCopyJSIArray

Those are not used anymore

Reviewed By: cortinico

Differential Revision: D77771186

fbshipit-source-id: e1f5e34238567241b4204d58ff85fd9067e321df
2025-07-07 11:04:01 -07:00
Nicola Corti 625f69f284 @DeprecatedInNewArchitecture -> @Deprecated (#52399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52399

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

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

Reviewed By: mdvacca

Differential Revision: D77736713

fbshipit-source-id: bc21729ed8253d3ec6b6a40577bcd76622c3f8a6
2025-07-07 10:20:43 -07:00
Christoph Purrer 06034554e4 Remove SampleTurboCxxModule example (#52442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52442

Changelog: [Internal]

The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.

Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

It is not included in any RNTester app at this time

Reviewed By: cortinico

Differential Revision: D77771111

fbshipit-source-id: a4fe1d13fd0224babc46f54b921a036f7b237a48
2025-07-07 09:37:37 -07:00
Samuel Susla 298ec6ca5d Deprecate ShadowNode::ListOfWeak and replace with std::vector<std::weak_ptr<const ShadowNode>> (#52401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52401

changelog: [internal]

- Mark ShadowNode::ListOfWeak as deprecated with appropriate deprecation message
- Replace all usages of ShadowNode::ListOfWeak with std::vector<std::weak_ptr<const ShadowNode>>
- Updated primitives.h and ReactNativeCPP.api to use the explicit type instead of the alias

This change continues the effort to remove type aliases in favor of explicit standard library types for better code clarity and maintainability.

Reviewed By: christophpurrer

Differential Revision: D77652083

fbshipit-source-id: 79cad019e039c19f661346604ff49a44a4af7a79
2025-07-07 09:29:57 -07:00
Christoph Purrer c1200718a0 Move RuntimeExecutor after copying it into BufferedRuntimeExecutor (#52404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52404

Changelog: [Internal]

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h#L23

is a copy-able type (it will be copied when passed into the BufferedRuntimeExecutor constructor).

Hence we can `std::move` it in the `BufferedRuntimeExecutor` constructor

Reviewed By: javache

Differential Revision: D77758211

fbshipit-source-id: 634b1cd0e1ed4d27a013ad8927b2123dc6977ad8
2025-07-07 08:59:56 -07:00
Rubén Norte a3933e6878 Remove legacy tests for Performance API (#52465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52465

Changelog: [internal]

Now that we have enough coverage for the Performance API in Fantom, Jest tests where most of the API is mocked are redundant and useless, so this removes them (and the mock).

Reviewed By: huntie

Differential Revision: D77860888

fbshipit-source-id: 7dbd1a8a43b056a3b34e4e37d578be9ccb521824
2025-07-07 06:42:23 -07:00
Rubén Norte 9f8179afa7 Add tests for durationThreshold option for PerformanceObserver (#52464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52464

Changelog: [internal]

This adds tests for the `durationThreshold` option for `PerformanceObserver.prototype.observe`.

Reviewed By: huntie

Differential Revision: D77860882

fbshipit-source-id: 1e56391166523d2c4f837f758bc367b58fe8e82e
2025-07-07 06:42:23 -07:00
Rubén Norte e6bff3f1fe Add tests for performance.eventCounts (#52463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52463

Changelog: [internal]

This adds Fantom tests for `performance.eventCounts`.

Reviewed By: huntie

Differential Revision: D77860881

fbshipit-source-id: 26b9ef56b9c610cbad7011bc0adde27251fda909
2025-07-07 06:42:23 -07:00
Rubén Norte feeef97554 Expand tests for the performance API (#52462)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52462

Changelog: [internal]

This adds a few more tests for `performance.getEntries`, `performance.getEntriesByName` and `performance.getEntriesByType`.

Reviewed By: huntie

Differential Revision: D77801746

fbshipit-source-id: 42f80c4e2b787c455b149ee38d071511181532b0
2025-07-07 06:42:23 -07:00
Rubén Norte 9005d93e32 Optimize performance.mark and performance.measure (#52429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52429

Changelog: [internal]

This implements a significant optimization for `performance.mark` and `performance.measure`. After these changes, they take 1/3 of the time they took before.

We've seen these methods show up too often in traces (in the Hermes sampling profiler) so this should significantly reduce their overhead.

I found out that most of the time spent in `performance.mark` and `performance.measure` was creating the `PerformanceMark` and `PerformanceMeasure` instances returned by those methods. I applied the same playbook I did for `ReactNativeElement` (avoiding private fields and `super()` calls, which yielded these wins.

* Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5579.80 ± 0.32%'    | '5479.00'           | '181368 ± 0.02%'           | '182515'                  | 179218  |
| 1       | 'mark (with custom startTime)'                            | '5759.72 ± 0.99%'    | '5648.00'           | '176162 ± 0.02%'           | '177054'                  | 173620  |
| 2       | 'measure (with start and end timestamps)'                 | '6506.38 ± 0.34%'    | '6390.00'           | '155503 ± 0.02%'           | '156495'                  | 153696  |
| 3       | 'measure (with mark names)'                               | '6770.94 ± 0.72%'    | '6620.00'           | '149833 ± 0.03%'           | '151057'                  | 147691  |
| 4       | 'clearMarks'                                              | '785.89 ± 0.07%'     | '771.00'            | '1291356 ± 0.01%'          | '1297017'                 | 1272442 |
| 5       | 'clearMeasures'                                           | '777.98 ± 0.06%'     | '761.00'            | '1303362 ± 0.01%'          | '1314060'                 | 1285383 |
| 6       | 'mark + clearMarks'                                       | '5995.34 ± 1.37%'    | '5779.00'           | '171874 ± 0.03%'           | '173040'                  | 166797  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7040.28 ± 0.57%'    | '6830.00'           | '145289 ± 0.03%'           | '146413'                  | 142040  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7184.43 ± 0.40%'    | '6990.00'           | '141809 ± 0.03%'           | '143062'                  | 139190  |

* After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '1678.19 ± 0.73%'    | '1633.00'           | '607139 ± 0.01%'           | '612370'                  | 595882  |
| 1       | 'mark (with custom startTime)'                            | '1920.23 ± 1.30%'    | '1843.00'           | '538217 ± 0.01%'           | '542594'                  | 520772  |
| 2       | 'measure (with start and end timestamps)'                 | '2651.72 ± 0.94%'    | '2554.00'           | '388312 ± 0.02%'           | '391543'                  | 377114  |
| 3       | 'measure (with mark names)'                               | '2815.84 ± 0.75%'    | '2744.00'           | '362303 ± 0.02%'           | '364431'                  | 355134  |
| 4       | 'clearMarks'                                              | '743.82 ± 0.06%'     | '731.00'            | '1363190 ± 0.01%'          | '1367989'                 | 1344417 |
| 5       | 'clearMeasures'                                           | '776.69 ± 0.07%'     | '761.00'            | '1306563 ± 0.01%'          | '1314060'                 | 1287512 |
| 6       | 'mark + clearMarks'                                       | '2043.97 ± 1.26%'    | '1973.00'           | '504750 ± 0.01%'           | '506842'                  | 489801  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '3048.39 ± 0.87%'    | '2965.00'           | '335285 ± 0.02%'           | '337268'                  | 328042  |
| 8       | 'measure + clearMeasures (with mark names)'               | '3132.75 ± 0.80%'    | '3065.00'           | '324365 ± 0.02%'           | '326264'                  | 319209  |

Reviewed By: huntie

Differential Revision: D77790874

fbshipit-source-id: baf7aca07d281fef4373956d125c63f006fab592
2025-07-07 06:42:23 -07:00
Rubén Norte 74c03b67e3 Fix bugs in performance.mark and performance.measure (#52430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52430

Changelog: [internal]

(This is marked as internal because this API hasn't been marked as stable yet).

This fixes multiple bugs and missing features in `performance.mark` and `performance.measure`. See re-enabled tests to see the specific behaviors.

Validated that performance isn't regressed by this change using the existing benchmark for `Performance` (`Performance-benchmark-itest`):

* Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5557.96 ± 0.34%'    | '5459.00'           | '182114 ± 0.02%'           | '183184'                  | 179922  |
| 1       | 'mark (with custom startTime)'                            | '5664.54 ± 1.71%'    | '5518.00'           | '180296 ± 0.02%'           | '181225'                  | 176537  |
| 2       | 'measure (with start and end timestamps)'                 | '6653.62 ± 0.94%'    | '6530.00'           | '152296 ± 0.02%'           | '153139'                  | 150295  |
| 3       | 'measure (with mark names)'                               | '6903.37 ± 0.42%'    | '6790.00'           | '146429 ± 0.02%'           | '147275'                  | 144857  |
| 4       | 'clearMarks'                                              | '782.98 ± 0.04%'     | '771.00'            | '1287735 ± 0.01%'          | '1297017'                 | 1277173 |
| 5       | 'clearMeasures'                                           | '792.24 ± 0.03%'     | '781.00'            | '1270847 ± 0.01%'          | '1280410'                 | 1262238 |
| 6       | 'mark + clearMarks'                                       | '5883.69 ± 0.52%'    | '5759.00'           | '172863 ± 0.02%'           | '173641'                  | 169962  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7222.22 ± 0.68%'    | '7021.00'           | '141204 ± 0.02%'           | '142430'                  | 138462  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7234.53 ± 0.34%'    | '7121.00'           | '139600 ± 0.02%'           | '140430'                  | 138227  |

* After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5579.80 ± 0.32%'    | '5479.00'           | '181368 ± 0.02%'           | '182515'                  | 179218  |
| 1       | 'mark (with custom startTime)'                            | '5759.72 ± 0.99%'    | '5648.00'           | '176162 ± 0.02%'           | '177054'                  | 173620  |
| 2       | 'measure (with start and end timestamps)'                 | '6506.38 ± 0.34%'    | '6390.00'           | '155503 ± 0.02%'           | '156495'                  | 153696  |
| 3       | 'measure (with mark names)'                               | '6770.94 ± 0.72%'    | '6620.00'           | '149833 ± 0.03%'           | '151057'                  | 147691  |
| 4       | 'clearMarks'                                              | '785.89 ± 0.07%'     | '771.00'            | '1291356 ± 0.01%'          | '1297017'                 | 1272442 |
| 5       | 'clearMeasures'                                           | '777.98 ± 0.06%'     | '761.00'            | '1303362 ± 0.01%'          | '1314060'                 | 1285383 |
| 6       | 'mark + clearMarks'                                       | '5995.34 ± 1.37%'    | '5779.00'           | '171874 ± 0.03%'           | '173040'                  | 166797  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7040.28 ± 0.57%'    | '6830.00'           | '145289 ± 0.03%'           | '146413'                  | 142040  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7184.43 ± 0.40%'    | '6990.00'           | '141809 ± 0.03%'           | '143062'                  | 139190  |

Reviewed By: huntie

Differential Revision: D77795990

fbshipit-source-id: 97895065ca63f87f1f66710cf7bce97e1255a142
2025-07-07 06:42:23 -07:00
Rubén Norte 34201d8387 Fix Flow types for performance.measure (#52431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52431

Changelog: [internal]

`performance.measure` supports passing mark names as `start` and `end` options, so this fixes the Flow type before fixing the actual implementation.

It also makes it so you can't specify both `end` and `duration`, enforced by the type system.

Reviewed By: huntie

Differential Revision: D77795991

fbshipit-source-id: e89f509c7efc2fa49d17d79bc19bc1d14e007871
2025-07-07 06:42:23 -07:00
Rubén Norte 2edda6d967 Add basic Fantom tests for performance.mark and performance.measure (#52432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52432

Changelog: [internal]

This creates a battery of tests for `performance.mark` and `performance.measure`. For this, it was necessary to add a new method in the native module to mock the current time.

Many of the tests are currently failing, as the API doesn't support all the options or behaviors defined in the spec. They're skipped here and will be re-enabled and fixed in a following diff.

Reviewed By: huntie

Differential Revision: D77795989

fbshipit-source-id: 3ebf18c8ac336df1fb43003a55a4678b52e8982d
2025-07-07 06:42:23 -07:00
Samuel Susla 1c51d6684b Deprecate ShadowNode::ListOfShared and migrate to std::vector<std::shared_ptr<const ShadowNode>> (#52402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52402

changelog: [internal]

Mark ShadowNode::ListOfShared as deprecated and replace most usages throughout the React Native renderer codebase with the explicit std::vector<std::shared_ptr<const ShadowNode>> type. This improves code clarity by making the container type explicit rather than relying on a type alias.

Reviewed By: christophpurrer

Differential Revision: D77651676

fbshipit-source-id: 8c4bd9b8cbbe467384b947ef9e7a4524f2053e36
2025-07-07 06:15:29 -07:00
szymonrybczak 9d63098520 chore: bump @react-native-community/cli* devDependencies to 20.0.0-alpha (#52460)
Summary:
Upgrade `react-native-community/cli` to version 20.

## Changelog:

[INTERNAL] [CHANGED] - Upgrade react-native-community/cli to v20

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

Test Plan: n/a

Reviewed By: huntie

Differential Revision: D77860027

Pulled By: cortinico

fbshipit-source-id: 3eb3942b38091b4216628b94cdf1449838daa8d3
2025-07-07 05:17:07 -07:00
Alex Hunt 9d4d8dcb02 Move BugReporting module out of open source repo (#52425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52425

Changelog:
[General][Breaking] - All `react-native/Libraries/BugReporting` APIs have been removed

Reviewed By: javache

Differential Revision: D77014767

fbshipit-source-id: a074fb952948a58259be66033e1f85e04bacf2de
2025-07-07 05:08:57 -07:00
Alex Hunt caff37df5a Remove internal calls to BugReporting (#52374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52374

Precursor to removing `BugReporting` from React Native's internals.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77014724

fbshipit-source-id: 91cd38fe6c39656573fecdeff18162073df2fb42
2025-07-07 05:08:57 -07:00
Christoph Purrer 7998914471 Remove outdated SampleTurboCxxModuleLegacyImpl (#52412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52412

Changelog: [Internal]

The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.

Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

It is not included in any RNTester app at this time

Reviewed By: cortinico

Differential Revision: D77770455

fbshipit-source-id: 987c9f2b9ab4145a2f6a724aad12d8473957dbe8
2025-07-06 22:35:20 -07:00