Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53250
Changelog: [internal]
This updates the types for Fantom benchmarks to support the new `overriddenDuration` option from `tinybench`.
It also exposes a new method in the benchmark namespace to access the same timestamp used in benchmarks.
Reviewed By: rshest
Differential Revision: D80169515
fbshipit-source-id: 59af197eababbf5b8544ee9f1862b206756dc87d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53249
Changelog: [internal]
This just upgrades tinybench (used in Fantom benchmarks) to v4.1.0, which contains a feature we need to customize test durations.
Reviewed By: rshest
Differential Revision: D80169516
fbshipit-source-id: 5813b3050843b52d604619a44a5e097e26f54432
Summary:
While verifying the lock deduplication changes, I have spotted that `eslint-plugin-jest` package does not match Jest version used within the workspace.
## Changelog:
[INTERNAL][CHANGED] - update `eslint-plugin-jest` package in workspace to align with Jest version used
Pull Request resolved: https://github.com/facebook/react-native/pull/53246
Test Plan: Running `yarn test`, `yarn lint-ci` and `test-typescript` checks does not yield any errors.
Reviewed By: rshest, cortinico
Differential Revision: D80170591
Pulled By: robhogan
fbshipit-source-id: f3ac58bc26cf2d3a34899f8558f872b3df85942d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53223
changelog: [internal]
remove dependency on perfetto and use TraceSection like we do elsewhere.
Reviewed By: zeyap, rubennorte
Differential Revision: D80087082
fbshipit-source-id: 08d3434985443db9a83189a4dfabc65d6eda8166
Summary:
fix: https://github.com/facebook/react-native/issues/52279
## Changelog:
[iOS] [FIXED] - non-UTF8 crashes Info.plist local frameworks
Pull Request resolved: https://github.com/facebook/react-native/pull/52336
Test Plan:
after this change pods install and are working with the new warning:
[!] Failed to read Info.plist at /Users/user/apps/test/ios/promiflash/Frameworks/YouTubeEmbeddedPlayerFramework.framework/Info.plist: invalid byte sequence in UTF-8
Reviewed By: cortinico
Differential Revision: D80096932
Pulled By: cipolleschi
fbshipit-source-id: f60cd67cb99a581d6fbab92422c1adf7b50066eb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53214
Changelog: [General] [Fixed] Enforce void return type for void return type in JS C++ TM spec
Example if you have this spec
```
export interface Spec extends TurboModule {
+foo: (bar: string) => void;
}
```
We must enforce in C++ that the return type is `void` as e.g.
```
void foo(jsi::Runtime& rt, const std::string& bar);
```
Right now you can return any type in C++ such as `std::string` which does not make sense
Reviewed By: lenaic
Differential Revision: D79980538
fbshipit-source-id: 9b99ea6b1ac97d1e46cdb9952e83c445ec5503b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53208
changelog: [internal]
When Fabric View Culling is enabled together with immediate state update, it may lead to a crash inside of `[RCTScrollViewComponentView _adjustForMaintainVisibleContentPosition]`.
When doing immediate state update, we can avoid calling `[RCTScrollViewComponentView _adjustForMaintainVisibleContentPosition]` altogether to avoid the crash.
Reviewed By: lenaic
Differential Revision: D80000362
fbshipit-source-id: 123b70aa31edb14a99bb968648eb8b8aac84afb6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53226
Changelog: [internal]
This adds documentation about how to take JS memory heap snapshots in Fantom.
Reviewed By: lenaic
Differential Revision: D80090283
fbshipit-source-id: 04f66a62aa756d1020b8d8ef6fc0ea7e68341710
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53228
Changelog: [internal]
This adds some documentation about how to debug Fantom tests (C++ and JS).
Reviewed By: lenaic
Differential Revision: D80090286
fbshipit-source-id: 435d2079abfe72e93de0c297347b15dc39b25a89
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53231
The RCTPullToRefreshViewComponentView props are not initialized when the component view is created. this could lead to undefined behaviors and crashes.
This change fixes it.
## Changelog:
[iOS][Fixed] - Properly initialize the RCTPullToRefreshViewComponentView
Reviewed By: sammy-SC
Differential Revision: D80093141
fbshipit-source-id: dac98d56c749b9f5d85338279c8da2a7e5ddb4a3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53221
# Changelog:
[Internal] -
This changes the benchmark test results comparison print the results slightly differently, in particular it now uses the slowest result as a baseline and prints how much faster the other ones are (as opposed to printing "slower" previously).
This arguably brings a more positive vibe when looking into the benchmark results :)
Reviewed By: andrewdacenko
Differential Revision: D80082134
fbshipit-source-id: 7dc9c7c520afe08270d4f5da9031db02261690ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53095
This change simplifies the RNTesterApplication so that it's looking closer to the template MainApplication file.
In order to do so, I had to create 2 files inside the `metainternal/` folder as those files are
generated as part of the CLI Autolinking
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D79722917
fbshipit-source-id: 06852c72ae1e1abed9952b1637515123977bc7b4
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53205
Changelog: [internal]
This injects a custom Babel transform for Fantom tests that automatically injects `debugger` statements in the generated code. This simplifies debugging by providing a default interruption point in the test setup for the test author to decide what to debug.
This has no effect unless the debugger is opened, which isn't happening yet.
Reviewed By: rshest
Differential Revision: D79996000
fbshipit-source-id: 6153587264d293a067e359edba4f64f41898c506
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53200
Changelog: [internal]
TSIA. This is necessary for Fantom to use real HTTP and WebSocket connections for DevTools, while still providing stubs for the runtime (the networking and websockets native modules provided to clients).
If there are no specific factories for DevTools provided, we fall back to regular ones (keeping backwards compatibility).
Reviewed By: rshest
Differential Revision: D79806934
fbshipit-source-id: 6d16fa44e11f3c8e304c3c3d31fe952d0ba5811a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53201
Changelog: [internal]
This splits the `ReactHost` option `enableDebugging` into more granular options:
- `enableInspector` which enables the connection with the inspector/debugger.
- `enableDevMode` which enables the use of bundles from Metro, reloads, etc.
This allows us to enable the inspector in Fantom without consuming bundles from Metro.
This should be backwards compatible with existing apps.
In the future, we should be able to inject custom `DevSupportManager` instances into the `ReactHost` so we can customize all options with any level of granularity (the same way we do on Android, for example).
Reviewed By: rshest
Differential Revision: D79804006
fbshipit-source-id: c28e788e5006cdbeb1a373d44b4e5aec1acec702
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53203
Changelog: [internal]
This makes ReactHost connect the inspector immediately after creating the instance, aligned with how we do it on Android, instead of doing it as part of loading a bundle.
Reviewed By: rshest
Differential Revision: D79804004
fbshipit-source-id: b165520b0feb089fdfaa323413d697939c7ac794
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53202
Changelog: [internal]
Just a minor refactor to follow the convention of prefixing Fantom-related globals and environment variables.
Reviewed By: rshest
Differential Revision: D79804007
fbshipit-source-id: 0c9a57c1b08ae18ae03cd66d1a6ef9690e0dea42
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53204
Changelog: [internal]
This changes the logic to find an available port for Metro on Fantom to do this outside Metro. Before, we'd set `0` as the port for Metro to find an available port, but in a following change we'll need to know the port before calling into Metro. This allows that.
Reviewed By: rshest
Differential Revision: D79804005
fbshipit-source-id: 5c2e2f4acbba3a79771586799b65653d46b8fe72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53220
This is fix for some React Native libraries can't be found by Codegen, and will make the libraries unusable in new architecture (Turbo Modules)
Internally in the Codegen script, it will try to import library's package.json file with the `require.resolve`, but for some React Native libraries will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code due to using the `exports` field in their package.json file while not exposing the package.json file itself. As an example
```json
{
"exports": {
".": {
"import": {
"types": "./lib/typescript/module/index.d.ts",
"default": "./lib/module/index.js"
},
"require": {
"types": "./lib/typescript/commonjs/index.d.ts",
"default": "./lib/commonjs/index.js"
}
},
"./package.json": "./package.json" <-- here some libraries missed this
},
"codegenConfig": {}
}
```
Personally feel weird that library author has to expose their package.json only for the sake of Codegen and i believe library author shouldn't, even the library consumer don't need it.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Help Codegen find library's package.json if some libraries using `exports` field in their package.json file and the `./package.json` subpath is not explicitly defined
bypass-github-export-checks
Pull Request resolved: https://github.com/facebook/react-native/pull/53195
Test Plan:
`require.resolve('library/package.json')` [here](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js#L203) will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code by Node.js. So if it does, help Codegen retry to find closest library's package.json with [`require.main.paths`](https://nodejs.org/api/modules.html#requiremain) search paths
You can init new app React Native CLI app with my sample react native library here [`ping-react-native`](https://github.com/RakaDoank/ping-react-native) v1.2.2.
Due to missing of the `package.json` subpath, before this change, it's autolinked but unusable due to missing of the spec header file. After this change, it works normally.
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D80080243
Pulled By: cipolleschi
fbshipit-source-id: d33bf9eeb385ccf0c076e4d800a0d2840bd91b68
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53218
# Changelog:
[Internal] -
Uses the existing generalized accessibility props test suite, recently created by andrewdacenko, to test the corresponding props in the <Text/> component.
Reviewed By: andrewdacenko
Differential Revision: D80000693
fbshipit-source-id: ebbceef8db7b56dc5e4ba1ac7c027a5952b680a7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53217
Changelog: [Internal]
Fix rn-tester jobs
This diff reverts D79993649
(The context such as a Sandcastle job, Task, SEV, etc. was not provided.)
Depends on D79993649
Reviewed By: cortinico
Differential Revision: D80030502
fbshipit-source-id: 1feee2e2ae6a1edbeb755687aecb2a25d9759a90
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53196
In the FabricUIManager, the runnable created for scheduled mounts is only used if currently running on the UI thread.
With this diff the runnable only gets created when needed.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D79969412
fbshipit-source-id: ee78890322af8580357389aad8357f7c0d18490f
Summary:
This is fix for some React Native libraries can't be found by Codegen, and will make the libraries unusable in new architecture (Turbo Modules)
Internally in the Codegen script, it will try to import library's package.json file with the `require.resolve`, but for some React Native libraries will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code due to using the `exports` field in their package.json file while not exposing the package.json file itself. As an example
```json
{
"exports": {
".": {
"import": {
"types": "./lib/typescript/module/index.d.ts",
"default": "./lib/module/index.js"
},
"require": {
"types": "./lib/typescript/commonjs/index.d.ts",
"default": "./lib/commonjs/index.js"
}
},
"./package.json": "./package.json" <-- here some libraries missed this
},
"codegenConfig": {}
}
```
Personally feel weird that library author has to expose their package.json only for the sake of Codegen and i believe library author shouldn't, even the library consumer don't need it.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Help Codegen find library's package.json if some libraries using `exports` field in their package.json file and the `./package.json` subpath is not explicitly defined
bypass-github-export-checks
Pull Request resolved: https://github.com/facebook/react-native/pull/53195
Test Plan:
`require.resolve('library/package.json')` [here](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js#L203) will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code by Node.js. So if it does, help Codegen retry to find closest library's package.json with [`require.main.paths`](https://nodejs.org/api/modules.html#requiremain) search paths
You can init new app React Native CLI app with my sample react native library here [`ping-react-native`](https://github.com/RakaDoank/ping-react-native) v1.2.2.
Due to missing of the `package.json` subpath, before this change, it's autolinked but unusable due to missing of the spec header file. After this change, it works normally.
Rollback Plan:
Reviewed By: cortinico
Differential Revision: D79993649
Pulled By: cipolleschi
fbshipit-source-id: fa2bbd6178f5e5fef19a14e67f09ee8a727d01de
Summary:
Bump CLI to stable v20 for RNTester
## Changelog:
[INTERNAL] [CHANGED] - Update RNC CLI in RNTester to v20.0.0
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/53206
Reviewed By: cortinico
Differential Revision: D79997077
Pulled By: rshest
fbshipit-source-id: 7264d942967fbfbc7fa5704f1089c0e7dbd3eb4b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53213
`-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it.
This:
```
try {
...
} catch (exception& e) {
// no use of e
}
```
should instead be written as
```
} catch (exception&) {
```
If the code compiles, this is safe to land.
Reviewed By: dtolnay
Differential Revision: D79968851
fbshipit-source-id: 18f2e6861f099915b1aad6aba58217ba94eb10c8