Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53097
# Changelog:
[Internal] -
This makes the benchmark results comparison printout, added in https://github.com/facebook/react-native/pull/52925, be done in a tabular form, so it's easier to read and copy/paste around.
Reviewed By: lenaic
Differential Revision: D79728695
fbshipit-source-id: 4dfc999ad4a9a8c2d67efdfce11aff75383cf645
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53071
Changelog: [internal]
The current API to take JS heap snapshots has some problems:
1. Ergonomics: it requires you to input the filepath where you want to store the snapshot. This isn't aligned with the behavior we have for JS traces where the output path is provided to you.
2. It doesn't work in optimized builds, as it requires a specific option in Hermes.
For 1), this replaces `Fantom.saveJSMemoryHeapSnapshot(filePath)` with `Fantom.takeJSMemoryHeapSnapshot()` that outputs the snapshot in a predefined path and prints it to the console.
For 2), this adds a new environment variable to force building Hermes with memory instrumentation (`FANTOM_ENABLE_JS_MEMORY_INSTRUMENTATION`). This is exposed as an option and not set by default because it has a performance overhead at runtime that we don't want to pay (especially in benchmarks).
This option only works when using Buck in development, because we want to generate this new binary type on demand when necessary, instead of making it part of the prebuilts we do before running tests in OSS and CI.
Reviewed By: lenaic
Differential Revision: D79642314
fbshipit-source-id: a2980616a495bd6dca29c0709a9581db6fb3f2cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53069
Changelog: [internal]
This changes the names of the JS traces from Fantom from using a unix timestamp in the file name to using the ISO date:
- From: `View-itest.js-1754406329686.cpuprofile`
- To: `View-itest.js-2025-08-05T15:05:29.686Z.cpuprofile`
Reviewed By: rshest
Differential Revision: D79646760
fbshipit-source-id: d8a654724c1abc2d3e285ee658c2d390d3241d82
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53091
# Changelog:
[Internal] -
This fixes some excessive printing from the benchmarking results, which happened even if there was no benchmarks ran.
Reviewed By: rubennorte
Differential Revision: D79719026
fbshipit-source-id: 0e75d97ae9c762cab25007bfab5ca8a6dc43e148
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
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
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
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
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
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
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
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
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
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52894
Adds the following boolean pragma modes for more granular control:
```
fantom_native_opt true|false
fantom_js_opt true|false
fantom_js_bytecode true|false
```
Previously these were all set together with `fantom_mode`. These modes are mutually exclusive with `fantom_mode`.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D79151687
fbshipit-source-id: 59c3f20bccb570c0293ffd037609946a1a9bbb8f
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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