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
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
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
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
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
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
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
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
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
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
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
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
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