Commit Graph

25 Commits

Author SHA1 Message Date
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
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
Rubén Norte 38e1e0de53 Use string references in Fantom native module (#53274)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53274

Changelog: [internal]

Minor refactor

Reviewed By: rshest

Differential Revision: D80255982

fbshipit-source-id: 703f32a1edf5c225b0b07b3c519932ebe167b2c8
2025-08-14 06:19:00 -07:00
Rubén Norte 65974e938c Add support for JS debugging in Fantom (#53215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53215

Changelog: [internal]

This adds a new environment variable to Fantom that allows debugging the JS code in tests.

Usage:

```
FANTOM_DEBUG_JS=1 yarn fantom <test>
```

**Does NOT work in OSS yet**. We need to include a third-party library to send HTTP and WebSocket requests and implement a wrapper on top of it.

Reviewed By: christophpurrer

Differential Revision: D79883372

fbshipit-source-id: d077c373a036033344e61d58274d5cd14028bda4
2025-08-12 05:41:11 -07:00
Zeya Peng 5517c046ab Cache result when RenderOutput::render() is called (#53112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53112

## Changelog:

[Internal] [Changed] - Cache result when RenderOutput::render() is called

Rreviously, root.getRenderedOutput in fantom doesn't really reflect the result of direct manipulation from native animated (see the test case added here). This stack is enabling it.

* make RenderOutput an instance owned by TestMountingManager that can cache render result
  * why is this needed - native animation's direct manipulation should modify the render result (analog to directly manipulating host views on a platform) instead of props on a StubView
* here i also make sure that `RenderOutput::render()` will only re calculate the render result for a tree after StubViewTree::mutate is called

Reviewed By: andrewdacenko

Differential Revision: D79737991

fbshipit-source-id: ee2193b708e319c1519b06bc672054c4f7105da1
2025-08-08 10:54:05 -07:00
Andrew Datsenko 8363a4c515 Add static methods tests (#53087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53087

Changelog: [Internal]
As title

Reviewed By: lenaic

Differential Revision: D79665922

fbshipit-source-id: 024c10960a59e1332aacf2411a68ca85c17142db
2025-08-08 06:00:58 -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 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
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
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
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
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
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
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
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
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
Andrew Datsenko 1e212f91bc Add remaining dependencies (#52202)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52202

Changelog: [Internal]

Build fantom_tester for OSS

Reviewed By: mdvacca

Differential Revision: D76928253

fbshipit-source-id: a95e8751326f45a25cd512b7a5d05260b37a0305
2025-06-24 12:33:59 -07:00
Andrew Datsenko 252e1345bf Move fantom into OSS (#52201)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52201

Changelog: [Internal]

Moving fantom tester into OSS.

Reviewed By: rubennorte

Differential Revision: D76928252

fbshipit-source-id: 3faf4a236eacba17896e0a440bac7a5032d063f9
2025-06-24 07:24:41 -07:00
Andrew Datsenko 386a930afb HermesInstance::createJSRuntime integration (#52111)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52111

Changelog: [Internal]

JSRuntime integration with executor on messagequeue.

Inching closer to full integration with the rest of RN.

Reviewed By: rshest

Differential Revision: D76752667

fbshipit-source-id: 0ef8fe0c615dc1eb45355f7502e01663772ebf13
2025-06-20 07:08:28 -07:00
Andrew Datsenko aeaae4294f Add hermes and jsi (#52060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52060

Changelog: [Internal]

Add hermes and jsi so we can evaluate JS.

Reviewed By: christophpurrer

Differential Revision: D76746362

fbshipit-source-id: a5fbb90d06a8608154b6ae80242b969e7cb03cea
2025-06-17 04:18:08 -07:00
Andrew Datsenko 74b6acb1f0 Add gflags (#52015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52015

Changelog: [Internal]
Add gflags to fantom_tester so we can pass in data like featureFlags

Reviewed By: cortinico

Differential Revision: D76618409

fbshipit-source-id: a18e642a02c405eef972a7418a606a5980253b6a
2025-06-17 04:18:08 -07:00
Andrew Datsenko 05521adbc8 Add react/featureflags (#52003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52003

Changelog: [Internal]
This is a react common dep check that we can build and run tester.

Reviewed By: christophpurrer

Differential Revision: D76531041

fbshipit-source-id: 0a43fdb91aa61f7e6461ff8a94ea6e2732b55dbb
2025-06-13 13:36:39 -07:00
Christoph Purrer fed27e71f8 Use std::format (#51992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51992

changelog: [internal]

Reviewed By: javache

Differential Revision: D76486572

fbshipit-source-id: e0577c067d350c993cffbcb6efd5a240faeca5f6
2025-06-13 08:25:50 -07:00
Tim Yung d6f29c8afd RN: Move {packages => private}/react-native-fantom (#51938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51938

Moves `packages/react-native-fantom` to `private/react-native-fantom`.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76368959

fbshipit-source-id: 8d62f792229c10cd108dc849e8629d3174dc72c1
2025-06-11 23:49:51 -07:00