Files
react-native/ReactAndroid/src/main/java
Ramanpreet Nara 5127ac5c2a Implement support for legacy CxxModules
Summary:
## Background
Legacy Cxx NativeModules are implemented as Hybrid classes. Essentially, when a Cxx NativeModule is requested, you instantiate its hybrid class, which then creates a C++ counterpart. Then, the bridge uses the C++ counterpart's `getModule()` method to obtain ownership of the Cxx NativeModule.

## Summary
This diff implements backwards-compability for Cxx NativeModules.

If a Cxx NativeModule implements the `TurboModule` interface, then when the module is requested by name, we:
1. Instantiate its Java hybrid class, createing a C++ counterpart.
3. Obtain the CxxModule from the C++ counterpart using `getModule()` and use it to create a `TurboCxxModule` instance (this forwards all JavaScript method calls to the CxxModule) inside `TurboModuleManager`.
5. Return this `TurboCxxModule` to JS.

Reviewed By: mdvacca

Differential Revision: D15252041

fbshipit-source-id: cdbb62632d7a8735f7687daf62de63df9e3ad2c5
2019-05-22 13:16:13 -07:00
..