Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56527
Removed parameter names from unused parameters in StubWebSocketClient stub implementation to fix clang-diagnostic-unused-parameter warnings. This stub class implements IWebSocketClient interface with empty method bodies, so all parameters were unused.
Changelog: [Internal]
Reviewed By: philIip
Differential Revision: D101110612
fbshipit-source-id: 859d7e630b6f0fd1836c5706a81f05ffd72471f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56541
The Fantom test runner spawns native `fantom-tester` binaries built in
either dev or opt mode based on each test's `fantom_mode` pragma. When
collecting C++ code coverage of the tester binary, however, the build
may switch to a coverage-instrumented build configuration that does not
define `REACT_NATIVE_DEBUG`.
That breaks dev-mode tests that rely on debug-only native APIs. For
example, `installHighResTimeStampMock` in
`private/react-native-fantom/tester/src/NativeFantom.cpp` is gated on
`#ifdef REACT_NATIVE_DEBUG` and throws "Mocking timers is not supported
in optimized builds" otherwise. Tests like `LongTasksAPI-itest.js` (no
`fantom_mode` pragma → defaults to dev) fail in CI coverage runs with
that error.
When invoking buck with coverage enabled, layer the `hermes_build_mode`
constraint on top of the build platform so `rn_build_mode()` (in
`tools/build_defs/oss/rn_defs.bzl`) picks up the right value and adds
`-DREACT_NATIVE_DEBUG` for dev tests.
Reviewed By: fkgozali
Differential Revision: D101832028
fbshipit-source-id: cfb5269dea846f41d9d1f9af1c5ff8bd5828085c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56538
The Fantom Jest `globalSetup` builds the `fantom-tester` native binaries
upfront, using `globalConfig.collectCoverage` to decide whether to build
the `-coverage` flavor.
However, `runner/coverageUtils.js`'s `shouldCollectCoverage()` returns
`false` for some tests even when `globalConfig.collectCoverage` is true:
- All benchmarks (filename matches `*Benchmark-itest.*`)
- Tests with the `fantom_disable_coverage` pragma
In CI coverage runs, those tests resolve their tester binary path with
`enableCoverage=false` (e.g. `fantom-tester-statichermesstable-opt`),
but `globalSetup` only built the `-coverage` variants, so spawn fails
with `ENOENT` and the test fails with an empty stdout/stderr and exit
code `-2`.
When `enableCoverage` is true, also build the non-coverage tester
variants so coverage-opt-out tests can find their binary.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D101819861
fbshipit-source-id: e82f7c8c548c9477d214e9265c813bf9b54ab141
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56531
Add a section to the Fantom `__docs__/README.md` that recommends running the full suite locally with `FANTOM_FORCE_CI_MODE=1`. In CI mode, `globalSetup` pre-builds the entire `(hermesVariant × enableOptimized)` binary matrix once up-front and per-test buck2 invocations are skipped, which eliminates buck2 daemon contention from the worker pool — a common source of sporadic build failures when many workers race to build different binary variants at the same time.
CI environments (`SANDCASTLE`, `GITHUB_ACTIONS`) already auto-detect this mode; this just documents it for local use.
Changelog: [Internal]
Reviewed By: andrewdacenko
Differential Revision: D101795648
fbshipit-source-id: 984bc8bfd034347b5aee0ff438b037e5eb9d41a8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56530
Each Fantom test writes a unique `\-<test>.js` entrypoint into
`.out/js-builds/` and then asks Metro to bundle it. Metro's file watcher
(metro-file-map's `FallbackWatcher` on Linux, debounced 100 ms) does not
always observe the new entrypoint by the time the HTTP request arrives,
especially when multiple workers are writing entrypoints concurrently.
The previous retry logic was too narrow:
- Only HTTP 404 was treated as retryable. Metro returns 404 only when the
entry file path itself can't be resolved; an unresolved transitive
dep (e.g. `setUpDefaultReactNativeEnvironment`) returns HTTP 500 with
`{type: 'UnableToResolveError'}` — we'd throw immediately on that.
- Only 3 attempts with a flat 500 ms wait (~1 s total), which is not
enough on a busy host with 8 workers writing entrypoints at once.
This results in ~30 spurious "Failed to request bundle from Metro: Unable
to resolve module ..." failures per run.
Refactor `createBundle` into a focused `fetchBundleWithRetry` helper that:
- Parses Metro's JSON error envelope (`{type, message, ...}` from
`formatBundlingError`) once per response and uses `type` to decide
whether to retry. Retries on HTTP 404, on HTTP 500 with
`UnableToResolveError` or `ResourceNotFoundError`, and on transient
`fetch` network errors. All other failures (transform errors, syntax
errors, real config issues) throw immediately so we don't waste seconds
on them.
- Uses exponential backoff (100 ms → 200 → 400 → 800 → 1.6 s, capped at
2 s) with up to 10 attempts (~11 s total worst case).
- Surfaces a clean error message (parsed from the JSON envelope) when
retries are exhausted.
Changelog: [Internal]
Reviewed By: andrewdacenko
Differential Revision: D101791796
fbshipit-source-id: 805ef9bc6e58fce7c1dc10d0cbbb7fdfa1fa24a5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56529
Fantom runs every test through a single shared Metro server (started in
`globalSetup`). Jest's default `maxWorkers` is `numCpus - 1`, so on a
high-core box (e.g. 176 CPUs) ~175 workers fire bundle requests at Metro
concurrently. Each in-flight request makes Metro materialize a full
dependency `Graph` (transformed modules, source maps, inverse-deps,
file-watcher subscription), which is hundreds of MB.
The per-test `DELETE` eviction added in D101652820 only releases that
memory after the bundle response completes, so the simultaneous in-flight
set still blows past the previous Node `--max-old-space-size=8192` ceiling
in `scripts/fantom.sh` — the Metro process aborts with
`FATAL ERROR: Ineffective mark-compacts near heap limit` after just a
handful of test suites.
Two coordinated changes that balance throughput and safety:
- `scripts/fantom.sh`: bump the Node heap from 8 GB to 16 GB so we have
headroom over the observed steady-state peak.
- `private/react-native-fantom/config/jest.config.js`: cap `maxWorkers`
at `min(numCpus - 1, 16)`. With 8 workers the heap peaked at ~3 GB
(~400 MB / worker), so 16 workers fits comfortably under a 16 GB cap
with ~40% headroom.
This is intentionally a balance rather than a hard worker cap — bumping
the heap alone would still leave 100+ in-flight graphs racing GC, and
capping workers alone leaves throughput on the table on big machines.
Changelog: [Internal]
Reviewed By: andrewdacenko
Differential Revision: D101791795
fbshipit-source-id: 035c7235c32303f7b7f1eb05698b2a5cba90edc9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56513
Changelog: [internal]
Fantom previously did not propagate errors thrown inside `runTask` callbacks
(or microtasks queued by them) to Jest, so failing assertions inside tasks
were silently swallowed and only logged via `console.error`. Tests had to
work around this with manual `try`/`catch` blocks and a couple of
`it.skip`s with TODOs.
This installs a Fantom-specific global error handler (via `ErrorUtils.setGlobalHandler`)
that captures the first error reported during the current work loop into
`pendingError`. After `flushMessageQueue()` returns, `runWorkLoop()`
re-throws the captured error so it becomes observable as a Jest failure.
Only the first error in a work loop is re-thrown (subsequent ones are
typically follow-on noise), and `pendingError` is cleared at the start of
each work loop so errors captured during module setup do not spuriously
fail later loops. The post-loop `runLogBoxCheck()` continues to take
precedence, since LogBox diagnostics are more actionable.
With this in place:
- The 'should throw when running a task inside another task' test can use
`expect(...).toThrow(...)` directly instead of manual try/catch.
- The two previously-skipped tests for re-throwing errors from tasks and
microtasks are now enabled.
NOTE: this will cause some tests to start failing, but they're legit failures
Reviewed By: javache
Differential Revision: D101647822
fbshipit-source-id: b9cba056d46cc94a4f6dad5e3665266df62a0211
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56464
Changelog: [internal]
Moved the CI validation checks for `debugCpp` and `profileCpp` from the `run()` function in `tester.js` to `validateEnvironmentVariables()` in `EnvironmentOptions.js`, alongside the existing CI/OSS validation for memory instrumentation.
This centralizes all environment option validation in one place, so invalid configurations are caught early during environment setup rather than at tester execution time.
Reviewed By: javache
Differential Revision: D101159820
fbshipit-source-id: 1e488db6e9de3eb3bac840c4931bb1536f8b5efb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56435
Avoid printing the result summary table when benchmarks are executed in
test mode. In test mode, benchmarks run only a single iteration with no
warmup, so the timing results are not meaningful for comparison.
The per-suite results table (console.table) was already skipped in test
mode, but the benchmark result was still reported to the runner, which
could cause the cross-variant comparison table to be printed with
meaningless data. This change skips the reportBenchmarkResult call
entirely when running in test mode.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D100795458
fbshipit-source-id: 910f0aa5615ea07fd19b3703a2774e13b4531743
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.
## Changelog:
[General][Added] - Add pushAnimationMutations to AnimationBackend for targeted event-driven animation updates
Reviewed By: zeyap
Differential Revision: D100164749
fbshipit-source-id: 53d36ed316614baa835707a45361ae8f3b828d26
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56418
Changelog: [internal]
D92150163 excluded benchmark tests by default when running `yarn fantom` without `--benchmarks`. This was incorrect because it means benchmarks could silently break without being caught.
This changes the behavior so:
1. By default (without `--benchmarks`), benchmarks run in test mode (single iteration for correctness only), ensuring they do not break.
2. With `--benchmarks`, benchmarks run in full benchmark mode (multiple iterations for performance measurement).
Also renames `FANTOM_FORCE_TEST_MODE` to `FANTOM_RUN_BENCHMARKS` and `forceTestModeForBenchmarks` to `runBenchmarks` to better reflect the intent (opt-in to full benchmarks rather than opt-in to test mode).
Reviewed By: sammy-SC
Differential Revision: D100464314
fbshipit-source-id: 822cc5a25f0cdddf035616fdddf8619d27ef436a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56423
Changelog: [Internal]
The `FANTOM_BENCHMARK_FILENAME_RE` and `FANTOM_BENCHMARK_SUITE_RE` regexes used the `g` (global) flag, which makes `.test()` stateful — it preserves `lastIndex` between calls. When `getFantomTestConfigs` is called for multiple test files in the same process, the stale `lastIndex` from a previous successful match causes `.test()` to miss the match on the next file, returning `false`. This results in benchmark files intermittently getting the default dev config (`isJsOptimized: false`, `dev: true`), causing them to fail at runtime with "Benchmarks should not be run in development mode".
Removes the `g` flag from both regexes since they are used with `.test()` across different strings and should be stateless.
___
overriding_review_checks_triggers_an_audit_and_retroactive_review
Oncall Short Name: react_native_iroc
Differential Revision: D100603612
fbshipit-source-id: 4eded9b0a59a2343ad44c0c1c2855466e3981b7a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56416
Registers Event, EventTarget and CustomEvent as global polyfills in `setUpDOM.js`. These are standard Web APIs that DOM nodes need access to.
Removes the Event/EventTarget polyfills from the Fantom test setup since they are now provided globally by setUpDOM.js.
Changelog: [internal]
Marking as internal for now, until we ship to stable, even though this isn't gated. We shouldn't communicate this yet.
Reviewed By: javache
Differential Revision: D100462548
fbshipit-source-id: 3e30be760d4f524ca823ebf1320d9a607abeabf9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56257
## Changelog:
[General] [Changed] - move ViewTransition APIs not for react reconciler to its own TurboModule
Move `unstable_getViewTransitionInstance` which is not consumed by react reconciler out of UIManagerBinding into a standalone NativeViewTransition CxxTurboModule, following the NativeDOM pattern. This avoids bloating UIManager with ViewTransition-specific APIs.
Reviewed By: christophpurrer
Differential Revision: D98360009
fbshipit-source-id: 191d0c8cc39fbe1cff87e12ad9a99d5e125b0250
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55879
Float values in debug layout metrics output (used by Fantom test assertions) are
subject to floating-point precision differences across platforms and compilers
(e.g., `66.6667` vs `66.66666412353516`), causing flaky test comparisons.
This changes `toString(const double&)` in `DebugStringConvertible.cpp` to format
floats with 4 decimal places using `snprintf("%.4f")` and strip trailing zeros,
replacing `double-conversion`'s `ToShortest()`. This is debug-only code (guarded
by `#if RN_DEBUG_STRING_CONVERTIBLE`) so the precision change is safe for all
consumers.
The `double-conversion` dependency is also removed from the BUCK file since it is
no longer used.
Output examples:
- `0.0` → `"0"`
- `100.0` → `"100"`
- `66.66666412353516` → `"66.6667"`
- `1.5` → `"1.5"`
- `33.333333` → `"33.3333"`
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D95041966
fbshipit-source-id: 4cce0c9ade73137d6a3d1fffd43905a1cf6d76ac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55892
Adds `toMatchInlineSnapshot()` to the Fantom custom `expect` implementation,
matching Jest's inline snapshot behavior. On first run, snapshot values are
written directly into the test source file as template literal arguments.
On subsequent runs, values are compared and the test fails on mismatch
unless the `-u` flag is passed to force an update.
The implementation spans the two-process Fantom architecture:
**Runtime (Hermes VM):**
- `snapshotContext.js`: New `toMatchInlineSnapshot` method that compares
received values against existing inline snapshots, captures stack traces
for new/mismatched snapshots, and tracks results per test.
- `expect.js`: New `toMatchInlineSnapshot` method on the `Expect` class
that serializes values with `prettyFormat` and delegates to snapshot context.
- `setup.js`: Plumbs `inlineSnapshotResults` through `TestCaseResult`.
**Runner (Node.js):**
- `snapshotUtils.js`: New `processInlineSnapshotResults` resolves VM stack
traces back to original source locations via source map symbolication.
New `saveInlineSnapshotsToSource` directly rewrites the test source file
by finding each `toMatchInlineSnapshot(...)` call and replacing its
argument with the formatted template literal. This avoids jest-snapshot's
`saveInlineSnapshots` which requires Babel and Prettier 2.x.
- `runner.js`: Generates source maps when inline snapshots need updating,
collects pending snapshots across test configs, and writes them after
all configs complete.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D95077617
fbshipit-source-id: 6a25c8ce966ed71ecd8977c13c25de5907311c6e
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
## Changelog:
[General] [Added] - Add c++ AnimatedModule to DefaultTurboModules
Reviewed By: NickGerleman
Differential Revision: D94244698
fbshipit-source-id: 09e905eb4bad7d03cdf87d5b47352060b0e6212f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55861
Add `Fantom.getDefinedEventHandlers(element)` which returns the names of event handlers registered on a component. It Reads committed memoizedProps from the React fiber, so it works for any component type — including component-specific events like ScrollView's onScroll.
The alternative we considered was reading the ViewEvents bitmap from `BaseViewProps` in the ShadowNode (C++). That approach only covers View-specific touch/pointer events and onLayout; it misses component-specific events dispatched imperatively (e.g. ScrollView's onScroll), requiring a separate codepath per component type.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D94936370
fbshipit-source-id: f48b6e37a9e7cf252f396db69e1a43ecca82db96
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55891
`RenderOutput::renderView` merged old cached props with new debug props
via `mergeDynamicProps`. Since `getDebugProps()` omits default-valued
props, removed props were never cleared from the cache. Also,
`renderedViews_.insert()` never overwrote existing entries.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D95055704
fbshipit-source-id: 6cdcbde0473a1d03785f49a9eac79be18395a0bf
Summary:
Changelog: [Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/54637
Add c++ code-coverage mode for Fantom and set up custom output path for it.
Reviewed By: sammy-SC
Differential Revision: D87548065
fbshipit-source-id: 5462582ca467051f7e9a155fd82bfb7045380097
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55860
Changelog: [Internal]
This diff adds the ability to convert LLVM coverage JSON output to LCOV format for C++ code coverage in react-native-fantom.
Key additions:
- `convertLLVMCoverage.js`: Converts LLVM coverage data (segments, branches, functions) to LCOV format lines
- `types.flow.js`: Flow type definitions for LLVM coverage data structures
- Test utilities and fixtures for validating the conversion with real coverage data from various C++ files (AppSettings.cpp, Class.h, DevSettingsModule.h, NativeFantom.cpp/h, RawPropsKey.cpp)
This enables reporting C++ code coverage from Fantom tests in a standard format that can be consumed by coverage tools.
Reviewed By: sammy-SC
Differential Revision: D90135000
fbshipit-source-id: 3b22250c4b1665748b6ccb4feb79cc1c20ec7fa6
Summary:
The ViewTransitionModule commit (f81f73e5a0) added `react_renderer_viewtransition` as a dependency of `react_renderer_scheduler`, but did not update the Fantom tester's `CMakeLists.txt` to include the `react/renderer/viewtransition` subdirectory. This causes the Fantom tester build to fail with:
```
/usr/bin/ld: cannot find -lreact_renderer_viewtransition: No such file or directory
```
This adds `add_react_common_subdir(react/renderer/viewtransition)` to the Fantom tester CMakeLists.
Changelog: [Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/55887
Test Plan: - `run_fantom_tests` CI should pass with this fix.
Reviewed By: cipolleschi
Differential Revision: D95066938
Pulled By: cortinico
fbshipit-source-id: aeda33365d9967fa7a3e07ac57c4a86863f20243
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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