Commit Graph

38536 Commits

Author SHA1 Message Date
Rubén Norte 5936f29d6a Add test to ensure setUpDefaultReactNativeEnvironment does not access feature flags (#53057)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53057

Changelog: [internal]

This adds a Fantom test to ensure that `setUpDefaultReactNativeEnvironment` doesn't read any feature flags. This prevents catching this as a runtime issue when the feature flag system complains that feature flags were accessed before being overridden, which always would happen if this module read any flags (as it runs before any product code that sets overrides).

Reviewed By: rshest

Differential Revision: D79639890

fbshipit-source-id: 6997609b7bf84947a6da53b58e68f9edd5654912
2025-08-05 13:58:32 -07:00
Rubén Norte 527e308a90 Add private function in feature flags to reset internal JS state for testing (#53056)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53056

Changelog: [internal]

This exposes a utility method in `ReactNativeFeatureFlagsBase` to reset its internal state for testing purposes.

This is intentionally not exposed through `ReactNativeFeatureFlags` to avoid it being used at runtime.

Reviewed By: rshest

Differential Revision: D79639889

fbshipit-source-id: adfb6125d991994c9706d5952d309915fec8f815
2025-08-05 13:58:32 -07:00
Zeya Peng 1f9667effa Make sure props default value is restored when disconnected from animated (#53043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53043

## Changelog:

[Internal] [Changed] - Make sure props default value is restored when disconnected from animated

Reviewed By: sammy-SC

Differential Revision: D79566216

fbshipit-source-id: b23b10101dfac5027cd6d0f0926f6e41b39715ba
2025-08-05 13:28:17 -07:00
Andrew Datsenko a0f93ea879 Add tests for crossOrigin (#53045)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53045

Changelog: [Internal]
Add tests for cross origin headers.

Reviewed By: rubennorte

Differential Revision: D79562333

fbshipit-source-id: ff8705b4e59c89bc48be29767bbdefbba9328534
2025-08-05 12:06:14 -07:00
Riccardo Cipolleschi 83e6eaf693 Prevent users from opting-out of the New Architecture (#53026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53026

This change prevents users from opting out of the New Architecure.

The change is non breaking with respect to building an app: all the functions are still there, even if they are unreachable, in case users will still call them explicitly.
We hardcoded all the values to enable the New Architecture, so there is no way to disable it.

This is a behavioral breaking change, though.

## Changelog:
[iOS][Removed] - Removed the opt-out from the New Architecture.

Reviewed By: cortinico

Differential Revision: D79090048

fbshipit-source-id: 9779bfedf50748d7adbef5f7ef038f469e30efc2
2025-08-05 11:37:24 -07:00
Sam Zhou 01d5eebdb7 Remove random variants of suppress_types that have been fully cleaned up
Summary: Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79652708

fbshipit-source-id: 8027082b0566cca5700d40860272b7683082b275
2025-08-05 11:02:53 -07:00
Alex Hunt 141c95697a Validate max requestable IO.read size (#53063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53063

Update `IO.read` CDP method handler to validate the received `size` parameter.

This now accepts a max value of 10MB — adding a layer of safety in front of our current Android implementation, which fails at around ~15MB due to OkHttp limits.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D79646155

fbshipit-source-id: c777802105dc31cdcc7e9e960c880e689540fddd
2025-08-05 10:09:19 -07:00
Peter Abbondanzo 0f0a3cfce2 Provide ReactContext to experimental JSTouchDispatcher method (#53003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53003

The new `onChildStartedNativeGesture` method accepts a nullable `ReactContext` value for the purpose of flushing active touch events. This change updates all callsites of that method to pass a `ReactContext`

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D79258727

fbshipit-source-id: 7b2950f514295dbe26822442c98079b8121cb3bf
2025-08-05 09:42:36 -07:00
Devan Buggay 551af31871 Update debugger-frontend from a7e4f59...7dcbddd (#53047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53047

Changelog: [Internal] - Update `react-native/debugger-frontend` from a7e4f59...7dcbddd

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/a7e4f59675edbda995b0cb0d40f277a59a3baebf...7dcbddd636137a9604d69a99cc69221216cd4be6).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [7dcbddd63](https://github.com/facebook/react-native-devtools-frontend/commit/7dcbddd63) | sbuggay (sbuggay@gmail.com) | 2025-08-04T13:54:27-07:00 | [Add landingView query param enabling view focus on launch (#197)](https://github.com/facebook/react-native-devtools-frontend/commit/7dcbddd63) |

Reviewed By: huntie

Differential Revision: D79590789

fbshipit-source-id: 1868506dd401361a9843f24e67ffce9c6a5ffb64
2025-08-05 08:36:40 -07:00
Ruslan Shestopalyuk 8ef39b491c Implement benchmark comparison of different feture flag configurations (#52925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52925

# Changelog:
[Internal] -

This adds an extra "ranking" report when running Fantom benchmark vs different React Feature flag configurations.

It can be very useful when implementing some particular optimization, to streamline the before/after comparison wit this optimization enabled/disabled.

Reviewed By: andrewdacenko

Differential Revision: D79269601

fbshipit-source-id: f29e761e313d6857e5b3ac65faf2a387a84be9df
2025-08-05 08:34:35 -07:00
Rubén Norte 664f7c0dcf Add test to verify that components like View and Text are not loaded as a side-effect of environment initialization (#53053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53053

Changelog: [internal]

This adds a Fantom test to ensure that setting up the RN environment doesn't trigger the initialization for React components like View and Text, which should be lazy loaded when necessary.

Reviewed By: rshest

Differential Revision: D79636160

fbshipit-source-id: ef1fbd6cd531eb7082dce000ba74a5eed451e259
2025-08-05 07:06:24 -07:00
Rubén Norte 14c869cee6 Reduce side-effects of AppRegistry (#53054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53054

Changelog: [internal]

We eagerly require `AppRegistry` from environment initialization (`InitializeCore`) because it has some side-effects that are necessary for error reporting (see https://github.com/facebook/react-native/issues/34649 and https://github.com/facebook/react-native/pull/34650), but this change makes a lot of modules to be eagerly initialized.

This reduces that to avoid loading modules that not necessary for environment setup, which allows us to do things like setting up feature flags before modules like `View` and `Text` have been initialized.

Reviewed By: rshest

Differential Revision: D79636159

fbshipit-source-id: a3f1e0db3dd69112ceef3ea339167694e2457454
2025-08-05 07:06:24 -07:00
Andrew Datsenko dc322d91d2 Add ImageSource debug convertions (#53042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53042

Changelog: [Internal]
Add debug convertions for ImageSource.

Reviewed By: rubennorte

Differential Revision: D79561513

fbshipit-source-id: f48d640d78b34a6e72d120f41f1f32ab963d1069
2025-08-05 07:05:54 -07:00
Andrew Datsenko e9fdb23ed2 Test blurRadius (#53037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53037

Changelog: [Internal]
Add `blurRadius` test.

Reviewed By: rshest

Differential Revision: D79552155

fbshipit-source-id: 710b2f328857a32ecb0db00c36f3eedabe74a249
2025-08-05 07:05:54 -07:00
Andrew Datsenko d58601b59f Add base public API tests (#53040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53040

Changelog: [Internal]

Add base public API integration tests for Image component.

Reviewed By: rubennorte

Differential Revision: D79551685

fbshipit-source-id: 467d3573102675f4ad1e3757894795b0ad9a8413
2025-08-05 07:05:54 -07:00
Rubén Norte b903ed7940 Add support for JS sampling profiler (#52827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52827

Changelog: [internal]

This adds **support for creating Hermes/JS sampling profiler traces in Fantom**, which is especially useful when running benchmarks.

Usage:
```
FANTOM_PROFILE_JS=1 yarn fantom Animated-benchmark
```

Output:

 {F1980642216}

After this, the trace is fully symbolicated.

Can be opened directly in Google Chrome:
{F1980642229}

Or in the built-in viewer in VSCode:

 {F1980642242} {F1980642240} {F1980642241}

When collapsing frames in the Flame Chart viewer in VSCode, we can quickly identify opportunities for optimizations.

This also supports multi-config environments. In that case, trace file names are created using a short representation of the configuration.

User guide for benchmarks in Fantom, including how to use this, will be done in a future diff.

NOTE: This still doesn't work in OSS because we don't support optimized mode there. In dev mode, there's a segmentation fault coming from this line: `hermesRuntime->sampledTraceToStreamInDevToolsFormat(fileStream)`

Reviewed By: sammy-SC

Differential Revision: D78905646

fbshipit-source-id: 382ddd5034db601309bd118cedde2fe0d57fde98
2025-08-05 05:36:26 -07:00
Rubén Norte 064750daa8 Improve type safety of constants passed from runner to runtime (#53034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53034

Changelog: [internal]

This is just a refactor to make sure that the constants we pass from the Fantom runner to its runtime are correct by using Flow to typecheck it.

Reviewed By: andrewdacenko

Differential Revision: D79565574

fbshipit-source-id: cbbab9cdec5ef5b3c82b929b8939c76c0ef41823
2025-08-05 05:36:26 -07:00
Nicola Corti 36bdd7b9cb Remove unused ReactSafeAreaViewShadowNode (#52985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52985

This class is essentially a wrapper of LayoutShadowNode with no extra logic added.
Let's remove it.

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D79450688

fbshipit-source-id: 943e10e602cb9a5b77fca81e11d2333828b27813
2025-08-05 05:16:57 -07:00
Nicola Corti d5d21d0614 Remove possibility to newArchEnabled=false in 0.82 (#53025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53025

It's now time to say goodbye to the Legacy Architecture :')

This change hardcodes the `newArchEnabled` property to true, and warns the users
if they're attempting to set it to false.

Changelog:
[Android] [Breaking] - Remove possibility to newArchEnabled=false in 0.82

Reviewed By: cipolleschi

Differential Revision: D78560296

fbshipit-source-id: ccfc45d2f7f21cc20e063cb901d76be3d41458d6
2025-08-05 05:11:12 -07:00
Rubén Norte de5093c887 Add test for MemoryInfo (#53052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53052

Changelog: [internal]

Adds a test for `performance.memory`.

Reviewed By: hoxyq

Differential Revision: D79633246

fbshipit-source-id: 8f9df0219de6c04c8be75af4c9d03576a8164ea9
2025-08-05 03:46:35 -07:00
Sam Zhou 6b354155ed Replace $FlowFixMe(Props|State|Empty) with just $FlowFixMe (#53002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53002

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79524515

fbshipit-source-id: 18b96538a62c7ae5912b1e89d2b50c1420c7eaf5
2025-08-04 11:43:00 -07:00
Rubén Norte 21bccda26c Remove PerformanceEntryReporter::getCurrentTimeStamp (#53030)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53030

Changelog: [internal]

Removes `PerformanceEntryReporter::getCurrentTimeStamp` in favor of `HighResTimeStamp::now`, to make the source of truth more explicit.

Reviewed By: hoxyq

Differential Revision: D79560370

fbshipit-source-id: 0ccf2bf511781d3c47c6ddb4dd7f2061aab152b5
2025-08-04 11:21:03 -07:00
Rubén Norte 7c1c833ee9 Remove redundant methods to mock timers from PerformanceEntryReporter and NativePerformance (#53028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53028

Changelog: [internal]

Now that we have mocking at a more fundamental level (`HighResTimeStamp` API) we can replace other timing mocks with that one.

This does it for `PerformanceEntryReporter` and the `NativePerformance` module.

Reviewed By: hoxyq

Differential Revision: D79557640

fbshipit-source-id: 86579b8bb586190ab7cc8721f30e60b3ef789798
2025-08-04 11:21:03 -07:00
Rubén Norte 2658e21a62 Make test for LongTasks API deterministic and re-enable on Github (#53018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53018

Changelog: [internal]

This makes the test for LongTasks API use the new API for mocking timers in Fantom to make it deterministic, and re-enables it on Github.

Reviewed By: rshest

Differential Revision: D79554724

fbshipit-source-id: 984c66ecd7c20eb972ba1e6b19944532acb82246
2025-08-04 11:21:03 -07:00
Rubén Norte f2e72c3859 Implement HighResTimeStamp mocking in Fantom (#53019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53019

Changelog: [internal]

This adds support for mocking `HighResTimeStamp` values in Fantom tests via a new `Fantom.installHighResTimeStampMock` function.

See new tests for more details on how it works.

Reviewed By: rshest

Differential Revision: D79554723

fbshipit-source-id: 8b0fb292948be118c7616fde1a8a84014af82de8
2025-08-04 11:21:03 -07:00
Rubén Norte f1cf4894ff Allow mocking HighResTimeStamp in debug builds (#53020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53020

Changelog: [internal]

This adds a new feature to `HighResTimeStamp` to set a custom timestamp provider for "now" that can be useful for testing, only in debug builds to avoid potentially regressing performance.

Reviewed By: hoxyq, rshest

Differential Revision: D79554725

fbshipit-source-id: c325d05999b9e2d69f769b61f15c763446777a0a
2025-08-04 11:21:03 -07:00
Rubén Norte 8dc162a56a Small refactor of HighResTimeStamp (#53021)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53021

Changelog: [internal]

Moving the logic to set the default value for `HighResTimeStamp` to a shared function, to simplify further changes.

Reviewed By: rshest

Differential Revision: D79554726

fbshipit-source-id: cd0d4567ef63d386d28e0325203169323e97b207
2025-08-04 11:21:03 -07:00
Fabrizio Cucci 893730633c Use buttonState to distinguish ACTION_DOWN and ACTION_HOVER_EXIT (#53033)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53033

This diff replaces the logic introduced in D72078450 to prevent `onPointerEnter`/`onPointerLeave` from firing when a button is pressed. The new approach trades off some complexity for reliability: instead of deferring `ACTION_HOVER_EXIT` handling to the next frame, we now suppress it immediately if any button is pressed (`buttonState != 0`). This simpler logic appears to work reliably on Quest devices, though it may behave differently on the Android emulator (something we’ll monitor).

The main reason for this change is that deferring ACTION_HOVER_EXIT introduces problems in newer Spatial React use cases, particularly when a single component hierarchy spans multiple roots. For example, when hovering between ReactSurfaceRoot and another root like VolumetricWindow, deferring ACTION_HOVER_EXIT can lead to incorrect enter/exit ordering:

* Cursor starts hovering over `ReactSurfaceRoot`
* Cursor moves to `VolumetricWindow`
* `ACTION_HOVER_EXIT` (`ReactSurfaceRoot`) — deferred
* `ACTION_HOVER_ENTER` (`VolumetricWindow`) — processed
* `ACTION_HOVER_EXIT` (`ReactSurfaceRoot`) — processed (too late)

This results in inconsistent hover state updates across roots, which this diff resolves by handling `ACTION_HOVER_EXIT` immediately when appropriate.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D79504775

fbshipit-source-id: ea97bff48ddf4d3d09caf56ca29057c202b12409
2025-08-04 11:10:10 -07:00
Mateo Guzmán d547d9e56e Kotlin: redundant unit return type [1/2] (#52993)
Summary:
Fixing some warnings from static code analysis regarding [redundant unit return type](https://www.jetbrains.com/help/inspectopedia/RedundantUnitReturnType.html).

## Changelog:

[INTERNAL] - Kotlin: redundant unit return type [1/2]

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

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

Reviewed By: cortinico

Differential Revision: D79546007

Pulled By: rshest

fbshipit-source-id: 017cb3b70333fe652ecb1bdca751fa4f56f737fd
2025-08-04 11:04:51 -07:00
Alex Hunt e39fd8f79c Fix mimeType parsing for CDP responses (#53027)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53027

Tweaks MIME type parsing in CDP Network messages, now matching Chrome.

This fixes response preview behaviour by the frontend for text response previews that are `base64Encoded` 🙌🏻 (we were observing these for JSON `fetch` calls on iOS).

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D79559495

fbshipit-source-id: 2565af7587fc6fbdd3ef6fcbb10c558341ddfbdc
2025-08-04 10:29:37 -07:00
Alex Hunt fa66e314b2 Implement Network.loadingFailed (#53023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53023

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D79555222

fbshipit-source-id: bfbe36edc867b1fc7a44d8e998489ef1d8896331
2025-08-04 10:04:02 -07:00
Alex Hunt ea50245e1e Update InspectorNetworkReporter to avoid overhead for CDP-only methods (#53022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53022

Following D77799617, D77927896, updates `InspectorNetworkReporter.kt` to check `isDebuggingEnabled` internally and avoid work/communication over the JNI layer — to minimise impact on the Android Network stack.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D78004462

fbshipit-source-id: 2bea2ee0592d68d1cb330ac82e8b3b227b54a675
2025-08-04 10:04:02 -07:00
Nolan O'Brien 323fe3a5d4 Fix exhaustive switches (#53032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53032

## Changelog:

[General][Fixed] - Add default cases to switch statements in headers

Differential Revision: D79148595

fbshipit-source-id: e7260b5e9356b60b238b9f75ab1809fbbbbbeaf4
2025-08-04 09:42:15 -07:00
Samuel Susla 0f912f8312 make ivars in NativeAnimatedNodesManager const (#53015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53015

changelog: [internal]

marking a few fields as const to prevent accidental change.

Reviewed By: rshest

Differential Revision: D79443448

fbshipit-source-id: 32a44f7f0c43c240879c77058ef6672885488191
2025-08-04 08:57:06 -07:00
Ruslan Shestopalyuk d03151f561 Mitigate "Feature flags were accessed before being overridden" error (#53031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53031

# Changelog:
[Internal] -

This partially reverts https://github.com/facebook/react-native/pull/52905, as in some configurations we don't appear to be able to use RN feature flags on the module level.

The usage is removed for now to unbreak the builds, with a follow up to resolve it in an adequate manner.

Reviewed By: hoxyq

Differential Revision: D79562056

fbshipit-source-id: 45bd896d572ff926a4c2dfa98334bf998718d86b
2025-08-04 08:47:18 -07:00
Riccardo Cipolleschi 75e04b8c41 Add documentation for updating the issue triage oncall
Summary:
This Diff simply adds some docs on how the secret must be formatted, and removes a print that would expose the triager IDs is anyone would look at the logs (not a big deal given that the ids are public on Discord, though).

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D79556988

fbshipit-source-id: 23d6e72141dff4e91242cc1d9f5b95ebaf5ca858
2025-08-04 08:28:48 -07:00
Peter Abbondanzo 1828c53f85 Emit scroll end events when fling animator completes (#52989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52989

Adds a call to `NativeAnimatedModule`'s `userDrivenScrollEnded` method whenever a scroll event completes a smooth scroll animation. This is necessary in cases where Animated events control any layout properties of children and we need to force the shadow tree to resync with the native tree. For example, if a scroll view's child transforms its scale based on the scrollX or scrollY properties and the user triggers a `scrollToOffset` or `scrollToIndex` call, we don't update the layout of that child until the next state change.

Changelog: [Android][Fixed] - Fixed an issue where shadow tree and native tree layouts mismatch at the end of a scroll event

Reviewed By: sammy-SC

Differential Revision: D79464176

fbshipit-source-id: fee5f1c522714dbcddf8836de291c05d10e6e90e
2025-08-04 08:19:16 -07:00
Nicola Corti ea1aff455a Make ReactCxxErrorHandler internal (#53024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53024

This class is Legacy Arch and is not used in OSS. Let's make it internal.

Changelog:
[Internal] [Changed] -

Reviewed By: RSNara

Differential Revision: D79556615

fbshipit-source-id: d157fe8f04784038d64657c6d240b0c51e41d82d
2025-08-04 07:51:30 -07:00
Ruslan Lesiutin dd7ab0f833 forward fix tests after changes to PerformanceTracer (#53016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53016

# Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D79554532

fbshipit-source-id: 83e68f714974083238f97e2ef1affa6dee3b116f
2025-08-04 06:34:45 -07:00
Ruslan Lesiutin bfd6c6d8fc fix: removed constexpr from now() (#53014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53014

# Changelog: [Internal]

This doesn't make sense, I've probably overlooked it while applying this to other methods.

Reviewed By: rubennorte

Differential Revision: D79552990

fbshipit-source-id: a7dc428dfcc86a08a9e52655f9878795b8e58c1c
2025-08-04 06:03:41 -07:00
Rubén Norte 2016118aeb Centralize path definitions for Fantom builds and move to .out (#52829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52829

Changelog: [internal]

Just a small refactor to move the definitions of output paths to a specific module. We'll add more to this in a latter diff.

Reviewed By: sammy-SC

Differential Revision: D78905645

fbshipit-source-id: 011e6cec13396301dad8e76400b6f2b9e13568f0
2025-08-04 05:56:51 -07:00
Rubén Norte 6760383470 Create source maps for Fantom lazily (#52786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52786

Changelog: [internal]

It takes around 300ms to generate each source map file, and we really only need them if tests throw errors. Requesting source maps also increases contention to access the Metro server from each test worker.

This refactors the code so we only generate them in that case, which could save up to 20s in test execution time.

Reviewed By: rshest

Differential Revision: D78807672

fbshipit-source-id: af9f0f0377ddcf05014b5aca0b28db938dfb4ce2
2025-08-04 05:56:51 -07:00
Rubén Norte 5c2b9eda69 Refactor runner to use a single instance of Metro for each run (#52777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52777

Changelog: [internal]

This significantly speeds up test execution in Fantom (around 2x in OSS and 6x at Meta) by starting a Metro server before all tests runs and reusing it across all tests to build test bundles, instead of spinning up a new Metro instance every time we run each test.

The architecture change (also considering the previous change in buck prebuilds) looks like this:
{F1980689532}

This is how is impacts execution times (compared to the baseline):
* OSS
  * Before: 62s {F1980564286}
  * After: 30s (**2x faster**) {F1980564265}

Reviewed By: andrewdacenko

Differential Revision: D78741903

fbshipit-source-id: b209f88925e49cc2a2067e8df9b7fa9a29b4c8d2
2025-08-04 05:56:51 -07:00
Rubén Norte 3ecd48fa91 Refactor Fantom runner to decouple compilation from execution to speed up test execution (#52758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52758

Changelog: [internal]

This is a change to how Fantom tests run in Meta infra via Buck.

After this, the biggest opportunity will be optimizing how we generate bundles with Metro.

Reviewed By: christophpurrer

Differential Revision: D78672863

fbshipit-source-id: 1152907f3ba60e7d2e48bcc588f3c07aef7bb393
2025-08-04 05:56:51 -07:00
Ruslan Shestopalyuk f047c9b42b Remove props that set by default for Text component on JS side (#52905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52905

Similarly to [this PR](https://github.com/facebook/react-native/pull/51225), we do it for the Text component now: we don't set any non-default value props (most prominently, the accessibility ones) before passing this to native.

This saves bandwidth and potentially improves the prop parsing time, which existing Fantom benchmarks do confirm.

This is implemented behind a feature flag, which is false by default (will use it to run an experiment before rolling out).

**NOTE:** This implementation forks the whole text component, as suggested by rubennorte, in order to isolate the changes and with the ultimate goal of removing the old version once the experiment is concluded.

## Changelog:
[Internal] - Text no longer sets any default accessibility props, which should not result in visible changes in behaviour but may affect snapshot tests.

Reviewed By: rubennorte

Differential Revision: D79177652

fbshipit-source-id: a39430464fd5edec953b4c91be7ef9620ebd75ac
2025-08-04 05:29:19 -07:00
Nicola Corti c37f3ed8c6 Remove unnecessary ReactNoCrashBridgeNotAllowedSoftException (#52987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52987

This class is unnecessary. Is also public for no real reason.
Instead we should use `ReactNoCrashSoftException` directly.

I'm not marking this as breaking as users hsould not be catching this class.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D79451567

fbshipit-source-id: 4d6f45b3006c79969fcf141002d34a72bf88901a
2025-08-04 04:50:59 -07:00
lukmccall 2f46a49b8d Fix ReactHostImpl.nativeModules always returning an empty list (#52986)
Summary:
During the Expo QA process, we discovered that `ReactContext.reactApplicationContext.nativeModules` always returns an empty list (https://github.com/expo/expo/blob/4e2bbb23edda74d0e24756fd1735b8763e38f7a7/packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/ReactExtensions.kt#L12). This happens because, during object creation, the `reactInstance` is always null.

## Changelog:

[ANDROID] [FIXED] - Fix `ReactHostImpl.nativeModules` always returning an empty list

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

Test Plan: - RN tester compiles 

Reviewed By: mdvacca

Differential Revision: D79451613

Pulled By: cortinico

fbshipit-source-id: d5341bcc1193eb948db4e99f16ba32a63073a6db
2025-08-04 04:46:56 -07:00
Mateo Guzmán f273c63d37 Kotlin: obvious explicit type (#52990)
Summary:
Fixing some warnings from static code analysis regarding [obvious explicit type](https://www.jetbrains.com/help/inspectopedia/RedundantExplicitType.html#locating-this-inspection).

## Changelog:

[INTERNAL] - Kotlin: obvious explicit type

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

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

Reviewed By: cortinico

Differential Revision: D79546014

Pulled By: rshest

fbshipit-source-id: 1b66edde3185911b137e2c77673779cc613fae74
2025-08-04 04:28:50 -07:00
Rubén Norte b708d2da61 Disable LongTasksAPI on Github CI (#53009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53009

Changelog: [internal]

This disables the test for LongTasks API on Github CI as the execution speed there is unreliable and makes the current tests flaky.

This happens because the test is timing dependent, but the alternative would be to mock some core behaviors that I think might be even worse.

Reviewed By: cortinico

Differential Revision: D79510480

fbshipit-source-id: 277e42e36aa6dfebf4745d094541a667f58a0996
2025-08-04 03:54:58 -07:00
Rubén Norte 4289cff268 Add isOSS to Fantom constants (#53010)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53010

Changelog: [internal]

Exposing this value so we can disable some tests in some scenarios in a following this.

Reviewed By: cipolleschi

Differential Revision: D79510481

fbshipit-source-id: 632d9a008943ed40c24878b5561065b6ede1d689
2025-08-04 03:54:58 -07:00