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
Summary:
This PR implements the missing `automicallyAdjustsKeyboardInsets` for new architecture.
After fixing this I've noticed there is an open issue (https://github.com/facebook/react-native/issues/45647) with somebody assigned (sorry shubhamguptadream11 for taking your task)
Here is the app running on new arch:
https://github.com/user-attachments/assets/673f0587-6a67-47e3-8050-d6ee33a45724
## Changelog:
[IOS] [FIXED] - implement automicallyAdjustsKeyboardInsets for new arch
Pull Request resolved: https://github.com/facebook/react-native/pull/45819
Test Plan:
1. Test out ScrollViewKeyboardInsets example
2. See if it works the same with old and new arch
Reviewed By: sammy-SC
Differential Revision: D60453404
Pulled By: cipolleschi
fbshipit-source-id: bd7ce5bac8facffc527106b50c54112acf687bc3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45846
In general this diff fixes all crashes related to RTCImageUtills happened because of uncovered cases in switch.
In this current bug the problem was in this part of code
RCTTargetSize(imageSize, imageScale, frame.size, RCTScreenScale(), (RCTResizeMode)self.contentMode, YES);
when we cast UIViewContentMode to RCTResizeMode. RCTResizeMode doesnt cover all of UIViewContentMode values.
So just added default cases to swithces in places where it was lost.
Changelog:
[iOS][Fixed] - fixed crash in RCTImageUtils
Reviewed By: philIip
Differential Revision: D60523540
fbshipit-source-id: b8027537c600a7ca226e62238d16a6b05301d4de
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45900
Changelog: [internal]
make `normalizeEventType` public, it looks like a nice util when we want to write code to intercept event, e.g. "scroll" event could be named as "onScroll" or "topScroll", this function contains the source of truth of how RN parses it
Reviewed By: christophpurrer
Differential Revision: D60767388
fbshipit-source-id: b3880fda57e2d92d9d199db5f5d39b8a8435820c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45899
Changelog: [internal]
replace ScrollViewEventEmitter::Metrics for ScrollEvent payload type created earlier
make ScrollViewEventEmitter::Metrics an alias of ScrollEvent as well
Reviewed By: christophpurrer
Differential Revision: D60767390
fbshipit-source-id: 8db88c0e1fa837b5dbad92d7bcce825882feaaf6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45851
Create ScrollEvent payload type, so we can unwrap the scroll event metrics if intercept it in C++
Changelog: [internal]
Reviewed By: christophpurrer
Differential Revision: D60526048
fbshipit-source-id: 219a690ccf67d0b1c90e3496b8e5970ab7e2a79b
Summary:
For the ones where `React.MixedElement` would suffice, I change them to `React.MixedElement`. For everything else, I changed it to be `React.Element`
Changelog: [Internal]
Reviewed By: gkz
Differential Revision: D60798229
fbshipit-source-id: 40176b44769aade2c6b63a680d03c10056b2ddfa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45904
Flow will error on these dollar types soon. For all the ones changed here, they can all be further simplified.
Changelog: [Internal]
Reviewed By: gkz
Differential Revision: D60786768
fbshipit-source-id: e26bf0be1c4a933fc0bd8b59827e10cbd7242a83
Summary:
Adds changelog for the 0.74.5 patch.
## Changelog:
<!-- 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
-->
[Internal] [Changed] - Add 0.74.5 changelog
Pull Request resolved: https://github.com/facebook/react-native/pull/45898
Reviewed By: christophpurrer
Differential Revision: D60768626
Pulled By: arushikesarwani94
fbshipit-source-id: 62196fc8a4fec1ff992ecc4622116b97dd96b79b
Summary:
I introduced a typo in https://github.com/facebook/react-native/issues/45486 . Thanks migueldaipre
for the catch-up. cc cipolleschi
## Changelog:
[IOS] [FIXED] - Fixes typo of function callFunctionOnBufferedRumtimeExecutor
Pull Request resolved: https://github.com/facebook/react-native/pull/45902
Test Plan: Just a typo.
Reviewed By: cipolleschi
Differential Revision: D60775511
Pulled By: arushikesarwani94
fbshipit-source-id: da781ea5ecf2e0a15e5419430240e10194043b1b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45893
changelog: [internal]
This is mainly impact for the Event Loop where setting up of animation graph will no longer block paint.
Reviewed By: rubennorte
Differential Revision: D60648823
fbshipit-source-id: 8efa1dac2a42b14a609adae05e9266f78a181d43
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45877
A couple fixes:
- Test was mixing up event names - refactored to make the code [hopefully] clearer
- Code potentially recreates `events` if it's a singleton map, but that was lost due to it not being returned
Changelog: [Internal] Minor fix to UIManagerModuleConstantsHelper
Reviewed By: cortinico
Differential Revision: D60609294
fbshipit-source-id: 3c82ba30b9401674e678585b1612324f885c9ae1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45743
This is a Java-centric class that can be replaced by Kotlin's map extensions.
Changelog:
[Android][Deprecated] Deprecate MapBuilder
Reviewed By: cortinico
Differential Revision: D60309106
fbshipit-source-id: 4a764fa1d59993dc735b2181a2270dc79a0e0396
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44569
# Changelog:
[Internal] -
This converts the vertical of NativeArray/ReadableNativeArray/WritableNativeArray classes to Kotlin.
NOTE: the `getArray`, `getMap` and `getString` being annotated as `NonNull` in the Java code is a scam - there is no guarantee that native side will send non-null to the Java side, and in practice, indeed, in certain cases it doesn't. So I opted to make it nullable instead - this way it's at least explicit and is not a ticking bomb hidden to explode behind the false sense of security.
Reviewed By: javache
Differential Revision: D57327835
fbshipit-source-id: 1b546b2ff22af2be903fe6ab91f0148b645595fb