Summary:
Bumps the CLI to the next version
## Changelog:
[General][Changed] - Bump cli dependencies to 15.0.0-alpha.2
Pull Request resolved: https://github.com/facebook/react-native/pull/46394
Test Plan: CI
Reviewed By: huntie
Differential Revision: D62375405
Pulled By: cipolleschi
fbshipit-source-id: fec99216bc7ad6decfd83840091d807f603184da
Summary:
This PR exposes the `newArchEnabled` flag and deprecates all of the separate methods to enable new architecture.
As discussed with cipolleschi here: https://github.com/react-native-community/template/pull/45#discussion_r1732522705
## Changelog:
[IOS] [DEPRECATED] - Deprecate turboModuleEnabled, fabricEnabled, bridgelessEnabled
[IOS] [ADDED] - Add newArchEnabled method to RCTAppDelegate
Pull Request resolved: https://github.com/facebook/react-native/pull/46228
Test Plan: Test if switching newArchEnabled flag from AppDelegate works.
Reviewed By: cortinico
Differential Revision: D61849385
Pulled By: cipolleschi
fbshipit-source-id: 8acf718386882679f00d2d5000b4432a523b34ac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46391
**Issue:**
RedBox displays early error before JS Error handling is properly setup.
On Android 15, targetSdk 35 (forced edge-to-edge), dialog overlaps with system bars making it difficult to use.
**Solution**
Add inset based margins so content does not overlap with system bars.
Changelog:
[Android][Fixed] - RedBox content overlapping with system bars on Android 15 forced edge-to-edge
Reviewed By: fkgozali
Differential Revision: D62362105
fbshipit-source-id: 57f60222914d407ebdcfd0359dbdf3ac36bde8f5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46390
As React Native's minSdkVersion is not 24, clean up version checks and code that is using deprecated version from OSS
Changelog:
[Internal] - code cleanup for minSdkVersion 24
Reviewed By: philIip
Differential Revision: D62362059
fbshipit-source-id: a851d0908d4175269524f41955acca5f2da69cad
Summary:
In a react native project where USE_FRAMEWORKS is not nil, every time when running `pod install`, duplicate lines are added to `HEADER_SEARCH_PATHS` section of `project.pbxproj`:
```
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
" ${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
```
Note: a popular library that needs `use_frameworks` is react-native-firebase.
See https://rnfirebase.io/#altering-cocoapods-to-use-frameworks
## Analyse
- `react_native_post_install` calls `ReactNativePodsUtils.update_search_paths(installer)`
- when `ENV['USE_FRAMEWORKS'] != nil` then `update_search_paths` calls `add_search_path_if_not_included`
- `add_search_path_if_not_included` checks if `"#{new_search_path}"` is already there
- if not found it adds `" #{new_search_path}"` _with an extra space_
- next time, it can't find `"#{new_search_path}"` because of the extra space, and adds `" #{new_search_path}"` again
## Changelog:
[IOS] [FIXED] - react_native_post_install script no longer adds duplicate entries to HEADER_SEARCH_PATHS
Pull Request resolved: https://github.com/facebook/react-native/pull/46262
Test Plan:
- create a react native project
- add `use_frameworks! :linkage => :static` to `ios/Podfile` (just before `use_react_native`)
- run `pod install`
- assert no duplicate lines are added to HEADER_SEARCH_PATHS of file `project.pbxproj`
Reviewed By: cipolleschi
Differential Revision: D61982680
Pulled By: shwanton
fbshipit-source-id: 61b566893c551d0813edd6eec2f8352c041c748f
Summary:
This PR bumps Socket Rocket to 0.7.1, this release brings some new improvements and visionOS support. I've also moved the version to a constant.
## Changelog:
[INTERNAL] [CHANGED] - Bump SocketRocket to 0.7.1
Pull Request resolved: https://github.com/facebook/react-native/pull/46300
Test Plan: CI Green
Reviewed By: cortinico, cipolleschi
Differential Revision: D62294833
Pulled By: blakef
fbshipit-source-id: 0e45c7de041710fb1f500b0ac23898b68a8a8936
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46359
Remove unneeded code around size calculation and old arch support
- updateState was getting called unnecessarily in multiple places --> only call from onSizeChanged()
- this is a reliable source for getting the content size area of the dialog used for Modal
- remove code checking duplicated update
- Old architecture cleanup
- Remove Java implementation of ShadowNode
- we already have logic to set the node size via UIManagerModule::updateNodeSize(). This code is now group together in updateState() for both new and old architecture
This fixes issues with resulting from wrong size calculation:
- having gaps at bottom when we set `statusBarTranslucent` to `true`
- Modal cut off at bottom on Android 15 (drawn under bottom nav bar)
Changelog:
[Android][Fixed] - Modal statusBarTranslucent bug, Modal at bottom being cut off in Android 15 (without forced edge-to-edge)
[Android][Deprecation] - Deprecating ModalHostShadowNode and ModalHostHelper classes
Reviewed By: mdvacca
Differential Revision: D62286026
fbshipit-source-id: 03b64a7783c12bebd1457c86a9a2657adc882c79
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46326
- renaming variabled to make intent more clear
- `dialog` -> `dialogWindow` to distinguish with `activity.window`
- `hostView` -> `dialogRootViewGroup` as name was confusing.
- `ReactModalHostView` creates and manages `DialogRootViewGroup` but it used as contentView for the Dialog.
- bug fixes
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D62177564
fbshipit-source-id: f81b167c1a234c02617ec2a3d63979628e01063b
Summary:
Reverts the PR https://github.com/facebook/react-native/pull/45967 from philIip to bring back the `registerCxxModuleToGlobalModuleMap(..)` function, which I use in Nitro Modules and MMKV.
Ontop of that, this also removes the "experimental" `RCT_EXPORT_CXX_MODULE_EXPERIMENTAL` macro, which I think was the original intent of this PR as this macro is a bit unsafe.
I also added some small docs to `registerCxxModuleToGlobalModuleMap` while I'm at it.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[GENERAL] [CHANGED] - Bring back CxxTurboModule autolinking function, but remove `RCT_EXPORT_CXX_MODULE_EXPERIMENTAL` macro
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/46360
Test Plan: Build Nitro Modules. Worked for me! :)
Reviewed By: realsoelynn
Differential Revision: D62310637
Pulled By: philIip
fbshipit-source-id: 2caa2b8ea094dda5e13c81431a9a645cbcf8f807
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46370
Add a function to write the current trace contents to a file. To be used by the upcoming Perfetto data source while we wait for devtools to work in a profiling build.
Reviewed By: rubennorte
Differential Revision: D62262985
fbshipit-source-id: 04789f5312721434c773e51b3da333498bf0e786
Summary:
Currently, `AnimatedNode.prototype.getListeners` creates an array with `Object.keys()` to determine the number of listeners.
This is a relatively hot code path for animation-intensive user interfaces. Although `Object.keys()` is fast, every unnecessary memory allocation is an unnecessary opportunity to create garbage that requires collection.
Using an object as a dictionary performs worst than using a `Map` anyway, so this switches `AnimatedNode` to use a `Map`.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D62267352
fbshipit-source-id: 8629861a64109a3a711c0f66a345029d0bfcd440
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46312
Refactors `NativeAnimatedHelper` to make it easier to read, reduce runtime overhead, and no longer export `queueOperation` (which was not useable externally anyway).
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D62139993
fbshipit-source-id: ce75e530887da6290f26060ecfe36049cf81879a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46366
This diff adds a Systrace section to the `SurfaceMountingManager::createViewUnsafe` method.
This will allow us to see more detail within the `MountItemDispatcher::mountViews preMountItems` that was previously almost blank.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D62247235
fbshipit-source-id: 3765c15e3e24e3231a30294938c725e82d100542
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46348
`continueWithTask` skips an extra invocation layer that `onSuccess` adds. Switch to Task<Void> as the task can already represent failure or success without needing a boolean.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D62213722
fbshipit-source-id: 631d741bd2ec4917eab69a20978ab2ace737c459
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46340
**Issue:**
InspectorPanel is hidden behind 3 button nav bar on Android 15 forced edge-to-edge
**Solution:**
Apply SafeAreaView to avoid overlap with system bars
(CAUTION: SafeAreaView here is for internal RN Core usage only and should not be used elsewhere)
Changelog:
[Internal]
Reviewed By: cortinico, mdvacca
Differential Revision: D62225374
fbshipit-source-id: e762288386d4f1d210bd26b8f28e73c652c7ba4e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46341
Issue: LogBox Notification (or toast) is partly hidden behind 3 button nav bar on Android 15 targetSdk 35 build
Solution: surround with SafeAreaView to avoid overlap with system bars
(CAUTION: SafeAreaView here is for internal RN Core usage only and should not be used elsewhere)
Changelog:
[Internal]
Reviewed By: cortinico, mdvacca
Differential Revision: D62224584
fbshipit-source-id: 0662b1be9822bf51dadec2dd4879c915a47dfc65
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46368
This bumps AGP to the latest stable.
Release notes are here https://developer.android.com/build/releases/gradle-plugin
No relevant changes for React Native, other than the requirement on minimum Gradle version.
Changelog:
[Android] [Changed] - Bump AGP to 8.6.0
Reviewed By: tdn120
Differential Revision: D62296897
fbshipit-source-id: c34a18ab15dbacd6e5d69003b9e192d7f76d9f8f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46347
Calculate a frame deadline, and compare the current time against that.
This will also allow us to make frame timing more dynamic in the future, based on the display's frame rate.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D62213710
fbshipit-source-id: 1c7fc4b67d08c1eda4f3b9612a4506b33c44f626
Summary:
This diff cleans up the `use_debounced_effects_for_animated` experiment. It is not shipped because it breaks semantics of Animated.
It also removes the implementation of now unused `useDebouncedEffect` hook.
bypass-github-export-checks
Facebook
Details here https://fb.workplace.com/groups/3611662615830335/permalink/3666119690384627/
Changelog: [Internal]
Reviewed By: bvanderhoof
Differential Revision: D62188361
fbshipit-source-id: ce215cf7dd57e41e02c33760e91808d774bbd919
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46338
**Issue:**
With forced edge-to-edge on Android 15, LogBox bottom tab bar is hidden behind 3 button nav bar and is unusable.
**Solution:**
LogBox is using Android Dialog so update it to set margins based on inset values. With this change we can get rid of android header logic from JS.
Changelog:
[Android][Changed] - Modify LogBox to be usable on Android 15
Reviewed By: mdvacca
Differential Revision: D62224124
fbshipit-source-id: 4721753bf340bd813bcd560052c52b63fa58ad4b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46354
**Issue:**
With forced edge-to-edge on Android 15, RNTester title at top overlaps with the status bar and bottom tab bar overlaps with bottom nav bar
**Solution:**
Add margins based on inset values to the ReactRootView which is the contentView for RNTesterActivity which acts as global padding within RNTester
Changelog:
[Android][Changed] - Adding padding for RNTester on Android 15 forced edge-to-edge
Reviewed By: mdvacca
Differential Revision: D62247910
fbshipit-source-id: 7b35d0c2016b6897b5de436a4245c9e910559541
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46346
Noticed that we could sometimes have multiple instances of DispatchUIFrameCallback in a single frame, which would cause us to execute more view preallocations or other work scheduled by Fabric. Root cause for this is on the new architecture, onHostResume seems to be invoked multiple times.
Make this code more resilient by explicitly tracking the state of the frame callback and avoiding multiple subscriptions. Longer-term we should consider having ReactChoreographer support repeating FrameCallbacks, since most of them are.
Changelog: [Android][Fixed] Fixed multiple Fabric dispatch callbacks being executed in a single Android frame
Reviewed By: sammy-SC
Differential Revision: D62213721
fbshipit-source-id: ac6fa5483ea38d9a15824af233fd23f1f6f3c891
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46295
X-link: https://github.com/facebook/metro/pull/1343
Updated all **babel** packages in all `package.json` across the repo and ran `npx yarn-deduplicate yarn.lock --scopes babel`. Afterwards, fixed the following issues appearing as a result of that (squashed the following initially separate diffs to make this packages update work atomically):
### (D61336392) updated jest snapshot tests failing
### (D61336393) updated babel types and corrected typings accordingly
The latest babel 7 introduces the following features we need to adjust our types to:
* `JSXNamespacedName` is removed from valid `CallExpression` args ([PR](https://github.com/babel/babel/pull/16421))
* `JSXNamespacedName` is used for namespaced XML properties in things like `<div namespace:name="value">`, but `fn(namespace:name)` doesn't make any sense.
* Dynamic imports are enabled behind a new flag `createImportExpressions` ([PR](https://github.com/babel/babel/pull/15682)), introducing calls such as `import(foo, options)`. These complicate the expected values passed to `import` to be more than just strings.
* Since these are behind a flag that is not expected to be enabled, we can throw an error for now and whoever uses it can add a support to it if needed later.
### Added a new metro ENV ignore
`BROWSERSLIST_ROOT_PATH` is set to `""` explicitly in `xplat/js/BUCK`
and then ignored in
`js/tools/metro-buck-transform-worker/src/EnvVarAllowList.js`
Reviewed By: robhogan
Differential Revision: D61543660
fbshipit-source-id: abbcab72642cf6dc03eed5142eb78dbcc7f63a86
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46345
Deriving transforms can be expensive on Android. When using NativeAnimated with transforms, especially with an EventBasedDriver, we may update the transform every frame, even if it's unchanged. Ideally, we'd fix this in Animated, and diff the previous and next values, but this closes the gap somewhat in the short-term.
Both JavaOnlyArray and ReadableNativeArray implement equals, but will not compare equality correctly with each other. That's not an issue, as it just means we'll redo the transform once more than necessary.
Changelog: [Android][Fixed] Optimize BaseViewManager#setTransform to ignore duplicate values
Reviewed By: NickGerleman
Differential Revision: D62213726
fbshipit-source-id: 5df026030c66e31eb6a5fe6353de3706b5b7b799
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46333
This pull request introduces enhancements to the view controller presentation logic in React Native, allowing for multiple sheets to be presented on top of each other. The current implementation restricts the presentation to a single view at a time, which limits the flexibility needed in complex applications.
The proposed changes modify the presentation behavior to always utilize the top-most view controller for presentations. This adjustment ensures that multiple sheets can be managed more effectively, without disrupting the existing application flow.
Key changes include:
Modification of the presentation logic to reference the top-most view controller.
Utilization of a recursive method to determine the top-most controller.
The changes have been thoroughly tested with both old and new interfaces and have shown to work seamlessly across different scenarios
Changelog: [Internal] Allow multiple sheets to be presented on top of each other
Reviewed By: jessebwr
Differential Revision: D62202475
fbshipit-source-id: daa0cf95edb23ea52a26441337f9a16f5475b211
Summary:
## Context
The error message in folly dynamic has been updated in D62136190. Updating related tests to reflect the change.
## Diff
Only test code is changed. No business logic change.
## Changelog:
[Internal] [Fixed] - Fix broken unit test due to folly error message change
Pull Request resolved: https://github.com/facebook/react-native/pull/46329
```
Shows details about the selected run from the run history
Run result
java.lang.AssertionError: Test failure
Test Case RecoverableError
* Running RecoverableError.RunRethrowingAsRecoverableRecoverTest
* Running RecoverableError.RunRethrowingAsRecoverableFallthroughTest
2/2 tests passed.
Test Case JsArgumentHelpersTest
* Running JsArgumentHelpersTest.args
***** Failure in xplat/js/react-native-github/packages/react-native/ReactCommon/cxxreact/tests/jsarg_helpers.cpp:108
Expected equality of these values:
ex.what()
Which is: "Error converting javascript arg 4 to C++: TypeError: expected dynamic type 'int/double/bool/string', but had type 'array'"
std::string("Error converting javascript arg 4 to C++: " "TypeError: expected dynamic type `int/double/bool/string', but had type `array'")
Which is: "Error converting javascript arg 4 to C++: TypeError: expected dynamic type `int/double/bool/string', but had type `array'"
0/1 tests passed.
Test Case JSBigFileString
```
Reviewed By: yfeldblum
Differential Revision: D62184078
fbshipit-source-id: 6ae0a33f58e0e10f14166084b80a997e59a008ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46318
Configures the Metro by default to use the Hermes parser so that React Native can fully leverage all modern Flow language syntax.
NOTE: This does not affect `*.ts` and `*.tsx` files which will continue to use Babel. Metro has logic to enforce this regardless of the transform options.
Changelog:
[General][Changed] - Changed Metro default config to use Hermes parser, enabling the use of advanced Flow syntax in React Native.
Reviewed By: robhogan
Differential Revision: D62161923
fbshipit-source-id: 0f4c069d429517be16abcc6a2187cd23c6bd52d4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46324
For listener sets that change infrequently, `CopyOnWriteArrayList` is a better trade-off compared to copying the list to iterate on it, especially in perf-sensitive paths like scrolling. Using `WeakReference` is also significantly simpler than `Collections.newSetFromMap(WeakHashMap`.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D62178024
fbshipit-source-id: bfc4f7389683b15be673dd7731094d52199d1c66
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46311
A straightforward move of `NativeAnimatedHelper` into the private directory, so that it does not impact our Public API.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D62142349
fbshipit-source-id: c93979e26e290d13e2a19fbe40d8f460ebea15fd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46316
This pull request introduces enhancements to the view controller presentation logic in React Native, allowing for multiple sheets to be presented on top of each other. The current implementation restricts the presentation to a single view at a time, which limits the flexibility needed in complex applications.
The proposed changes modify the presentation behavior to always utilize the top-most view controller for presentations. This adjustment ensures that multiple sheets can be managed more effectively, without disrupting the existing application flow.
Key changes include:
Modification of the presentation logic to reference the top-most view controller.
Utilization of a recursive method to determine the top-most controller.
The changes have been thoroughly tested with both old and new interfaces and have shown to work seamlessly across different scenarios
Changelog: [Internal] Allow multiple sheets to be presented on top of each other
Reviewed By: cipolleschi
Differential Revision: D62143463
fbshipit-source-id: 53667cf1a75e4514156780574bf604aee6b3fefc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46287
Changes `Animated` to avoid validating certain values in production builds to improve performance.
In order to maintain consistent behavior between development and production builds (so that we reduce the likelihood of bugs that only appear in one of the environments), this also changes the validation errors to use `console.error` instead of error throwing.
Changelog:
[General][Changed] - Changed `Animated` props validation to soft errors instead of thrown errors
Reviewed By: sammy-SC
Differential Revision: D62055674
fbshipit-source-id: 8e5732d00ab06e14ba8562f5190ce79ca240e374
Summary:
The following fixes were needed to restore a clean build of React Native Windows downstream.
- LayoutableShadowNode.cpp: Value must be cast to a float to avoid type conversion error.
- ValueUnit.h: Must add a default return statement. Switch statement alone produces compiler error that function may end with no return value.
## Changelog:
[GENERAL] [FIXED] - Upstream fixes for build errors in React Native Windows
Pull Request resolved: https://github.com/facebook/react-native/pull/46315
Test Plan: React Native Windows CI runs clean.
Reviewed By: javache, alanleedev
Differential Revision: D62149228
Pulled By: realsoelynn
fbshipit-source-id: 0d85455a22fbc0066076a50adee6b2d4409cd628
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46314
In Bridgeless's version of the Hermes JVM init path, we defaulted an internal GC option to allocate memory in Hermes' OldGen, and revert that behaviour once an internal API was called which marked the app as loaded.
This is an unsuitable default behaviour, since we can't rely on that internal API to be called on every launch. We're also moving to implicit performance instrumentation, which makes it harder to reliably call this API at the right time.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D61937427
fbshipit-source-id: 95e43fc093b56aee6362f43b6b0832d1f439fb3f