Commit Graph

13 Commits

Author SHA1 Message Date
Dawid Małecki ddcab831b1 Migrate already root exported deep imports in rn-tester. (#50958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50958

In rn-tester package there are many react-native deep imports which will be deprecated in the future. It is a starter for migrating rn-tester to using root imports instead. Only deep imports that are already root exported are changed. This diff avoids using `CodegenTypes` as it causes build errors and will be resolved in next stages.

Besides import changes, `PointerEvent` type is now also exported from the root.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73656526

fbshipit-source-id: 5814a3d9c6a04b1236581dbbe291cd109e2c71c0
2025-04-28 07:24:46 -07:00
Sam Zhou 4f14499013 Fix issues in react-native ahead of making React.ComponentType an alias of component(...Props) (#50180)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50180

Prepare for the change that makes `React.ComponentType` an alias of `component(...Props)`, which comes with stricter checking and making the props automatically readonly.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D71566900

fbshipit-source-id: cefcc10fda9a9777532f25b325412b0d50ebb9b8
2025-03-20 15:05:28 -07:00
Dawid Małecki f36bfe5dfa Remove redundant {||} syntax (#48686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48686

Changelog:
[Internal] - Removed redundant `{||}` syntax

Reviewed By: javache

Differential Revision: D68205038

fbshipit-source-id: f7d3271142b6443a5859c3b668b7aebd3ce3ef3f
2025-01-15 07:07:01 -08:00
Dmitry Rykun d66d6518d8 RNTester - Legacy component example: do not convert commands to string (#42822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42822

The conversion to string was introduced in D45043929. It was supposed to fix command execution for `MyLegacyNativeComponent` in RNTester on Android/Old Architecture.

At the same time it introduced a regression on iOS, since we have [different code path](https://www.internalfb.com/code/fbsource/[ffee789cab9514c0a15b8a63869cbfdf4e534a56]/xplat/js/react-native-github/packages/react-native/React/Modules/RCTUIManager.m?lines=1088-1092) for string commands in iOS, where we expect command name, and not command number converted to string.

I tried to remove that conversion, did local tests, and saw no issues with executing commands on Android.
Looks like the underlying issue has been fixed in some other way.

So let's just remove those conversions.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D53123956

fbshipit-source-id: 968e35277e01215bd6fc1282c78f04666453317d
2024-02-05 04:01:14 -08:00
Ramanpreet Nara fafd00ab1a UIManagerJSInterface: Make reactTags non-nullable (#42208)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42208

I went through the [android](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java?fbclid=IwAR29Xk1KiGsxg7O2Fc7F2k4uKFmqqAbcMtsEEdaBalcGjJK7xuyYDo6X1Z8) and [ios](https://github.com/facebook/react-native/blob/main/packages/react-native/React/Modules/RCTUIManager.m?fbclid=IwAR2axOTNVuvGbnGw0_1wlnRhftx4W6K-ptTm_DtQ-eSOLFtnrYwzbjPyeYA) implementations of UIManagerModule. It turns out, the reactTag is always nonnull in all methods!

This diff updates UIManagerJSInterface accordingly.

Changelog: [General][Changed] - UIManagerModule: Make reactTags required

Reviewed By: sammy-SC

Differential Revision: D52627087

fbshipit-source-id: e79650f539fa2fbc00654a1ecce4fae2da8ae11a
2024-02-03 13:12:10 -08:00
Zeya Peng 5d1eac047a add RNTester example for native command Array param (#41897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41897

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D51875073

fbshipit-source-id: 403274b3063d7c49fe4642347d2f724d58a46c1f
2023-12-14 21:06:09 -08:00
Moti Zilberman d6e0bc714a Enable lint/sort-imports everywhere (#41334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41334

TSIA.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025812

fbshipit-source-id: e10d437be775a6b80946483aa96460f34927f870
2023-11-06 12:59:38 -08:00
Nicola Corti 6dcdd2e2bc Fix old-arch component not updating background in interop layer example (#36924)
Summary:
I've noticed that in the Fabric Interop Layer sample on RN-Tester, when running with Old Arch, the legacy view is not receiving the commands correctly.
This is due to us not sending the command as string, which is making the command fail to deliver.

## Changelog:

[INTERNAL] - Fix old-arch component not updating background in interop layer example

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

Test Plan:
Tested locally:

| Before | After |
|--------|--------|
| ![screen-1681728104](https://user-images.githubusercontent.com/3001957/232461662-68b23545-f38c-40fe-9a5d-44bb0cae29e9.png) | ![screen-1681728077](https://user-images.githubusercontent.com/3001957/232461651-eec93a51-b0f0-4650-af3a-c5dd991f2f96.png) |

Reviewed By: cipolleschi

Differential Revision: D45043929

Pulled By: cortinico

fbshipit-source-id: 8bb2a052a1a600046f3a16c868062c5e600385f0
2023-04-18 04:24:13 -07:00
Riccardo Cipolleschi c7aaae61ca Make UIManager.dispatchViewManagerCommand work in Fabric through Interop Layer (#36578)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36578

This change brings to the Fabric Interop Layer the possibility to directly call native methods on the View Manager, something that was not possible before and that we can use to simplify the migration to the New Architecture.

## Changelog:
[iOS][Added] - Native Components can now call native methods in Fabric when they are loaded through the Interop Layer

Reviewed By: sammy-SC

Differential Revision: D43945278

fbshipit-source-id: fe67ac85a5d0db3747105f56700d1dbba7ada5f1
2023-03-29 15:30:26 -07:00
Riccardo Cipolleschi c005830958 Add Fabric Interop event example
Summary:
This changes adds an example to RNTester to verify that the Interop Layer can process bubbling events in Fabric as it used to do in Paper.

## Changelog:
[iOS][Added] - Add example in the Interop Layer to use events

Reviewed By: sammy-SC

Differential Revision: D43911390

fbshipit-source-id: ae75db25078669676e5a609e090f1e9674026391
2023-03-10 04:52:44 -08:00
Nicola Corti ab55e123da Expose UnstableReactLegacyComponentDescriptor inside rrc_legacyviewmanagerinterop
Summary:
This adds the `UnstableReactLegacyComponentDescriptor`, part of the Fabric Interop Layer for Android.

Summary of the changes are:
* Expose a new `rrc_legacyviewmanagerinterop` native module via prefab
* Extend default App Cmake setup so `rrc_legacyviewmanagerinterop` is exposed by default
* Add a sample legacy component inside RN Tester

Changelog:
[Internal] [Changed] - Expose UnstableReactLegacyComponentDescriptor inside react/renderer/core

Reviewed By: cipolleschi

Differential Revision: D43731219

fbshipit-source-id: ee26d7e9d7eff5ef6a3e22853f8ea363b9198567
2023-03-02 05:10:45 -08:00
Simeng Pang 851c8c671a Revert D43500868: Expose UnstableReactLegacyComponentDescriptor inside react/renderer/components/legacyviewmanagerinterop
Differential Revision:
D43500868 (https://github.com/facebook/react-native/commit/071f6d2ca697ad298f41572e3d70a238f00ae8a3)

Original commit changeset: acfcd89efc42

Original Phabricator Diff: D43500868 (https://github.com/facebook/react-native/commit/071f6d2ca697ad298f41572e3d70a238f00ae8a3)

fbshipit-source-id: bb354015b2dcc812491b0219c6dd4d9c6321dc0b
2023-03-01 23:09:13 -08:00
Nicola Corti 071f6d2ca6 Expose UnstableReactLegacyComponentDescriptor inside react/renderer/components/legacyviewmanagerinterop (#36344)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36344

This adds the `UnstableReactLegacyComponentDescriptor`, part of the Fabric Interop Layer,
inside the `react/renderer/components/legacyviewmanagerinterop` module so that it can be included by the user externally.

If we wish to place it somewhere else, I'm more than happy to move it around.

Changelog:
[Internal] [Changed] - Expose UnstableReactLegacyComponentDescriptor inside react/renderer/components/legacyviewmanagerinterop

Reviewed By: mdvacca, cipolleschi

Differential Revision: D43500868

fbshipit-source-id: acfcd89efc42ff7a4ee6cb0a1cbd71d69f79721f
2023-03-01 17:58:07 -08:00