Commit Graph

24 Commits

Author SHA1 Message Date
Nivaldo Bondança 2ab6f22f26 Codemod format for trailing commas incoming change [5/n] (#53260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53260

X-link: https://github.com/facebook/yoga/pull/1847

Adding trailing commas.

Reviewed By: cortinico

Differential Revision: D80174965

fbshipit-source-id: 5438fa9ebce13525b1286dd30704138ef99703cb
2025-08-14 07:24:42 -07:00
Pieter De Baets 85498ad46f Remove unnecessary receiveCommand overrides (#51844)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51844

These just redefine the existing `receiveCommand` from the ViewManagerDelegate which already has this codegen'ed

Changelog: [Internal]

Reviewed By: cortinico, rshest

Differential Revision: D75869325

fbshipit-source-id: c8ba482075c2586caf33f46a871b5b5e16fda213
2025-06-09 05:49:45 -07:00
Nicola Corti c059ae1b77 Correctly propagate RN_SERIALIZABLE_STATE to 3rd party CMake targets (#51619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51619

RNTester Android is currently instacrashing in OSS due to 3rd-party packages not having the `RN_SERIALIZABLE_STATE` definition.
That's because the `INTERFACE` definition is not properly propagated on the prefab boundaries.

This was happening for `react-native-popup-menu-android` and `react-native-test-library` and will also happen for Codegen libraries.

This fixes it. 3p developers with custom CMake files will also have to use the `target_compile_reactnative_options` functions to make sure the compilation flag are properly populated.

Changelog:
[Android] [Breaking] - Correctly propagate RN_SERIALIZABLE_STATE to 3rd party CMake targets. Users with custom CMake and C++ code should update to use `target_compile_reactnative_options` inside their CMakeLists.txt files. See the 0.81 release notes for more information.

Reviewed By: cipolleschi

Differential Revision: D75441245

fbshipit-source-id: 3855fdf11cbe7f4b01f68e0dde68b63b3240ad35
2025-05-27 05:33:16 -07:00
Nick Gerleman 88de631d05 RN_SERIALIZABLE_STATE (#51185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51185

Was running into issues with split Android ParagraphState, because a lot of code is tied to `#ifdef ANDROID`, which also builds for react-native-cxx.

This does that spliitting, and also introduces `RN_SERIALIZABLE_STATE` to replace previous ANDROID checks related to state serialization, so we can cofine that to just the Android platform. These changes are dependent on each other.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74374376

fbshipit-source-id: ffb246ea2e16773f85de12209f2d88a95f8bb792
2025-05-14 16:10:08 -07:00
David Vacca 3442b3885a Implement getDelegateMethod on ReactPopupMenuManager (#49507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49507

Implement getDelegateMethod on ReactPopupMenuManager

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D69807880

fbshipit-source-id: b0168454b24a1af4e99a46e8c70ebb70162c19d0
2025-02-18 16:43:13 -08:00
David Vacca 847f8902ff Update non-codegen ViewManagerInterfaces to extend ViewManagerWithGeneratedInterface (#49274)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49274

In this diff I'm updating all the non-codegen ViewManagerInterfaces to extend ViewManagerWithGeneratedInterface to make it consistent with codenerated ViewManagerInterfaces

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D69206247

fbshipit-source-id: 6a577d9ee7410be990a03e78847333b61b429e88
2025-02-07 14:28:12 -08:00
Nicola Corti e96396bd18 Fix @react-native/popup-menu-android not building for 3rd party developers (#49212)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49212

Currently, developers can't use `popup-menu-android` at all because the Gradle file we publish is referencing
internal machinery.

I'm adding a pre-publish script that manipulates the Gradle. This is the easiest solution without having to do
crazy setup inside RNGP or having duplicated version codes around in the monorepo.

Fixes https://github.com/facebook/react-native/issues/49112

Changelog:
[Android] [Fixed] - Fix react-native/popup-menu-android not building for 3rd party developers

Reviewed By: cipolleschi

Differential Revision: D69192874

fbshipit-source-id: 9f9e8a0a6e76308e598a09f4c70dbc659c238b00
2025-02-06 05:47:37 -08:00
Pieter De Baets e0a5bbe309 Convert com.facebook.react.ViewManagerOnDemandReactPackage to Kotlin (#47682)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47682

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D66131124

fbshipit-source-id: aef75eba5fffb1e54c800a4351f8fcb5e1c8a6d4
2024-11-20 04:05:26 -08:00
Pieter De Baets 09b08aa4e0 Convert com.facebook.react.BaseReactPackage to Kotlin (#47679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47679

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D66119659

fbshipit-source-id: d7917aa09edac6d5a8c07635d294de229723f0c9
2024-11-20 04:05:26 -08:00
Pieter De Baets ba1bc639b8 Convert com.facebook.react.ReactPackage to Kotlin (#47677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47677

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D66123384

fbshipit-source-id: afac59b4b8f6a0fed9c2acd45176422aa1ffa85e
2024-11-20 04:05:26 -08:00
Nick Gerleman 7fb3d830be Breaking: Remove BaseViewManagerInterface (#46809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46809

BaseViewManagerInterface isn't adding much value right now. It was added in D16984121 to allow codegen generated ViewManager delegates to apply to view managers which derive from ViewMangager instead of BaseViewManager (if they did some cleverness, to make VM delegate apply to a no-op class, still implementing all of BaseViewManager's methods).

All of the cases where that was used have since been moved to `SimpleViewManager`, and `BaseViewManagerAdapter` (needed to wire this together) doesn't exist anymore, so it's not possible to take any advantage of this interface existing. We should remove it, since its existence  is a source of error (e.g. it was missing setters for `accessibilityValue` or those related to pointer events), and is more generally confusing for anyone adding to `BaseViewManager` in the future.

This is a breaking change, because there are some libraries which vendor a copy of generated ViewManagerDelegate when building against legacy arch to be able to share code normally generated at build time. That means these will need to be updated to maintain compatibility with RN versions of 0.77+ with new arch disabled. This will not effect compatibility of these libraries against the default new arch, and the updated delegate is still compatible with older RN version.

```
    sourceSets.main {
        java {
            if (!isNewArchitectureEnabled()) {
                srcDirs += [
                    "src/paper/java",
                ]
            }
        }
    }
```

1. `react-native-picker/picker`
2. `rnmapbox/maps`
3. `react-native-gesture-handler`
4. `react-native-screens`
5. `react-native-svg`
6. `react-native-safe-area-context`
7. `react-native-pdf`

Changelog:
[Android][Breaking] - Remove BaseViewManagerInterface

Reviewed By: cortinico

Differential Revision: D63819044

fbshipit-source-id: 7e4935c8e43706b168f0f599a6676e8abfa66937
2024-10-09 14:49:01 -07:00
Thomas Nardone c942469700 Re-enable ktfmt on RN (#46441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46441

Changelog: [Internal]

Reviewed By: zertosh

Differential Revision: D62518893

fbshipit-source-id: ca2ff83018716a4dc1e2dcfb8596138d088ce9f4
2024-09-11 19:06:25 -07:00
Alan Lee 3244a5ee74 code cleanup for depreacted OS version (#46390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46390

As React Native's minSdkVersion is not 24, clean up version checks and code that is using deprecated version from OSS

Changelog:
[Internal] - code cleanup for minSdkVersion 24

Reviewed By: philIip

Differential Revision: D62362059

fbshipit-source-id: a851d0908d4175269524f41955acca5f2da69cad
2024-09-09 00:25:54 -07:00
Nicola Corti 80c3aea48d Move libyoga.so and libturbomodulejsijni.so inside libreactnative.so (#46058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46058

This moves other 2 libraries inside libreactnative.so

Changelog:
[Android] [Changed] - Move libyoga.so and libturbomodulejsijni.so inside libreactnative.so

Reviewed By: cipolleschi

Differential Revision: D61376499

fbshipit-source-id: 8780831491a5d57c4bb747fccf8a872ad30dc09e
2024-08-16 05:42:46 -07:00
Nicola Corti 04159a53c8 Move react_codegen_* libraries for RNTester to OBJECT (#45735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45735

This merges several 2 external libraries from .so to be included inside
libappmodules.so.

Changelog:
[Internal] [Changed] - Move react_codegen_* libraries for RNTester to OBJECT

Reviewed By: rozele, rshest

Differential Revision: D60290806

fbshipit-source-id: 6bfa40995d7538e075819d916e8a204464edb75b
2024-07-26 09:56:17 -07:00
Nicola Corti 52de8c70f2 Move several libs from default App CMake setup to static linking (#43909)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43909

As we're moving towards a single `libreactnative.so` file, we need to remove several of our prefab targets. Here I'm cleaning up those that are not having an OnLoad.cpp file which needs to be loaded from SoLoader.

This is breaking for libraries using native dependencies via Prefab (i.e. search for `ReactAndroid::` in CMakeLists.txt files for your project).

If so, the CMakeLists.txt files should be updated as follows:

```diff
- ReactAndroid::react_render_debug
+ ReactAndroid::reactnative
```

This applies to every prefab dependencies (the example is just for `react_render_debug`

Changelog:
[General] [Breaking] - Remove several libs from default App CMake setup

Reviewed By: cipolleschi

Differential Revision: D55751683

fbshipit-source-id: 3aca7897852b5f323d60ede3c5036cae2f81e6c3
2024-07-26 07:00:32 -07:00
Nicola Corti cf914e412d RNGP - Autolinking. Add support for linking projects. (#44799)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44799

This is the final part of core autolinking:
1. I split RNGP into an `app-plugin` and a `settings-plugin`. This was necessary as the Gradle modules need to be loaded inside the settings.gradle.kts.
2. I've introduced a Settings Plugin to take care of either invoking the `config` command from CLI or receiving a file in input.
3. I've removed the former `RunAutolinkingConfigTask` as now the command is invoked inside the settings plugin
4. I've added hashing computed based on the lockfiles so we won't be re-executing teh `config` command if the lockfiles are not changed.
5. I've updated RN-Tester to use the core autolinking rather than manual linking for the 2 libraries it's using.

Changelog:linking
[Internal] [Changed] - RNGP - Autolinking. Add support for linking projects

Reviewed By: blakef

Differential Revision: D58190363

fbshipit-source-id: 6ab8b36729e77ca715f50a4a00aa0ca4eb5b63b1
2024-06-07 10:32:16 -07:00
Pieter De Baets 88de74b2dc Do not pass ReactContext to getViewManagersMap (#44379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44379

A common pattern to implement `ViewManagerOnDemandReactPackage` is to use a `getViewManagersMap` helper. If we capture `ReactApplicationContext` there, we will indefinitely retain the the very first ReactApplicationContext, and break/leak across reloads. Instead we should pass the `ReactApplicationContext` whenever we construct the ViewManager.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D56838427

fbshipit-source-id: 76583dd7f5564ed29f0dbfcef33d8d288cbb90e0
2024-05-02 13:25:18 -07:00
Alan Lee 47c6311422 fix issue with PopupMenuAndroid event (#44103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44103

Changes here fixes events in PopupMenuAndroid not being triggered correctly.

Issuses were:
1) naming mismatch
2) wrong parameters were set for the Event Map
3) missing code in .cpp

Applied fixes:
1) consistent event naming
2) fixed key used for event mapping
3) re-ran codegen to update .cpp files

## Changelog:

[Android] [internal] - Fix issue with PopupMenuAndroid event callback not working

Steps took to run codegen for this diff: https://www.internalfb.com/intern/phabricator/paste/markdown/P1214671854/

This diff is patching issues from D55531870

Reviewed By: RSNara

Differential Revision: D56164235

fbshipit-source-id: 4cf66ad3cfd753c146c5e219f27910834731e183
2024-04-16 00:27:57 -07:00
Nicola Corti ca7cc32288 Bump Gradle to 8.7 (#43926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43926

Just keeping our dependencies up-to-date.

Changelog:
[Internal] [Changed] - Bump Gradle to 8.7

Reviewed By: cipolleschi

Differential Revision: D55803535

fbshipit-source-id: 90bc2902d8692f1fa621a088189f6bae74c3c61f
2024-04-05 10:14:42 -07:00
Alan Lee bc3e3360d1 add PopupMenuDismissEvent (#43785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43785

Deprecated `UIManager.showPopupMenu()` had success callback that would be triggered on 1) item selection or 2) dismiss.
New `PopupMenuAndroid` only has item selection callback so adding in missing dismiss callback.

Changelog:
[Android][Added] - Add (optional) onPopupDismiss() callback for PopupMenuAndroid

Reviewed By: cortinico

Differential Revision: D55531870

fbshipit-source-id: 26f3992ef6c85fbc6d8dfff00cb723ac4aae3762
2024-04-04 02:29:29 -07:00
Nick Gerleman 15a965f0f2 Enable Kotlin warnings as errors in rn_android_library (#43755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43755

This is another place where the OSS build went ahead of the internal source of truth, which has caused build breaks more than once.

This enables warnings as errors in `rn_android_library` for consistency. This is used for a couple libraries outside of ReactAndroid that might need fixup/suppression.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55623682

fbshipit-source-id: 37da30c642de2c3d8390334a0d0bff365a4ed7a1
2024-04-02 03:21:55 -07:00
Nicola Corti 5ceb92801e Flip explicitApi to True for everyone (#43696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43696

This just sets explicitApi to true for every module inside ReactAndroid

Changelog:
[Internal] [Changed] - Flip explicitApi to True for everyone

Reviewed By: tdn120

Differential Revision: D55478674

fbshipit-source-id: c9aeba89ad5b0f88bca7fd480c6aa66e0152a456
2024-03-28 14:22:28 -07: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