mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
b7f49a84d5
Summary: The TurboModuleManagerDelegate now supports a `getEagerInitModuleNames()` method, which is supposed to return a `java.util.List` containing the names of all NativeModules that require eager initialization. The NativeModuels are created when the `TurboModuleManager` is created. This happens inside `ReactInstanceManager.createReactContext` slightly after the NativeModuleRegistry is created, which is when our legacy NativeModules are eagerly initialized. All NativeModules declared in `TurboReactPackages` that are wired into the `TurboModules` infra via `ReactPackageTurboModuleManagerDelegate` can use the `ReactModule(needsEagerInit = true)` annotation. Our build pipeline should correctly process the annotation into a `ModuleInfo`, and `ReactPackageTurboModuleManagerDelegate` should correctly forward the eagerly initialized module names to TurboModuleManager. Changelog: [Android][Added] - Implement TurboModule eager initialization support Reviewed By: mdvacca Differential Revision: D18819552 fbshipit-source-id: b2009a3b8f4e064362d2abeb5281637962531678