128 Commits
Author SHA1 Message Date
Bartlomiej Bloniarz 16e6e32944 Add pushAnimationMutations to the AnimationBackend (#56401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56401

Add `pushAnimationMutations(Callback)` to the AnimationBackend as a targeted alternative to `trigger()`.

The existing `trigger()` method has two problems:

1. **Blast radius**: It calls `onAnimationFrame()` which invokes ALL registered callbacks. When one animation frontend (e.g. Animated) calls `trigger()` in response to an event, every other frontend (e.g. Reanimated) also spins up unnecessarily.

2. **Broken timestamp on iOS**: `trigger()` uses `std::chrono::steady_clock` which on iOS maps to a different kernel clock than what `CADisplayLink` uses for vsync timestamps. These clocks have different baselines and can diverge over time (e.g. after device sleep), causing animations to see time jumps.

`pushAnimationMutations(Callback)` fixes both issues:
- Executes only the provided callback, not all registered ones
- Uses `AnimationChoreographer::now()` which delegates to `HighResTimeStamp`, providing a timestamp from the same clock as the vsync path on each platform

Also refactors `onAnimationFrame` to use `unpackMutations`/`applySurfaceUpdates` helpers, avoiding intermediate vector/set merging when accumulating mutations from multiple callbacks.

[General][Added] - Add pushAnimationMutations to AnimationBackend for targeted event-driven animation updates

Reviewed By: zeyap

Differential Revision: D100164749

fbshipit-source-id: 53d36ed316614baa835707a45361ae8f3b828d26
2026-04-20 12:40:41 +01:00
Zeya Peng f3f3506245 Add c++ AnimatedModule to DefaultTurboModules (#55729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55729

This is added so that one can easily enables c++ AnimatedModule in open source.

If an app doesn't use `RCTAnimatedModuleProvider`(ios) or `AnimatedCxxReactPackage`(android), it can fallback to this default AnimatedModule when it has both c++animated and shared backend enabled
- shared backend removes the need to pass down start/stop callbacks to NativeAnimatedNodesManagerProvider, so we can cleanly initialize it as static default
  -  RCTAnimatedModuleProvider uses the version of AnimatedModule that still relies on a dedicated CADisplayLink for start/stop
  - AnimatedCxxReactPackage also bundles internal ViewEventModule (for NativeViewEvents) that shares `NativeAnimatedNodesManagerProvider` with AnimatedModule, but NativeViewEvents is not needed for open source
    - Alternatively we could also expose `NativeAnimatedNodesManagerProvider` via UIManager so other turbomodules can also use it. However I don't think it makes sense to double down on another animation API on UIManager given we have shared backend.
- This assumes DefaultTurboModules is always the fallback module provider. So it'll not override when app already uses RCTAnimatedModuleProvider or AnimatedCxxReactPackage

[General] [Added] - Add c++ AnimatedModule to DefaultTurboModules

Reviewed By: NickGerleman

Differential Revision: D94244698

fbshipit-source-id: 09e905eb4bad7d03cdf87d5b47352060b0e6212f
2026-03-09 00:06:21 -07:00
Nick Lefever b2efda00a8 Improve bundling error message formatting (#55794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55794

Format the error messages coming from bundling to mainting the formatting and make these easier to read.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D94611951

fbshipit-source-id: cbb8b2d1ff517b5487d4b799b1e2e3476629f84c
2026-03-01 17:49:19 -08:00
Samuel Susla 1eca581446 Add C++ sampling profiler support with FANTOM_PROFILE_CPP (#55735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55735

changelog: [internal]

Add support for profiling C++ code in Fantom tests using Linux `perf`.

When `FANTOM_PROFILE_CPP=1` is set, the fantom_tester binary is wrapped with `perf record` to capture sampling profiler data with DWARF call graphs.

Usage:
```
FANTOM_PROFILE_CPP=1 yarn fantom --benchmarks --testPathPattern="View-benchmark"
```

Output is saved to `.out/cpp-traces/perf-<timestamp>.data` and can be analyzed with:
```
perf report -i .out/cpp-traces/perf-<timestamp>.data
```

Reviewed By: rubennorte

Differential Revision: D92155573

fbshipit-source-id: bde3ffcd11468e4ad88bec4b547726bed7cbde41
2026-02-27 04:03:13 -08:00
Alex Hunt 703fe8b222 Add module mock for DefaultToolLauncher and apply in tests (#55728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55728

Fixes unwanted side effect launches of the debugger shell in tests (likely introduced in D88161573!).

Also adds error guard on `DefaultAppLauncher` to ensure that the implementation is always mocked.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D94230761

fbshipit-source-id: 966f6f09c38aa55594091bd7d34a5c78dc6eee93
2026-02-26 12:12:16 -08:00
Nick Lefever 017bf1a7f0 Fix asan/tsan env options handling (#55753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55753

The warning "ASAN and TSAN modes cannot be used together" was incorrectly displayed when only ASAN was enabled. This happened because the condition checked only `enableASAN` instead of `enableASAN && enableTSAN`. Updated the conditional logic to properly check that both flags are enabled before showing the conflict warning.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D94393117

fbshipit-source-id: f7a96de11230710e8d54c17d4c89edb569ebaa07
2026-02-25 13:19:50 -08:00
Samuel Susla 89df2e3a75 Fix Buck2 --out permission errors on macOS for claude code (#55736)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55736

changelog: [internal]

On macOS with EdenFS backed directories, Buck2's --out flag fails with "Operation not permitted" error.

This fix works around the issue by:
1. Building to a temp directory outside the repo (os.tmpdir())
2. Removing extended attributes with `xattr -rc` on macOS

Reviewed By: cipolleschi

Differential Revision: D92078500

fbshipit-source-id: 437734c068e4bf20a4f8e570e1184565810154d3
2026-02-25 05:16:09 -08:00
Samuel Susla 677330a6d6 Exclude benchmark tests by default, add --benchmarks flag (#55725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55725

changelog: [internal]

By default, `yarn fantom` now excludes benchmark tests (`*-benchmark-itest.js` files) to speed up regular test runs.

Benchmark tests are typically slower and used for performance analysis rather than correctness testing. Excluding them by default improves the developer experience for everyday test runs.

To run benchmark tests, use the new `--benchmarks` flag:
```
yarn fantom --benchmarks
```

Reviewed By: andrewdacenko

Differential Revision: D92150163

fbshipit-source-id: 4c40ef1ba542c4856221373d8239ba603e8f6620
2026-02-25 03:17:00 -08:00
Samuel Susla 1707d30025 stop standalone Devtools from starting in Fantom (#55713)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55713

changelog: [internal]

when running Fantom on Mac, I frequently see this error. This is DevTools standalone app crashing. Let's disable DevTools standalone app, it is not needed with tests anyway.

 {F1985865132}

Reviewed By: huntie

Differential Revision: D94092247

fbshipit-source-id: 440e4482102b2f4152eb63c04023b01867250213
2026-02-24 09:39:47 -08:00
Bartlomiej Bloniarz b38428c9bc Fix js sync on animation end in Animation Backend (#55566)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55566

In Animation Backend, we allow animation frameowrks to request a js-thread sync of the current animation state. It is used by c++ Animated, and is meant to serve as a way to push animation changes to react through RSNRU, after the animation finsishes. This way we ensure that subsequent rerenders of the component don't bring back the old style value.

This approach is currently broken when the animation performs any main-thread commits, as in this case the `runtimeShadowNodeReference_` is not copied to new node revisions, so the js-thread sync commit cannot use RSNRU properly. The bug was not visible, because we don't clean up the registry in that case, we only do it for react commits.

This PR fixes the issue for the case when `updateRuntimeShadowNodeReferencesOnCommitThread` is enabled, as this fixes the RSNRU propagation, so we can clean-up the registry. If the flag is disabled, we don't cleanup the registry, as we want the next react commit to make sure the animation state is not overwritten.

# Changelog

[General][Added] - test for the Animation Backend js sync
[General][Changed] - TesterAnimationChoreographer changes the thread_local RSNRU flag when running animation update, to better simulate the real application use-case
[General][Changed] - AnimationBackend now cleans-up the AnimatedPropsRegistry after the js sync when `updateRuntimeShadowNodeReferencesOnCommitThread` is enabled

Reviewed By: zeyap

Differential Revision: D93414839

fbshipit-source-id: 1c2566d117c2da563ae35e95cefc5ea08313fc7d
2026-02-19 02:20:47 -08:00
Jack Pope ba4ed28cb0 Add host instance pointer and text node feature flags (#55614)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55614

- enableFragmentRefsInstanceHandles
  - Enables a pointer on each element back to the FragmentInstances that control it. Needed to implement the common IntersectionObserver pattern of reusing IntersectionObservers across multiple callbacks. See more in https://github.com/facebook/react/pull/34935
- enableFragmentRefsTextNodes
  - This should be a noop on RN as unlike dom, text nodes are considered host components and already handled. Text without a `<Text/>` wrapper throws an error.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D93479122

fbshipit-source-id: 639369893c8aafc1d2bf0ffbdf4bf09fe6dca45c
2026-02-18 09:53:41 -08:00
Zeya Peng 4cfb2ee468 enable -DRN_USE_ANIMATION_BACKEND by default (#55266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55266

## Changelog:

[General] [Changed] - enable -DRN_USE_ANIMATION_BACKEND by default

Reviewed By: cipolleschi

Differential Revision: D91056420

fbshipit-source-id: bd8ef6b63a593540688c1af6a25274d047f43f9b
2026-01-23 07:49:20 -08:00
Bartlomiej Bloniarz 2a4a54ae6c Use timestamp from Animation Backend in Animated (#55206)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55206

To avoid timestamp representation bugs with different platforms passing the timestamp as a simple double, we now use `std::chrono::duration<double, std::milli>` to represent timestamps.

# Changelog
[General] [Added] - `AnimationTimestamp` to `UIManagerAnimationBackend`
[General] [Changed] - updated `AnimationBackend` usages to use `AnimationTimestamp`

Reviewed By: zeyap

Differential Revision: D90505538

fbshipit-source-id: 98761ac0060612e9ed9a57c9952656cae70c30f1
2026-01-20 05:26:20 -08:00
Bartlomiej Bloniarz f8564b47fd Move AnimationBackend initialization from Animated (#55103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55103

This diff decouples AnimationBackend from Animated. Now the backend is intialized in the Scheduler, from where it's passed to UIManager. Animation frontends (such as Animated) can then obtain a reference to the backend, and use it to schedule animation frame updates.

# Changelog
[General] [Changed] - Moved AnimationBackend initiailzation to `Scheduler`
[General] [Added] - `AnimationChoreographer` interface with an implementation for fantom tests

Reviewed By: zeyap

Differential Revision: D89663251

fbshipit-source-id: 428a83d78ef92a89095989fe3121c578cf8d3983
2026-01-20 02:28:23 -08:00
Jakub Piasecki 1c63877fec Explicitly enable debugger when building Hermes for Fantom (#55202)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55202

Changelog: [Internal]

After changing Hermes V1 to be the default engine, Fantom tests started failing. This was due to a combination of changes, one of them being the change of default value for `HERMES_ENABLE_DEBUGGER`. In case of legacy Hermes it was enabled by default, while for Hermes V1 it's disabled by default.

Fantom didn't explicitly set this flag, but the debug build of RN (which Fantom performs) requires it to be enabled. This diff explicitly sets this flag to true for Fantom builds.

Reviewed By: cipolleschi, cortinico

Differential Revision: D90849881

fbshipit-source-id: 17f8393872eacef26f927f50aaf364644d9b94d7
2026-01-16 06:42:34 -08:00
Jakub Piasecki 58f9141aec Propagate Hermes V1 opt-in to Fantom (#55157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55157

Changelog: [Internal]

At the moment, Fantom doesn't propagate the Hermes V1 opt-in to the React Native build, which causes the code that should be gated by compile-time flags to be compiled. Since Hermes V1 differs in some cases, the headers there are missing.

This diff adds the opt-in propagation, so the code can be correctly compiled out.

Reviewed By: cortinico

Differential Revision: D90674696

fbshipit-source-id: d2adb131af4588e745c023703a893d0ecaaaee01
2026-01-16 06:42:34 -08:00
Marco Wang 92c32780f1 Transform $ReadOnlyArray to ReadonlyArray 18/n (#55152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55152

We are transforming the following utility types to be more consistent with typescript and better AI integration:

* `$NonMaybeType` -> `NonNullable`
* `$ReadOnly` -> `Readonly`
* `$ReadOnlyArray` -> `ReadonlyArray`
* `$ReadOnlyMap` -> `ReadonlyMap`
* `$ReadOnlySet` -> `ReadonlySet`
* `$Keys` -> `keyof`
* `$Values` -> `Values`
* `mixed` -> `unknown`

See details in https://fb.workplace.com/groups/flowlang/permalink/1837907750148213/.

drop-conflicts

Command:

`js1 flow-runner codemod flow/transformUtilityType --legacy-type='$ReadOnlyArray'`

Reviewed By: SamChou19815

Differential Revision: D90424826

fbshipit-source-id: 207e1abebb50671e8eb2a7f79ecfeaf4569b5b3e
2026-01-13 21:59:05 -08:00
Nicola Corti ebf117ca95 Account for REACT_NATIVE_DOWNLOADS_DIR inside fantom (#55148)
Summary:
Currently Fantom is completely ignoring the `REACT_NATIVE_DOWNLOADS_DIR` env variable that other scripts in the repo are instead honoring. This fixes it.

## Changelog:

[INTERNAL] -

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D90594286

Pulled By: cortinico

fbshipit-source-id: 872a26fc15a2acbe3c0e26035407159c20a9a285
2026-01-13 10:34:10 -08:00
Pieter De Baets bc8970ec9e Fix Hermes opt mode for local mac runs (#55138)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55138

Some tests were failing locally on Mac, since //arvr/mode/mac-arm/opt doesn't correctly undefine REACT_NATIVE_DEBUG. Use `//xplat/mode/hermes/opt` as a short-cut since that directly defines rn_build_mode.

Changelog: [Internal]

Reviewed By: zeyap

Differential Revision: D90536112

fbshipit-source-id: 55aeb78970c9d210206a6d86cd3e57d55b0a6396
2026-01-13 06:40:10 -08:00
Marco Wang 41efc3b588 Transform $ReadOnly to Readonly 38/n (#55067)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55067

Differential Revision: D90146229

fbshipit-source-id: 62733ba51fd0c318140b7a76b499b1a7ac1f7853
2026-01-06 20:23:03 -08:00
Marco Wang 894a1f16ef Transform mixed to unknown in xplat/js (#54954)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54954

We are transforming the following utility types to be more consistent with typescript and better AI integration:

* `$NonMaybeType` -> `NonNullable`
* `$ReadOnly` -> `Readonly`
* `$ReadOnlyArray` -> `ReadonlyArray`
* `$ReadOnlyMap` -> `ReadonlyMap`
* `$ReadOnlySet` -> `ReadonlySet`
* `$Keys` -> `keyof`
* `$Values` -> `Values`
* `mixed` -> `unknown`

See details in https://fb.workplace.com/groups/flowlang/permalink/1837907750148213/.
drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D89581744

fbshipit-source-id: 58a6c246629bbe4fb5c0af447dc002c48e10c342
2025-12-22 12:25:44 -08:00
Marco Wang f41f3bf41f Transform all Flow legacy utility types ($NonMaybeType) to TypeScript-style types in xplat/js (#54935)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54935

We are transforming the following utility types to be more consistent with typescript and better AI integration:

* `$NonMaybeType` -> `NonNullable`
* `$ReadOnly` -> `Readonly`
* `$ReadOnlyArray` -> `ReadonlyArray`
* `$ReadOnlyMap` -> `ReadonlyMap`
* `$ReadOnlySet` -> `ReadonlySet`
* `$Keys` -> `keyof`
* `$Values` -> `Values`
* `mixed` -> `unknown`

See details in https://fb.workplace.com/groups/flowlang/permalink/1837907750148213/.

drop-conflicts

Reviewed By: gkz

Differential Revision: D89494075

fbshipit-source-id: 1bc3e0039dfb5bf04f1860d5098e024fb8491647
2025-12-19 01:35:12 -08:00
Jakub Piasecki 076e6a1d53 Use prebuilt Hermes by default when building Android (#54707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54707

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D87929652

fbshipit-source-id: 439eef5eea9b9203cf2a7b5a8eae38d83e192bd5
2025-12-15 08:13:16 -08:00
Andrew Datsenko eb13ebaaf4 enable render debug strings to opt mode (#54581)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54581

Changelog: [Internal]
This helps us test with opt mode enabled as its the only one available for coverage.

Reviewed By: javache

Differential Revision: D87346884

fbshipit-source-id: 76dcb0848c3d4019739120339dd5b16dd25ef02d
2025-11-23 12:01:55 -08:00
Gang Zhao 11f6ffd139 Add DEFAULT_OSS_HERMES_VARIANT and change DEFAULT_HERMES_VARIANT to use SH internally (#54543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54543

Changelog: [Internal]

We are switching to SH as default, so internally, we need to switch
DEFAULT_HERMES_VARIANT to use SH stable. To keep the tests working in
OSS, we add DEFAULT_OSS_HERMES_VARIANT to use legacy Hermes.

Reviewed By: cipolleschi

Differential Revision: D87082037

fbshipit-source-id: f2fa00d6922816881201d736aeb6591745127d4c
2025-11-17 11:52:11 -08:00
Pieter De Baets 5f69ff704a Rename TurboModuleManagerDelegate to TurboModuleProvider (#54390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54390

Simplify the concepts used. These are provider methods for TurboModules, nothing more.

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D85052393

fbshipit-source-id: 7f972b211196d12156dfd9aa8890d8f7251cdd57
2025-11-04 07:07:16 -08:00
Rubén Norte 9c4601abec Clean up feature flag "enableAccessToHostTreeInFabric" (#54322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54322

Changelog: [internal]

This just cleans up the feature flag, which is set to `true` by default and it's been enabled in `stable` already.

Reviewed By: lunaleaps, yungsters

Differential Revision: D85782127

fbshipit-source-id: 0a6174708066cfe597b4c6dbc8bb33829c6155e9
2025-10-30 08:37:04 -07:00
Nikita Lutsenko 59affc38a6 clang-format | Format fbsource with clang-format 21.
Reviewed By: ChristianK275

Differential Revision: D85317706

fbshipit-source-id: b399c5c4b75252999442b7d7d2778e7a241b0025
2025-10-26 23:40:59 -07:00
Zeya Peng 43f464b218 pass down isAsync arg to start/stopOnRenderCallback to indicate thread (#54252)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54252

## Changelog:

[Internal] [Added] - pass down isAsync arg to start/stopOnRenderCallback to indicate thread

make it more explicit where start/stopOnRenderCallback is invoked so we can handle it on each platform in a more thread safe way

Reviewed By: lenaic

Differential Revision: D85365058

fbshipit-source-id: 5f0ee1343547fe3466fcd23282e0f27e129a2e7d
2025-10-24 11:52:48 -07:00
Rubén Norte e58bbbcd8e Allow passing refs where nodes are expected (#54221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54221

Changelog: [internal]

Small change in the Fantom API to accept refs and reduce boilerplate. See next diff for examples

Reviewed By: javache

Differential Revision: D85143177

fbshipit-source-id: fd65abcc1b107df8726fee172b284f5dc96e88a6
2025-10-21 09:34:49 -07:00
Zeya Peng d2eca58996 use processor flag -DRN_USE_ANIMATION_BACKEND to gate animation backend dep (#54091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54091

## Changelog:

[Internal] [Changed] - use processor flag -DRN_USE_ANIMATION_BACKEND to gate animation backend dep

So it's only enabled for catalyst and fantom when building with BUCK while gated from other meta apps, and enabled by default in oss version

Reviewed By: sammy-SC

Differential Revision: D84157729

fbshipit-source-id: e822f11c4b64b77b17a698bf3b60b5c5a4faf4f4
2025-10-09 19:01:20 -07:00
Bartlomiej Bloniarz 325c681cb1 boostrap shared animation backend (#53994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53994

# Summary

This diff introduces the Shared Animation Backend - a class that can be used by animation frameworks to schedule and run animation updates.

## Changelog:

[GENERAL] [ADDED] - AnimationBackend-itest.js AnimationBackend BUCK/CmakeLists
[GENERAL] [ADDED] - useSharedAnimationBackend feature flag
[GENERAL] [CHANGED] - make AnimatedNodesManager use the backend behind the flag

Reviewed By: zeyap, sammy-SC

Differential Revision: D80809364

fbshipit-source-id: dbfe273362410cdf2f9fc37d78adac7faf4cd118
2025-10-01 04:15:11 -07:00
Vitali Zaidman 3a954caf4f don't require projectRoot in devMiddleware (#53921)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53921

Changelog: [Internal] `devMiddleware` removed the unused option `projectRoot`

This option was used only in a dead branch of the code inside `InspectorProxy`.

The scenario where it appeared was enabling resolving script sources (`Debugger.getScriptSource`) starting with `file://` which were coming from the file system. However, we don't seem to ever point scripts at the filesystem this way.

Reviewed By: huntie

Differential Revision: D82739662

fbshipit-source-id: 9a130eaa83cb94ae0e36a5a1102c56ff8a36cffc
2025-09-24 12:47:24 -07:00
Andrew Datsenko 22002bb70c Allow to disable coverage via flag & disable it for benchmarks (#53912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53912

Changelog: [Internal]
Add new fantom flag `fantom_disable_coverage` to be used in tests that are sensitive to things like memory allocation.
Also disable coverage for any benchmark test.

Reviewed By: arushikesarwani94

Differential Revision: D83070065

fbshipit-source-id: a885e79e3d0c88cfb7adef30cb60ab46a617edac
2025-09-23 13:40:31 -07:00
Andrew Datsenko 2e4da10b52 fix coverage patterns (#53881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53881

Changelog: [Internal]
To make sure that coverage is insertect correctly when run in different metro setup where patterns do not match perfectly, we need to add glob prefix

Reviewed By: sammy-SC

Differential Revision: D82968565

fbshipit-source-id: c2676ef4c774411938039fc5b98a3b953f6ec916
2025-09-22 10:48:45 -07:00
Andrew Datsenko e97ef8f1fb Fix dotslash issue in OD (#53842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53842

Changelog: [Internal]
There is a conflict between dotslash in node_modules and in OD it does not invoke buck2

Reviewed By: javache

Differential Revision: D82724326

fbshipit-source-id: c90cab58818e0245f8763b729c7e5432735eb05e
2025-09-18 07:39:22 -07:00
Andrew Datsenko 10a46f7b52 Add support for JS coverage (#53410)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53410

Changelog: [Internal]
Adding babel-istanbul-plugin to instrument bundle code with coverage reporting.
Metro will transform source code only when coverage flag is set up globally in jest.
Coverage map is then provided by runner as part of test result.

Reviewed By: sammy-SC

Differential Revision: D80716433

fbshipit-source-id: 3831f227f8793f874f0d2366759bb6916e747c72
2025-09-04 07:19:56 -07:00
Andrew Datsenko 42b94fc709 Add babel-plugin-istanbul for code covearage (#53413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53413

Changelog: [Internal]
Add dependency on istanbul plugin so we can collect code coverage.

Reviewed By: christophpurrer

Differential Revision: D80723825

fbshipit-source-id: bf0ac0e49e12ea1b01f72c11362019ef68e09ff9
2025-08-25 10:45:16 -07:00
Marco Wang da9136f587 Turn on null strict comparison check for xplat js (#53379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53379

X-link: https://github.com/facebook/react/pull/34240

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D80648362

fbshipit-source-id: cc47ae207f29a3ddb68bc0e029b8773f89503c52
2025-08-21 16:46:23 -07:00
Jakub Piasecki 776fca1e7c Change hermes atrifact names (#53094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53094

Changelog: [General][Changed] - Changed names of hermes binaries

Reviewed By: cipolleschi, cortinico

Differential Revision: D79163127

fbshipit-source-id: 54be34ba1f6ce90067768394ca9a6e9c4048be90
2025-08-21 04:00:04 -07:00
Rubén Norte 78f089906c Use React Native built-in definitions for Event and EventTarget in Fantom (#53362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53362

Changelog: [internal]

This just replaces the polyfills for `Event` and `EventTarget` that we're defining inline in Fantom with the implementations that already exist in RN.

Reviewed By: javache

Differential Revision: D80612067

fbshipit-source-id: 047c8f12cbb1f4afea2d05a5a1235d9dff2e25f9
2025-08-20 06:01:22 -07:00
Nivaldo Bondança d1a1020a4a Codemod format for trailing commas change
Reviewed By: VladimirMakaev

Differential Revision: D80576929

fbshipit-source-id: 1310f77f5d9d489b780b14875454ebda7f7adfc9
2025-08-19 18:15:18 -07:00
Marco Wang 8351a5d186 Pre-Suppress errors for xplat/js for general strict comparison in non-generated files (#53342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53342

Commands

```
scripts/flow/tool add-comments --comment 'Error discovered during Constant Condition roll out. See https://fburl.com/workplace/4oq3zi07.' .
```
```
arc f
```

drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D80487235

fbshipit-source-id: 9e7c1a2641ddc0da0400fa1aff598b112a0434d5
2025-08-19 01:09:22 -07:00
Sam Zhou cf664c65e2 Standardize subtyping error code into incompatible-type in react native and metro (#53312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53312

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D80400976

fbshipit-source-id: 196af69c0b9621b2a2675b232406639773e04933
2025-08-18 09:04:31 -07:00
Rubén Norte 6b4af382c2 Apply better default options in benchmarks (#53320)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53320

Changelog: [internal]

This improves the defaults the options related to minimum number of iterations and test duration in benchmarks.

If you indicate a minimum duration, we set the minimum number of iterations so the duration is honored. We do the same if what's specified is the number of iterations.

This is useful when you want to make sure all the tests in a benchmark suite use the same number of iterations without having to explicitly set the time to 0 in all of them.

It also changes the default for warmup iterations to be just 1 (that's enough to load all modules and all the code into memory).

Reviewed By: rshest

Differential Revision: D80405287

fbshipit-source-id: 41a61c4d1979db6a25dd30f0c84b5de319416885
2025-08-18 08:57:52 -07:00
Rubén Norte 219fc99e99 Rename minDuration as minTestExecutionTime for clarity (#53321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53321

Changelog: [internal]

Just a rename to make it easier to understand.

Reviewed By: rshest

Differential Revision: D80404378

fbshipit-source-id: 3d7e89797be3b92599e07b4b64d2a720756a4f3b
2025-08-18 08:57:52 -07:00
Rubén Norte 6c37b5b682 Improve typing of benchmark functions (#53322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53322

Changelog: [internal]

This changes the types for benchmark functions to improve safety:
1. It makes the return object be an object instead of an interface, to catch when `overriddenDuration` is misspelled.
2. It makes the function always synchronous, as asynchronous tests aren't supported in Fantom (even though they are in `tinybench`).

Reviewed By: rshest

Differential Revision: D80404121

fbshipit-source-id: c0e2fb9f67174432f50e31c399f5b10cfe098ae6
2025-08-18 08:57:52 -07:00
Rubén Norte 180996683b Print information about benchmark duration (#53323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53323

Changelog: [internal]

This just makes it easier to understand when the benchmark itself has started running and how long the benchmark itself took to run.

Reviewed By: rshest

Differential Revision: D80400268

fbshipit-source-id: b447c4c389d563f7b2b1cbe82822d5d3a93272da
2025-08-18 08:57:52 -07:00
Samuel Susla 3a3e3b884c Move C++ Animated to ReactCommon (#53278)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53278
changelog: [internal]

C++ Animated should be in ReactCommon, it is code shared across all platforms.

Reviewed By: christophpurrer, zeyap

Differential Revision: D80261447

fbshipit-source-id: 8ad5d0bb65c9b499b1d9f60fc8babef8d4d90078
2025-08-18 04:13:13 -07:00
Ruslan Shestopalyuk e3183739bb Options to run Fantom with address and thread sanitizers enabled (#53300)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53300

# Changelog:
[Internal] -

This adds two new modes to Fantom, allowing to run the native (C++) side with enabling either:
* Address sanitizer, which would detect memory overwrites
* Thread sanitizer, which can detect potential threading issues, such  as race conditions

This are opt-in for now.

Currently, both modes already detect different errors, which have a high chance to be real issues and have to be fixed.

Reviewed By: lenaic

Differential Revision: D80339524

fbshipit-source-id: 784ddb9f0af79a04b074e107e4955724d54d5685
2025-08-15 08:12:04 -07:00