Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45945
This code is forked on iOS, where we have been, as a policy, avoiding Paper-specific changes. This code is shared between renderers on Android, but it is confusing developer experience to have it work on Android Paper, to then fail on iOS unless it is on new arch.
This change disables support on Android Paper for consistency.
Changelog:
[Android][Removed] - Gate off % border radii on Android Paper
Reviewed By: cortinico
Differential Revision: D60967347
fbshipit-source-id: 1d26bc71aee677aa9a0dc9bb38f781a99c7762a8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45783
Improves type strictness in the `react-native` package.
- Break out `URLSearchParams` from `URL.js` into its own module, to isolate a `$FlowFixMe[unsupported-syntax]` suppression within that definition.
- Update `public-api-test` to require an adjacent `<module>.js.flow` type definition file whenever a `$FlowFixMe[unsupported-syntax]`is present.
- Add `URLSearchParams.js.flow` with a Flow parser compatible typedef (`@iterator` instead of `[Symbol.iterator]`).
The result of these changes is to add missing typedef test coverage for `Libraries/Blob/URL.js` (see updated test snapshots).
Changelog: [Internal]
Reviewed By: hoxyq
Differential Revision: D60376327
fbshipit-source-id: 93c0949289a4b53f621f563769ffb68d5dc38d91
Summary:
This PR fixes Cache repear
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
[INTERNAL] [FIXED] - Cache repear job
Pull Request resolved: https://github.com/facebook/react-native/pull/45943
Test Plan: CI Green
Reviewed By: blakef
Differential Revision: D60962822
Pulled By: cortinico
fbshipit-source-id: 453153005bbc1b99dbe569eb6be77d17c8a176db
Summary:
Added a check in setRemoteJSDebugEnabled in DevSupportManagerBase.java to check for PREFS_REMOTE_JS_DEBUG_KEY to see if the value has changed.
Fix for https://github.com/facebook/react-native/issues/45399 - App restarting when `NativeDevSettings.setIsDebuggingRemotely` is used in a landing component. If this was invoked from a component load or action that would fire on app start, it was creating an infinite loop where the app would keep on restart before eventually leading to a crash.
## Changelog:
[ANDROID] [FIXED] - Fix issue with `NativeDevSettings.setIsDebuggingRemotely` where the app would keep on restarting if remote debugging was invoked from an action / component that was called on app start.
Pull Request resolved: https://github.com/facebook/react-native/pull/45775
Test Plan:
Create a new project using RN CLI.
Set `newArchEnabled=false`.�
Install modules using `yarn install`.�
Build from source for Android by setting the following in `settings.gradle`-�
```
includeBuild('../node_modules/react-native') {
dependencySubstitution {
substitute(module("com.facebook.react:react-android")).using(project(":packages:react-native:ReactAndroid"))
substitute(module("com.facebook.react:react-native")).using(project(":packages:react-native:ReactAndroid"))
substitute(module("com.facebook.react:hermes-android")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
substitute(module("com.facebook.react:hermes-engine")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
}
}
```
Set the ANDROID_HOME and ANDROID_NDK_HOME environment variables required for react native.�Call `NativeDevSettings.setIsDebuggingRemotely` from App.tsx which is the landing component.�
Test with both `hermesEnabled=true` and `hermesEnabled=false` and ensure that app does not keep on restarting after fix.
Reviewed By: cipolleschi
Differential Revision: D60377406
Pulled By: huntie
fbshipit-source-id: c8faf184b50b67f50f8a4b6851df9d0ef3350949
Summary:
This diff sets up an experiment to use `useDebouncedEffect` for managing animated props lifecycle.
Changelog: [Internal]
bypass-github-export-checks
Facebook
This diff also defaults to `useDebouncedEffect` for managing animated props lifecycle in IGVR and FBVR.
Based on local tracing of FBVR, `useDebouncedEffect` results in **~19ms faster visual completion**.
Before we executed **54.2 ms** of passive effects vs **35.6 ms** after.
Reviewed By: josephsavona, rubennorte
Differential Revision: D60834116
fbshipit-source-id: 35d5eb4c4be18e716f96129911e66eaffe54bb17
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45941
Quick fix to avoid imports from Swift chaining to Objective-C++ headers. Will follow up with a redesign.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D60960077
fbshipit-source-id: 4ce9507900196d5298c7885a99a5e4d786f76982
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45930
This introduces the `enableEventEmitterRetentionDuringGesturesOnAndroid` that allows us to gate the
fix for bug #45126 and #44610.
Changelog:
[Internal] [Changed] - Introduce the enableEventEmitterRetentionDuringGesturesOnAndroid to gate the Pressable fix
Reviewed By: mdvacca
Differential Revision: D60908117
fbshipit-source-id: 885917832718d9b90d043b2d7e2cdb47e0f01ea7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45865
This diff introduces the logic to defer the destruction of ViewState (and EventEmitter) for views that are currently touched on by the user. The idea is to let the UIManager know which view is currently active from the `JSTouchDispatcher` and eventually defer the view deletion till the view is not interacted anymore.
The JSTouchDispatcher already retains the information on which tag was the touch originally fired.
We'll pass over that information to the UIManager/SurfaceMountingManager so that it can be accounted for when the view has to be deleted.
This is causing a couple of bad bugs on Android:
Fixes https://github.com/facebook/react-native/issues/45126
Fixes https://github.com/facebook/react-native/issues/44610
Closes https://github.com/facebook/react-native/pull/45675
Changelog:
[Android] [Fixed] - Do not destroy views when there is a touch going on for New Architecture
Reviewed By: mdvacca
Differential Revision: D60594878
fbshipit-source-id: c3334d16cf305e0178f50772576050ebfbba85ec
Summary:
This PR enables the `cache-repear.yml` only for the main repository. This is running constantly on forks creating lots of notifications and it's mostly needed only for the main repo.

