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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53207
When restructuring the RCTReactNativeFactory, we forgot to add a couple of methods to check whether the delegate was implementing the RCTTurboModuleManager delegate methods.
This has been reported [here](https://github.com/react-native-community/discussions-and-proposals/issues/916)
This change fixes it.
## Changelog:
[iOS][Fixed] - Ask the delegate for `getModuleForClass` and `getModuleInstanceFromClass`
Reviewed By: cortinico
Differential Revision: D79998104
fbshipit-source-id: 68069a9f93182d4fa416b5799bf4eec4d107552b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53134
This change sets up the Fanto test for the Switch component
## Changelog:
[Internal] -
Reviewed By: rubennorte
Differential Revision: D79719683
fbshipit-source-id: d8a5d127296e3448faf5f841baa98bc34f4f43cb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53177
This action is used only when running tests for RNTester. Now that we are using prebuilds, this is a liability, because Cocoapods and Xcode would not update the binary if a new one is provided.
With prebuild, this caching does not provide a lot of benefits, so we can remove it.
## Changelog
[Internal] -
Reviewed By: cortinico
Differential Revision: D79893870
fbshipit-source-id: 0773f910f418cf9ebd5d557d563160993084e83a
Summary:
When running `RCT_USE_PREBUILT_RNCORE=1 RCT_USE_RN_DEP=1 pod install` I'm getting an error: `cp: framework/packages/react-native/..: File exists`
This is not seen consistently by everyone but I've seen in reported one more time at Expo. Could be related to running MacOS 26.
Somehow, apparently, the `..` is being treated as a literal directory name and cp is trying to create a directory named `..` inside `framework/packages/react-native/` which is not what we want. Using `/.` avoids that.
---
What also seemed to work(around) was to change `mkdir -p framework/packages/react-native` to `mkdir -p framework/packages/` and then `cp` can create the `framework/packages/react-native/..` folder. But this is definitely more confusing.
## Changelog:
Pick one each for the category and type tags:
[IOS] [FIXED] - fix "file exists" error in `ReactNativeDependencies.podspec`
Pull Request resolved: https://github.com/facebook/react-native/pull/53136
Test Plan: tested locally, and in CI on older macOS: https://github.com/expo/expo/pull/38631 (the ios build succeeds)
Reviewed By: rshest
Differential Revision: D79990895
Pulled By: cipolleschi
fbshipit-source-id: 44ff9034800d3acd4e55ec39aabfb326382372cb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53199
Changelog: [internal]
This adds a new `taskEndTime` field in the internal C++ representation of `PerformanceEventTiming` so we can distinguish events that waited for mount (because they triggered changes) and events that didn't, so report INP correctly.
Reviewed By: rshest
Differential Revision: D79894702
fbshipit-source-id: f7472bfaecaa69f2126719d0dc3d3b251e3a8f68
Summary:
When running a project in a path that contains any spaces, the scripts have several escape patterns that don't handle this path correctly. For example, `"/absolute/path/with spaces"` may be rendered as `/absolute/path/with spaces` and this shows as an output error such as `No such file or directory /absolute/path/with`
This was likely a longstanding issue, but is unexpected for some beginners that first try out React Native. While it's not recommended to create a path like this, it's certainly not hard to make this mistake.
## Changelog:
[IOS] [FIXED] - fix scripts for paths containing whitespaces
Pull Request resolved: https://github.com/facebook/react-native/pull/53194
Test Plan: tested locally; create a React Native or Expo project in a folder containing a space (e.g. `/my/path/with spaces/new-app` and build the project. With changes applied, the build should succeed. (There's related failures in `expo/expo` that need fixing too)
Reviewed By: robhogan
Differential Revision: D79993537
Pulled By: cipolleschi
fbshipit-source-id: b32697ce2405c403c410b3ceaed7e161e4a48537
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53104
Deprecate com/facebook/react Legacy Architecture classes
changelog: [Android][Changed] Depreacate CoreModulesPackage and NativeModuleRegistryBuilder legacy architecture classes, these classes unused in the new architecture and will be deleted in the future
Reviewed By: shwanton
Differential Revision: D79676942
fbshipit-source-id: a2c447bee251fdac79d3dc81a17851eaf5271413
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53107
Deprecate Legacy Architecture ViewManagers, these classes are not used as part of the new architecture and will be deleted in the future
changelog: [Android][Changed] Deprecate Legacy Architecture ViewManagers, these classes are not used as part of the new architecture and will be deleted in the future
Reviewed By: shwanton
Differential Revision: D79676585
fbshipit-source-id: 72cb6fe0bbe666cfa317cf28d6aec475f1c38c35
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53192
In this diff I'm deprecating ShadowNode classes included in React Native library
These classes are part of the legacy architecture and will be deleted in the future
changelog: [Android][Changed] Deprecate LegacyArchitecture ShadowNode classes included in React Native
Reviewed By: mlord93
Differential Revision: D79676584
fbshipit-source-id: a39267e6e430fcf4f6a73c96cd28d02eafc88a32
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53152
When a redundant reject is called, show the rejection message in the redbox. This can help us pin down the error we need to elminiate in production.
Changelog: [Internal]
Reviewed By: sanjay-io
Differential Revision: D79837541
fbshipit-source-id: 879b5dc42980867051cfab6ccb575304a4a9c4c6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53151
If the native module calls the resolve/reject, resolve/resolve, reject/resolve, reject/reject concurrently, the turbomodule infra could run into a null pointer exception. This diff mitigates that problem.
Changelog: [iOS][Fixed] - Fix concurrent calls into resolve/reject inside native modules
Reviewed By: sanjay-io
Differential Revision: D79824319
fbshipit-source-id: 675264781f303d12fc1eb9649ecdc78601b7720b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53181
Adds basic Fantom tests for the <Pressable> React Native component.
Following T233710053, adds tests for some of the listed props and refs.
Covered props:
* children
* disabled
* onPress
* style
Ref:
* Pressable is a Native Component and has the correct tag
I did not cover the rest of the listed props due to Fantom not having suitable events to trigger to test them and/or inease of implementing functionality to do so.
## Changelog:
[Internal]
Reviewed By: andrewdacenko
Differential Revision: D79745215
fbshipit-source-id: 26caaabf72ea7ffff3e652616dfd9f0cf7fc2020
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52852
Changelog: [Internal] - Implementation of ScrollView-managed VirtualViews for iOS
In previous diffs we've introduced a "VirtualViewExperimental" which is a clone of VirtualView. This diff updates the experimental version to move interection logic (whether something is visible, in prerender-space, etc.) to the ScrollView so there are less listeners. We now use 1 scroll listener vs. N
Reviewed By: philIip
Differential Revision: D78825701
fbshipit-source-id: d515e3cb2dae53d779b5d3f4c317a2c7a6b25857
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