Commit Graph

38536 Commits

Author SHA1 Message Date
Ramanpreet Nara 8bced4b29d Pull PopupMenuAndroid out of React Native core
Summary:
**History:** This component was originally introduced into React Native core in D52712758, to replace UIManagerModule.showPopupMenu().

**Problem:** But, React Native core should be lean. Adding this component to React Native bloats the core.

**Changes:** So, this diff pulls PopupMenuAndroid out into its own package in the react-native GitHub repository.

In the future, this will be migrated to a community package!

Changelog: [Android][Removed] Move PopupMenu out of React Native core

Reviewed By: NickGerleman

Differential Revision: D53328110

fbshipit-source-id: 469d8dc3e756c06040c72e08fa004aafa1bd6e18
2024-02-23 16:43:18 -08:00
David Vacca e6e5822d07 Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D54027183

fbshipit-source-id: b87e3931642abaa22b84fd48f0504f36e9c3621f
2024-02-23 15:27:17 -08:00
David Vacca 51088c9b90 Mark classes of package uimanager as @Nullsafe (#43162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43162

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54027181

fbshipit-source-id: af9f022d36a2e60788d6790525736d1b6cfdf6fa
2024-02-23 15:27:17 -08:00
David Vacca e69faff265 Mark classes of package uimanager as @Nullsafe (#43161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43161

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D54027187

fbshipit-source-id: a25024ba7f7d4893a2b7d083e2ba10c5f2e3a035
2024-02-23 15:27:17 -08:00
David Vacca 9f58b1a0fc Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D54027182

fbshipit-source-id: 946dbf484119890658c68767916fcbf7c66996bc
2024-02-23 15:27:17 -08:00
David Vacca a15e8f318d Mark interop classes and interfaces as Unstable
Summary:
Mark interop classes and interfaces as Unstable

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: fkgozali, arushikesarwani94

Differential Revision: D54128912

fbshipit-source-id: 56956fc38bac01f461bf686fda0f05a7a105008e
2024-02-23 15:22:45 -08:00
David Vacca 0274ad076d Mark UIManagerListener interface as UnstableReactNativeAPI
Summary:
UIManagerListener interface is unstable and not recommended to be consumed externally, this API is likely to change in the future

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D54028407

fbshipit-source-id: c8601451f117226f9e5a4d291307f4a0ac04a10f
2024-02-23 15:22:45 -08:00
Nicola Corti c7bacf610d Remove accidental files included inside the template.
Summary:
Those files should not stay in the root `/app` folder but inside the `/app/gradle/wrapper` folder.
I've noticed this in the Upgrade Helper UI hence I'm removing them.

Changelog:
[Internal] [Changed] - Remove accidental files included inside the template

Reviewed By: mdvacca

Differential Revision: D54122995

fbshipit-source-id: 8873a91ffbea20f609c7aabd428a815c77a38db5
2024-02-23 11:46:14 -08:00
Nicola Corti 44e5bc9e2c Do not crash on onJSBundleLoadedFromServer when fast-refreshing on bridgeless mode
Summary:
RN-Tester is currently instacrashing on fast-refresh (pressing r on Metro) as it ends up on `onJSBundleLoadedFromServer`
which throws an exception on Bridgeless mode. I'm fixing it by following the same logic as `onReloadWithJSDebugger`.

Changelog:
[Android] [Fixed] - Do not crash on onJSBundleLoadedFromServer when fast-refreshing on bridgeless mode

Reviewed By: huntie

Differential Revision: D54121838

fbshipit-source-id: 82d98ec0c5b2295f5751525368c956574dd7f3a0
2024-02-23 10:44:53 -08:00
Nicola Corti 2647dc8c39 Bump CLI to 13.6.1 (#43153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43153

This contains an hotfix for the CLI needed for 0.74

Changelog:
[Internal] [Changed] - Bump CLI to 13.6.1

Reviewed By: huntie

Differential Revision: D54073715

fbshipit-source-id: a5fdf02f47c5e144efc58e6b7fd355669a21e07b
2024-02-23 06:14:29 -08:00
Alex Hunt 30b088d245 Adjust output package.json formatting in scripts (#43133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43133

I noticed inconsistent handling of terminating newlines in D54006327@V1, and had also been noticing `yarn build` reformatting unrelated sections of `package.json` files.

For now, this logic isn't moved to a shared util, since there will likely be a higher level abstraction for the release scripts in the next batch of improvements.

Changelog: [Internal]

Reviewed By: lunaleaps, cipolleschi

Differential Revision: D54007565

fbshipit-source-id: 74d58362a85be4fae2f9e058b6c6622a026ff0a0
2024-02-23 02:44:10 -08:00
David Vacca 52a70d7832 Mark IViewGroupManager interface as @Nullsafe (#43157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43157

IViewGroupManager is NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D54034058

fbshipit-source-id: ad317c73d45fdd801aeee65d5308400e2e1c8552
2024-02-23 02:42:20 -08:00
David Vacca c77c13ab7c Mark classes of package uimanager as @Nullsafe (#43156)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43156

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54027185

fbshipit-source-id: f3c337def2d42cf1f6fed2e2eb4938a84a51f8d4
2024-02-23 02:42:20 -08:00
David Vacca ed3eacb8b9 Mark classes of package uimanager as @Nullsafe (#43155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43155

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D54027178

fbshipit-source-id: 37940ecec4d42f9f5ae7784a865564b0ef80f4a7
2024-02-23 02:42:20 -08:00
David Vacca 93b4ec3472 Validate textAttributeProps is created with a non-null textAttributes map (#42932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42932

Validate textAttributeProps is created with a non-null textAttributes map

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D53558784

fbshipit-source-id: 2f7521a7f0a1cfdf67c0ab8ea0048e7f5da365b8
2024-02-23 02:42:20 -08:00
Rubén Norte 0eac4181cc Enable the native module for feature flags by default for iOS apps in OSS (#43159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43159

Changelog: [internal]

This modifies the default `RCTAppDelegate` for iOS apps in OSS to provide an implementation for the C++ native module for feature flags.

In a following diff I'll replace the `React-featureflagsnativemodule.podspec` file with one that includes all built-in C++ native modules.

Reviewed By: RSNara

Differential Revision: D54082349

fbshipit-source-id: 8c4ed7499c6fd35916ba105edcae0e2c85961e1c
2024-02-23 01:14:03 -08:00
Zeya Peng 073ca1aa03 extract constants type in BlobModule + add stub impl (#43160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43160

## Changelog:

[Internal] - extract constants type in BlobModule

Reviewed By: christophpurrer, rshest

Differential Revision: D54073162

fbshipit-source-id: ba783fd4592feb7ecd65c65ad646e681b2f26a17
2024-02-22 18:10:40 -08:00
Pieter De Baets 2584bcb6c8 Stop catching IllegalArgumentException in ReactPackageTurboModuleManagerDelegate (#43152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43152

Now that 0.74 has been cut, we can drop this warning and let the exception bubble up.

In https://github.com/facebook/react-native/pull/41509 we stopped masking this.

Changelog: [Android][Changed] Throwing IllegalArgumentException from ReactPackage is no longer suppressed

Reviewed By: cortinico, cipolleschi

Differential Revision: D54068429

fbshipit-source-id: c2f780ccfefabf2334c94b632bca93242af86008
2024-02-22 15:51:17 -08:00
Alex Hunt 2dc39c26ed Add fbjni wrapper for java.util.concurrent.Executor (#43154)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43154

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54072449

fbshipit-source-id: 02a6fe6a95fd8e4b3bacab7a21f8480509d6c90c
2024-02-22 11:39:18 -08:00
Dmitry Rykun 6549216b76 Rename React-Codegen to ReactCodegen
Summary:
This diff renames React-Codegen to ReactCodegen. This way we'll no longer have to try both
```
#include <React-Codegen/MyModule.h>
```
and additionally
```
#include <React_Codegen/MyModule.h>
```
for cases with `use_frameworks`.

Changelog: [iOS][Breaking] - Rename React-Codegen to ReactCodegen

Reviewed By: cipolleschi

Differential Revision: D54068492

fbshipit-source-id: dab8ea2034d299266482929061caa14397421445
2024-02-22 09:52:48 -08:00
Diego Segura e33767a36d fix flatlist props being undefined in ios (#43141)
Summary:
When using Flatlist on iOS and Android its failing because props are undefined

The problem is described on https://github.com/facebook/react-native/issues/34783

![Captura de pantalla 2024-02-22 a las 4 13 11](https://github.com/facebook/react-native/assets/1161455/325738d9-2e49-44a0-bb6a-077b2e02e9cd)

![Captura de pantalla 2024-02-22 a las 4 14 58](https://github.com/facebook/react-native/assets/1161455/118f76e1-a818-428e-938e-123b55536b49)

Fixed by setting constructor before any statement and removing unnecessary props declaration at the top of the class.

## 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
-->
[GENERAL] [FIXED] - Fix undefined props crash in FlatList

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

Reviewed By: javache

Differential Revision: D54069559

Pulled By: robhogan

fbshipit-source-id: b39cd9a273eb0279ed353f9efcb66a3c4ccf93b4
2024-02-22 09:03:03 -08:00
Alex Taylor (alta) b857a6eb54 Update hermes-parser and related packages in fbsource to 0.19.2 (#43140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43140

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

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D54044847

fbshipit-source-id: ce6830c6cdae8f9cb7225a86c0a1ff23a6929796
2024-02-22 08:56:32 -08:00
Rubén Norte 71ee246183 Include native module for ReactNativeFeatureFlags by default in all apps using TurboModules (#42431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42431

Changelog: [internal]

Reviewed By: dmytrorykun

Differential Revision: D52905704

fbshipit-source-id: df1a0ec71ba468d8352f2af92bf87b5175c0d72c
2024-02-22 08:39:12 -08:00
Rubén Norte d979452d24 Log an error when trying to access native feature flags from JS if the native module is not available (#43149)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43149

Changelog: [internal]

At the moment we're silently falling back to default values when trying to use common feature flags from JS when the native module isn't available. This could lead to unexpected behaviors and it's not immediately obvious, so this logs an error when it happens.

Reviewed By: javache

Differential Revision: D54063391

fbshipit-source-id: 5886754958930b88ef63c24d77a9e8486d92c731
2024-02-22 08:35:25 -08:00
Kesha Antonov 767330f218 Update Yoga.podspec: fixes archiving for Mac Catalyst (#42847)
Summary:
Hi

When I tried to archive macos catalyst app in Xcode I got errors:

<img width="977" alt="Screenshot 2024-02-05 at 00 03 32" src="https://github.com/kesha-antonov/react-native/assets/11584712/b83f75a5-b42f-42e4-9afa-1e2527501baa">

This PR fixes archiving by linking PrivateHeaders in yoga.framework

<img width="399" alt="Screenshot 2024-02-05 at 01 03 48" src="https://github.com/kesha-antonov/react-native/assets/11584712/089080ad-b1dc-4703-9273-d8aa3253205e">

<img width="1404" alt="Screenshot 2024-02-05 at 01 05 18" src="https://github.com/kesha-antonov/react-native/assets/11584712/5263cb80-8a53-4a51-bcfc-9d3a2ba739b4">

Prev PR here https://github.com/facebook/react-native/pull/42159

## Changelog:

[IOS] [FIXED] - fixed archiving for Mac Catalyst

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

Test Plan: Try archive react-native tester app for macos catalyst in Xcode

Reviewed By: NickGerleman

Differential Revision: D53920474

Pulled By: cipolleschi

fbshipit-source-id: 0534d9aa9d249e4e0c35ada0464c38c291be7f84
2024-02-22 06:00:12 -08:00
Riccardo Cipolleschi b9f3186ee6 Make the New Architecture the default (#43135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43135

This change makes the New Architecture the default on both iOS and Android.
This means that new application will be created using the New Architecture by default.

It is still possible to opt out from it.

## Changelog
[General][Changed] - Make the new architecture the default

Reviewed By: cortinico, sammy-SC, dmytrorykun

Differential Revision: D54006751

fbshipit-source-id: bd7de0814925b65ab180105e18c1f6f275ba2672
2024-02-22 05:10:57 -08:00
Rob Hogan 8cbf46a5f4 Move integration tests to OSS (#43094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43094

Merge the internal `cxxcdp-tester` project into `jsinspector-modern/tests`.

Note: These tests still use RN default feature flags and therefore test against the legacy CDP registry - that's addressed in the next diff.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D53766994

fbshipit-source-id: eec144124b20a4500e28398e98763febaed52748
2024-02-22 04:21:35 -08:00
Nikita Lutsenko 765e542c8d react-native | Allow invoking a sync callback under AsyncCallback via 'unsafeCallSync'. (#43143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43143

AsyncCallback allows storing SyncCallback and invoking it from any thread.
However, there are cases where if you have a mix of sync and async callbacks - you might want to invoke them together in one go, instead of spreading them out across thread invocations.

For those cases - allow invoking any AsyncCallback as a sync one, prefixing it with "unsafe", because it's inherently not a safe operation to perform.

Changelog:
[General][Changed] - Allow invoking the AsyncCallback synchronously to allow for tight performance optimization.

Reviewed By: s-rws

Differential Revision: D54028850

fbshipit-source-id: f6729819f791f1d58d2ca655d4082547f18bdd2d
2024-02-22 00:58:29 -08:00
Tommy Nguyen a1171f79f8 fix(android): fix ndkVersion is unset when building from source (#43131)
Summary:
`ndkVersion` is unset when building from source using this guide: https://reactnative.dev/contributing/how-to-build-from-source

## Changelog:

[ANDROID] [FIXED] - Fix `ndkVersion` is unset when building from source

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

Test Plan:
```
git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version nightly
yarn

# Manually apply the patch in node_modules/react-native/ReactAndroid/build.gradle.kts
# Enable building from source
sed -i '' 's/#react.buildFromSource/react.buildFromSource/' example/android/gradle.properties

# Build
cd example/android
./gradlew assembleDebug
```

Reviewed By: christophpurrer

Differential Revision: D54006425

Pulled By: cortinico

fbshipit-source-id: 9ede64bc14af4cf609b7a4c12c5a1082bbc31f09
2024-02-21 10:09:53 -08:00
Ruslan Shestopalyuk f3e132bb0b Correctly pass Image.source attribute to the C++ side (#43129)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43129

## Changelog:
[Internal] -

C++ side expects "source" property to be an up to date, correctly resolved Image source inside `ImageProps`.

Incidentally, it wasn't the case when:
* we build for an Android platform
* the asset is a "packager asset", i.e. bundled by Metro and included in APK

It hasn't been an issue in the case of "pure" Android platform, as it instead uses "src" prop, instead of source on the Java implementation side, ignoring "source" completely, so the fact that "source" wasn't propagated correctly to C++ in some cases didn't affect Android.

However, there are some new use cases where we'd like to have correct "source" value in C++ as well (and ultimately align this between all the platforms, so it's "source" everywhere, but this is a matter of a separate discussion).

Differential Revision: D54000899

fbshipit-source-id: 9bfb9e7c157cf19ddf396c141b03b75f3b2022e8
2024-02-21 08:26:57 -08:00
Alex Hunt ee2bc59dfe Add changelog for 0.74.0-rc0
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D53949080

fbshipit-source-id: 8740e4aa4e446c27659440487141d1335df80608
2024-02-21 07:52:20 -08:00
Alex Hunt 8c51cbec94 Fix release testing script (#43130)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43130

Various fixes/tweaks to the `test-e2e-local` script, impacted by recent changes, found during the release process:

- Fix typo in variable name for `circleciToken` arg.
- Relocate erroneously positioned `process.exit` call (a force exit around Verdaccio, which we will remove in future).
- Add notice on exit around Verdaccio server not being killed successfully (to do in T179377112).
- Switch from Yarn to npm for test project installation — Yarn 3 is not respecting `npmRegistryServer`, see https://github.com/yarnpkg/yarn/issues/2508.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53951606

fbshipit-source-id: f6e29ef6c9ab33ebf60124757576fcb54219f339
2024-02-21 07:51:10 -08:00
Ingrid Wang 7fffe692e7 Delete deprecated didReceiveLocal/RemoteNotification (#43117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43117

Changelog:
[iOS][Breaking] Deleting deprecated didReceiveLocalNotification & didReceiveRemoteNotification callbacks on RCTPushNotificationManager

Reviewed By: philIip

Differential Revision: D52883365

fbshipit-source-id: b7136ecaf73263b8f8b633c8861a673868ac252e
2024-02-20 22:23:54 -08:00
Ingrid Wang 410e3b5ebd Remove deprecated alertAction and repeatInterval properties (#43116)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43116

Changelog:
[iOS][Breaking] Deleting deprecated alertAction and repeatInterval in PushNotificationIOS

Reviewed By: philIip

Differential Revision: D53734569

fbshipit-source-id: 20b2cd304443f27987f336e768eb44e6c5d7c2b9
2024-02-20 21:33:27 -08:00
Dustin Shahidehpour 46f53e97f0 Fix missing imports in React Native files. (#43118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43118

While debugging issues with precompiled_headers in Instagram, it became apparent that these RN files don't correctly import the necessary files to make them build on their own. Fix that!

Changelog: [iOS][Fixed] Fixed missing header imports

Reviewed By: fkgozali

Differential Revision: D53963676

fbshipit-source-id: 74e9758153f6176133475e45d27f7644d1a6dece
2024-02-20 15:33:28 -08:00
Sam Zhou bdab8700ef Deploy 0.229.0 to xplat (#43115)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43115

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D53955506

fbshipit-source-id: bfccb5674ece70dbe6b6d6d9a4982592bdff645a
2024-02-20 15:06:24 -08:00
Pieter De Baets b164302bf6 Cleanup ios_hermes:rn_heap_size_mb (#43023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43023

Unused mobile config, and is not consistently used across all the many places we can initialize a Hermes instance.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D53761942

fbshipit-source-id: a3e1adae87e41142c337a27b33750f82774cf92c
2024-02-20 14:44:59 -08:00
Phillip Pan 916dde4c60 delete access to UIApplicationLaunchOptionsLocalNotificationKey (#43114)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43114

Changelog: [iOS][Breaking]

PR#42628 introduced new behavior on how the react native infra tracks local notifications that start the app. in this PR, we are officially deleting the old implementation.

Reviewed By: ingridwang

Differential Revision: D52931617

fbshipit-source-id: 3b77479b0aacf239e45cfcc7d7c4b20e82e0b786
2024-02-20 13:11:17 -08:00
Moti Zilberman e9351f0f8a PageTarget → HostTarget (#43113)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43113

Changelog: [Internal]

Renames the "Page" concept in the modern CDP backend to "Host". Now all the Target types we have are named consistently after React Native concepts (ReactHost, ReactInstance, JSI Runtime) rather than CDP/browser concepts (Page).

Reviewed By: robhogan

Differential Revision: D53945333

fbshipit-source-id: 90e8b914ba8b4927806cbdd072ca36c78fd2093f
2024-02-20 10:39:44 -08:00
Alex Hunt d6bf51cad9 Refactor remaining forEachPackage call sites (#43112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43112

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53942028

fbshipit-source-id: 335bff3c3a31026bae7140fac1d1a6aae23a0f1e
2024-02-20 09:55:46 -08:00
Nicola Corti 4ecf57ead2 Hook the default-app-setup OnLoad.cpp file with the cxxModuleProvider from RNCLI (#43049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43049

This connects the OnLoad.cpp file used by OSS apps with the `rncli_cxxModuleProvider`.
This method is created by the CLI and takes care of querying all the TM CXX Modules discovered and returning them.

This PR is currently waiting on https://github.com/react-native-community/cli/pull/2296

Changelog:
[Internal] [Changed] - Hook the default-app-setup OnLoad.cpp file with the cxxModuleProvider from RNCLI

Reviewed By: cipolleschi

Differential Revision: D53812109

fbshipit-source-id: 47bc0ea699516993070cfa0127de97853acf8890
2024-02-20 08:30:38 -08:00
Riccardo Cipolleschi 488dd78d7c Unmount view from the reactsubviews in the Interop Layer (#43111)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43111

When mounting views in the interop layer, we register them in an array `reactSubview` that is added to `UIView`. However, when unmounting them, we were just removing them from the parent view.

This worked fine while the view we were adding to reactSubview was the same that we were adding to hierarchy. However, there are instances where libraries might wrap those views in some custom wrappers. This break the assumption that the same view we are adding to the UI hierarchy is the same view we will remove.

With this change, we make sure to use the same semantic when we add some view and when we remove it.

This also fixes a crash that happens with Mobile home when navigating away from the Ride's Map, using Fabric.

## Changelog
[internal] - Remove views from hierarchy using the view that is added to the `reactSubviews`

Reviewed By: sammy-SC

Differential Revision: D53943728

fbshipit-source-id: 56e669c14db74b6af683384b6ca72ad3f5cfdafe
2024-02-20 08:09:09 -08:00
Rubén Norte 1fc2a5a4c9 Prevent reporting mount when FabricUIManager has been destroyed (#43099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43099

In all methods of FabricUIManager we check whether it's been destroyed before doing any logic, but we don't in this asynchronous method we're scheduling to report mounts.

This adds the check in that case as well to potentially fix some crashes we're seeing in current experiments for mount hooks on Android.

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D53920863

fbshipit-source-id: 3cc18cf5237d4866940739de80cc00604bcd0fb6
2024-02-20 07:37:29 -08:00
szymonrybczak c99d96b7a1 Bump CLI to 13.6.0 (#43093)
Summary:
Bump CLI version to 13.6.0

## Changelog:

[GENERAL] [CHANGED] - Bump CLI to 13.6.0

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D53920559

Pulled By: cortinico

fbshipit-source-id: 7c95345f47c80864881fff7fce5adb35195ec723
2024-02-20 07:04:33 -08:00
Dmitry Rykun de5619ed8c Make codegenNativeComponent show warning and not error (#43070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43070

**Context**

The `codegenNativeComponent` function is a hint for the codegen that the file that contains it is a Native Component spec. Static ViewConfig codegen overwrites this function call by the generated ViewConfig.
If this function is not overwritten by the codegen, it has runtime behaviour that falls back to `requireNativeComponent`. At the time when this system was built `requireNativeComponent` was not supported in Bridgeless mode because it is relied on some Bridge-only functionality. That's why it outputs error in Bridgeless mode.
 ---

This is not the case any more, we now have interop layers which provide the functionality needed by `requireNativeComponent`.
The SVC codegen is implemented as [Babel plugin](https://github.com/facebook/react-native/tree/main/packages/babel-plugin-codegen). The are scenarios when it is not run for the native component specs:
- If the plugin is not used for whatever reason.
- If Babel is not used for whatever reason.

In order to not to regress the DevX for such cases, we've turned the error into the warning.

**Note:** we use `console.info('⚠️...` instead of `console.warn('...`. That's because `console.warn` also prints a stack trace in the console, and we didn't want to create too much noise.

Changelog: [General][Changed] - codegenNativeComponent show warning and not error if not code generated at build time.

Reviewed By: huntie, rshest

Differential Revision: D53761805

fbshipit-source-id: c924c7668e6d2e45b920672b8a309221be767a73
2024-02-20 07:04:03 -08:00
Alex Hunt a4d6be8908 Update set-version to reuse set-rn-version (#43109)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43109

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53940616

fbshipit-source-id: 8ce85437ab5164dae81a9956706c517880ee1f74
2024-02-20 05:06:03 -08:00
Alex Hunt cffb69a12b Fix path in trigger-react-native-release (#43107)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43107

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53940161

fbshipit-source-id: 0de7887ff117db6f876420c1b609924bfc237847
2024-02-20 04:22:55 -08:00
Alex Hunt 1b504382c1 Fix import in bump-all-updated-packages, add Flow (#43106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43106

Missed import in untyped, untested script during recent file move.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53940160

fbshipit-source-id: ec86c5881a2f34d992538c713f808c8d5634ba16
2024-02-20 04:22:55 -08:00
Jakub Trzebiatowski 69977d05f0 De-duplicate the logic for counting attachments (#42596)
Summary:
De-duplicate the logic for counting attachments.

This is a minor improvement in the context of my multi-PR work on https://github.com/react-native-community/discussions-and-proposals/issues/695.

## 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] [CHANGE] - De-duplicate the logic for counting attachments

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

Reviewed By: rshest

Differential Revision: D53917281

Pulled By: cipolleschi

fbshipit-source-id: cdb9bc834bddd7deffc60f33578464733982fedf
2024-02-20 04:04:01 -08:00
Riccardo Cipolleschi 10edb9f545 Add build script to check that codegen run properly in the project (#43105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43105

This is a quality of like improvement for the project we create for the final users.
Codegen generates code in `rncore`, within `node_modules`. This is not the perfect approach but it is working so far.

To make it more robust, we added a small script in React-Fabric podspec to check that codegen run properly when building.
In this way, if a user run `yarn install` and, for any reason, react-native is regenerated, we can provide a better DevX to our users with an actionable message on how to fix the build problem.

##Changelog
[iOS][Added] - Add error message if codegen has not run properly

Reviewed By: cortinico

Differential Revision: D53927788

fbshipit-source-id: a01a33086e4a0a1b0ada6c83283a5fd3fb5ee3eb
2024-02-20 04:01:50 -08:00