You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve Codegen to support automatic registration of Cxx TM (facebook#49624)
Summary:
Pull Request resolved: facebook#49624
This change improves the iOS infra so that there is no need to modify the Swift AppDelegate or to create a Bridging Header.
## Problem
As of today, it is not possible to create a pure C++ TM and to register it through a Swift AppDelegate
## Solution
We can create a pod that can be imported in a Swift AppDelegate and that offer some pure Objective-C classes.
These classes contains a provider that can be instantiated in Swift.
The TurboModule manager delegate will ask the AppDelegate about the presence of some provider that can instantiate a pure C++ turbomodule with a given name.
The provider has an empty interface, but the implementation contains a function that can actually instantiate the TM. The function is implemented in an Objective-C++ class that imports the pure C++ turbomodule and creates it.
The TMManager extends the provider through a category to attaach the signature of the function that is implemented by the provider.
The last diff in this stack contains an exaple on how to implement this.
## Changelog:
[iOS][Added] - Wire codegen to the new TM provider to automatically register CXX modules.
Reviewed By: javache
Differential Revision: D70082999
fbshipit-source-id: 11d829450e1d17984d6f22ee5b8907073c59d008
0 commit comments