Files
react-native/packages/react-native/React/Base/RCTTurboModuleRegistry.h
T
Phillip Pan 9e5c963e2d pass eager initialized modules directly to bridge (#36916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36916

Changelog: [iOS][Removed]

the bridge only behavior of eager initialization of native modules was coupled with the turbomodule infra, even though it didn't need to be. this eager initialized modules is a static list, and the bridge owner which is usually app scoped, can pass this list directly to the bridge instead.

Reviewed By: sammy-SC

Differential Revision: D45021784

fbshipit-source-id: f033661e0722f65ae971bd7ce27f8dc7de1173ad
2023-04-17 19:33:02 -07:00

27 lines
974 B
Objective-C

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* A protocol that allows TurboModules to do lookup on other TurboModules.
* Calling these methods may cause a module to be synchronously instantiated.
*/
@protocol RCTTurboModuleRegistry <NSObject>
- (id)moduleForName:(const char *)moduleName;
/**
* Rationale:
* When TurboModules lookup other modules by name, we first check the TurboModule
* registry to see if a TurboModule exists with the respective name. In this case,
* we don't want a RedBox to be raised if the TurboModule isn't found.
*
* This method is deprecated and will be deleted after the migration from
* TurboModules to TurboModules is complete.
*/
- (id)moduleForName:(const char *)moduleName warnOnLookupFailure:(BOOL)warnOnLookupFailure;
- (BOOL)moduleIsInitialized:(const char *)moduleName;
@end