Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude generation of app-defined components from RCTThirdPartyFabricComponentsProvider #47176

Closed
wants to merge 1 commit into from

Conversation

blakef
Copy link
Contributor

@blakef blakef commented Oct 23, 2024

Summary:
While writing the guide for the New Architecture, we realized that we need to exclude the generation of the Cls function in the RCTThirdPartyFabricComponentsProvider for components defined in the app.

This is needed because a component that is defined in the app will have those function defined in the app project. However, the RCTThirdPartyFabricComponentsProvider is generated in Fabric, inside the Pods project.

The pod project needs to build in isolation from the app and cocoapods then link the app to the pods project. But the compilation of the pods project fails if one of the symbol needed by the pods lives in the app.

By disabling the generation of that function in th RCTThirdPartyFabricComponentsProvider, we can successfully build the app.

The downside is that the user needs to register the component manually, but this is not an issue because if they are writing a component in the app space, they have all the information tomanually register it in the AppDelegate

Changelog

[iOS][Fixed] - Do not generate the ComponentCls function in the RCTThirdPartyFabricComponentsProvider for components deined in the app.

Differential Revision: D64739896

…ComponentsProvider

Summary:
While writing the guide for the New Architecture, we realized that we need to exclude the generation of the Cls function in the RCTThirdPartyFabricComponentsProvider for components defined in the app.

This is needed because a component that is defined in the app will have those function defined in the app project. However, the RCTThirdPartyFabricComponentsProvider is generated in Fabric, inside the Pods project.

The pod project needs to build in isolation from the app and cocoapods then link the app to the pods project. But the compilation of the pods project fails if one of the symbol needed by the pods lives in the app.

By disabling the generation of that function in th RCTThirdPartyFabricComponentsProvider, we can successfully build the app.

The downside is that the user needs to register the component manually, but this is not an issue because if they are writing a component in the app space, they have all the information tomanually register it in the AppDelegate

## Changelog
[iOS][Fixed] - Do not generate the ComponentCls function in the RCTThirdPartyFabricComponentsProvider for components deined in the app.

Differential Revision: D64739896
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 23, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D64739896

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in dc7e9e2.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Oct 24, 2024
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @cipolleschi in dc7e9e2

When will my fix make it into a release? | How to file a pick request?

