Summary:
Fixed `hermes-compiler` not being resolved correctly when your repo is set up as a monorepo using pnpm.
## Changelog:
[GENERAL] [FIXED] - Fixed `hermes-compiler` not being resolved correctly when your repo is set up as a monorepo using pnpm.
Pull Request resolved: https://github.com/facebook/react-native/pull/54667
Test Plan: n/a
Reviewed By: cortinico
Differential Revision: D87873273
Pulled By: cipolleschi
fbshipit-source-id: 4d60a00ae579bc4a671d6536de4dd02bdefef6c8
Summary:
In https://github.com/facebook/react-native/issues/54139 I have removed checking shared preferences for `debug_http_host`. The diff reverts this removal because it is used for changing the bundle source before the app starts.
## Changelog:
[ANDROID][FIXED] - revert removal of checking shared preferences for `debug_http_host`.
Pull Request resolved: https://github.com/facebook/react-native/pull/54687
Test Plan:
I have run the `rn-tester` app and swapped a default prefs file on Android emulator located in: `/data/data/com.facebook.react.uiapp/shared_prefs/com.facebook.react.uiapp_preferences.xml` with one that had updated port in `debug_http_host` setting to `8082`:
```xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<boolean name="fps_debug" value="true" />
<string name="debug_http_host">10.0.2.2:8082</string>
<boolean name="inspector_debug" value="true" />
</map>
```
Then, I have run the app and checked if the bundle is loaded from the Metro instance invoked using `yarn start --port 8082`.
Reviewed By: cortinico
Differential Revision: D87869540
Pulled By: coado
fbshipit-source-id: 9a76990b097ad7ff24cbbc5202ca935053de23e5
Summary:
The argument for the output path to this CLI has always been optional, but the types didn't reflect this, which caused a few regressions in recent changes (e.g. https://github.com/facebook/react-native/issues/53503)
There's several code paths where the `baseOutputPath` can be altered or derived in different ways, which wasn't respected in logic before the main codegen output block or in `generateReactCodegenPodspec`.
When applied, this PR alters the `baseOutputPath` logic to use a default by `computeBaseOutputPath` extracted from `computeOutputPath` and have an added `process.env.RCT_SCRIPT_OUTPUT_DIR` override, which was previously only applied to `readReactNativeConfig`
This should restore:
- `react-native codegen` being run without an `--outputPath` argument
- codegen running with a `package.json:codegenConfig.outputDir` override
Resolves https://github.com/facebook/react-native/issues/54473
## Changelog:
[GENERAL] [FIXED] - Ensure codegen CLI supports unspecified `--outputPath` argument and respects `codegenConfig.outputDir` configurations
Pull Request resolved: https://github.com/facebook/react-native/pull/54609
Test Plan: - Manually run `react-native codegen` in `rn-tester`
Reviewed By: cipolleschi
Differential Revision: D87456501
Pulled By: cortinico
fbshipit-source-id: 997e99af1f99227eb70955478643b28b1a90df61
Summary:
Fixed an `ENOENT` exception when a dependency does not export `package.json`, and your repo is set up as a monorepo using pnpm.
> [!NOTE]
>
> This does not fix the actual search algorithm. We shouldn't be using `require.main.paths` here because it does not point to the correct starting point, the project root.
>
> This change only fixes the case where we cannot find `package.json` at all.
## Changelog:
[GENERAL] [FIXED] - Fixed an `ENOENT` exception when a dependency does not export `package.json`, and your repo is set up as a monorepo using pnpm
Pull Request resolved: https://github.com/facebook/react-native/pull/54665
Test Plan:
**Before:**
```
% node node_modules/react-native/scripts/generate-codegen-artifacts.js -p . -o ios -t ios
[Codegen] Analyzing package.json
[Codegen] Could not find generated autolinking output at: /~/packages/app/example/ios/build/generated/autolinking/autolinking.json
[Codegen] Searching for codegen-enabled libraries in the app.
[Codegen] The "codegenConfig" field is not defined in package.json. Assuming there is nothing to generate at the app level.
[Codegen] Could not find generated autolinking output at: /~/packages/app/example/ios/build/generated/autolinking/autolinking.json
[Codegen] Searching for codegen-enabled libraries in the project dependencies.
[Codegen] Found react-native-webapis/web-storage
[Codegen] Found react-native
[Codegen] Found react-native-safe-area-context
Trying to find `package.json` for `webdriverio` in [
'/~/node_modules/.store/react-native-virtual-a5dea7d647/package/scripts/node_modules',
'/~/node_modules/.store/react-native-virtual-a5dea7d647/package/node_modules',
'/~/node_modules/.store/react-native-virtual-a5dea7d647/node_modules',
'/~/node_modules/.store/node_modules',
'/~/node_modules',
'/node_modules'
]
[Codegen] Error: ENOENT: no such file or directory, open ''
[Codegen] Done.
```
**After:**
```
% node node_modules/react-native/scripts/generate-codegen-artifacts.js -p . -o ios -t ios
[Codegen] Analyzing package.json
[Codegen] Could not find generated autolinking output at: /~/packages/app/example/ios/build/generated/autolinking/autolinking.json
[Codegen] Searching for codegen-enabled libraries in the app.
[Codegen] The "codegenConfig" field is not defined in package.json. Assuming there is nothing to generate at the app level.
[Codegen] Could not find generated autolinking output at: /~/packages/app/example/ios/build/generated/autolinking/autolinking.json
[Codegen] Searching for codegen-enabled libraries in the project dependencies.
[Codegen] Found react-native-webapis/web-storage
[Codegen] Found react-native
[Codegen] Found react-native-safe-area-context
Trying to find package.json for webdriverio in [
'/~/node_modules/.store/react-native-virtual-a5dea7d647/package/scripts/node_modules',
'/~/node_modules/.store/react-native-virtual-a5dea7d647/package/node_modules',
'/~/node_modules/.store/react-native-virtual-a5dea7d647/node_modules',
'/~/node_modules/.store/node_modules',
'/~/node_modules',
'/node_modules'
]
[Codegen] Searching for codegen-enabled libraries in react-native.config.js
[Codegen] Processing RNWWebStorageSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, macos, visionos for RNWWebStorageSpec
[Codegen] Processing FBReactNativeSpec
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Processing safeareacontext
[Codegen] Searching for podspec in the project dependencies.
[Codegen] Supported Apple platforms: ios, macos, tvos, visionos for safeareacontext
[Codegen] Generating Native Code for RNWWebStorageSpec - ios
[Codegen] Generated artifacts: ios/build/generated/ios/ReactCodegen
[Codegen] [Codegen - FBReactNativeSpec] Skipping iOS code generation for FBReactNativeSpec as it has been generated already.
[Codegen] Generating Native Code for safeareacontext - ios
[Codegen] Generated artifacts: ios/build/generated/ios/ReactCodegen
[Codegen] Generating RCTThirdPartyComponentsProvider.h
[Codegen] Generated artifact: ios/build/generated/ios/ReactCodegen/RCTThirdPartyComponentsProvider.h
[Codegen] Generating RCTThirdPartyComponentsProvider.mm
[Codegen] Generated artifact: ios/build/generated/ios/ReactCodegen/RCTThirdPartyComponentsProvider.mm
[Codegen] Generating RCTModulesProvider.h
[Codegen] Generated artifact: ios/build/generated/ios/ReactCodegen/RCTModuleProviders.h
[Codegen] Generating RCTModuleProviders.mm
[Codegen] Generated artifact: ios/build/generated/ios/ReactCodegen/RCTModuleProviders.mm
[Codegen] Generating RCTAppDependencyProvider
[Codegen] Generated artifact: ios/build/generated/ios/ReactAppDependencyProvider/RCTAppDependencyProvider.h
[Codegen] Generated artifact: ios/build/generated/ios/ReactAppDependencyProvider/RCTAppDependencyProvider.mm
[Codegen] Generated podspec: ios/build/generated/ios/ReactAppDependencyProvider/ReactAppDependencyProvider.podspec
[Codegen] Generated podspec: ios/build/generated/ios/ReactCodegen/ReactCodegen.podspec
[Codegen] Generating Package.swift
[Codegen] Generated artifact: ios/build/generated/ios/Package.swift
[Codegen] Done.
```
Reviewed By: cipolleschi
Differential Revision: D87872496
Pulled By: cortinico
fbshipit-source-id: b9da0e1808248cb806a2a8a0ee575566ce027067
Summary:
Previously the symbolication support when using the precompiled React.XCFramework copied the symbol bundles to the wrong folder in the framework, causing Xcode to not find the symbols.
This commit fixes this by copying symbols to the correct slice folders instead of in the root of the framework folder.
Note:
Running `pod cache clean --all` and `rm -rf Pods` in the iOS folder followed by a clean rebuild in Xcode might be a good thing to ensure you're using the correct binaries when compiling.
## Changelog:
[IOS] [FIXED] - Fixed copying symbol bundles into correct slice folder
Pull Request resolved: https://github.com/facebook/react-native/pull/54641
Test Plan:
```
npx react-native-community/cli init Next --version next --skip-install
cd Next
yarn
cd ios
bundle install
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1 bundle exec pod install
```
Run Xcode and observe that you are not able to step into React Native source code.
After this fix, you should be able to step into the source code of React Native.
Reviewed By: cortinico
Differential Revision: D87919202
Pulled By: cipolleschi
fbshipit-source-id: 029bca3e182c170562e358beb50592d5b91d8e8b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54754
Enables the standalone app shell for React Native DevTools by default.
We preserve + document this flag as an opt-out (allowing Frameworks to override this behaviour if needed).
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D88161573
fbshipit-source-id: 64ee191dcead4e639bb3067bc9e715b1c8cdf80d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54408
Follows from the parent commit. This will prevent 3P CDP clients from using the `Tracing` or `Network` domains when we are in an unsupported multi React Native Host setup.
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D86201688
fbshipit-source-id: 052d563a371fd77c1a05ad8518e222d6bc1eb372
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54407
Introduces a new `InspectorSystemState` object and `ReactNativeApplication.systemStateChanged` CDP event, used to assert whether more than one React Native Host has been registered for the current app lifetime.
This will be used to disable the Performance and Network features in React Native DevTools when the debugger backend is in this currently unsupported state. We intend to implement host lifecycle correctness across all features soon.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D86201689
fbshipit-source-id: b8525359fc01eb7ae666879f2c0fd4c94f0af81a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54479
Fixes failing CI jobs on `0.83-stable`, e.g. https://github.com/facebook/react-native/actions/runs/19234912061/job/54982161510.
**Changes**
- Simplify main package `package.json` file read with existing `getWorkspaceRoot` util.
- Fix test by mocking `getWorkspaceRoot` (previously: read the real filesystem and caused test breakage outside `main`).
- Add additional `RC0 → RC1` test case.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D86674348
fbshipit-source-id: 0b8feb4cbf7b1ac7cf4cc560f066a0a10aec1b5f
Summary:
When RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS is enabled, source file paths in dSYMs were incorrectly resolved with extra path segments:
double node_modules (e.g., /path/node_modules/node_modules/...)
The root cause was using File.expand_path(@react_native_path) without the correct base directory. The path was first expanded without a base (causing double node_modules), then fixed to use project_pods_root (ios/Pods/), which still resulted in incorrect paths with an extra ios/ folder.
Fixed by expanding the path relative to Pod::Config.instance.installation_root, which correctly points to the ios/ directory, allowing relative paths like ../node_modules/react-native to resolve properly to the project root's node_modules directory.
## Changelog:
[IOS] [FIXED] - Fix incorrect source path resolution in dSYM remapping in precompiled framework scripts
Pull Request resolved: https://github.com/facebook/react-native/pull/54470
Test Plan:
```
rm -rf ./Pods
pod cache clean --all
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1 bundle exec pod install
```
✅ Tested with RN-Tester
✅ Tested in 0.83.rc0 project
Reviewed By: huntie
Differential Revision: D86667786
Pulled By: cipolleschi
fbshipit-source-id: cd6279d02d5ed7188e282e4491c05de35f17a8f1
Summary:
OSS community shared with me that we have a circular dependency in React-utils.podspec that prevent them from building with JSC.
While fixing it, I realized that the dynamic framework build was broken. So I fixed them both.
## Changelog:
[iOS][Fixed] - Fixed build with dynamic frameworks
Pull Request resolved: https://github.com/facebook/react-native/pull/54421
Test Plan: Build RNTester locally with USE_FRAMEWORKS=dynamic
Reviewed By: javache
Differential Revision: D86309592
Pulled By: cipolleschi
fbshipit-source-id: f2995332ae135ce951480b353df7d597ff8a85ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54419
Changelog: [Internal]
React Native uses `files` field in `package.json` to list everything that should end up in the apckage. `.hermesv1version` file was missing from that list, which is fixed by this diff.
Reviewed By: huntie, cipolleschi
Differential Revision: D86295805
fbshipit-source-id: 8a17191f26f9536884e4aaf09447121c020d1212
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54385
Changelog: [Internal]
`test-release-local` shouldn't be changing the hermes version stored in `version.properties` as this script should be called on a cut branch with hermes already bumped.
Reviewed By: cipolleschi
Differential Revision: D86105703
fbshipit-source-id: 5a1edd9f7a6cd756521749c2b0023ea683dadf82
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54363
The calculus for active scroll maintainVisibleContentPosition is not isomorphic between ReactHorizontalScrollView and ReactScrollView. Additiionally, it doesn't make sense that we would use an x-offset in a y-offset calculation. This fixes a likely bug where the OverScroller's x-offset is used to compute the scroll animation update in ReactScrollView.recreateFlingAnimation.
## Changelog
[Android][Fixed] - Issue with restarting scroll in maintainVisibleContentPosition
Reviewed By: javache
Differential Revision: D86021007
fbshipit-source-id: 0d7febcbccd59df534bacbba7f1b5bb5085fa95f
Summary:
While integrating nightlies in the main Expo repo, I noticed an issue where iOS builds would fail in release mode when setting `RCT_USE_RN_DEP=1`. The error was thrown by a failure in the `replace_dependencies_version` script given that during the pod install phase, we were not downloading the release artifacts for nightlies, only the debug ones.
## Changelog:
[IOS] [FIXED] - Fix using iOS nightly prebuilds in release mode
Pull Request resolved: https://github.com/facebook/react-native/pull/54369
Test Plan:
1. run `RCT_DEPS_VERSION=nightly pod install`
2. Build the app in release mode
Reviewed By: javache
Differential Revision: D86089167
Pulled By: cipolleschi
fbshipit-source-id: ea9a608926ed0a9145e3e305e8a3210364e1d36c
Summary:
Setting `ENV['RCT_USE_PREBUILT_RNCORE'] = '1'` when running nightlies on iOS will result in the following error:
<img height="608" alt="image" src="https://github.com/user-attachments/assets/130112d7-d4d8-4934-be56-c020a4b204a6" />
The reason for this happening is that we precompile the iOS artifacts on CI using whatever version is set on main (by default version 1000). This works fine when using RCs and stable versions because before the publishing step we do a release commit (e.g https://github.com/facebook/react-native/commit/57ff54492f4a5a0e9d331e880b3c2264a2bd81f7), which updates the react-native version.
This can be easily mitigated by invoking the `set-rn-artifacts-version` CLI right before building the iOS prebuilds.
## Changelog:
[IOS] [FIXED] - Fix iOS version mismatch when using nightly prebuilds
Pull Request resolved: https://github.com/facebook/react-native/pull/54370
Test Plan: Run `node ./scripts/releases/set-rn-artifacts-version.js --build-type` locally
Reviewed By: javache
Differential Revision: D86089144
Pulled By: cipolleschi
fbshipit-source-id: a5c296ea8e022e562f7898803ab37dc61ffd67b6