## Changelog:
[INTERNAL] [CHANGED] - Run `cache-repear.yml` only on main repo
Pull Request resolved: https://github.com/facebook/react-native/pull/45940
Test Plan: CI GREEN
Reviewed By: blakef
Differential Revision: D60957003
Pulled By: cortinico
fbshipit-source-id: 2f250d734688739a278095af8d860a54426604bf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45922
Introduce the ReactNativeNewArchitectureFeatureFlagsDefaults class, which initializes default values for ReactNativeFeatureFlags when the New architecture is enabled.
This class is meant to be overrode by ReactNativeNewArchitectureFeatureFlagsDefaults or others apps migrating to the new architecture.
changelog: [internal] internal
Reviewed By: philIip
Differential Revision: D60861873
fbshipit-source-id: b31ba947dae999fea8bb4effd63c56dc142a5c3d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45934
The OSS impl of gradient was wrong, and ends up skipping shadows if it is not defined. Fixed that.
Changelog: [Internal]
Reviewed By: jorge-cab
Differential Revision: D60917620
fbshipit-source-id: 3d4ea3e8084d33fa5d15fb82d45cfd063143087c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45850
Enables the `nativeSourceCodeFetching` capability flag for the modern debugger stack on both Android and iOS. This disables source code fetching hacks within the Inspector Proxy layer and instead enables the debugger server to handle all source code fetching directly on the device.
Changelog: [Internal]
Differential Revision: D60236216
fbshipit-source-id: 1239b4d7d2233852f007114721b202d90459fa06
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45849
This fixes a bug where we were calling `delegate.didReceiveMessage` (and other handlers) from multiple threads on Android. In particular, with the addition of `Network.loadNetworkResource` in D54496969, we observed memory access issues in the implementation for `IO.read` in `NetworkIOAgent` after multiple successive requests are received.
This approach updates the Android-specific implementation of `IWebSocketDelegate` to schedule delegate handler and `close` calls on the inspector thread.
Changelog: [Internal]
Differential Revision: D60520747
fbshipit-source-id: 459b44b424157793faaf5967435e1303a0061292
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45664
Implement the `networkRequest` method of `jsinspector_modern::HostTargetDelegate` for Android (Bridge). This diff introduces a common `InspectorNetworkHelper` class that will be shared for the Bridgeless implementation.
This change allows the modern debugger server to handle CDP `Network.loadNetworkResource` (etc) requests. Notably, resources in the Chrome DevTools Sources panel will now be loaded by the backend.
Changelog: [Internal]
Differential Revision: D60036502
fbshipit-source-id: 5fdca7f34634c7541395041025bef62ddfad9eab
Summary:
This diff introduces the `useDebouncedEffect` hook. It should be used for expensive effects that can be scheduled asynchronously, not blocking the rendering.
Changelog: [Internal]
bypass-github-export-checks
Facebook
This a copy of https://www.internalfb.com/code/fbsource/xplat/js/RKJSModules/public/xplat-react/shared/core/react_hooks/DebouncedEffectImplementation.js
I put it here temporarily to be able to run an experiment with `Animated`. We should come up with a better way to introduce this hook to OSS.
I'm bypassing GH export to not to draw extra attention to this.
Reviewed By: rubennorte
Differential Revision: D60762745
fbshipit-source-id: c13b20424360493a7fc94dc27264591a7253f77f
Summary:
Building for the visionOS simulator in the Release scheme requires an x86_64 slice to be included.

