Skip to content

Commit 3e69022

Browse files
Ubaxfacebook-github-bot
Ubax
authored andcommitted
fix: Removes interface only check from third party components GenerateThirdPartyFabricComponentsProvider (#32779)
Summary: Currently the codegen does not include component with field `interfaceOnly` set to `true` in the `ThirdPartyFabricComponentsProvider`. These components need to be added to this file, so that non-core components can be used in fabric. ## Changelog [General [Fixed] - Fixes GenerateThirdPartyFabricComponentsProvider Pull Request resolved: #32779 Test Plan: Run codegen with component outside of core on iOS. Check if components with and without `interfaceOnly` are added to `RCTThirdPartyFabricComponentsProvider` Reviewed By: cortinico Differential Revision: D33235363 Pulled By: ShikaSD fbshipit-source-id: e7224d2123e4da0da912fe677dae32d3aaea2ec8
1 parent 8c3b839 commit 3e69022

4 files changed

+4
-8
lines changed

packages/react-native-codegen/src/generators/components/GenerateThirdPartyFabricComponentsProviderH.js

-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ module.exports = {
8787
})
8888
.map(componentName => {
8989
const component = components[componentName];
90-
if (component.interfaceOnly === true) {
91-
return;
92-
}
9390

9491
return LookupFuncTemplate({
9592
className: componentName,

packages/react-native-codegen/src/generators/components/GenerateThirdPartyFabricComponentsProviderObjCpp.js

-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ module.exports = {
8484
);
8585
})
8686
.map(componentName => {
87-
if (components[componentName].interfaceOnly === true) {
88-
return;
89-
}
9087
const replacedTemplate = LookupMapTemplate({
9188
className: componentName,
9289
libraryName,

packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateThirdPartyFabricComponentsProviderH-test.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extern \\"C\\" {
2424
Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name);
2525
2626
Class<RCTComponentViewProtocol> NoPropsNoEventsComponentCls(void) __attribute__((used)); // NO_PROPS_NO_EVENTS
27-
27+
Class<RCTComponentViewProtocol> InterfaceOnlyComponentCls(void) __attribute__((used)); // INTERFACE_ONLY
2828
Class<RCTComponentViewProtocol> BooleanPropNativeComponentCls(void) __attribute__((used)); // BOOLEAN_PROP
2929
Class<RCTComponentViewProtocol> StringPropComponentCls(void) __attribute__((used)); // STRING_PROP
3030
Class<RCTComponentViewProtocol> IntegerPropNativeComponentCls(void) __attribute__((used)); // INTEGER_PROPS
@@ -41,7 +41,7 @@ Class<RCTComponentViewProtocol> ImageColorPropNativeComponentCls(void) __attribu
4141
Class<RCTComponentViewProtocol> StringEnumPropsNativeComponentCls(void) __attribute__((used)); // STRING_ENUM_PROP
4242
Class<RCTComponentViewProtocol> Int32EnumPropsNativeComponentCls(void) __attribute__((used)); // INT32_ENUM_PROP
4343
Class<RCTComponentViewProtocol> EventsNativeComponentCls(void) __attribute__((used)); // EVENT_PROPS
44-
44+
Class<RCTComponentViewProtocol> InterfaceOnlyComponentCls(void) __attribute__((used)); // EVENTS_WITH_PAPER_NAME
4545
Class<RCTComponentViewProtocol> EventsNestedObjectNativeComponentCls(void) __attribute__((used)); // EVENT_NESTED_OBJECT_PROPS
4646
Class<RCTComponentViewProtocol> MultiComponent1NativeComponentCls(void) __attribute__((used)); // TWO_COMPONENTS_SAME_FILE
4747
Class<RCTComponentViewProtocol> MultiComponent2NativeComponentCls(void) __attribute__((used)); // TWO_COMPONENTS_SAME_FILE

packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateThirdPartyFabricComponentsProviderObjCpp-test.js.snap

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char
2424
2525
{\\"NoPropsNoEventsComponent\\", NoPropsNoEventsComponentCls}, // NO_PROPS_NO_EVENTS
2626
27+
{\\"InterfaceOnlyComponent\\", InterfaceOnlyComponentCls}, // INTERFACE_ONLY
2728
2829
{\\"BooleanPropNativeComponent\\", BooleanPropNativeComponentCls}, // BOOLEAN_PROP
2930
@@ -57,6 +58,7 @@ Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char
5758
5859
{\\"EventsNativeComponent\\", EventsNativeComponentCls}, // EVENT_PROPS
5960
61+
{\\"InterfaceOnlyComponent\\", InterfaceOnlyComponentCls}, // EVENTS_WITH_PAPER_NAME
6062
6163
{\\"EventsNestedObjectNativeComponent\\", EventsNestedObjectNativeComponentCls}, // EVENT_NESTED_OBJECT_PROPS
6264

0 commit comments

Comments
 (0)