Commit Graph

128 Commits

Author SHA1 Message Date
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
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
Riccardo Cipolleschi ec5a98b1f5 Sync React 19.1.1 into React Native (#52887)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52887

Syncs Reac 19.1.1 into React Native.

This commit should contains the fix for:
- React owner stack in React Native
- An issue with React holding shadow node for longer than it needed
- An issue that made `startTransition` not working with React Native.

## Changelog:
[General][Changed] - Bumped React to 19.1.1

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D79096406

fbshipit-source-id: cbb2f846b1f08ba5ff482cfed5aaddc16df075cc
2025-07-29 08:05:38 -07:00
Riccardo Cipolleschi cda32c3119 Fix vulnerabilities in HelloWorld's Gemfile (#52873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52873

Our tooling detected a vulnerability in HelloWorld's Gemfile. This change fixes them.

bypass-github-export-checks

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D79084217

fbshipit-source-id: 7a0c85a0b2e79792c43226f43a19f27414cfee2a
2025-07-28 10:32:44 -07:00
Riccardo Cipolleschi 9d4f6cd6b5 Fix path to react-native for Metro (#52877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52877

We moved the HelloWorld package from `packages`to `private` but we didn't update the path to React Native that is consumed by metro.

This change fixes this.

## Changelog:
[Internal] -

Reviewed By: huntie

Differential Revision: D78493478

fbshipit-source-id: 8795c2963dec036693a73a16c18be381f19e11c4
2025-07-28 10:32:44 -07:00
Rubén Norte 797d14da9e Expose types for benchmark options (#52875)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52875

Changelog: [internal]

This simplifies typing tests.

Reviewed By: christophpurrer

Differential Revision: D79086359

fbshipit-source-id: 683a713e0182f18c9b26e515921d17cf7873aa06
2025-07-28 10:02:25 -07:00
Sam Zhou 209e124340 Apply fix of https://github.com/facebook/react-native/pull/52787 to an inner prettier config (#52881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52881

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D79089990

fbshipit-source-id: 12d5a7defabf877c62113e72099c965351896cf7
2025-07-28 07:28:05 -07:00
Rubén Norte 082db1e0a7 Remove static_hermes_staging variant for Fantom tests (#52861)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52861

Changelog: [internal]

We added this mode recently to support all local Hermes variants, but this doubles the number of build type combinations which regresses test execution time and give us little benefit, so we're removing it.

Reviewed By: rshest

Differential Revision: D79080370

fbshipit-source-id: e1b536427acb98ec01edfd44829e2fef9be9b18d
2025-07-28 06:35:49 -07:00
Rubén Norte 20fc2618d0 Force every output to have a different filename in the same run (#52863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52863

Changelog: [internal]

We're seeing some issues in stress runs for Fantom tests in optimized mode, failing when compiling the bytecode with Hermes. The specific error in the Hermes compiler isn't clear, but this started failing when we changed the folders for output. It's possible that it's due to race conditions in stress runs, where multiple workers are attempting to compile in the same locations.

This forces every output in every runner to be in a different file to prevent these possible collisions.

Reviewed By: rshest

Differential Revision: D79084242

fbshipit-source-id: b4540e2e6c5378c7fc8630ac2fea674e0ef78a14
2025-07-28 06:35:49 -07:00
Andrew Datsenko 627136ee76 Add basic steps in CI (#52225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52225

## Changelog:
[Internal] - Fantom in RN CLI
This diff prepares the RN CI to build and run Fantom Tests

Reviewed By: cortinico

Differential Revision: D70097944

fbshipit-source-id: 163cb3f5204f7e5491f94f2fbebe11b514919cdf
2025-07-25 13:46:35 -07:00
Ruslan Shestopalyuk c5bb31c46e Add 'testWithArg' to Fantom benchmarking API (#52831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52831

# Changelog
[Internal] -

The corresponding `testWithArg` API is similar to the existing `test` one for the Fantom benchmarks, except it would allow to run the same test several times in a parametrized manner, with the set of parameters specified as an array (for now, of numbers).

This allows to easily implement testing patterns such as we have in a View benchmark test, whereas we have a mostly duplicated test body doing a similar thing with 100, 1000, 1500 view component instances etc.

Reviewed By: rubennorte

Differential Revision: D78970312

fbshipit-source-id: 504b7aada648c7213ce698f088ac71d9fde8884b
2025-07-25 08:53:45 -07:00
Rubén Norte 54d5b74bbb Improve stack traces in benchmarks (#52828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52828

Changelog: [internal]

Just a small quality of life improvement. It forces the test functions in benchmarks to have the name of the test case if it's an anonymous function, so it shows better in stack traces.

Reviewed By: sammy-SC

Differential Revision: D78924769

fbshipit-source-id: 9b44a49feaae93ccfa90cc726274f0ea013654b1
2025-07-25 05:47:35 -07:00
Rubén Norte bfe31bad1f Small refactor of how Fantom configs are formatted (#52826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52826

Changelog: [internal]

This is just an intermediate change to simplify how we format Fantom configs, so we can extend it to use other formatting formats (e.g.: short format to use in file names).

Reviewed By: lenaic

Differential Revision: D78924771

fbshipit-source-id: 4886a800a6836dc6a66539b1df079adb6c9c52e1
2025-07-25 05:47:35 -07:00
Rubén Norte 0f7ba79166 Avoid creating too many unnecessary build directories for Fantom bundles (#52788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52788

Changelog: [internal]

Minor change to just create a single output directory for generated JS code in Fantom per Jest run.

Reviewed By: lenaic

Differential Revision: D78808564

fbshipit-source-id: 70e1a60dfcdcc3fc6ee5f08ced1e9c8f8cab2782
2025-07-25 05:47:35 -07:00
Andrew Datsenko 273c2d842d skip bytecode support for hermes (#52767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52767

Changelog: [Internal]
Currently tests that depend on hermes dev bytecode will fail because in OSS this case was not handled. We need to skip them for now before we integrate hermes compiler properly.

Reviewed By: christophpurrer, rubennorte

Differential Revision: D78750791

fbshipit-source-id: 5b55bc9acbd6ee5aad874ad57607325cb1373c2e
2025-07-24 07:23:28 -07:00
Rubén Norte 54d733311d Add validation for environment variables for Fantom (#52779)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52779

Changelog: [internal]

Adds validation for Fantom environment variables at runtime, to catch typos or variables that no longer have an effect.

Reviewed By: rshest

Differential Revision: D78803045

fbshipit-source-id: efb28a4f3fd6a4be35fb525d91fb093a1e88f7e4
2025-07-23 04:41:42 -07:00
Rubén Norte 3c087fc81c Small refactor of Fantom global setup (#52766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52766

Changelog: [internal]

Just a minor refactor so adding more logic that should work both at Meta and in OSS is easier in the next diff

Reviewed By: christophpurrer

Differential Revision: D78741904

fbshipit-source-id: 3abda5d5b7be157bf381e26dad2fd4b064a0f556
2025-07-23 04:41:42 -07:00
Rubén Norte fec6a0adf1 Set displayName for Fantom configuration (#52778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52778

Changelog: [internal]

Jest has an option to select a specific project when running tests:

```
jest --selectProjects fantom
```

But for this to work, a `displayName` option needs to be set in the project configuration. This adds that for Fantom tests (using `fantom`).

Reviewed By: rshest

Differential Revision: D78802516

fbshipit-source-id: 483e7c1450b1f97961e4e43c963fac3ce82cee58
2025-07-23 04:41:42 -07:00
Rubén Norte 130b46c117 Add new environment variables to force CI and debug C++ (#52776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52776

Changelog: [internal]

`FANTOM_FORCE_CI_MODE` is just an explicit way to indicate that we're on CI, so we'd run benchmarks in test mode, for example.

`FANTOM_DEBUG_CPP` is just an alias for `FANTOM_ENABLE_CPP_DEBUGGING` which is unnecessarily long.

Reviewed By: rshest

Differential Revision: D78801918

fbshipit-source-id: 8e60bdd911067c6b0b92be7e90553fd5209c9ca9
2025-07-23 04:41:42 -07:00
Rubén Norte 342b88d0d3 Create new environment variable to force running benchmarks in test mode (#52759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52759

Changelog: [internal]

This introduces a new environment variable for Fantom to disable benchmarks (`FANTOM_FORCE_TEST_MODE`), without having to run in CI mode.

Reviewed By: rshest

Differential Revision: D78672864

fbshipit-source-id: ef445bd8b36703594658529da2436c75d5b87179
2025-07-23 04:41:42 -07:00
Rubén Norte af670c8319 Honor ignored frames in errors reported by Fantom (#52765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52765

Changelog: [internal]

Reported locations for errors in Fantom is wrong, because it seems it's not ignoring "infra" frames.

This was caused by the `stack` property in `ErrorWithCustomBlame` being set on the error objects and shadowing the getter that removes the necessary frames. This fixes that by forcing that property to be deleted.

Reviewed By: christophpurrer

Differential Revision: D78747119

fbshipit-source-id: 81d6ce74041382d7582e2066409e839d28d91052
2025-07-23 04:41:42 -07:00
Christoph Purrer 7b5307d181 Replace ContextContainer::Shared with std::shared_ptr<const ContextContainer> 2/2 (#52750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52750

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D78704833

fbshipit-source-id: 4df0029f6de860c93864e12c479e387f3981f7b5
2025-07-22 12:40:27 -07:00
Christoph Purrer c0eeebbd9d Apply clang-tidy setting: fantorm/rntester (#52731)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52731

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D78634903

fbshipit-source-id: f4ad862061630a098e80a125e25ae3af17b9eb60
2025-07-22 00:48:40 -07:00
Sam Zhou 7970ee9998 Prepare react-native for prettier v3: 2/n (#52745)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52745

Prettier v3 no longer loads plugin implicitly. This diff first configures the hermes-parser plugin explicitly to prepare for v3 rollout. D78590158 missed this config.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D78673890

fbshipit-source-id: 1931718ef2b3f011621bf4d64c8936a698506374
2025-07-21 15:22:17 -07:00
Christoph Purrer a0a77f7476 Make it explicit to specify HttpClientFactoryKey and WebSocketClientFactoryKey values (#52715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52715

Changelog: [Internal]

Right now we rely on compile / link time magic to detect the implementation of
```
WebSocketClientFactory getWebSocketClientFactory();
HttpClientFactory getHttpClientFactory();
```
this actually works until it does not work anymore, see .e.g.:
```
ld.lld: error: undefined symbol: facebook::react::getHttpClientFactory()
>>> referenced by ReactHost.cpp:111 (xplat/js/react-native-github/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp:111)
>>>               xplat/js/react-native-github/packages/react-native/ReactCxxPlatform/react/runtime/__runtimeAndroid__/__objects__/ReactHost.cpp.pic.o:(facebook::react::ReactHost::ReactHost(facebook::react::ReactInstanceConfig, std::__ndk1::shared_ptr<facebook::react::IMountingManager>, std::__ndk1::shared_ptr<facebook::react::RunLoopObserverManager>, std::__ndk1::shared_ptr<facebook::react::ContextContainer const>, std::__ndk1::function<void (facebook::jsi::Runtime&, facebook::react::JsErrorHandler::ProcessedError const&)>, std::__ndk1::function<void (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, unsigned int)>, std::__ndk1::shared_ptr<facebook::react::IDevUIDelegate>, std::__ndk1::vector<std::__ndk1::function<std::__ndk1::shared_ptr<facebook::react::TurboModule> (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, std::__ndk1::shared_ptr<facebook::react::CallInvoker> const&)>, std::__ndk1::allocator<std::__ndk1::function<std::__ndk1::shared_ptr<facebook::react::TurboModule> (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, std::__ndk1::shared_ptr<facebook::react::CallInvoker> const&)>>>, std::__ndk1::shared_ptr<facebook::react::SurfaceDelegate>, std::__ndk1::shared_ptr<facebook::react::NativeAnimatedNodesManagerProvider>, std::__ndk1::function<void (facebook::jsi::Runtime&)>))

ld.lld: error: undefined symbol: facebook::react::getWebSocketClientFactory()
>>> referenced by ReactHost.cpp:117 (xplat/js/react-native-github/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp:117)
>>>               xplat/js/react-native-github/packages/react-native/ReactCxxPlatform/react/runtime/__runtimeAndroid__/__objects__/ReactHost.cpp.pic.o:(facebook::react::ReactHost::ReactHost(facebook::react::ReactInstanceConfig, std::__ndk1::shared_ptr<facebook::react::IMountingManager>, std::__ndk1::shared_ptr<facebook::react::RunLoopObserverManager>, std::__ndk1::shared_ptr<facebook::react::ContextContainer const>, std::__ndk1::function<void (facebook::jsi::Runtime&, facebook::react::JsErrorHandler::ProcessedError const&)>, std::__ndk1::function<void (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, unsigned int)>, std::__ndk1::shared_ptr<facebook::react::IDevUIDelegate>, std::__ndk1::vector<std::__ndk1::function<std::__ndk1::shared_ptr<facebook::react::TurboModule> (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, std::__ndk1::shared_ptr<facebook::react::CallInvoker> const&)>, std::__ndk1::allocator<std::__ndk1::function<std::__ndk1::shared_ptr<facebook::react::TurboModule> (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, std::__ndk1::shared_ptr<facebook::react::CallInvoker> const&)>>>, std::__ndk1::shared_ptr<facebook::react::SurfaceDelegate>, std::__ndk1::shared_ptr<facebook::react::NativeAnimatedNodesManagerProvider>, std::__ndk1::function<void (facebook::jsi::Runtime&)>))
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
The change here makes it explicit and mandatory to set the specific implementations of these interfaces

Reviewed By: lenaic

Differential Revision: D78529932

fbshipit-source-id: f26876683433a58e078d6720f169702c563ed92b
2025-07-20 23:08:03 -07:00
Nicola Corti 9f0903780b Bump monorepo packages to 0.82.0-main (#52706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52706

This just prepares the repo for the next branch cut.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D78558445

fbshipit-source-id: 2132d560dad447b3685874438387a519587f8554
2025-07-18 09:23:10 -07:00
Nicola Corti d89acc1596 Migrate helloworld to use {usesCleartextTraffic} manifest placeholder (#52647)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52647

This removes the need to specify 2 Manifests for apps and we can just use the `main` manifes to toggle if `usesCleartextTraffic` should be enabled or not.

This will have to be replicated in the template repository.

Changelog:
[Android] [Added] - Add support to specify a single Manifest rather than 2 (main/debug) by using the `usesCleartextTraffic` manifest placeholder which is autoconfigured by RNGP.

Reviewed By: cipolleschi

Differential Revision: D78425139

fbshipit-source-id: 9173a014b387d5aed5f7087fa69b7bd49c220f2c
2025-07-18 08:07:54 -07:00
Rubén Norte 532b415960 Throw an error when using an unrecognized @fantom_ prefixed pragma (#52701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52701

Changelog: [internal]

This adds validation for Fantom test file pragmas to avoid ignoring configurations accidentally when introducing typos.

Reviewed By: rshest

Differential Revision: D78550866

fbshipit-source-id: 7123bfb39573adbb1adf417c232cf7d4cae4cd25
2025-07-18 04:19:28 -07:00
Alex Hunt e247be793c Lower minimum Node.js version to 20.19.4 (#52678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52678

From partner feedback, there's still appetite to support Node 20.x for the next <1y of life. Lower min version to `20.19.4` (Jul 2025) and widen test matrix in CI.

Changelog:
[General][Breaking] - Our new minimum Node version is Node.js 20 (Overrides #51840)

Reviewed By: cortinico

Differential Revision: D78494491

fbshipit-source-id: c8d9dc6250cb11f8a12ca7e761b65f4a8dae9265
2025-07-18 03:32:13 -07:00
Andrew Datsenko 46f3e32019 Add support for meta only code & oss only code (#52583)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52583
Changelog: [Internal]
OSS build is broken atm as there is rn-tester dep in Fantom, needed for Meta only purposes.
Platformizing code to allow for Meta only implementation here and also for OSS only. Using this approach over ifdef.

Reviewed By: christophpurrer

Differential Revision: D78275698

fbshipit-source-id: c3234bb61b4591c0a5045fdb84aa0316f6382ecc
2025-07-15 14:16:06 -07:00
Rubén Norte 7dc84491e9 Fix reporting of errors without stack traces (#52601)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52601

Changelog: [internal]

Fixes a bug in Fantom when throwing a value that's not an instance of `Error` in a test.

Reviewed By: javache

Differential Revision: D78332756

fbshipit-source-id: 350479dcb7bcea399070c6851aca76a1d1cc2629
2025-07-15 03:45:28 -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
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
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
Alex Hunt 5fe782a800 Move cxx-api scripts under scripts/, add README (#52467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52467

Moves the WIP `cxx-public-api` project under `scripts/cxx-api/`, add minimal README docs.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D77865490

fbshipit-source-id: ce49845386c468ee7422b864c49f2a8c9eed5a70
2025-07-07 15:04:37 -07:00
Christoph Purrer abfb9cbd40 Update outdated ReactNativeCPP.api (#52475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52475

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77887914

fbshipit-source-id: 1431205eff716bac86610750103df729553d22b9
2025-07-07 14:50:58 -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
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
Christoph Purrer 9d5033afb0 Delete non C++ Turbo Module SampleCxxModule (#52407)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52407

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

Reviewed By: javache

Differential Revision: D77765443

fbshipit-source-id: 112fef4c1a7e1c567f3c1d471728a1dfc926adc6
2025-07-06 19:54:06 -07:00
Ian Childs d2b55ad1ba Use build instead of targets in check-api.sh (#52424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52424

This makes sure the output is actually materialized.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D77793365

fbshipit-source-id: 5505abd0f4c2994f4ced1c27a506d9199f9454ca
2025-07-04 06:17:14 -07:00
Samuel Susla 0e175ce5b6 Mark ShadowNode::Shared as deprecated and replace all usages (#52393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52393

## Changelog:
[General][Deprecated] - ShadowNode::Shared is now deprecated. Use `std::shared_ptr<const ShadowNode>` instead.

- Mark ShadowNode::Shared as deprecated in ShadowNode.h
- Replace all uses of ShadowNode::Shared with std::shared_ptr<const ShadowNode>.

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

Reviewed By: christophpurrer

Differential Revision: D77650696

fbshipit-source-id: b4769e2a1e39f49d14d5927be105487ecf69fa3f
2025-07-04 00:29:54 -07:00
Christoph Purrer ceb5f1dedb Remove unused SharedAttributedString alias (#52362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52362

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77630091

fbshipit-source-id: df297bc5150416b6ddf719addc3ae926e3b39f48
2025-07-02 08:34:21 -07:00
Nicola Corti e20bb56f3b Bump Gradle to 8.14.2 (#52370)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52370

This is just a patch bump of Gradle ahead of the 0.81 branch cut.

Changelog:
[Android] [Changed] - Bump Gradle to 8.14.2

Reviewed By: fabriziocucci

Differential Revision: D77601121

fbshipit-source-id: b2fdc8b022f2ab43997f412c77e0c924c01f1a5d
2025-07-02 04:36:22 -07:00
Nicola Corti b578a70bd5 Bump packages for next release (#52359)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52359

This is needed ahead of the 81 branch cut.

Changelog:
[Internal] - Bump all packages to 0.81.0-main

Reviewed By: huntie

Differential Revision: D77602196

fbshipit-source-id: 1b52a7d1577783d72aba8d20f98032f29ffcc7df
2025-07-02 03:53:34 -07:00
Dawid Małecki b41b924b2d Add diff-api-snapshot action to danger (#52045)
Summary:
This PR connects breaking change detection with a danger bot. The action takes snapshot from main branch and from the PR as inputs to`diff-api-snapshot` (saved in runner temp directory).

## Changelog:
[Internal]

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

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

Reviewed By: huntie

Differential Revision: D76735630

Pulled By: coado

fbshipit-source-id: 9208117340c1e0bf10d58b67892727717d22e62f
2025-07-01 08:58:15 -07:00
Andrew Datsenko ee02152fee Fix non standard hermes config internally (#52321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52321

Changelog: [Internal]
Allow non standard hermes internally.

Reviewed By: lenaic, rubennorte

Differential Revision: D77446774

fbshipit-source-id: 09919c8216932e15b2938d3e99b3df5d53e11c92
2025-06-27 09:47:34 -07:00
Mathieu Acthernoene 09ef774ff6 Add edge-to-edge opt-in support (#52088)
Summary:
This follows https://github.com/facebook/react-native/pull/47554

Compared to the initial proposal, I had to remove the `edgeToEdgeEnabled` property from the root `gradle.properties` and put it in the app `gradle.properties` instead (explaining the `AgpConfiguratorUtils.kt` / `GenerateEntryPointTask.kt` / `ProjectUtils.kt` / `PropertyUtils.kt` changes)

This PR:
- Enable edge-to-edge for `MainActivity` (when `edgeToEdgeEnabled` is set to `true`)
- Disable `StatusBar` `backgroundColor` and `translucent` (when `edgeToEdgeEnabled` is set to `true`)
- Enforce `statusBarTranslucent` and `navigationBarTranslucent` on `Modal` when edge-to-edge is enabled
- Add an `isEdgeToEdge` constant to `DeviceInfoModule` for [`react-native-is-edge-to-edge`](https://github.com/zoontek/react-native-edge-to-edge/tree/main/react-native-is-edge-to-edge) detection

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

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

- [Android] [Added] - Add edge-to-edge opt-in support

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

Test Plan:
- Update `enableEdgeToEdge` value in `packages/rn-tester/android/app/gradle.properties`
- Recompile

https://github.com/user-attachments/assets/4c6beb98-fa88-427c-b62d-a42ffe5330f0

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76834213

Pulled By: alanleedev

fbshipit-source-id: c39b2cff1a5e94e31306e3b35651aa2de83d2fe6
2025-06-27 06:16:23 -07:00
Sam Zhou 505588b9aa Add annotations or make things readonly to prepare for object literal soundness fix in react-native (#52305)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52305

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77386425

fbshipit-source-id: d69184abb1c8f7c516229aafe24dd418b5dd887e
2025-06-26 13:24:24 -07:00
Andrew Datsenko d0770ce425 Introduce isOSS (#52222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52222

Changelog: [Internal]
Introduce environment option to force usage of OSS fantom test runner.
If env is not set - check for BUCK file in tester which is checked in for FB but not for OSS.

Reviewed By: rubennorte

Differential Revision: D77160761

fbshipit-source-id: 1701ff140ff2be1bbeacfb4305e9f89089cacb42
2025-06-26 11:03:20 -07:00