Commit Graph

55 Commits

Author SHA1 Message Date
Arushi Kesarwani 7b40c8ee5f Support onWindowFocusChange in Bridgeless (#43398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43398

Implement onWindowFocusChange in Bridgeless by adding it to the ReactHostImpl

Changelog:
[Android][Breaking] Implement onWindowFocusChange in Bridgeless

Reviewed By: javache

Differential Revision: D54670119

fbshipit-source-id: 71f560e5a3bf0e853ac06955e67b8035f1ec0468
2024-03-12 11:52:52 -07:00
Arushi Kesarwani c6076bca97 Implement getJSCallInvokerHolder for BridgelessCatalystInstance (#43400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43400

Implement `getJSCallInvokerHolder()` for BridgelessCatalystInstance

Changelog:
[Android][Breaking] Implement `getJSCallInvokerHolder()` for Bridgeless Catalyst Instance

Reviewed By: cortinico

Differential Revision: D54650305

fbshipit-source-id: effac3daaad5173c2fd78ab11bbe3f3156a9c07b
2024-03-11 12:19:49 -07:00
Pieter De Baets 3283202248 Remove createRootView(initialProps) from ReactDelegate (#43365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43365

Changelog: [Android][Changed] Simplified ReactActivityDelegate to expose a single createRootView method.

Reviewed By: cortinico

Differential Revision: D54434648

fbshipit-source-id: 305c54910a1eac25664507972879c7c6bd633466
2024-03-11 09:40:33 -07:00
Pieter De Baets 641a9c468f Move lifecycle listener inside JavaTimerManager (#43338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43338

Reafactor JavaTimerManager so more code is shared between bridge and bridgeless.

Note that HeadlessJSTaskContext is not currently configured when using bridgeless.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D54496604

fbshipit-source-id: 2a61294267df372e69f8316dd8f8059625d0a2bd
2024-03-11 09:09:52 -07:00
Pieter De Baets 5ed3057822 Make ReactActivityDelegate methods public (#43367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43367

Enable `ReactActivityDelegate` to be used outside of `ReactActivity` as well.

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D54634339

fbshipit-source-id: 977e0da689d5a827feca89a5dcc9416ad5178334
2024-03-08 07:04:12 -08:00
Arushi Kesarwani c771011fed Support onActivityResult in Bridgeless (#43351)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43351

Implement `onActivityResult` on Bridgeless

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D54574139

fbshipit-source-id: f2369077199186ac6ef0187b5dfe7ed95f3b87fc
2024-03-06 13:19:55 -08:00
Rubén Norte fafd64e9c3 Migrate mount hooks flag to new system (#43350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43350

Changelog: [internal]

Mount hooks have been shipped on iOS, so this removes the flag for them.

On Android, we're still testing them so it's worth moving them to the new system and scoping them to that platform.

Reviewed By: sammy-SC

Differential Revision: D54587740

fbshipit-source-id: d074927fee1a967bd3928970c31975d07cd393bb
2024-03-06 12:41:49 -08:00
Ryan Linton 0dc5c5f1f4 Update bridge to handle long values (#43158)
Summary:
This adds support for 64 bit integer (long) values to the Android bridge. Per the wide gamut color [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738) Android encodes wide gamut colors as long values so we need to update the bridge to support 64 bit integers as well since these classes will soon receive those values from native.

## Changelog:

[ANDROID] [ADDED] - Update bridge to handle long values

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

Test Plan: I added tests where I could for long types and truncation. I would like to add tests for ReadableNativeArray and ReadableNativeMap but I'm not sure how to go about mocking HybridData.

Reviewed By: cipolleschi

Differential Revision: D54276496

Pulled By: NickGerleman

fbshipit-source-id: 1e71b5283f662748beef1bdb34d9c86099baecb0
2024-03-04 19:07:53 -08:00
Arushi Kesarwani 64b0c9cba4 Add BridgelessCatalystInstance as a placeholder for backwards comptability of legacy APIs of CatalystInstance
Summary:
In order to make the legacy APIs of Catalyst Instance backwards compatible, introducing a regular class that implements CatalystInstance so as to make these APIs available for folks in Bridgeless mode as well.

Changelog:
[Internal] internal

Reviewed By: RSNara

Differential Revision: D54093013

fbshipit-source-id: f494c05e79f570883f9b5374cd177862970304c0
2024-02-29 15:46:43 -08:00
Nicola Corti 4d982dcdae Undo moving of TurboModule to internal and expose utility function for TurboModule.class.isAssignableFrom (#43219)
Summary:
After discussing with mdvacca, we prefer to undo the change of `TurboModule` package to `.internal` as this is a quite aggressive breaking change for the ecosystem.

Moreover: users should not invoke `TurboModule.class.isAssignableFrom` because `TurboModule` is `.internal`. Therefore I'm exposing another API to check if a class is a TurboModule as a static field of `ReactModuleInfo`.

## Changelog:

[INTERNAL] - Do not use TurboModule.class.isAssignableFrom

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

Test Plan: Tests are attached

Reviewed By: mdvacca, cipolleschi

Differential Revision: D54280882

Pulled By: cortinico

fbshipit-source-id: 9443c8aa23cf70dd5cfe574fe573d83313134358
2024-02-29 10:23:09 -08:00
Rubén Norte a861a66d71 Add uiThreadConditionalSync executor to AndroidExecutors
Summary:
Changelog: [internal]

This adds a new type of executor in AndroidExecutors to execute runnables on the UI thread.

If the caller is already on the UI thread it'd call the runnable immediately. Otherwise it'd be scheduled in the UI thread to execute asynchronously.

Reviewed By: huntie

Differential Revision: D53941120

fbshipit-source-id: b68c7a4540be2a12df930e4e52eeb7b7a1aa91d8
2024-02-28 09:53:18 -08:00
Ryan Linton 57ed0fb309 MapBuffer long support (#43030)
Summary:
This adds support for 64 bit integer (long) values to MapBuffer. Per the wide gamut color [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738) Android encodes wide gamut colors as long values so we need to update MapBuffer to support 64 bit integers as well.

## Changelog:

[ANDROID] [ADDED] - Add 64 bit integer (long) value support to MapBuffer

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

Test Plan: I've added a test to the MapBuffer test suite. This new API is otherwise currently unused but will be used in subsequent PRs as part of wide gamut color support changes.

Reviewed By: mdvacca

Differential Revision: D53881809

Pulled By: NickGerleman

fbshipit-source-id: 39c20b93493a2609db9f66426640ef5e97d6e1a8
2024-02-27 17:33:40 -08:00
Nicola Corti 48a723366a Convert RNLog to Kotlin
Summary:
Convert RNLog to Kotlin

Changelog:
[Internal] [Changed] - Convert RNLog to Kotlin

Reviewed By: mdvacca

Differential Revision: D54010172

fbshipit-source-id: eff124f094248563a2b80575d5ca9e8dae2563f7
2024-02-24 01:50:24 -08:00
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 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
Samuel Susla ca980447f0 remove feature flag enableOnDemandReactChoreographer (#43044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43044

changelog: [internal]

Reviewed By: javache

Differential Revision: D53758129

fbshipit-source-id: bd921553e2aeaadac56624a100f5f27310995c98
2024-02-15 08:09:27 -08:00
Pieter De Baets 5a5c9eb96c Remove ReactViewManagerWrapper
Summary:
This was introduced to support MapBuffer-based view managers (D33735245), but that experiment has been removed from the codebase (D53072714).

This indirection is preventing a proper fix for a crash we're seeing with RemoveDeleteTree (T178300877)

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D53586567

fbshipit-source-id: d391ca56b23fc3dd57429c5ad8a7a405e97a81f2
2024-02-15 05:39:23 -08:00
Nicola Corti 6a4d011c6b Backport addUIBlock and prependUIBlock to Fabric for Android
Summary:
The `.addUIBlock` and `.prependUIBlock` APIs on UiManagerModule are missing on Fabric.
Here I'm re-implementing them to make migration to Fabric easier.

Set of changes:
- Moved `NativeViewHierarchyManager` to `NativeViewHierarchyManagerImpl` and extracted an interface
- Moved `addUIBlock` and `prependUIBlock` to the shared `UIManager` interface
- Added a `InteropUIBlockListener` class that takes care of executing the UI Blocks, implemented as a `UIManagerListener`

Changelog:
[Android] [Changed] - Changed the API of addUIBlock and prependUIBlock to implement it also in Fabric.

Reviewed By: mdvacca

Differential Revision: D53612514

fbshipit-source-id: 1cddbc391477318064f15c733a380983c3737373
2024-02-14 02:10:48 -08:00
Nick Gerleman 6c2f0888a4 Back out "Migrate flag enablePropIteratorSetter to new system"
Summary:
Original commit changeset: d6fd1e819abb

Original Phabricator Diff: D52810065

Changelog: [Internal]

Reviewed By: lunaleaps, mdvacca

Differential Revision: D53736651

fbshipit-source-id: 5ffd61467af0b87b0bc125c5a4b25575f32642ee
2024-02-13 19:06:21 -08:00
Rubén Norte ced4994247 Migrate flag enablePropIteratorSetter to new system (#42432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42432

Changelog: [internal]

This feature flag is accessed through `CoreFeatures` but it's initialized a few different ways:
* Android: assigned via `ReactFeatureFlags`, which is overridden by apps.
* iOS: `ReactNativeConfig` that's mapped to a dynamic configuration.

This migrates the flag to the new feature flag system.

Reviewed By: mdvacca, RSNara

Differential Revision: D52810065

fbshipit-source-id: d6fd1e819abbc4c3dee9e6221d8f99384f5197f5
2024-02-13 12:33:57 -08:00
David Vacca d0dd0e2852 Cleanup ReactScrollView
Summary:
Cleanup some code and lints in ReactScrollView

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D53485242

fbshipit-source-id: ec8d0c4b42d88786c14897e4ff4b44c2cc084d87
2024-02-10 10:33:16 -08:00
David Vacca 91fe3b484b Fully rollout FabricSharedEventPipeline (#42949)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42949

Reviewed By: javache, sammy-SC

Differential Revision: D53552253

fbshipit-source-id: 67e9db9bd48dd9c37a78e74faf0406fef0c3ad8d
2024-02-09 18:27:03 -08:00
Nicola Corti 3c2b2b181c Kotlin to 1.9.22 (#42927)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42927

This bumps Kotlin to 1.9.22 which is the latest in OSS and closer to the version we use inside fbsource.

Turns out that Explicit API mode was not enabled correctly, so I had to go over all the Kotlin classes
and correctly set them to `public` if they were intended to be for public consumption.

I updated some of them to `private` or `internal` but otherwise I've defaulted to `public` which is the default
we have right now.

Changelog:
[Android] [Changed] - Kotlin to 1.9.22

Reviewed By: cipolleschi

Differential Revision: D53576844

fbshipit-source-id: dd8b08ce9bf87f738159f60fd850e3e3bc490ebc
2024-02-09 10:58:29 -08:00
Rubén Norte 5e03813d18 Migrate enableBackgroundExecutor feature flag to new system (#42910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42910

TSIA

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D53516252

fbshipit-source-id: 6371317737d0125d2418ff226bb73017cb213767
2024-02-07 12:27:15 -08:00
Samuel Susla 57e49b584d remove gating around improved onLayout batching (#42631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42631

changelog: [General][Breaking] onLayout event batching changes

Reviewed By: mdvacca, veviego

Differential Revision: D52955970

fbshipit-source-id: 9e8a340c47bd0e39a55cc1d16a6361959342c55f
2024-02-05 07:43:17 -08:00
Nicola Corti 78f50020ef Back out "Add onUserLeaveHint support to ReactActivityDelegate" (#42791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42791

Original commit changeset: 491fc062421d

Original Phabricator Diff: D53279501

Reviewed By: mdvacca

Differential Revision: D53321360

fbshipit-source-id: 36ce929250077a9c2919ba7f01d937dc09986ec8
2024-02-01 13:46:38 -08:00
Wojciech Dróżdż 3b6c522942 Add onUserLeaveHint support to ReactActivityDelegate (#42741)
Summary:
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/42741

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

Reviewed By: javache

Differential Revision: D53279501

Pulled By: cortinico

fbshipit-source-id: 491fc062421da7e05b78dc818b22cd1ee79af791
2024-02-01 09:07:15 -08:00
Ramanpreet Nara 35308a73a5 Open source PopupMenuAndroid
Summary:
In React Native 0.75, we will remove UIManager.showPopupMenu(), UIManager.dismissPopupMenu().

To replace that API, we are introducing this <PopupMenuAndroid> component. This component works in both Fabric and Paper!

For the usage, please see PopupMenuAndroidExample.js.

Changelog: [Android][Added] - Introduce PopupMenuAndroid to replace UIManager.showPopupMenu()

Reviewed By: mdvacca

Differential Revision: D52712758

fbshipit-source-id: a87628a168d64fabbcc4d0f7b694fa639a927448
2024-01-29 18:54:14 -08:00
Nick Gerleman daa308027a Migrate enableSpannableBuildingUnification to new feature flag system (#42716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42716

Migrates this to the new flag system just added.

Made a quick change to the Android template, to mark Kotlin accessors as `JvmStatic` to make calling from Java more idiomatic.

Next diff will wire to MC.

Changelog: [Internal]

Reviewed By: rubennorte, mdvacca

Differential Revision: D53198874

fbshipit-source-id: 6ab5b279d9ac59733c6e820c25be72383ce0e54a
2024-01-29 18:15:22 -08:00
Jakub Trzebiatowski d4c3311296 Move all ReactSpan subclasses to a separate folder (#42594)
Summary:
Move all `ReactSpan` subclasses to a separate folder.

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.

I'm adding a new span class later, which was the direct motivation for this change.

## 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] - Move all `ReactSpan` subclasses to a separate folder

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

Reviewed By: mdvacca

Differential Revision: D53123733

Pulled By: cortinico

fbshipit-source-id: 10db214a520d157c231e6f3b97948b4209a7ad4b
2024-01-26 11:58:56 -08:00
Rubén Norte f8f7949e25 Move feature flags for the event loop to ReactNativeFeatureFlags (re-land) (#42677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42677

Changelog: [internal]

This is a re-application of https://github.com/facebook/react-native/pull/42434 which had to be reverted after a problem in a previous PR.

See details in the original PR.

Reviewed By: huntie

Differential Revision: D53122991

fbshipit-source-id: 5bc4306522fc5fa48ea81d0802d0f891706cfbf5
2024-01-26 09:55:27 -08:00
David Vacca 31a8bc9644 Back out "Move feature flags for the event loop to ReactNativeFeatureFlags"
Summary:
Original commit changeset: e30a6f2e12b4

Original Phabricator Diff: D52819137

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D53113944

fbshipit-source-id: daac6f2bf1e9cd16354987e17cb27f0bcda25f9d
2024-01-25 21:52:59 -08:00
Nick Gerleman 94a9791f2f Remove unshipped view/layout props-parsing paths
Summary:
We are making some decently large changes around here, to transition Fabric away from Yoga's private API, and add new units, and CSS properties. Even confined to Fabric, we have a large matrix of different paths for parsing.

This change consolidates layout props parsing to a single, tested path, used everywhere.

Concretely, this means removing:
1. MapBuffer for ViewProps
2. Iterator style props parsing (for layout props only)

MapBuffer for ViewProps to my understanding is not currently used at all, and has been live to edits, but untested, for quite some time. Iterator style props parsing is still enabled in some configurations, but we don't want to broadly ship its current form, and haven't been able to prioritize shipping it.

Both MapBuffer, and iterator style props parser, are performance wins. If we look at seriously shipping one of these again, we should look at swapping out the current path.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D53072714

fbshipit-source-id: 0a737c8c8f50b1f2c5c0b7ff0415e84a26a06abb
2024-01-25 20:03:52 -08:00
Samuel Susla 3c6c282c0a remove fix_stopped_surface_view_leak_android feature flag (#42666)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42666

changelog: [internal]

This is shipped, let's remove gating.

Reviewed By: javache

Differential Revision: D53088420

fbshipit-source-id: ac885596da4aab7131ac7a84ff8e6655d28d6ad3
2024-01-25 15:39:55 -08:00
Rubén Norte e04d1b47b6 Move feature flags for the event loop to ReactNativeFeatureFlags (#42434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42434

Changelog: [internal]

The flags for the event loop were set up using different mechanisms due to the limitations of the previous feature flags systems. Now we can centralize on the new system and use them consistently on Android and iOS.

Reviewed By: RSNara

Differential Revision: D52819137

fbshipit-source-id: e30a6f2e12b4a027a906502b80a70dd48bb657b6
2024-01-25 13:55:11 -08:00
David Vacca dc2ce9e66e Fix incorrect measurement of TextInput (#42655)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42655

This bug is caused by a caching issue: when the user enters a new character into the textInput: ReactTextInput 1) caches the Spannable entered by the user and 2) it updates internal Fabric state, which triggers the measurement of the TextInput component using the cached Spannable.

The problem is that the Spannable entered by the user has the wrong "styles" for the text input. Since measurement is using the cached Spannable, then the measurement of the TextInput ends up being is incorrect.

In this diff I'm fixing the bug by updating the styles (lineHeight) of the cached spannable that is cached when the user updates the TextInput.
The styles weren't updated correctly because mTextAttributes didn't have the proper style props set

Changelog:
    [Android][Fixed] - Fix incorrect measurement of TextInput when new architecture is enabled

Reviewed By: javache, sammy-SC

Differential Revision: D52924982

fbshipit-source-id: ced9f2c348bdb9bf706028b1063858cebd5a071a
2024-01-25 11:07:12 -08:00
Pieter De Baets c9764c5a17 Clarify docs and deprecation on Event methods (#42600)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42600

Disentangled the logic for emitting touches to JS on Android. `receiveTouches` should never be used as a public API, as TouchEvents can be dispatched just like any other event, and receiveTouches is an internal helper for `TouchEvent`.

Changelog: [Android][Removed] Updated migrated guidance for EventEmitter and reduced visibility of internal TouchesHelper methods

Reviewed By: cortinico

Differential Revision: D52907393

fbshipit-source-id: a8207039c863ab23a1d93dd2d2f28e8a274c8ecf
2024-01-25 07:33:17 -08:00
Krzysztof Magiera 0ea16fd3f7 Unify codepath for retrieveing metro location on Android (#42617)
Summary:
With the current ways metro location is determined, when we want to use a different metro port this requires app to be rebuild as the port and location are stored in resource file that gets compiled to R.class. The only way to avoid app rebuild due to a port change is to use shared preferences that can be accessed from dev menu, where metro URL can be specified. However, due to a separate code-paths for retrieving bundle location and for `/inspector/device` calls, the setting only applies to the former. As a consequence, you can change metro URL in the shared preferences, but debugging would only work if you use the default port or you rebuild the app with the correct port number.

This PR removes the separate code-path for retrieving inspector URL including all the dependencies scattered across different files including the gradle plugin. We then replace calls to `PackagerConnectionSettings.getInspectorServerHost` with `PackagerConnectionSettings.getDebugServerHost` which respects the shared preferences and other possible ways of configuring the port.

I decided to remove the separate inspector URL code path, as the resource value for inspector port added in https://github.com/facebook/react-native/issues/23616 was never functioning properly due to a bug. In the said PR introduced a bug in [AndroidInfoHelpers.java](https://github.com/facebook/react-native/blob/a13d51ff1c38ea85e59f4215563c0dd05452f670/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.java#L77) where `react_native_dev_server_port` was used instead `react_native_inspector_proxy_port`. As a result the added resource value was never read.

This can be potentially a breaking change as I'm removing some public methods. However I think it is unlikely anyone relied on said methods. As a part of this PR I'm also changing occurences of removed methods from ReactAndroid.api – I don't know how to test those changes since I don't understand how this file is used as it doesn't have any references in public code.

## Changelog:

[ANDROID] [FIXED] - Make Android respect metro location from shared preferences for the debugger workflow

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

Test Plan:
1. Run android app on emulator using default port
2. Check the debugger works when using "Open Debugger" option from dev menu
3. Restart metro with custom port (`--port 9090`) while keeping the app running
4. Open dev menu, click "Settings" then "Debug server host & port", put "10.0.2.2:9090" there
5. Reload the app
6. Before this change things like hot reload would continue to work while "Open Debugger" option would do nothing
7. After this change both reloading and debugging will work

Important: I haven't tested changes made to ReactAndroid.api as I don't know what this files is used for with no references in the codebase.

Reviewed By: cortinico

Differential Revision: D53010023

Pulled By: huntie

fbshipit-source-id: cc8b9c5c7e834ec9ea02b1ed5acf94f04f7b7116
2024-01-25 02:29:13 -08:00
Xin Chen 212e795edb Deprecate ReactFeatureFlags.reduceDeleteCreateMutationLayoutAnimation (#42338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42338

This diff cleans up the code added in D41895427 to run QE: https://fburl.com/qe2/0di6ipt6

More context: https://fb.workplace.com/groups/react.technologies.discussions/permalink/3479283292303384/

Changelog:
[Android][Internal] - Revert internal optimizations

Reviewed By: mdvacca

Differential Revision: D52751274

fbshipit-source-id: 61cd084ffa02561637d8ce7f8a113c3e6818b063
2024-01-22 12:52:01 -08:00
Xin Chen 0e90cd46f1 Revert QE for ReactFeatureFlags.reduceDeleteCreateMutation (#42339)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42339

This diff cleans up the code added in D41900201 to run QE: https://fburl.com/qe2/ovgxlayy

More context: https://fb.workplace.com/groups/react.technologies.discussions/permalink/3479283292303384/

Changelog:
[Android][Internal] - Revert internal optimizations

Reviewed By: mdvacca

Differential Revision: D52750975

fbshipit-source-id: 675a3d0bb05094e35e47b35e6840fb2e5a24b9a1
2024-01-22 12:52:01 -08:00
Erica Klein a58ec074b6 Back out "Send Modal onDismiss event on iOS (Fabric) and Android" @bypass-github-export-checks
Summary:
~~Original commit changeset: f419164032c3

Original Phabricator Diff: D52445670

bypass-github-export-checks

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D52932743

fbshipit-source-id: ea37270998213de0ae732477e0fb99b47aae7cd5
2024-01-20 05:57:48 -08:00
Jakub Trzebiatowski 7bcdb23cf0 De-duplicate building Spannable on Android (#39630)
Summary:
A first step in my work on https://github.com/react-native-community/discussions-and-proposals/issues/695

De-duplicate the code for creating `Spannable` on Android. I'm planning to add quite serious new features to this module. This would be really hard with the current level of code duplication.

## Changelog:

[INTERNAL] [CHANGED] - De-duplicate building `Spannable` on Android

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

Test Plan: I tried to ensure that the refactored code is relatively easy to prove to be equivalent to the original duplicated one, but there's always a risk of a human mistake in this process. So far, I have been testing this by ensuring that nothing broke in the `Text` example section in RNTester.

Reviewed By: mdvacca

Differential Revision: D51016244

Pulled By: NickGerleman

fbshipit-source-id: e9f873c01b2af0685c7b0943aebea170c997d22e
2024-01-19 17:24:52 -08:00
Nicola Corti fd0ca4dd62 Undo move of CallInvokerHolder to .internal (#42362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42362

This undos a change of CallInvokerHolder bringing it back in the public package: https://github.com/facebook/react-native/commit/b7191cde4e36

The problem is that if a developer wants to use the C++ CallInvokerHolder to schedule work on the JS thread from C++, they're forced to import the `.internal`
Java/Kotlin class.

Plus this is going to be a massive breaking change for the ecosystem:
https://github.com/search?type=code&q=%2Fimport.*CallInvokerHolderImpl%2F

So unless we come with a clear deprecation/replacement path, I'm undoing this change for now.

Changelog:
[Internal] [Changed] - Undo move of CallInvokerHolder to `.internal`

Reviewed By: cipolleschi

Differential Revision: D52873256

fbshipit-source-id: 900c3170ed2100ec706b03112bc23a0ba0171bcc
2024-01-19 06:18:28 -08:00
Samuel Susla 565dec4d20 remove gating for rtl swapping fix + clean Paragraph Yoga node (#42297)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42297

changelog: [internal]

Reviewed By: fkgozali

Differential Revision: D52728092

fbshipit-source-id: 6d05e5b72a350847030e0655aa914b64a4681752
2024-01-19 01:36:05 -08:00
Pieter De Baets 3cd85dc933 Fix RemoveDeleteTree and subview clipping compatibility (#42355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42355

`RemoveDeleteTreeUIFrameCallback` operated directly on the view to clean up its children, which does not correctly account for subviews which have been clipped because they're outside the visible frame.

Changelog: [Android][Added] Added `removeAllViews` to IViewGroupManager.

Reviewed By: jehartzog, sammy-SC

Differential Revision: D52834835

fbshipit-source-id: fb7f07a17d07467eecd3ce9721afc2f3abcc0caa
2024-01-18 07:58:49 -08:00
Gijs Weterings 17824fd56c update ReactAndroid.api for D52802644 (#42336)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42336

D52802644 land raced with D52800160

Changelog:
[Android] [Removed] - Remove deprecated DefaultNewArchitectureEntryPoint.load overload

Reviewed By: christophpurrer

Differential Revision: D52836926

fbshipit-source-id: 88aa74f6f100686d7e6f4fc4de3966bbe1784756
2024-01-17 08:13:21 -08:00
Gijs Weterings a5fbe28c29 Update ReactAndroid.api with changes after fixing react-native-android-breaking-change-detector (#42327)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42327

This diff is the result of running

`buck2 run //xplat/js/scripts/rn-api:generate-rn-api-metadata`

After this lands, `react-native-android-breaking-change-detector` will actually be green again, after the previous diff fixed the infra setup.

 Changelog: [General][Fix] Update stale ReactAndroid.api values after CI breakage

Reviewed By: cortinico, mdvacca

Differential Revision: D52800160

fbshipit-source-id: b96533baa1cb704ad43482d7a52db50e6dce9821
2024-01-17 03:29:07 -08:00
David Vacca 0b14eed185 Revert experiment that disables NativeModule codegen (#41978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41978

I'm revering the removal of ReactModule codegen.

We are postpoinging the removal of the codegen for the future, the reasons are:
- resources: the experiment that removes the codegen shows neutral metrics, but the codegen is shared between bridge and bridgeless, so we will need to implement and test the removal for bridge and we don't have the time to do this right now.
 - reduce fragmentation: we don't want to fragment NativeModules configuration between bridge and bridgeless, doing so will bring a lot of confusion to developers
- we don't want to introduce a public APIs in 0.73 that we know they are not used in production for now, we better remove these "unstable" apis before 0.74 cut

Note: I'm updating ReactAndroid.api because this is an intended change of APIs which were not part of 0.73 and we don't want them to be part of 0.74.

changelog: [internal] internal

Reviewed By: RSNara

Differential Revision: D52223650

fbshipit-source-id: 681bf5e4aab776505f64b1972a6ace6340db4587
2024-01-12 09:20:31 -08:00
Ramanpreet Nara 77f3edd32c UIManager: Delete replaceExistingNonRootView (#42065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42065

We should delete from UIManager:
- There are no usages of this api at Meta.
- The only usages found on GitHub are from old forks of React Native: [Github search](https://github.com/search?q=replaceExistingNonRootView+language%3AJavaScript&type=code&p=5&l=JavaScript)

Changelog: [Android][Removed] - Delete UIManager.replaceExistingNonRootView

Reviewed By: sammy-SC

Differential Revision: D52345872

fbshipit-source-id: b61e49731c68fff1f9c4223924a95b4d1e4763c1
2024-01-10 07:01:22 -08:00