Skip to content

Commit

Permalink
fix: Removes interface only check from third party components Generat…
Browse files Browse the repository at this point in the history
…eThirdPartyFabricComponentsProvider (#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
  • Loading branch information
Ubax authored and facebook-github-bot committed Dec 20, 2021
1 parent 8c3b839 commit 3e69022
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ module.exports = {
})
.map(componentName => {
const component = components[componentName];
if (component.interfaceOnly === true) {
return;
}

return LookupFuncTemplate({
className: componentName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ module.exports = {
);
})
.map(componentName => {
if (components[componentName].interfaceOnly === true) {
return;
}
const replacedTemplate = LookupMapTemplate({
className: componentName,
libraryName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern \\"C\\" {
Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name);
Class<RCTComponentViewProtocol> NoPropsNoEventsComponentCls(void) __attribute__((used)); // NO_PROPS_NO_EVENTS
Class<RCTComponentViewProtocol> InterfaceOnlyComponentCls(void) __attribute__((used)); // INTERFACE_ONLY
Class<RCTComponentViewProtocol> BooleanPropNativeComponentCls(void) __attribute__((used)); // BOOLEAN_PROP
Class<RCTComponentViewProtocol> StringPropComponentCls(void) __attribute__((used)); // STRING_PROP
Class<RCTComponentViewProtocol> IntegerPropNativeComponentCls(void) __attribute__((used)); // INTEGER_PROPS
Expand All @@ -41,7 +41,7 @@ Class<RCTComponentViewProtocol> ImageColorPropNativeComponentCls(void) __attribu
Class<RCTComponentViewProtocol> StringEnumPropsNativeComponentCls(void) __attribute__((used)); // STRING_ENUM_PROP
Class<RCTComponentViewProtocol> Int32EnumPropsNativeComponentCls(void) __attribute__((used)); // INT32_ENUM_PROP
Class<RCTComponentViewProtocol> EventsNativeComponentCls(void) __attribute__((used)); // EVENT_PROPS
Class<RCTComponentViewProtocol> InterfaceOnlyComponentCls(void) __attribute__((used)); // EVENTS_WITH_PAPER_NAME
Class<RCTComponentViewProtocol> EventsNestedObjectNativeComponentCls(void) __attribute__((used)); // EVENT_NESTED_OBJECT_PROPS
Class<RCTComponentViewProtocol> MultiComponent1NativeComponentCls(void) __attribute__((used)); // TWO_COMPONENTS_SAME_FILE
Class<RCTComponentViewProtocol> MultiComponent2NativeComponentCls(void) __attribute__((used)); // TWO_COMPONENTS_SAME_FILE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char
{\\"NoPropsNoEventsComponent\\", NoPropsNoEventsComponentCls}, // NO_PROPS_NO_EVENTS
{\\"InterfaceOnlyComponent\\", InterfaceOnlyComponentCls}, // INTERFACE_ONLY
{\\"BooleanPropNativeComponent\\", BooleanPropNativeComponentCls}, // BOOLEAN_PROP
Expand Down Expand Up @@ -57,6 +58,7 @@ Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char
{\\"EventsNativeComponent\\", EventsNativeComponentCls}, // EVENT_PROPS
{\\"InterfaceOnlyComponent\\", InterfaceOnlyComponentCls}, // EVENTS_WITH_PAPER_NAME
{\\"EventsNestedObjectNativeComponent\\", EventsNestedObjectNativeComponentCls}, // EVENT_NESTED_OBJECT_PROPS
Expand Down

0 comments on commit 3e69022

Please sign in to comment.