Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48570
Changelog: [internal]
We're still iterating on this feature and making sure it reports stable results, so marking it as `unstable` to set expectations.
Reviewed By: andrewdacenko
Differential Revision: D67975844
fbshipit-source-id: 41e93cb9cb0c887a96178e4a4d5078d1899b2478
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48451
Changelog: [internal]
Modifies the execution of benchmarks in CI to run benchmarks in test mode when they don't define a `verify` method.
If a benchmark uses `verify`, the test is meant to make sure that the benchmark doesn't regress in CI. If it doesn't, then running the benchmark on CI doesn't provide much value. In that case, we run a single iteration of each test case just to make sure things don't break over time.
Reviewed By: rshest
Differential Revision: D67637754
fbshipit-source-id: 33b78a9c809386cf2e040314b0427de6a53da3e3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48452
Changelog: [internal]
Implements a basic API to run benchmarks with Fantom (using `tinybench` under the hood):
```
import {benchmark} from 'react-native/fantom';
benchmark
.suite('Suite name', {
// options
})
.add(
'Test name',
() => {
// code to benchmark
},
{
beforeAll: () => {},
beforeEach: () => {},
afterEach: () => {},
afterAll: () => {},
},
)
.verify(results => {
// check results and throw an error if the expectations fail
});
```
Features:
* Print benchmark results in the console as a table.
* It opts into optimized builds automatically
* Verifies that optimized build is used (unless manually opting out of the check via `disableOptimizedBuildCheck`).
* Supports verification of results (making expectations and making the test fail if the benchmark doesn't meet some expectations).
Reviewed By: rshest
Differential Revision: D66926183
fbshipit-source-id: 61cfa7689ea7684eb870fbbc815b8d236a1871e6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48434
Changelog: [internal]
We were starting to repeat this logic too much in tests, so extracting so we can reuse it.
Reviewed By: rshest
Differential Revision: D67520443
fbshipit-source-id: 64e4e5b35f83dc45e41bb0efae9685aeaf0cf2e2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48436
Changelog: [internal]
Changing the defaults to use something that resembles a real device (in this case the iPhone 14 which is a very common device).
Reviewed By: christophpurrer
Differential Revision: D67759914
fbshipit-source-id: 87fe3be19196ece62c412e5076c601be746a4f22
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48391
Changelog: [internal]
When we enabled log streaming in Fantom, we saw a lot of logs that we were previously not forwarding (console.error, console.warn) in existing tests.
This removes all the warnings and errors from those tests.
Reviewed By: rshest
Differential Revision: D67602299
fbshipit-source-id: 111f373eafd8707f2746ff727894f1fa4283b83f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48432
Changelog: [internal]
This moves the native module definition for Fantom to the `react-native` package so we can migrate the module to use the codegen.
Also implements the migration.
Reviewed By: christophpurrer
Differential Revision: D67759729
fbshipit-source-id: d79d078908b05fc4b6f5f26f0144ab7e3485cb83
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48368
Changelog: [internal]
Just a minor rename to align with the existing convention.
Reviewed By: javache
Differential Revision: D67549203
fbshipit-source-id: faa9e34cdce7c59e2c6b3f7e697c90df103699d0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48291
Changelog: [internal]
`react-native-fantom` was added to `.eslintignore` when we upgraded to React 19 because we wanted to reduce the amount of warnings to ease the migration.
This re-enables ESLint for that directory and removes the warnings.
Reviewed By: cipolleschi
Differential Revision: D67283104
fbshipit-source-id: 4ec2363ceaff3cd7bd6e5d70e9588c3dd22d7d85
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48284
Changelog: [internal]
We recently prevented tasks that run via `runTask` to synchronously call `runTask` because the execution is synchronous and we can't nest tasks in the event loop (D67107664 / https://github.com/facebook/react-native/pull/48235).
This adds `scheduleTask` to schedule tasks (also within tasks) with the right expectations (the task will not run synchronously on that call but at the right time).
It also adds `runWorkLoop` so we can run scheduled tasks if they're not scheduled from an already running task.
Reviewed By: javache
Differential Revision: D67275518
fbshipit-source-id: acde0093802fbcb7083334f2c0247b37b759a6b1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48283
Migrate from custom JSI integration to use TurboModule base-class.
This doesn't use codegen right now for ease of migration, and to avoid needing to setup a js_library buck definition for react-native-fantom. We should also figure out what the right abstraction/division of responsibilities is going forward for TesterAppDelegate and FantomModule.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D67111850
fbshipit-source-id: e1623d80f1f25ec123315b3620930dd17dd8a8a7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48235
Recursively calling runTask is not supported, as the inner call will no-op since we're already executing the eventloop.
Currently errors are not correctly propagated, but this at least makes it so that we don't attempt to schedule the task either, which could lead to incorrect assumptions being made.
Changelog: [internal]
Reviewed By: rubennorte
Differential Revision: D67107664
fbshipit-source-id: e665a96671f4812308d87aec3b880ce2009328e2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48029
Changelog: [Internal]
Adding snapshot support for rendered output only for now.
This will only work if snapshot is created beforehand by hand.
# Next steps
* Create snapshot when no prior snapshot is available
* Pass and update if instructed
Reviewed By: christophpurrer
Differential Revision: D66601387
fbshipit-source-id: fe528cded43c5ba36d314bd9af8e3fb84b98ac3e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48178
Changelog: [internal]
Adds a new mode for Fantom to run tests with dev-mode bytecode. Right now the modes were only dev (development with source code) or opt (optimized bytecode).
Reviewed By: rshest
Differential Revision: D66888986
fbshipit-source-id: 34b2566a65d138790e16f8fb5787fd9c2bcde536
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48123
Changelog: [internal]
This verifies that the modes specified in the pragmas are applied correctly.
Reviewed By: andrewdacenko
Differential Revision: D66822377
fbshipit-source-id: 420f21f171c5d356ab91b49f7a33345386f6f0c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48142
Changelog: [internal]
This is the default export from the `react-native/fantom` package and it makes sense to be called that way. Also, this is similar to the `jest` global.
Reviewed By: javache
Differential Revision: D66874225
fbshipit-source-id: 8b43a637ebb42b5b1acb9ea5a6dbedd4c1a4f9e0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48141
Changelog: [internal]
This just aligns the file name with the common convention to name modules with the same name as their default export (if any).
Reviewed By: javache
Differential Revision: D66874227
fbshipit-source-id: 2a619b434c26a29f1774cba1c32ba711b1a7af46
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48140
Changelog: [internal]
These tests test an API that's part of `ReactNativeTester` (will be renamed as `Fantom`) so it makes sense that they're in the same test file as the tests for the rest of the API.
Reviewed By: javache
Differential Revision: D66874226
fbshipit-source-id: f17e14c83cb5ca95ac619c5398c49ad84a27cfa5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48125
Changelog: [internal]
This just moves the runtime modules for Fantom to its own package.
Reviewed By: javache
Differential Revision: D66825478
fbshipit-source-id: ac4dbc23b86895f09abc46345d497c1c53737ae2