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:
Kevin Gozali 2018-11-14 10:27:32 -08:00 committed by Facebook Github Bot
parent e02a24b738
commit 39b8fa95a3
4 changed files with 6 additions and 6 deletions

View File

@ -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);
/**

View File

@ -86,7 +86,7 @@ NSString *RCTBridgeModuleNameForClass(Class cls)
}
static BOOL jsiNativeModuleEnabled = NO;
BOOL RCTJSINativeModuleEnabled(void)
BOOL RCTTurboModuleEnabled(void)
{
return jsiNativeModuleEnabled;
}

View File

@ -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

View File

@ -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;
}