## Changelog:
[IOS] [FIXED] - Include x86_64 slice when building for visionOS simulator
Pull Request resolved: https://github.com/facebook/react-native/pull/45911
Test Plan: CI Green
Reviewed By: GijsWeterings
Differential Revision: D60828872
Pulled By: cipolleschi
fbshipit-source-id: 74444ac0b6661baf427837d242ba0ca295da0d16
Summary:
This PR fixes few issues with Hermes scripts:
- Set visionOS vendored frameworks
- Fail if env variables are not set
## Changelog:
[INTERNAL] [FIXED] - Hermes script should fail when no deployment target is set
Pull Request resolved: https://github.com/facebook/react-native/pull/45841
Test Plan: Try to build Hermes
Reviewed By: blakef
Differential Revision: D60901886
Pulled By: cipolleschi
fbshipit-source-id: b9ff470ac6c07e1bd5abc7410ac0c366d66016c5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45878
Changelog:
[General][Added] - Add optional `PackagerAsset.resolver` prop so AssetSourceResolver can use it instead of `Platform.OS` to identify where asset is stored on device.
Reviewed By: rshest
Differential Revision: D60447815
fbshipit-source-id: 44fb8510746905ca0cd266144e213c40a3fa86a9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45917
Did this the right way for BorderStyle, but not for Overflow.
Changelog:
[Android][Fixed] - Gracefully handle unexpected overlow values
Reviewed By: necolas
Differential Revision: D60853891
fbshipit-source-id: e641e62e9e301681a1be190d8158f793ec17c1f5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45860
This has been on by default for a long while.
Changelog: [Internal]
Reviewed By: philIip
Differential Revision: D60579198
fbshipit-source-id: 4bd8a13dada8edf00489dc64b1ff4ff0364a8843
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45918
In this diff we are deprecating ReactFeatureFlags.enableBridgelessArchitecture, this flag will be deleted in the next version of ReactNative (0.77)
Please use DefaultNewArchitectureEntryPoint.load() to enable TurboModules.
changelog: [Android][Deprecated] deprecate ReactFeatureFlags.enableBridgelessArchitecture
Reviewed By: philIip
Differential Revision: D60853317
fbshipit-source-id: 2476bb81887893cedc8d43b117c10cd9d96bdee3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45920
In this diff we are deprecating ReactFeatureFlags.useTurboModules, this flag will be deleted in the next version of ReactNative (0.77)
Please use DefaultNewArchitectureEntryPoint.load() to enable TurboModules.
changelog: [Android][Deprecated] deprecate ReactFeatureFlags.useTurboModules
Reviewed By: philIip
Differential Revision: D60853315
fbshipit-source-id: 084ef8073daae16b288d82ececf770fd4b68e80c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45921
In this diff we are deprecating ReactFeatureFlags.enableFabricRenderer, this flag will be deleted in the next version of ReactNative (0.77)
Please use DefaultNewArchitectureEntryPoint.load() to enable fabric instead.
changelog: [Android][Deprecated] deprecate ReactFeatureFlags.enableFabricRenderer
Reviewed By: philIip
Differential Revision: D60853316
fbshipit-source-id: f9883a68771c8db8f24269630b0950e96741cf9d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45905
- Updating minSdk to 24 before we do the update for the RN
Changelog: [Internal]
Reviewed By: blakef
Differential Revision: D60788291
fbshipit-source-id: d21d766159a04d79547e64fca802600279d08255
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45916
When a Filter was removed by state update we missed this check which led to setting the layer type to HARDWARE incorrectly
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D60840169
fbshipit-source-id: e375e7d25c85e9d031c1e1a0795c49687e0018e7
Summary:
- Adds `background` prop that supports CSS's linear gradient. Later this can be extended to support various other gradients and possibly CSS's background image (less motivation as better solutions exists for image)
- Uses `CAGradientlayer` to draw Linear Gradient layers. So it is GPU optimised under the hood.
- Style supports JS object to specify `LinearGradient`, so it can support Animated libraries.
## Changelog:
[IOS] [ADDED] - linear gradient
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[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/45434
Test Plan:
- Check out `processBackground-test.js` for supported syntax testcases.
- Checkout example added in ViewExample.js
Although the PR is tested well but open to any changes/feedback on the approach taken.
Android PR - https://github.com/facebook/react-native/pull/45433. Separated the PRs to keep it easier to review. Both PRs can be reviewed individually.
Reviewed By: NickGerleman
Differential Revision: D60791581
Pulled By: joevilches
fbshipit-source-id: 051088fdf68d9fe20c0c306f1f1c591cbd77f3d5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45915
We avoid recomputing the RenderNode display list for shadow shape when the inputs have not changed, but Android may clear the display list itself, in which case we need to recreate it.
Changelog: [Internal]
Reviewed By: rozele
Differential Revision: D60833553
fbshipit-source-id: fe1ea04b13f85dda6af2761693e7c664794235e1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45913
Changelog: [Internal] - Call ViewManagers' onSurfaceStopped() before onDropViewInstance()
This allows `ViewManager` to call `mRecyclableViews.remove(surfaceId)` before it wastes time on `prepareToRecycleView()` for views in a stopped surface.
Reviewed By: sammy-SC
Differential Revision: D60806242
fbshipit-source-id: d5eaaa5443fcb1d9390d8b84e0b5069618bb175e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45885
There are some gaps here right now, but Android API 31+ is looking good.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D60731848
fbshipit-source-id: f515270a61a00c362b584f0d1549d14098c2e385
Summary:
In build_npm_package, the publishing of the bumped template is [failing](https://github.com/facebook/react-native/actions/runs/10148492447/job/28063424722)
because it's running in sh instead of bash, but using bash syntax.
## Changelog: [Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/45910
Test Plan:
~~I'm unclear on how to test this, and the fix is very much speculative based on other having hit a similar issue.~~
I've had to stub some of the values that the action substitutes.
Reviewed By: cortinico
Differential Revision: D60828697
Pulled By: blakef
fbshipit-source-id: 0a8f909ae5219268f034e5ff0efb8acc94bdb7b1
Summary:
We had CI on main failing consistently the past couple of days.
The problem is that the hermes pipeline is failing to create the iOS XCFramework with the error:
> unable to create a Mach-O from the binary at '/Users/runner/work/react-native/react-native/packages/react-native/sdks/hermes/destroot/Library/Frameworks/catalyst/hermes.framework/hermes'
The main cause is this upgrade of [upload-artifacts](https://github.com/actions/upload-artifact/issues/590) which breaks symlinks.
The solution is to bump the caches and downgrade the `upload-artifact` actions.
## Changelog:
[Internal] - Try to fix CI for Hermes
Pull Request resolved: https://github.com/facebook/react-native/pull/45908
Test Plan: GHA must be green
Reviewed By: cortinico
Differential Revision: D60828616
Pulled By: cipolleschi
fbshipit-source-id: 6976b86dd67e2fd9d806ebaa62f47e39dc44b30d
Summary:
Last month, during the migration to GHA, we decided to reimplement the same behavior we had in CCI: when a new commit comes in, we stop executing tests on the previous one.
This behavior is great to save money, but on main it has the side effect that it makes it hard to detect when the ci was broken.
\With this change, we want to disable this behvior on main while keeping it in PRs.
After this change, when a new commit arrives on main, the previous jobs will not be interrupted
## Changelog
[Internal] - Do not cancel jobs on main when new commits are pushed.
Reviewed By: cortinico, blakef
Differential Revision: D60822657
fbshipit-source-id: 38561438f2e2850a94220d732cd73a09d04e8b81