Commit Graph

38536 Commits

Author SHA1 Message Date
Alex Hunt 115918780d Update hermes-parser and related packages in fbsource to 0.23.1 (#45782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45782

Bump hermes-parser and related packages to [0.23.1](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

React Native specific changes: This removes all remaining syntax parsing exclude cases from `public-api-test` 🎉

Changelog: [Internal]

Differential Revision: D60375696

fbshipit-source-id: 35dbb17fe1b2b9bce7c7772e5735773ac50504e8
2024-08-07 12:41:47 -07:00
Alex Hunt 7c49df9d08 Set nativeSourceCodeFetching capability in jsinspector-modern targets (#45850)
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
2024-08-07 09:08:28 -07:00
Alex Hunt db3069b7ca Schedule IWebSocketDelegate event calls on inspector thread (#45849)
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
2024-08-07 09:08:28 -07:00
Alex Hunt 7cd1787e02 Implement HostTargetDelegate.networkRequest (Android Bridgeless) (#45666)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45666

Following https://github.com/facebook/react-native/pull/45664, implements the `networkRequest` method of `jsinspector_modern::HostTargetDelegate` for Android (Bridgeless).

Changelog: [Internal]

Differential Revision: D60232817

fbshipit-source-id: 109574392da21b2a698e061aa1847e17d17e662b
2024-08-07 09:08:28 -07:00
Alex Hunt 0c8ce2728e Implement HostTargetDelegate.networkRequest (Android Bridge) (#45664)
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
2024-08-07 09:08:28 -07:00
Rob Hogan c720583f6c Implement HostTargetDelegate.networkRequest on iOS (#44846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44846

Implement the `networkRequest` method of `jsinspector_modern::HostTargetDelegate` for iOS (bridge and bridgeless) to satisfy CDP `Network.loadNetworkResource` (etc) requests.

Changelog:
[iOS][Added] Debugger: Implement CDP methods for loading network resources through the debug target.

Differential Revision: D54496969

fbshipit-source-id: fdaf445dda69b621617decdba49ba89c42043a92
2024-08-07 09:08:28 -07:00
Dmitry Rykun 62231ea883 Introduce useDebouncedEffect
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
2024-08-07 08:41:06 -07:00
Oskar Kwaśniewski 05dec917f2 fix: Hermes build for visionOS simulator (Release) (#45911)
Summary:
Building for the visionOS simulator in the Release scheme requires an x86_64 slice to be included.

![CleanShot 2024-08-06 at 15 18 29@2x](https://github.com/user-attachments/assets/6fd962eb-ab71-4937-affe-964d8fa39f53)

## 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
2024-08-07 07:56:19 -07:00
Oskar Kwaśniewski c17da4e811 fix: minor fixes for hermes scripts (#45841)
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
2024-08-07 06:53:37 -07:00
Alex Hunt e9e5fb0141 Remove unstable_fuseboxEnabled API (#45926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45926

Removes the temporary `unstable_fuseboxEnabled` API on both platforms. Fusebox is enabled by default on `main` since https://github.com/facebook/react-native/pull/45469.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D60893243

fbshipit-source-id: 7ca4550eafb979730c0c5829df4c200f11e0df30
2024-08-07 06:40:13 -07:00
Nicola Corti 2ca01b4d04 Revert "Remove unnecessary git config --global --add safe.directory" (#45929)
Summary:
This reverts commit 9d9a8d2df6.

## Changelog:

[INTERNAL] - This reverts commit 9d9a8d2df6.

Pull Request resolved: https://github.com/facebook/react-native/pull/45929

Test Plan: CI

Reviewed By: blakef

Differential Revision: D60901502

Pulled By: cortinico

fbshipit-source-id: 2b7a7908a29f031c1f229907aa899a8a6960da4b
2024-08-07 06:39:31 -07:00
Andrew Datsenko baa366654e AssetSourceResolver: use resolver defined by PackagerAsset (#45897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45897

Changelog:
[General][Added] - Use PackagerAsset resolver instead of Platform.OS when its provided.

Reviewed By: christophpurrer

Differential Revision: D60670503

fbshipit-source-id: 9732b0ee3ec0cd1424bd83a4cc18924bcbd88db5
2024-08-07 05:40:05 -07:00
Andrew Datsenko 3f3a85b3c5 Add asset dest path resolver override (#45878)
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
2024-08-07 05:40:05 -07:00
Sam Zhou 5b96e90f77 Replace React.Element<any> and unnecessarily specific React.Element with React.MixedElement (#45923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45923

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D60872182

fbshipit-source-id: b81fb43968c52cbfdb4a9fa57f1175aabc2a3939
2024-08-06 21:33:08 -07:00
Nick Gerleman 82094dd9e3 Gracefully handle unexpected overlow values (#45917)
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
2024-08-06 20:45:25 -07:00
Nick Gerleman 8ed3838cbd Cleanup ReactNativeFeatureFlags.allowCollapsableChildren() (#45860)
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
2024-08-06 20:17:27 -07:00
David Vacca 10c91e9a38 Deprecate ReactFeatureFlags.enableBridgelessArchitecture (#45918)
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
2024-08-06 19:50:55 -07:00
David Vacca 0e91400857 Deprecate ReactFeatureFlags.useTurboModules (#45920)
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
2024-08-06 19:50:55 -07:00
David Vacca 3f35217856 Deprecate ReactFeatureFlags.enableFabricRenderer (#45921)
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
2024-08-06 19:50:55 -07:00
Nick Gerleman 35d9a18b81 Fix "setTranslucentBackgroundDrawable()" deprecation version (#45856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45856

No time traveling allowed.

Changelog:
[Android][Fixed] - Fix "setTranslucentBackgroundDrawable()" deprecation version

Reviewed By: joevilches

Differential Revision: D60569284

fbshipit-source-id: 364b0cde6f5117523289a2720128f44fd0e9e7db
2024-08-06 19:07:17 -07:00
Alan Lee 60c38c37aa Update helloworld tempate to minSdk 24 (#45905)
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
2024-08-06 17:13:48 -07:00
Omar Manjarrez Osornio fb67612e0b Revert D60453404: feat(iOS): implement automicallyAdjustsKeyboardInsets for new arch
Differential Revision:
D60453404

Original commit changeset: bd7ce5bac8fa

Original Phabricator Diff: D60453404

fbshipit-source-id: cda549be11288fa6cda03a4e6798125bac3c95e2
2024-08-06 15:36:52 -07:00
Jorge Cabiedes Acosta c3e2390be2 Fix missing empty check on isOnlyColorMatrixFilters() (#45916)
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
2024-08-06 15:07:39 -07:00
Nishan b99675d78a feat: linear gradient ios (#45434)
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
2024-08-06 13:59:33 -07:00
Fred Liu 09fd7528b6 Revert D60648823: ship use of passive effects in Animated
Differential Revision:
D60648823

Original commit changeset: 8efa1dac2a42

Original Phabricator Diff: D60648823

fbshipit-source-id: 6deb00df29f8e2ba8cb58d252c40144d2bed229e
2024-08-06 13:48:30 -07:00
Nick Gerleman 05e8b1061a Recreate Shadow RenderNode Display List If Needed (#45915)
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
2024-08-06 11:46:04 -07:00
Thomas Nardone d023e0aae5 Stop recycling before calling onViewStateDeleted v2 (#45913)
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
2024-08-06 11:11:55 -07:00
Samuel Susla 8bf5a12ea2 fix crash in RefreshControl (#45914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45914

changelog: [internal]

Fix a crash when SwipeRefreshLayout uses a custom child.

According to the docs, [SwipeRefreshLayout must override canChildScrollUp](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#canChildScrollUp()) method if a custom view is used.

On Android, we do use a custom view: https://fburl.com/code/kfaj8q9z

Reviewed By: Abbondanzo

Differential Revision: D60829986

fbshipit-source-id: 09e6bc690bb66131d614b1eedfbede615f42d2e1
2024-08-06 10:42:07 -07:00
Nick Gerleman 9035008427 Add Screenshot Tests for Image border, background, shadows (#45885)
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
2024-08-06 09:25:34 -07:00
Blake Friedman 28597168aa Fix failing Publish @react-native-community/template step (#45910)
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
2024-08-06 07:34:31 -07:00
Riccardo Cipolleschi 24e7f7d256 Try to restore caches for Hermes (#45908)
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
2024-08-06 06:41:35 -07:00
Riccardo Cipolleschi c7d238da13 Do not cancel jobs on main when new commits are pushed
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
2024-08-06 06:37:58 -07:00
Oskar Kwaśniewski 21bdce7286 feat(iOS): implement automicallyAdjustsKeyboardInsets for new arch (#45819)
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
2024-08-06 04:15:49 -07:00
Pavel Gurkovskii 3572ef3f1b T183626616 - [KP][WP iOS v] App crashes after rotation in landscape view during playing a video. (#45846)
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
2024-08-06 02:07:47 -07:00
Zeya Peng 67367a0bba Make normalizeEventType public (#45900)
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
2024-08-05 22:12:26 -07:00
Zeya Peng b0b898b460 ScrollEvent 2/n - use ScrollEvent over ScrollViewEventEmitter::Metrics (#45899)
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
2024-08-05 22:12:26 -07:00
Zeya Peng e7caad2ee4 ScrollEvent 1/n - Create ScrollEvent payload (#45851)
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
2024-08-05 22:12:26 -07:00
Sam Zhou ae73fe462e Replace React$Element that will cause an error in the future
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
2024-08-05 18:42:05 -07:00
Sam Zhou 4f47b385fa Cleanup all uses of internal flow type React$ElementRef in react-native (#45904)
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
2024-08-05 14:51:30 -07:00
Thibault Malbranche fbcb3d469c chore: changelog for 0.74.5 (#45898)
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
2024-08-05 13:30:07 -07:00
zhongwuzw 4e12c2e37c Fixes typo of function callFunctionOnBufferedRumtimeExecutor (#45902)
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
2024-08-05 13:02:04 -07:00
Samuel Susla 9ee50e5db9 ship use of passive effects in Animated (#45893)
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
2024-08-05 08:30:49 -07:00
Alex Hunt 7b34870564 Replace usage of Java OptionalInt (#45862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45862

Fixes compatibility with Android API < 24, and removes our `JOptionalInt` wrapper implementation for now.

Changelog: [Internal]

Reviewed By: robhogan, motiz88

Differential Revision: D60581676

fbshipit-source-id: 7e79fc59a4199a967e62ac3aeafc5d5681c60077
2024-08-05 08:15:45 -07:00
Jordan Brown fa3f769979 Deploy 0.242.0 to xplat (#45886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45886

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D60688497

fbshipit-source-id: 09c6daeef56e87317cbdb5c9ee0a8bc0828fa4ce
2024-08-05 07:04:16 -07:00
Blake Friedman 8689aa48bb AdditionalAnimatedNode → Kotlin
Summary: Changelog: [Android][Changed] AdditionalAnimatedNode.java → Kotlin

Reviewed By: rshest

Differential Revision: D60523059

fbshipit-source-id: de4e60854a03b5a6f061882c03cf191998888015
2024-08-05 05:21:36 -07:00
generatedunixname89002005232357 a4cd5994a7 Revert D57327835 (#45884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45884

Pull Request resolved: https://github.com/facebook/react-native/pull/44569
Changelog:
[Internal] -
Reverting this diff due to internal build crashes:

This converts the vertical of NativeArray/ReadableNativeArray/WritableNativeArray classes to Kotlin.

Reviewed By: bvanderhoof

Differential Revision: D60707170

fbshipit-source-id: 95e66ebe725d0ff625b50f4711872b9f70ec2f7c
2024-08-03 00:36:01 -07:00
Thomas Nardone 8d4fd07469 Fix up UIManagerModuleConstantsHelper + test (#45877)
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
2024-08-02 13:58:32 -07:00
Thomas Nardone a696d2ed6b Deprecate MapBuilder and remove Kotlin usages (#45743)
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
2024-08-02 13:58:32 -07:00
zhongwuzw a778979ed6 Fixes main thread stuck when reload in bridgeless mode (#45486)
Summary:
In fabric bridgeless mode, when we reload, main thread may block because of dead lock. the backtrace example as below:

```
(lldb) bt
* thread https://github.com/facebook/react-native/issues/1, stop reason = signal SIGSTOP
  * frame #0: 0x000000010a5c76f2 libsystem_kernel.dylib`__psynch_mutexwait + 10
    frame https://github.com/facebook/react-native/issues/1: 0x00000001099e0a70 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 78
    frame https://github.com/facebook/react-native/issues/2: 0x00000001099de82b libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 217
    frame https://github.com/facebook/react-native/issues/3: 0x00007ff80030c6b9 libc++.1.dylib`std::__1::mutex::lock() + 9
    frame https://github.com/facebook/react-native/issues/4: 0x0000000106968b13 RNTester`std::__1::lock_guard<std::__1::mutex>::lock_guard[abi:ue170006](this=0x00007ff7b95e2478, __m=0x000060000377c958) at lock_guard.h:35:10
    frame https://github.com/facebook/react-native/issues/5: 0x00000001069689ed RNTester`std::__1::lock_guard<std::__1::mutex>::lock_guard[abi:ue170006](this=0x00007ff7b95e2478, __m=0x000060000377c958) at lock_guard.h:34:19
    frame https://github.com/facebook/react-native/issues/6: 0x00000001070691c1 RNTester`-[RCTInstance invalidate](self=0x000060000377c900, _cmd="invalidate") at RCTInstance.mm:146:31
    frame https://github.com/facebook/react-native/issues/7: 0x0000000107060fd2 RNTester`-[RCTHost didReceiveReloadCommand](self=0x0000600003d100f0, _cmd="didReceiveReloadCommand") at RCTHost.mm:317:3
    frame https://github.com/facebook/react-native/issues/8: 0x0000000106b005a5 RNTester`RCTTriggerReloadCommandListeners(reason=@"Global hotkey") at RCTReloadCommand.m:57:5
    frame https://github.com/facebook/react-native/issues/9: 0x0000000106b86da5 RNTester`__28-[RCTDevSettings initialize]_block_invoke.157(.block_descriptor=0x0000000107496170, params=0x00007ff84002f610) at RCTDevSettings.mm:201:11
    frame https://github.com/facebook/react-native/issues/10: 0x0000000106ae658e RNTester`__65-[RCTPackagerConnection reconnectingWebSocket:didReceiveMessage:]_block_invoke.68(.block_descriptor=0x0000600000c82df0) at RCTPackagerConnection.mm:293:9
    frame https://github.com/facebook/react-native/issues/11: 0x0000000109a4529d libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame https://github.com/facebook/react-native/issues/12: 0x0000000109a4658f libdispatch.dylib`_dispatch_client_callout + 8
    frame https://github.com/facebook/react-native/issues/13: 0x0000000109a563ee libdispatch.dylib`_dispatch_main_queue_drain + 1362
    frame https://github.com/facebook/react-native/issues/14: 0x0000000109a55e8e libdispatch.dylib`_dispatch_main_queue_callback_4CF + 31
    frame https://github.com/facebook/react-native/issues/15: 0x00007ff800429af4 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame https://github.com/facebook/react-native/issues/16: 0x00007ff80042442f CoreFoundation`__CFRunLoopRun + 2463
    frame https://github.com/facebook/react-native/issues/17: 0x00007ff8004236ad CoreFoundation`CFRunLoopRunSpecific + 557
    frame https://github.com/facebook/react-native/issues/18: 0x00007ff8103da08f GraphicsServices`GSEventRunModal + 137
    frame https://github.com/facebook/react-native/issues/19: 0x00007ff805cc0ad1 UIKitCore`-[UIApplication _run] + 972
    frame https://github.com/facebook/react-native/issues/20: 0x00007ff805cc5551 UIKitCore`UIApplicationMain + 123
    frame https://github.com/facebook/react-native/issues/21: 0x00000001069205a0 RNTester`main(argc=1, argv=0x00007ff7b95e3b60) at main.m:15:12
    frame https://github.com/facebook/react-native/issues/22: 0x00000001099023e0 dyld_sim`start_sim + 10
    frame https://github.com/facebook/react-native/issues/23: 0x0000000116b92366 dyld`start + 1942

(lldb) bt
* thread https://github.com/facebook/react-native/issues/3
    frame #0: 0x000000010a5c6b86 libsystem_kernel.dylib`__ulock_wait + 10
    frame https://github.com/facebook/react-native/issues/1: 0x0000000109a46eb1 libdispatch.dylib`_dlock_wait + 46
    frame https://github.com/facebook/react-native/issues/2: 0x0000000109a46d08 libdispatch.dylib`_dispatch_thread_event_wait_slow + 40
    frame https://github.com/facebook/react-native/issues/3: 0x0000000109a5774a libdispatch.dylib`__DISPATCH_WAIT_FOR_QUEUE__ + 371
    frame https://github.com/facebook/react-native/issues/4: 0x0000000109a57161 libdispatch.dylib`_dispatch_sync_f_slow + 240
    frame https://github.com/facebook/react-native/issues/5: 0x0000000106b3b33b RNTester`RCTUnsafeExecuteOnMainQueueSync(block=0x0000000106f116c0) at RCTUtils.m:291:5
  * frame https://github.com/facebook/react-native/issues/6: 0x0000000106f115ad RNTester`-[RCTFabricSurface start](self=0x000000010af0df40, _cmd="start") at RCTFabricSurface.mm:102:3
    frame https://github.com/facebook/react-native/issues/7: 0x00000001070601ce RNTester`__108-[RCTHost initWithBundleURLProvider:hostDelegate:turboModuleManagerDelegate:jsEngineProvider:launchOptions:]_block_invoke_2(.block_descriptor=0x0000600000c75590) at RCTHost.mm:211:9
    frame https://github.com/facebook/react-native/issues/8: 0x000000010706cdc8 RNTester`-[RCTInstance _loadScriptFromSource:](self=0x000060000377c900, _cmd="_loadScriptFromSource:", source=0x0000600000cd57d0) at RCTInstance.mm:472:5
    frame https://github.com/facebook/react-native/issues/9: 0x000000010706ca81 RNTester`__29-[RCTInstance _loadJSBundle:]_block_invoke.120(.block_descriptor=0x0000600000c96d00, error=0x0000000000000000, source=0x0000600000cd57d0) at RCTInstance.mm:452:9
    frame https://github.com/facebook/react-native/issues/10: 0x0000000106ab1919 RNTester`invocation function for block in attemptAsynchronousLoadOfBundleAtURL(.block_descriptor=0x00006000017b0fc0, statusCode=200, headers=6 key/value pairs, data=0x00006000002a4760, error=0x0000000000000000, done=YES) block_pointer, void (NSError*, RCTSource*) block_pointer) at RCTJavaScriptLoader.mm:318:9
    frame https://github.com/facebook/react-native/issues/11: 0x0000000106ad92a6 RNTester`__80-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]_block_invoke(.block_descriptor=0x000070000035c7a0, headers=6 key/value pairs, content=0x00006000002a4760, done=YES) at RCTMultipartDataTask.m:121:9
    frame https://github.com/facebook/react-native/issues/12: 0x0000000106ad9b4f RNTester`-[RCTMultipartStreamReader emitChunk:headers:callback:done:](self=0x00006000002b4220, _cmd="emitChunk:headers:callback:done:", data=0x00006000002a4020, headers=6 key/value pairs, callback=0x0000000106ad9230, done=YES) at RCTMultipartStreamReader.m:57:5
    frame https://github.com/facebook/react-native/issues/13: 0x0000000106ada800 RNTester`-[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:](self=0x00006000002b4220, _cmd="readAllPartsWithCompletionCallback:progressCallback:", callback=0x0000000106ad9230, progressCallback=0x0000000106ab2a60) at RCTMultipartStreamReader.m:154:7
    frame https://github.com/facebook/react-native/issues/14: 0x0000000106ad9130 RNTester`-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:](self=0x00006000017b0d40, _cmd="URLSession:streamTask:didBecomeInputStream:outputStream:", session=0x000000010e02a0a0, streamTask=0x000000010c83ba00, inputStream=0x000060000300d4d0, outputStream=0x000060000300c990) at RCTMultipartDataTask.m:119:20
    frame https://github.com/facebook/react-native/issues/15: 0x00007ff80479fdf9 CFNetwork`___lldb_unnamed_symbol2876 + 42
    frame https://github.com/facebook/react-native/issues/16: 0x0000000109a4529d libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame https://github.com/facebook/react-native/issues/17: 0x0000000109a4658f libdispatch.dylib`_dispatch_client_callout + 8
    frame https://github.com/facebook/react-native/issues/18: 0x0000000109a4e4ba libdispatch.dylib`_dispatch_lane_serial_drain + 1127
    frame https://github.com/facebook/react-native/issues/19: 0x0000000109a4f255 libdispatch.dylib`_dispatch_lane_invoke + 441
    frame https://github.com/facebook/react-native/issues/20: 0x0000000109a5c356 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 318
    frame https://github.com/facebook/react-native/issues/21: 0x0000000109a5b751 libdispatch.dylib`_dispatch_workloop_worker_thread + 590
    frame https://github.com/facebook/react-native/issues/22: 0x00000001099dfb84 libsystem_pthread.dylib`_pthread_wqthread + 327
    frame https://github.com/facebook/react-native/issues/23: 0x00000001099deacf libsystem_pthread.dylib`start_wqthread + 15
```

## Changelog:

[IOS] [FIXED] - Fixes main thread stuck when reload in bridgeless mode

Pull Request resolved: https://github.com/facebook/react-native/pull/45486

Test Plan: RNTester, enables fabric, which is very easy to repro by tapping `r`  command multiple times quickly to trigger reload.

Reviewed By: philIip

Differential Revision: D59911929

Pulled By: cipolleschi

fbshipit-source-id: e7e431a11d26c399fa767b6cbf45e16bce24b9a0
2024-08-02 13:48:31 -07:00
Ruslan Shestopalyuk 878e1f3d93 Migrate NativeArray classes to Kotlin (#44569)
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
2024-08-02 10:56:27 -07:00