Commit Graph

38536 Commits

Author SHA1 Message Date
Joe Vilches d99960744c Inset box shadow impl (#45242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45242

tsia, comments should explain how this works but tldr is

* Set up cropping region to only draw within the view's bounds
* Draw 2 offscreen rects to cast the shadow. One represents the bounds of the original view, the other represents the clear region. Fill these rects with EO fill algo so the intersection is clear. The disjoint will be colored and cast a shadow.
* Do that for each shadow in reverse order

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: lenaic

Differential Revision: D58885576

fbshipit-source-id: 2f3a5de75e93c7d34676128bbddbe38d64f1fb59
2024-07-02 13:44:58 -07:00
Joe Vilches a3cf1624d0 Outset box shadow impl
Summary:
tisa. Algo is

* Draw offscreen rect the size of the outset shadow (so accounting for spread)
* Set g state to cast shadow in proper place ON screen
* Clear out region in view

The rects need to be offscreen for the following reasons
* We need to account for spread radius, and CGContext shadows do not have support for this. So the only way to create a bigger shadow is the create a path that is the same size as the shadow we want
* We cannot just position this rect onscreen with no offset (so the shadow is casting directly under it) since the blur will look unnatural
* Offscreen means we do not see filled shadow rect but we do see the shadow it casts by offsetting it in the proper location

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D58881588

fbshipit-source-id: 2ea1b8945a3b9f182c4fb11668ac91a0ae7846ca
2024-07-02 13:44:58 -07:00
Joe Vilches 24d7cc15db Parse raw box shadow props (#44882)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44882

tsia, nothing too fancy here. Just taking the box shadows from raw props and throwing them into a struct so we can read it.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: NickGerleman

Differential Revision: D57617028

fbshipit-source-id: 29cf683b663b4903721d674efbf61a200eaf3a64
2024-07-02 13:44:58 -07:00
Christoph Purrer 3fc7ebb311 Don't include C++ bridging header in RCTTurboModule.h (#45251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45251

https://github.com/facebook/react-native/pull/44914 is causing some iOS build breaks

## Changelog:

[iOS] [Changed] - Don't include C++ bridging header in RCTTurboModule.h

Reviewed By: cortinico

Differential Revision: D59280331

fbshipit-source-id: 489bc94ee0e5073129205370245c0093c0754f58
2024-07-02 11:26:11 -07:00
Wojciech Dróżdż 27ba369f23 Add onUserLeaveHint support to ReactActivityDelegate (#43658)
Summary:
**This is a resubmission of the previous PRs. We are trying to figure out why it causes crashes in some apps.**

This PR adds `onUserLeaveHint` support into the `ReactActivityDelegate`. It allows modules to receive an event every time user moves the app into the background. This is slightly different than `onPause` - it's called only when the user intentionally moves the app into the background, e.g. when receiving a call `onPause` should be called but `onUserLeaveHint` shouldn't.

This feature is especially useful for libraries implementing features like Picture in Picture (PiP), where using `onUserLeaveHint` is the [recommended way of auto-entering PiP](https://developer.android.com/develop/ui/views/picture-in-picture#:~:text=You%20might%20want%20to%20include%20logic%20that%20switches%20an%20activity%20into%20PiP%20mode%20instead%20of%20going%20into%20the%20background.%20For%20example%2C%20Google%20Maps%20switches%20to%20PiP%20mode%20if%20the%20user%20presses%20the%20home%20or%20recents%20button%20while%20the%20app%20is%20navigating.%20You%20can%20catch%20this%20case%20by%20overriding%20onUserLeaveHint()%3A) for android < 12.

## Changelog:

[ANDROID] [ADDED] - Added `onUserLeaveHint` support into `ReactActivityDelegate`

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

Test Plan: Tested in the `rn-tester` app - callbacks are correctly called on both old and new architecture.

Reviewed By: javache

Differential Revision: D56015911

Pulled By: cortinico

fbshipit-source-id: fc41af30f697da6fe7db3dd6e579a702f90cf218
2024-07-02 10:43:29 -07:00
Rubén Norte e35a2f4a7c Set up experiment to fix incorrect state updates in smooth scroll animations on Android (#45237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45237

Changelog: [internal]

This creates a feature flag to test a fix for an incorrect state update dispatched to Fabric when using smooth scroll animations.

Specifically, when starting a smooth scroll animation from X to Y, the scroll view would set the state to Y, and then all the range from X to Y again. For example, the sequence of state updates when smooth scrolling from 0 to 5 would be `0 -> 5 -> 1 -> 2 -> 3 -> 4 -> 5`, which is obviously incorrect.

This flag prevents setting the final value before it's actually reached.

Reviewed By: javache

Differential Revision: D59233069

fbshipit-source-id: 221602d7d30635070e7776ce756e2ef438edf638
2024-07-02 07:58:37 -07:00
Rubén Norte 818e70f7eb Set up experiment to fix race conditions when doing Fabric state updates on Android (#45236)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45236

Changelog: [internal]

## Context

We're currently observing inconsistencies between the state of the UI on Android and the propagated state in Fabric.

When investigating the issue, we saw that there are some state updates that were going to be dispatched from scroll views to Fabric were skipped because the state object in native was deallocated.

The reason for that is a race condition between:
1. Dispatching new state updates from the UI thread
2. Updating the state previously dispatched from the UI thread on the JS thread.

 {F1735383134}

## Changes

This creates a new feature flag to replace the weak reference with a strong one, so when the previous state is deallocated we can still access it to set new state.

The use of weak references was introduced in D44472121 to avoid holding onto JSI references (which could be contained in the state) when the runtime was deallocated, but we later introduced an explicit clean up mechanism in D45905628 that would make that unnecessary.

Reviewed By: javache

Differential Revision: D59233070

fbshipit-source-id: 018d8935f506430ecab96df0f7a998a37ee0f556
2024-07-02 07:58:37 -07:00
Nicola Corti c25246044f Migrate test_js to GHA (#45246)
Summary:
This migrates the `test_js` workflow to GHA

## Changelog:

[INTERNAL] - Migrate test_js to GHA

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

Test Plan: Will wait for CI

Reviewed By: javache

Differential Revision: D59270333

Pulled By: cortinico

fbshipit-source-id: e77eb9819e0819638c51e61b1e477ac04680a2f4
2024-07-02 05:17:33 -07:00
Nicola Corti 258ea84f46 Further refine the Gradle caching logic. (#45233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45233

We want the Gradle cache to be written only on main/-stable branches run, and only for jobs with `cache-read-only` == false (i.e. `build_android`).
This changes implements it.

Changelog:
[Internal] [Changed] - Further refine the Gradle caching logic.

Reviewed By: blakef

Differential Revision: D59225944

fbshipit-source-id: b6c3a5d4d0d399d6fe42287976925c43f3f12eb7
2024-07-02 04:22:43 -07:00
Nicola Corti ffd0b39755 Changelog for 0.75.0-rc.3 (#45244)
Summary:
Just updating the changelog for 0.75.0-rc.3

## Changelog:

[INTERNAL] - Changelog for 0.75.0-rc.3

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

Test Plan: NA

Reviewed By: rshest, blakef

Differential Revision: D59269046

Pulled By: cortinico

fbshipit-source-id: b5124c1574786d90c4bb65feb24328de86169718
2024-07-02 03:25:23 -07:00
Thibault Malbranche 7edc7169c7 chore: changelog for 0.74.3 (#45238)
Summary:
Adds changelog for the 0.74.3 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.3 changelog

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

Reviewed By: cortinico

Differential Revision: D59263876

Pulled By: dmytrorykun

fbshipit-source-id: 0f16d51a01790b4ddcaca092dec7527aab386dcd
2024-07-02 02:41:49 -07:00
Wojciech Lewicki 54dadd7bda fix: add JvmStatic to all methods used in cpp (#45243)
Summary:
Following-up on https://github.com/facebook/react-native/pull/45230, I added all the needed `JvmStatic` annotations for methods used in cpp code here: https://github.com/facebook/hermes/blob/f5c867514c71b25212eb3039230e0c095518b532/lib/Platform/Unicode/PlatformUnicodeJava.cpp.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Use `JvmStatic` annotations for all methods from `AndroidUnicodeUtils.kt`

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - Use `JvmStatic` annotations for all methods from `AndroidUnicodeUtils.kt`

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

Test Plan: Try and use those methods to see that they don't crash on `cpp` side.

Reviewed By: cortinico

Differential Revision: D59264093

Pulled By: dmytrorykun

fbshipit-source-id: 07d683ee38ea1c7d9621ad2e37d04f3d484d3200
2024-07-02 02:40:49 -07:00
Christoph Purrer ad3df84668 Add EventEmitter Code-gen support for Java and ObjC Turbo Modules (#45119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45119

## Changelog:

[iOS][Added] - Add EventEmitter Code-gen support for Java and ObjC Turbo Modules

Reviewed By: RSNara

Differential Revision: D58929417

fbshipit-source-id: 5208ba5ecb5882d47c3827c2aa8e3a54a3d7f2b6
2024-07-01 14:42:46 -07:00
Pieter De Baets 9d3052378a Revert D59107105: Merge newarchdefaults jni target into fabric and turbomodule targets
Differential Revision:
D59107105

Original commit changeset: fb3b25f3ce45

Original Phabricator Diff: D59107105

fbshipit-source-id: 2197d1deb79e7fc9b3ac7b0772225e13c23e0001
2024-07-01 12:47:24 -07:00
Christoph Purrer f473a2f8f4 Add ObjC Turbo Module Event Emitter example (#44914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44914

Shows a proof of concept how '*strongly typed Turbo Module scoped*' `EventEmitters` can be used in a ObjC Turbo Module.

## Changelog:

[iOS] [Added] - Add ObjC Turbo Module Event Emitter example

Reviewed By: rshest

Differential Revision: D57650830

fbshipit-source-id: c5c2dee4766484e9e58415e33c084999a9ae3bc6
2024-07-01 09:36:51 -07:00
Pieter De Baets 8b121c5071 Use RAII for cleaning up global_refs in JavaTurboModule (#45218)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45218

Noticed that when an exception occurred we would not cleanup global_refs, leaking them in the global table.

Restructure this to use RAII and rely on JNIArgs to do the cleanup as necessary.

Changelog: [Android][Internal]

Reviewed By: RSNara

Differential Revision: D59156494

fbshipit-source-id: c89552d72387bad2a120373e78a2c545415a7c82
2024-07-01 09:16:25 -07:00
Pieter De Baets c68f35d444 Merge newarchdefaults jni target into fabric and turbomodule targets (#45207)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45207

These are their own shared library, and their own soloader-call, but they can easily be pulled into existing targets without causing excessive bloat.

Changelog: [Android][Removed] react_newarchdefaults is no longer a prefab, instead use fabricjni

Reviewed By: christophpurrer

Differential Revision: D59107105

fbshipit-source-id: fb3b25f3ce4511aa18126477f2beefe1292c6d09
2024-07-01 07:28:42 -07:00
Nicola Corti c911c89728 Setup git config --global --add safe.directory '*' when running jobs inside Docker (#45231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45231

Following up to cipolleschi's work, it turns out that me setting this command inside
the docker file for React Android is unneffective:
https://github.com/react-native-community/docker-android/pull/228

The reason is that the user executing is different (1001 for the Dockerfile, while GHA executes as root 1000).
So we need to set this, otherwise the nightlies will be invoked with the `-TEMP` prefix:

Changelog:
[Internal] [Changed] - Setup `git config --global --add safe.directory '*'` when running jobs inside Docker

Reviewed By: blakef

Differential Revision: D59223862

fbshipit-source-id: 26674fc8cdaebf6687407072cc4e4f5c38246845
2024-07-01 06:28:51 -07:00
Pieter De Baets de7976c69d Remove unused hybrid class from DefaultComponentsRegistry (#45205)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45205

We only need a static register method, which includes the core components and the provider function. CoreComponentsRegistry isn't referenced at all in Kotlin/Java, and can be replaced with DefaultComponentsRegistry with no change in behaviour in all scenarios.

Changelog: [Android][Removed] CoreComponentsRegistry is now fully replaced by DefaultComponentRegistry.

Reviewed By: cortinico

Differential Revision: D59107106

fbshipit-source-id: e679be490f43dab52eb5e11a08aa9d0ae2a89a92
2024-07-01 05:20:31 -07:00
Gabriel Donadel 20521cc908 Fix Android autolink plugin for libraries that are platform specific (#45223)
Summary:
Fixes https://github.com/facebook/react-native/issues/45222

## Changelog:

[ANDROID] [FIXED] - Fix autolink plugin for libraries that are platform-specific

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

Test Plan: And a library that does not have Android native code such as react-native-segmented-control/segmented-control and sync gradle

Reviewed By: rshest

Differential Revision: D59221562

Pulled By: cortinico

fbshipit-source-id: 55739d63ded63e46897d0d770281f937668c1f50
2024-07-01 05:05:23 -07:00
Nicola Corti cef17ba14f Fix crash due to missing @JvmStatic to convertToCase
Summary:
Users are reporting that RN 0.75 is crashing due to us attempting to accessing a static method
on `AndroidUnicodeUtils.convertToCase` which is not static anymore due to Kotlin conversion.

Static access is inside Hermes codebase here:
https://github.com/facebook/hermes/blob/f5c867514c71b25212eb3039230e0c095518b532/lib/Platform/Unicode/PlatformUnicodeJava.cpp#L107-L109

Changelog:
[Android] [Fixed] - Fix crash due to missing JvmStatic to `convertToCase`

Reviewed By: javache

Differential Revision: D59218291

fbshipit-source-id: ac121a8bcd5fd917ee134d257f967c8e3e338ca5
2024-07-01 03:32:14 -07:00
Blake Friedman c7988c9c82 Back out "remove @react-native-community dependencies" (#45225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45225

Original commit changeset: f238e621c47d

Original Phabricator Diff: D58528447

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D59174823

fbshipit-source-id: 3c6d74aea2fd6de7cfee8f1e4389db3d63da3c4d
2024-06-28 17:01:45 -07:00
Christoph Purrer ed5f558a6c Code-generate an optional base class to use for every NativeModule (#45113)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45113

## Changelog:

[iOS][Added] - Code-generate an optional base class to use for every NativeModule

Extend RN Code-gen to generate a NativeModule base class for each ObjC Turbo Modules.

Its usage is not mandatory now, but would become for future features to add

A practial first step would be to migrate

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h#L157-L160

from the `protocol` to the default `interface` and then provide a default implementation for it

Reviewed By: RSNara

Differential Revision: D58907395

fbshipit-source-id: a6b0ef97a5c7f5bb0c53a4cb6fd83d2e55306953
2024-06-28 13:29:15 -07:00
Blake Friedman d6e8c061cd fix: ios Helloworld assumes community cli is present (#45221)
Summary:
Use the hard-coded config for Helloworld instead of assuming the community cli is there to generate a config, which we can no longer assume.

Changelog: [Internal]

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

Test Plan:
This works in my local environment:
```
bundle exec pod install
```
and
```
./gradlew generateAutolinkingPackageList
```
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59162715

Pulled By: blakef

fbshipit-source-id: 95ff2c3929f12ee0ecf468cb80d2df1281eb746e
2024-06-28 12:05:14 -07:00
Christoph Purrer 84a9f5e6c8 Add Java Turbo Module Event Emitter example (#44906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44906

Shows a proof of concept how '*strongly typed Turbo Module scoped*' `EventEmitters` can be used in a Java Turbo Module.

## Changelog:

[Android] [Added] - Add Java Turbo Module Event Emitter example

Reviewed By: javache

Differential Revision: D57530807

fbshipit-source-id: 04261d8885760f0e3b3c8c1931e0d56a5d33a0df
2024-06-28 09:41:02 -07:00
Håkon Knutzen dba25fa966 Data race related to reading/writing to AllocationTestModule.valid (#45191)
Summary:
The fix entails making `AllocationTestModule.valid` an Objective-C atomic property and funneling access to the ivar via the synthesized property getter and setter.

While the data race was present in test code, it would make it more difficult to spot more severe data races with the TSan. Also, getting rid of a data race is always good.

## Changelog:

[iOS][Fixed] - Data race related to access of `AllocationTestModule.valid`

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

Test Plan: `RCTAllocationTests` will test the implementation of `AllocationTestModule`.

Reviewed By: christophpurrer

Differential Revision: D59155083

Pulled By: javache

fbshipit-source-id: e3217cffd0801377a25f04bf8ed0b4e2d1d88498
2024-06-28 08:11:34 -07:00
Blake Friedman 9269429bb9 remove @react-native-community dependencies (#44928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44928

The react-native-community/ dependencies aren't being explicitly included as part of the Framworks (RFC-0759) work.

Changelog: [General][Breaking] react-native isn't dependend on react-native-community/*

WARNING: Do not commit until we've cut 0.75, this goes in the 0.76 release only otherwise it'll break `npx react-native@latest init`.

Reviewed By: cortinico

Differential Revision: D58528447

fbshipit-source-id: f238e621c47df9e28b2e18f4137eb08e525052f6
2024-06-28 07:48:10 -07:00
Håkon Knutzen ffc16fc18b Fix data races in RCTImageLoader and RCTNetworkTask with shared atomic counters (#45114)
Summary:
In order to fix the data races described in https://github.com/facebook/react-native/issues/44715, I propose a simple solution by leveraging shared counter functions wherein `std::atomic` is the backing for the integer values.

## Changelog:

[iOS] [Fixed] - Implement shared atomic counters and replace static integers in `RCTImageLoader` and `RCTNetworkTask` that were accessed concurrently, which in some cases lead to data races.

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

Test Plan: Added unit tests for the counters in `RCTSharedCounterTests`.

Reviewed By: cipolleschi

Differential Revision: D59155076

Pulled By: javache

fbshipit-source-id: f73afce6a816ad3226ed8c123cb2ccf4183549a0
2024-06-28 07:37:45 -07:00
Alex Hunt 9833338b5d Support @//xplat/mode/no-react-fusebox (#45216)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45216

Buck modifications supporting the internal React Native DevTools (Fusebox) rollout.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D59154105

fbshipit-source-id: ba22a7f2f64d199b3e4e5a83ffa5036ae36b1a3b
2024-06-28 06:44:52 -07:00
Dmitry Rykun 5532e511af Systrace instrumentation for prop parsing (#45153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45153

This diff adds more Systrace logging to the component create/update flow.
Changelog: [Internal]

Reviewed By: javache

Differential Revision: D56706472

fbshipit-source-id: c94445693694dfee43f1d46881fc1e18a507eb5e
2024-06-28 06:35:32 -07:00
Oskar Kwaśniewski c5653a03fb feat: add conditionals for iOS only code in RCTDeviceInfo.mm (#45176)
Summary:
Having React Native support every Apple platform is tough to achieve as it introduces many platform-specific ifdefs.

On the other side, maintaining an OOT platform fork is already a demanding job, so to make it easier I propose adding ifdefs for iOS-specific code. Thanks to this change, OOT platforms can focus on their OS-specific features while the core is also adding iOS-specific features behind ifdefs. Fortunately, **most of the code on Apple platforms can be shared** and this PR aims to introduce better support for this and to minimize OOT fork's surface.

In this example `RCTDeviceInfo.mm` has support for handling orientation changes and the availability of this feature across Apple OS looks as follows:

| Platform  | Support |
| ------------- | ------------- |
| macOS |    |
| tvOS |    |
| visionOS |    |
| iOS/iPadOS |    |

Here is a table from `TargetConditionals.h` header file which shows the coverage of `TARGET_OS_IOS` macro. (It supports both iOS and iPadOS)

![CleanShot 2024-06-26 at 11 51 47@2x](https://github.com/facebook/react-native/assets/52801365/5f7dc99a-72b8-46ce-87d4-896bdb017269)

## 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] [ADDED] - Conditionals for iOS only code in RCTDeviceInfo.mm

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

Test Plan: CI Green

Reviewed By: christophpurrer

Differential Revision: D59106103

Pulled By: cipolleschi

fbshipit-source-id: 594a9d2451024baddfbc9cd3bc1ccfb8829fc31c
2024-06-28 06:02:38 -07:00
Kacper Rozniata c9d589dab5 fix(iOS): fix rendering RCTRedBoxExtraData (#43102)
Summary:
This PR fixes rendering of `RCTRedBoxExtraData`

I noticed that it wasn't displaying the `reload` and `dismiss` buttons, which made it impossible to close modal and to reload JS on e.g. `visionOS` (on `iOS` it could only be closed by swiping).

PR adds these buttons back and also introduces some refactoring

Before & After:

<img width="1118" alt="pr-img" src="https://github.com/facebook/react-native/assets/56474758/50e22499-9df0-45f0-84ac-2118ab7a8e6c">

## Changelog:

[IOS] [FIXED] - Fix rendering `RCTRedBoxExtraData`

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

Test Plan: Make sure that `RCTRedBoxExtraData`  displays and works as expected

Reviewed By: dmytrorykun

Differential Revision: D59108365

Pulled By: cipolleschi

fbshipit-source-id: b88c5665962d0280d68377863aa3346edfdf86b7
2024-06-28 05:58:01 -07:00
zhongwuzw 7698cd0953 Fixes Image load event in new arch (#44918)
Summary:
Fixes https://github.com/facebook/react-native/issues/44896. cc cipolleschi

## Changelog:

[IOS] [FIXED] - Fixes Image load event in new arch

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

Test Plan: https://github.com/facebook/react-native/issues/44896

Reviewed By: dmytrorykun

Differential Revision: D59108500

Pulled By: cipolleschi

fbshipit-source-id: 1fad4f82288141e9fc37f525be7073deb81c542c
2024-06-28 04:35:39 -07:00
imWildCat e320ab47cf fix the path of the script phase (#45208)
Summary:
Since 0.75-rc.x, I cannot run pod install because of an linking issue of react native firebase.

https://github.com/reactwg/react-native-releases/issues/341#issuecomment-2194568204

## Changelog:

[IOS][FIXED] Auto linking script of script phase

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

Test Plan: Full demo of this fix: <https://github.com/imWildCat-archived/react-native-075-rc2-regression-ios-linking-script-phase>

Reviewed By: christophpurrer

Differential Revision: D59125585

Pulled By: blakef

fbshipit-source-id: be96d3b207eff67c5e0d777203e7fc0d10103fc0
2024-06-27 16:14:59 -07:00
Saad Najmi a557a81f96 Remove [RCTConvert UIBarStyle:] (#44597)
Summary:
Resolves https://github.com/microsoft/react-native-macos/issues/2008

Followup to https://github.com/facebook/react-native/pull/42100 / https://github.com/facebook/react-native/commit/157cb0e02b6328e8b640f2b302a11c298a240493 , let's remove the deprecated RCTConvert method.

## Changelog:

[IOS] [REMOVED] - Remove `[RCTConvert UIBarStyle:]`

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

Test Plan: CI should pass

Reviewed By: christophpurrer

Differential Revision: D59128144

Pulled By: javache

fbshipit-source-id: 3e66422a7f4a139a6d68cbdfc6aae211ea239d4e
2024-06-27 16:07:57 -07:00
Sam Zhou 1a990d1904 Deploy 0.238.3 to xplat (#45209)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45209

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D59119421

fbshipit-source-id: a547a153c051c103ecd16ad0497d30d43dbe80a7
2024-06-27 14:02:03 -07:00
Tim Yung 1341169a4b RN: Remove forwardRef from ScrollView (#45197)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45197

With React 19, `forwardRef` is no longer necessary because `ref` is available on props. However, this only holds true for functional components — not class components.

This eliminates the `forwardRef` invocation in `ScrollView`, while retaining the wrapper component to map `ref` to `scrollViewRef` for the class component. For now...

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D59091873

fbshipit-source-id: 60afcd441aec82fa050738b5c09083f3a26378d6
2024-06-27 11:08:11 -07:00
Alex Hunt bfc51f97da Expose preprocessor flag/Buck constraint for Fusebox opt in (#45203)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45203

Configures a `REACT_NATIVE_ENABLE_FUSEBOX_DEBUG` flag, and exposes this flag in the Buck target via a [constraint setting](https://www.internalfb.com/intern/wiki/Buck-users/select-and-friends/#constraint-setting-and-c). This is an additional hook to enable the new debugger stack (codename Fusebox) as part of our internal rollout.

NOTE: This approach replaces D59014161 (reverted).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D59109110

fbshipit-source-id: 7d23d9d402569b00d8dd17b9c8f3bcc108f0365f
2024-06-27 09:44:15 -07:00
Jorge Cabiedes Acosta eb9c388492 Update Filter header (#45151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45151

This change was missed when fixing hue-rotate and adding drop-shadow. I believe the only issue with this was stacking context was not being created for these two filters.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D58965245

fbshipit-source-id: e6bfdb738a8bc8caa878f60420cfe8b421f64aa4
2024-06-27 09:43:39 -07:00
Nicola Corti e8d3ad7216 Let build_android produce a signed maven-local.zip archive (#45161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45161

This is part of a bigger refactoring of the Android pipelines.
As `build_android` is already building everything, let's save the maven-local
so it can be reused by other jobs (test_android_helloworld and build_npm_package).

Changelog:
[Internal] [Changed] - Let build_android produce a signed maven-local.zip archive

Reviewed By: cipolleschi, blakef

Differential Revision: D59002893

fbshipit-source-id: db03946c975b2ce91dae0c4011981b2fe9dd6113
2024-06-27 09:29:22 -07:00
Riccardo Cipolleschi 2adb389fac Disable unit tests for flakyness in CircleCI (#45133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45133

Recently, CircleCI has failed pretty often due to these tests.
The reason is that we migrated these jobs to M1 machines, as circleCI is deprecating intel ones, and on these machines the simulators tend to freeze. Hence, every often we get stuck when running the tests. :(

We are going to move to GHA, so that should not be a big issue.

## Changelog:
[Internal] - Disable unit tests in CircleCI to improve CI robustness

Reviewed By: cortinico

Differential Revision: D58948614

fbshipit-source-id: 5420bdf0fda325779a4e287e7b00c623de822ccb
2024-06-27 09:27:24 -07:00
Oskar Kwaśniewski 815c415fb9 refactor: supportedInterfaceOrientations method to use RCTKeyWindow() (#43026)
Summary:
This PR refactors `supportedInterfaceOrientations` to use RCTKeyWindow instead of `[RCTSharedApplication() keyWindow]`.

## Changelog:

[IOS] [CHANGED] - Refactor supportedInterfaceOrientations method to use RCTKeyWindow()

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

Test Plan: CI Green

Reviewed By: dmytrorykun

Differential Revision: D59109614

Pulled By: cipolleschi

fbshipit-source-id: 025534c419078dce29e1e5caacf8a1b15de1abcc
2024-06-27 07:58:50 -07:00
Tim Yung fb58494283 RN: Fix mockComponent for Functional Components (#45196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45196

Currently, `mockComponent` makes a false assumption that if a component is a function, it extends `React.Component`.

There's a bunch of problems with this mocking setup with requiring mock components that extend `React.Component`, but this change does not attemp to solve that.

This change unblocks future refactors to make native components export functional components (that are neither class component nor `forwardRef` results).

Changelog:
[General][Changed] - Fixed native component mocking in Jest unit tests to support functional components

Reviewed By: javache

Differential Revision: D59097730

fbshipit-source-id: ca2784ac3baa9ab4ab6a503c5fd6437c60179352
2024-06-27 07:26:04 -07:00
Tim Yung 3965b7d78b RN: Fix Test Case Isolation in Modal-test.js (#45195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45195

Configure `Modal-test.js` to reset modules between test cases so that there is better isolation, making the tests easier to reason about and to debug.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D59097729

fbshipit-source-id: 3b9260283e171ff7fa6b7ffc56685f703875291e
2024-06-27 07:26:04 -07:00
Riccardo Cipolleschi c0b5e2e031 Bump CLI dependencies to alpha.11 (#45179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45179

## Changelog:
[General][Changed] - Bumps the CLI to alpha 11

Reviewed By: cortinico

Differential Revision: D59055459

fbshipit-source-id: 3bebe80d0cf6e7af8d7f74f3a5e4e2ccc91cf419
2024-06-27 04:11:44 -07:00
Riccardo Cipolleschi 119ab33036 Port changes in the release testing script from the release branch (#45174)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45174

As per title, this port bck to main the changes we made in the release testing script.

## Changelog:
[Internal] - Update release testing script to work with the new template

Reviewed By: blakef

Differential Revision: D59054045

fbshipit-source-id: 0e93c2db94499407845b4fb2c98c8b44310e770f
2024-06-27 04:11:44 -07:00
Riccardo Cipolleschi cf8d3f8007 Port CI improvements from Release branch to main (#45175)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45175

This change ports the CI improvements we made on stable branch to main.

## Changelog:
[Internal] - Port back to main improvements we made in GHA

Reviewed By: cortinico

Differential Revision: D59053873

fbshipit-source-id: 73eb7e33b9bbdc5d8c3a9294f487ad969b144bf3
2024-06-27 04:11:44 -07:00
Rubén Norte b80812a9af Avoid unnecessary creation of null shared pointers in IntersectionObserverManager (#45190)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45190

Just a small follow up from the previous change to `IntersectionObserverManager`.

Changelog: [internal]

Reviewed By: javache

Differential Revision: D59065041

fbshipit-source-id: 2944299143e6a0fe53fe64083db85635e72d71af
2024-06-27 03:36:36 -07:00
Pieter De Baets c2e080419b Fix crash on reload when useImmediateExecutorInAndroidBridgeless is enabled (#45162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45162

Previously we would crash in ReactInstance#callFunctionOnModule (P1443291303) when reloading (due to the onHostPause call) because we removed a source of synchronization by using the immediate executor.

Workaround it by making sure we always null out references to `mReactInstance` before we actually start destroying it.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D59002404

fbshipit-source-id: 3ee14cd1fe7d423bb6158356bb99b3d2d6af8d6f
2024-06-27 03:25:39 -07:00
Tim Yung c128a517b8 RN: Avoid Invalidating ScrollView Children on unstable_subscribeToOnScroll (#45170)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45170

Reimplements `unstable_subscribeToOnScroll` so it does not invalidate all descendant children upon first invocation per `ScrollView` instance.

Previously, the state update would cause the entire `ScrollView` component to re-render. This refactors the `enableSyncOnScroll` boolean state so that it resides in a lower level component that implicitly memoizes all of its `props` (including the `ScrollView` children).

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D59033393

fbshipit-source-id: 5a4b75aebdcbd0dd1dfa28511862bee495816250
2024-06-26 20:17:05 -07:00