iOS TM: Rename RCTJSINativeModule => RCTTurboModule
Summary: Simple codemod to rename RCTJSINativeModule => RCTTurboModule (the protocol) for less confusion. Reviewed By: PeteTheHeat Differential Revision: D13054206 fbshipit-source-id: 4829dc69838c623336475ea8ee11be815d79711c
This commit is contained in:
parent
e02a24b738
commit
39b8fa95a3
|
@ -97,7 +97,7 @@ RCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass);
|
|||
* Experimental.
|
||||
* Check/set if JSI-bound NativeModule is enabled. By default it's off.
|
||||
*/
|
||||
RCT_EXTERN BOOL RCTJSINativeModuleEnabled(void);
|
||||
RCT_EXTERN BOOL RCTTurboModuleEnabled(void);
|
||||
RCT_EXTERN void RCTEnableJSINativeModule(BOOL enabled);
|
||||
|
||||
/**
|
||||
|
|
|
@ -86,7 +86,7 @@ NSString *RCTBridgeModuleNameForClass(Class cls)
|
|||
}
|
||||
|
||||
static BOOL jsiNativeModuleEnabled = NO;
|
||||
BOOL RCTJSINativeModuleEnabled(void)
|
||||
BOOL RCTTurboModuleEnabled(void)
|
||||
{
|
||||
return jsiNativeModuleEnabled;
|
||||
}
|
||||
|
|
|
@ -324,9 +324,9 @@ RCT_EXTERN void RCTRegisterModule(Class); \
|
|||
|
||||
/**
|
||||
* Experimental.
|
||||
* A protocol to declare that a class supports JSI-bound NativeModule.
|
||||
* A protocol to declare that a class supports TurboModule.
|
||||
* This may be removed in the future.
|
||||
*/
|
||||
@protocol RCTJSINativeModule <NSObject>
|
||||
@protocol RCTTurboModule <NSObject>
|
||||
|
||||
@end
|
||||
|
|
|
@ -561,7 +561,7 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|||
NSArray *moduleClassesCopy = [moduleClasses copy];
|
||||
NSMutableArray<RCTModuleData *> *moduleDataByID = [NSMutableArray arrayWithCapacity:moduleClassesCopy.count];
|
||||
for (Class moduleClass in moduleClassesCopy) {
|
||||
if (RCTJSINativeModuleEnabled() && [moduleClass conformsToProtocol:@protocol(RCTJSINativeModule)]) {
|
||||
if (RCTTurboModuleEnabled() && [moduleClass conformsToProtocol:@protocol(RCTTurboModule)]) {
|
||||
continue;
|
||||
}
|
||||
NSString *moduleName = RCTBridgeModuleNameForClass(moduleClass);
|
||||
|
@ -666,7 +666,7 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|||
// we must use the names provided by the delegate method here.
|
||||
for (NSString *moduleName in moduleClasses) {
|
||||
Class moduleClass = moduleClasses[moduleName];
|
||||
if (RCTJSINativeModuleEnabled() && [moduleClass conformsToProtocol:@protocol(RCTJSINativeModule)]) {
|
||||
if (RCTTurboModuleEnabled() && [moduleClass conformsToProtocol:@protocol(RCTTurboModule)]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue