-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[0.64] Enable support for C++ TurboModules (#6804) #6814
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
[0.64] Enable support for C++ TurboModules (#6804) #6814
Conversation
* Enable support for C++ TurboModules * Change files * Fix compilation issues * Attempt to fix the CLI test for Nuget with binaries * Address PR feedback * Format code * Address PR feedback * Throw an exception in AbiCallInvoker::invokeSync as in Instance::JSCallInvoker::invokeSync * Format code # Conflicts: # vnext/JSI/Universal/ChakraJsiRuntime_edgemode.cpp
Hello @vmoroz! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 10 hours, a condition that will be fulfilled in about 9 hours 55 minutes. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cherry pick the #6804 from master branch: Enable support for C++ TurboModules
The #6804 description:
In this PR we enable support for C++ TurboModules as they defined in react-native package.
The C++ TurboModules use JSI and we can enable their support based on our ABI-safe JSI implementation.
The only additional code that we needed to add is the ABI-safe wrapper for CallInvoker and ABI-safe registration of TurboModules.
The TurboModules can use the same base types as in the react-native package.
Though we had to do a small fix to the TurboModuleUtils.h to avoid unnecessary dependency on Folly.
We have added new JsiTurboModuleTests to test the use of the TurboModules.
It shows that the TurboModule must be inherited from the
facebook::jsi::TurboModule
and registered using the Package provider that might look as in the test:This code uses the new
AddTurboModuleProvider
method to create an ABI safe provider for the TurboModule.Note that C++ TurboModule use code generation. In this PR we do not implement the code generation. We just provide a foundation for it. The code generation will be added in the follow up PRs.
Microsoft Reviewers: Open in CodeFlow