Commit Graph

18 Commits

Author SHA1 Message Date
generatedunixname89002005287564 4553f87489 Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53591)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53591

Reviewed By: rshest

Differential Revision: D81571883

fbshipit-source-id: 479a0764eabeac968028814ec6aafa32687b0905
2025-09-04 03:13:49 -07:00
generatedunixname89002005287564 e60ddf0adb Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [B] (#53425)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53425

Reviewed By: javache

Differential Revision: D80619000

fbshipit-source-id: d012c170ed366904b39ef335fea5241b604461ec
2025-08-22 05:52:14 -07:00
Riccardo Cipolleschi e9c8fee4ef Add Example for InteropLayer on RNTester (#51260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51260

This is a preparatory change that adds an example to RNTester for the Fabric interop layer on iOS.
This example is needed to create a Jest E2E tests that will make sure that the Fabric Interop Layer can properly add views as subviews.

We discovered the bug thanks to react-native-maps.

## Changelog:
[Internal] - Add Example for the Fabric Interop Layer to RNTester iOS

Reviewed By: cortinico

Differential Revision: D74579737

fbshipit-source-id: 0c1bbb06790b01313cd98aa4b7152d8aba0cded3
2025-05-14 10:11:03 -07:00
Riccardo Cipolleschi 7de3111f9b Add Maestro test for New Arch Example (#46541)
Summary:
This change adds automated tests for the New Architecture Examples page in RNTester.
It also updates the NativeComponentExample to make sure that iOS and Android behaves in the same way and in a reliable way.

## Changelog:
[Internal] - Adds

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

Test Plan:
* Android:

https://github.com/user-attachments/assets/65ead328-9c4f-4e0f-8b9b-992ffb584566

* iOS:

https://github.com/user-attachments/assets/412a4f68-c9c9-4ff2-a3e9-ae7194deef77

Reviewed By: cortinico

Differential Revision: D62879289

Pulled By: cipolleschi

fbshipit-source-id: 59e15f48f5995b18fd8b3ee24aca726b93e04d9f
2024-09-18 06:15:58 -07:00
Dmitry Rykun 4d07aae7ef RNTester: add legacy style event to MyNativeViewNativeComponent (#42809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42809

This diff adds a legacy style event to `MyNativeViewNativeComponent`.
This is a way of defining events where you specify additional string type parameter in the EventHandler in the spec. This additional type parameter is an overridden top level event name, that can be completely unrelated to the event handler name.
In this example it is `onLegacyStyleEvent` and `alternativeLegacyName`.
More context here D16042065.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D53310318

fbshipit-source-id: 4dec08c872acdfd09b9939f690fb7bc777149580
2024-02-13 02:47:53 -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
Nick Gerleman a966291611 Consistent QualifierAlignment (for real this time I swear) (#39217)
Summary:
(reland of D48761722)

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

React Native uses an inconsistent mix of "west const" and "east const". E.g. `const auto &` in 74 files, but `auto const &` in 60. Sometimes they are mixed from one line to the next:  {F1079102436}

Clang format 14 adds a QualifierAlignment option, but fbsource is still on 12, so we cannot use it in our config until the [world is updated]()https://fb.workplace.com/groups/toolchain.fndn/posts/24006558685624673/?comment_id=24009214565359085&reply_comment_id=24009455088668366. This diff just runs a local version of Clang format locally first to fix QualifierAlignment, then reformats with the fbsource version, to fix any other output differences unrelated to that. This will not continually enforce a style, but will make the world more consistent, and hopefully encourage a consistent style until we can set it.

West const seems more popular in `//xplat` so I just picked left alignment somewhat arbitrarily, but we could also maybe take a poll on this.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: shwanton

Differential Revision: D48852450

fbshipit-source-id: 1789aa0db43948169f482188cb8b5e8f0f0246b8
2023-08-30 19:56:13 -07:00
Riccardo Cipolleschi b6b09a7e72 Add support for distributed registration of Fabric Components with Dynamic Libraries (#37274)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37274

With dynamic frameworks, we can't use floating C functions.

The way in which dynamic frameworks work is that they need to be self contained. They are built in isolation so that other frameworks can be linked against them to solve their dependencies.

Currently, when working with 3rd party libraries, we are Codegenerating a RCTThirdPartyComponentProvider which tries to invoke floating C functions that are defined in other modules. React-RCTFabric has no visibility on those modules, therefore it fails building.

The implemented solution exclude the generation of those symbols and leverage a the Objective-C runtime to automatically register libraries when they are loaded.

**This mechanism is applied ONLY when the flag RCT_DYNAMIC_FRAMEWORKS is turned on.** There will be no impact on internal meta apps, nor on any apps that are not using Dynamic Frameworks.

This change requires a small migration in all the Fabric components libraries that wants to support dynamic frameworks. They have to implement a
```
+ (void)load
{
  [super load];
}
```
method in their ComponentView.

Not to slow down the adoption of the new architecture, waiting for a migration in the ecosystem, the next diff introduce a secondary, declarative loading mechanism for Fabric Components, which follows the same approach used by TurboModules.

## Changelog:
[iOS][Changed] - Add support for distributed registration of  Fabric Components with Dynamic Libraries.

Notes that this change is NOT breaking as dynamic frameworks were not working before in the New Architecture. Static Libraries and Static Frameworks continue working as usual.

Reviewed By: dmytrorykun

Differential Revision: D45605441

fbshipit-source-id: e609fbf6f92fddfbaa676227fde60962d6b0faa4
2023-05-15 08:14:59 -07:00
Riccardo Cipolleschi 8c8f7a510f Add example in RNTester to use events with arrays (#37143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37143

This change add an example on how to use events with arrays in the New Architecture in RNTester.

## Changelog:
[Internal] - Add Examples on RNTester on how to send events with arrays from Native to JS

Reviewed By: cortinico

Differential Revision: D45357873

fbshipit-source-id: 812521aad070181759c0a1c76b5e8c628166229c
2023-05-04 04:11:49 -07:00
Riccardo Cipolleschi a44d8a0f8a Add Examples for Direct Manipulation in the Interop Layer (#36610)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36610

This change add to RNTester examples of a legacy Native Component, loaded in the New Architecture through the Interop Layer, that uses the APIs described in the [Direct Manipulation](https://reactnative.dev/docs/direct-manipulation) sectioon of the website.

## Changelog:
[iOS][Added] - Added examples of direct manipulation

Reviewed By: sammy-SC

Differential Revision: D43978674

fbshipit-source-id: 1cbc56f28034f84f309166e3e392ad97a8164e64
2023-03-29 15:30:26 -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 a5866ca3aa Add Fabric Interop constants example (#36417)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36417

This changes adds an example to RNTester to verify that the Interop Layer can process constants in Fabric as it used to do in Paper.

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

Reviewed By: cortinico

Differential Revision: D43911916

fbshipit-source-id: 1d4b630d45d21904c53d85b97607ebb7fb8a62fc
2023-03-10 04:52:44 -08: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
Riccardo Cipolleschi 4d7753eb9a Add Legacy Component to RNTester with Interop Layer (#36360)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36360

This change is the iOS equivalent of D43731219 (https://github.com/facebook/react-native/commit/ab55e123da8749d982964f2aee6ce6b0bffdc7fc), but only for what concerns the RNTester example as the interop layer was already present in the codebase and exposed to the OSS.

## Changelog
[internal] - Add example on how to consume a Legacy component in Fabric with the interop layer

Reviewed By: cortinico

Differential Revision: D43735699

fbshipit-source-id: 6cb5a3591e7e4a606c274566226025af91849c16
2023-03-03 14:44:57 -08:00
Riccardo Cipolleschi 05aaba9514 Align Codegen between iOS and Android (#33864)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33864

This Diff aligns the way in which iOS and Android codegen the modules and components.
Android takes all the JS in the project root folder and creates components starting from there.
iOS used to required to specify a specific path for each component, within a JSON field called `libraries`. This Diff let iOS work in the same way as android does

**Backward compatibility:** This diff still support the old way for iOS, but we are deprecating it.

## Changelog
[iOS][Added] - Support codegen from a single folder

Reviewed By: cortinico

Differential Revision: D36473005

fbshipit-source-id: 1e8cf0f9764f529c02e948984c74d1982a84030b
2022-05-19 05:52:40 -07:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Nicola Corti aa4da248c1 Do not opt-out fbsource/xplat/js/react-native-github/packages from CLANGFORMAT
Summary:
As we're working on C++ code for RNTester to integrate Fabric, we should enable CLANGFORMAT for the files over there.

Changelog:
[Internal] [Changed] - Enable CLANGFORMAT on fbsource/xplat/js/react-native-github/packages

Reviewed By: ShikaSD

Differential Revision: D32493605

fbshipit-source-id: 7b5d63f6d2fae1a1aa1e782738953c8cd2cdbe4b
2021-11-18 04:44:46 -08:00
Sota Ogo d29f3d2a6b Add a simple fabric component example
Summary:
This diff adds a very simple example to show the use of new architecture in a component.

Changelog: [internal]

Reviewed By: cortinico

Differential Revision: D32045059

fbshipit-source-id: f388bfb765241122de425fbef61cea0620cd31ac
2021-11-17 16:01:55 -08:00