blakef pushed a commit that referenced this pull request Oct 28, 2024
…ComponentsProvider (#47176)

Summary:
Pull Request resolved: #47176

While writing the guide for the New Architecture, we realized that we need to exclude the generation of the Cls function in the RCTThirdPartyFabricComponentsProvider for components defined in the app.

This is needed because a component that is defined in the app will have those function defined in the app project. However, the RCTThirdPartyFabricComponentsProvider is generated in Fabric, inside the Pods project.

The pod project needs to build in isolation from the app and cocoapods then link the app to the pods project. But the compilation of the pods project fails if one of the symbol needed by the pods lives in the app.

By disabling the generation of that function in th RCTThirdPartyFabricComponentsProvider, we can successfully build the app.

The downside is that the user needs to register the component manually, but this is not an issue because if they are writing a component in the app space, they have all the information tomanually register it in the AppDelegate

## Changelog
[iOS][Fixed] - Do not generate the ComponentCls function in the RCTThirdPartyFabricComponentsProvider for components deined in the app.

Reviewed By: cortinico, blakef

Differential Revision: D64739896

fbshipit-source-id: 0eca818ea0198532a611377d14a3ff4c95cb5fe3
@blakef blakef mentioned this pull request Oct 30, 2024
@migueldaipre
Copy link
Collaborator

migueldaipre commented Oct 30, 2024

Hey @blakef,

What is appCondegenConfigSpec? Is this a new codegenConfig config or something internal? I have an external library and I still have this issue in the build.

I'm on v0.76.1

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request Nov 11, 2024
Summary:
In [facebook#47176](facebook#47176) we disabled the generation of the component registration for app specific components as it was creating a circular dependency between the app and React Native.

However, we made a couple of typos that make it not work as expected and users picked up those typos soon.

This change fixes them for good.

## Changelog
[iOS][Fixed] - Properly stop generating component registration for components defined in app.

Differential Revision: D65750433
facebook-github-bot pushed a commit that referenced this pull request Nov 11, 2024
…47547)

Summary:
Pull Request resolved: #47547

In [#47176](#47176) we disabled the generation of the component registration for app specific components as it was creating a circular dependency between the app and React Native.

However, we made a couple of typos that make it not work as expected and users picked up those typos soon.

This change fixes them for good.

## Changelog
[iOS][Fixed] - Properly stop generating component registration for components defined in app.

Reviewed By: blakef

Differential Revision: D65750433

fbshipit-source-id: 1a879c5be014905558b9fd05e6f16ac36b784ed6
blakef pushed a commit that referenced this pull request Nov 12, 2024
…47547)

Summary:
Pull Request resolved: #47547

In [#47176](#47176) we disabled the generation of the component registration for app specific components as it was creating a circular dependency between the app and React Native.

However, we made a couple of typos that make it not work as expected and users picked up those typos soon.

This change fixes them for good.

## Changelog
[iOS][Fixed] - Properly stop generating component registration for components defined in app.

Reviewed By: blakef

Differential Revision: D65750433

fbshipit-source-id: 1a879c5be014905558b9fd05e6f16ac36b784ed6
@1280103995
Copy link

It still happens in v0.76.3, but the documentation says it will be fixed in v0.76.2.
32545b-417a-47cf-8dc1-e83c09e5b5ef

@cipolleschi
Copy link
Contributor

@1280103995 Please, make sure to delete node_modules and reinstall pods.
It is not happening in 0.76.2.

@joaoveronezi
Copy link

joaoveronezi commented Jan 8, 2025

After updating my app, the RCTThirdPartyComponentsProvider issue has been resolved as it's no longer present. However, I'm still encountering a few other issues that appear to be related. Any insights or suggestions would be appreciated.

Undefined symbols for architecture arm64:
  "facebook::react::SwitchProps::SwitchProps(facebook::react::PropsParserContext const&, facebook::react::SwitchProps const&, facebook::react::RawProps const&)", referenced from:
      void facebook::react::RawPropsParser::prepare<facebook::react::SwitchProps>() in libReact-RCTFabric.a[37](RCTSwitchComponentView.o)
      std::__1::__shared_ptr_emplace<facebook::react::SwitchProps, std::__1::allocator<facebook::react::SwitchProps>>::__shared_ptr_emplace[abi:ne180100]<facebook::react::PropsParserContext const&, facebook::react::SwitchProps const&, facebook::react::RawProps const&, std::__1::allocator<facebook::react::SwitchProps>, 0>(std::__1::allocator<facebook::react::SwitchProps>, facebook::react::PropsParserContext const&, facebook::react::SwitchProps const&, facebook::react::RawProps const&) in libReact-RCTFabric.a[37](RCTSwitchComponentView.o)
  "facebook::react::SafeAreaViewProps::SafeAreaViewProps(facebook::react::PropsParserContext const&, facebook::react::SafeAreaViewProps const&, facebook::react::RawProps const&)", referenced from:
      void facebook::react::RawPropsParser::prepare<facebook::react::SafeAreaViewProps>() in libReact-RCTFabric.a[29](RCTSafeAreaViewComponentView.o)
      std::__1::__shared_ptr_emplace<facebook::react::SafeAreaViewProps, std::__1::allocator<facebook::react::SafeAreaViewProps>>::__shared_ptr_emplace[abi:ne180100]<facebook::react::PropsParserContext const&, facebook::react::SafeAreaViewProps const&, facebook::react::RawProps const&, std::__1::allocator<facebook::react::SafeAreaViewProps>, 0>(std::__1::allocator<facebook::react::SafeAreaViewProps>, facebook::react::PropsParserContext const&, facebook::react::SafeAreaViewProps const&, facebook::react::RawProps const&) in libReact-RCTFabric.a[29](RCTSafeAreaViewComponentView.o)
  "facebook::react::ModalHostViewProps::ModalHostViewProps(facebook::react::PropsParserContext const&, facebook::react::ModalHostViewProps const&, facebook::react::RawProps const&)", referenced from:
      void facebook::react::RawPropsParser::prepare<facebook::react::ModalHostViewProps>() in libReact-RCTFabric.a[21](RCTModalHostViewComponentView.o)
      std::__1::__shared_ptr_emplace<facebook::react::ModalHostViewProps, std::__1::allocator<facebook::react::ModalHostViewProps>>::__shared_ptr_emplace[abi:ne180100]<facebook::react::PropsParserContext const&, facebook::react::ModalHostViewProps const&, facebook::react::RawProps const&, std::__1::allocator<facebook::react::ModalHostViewProps>, 0>(std::__1::allocator<facebook::react::ModalHostViewProps>, facebook::react::PropsParserContext const&, facebook::react::ModalHostViewProps const&, facebook::react::RawProps const&) in libReact-RCTFabric.a[21](RCTModalHostViewComponentView.o)
  "facebook::react::InputAccessoryProps::InputAccessoryProps(facebook::react::PropsParserContext const&, facebook::react::InputAccessoryProps const&, facebook::react::RawProps const&)", referenced from:
      void facebook::react::RawPropsParser::prepare<facebook::react::InputAccessoryProps>() in libReact-RCTFabric.a[16](RCTInputAccessoryComponentView.o)
      std::__1::__shared_ptr_emplace<facebook::react::InputAccessoryProps, std::__1::allocator<facebook::react::InputAccessoryProps>>::__shared_ptr_emplace[abi:ne180100]<facebook::react::PropsParserContext const&, facebook::react::InputAccessoryProps const&, facebook::react::RawProps const&, std::__1::allocator<facebook::react::InputAccessoryProps>, 0>(std::__1::allocator<facebook::react::InputAccessoryProps>, facebook::react::PropsParserContext const&, facebook::react::InputAccessoryProps const&, facebook::react::RawProps const&) in libReact-RCTFabric.a[16](RCTInputAccessoryComponentView.o)
  "facebook::react::SwitchComponentName", referenced from:
      +[RCTSwitchComponentView componentDescriptorProvider] in libReact-RCTFabric.a[37](RCTSwitchComponentView.o)
      facebook::react::ConcreteComponentDescriptor<facebook::react::ConcreteViewShadowNode<&facebook::react::SwitchComponentName, facebook::react::SwitchProps, facebook::react::SwitchEventEmitter, facebook::react::SwitchState, false>>::getComponentHandle() const in libReact-RCTFabric.a[37](RCTSwitchComponentView.o)
      facebook::react::ConcreteComponentDescriptor<facebook::react::ConcreteViewShadowNode<&facebook::react::SwitchComponentName, facebook::react::SwitchProps, facebook::react::SwitchEventEmitter, facebook::react::SwitchState, false>>::getComponentName() const in libReact-RCTFabric.a[37](RCTSwitchComponentView.o)
  "facebook::react::DebuggingOverlayProps::DebuggingOverlayProps(facebook::react::PropsParserContext const&, facebook::react::DebuggingOverlayProps const&, facebook::react::RawProps const&)", referenced from:
      void facebook::react::RawPropsParser::prepare<facebook::react::DebuggingOverlayProps>() in libReact-RCTFabric.a[8](RCTDebuggingOverlayComponentView.o)
      std::__1::__shared_ptr_emplace<facebook::react::DebuggingOverlayProps, std::__1::allocator<facebook::react::DebuggingOverlayProps>>::__shared_ptr_emplace[abi:ne180100]<facebook::react::PropsParserContext const&, facebook::react::DebuggingOverlayProps const&, facebook::react::RawProps const&, std::__1::allocator<facebook::react::DebuggingOverlayProps>, 0>(std::__1::allocator<facebook::react::DebuggingOverlayProps>, facebook::react::PropsParserContext const&, facebook::react::DebuggingOverlayProps const&, facebook::react::RawProps const&) in libReact-RCTFabric.a[8](RCTDebuggingOverlayComponentView.o)
  "facebook::react::PullToRefreshViewProps::PullToRefreshViewProps(facebook::react::PropsParserContext const&, facebook::react::PullToRefreshViewProps const&, facebook::react::RawProps const&)", referenced from:
      void facebook::react::RawPropsParser::prepare<facebook::react::PullToRefreshViewProps>() in libReact-RCTFabric.a[26](RCTPullToRefreshViewComponentView.o)
      std::__1::__shared_ptr_emplace<facebook::react::PullToRefreshViewProps, std::__1::allocator<facebook::react::PullToRefreshViewProps>>::__shared_ptr_emplace[abi:ne180100]<facebook::react::PropsParserContext const&, facebook::react::PullToRefreshViewProps const&, facebook::react::RawProps const&, std::__1::allocator<facebook::react::PullToRefreshViewProps>, 0>(std::__1::allocator<facebook::react::PullToRefreshViewProps>, facebook::react::PropsParserContext const&, facebook::react::PullToRefreshViewProps const&, facebook::react::RawProps const&) in libReact-RCTFabric.a[26](RCTPullToRefreshViewComponentView.o)
  "facebook::react::ActivityIndicatorViewProps::ActivityIndicatorViewProps(facebook::react::PropsParserContext const&, facebook::react::ActivityIndicatorViewProps const&, facebook::react::RawProps const&)", referenced from:
      void facebook::react::RawPropsParser::prepare<facebook::react::ActivityIndicatorViewProps>() in libReact-RCTFabric.a[4](RCTActivityIndicatorViewComponentView.o)
      std::__1::__shared_ptr_emplace<facebook::react::ActivityIndicatorViewProps, std::__1::allocator<facebook::react::ActivityIndicatorViewProps>>::__shared_ptr_emplace[abi:ne180100]<facebook::react::PropsParserContext const&, facebook::react::ActivityIndicatorViewProps const&, facebook::react::RawProps const&, std::__1::allocator<facebook::react::ActivityIndicatorViewProps>, 0>(std::__1::allocator<facebook::react::ActivityIndicatorViewProps>, facebook::react::PropsParserContext const&, facebook::react::ActivityIndicatorViewProps const&, facebook::react::RawProps const&) in libReact-RCTFabric.a[4](RCTActivityIndicatorViewComponentView.o)
  "facebook::react::UnimplementedNativeViewProps::UnimplementedNativeViewProps(facebook::react::PropsParserContext const&, facebook::react::UnimplementedNativeViewProps const&, facebook::react::RawProps const&)", referenced from:
      void facebook::react::RawPropsParser::prepare<facebook::react::UnimplementedNativeViewProps>() in libReact-RCTFabric.a[40](RCTUnimplementedNativeComponentView.o)
      std::__1::__shared_ptr_emplace<facebook::react::UnimplementedNativeViewProps, std::__1::allocator<facebook::react::UnimplementedNativeViewProps>>::__shared_ptr_emplace[abi:ne180100]<facebook::react::PropsParserContext const&, facebook::react::UnimplementedNativeViewProps const&, facebook::react::RawProps const&, std::__1::allocator<facebook::react::UnimplementedNativeViewProps>, 0>(std::__1::allocator<facebook::react::UnimplementedNativeViewProps>, facebook::react::PropsParserContext const&, facebook::react::UnimplementedNativeViewProps const&, facebook::react::RawProps const&) in libReact-RCTFabric.a[40](RCTUnimplementedNativeComponentView.o)
  "facebook::react::DebuggingOverlayComponentName", referenced from:
      +[RCTDebuggingOverlayComponentView componentDescriptorProvider] in libReact-RCTFabric.a[8](RCTDebuggingOverlayComponentView.o)
      facebook::react::ConcreteComponentDescriptor<facebook::react::ConcreteViewShadowNode<&facebook::react::DebuggingOverlayComponentName, facebook::react::DebuggingOverlayProps, facebook::react::DebuggingOverlayEventEmitter, facebook::react::DebuggingOverlayState, false>>::getComponentHandle() const in libReact-RCTFabric.a[8](RCTDebuggingOverlayComponentView.o)
      facebook::react::ConcreteComponentDescriptor<facebook::react::ConcreteViewShadowNode<&facebook::react::DebuggingOverlayComponentName, facebook::react::DebuggingOverlayProps, facebook::react::DebuggingOverlayEventEmitter, facebook::react::DebuggingOverlayState, false>>::getComponentName() const in libReact-RCTFabric.a[8](RCTDebuggingOverlayComponentView.o)
  "facebook::react::PullToRefreshViewComponentName", referenced from:
      +[RCTPullToRefreshViewComponentView componentDescriptorProvider] in libReact-RCTFabric.a[26](RCTPullToRefreshViewComponentView.o)
      facebook::react::ConcreteComponentDescriptor<facebook::react::ConcreteViewShadowNode<&facebook::react::PullToRefreshViewComponentName, facebook::react::PullToRefreshViewProps, facebook::react::PullToRefreshViewEventEmitter, facebook::react::PullToRefreshViewState, false>>::getComponentHandle() const in libReact-RCTFabric.a[26](RCTPullToRefreshViewComponentView.o)
      facebook::react::ConcreteComponentDescriptor<facebook::react::ConcreteViewShadowNode<&facebook::react::PullToRefreshViewComponentName, facebook::react::PullToRefreshViewProps, facebook::react::PullToRefreshViewEventEmitter, facebook::react::PullToRefreshViewState, false>>::getComponentName() const in libReact-RCTFabric.a[26](RCTPullToRefreshViewComponentView.o)
  "facebook::react::ActivityIndicatorViewComponentName", referenced from:
      +[RCTActivityIndicatorViewComponentView componentDescriptorProvider] in libReact-RCTFabric.a[4](RCTActivityIndicatorViewComponentView.o)
      facebook::react::ConcreteComponentDescriptor<facebook::react::ConcreteViewShadowNode<&facebook::react::ActivityIndicatorViewComponentName, facebook::react::ActivityIndicatorViewProps, facebook::react::ActivityIndicatorViewEventEmitter, facebook::react::ActivityIndicatorViewState, false>>::getComponentHandle() const in libReact-RCTFabric.a[4](RCTActivityIndicatorViewComponentView.o)
      facebook::react::ConcreteComponentDescriptor<facebook::react::ConcreteViewShadowNode<&facebook::react::ActivityIndicatorViewComponentName, facebook::react::ActivityIndicatorViewProps, facebook::react::ActivityIndicatorViewEventEmitter, facebook::react::ActivityIndicatorViewState, false>>::getComponentName() const in libReact-RCTFabric.a[4](RCTActivityIndicatorViewComponentView.o)
  "facebook::react::UnimplementedNativeViewComponentName", referenced from:
      +[RCTUnimplementedNativeComponentView componentDescriptorProvider] in libReact-RCTFabric.a[40](RCTUnimplementedNativeComponentView.o)
      facebook::react::ConcreteComponentDescriptor<facebook::react::ConcreteViewShadowNode<&facebook::react::UnimplementedNativeViewComponentName, facebook::react::UnimplementedNativeViewProps, facebook::react::UnimplementedNativeViewEventEmitter, facebook::react::UnimplementedNativeViewState, false>>::getComponentHandle() const in libReact-RCTFabric.a[40](RCTUnimplementedNativeComponentView.o)
      facebook::react::ConcreteComponentDescriptor<facebook::react::ConcreteViewShadowNode<&facebook::react::UnimplementedNativeViewComponentName, facebook::react::UnimplementedNativeViewProps, facebook::react::UnimplementedNativeViewEventEmitter, facebook::react::UnimplementedNativeViewState, false>>::getComponentName() const in libReact-RCTFabric.a[40](RCTUnimplementedNativeComponentView.o)
  "facebook::react::SwitchEventEmitter::onChange(facebook::react::SwitchEventEmitter::OnChange) const", referenced from:
      -[RCTSwitchComponentView onChange:] in libReact-RCTFabric.a[37](RCTSwitchComponentView.o)
  "facebook::react::ModalHostViewEventEmitter::onOrientationChange(facebook::react::ModalHostViewEventEmitter::OnOrientationChange) const", referenced from:
      -[RCTModalHostViewComponentView boundsDidChange:] in libReact-RCTFabric.a[21](RCTModalHostViewComponentView.o)
  "facebook::react::ModalHostViewEventEmitter::onShow(facebook::react::ModalHostViewEventEmitter::OnShow) const", referenced from:
      ___60-[RCTModalHostViewComponentView ensurePresentedOnlyIfNeeded]_block_invoke in libReact-RCTFabric.a[21](RCTModalHostViewComponentView.o)
  "facebook::react::ModalHostViewEventEmitter::onDismiss(facebook::react::ModalHostViewEventEmitter::OnDismiss) const", referenced from:
      ___60-[RCTModalHostViewComponentView ensurePresentedOnlyIfNeeded]_block_invoke.1 in libReact-RCTFabric.a[21](RCTModalHostViewComponentView.o)
  "facebook::react::PullToRefreshViewEventEmitter::onRefresh(facebook::react::PullToRefreshViewEventEmitter::OnRefresh) const", referenced from:
      -[RCTPullToRefreshViewComponentView handleUIControlEventValueChanged] in libReact-RCTFabric.a[26](RCTPullToRefreshViewComponentView.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Setting arm64 as an excluded architecture resolves the issue during development, but it causes problems when I try to create a release build (archive). Any suggestions on how to address this?

I'm using version v0.75.3

@cipolleschi
Copy link
Contributor

@joaoveronezi it looks like something is off in the xcodeproject setup.
I suggest to:

  1. run pod deintegrate
  2. remove the Pods, Podfile.lock and xcworkspace file
  3. remove the node_modules folder
  4. run yarn install in the root of the project
  5. run bundle install && bundle exec pod install in the ios folder to regenerate the project
  6. Try to build again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants