diff --git a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj index 2f10b53ae..ea9084cd7 100644 --- a/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj +++ b/Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj @@ -16,7 +16,6 @@ 13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FE81AA91428003F314A /* libRCTImage.a */; }; 134180011AA9153C003F314A /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; }; 1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341802B1AA91779003F314A /* libRCTNetwork.a */; }; - 134366AF1BFD2C76000A2DE1 /* Thumbnails in Resources */ = {isa = PBXBuildFile; fileRef = 134366AE1BFD2C76000A2DE1 /* Thumbnails */; }; 134454601AAFCABD003F0779 /* libRCTAdSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1344545A1AAFCAAE003F0779 /* libRCTAdSupport.a */; }; 134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 134A8A251AACED6A00945AAE /* libRCTGeolocation.a */; }; 138D6A181B53CD440074A87E /* RCTShadowViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 138D6A161B53CD440074A87E /* RCTShadowViewTests.m */; }; @@ -34,7 +33,7 @@ 147CED4C1AB3532B00DA3E4C /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 147CED4B1AB34F8C00DA3E4C /* libRCTActionSheet.a */; }; 1497CFAC1B21F5E400C1F8F2 /* RCTAllocationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */; }; 1497CFAD1B21F5E400C1F8F2 /* RCTBridgeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA51B21F5E400C1F8F2 /* RCTBridgeTests.m */; }; - 1497CFAE1B21F5E400C1F8F2 /* RCTContextExecutorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA61B21F5E400C1F8F2 /* RCTContextExecutorTests.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 1497CFAE1B21F5E400C1F8F2 /* RCTJSCExecutorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA61B21F5E400C1F8F2 /* RCTJSCExecutorTests.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 1497CFAF1B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */; }; 1497CFB01B21F5E400C1F8F2 /* RCTConvert_UIFontTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA81B21F5E400C1F8F2 /* RCTConvert_UIFontTests.m */; }; 1497CFB11B21F5E400C1F8F2 /* RCTEventDispatcherTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */; }; @@ -56,8 +55,8 @@ 14D6D7291B2222EF001FB087 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14AADF041AC3DB95002390C9 /* libReact.a */; }; 14DC67F41AB71881001358AB /* libRCTPushNotification.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14DC67F11AB71876001358AB /* libRCTPushNotification.a */; }; 272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; }; + 27B885561BED29AF00008352 /* RCTRootViewIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */; }; 27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; }; - 27B885561BED29AF00008352 /* RCTRootViewIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */; settings = {ASSET_TAGS = (); }; }; 3578590A1B28D2CF00341EDB /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 357859011B28D2C500341EDB /* libRCTLinking.a */; }; 3DB99D0C1BA0340600302749 /* UIExplorerIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DB99D0B1BA0340600302749 /* UIExplorerIntegrationTests.m */; }; 834C36EC1AF8DED70019C93C /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 834C36D21AF8DA610019C93C /* libRCTSettings.a */; }; @@ -186,7 +185,6 @@ 13417FE31AA91428003F314A /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../../Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; 134180261AA91779003F314A /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../../Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; - 134366AE1BFD2C76000A2DE1 /* Thumbnails */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Thumbnails; sourceTree = ""; }; 134454551AAFCAAE003F0779 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = ../../Libraries/AdSupport/RCTAdSupport.xcodeproj; sourceTree = ""; }; 134A8A201AACED6A00945AAE /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = ../../Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = ""; }; 138D6A161B53CD440074A87E /* RCTShadowViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTShadowViewTests.m; sourceTree = ""; }; @@ -216,7 +214,7 @@ 144D21231B2204C5006DB32B /* RCTImageUtilTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageUtilTests.m; sourceTree = ""; }; 1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAllocationTests.m; sourceTree = ""; }; 1497CFA51B21F5E400C1F8F2 /* RCTBridgeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBridgeTests.m; sourceTree = ""; }; - 1497CFA61B21F5E400C1F8F2 /* RCTContextExecutorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTContextExecutorTests.m; sourceTree = ""; }; + 1497CFA61B21F5E400C1F8F2 /* RCTJSCExecutorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJSCExecutorTests.m; sourceTree = ""; }; 1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert_NSURLTests.m; sourceTree = ""; }; 1497CFA81B21F5E400C1F8F2 /* RCTConvert_UIFontTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert_UIFontTests.m; sourceTree = ""; }; 1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTEventDispatcherTests.m; sourceTree = ""; }; @@ -236,9 +234,9 @@ 14E0EEC81AB118F7000DECC3 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = ../../Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = ""; }; 272E6B3B1BEA849E001FCF37 /* UpdatePropertiesExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UpdatePropertiesExampleView.h; path = UIExplorer/NativeExampleViews/UpdatePropertiesExampleView.h; sourceTree = ""; }; 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UpdatePropertiesExampleView.m; path = UIExplorer/NativeExampleViews/UpdatePropertiesExampleView.m; sourceTree = ""; }; + 27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootViewIntegrationTests.m; sourceTree = ""; }; 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlexibleSizeExampleView.m; path = UIExplorer/NativeExampleViews/FlexibleSizeExampleView.m; sourceTree = ""; }; 27F441EA1BEBE5030039B79C /* FlexibleSizeExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlexibleSizeExampleView.h; path = UIExplorer/NativeExampleViews/FlexibleSizeExampleView.h; sourceTree = ""; }; - 27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootViewIntegrationTests.m; sourceTree = ""; }; 357858F81B28D2C400341EDB /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = ../../Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = ""; }; 3DB99D0B1BA0340600302749 /* UIExplorerIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIExplorerIntegrationTests.m; sourceTree = ""; }; 58005BE41ABA80530062E044 /* RCTTest.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTTest.xcodeproj; path = ../../Libraries/RCTTest/RCTTest.xcodeproj; sourceTree = ""; }; @@ -410,7 +408,7 @@ children = ( 1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */, 1497CFA51B21F5E400C1F8F2 /* RCTBridgeTests.m */, - 1497CFA61B21F5E400C1F8F2 /* RCTContextExecutorTests.m */, + 1497CFA61B21F5E400C1F8F2 /* RCTJSCExecutorTests.m */, 1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */, 1497CFA81B21F5E400C1F8F2 /* RCTConvert_UIFontTests.m */, 1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */, @@ -880,7 +878,7 @@ 1393D0381B68CD1300E1B601 /* RCTModuleMethodTests.m in Sources */, 1300627F1B59179B0043FE5A /* RCTGzipTests.m in Sources */, 1497CFAF1B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m in Sources */, - 1497CFAE1B21F5E400C1F8F2 /* RCTContextExecutorTests.m in Sources */, + 1497CFAE1B21F5E400C1F8F2 /* RCTJSCExecutorTests.m in Sources */, 1497CFAD1B21F5E400C1F8F2 /* RCTBridgeTests.m in Sources */, 1497CFB11B21F5E400C1F8F2 /* RCTEventDispatcherTests.m in Sources */, 1497CFB31B21F5E400C1F8F2 /* RCTUIManagerTests.m in Sources */, diff --git a/Examples/UIExplorer/UIExplorerUnitTests/RCTAllocationTests.m b/Examples/UIExplorer/UIExplorerUnitTests/RCTAllocationTests.m index b90a384e4..a3bcde254 100644 --- a/Examples/UIExplorer/UIExplorerUnitTests/RCTAllocationTests.m +++ b/Examples/UIExplorer/UIExplorerUnitTests/RCTAllocationTests.m @@ -17,7 +17,7 @@ #import "RCTBridge.h" #import "RCTBridge+Private.h" -#import "RCTContextExecutor.h" +#import "RCTJSCExecutor.h" #import "RCTModuleMethod.h" #import "RCTRootView.h" diff --git a/Examples/UIExplorer/UIExplorerUnitTests/RCTContextExecutorTests.m b/Examples/UIExplorer/UIExplorerUnitTests/RCTJSCExecutorTests.m similarity index 95% rename from Examples/UIExplorer/UIExplorerUnitTests/RCTContextExecutorTests.m rename to Examples/UIExplorer/UIExplorerUnitTests/RCTJSCExecutorTests.m index 07d1ebfb0..5d08f8f46 100644 --- a/Examples/UIExplorer/UIExplorerUnitTests/RCTContextExecutorTests.m +++ b/Examples/UIExplorer/UIExplorerUnitTests/RCTJSCExecutorTests.m @@ -16,24 +16,24 @@ #import -#import "RCTContextExecutor.h" +#import "RCTJSCExecutor.h" #import "RCTUtils.h" #define RUN_PERF_TESTS 0 -@interface RCTContextExecutorTests : XCTestCase +@interface RCTJSCExecutorTests : XCTestCase @end -@implementation RCTContextExecutorTests +@implementation RCTJSCExecutorTests { - RCTContextExecutor *_executor; + RCTJSCExecutor *_executor; } - (void)setUp { [super setUp]; - _executor = [RCTContextExecutor new]; + _executor = [RCTJSCExecutor new]; [_executor setUp]; } @@ -97,7 +97,7 @@ static uint64_t _get_time_nanoseconds(void) - (void)testJavaScriptCallSpeed { /** - * Since we almost don't change the RCTContextExecutor logic, and this test is + * Since we almost don't change the RCTJSCExecutor logic, and this test is * very likely to become flaky (specially across different devices) leave it * to be run manually * diff --git a/Libraries/RCTTest/RCTTestRunner.m b/Libraries/RCTTest/RCTTestRunner.m index 6c2e9b5d1..e1c8e29a8 100644 --- a/Libraries/RCTTest/RCTTestRunner.m +++ b/Libraries/RCTTest/RCTTestRunner.m @@ -15,7 +15,7 @@ #import "RCTRootView.h" #import "RCTTestModule.h" #import "RCTUtils.h" -#import "RCTContextExecutor.h" +#import "RCTJSCExecutor.h" static const NSTimeInterval kTestTimeoutSeconds = 60; static const NSTimeInterval kTestTeardownTimeoutSeconds = 30; @@ -135,7 +135,7 @@ expectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock // Take a weak reference to the JS context, so we track its deallocation later // (we can only do this now, since it's been lazily initialized) id jsExecutor = [bridge valueForKeyPath:@"batchedBridge.javaScriptExecutor"]; - if ([jsExecutor isKindOfClass:[RCTContextExecutor class]]) { + if ([jsExecutor isKindOfClass:[RCTJSCExecutor class]]) { weakJSContext = [jsExecutor valueForKey:@"context"]; } [rootView removeFromSuperview]; diff --git a/React/Base/RCTBatchedBridge.m b/React/Base/RCTBatchedBridge.m index d9ee999f7..b4734ddd6 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -14,7 +14,7 @@ #import "RCTBridge+Private.h" #import "RCTBridgeMethod.h" #import "RCTConvert.h" -#import "RCTContextExecutor.h" +#import "RCTJSCExecutor.h" #import "RCTFrameUpdate.h" #import "RCTJavaScriptLoader.h" #import "RCTLog.h" @@ -25,7 +25,7 @@ #import "RCTUtils.h" #define RCTAssertJSThread() \ - RCTAssert(![NSStringFromClass([_javaScriptExecutor class]) isEqualToString:@"RCTContextExecutor"] || \ + RCTAssert(![NSStringFromClass([_javaScriptExecutor class]) isEqualToString:@"RCTJSCExecutor"] || \ [[[NSThread currentThread] name] isEqualToString:@"com.facebook.React.JavaScript"], \ @"This method must be called on JS thread") @@ -370,7 +370,7 @@ RCT_EXTERN NSArray *RCTGetModuleClasses(void); { NSMutableArray *config = [NSMutableArray new]; for (RCTModuleData *moduleData in _moduleDataByID) { - if (self.executorClass == [RCTContextExecutor class]) { + if (self.executorClass == [RCTJSCExecutor class]) { [config addObject:@[moduleData.name]]; } else { [config addObject:RCTNullIfNil(moduleData.config)]; @@ -432,7 +432,7 @@ RCT_EXTERN NSArray *RCTGetModuleClasses(void); } // Register the display link to start sending js calls after everything is setup - NSRunLoop *targetRunLoop = [_javaScriptExecutor isKindOfClass:[RCTContextExecutor class]] ? [NSRunLoop currentRunLoop] : [NSRunLoop mainRunLoop]; + NSRunLoop *targetRunLoop = [_javaScriptExecutor isKindOfClass:[RCTJSCExecutor class]] ? [NSRunLoop currentRunLoop] : [NSRunLoop mainRunLoop]; [_jsDisplayLink addToRunLoop:targetRunLoop forMode:NSRunLoopCommonModes]; // Perform the state update and notification on the main thread, so we can't run into @@ -490,7 +490,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR - (Class)executorClass { - return _parentBridge.executorClass ?: [RCTContextExecutor class]; + return _parentBridge.executorClass ?: [RCTJSCExecutor class]; } - (void)setExecutorClass:(Class)executorClass diff --git a/React/Base/RCTBridge+Private.h b/React/Base/RCTBridge+Private.h index bb87cc173..878014cdf 100644 --- a/React/Base/RCTBridge+Private.h +++ b/React/Base/RCTBridge+Private.h @@ -65,13 +65,13 @@ - (void)handleBuffer:(NSArray *)buffer; /** - * Exposed for the RCTContextExecutor for sending native methods called from + * Exposed for the RCTJSCExecutor for sending native methods called from * JavaScript in the middle of a batch. */ - (void)handleBuffer:(NSArray *)buffer batchEnded:(BOOL)hasEnded; /** - * Exposed for the RCTContextExecutor for lazily loading native modules + * Exposed for the RCTJSCExecutor for lazily loading native modules */ - (NSArray *)configForModuleName:(NSString *)moduleName; diff --git a/React/Base/RCTRootView.h b/React/Base/RCTRootView.h index 710711704..b11881de9 100644 --- a/React/Base/RCTRootView.h +++ b/React/Base/RCTRootView.h @@ -85,7 +85,7 @@ extern NSString *const RCTContentDidAppearNotification; /** * The class of the RCTJavaScriptExecutor to use with this view. - * If not specified, it will default to using RCTContextExecutor. + * If not specified, it will default to using RCTJSCExecutor. * Changes will take effect next time the bundle is reloaded. */ @property (nonatomic, strong) Class executorClass; diff --git a/React/Executors/RCTContextExecutor.h b/React/Executors/RCTJSCExecutor.h similarity index 88% rename from React/Executors/RCTContextExecutor.h rename to React/Executors/RCTJSCExecutor.h index 3ad12683c..cbcf224fc 100644 --- a/React/Executors/RCTContextExecutor.h +++ b/React/Executors/RCTJSCExecutor.h @@ -11,12 +11,10 @@ #import "RCTJavaScriptExecutor.h" -// TODO (#5906496): Might RCTJSCoreExecutor be a better name for this? - /** * Uses a JavaScriptCore context as the execution engine. */ -@interface RCTContextExecutor : NSObject +@interface RCTJSCExecutor : NSObject /** * Configures the executor to run JavaScript on a specific thread with a given JS context. diff --git a/React/Executors/RCTContextExecutor.m b/React/Executors/RCTJSCExecutor.m similarity index 96% rename from React/Executors/RCTContextExecutor.m rename to React/Executors/RCTJSCExecutor.m index 0bf9c0caf..1d52ae5c9 100644 --- a/React/Executors/RCTContextExecutor.m +++ b/React/Executors/RCTJSCExecutor.m @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#import "RCTContextExecutor.h" +#import "RCTJSCExecutor.h" #import @@ -46,7 +46,7 @@ static NSString *const RCTJSCProfilerEnabledDefaultsKey = @"RCTJSCProfilerEnable _context = context; /** - * Explicitly introduce a retain cycle here - The RCTContextExecutor might + * Explicitly introduce a retain cycle here - The RCTJSCExecutor might * be deallocated while there's still work enqueued in the JS thread, so * we wouldn't be able kill the JSContext. Instead we create this retain * cycle, and enqueue the -invalidate message in this object, it then @@ -84,7 +84,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init) @end -@implementation RCTContextExecutor +@implementation RCTJSCExecutor { RCTJavaScriptContext *_context; NSThread *_javaScriptThread; @@ -186,14 +186,14 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) context:(JSContext *)context { RCTAssert(javaScriptThread != nil, - @"Can't initialize RCTContextExecutor without a javaScriptThread"); + @"Can't initialize RCTJSCExecutor without a javaScriptThread"); if ((self = [super init])) { _valid = YES; _javaScriptThread = javaScriptThread; - __weak RCTContextExecutor *weakSelf = self; + __weak RCTJSCExecutor *weakSelf = self; [self executeBlockOnJavaScriptQueue: ^{ - RCTContextExecutor *strongSelf = weakSelf; + RCTJSCExecutor *strongSelf = weakSelf; if (!strongSelf) { return; } @@ -216,9 +216,9 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) - (void)setUp { - __weak RCTContextExecutor *weakSelf = self; + __weak RCTJSCExecutor *weakSelf = self; [self executeBlockOnJavaScriptQueue:^{ - RCTContextExecutor *strongSelf = weakSelf; + RCTJSCExecutor *strongSelf = weakSelf; if (!strongSelf.isValid) { return; } @@ -369,9 +369,9 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) callback:(RCTJavaScriptCallback)onComplete { RCTAssert(onComplete != nil, @"onComplete block should not be nil"); - __weak RCTContextExecutor *weakSelf = self; + __weak RCTJSCExecutor *weakSelf = self; [self executeBlockOnJavaScriptQueue:RCTProfileBlock((^{ - RCTContextExecutor *strongSelf = weakSelf; + RCTJSCExecutor *strongSelf = weakSelf; if (!strongSelf || !strongSelf.isValid) { return; } @@ -443,7 +443,7 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) // Looks like making lots of JSC API calls is slower than communicating by using a JSON // string. Also it ensures that data stuctures don't have cycles and non-serializable fields. - // see [RCTContextExecutorTests testDeserializationPerf] + // see [RCTJSCExecutorTests testDeserializationPerf] id objcValue; // We often return `null` from JS when there is nothing for native side. JSONKit takes an extra hundred microseconds // to handle this simple case, so we are adding a shortcut to make executeJSCall method even faster @@ -468,9 +468,9 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) RCTAssertParam(script); RCTAssertParam(sourceURL); - __weak RCTContextExecutor *weakSelf = self; + __weak RCTJSCExecutor *weakSelf = self; [self executeBlockOnJavaScriptQueue:RCTProfileBlock((^{ - RCTContextExecutor *strongSelf = weakSelf; + RCTJSCExecutor *strongSelf = weakSelf; if (!strongSelf || !strongSelf.isValid) { return; } @@ -532,9 +532,9 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) RCTAssert(RCTJSONParse(script, NULL) != nil, @"%@ wasn't valid JSON!", script); } - __weak RCTContextExecutor *weakSelf = self; + __weak RCTJSCExecutor *weakSelf = self; [self executeBlockOnJavaScriptQueue:RCTProfileBlock((^{ - RCTContextExecutor *strongSelf = weakSelf; + RCTJSCExecutor *strongSelf = weakSelf; if (!strongSelf || !strongSelf.isValid) { return; } diff --git a/React/Profiler/RCTPerfMonitor.m b/React/Profiler/RCTPerfMonitor.m index e91360198..93a6fd70a 100644 --- a/React/Profiler/RCTPerfMonitor.m +++ b/React/Profiler/RCTPerfMonitor.m @@ -20,6 +20,7 @@ #import "RCTFPSGraph.h" #import "RCTInvalidating.h" #import "RCTJavaScriptExecutor.h" +#import "RCTJSCExecutor.h" #import "RCTPerformanceLogger.h" #import "RCTRootView.h" #import "RCTUIManager.h" @@ -311,7 +312,7 @@ RCT_EXPORT_MODULE() forMode:NSRunLoopCommonModes]; id executor = [_bridge valueForKey:@"javaScriptExecutor"]; - if ([executor isKindOfClass:NSClassFromString(@"RCTContextExecutor")]) { + if ([executor isKindOfClass:[RCTJSCExecutor class]]) { self.container.frame = (CGRect) { self.container.frame.origin, { self.container.frame.size.width + 44, diff --git a/React/React.xcodeproj/project.pbxproj b/React/React.xcodeproj/project.pbxproj index 39f3b8633..35a7a346b 100644 --- a/React/React.xcodeproj/project.pbxproj +++ b/React/React.xcodeproj/project.pbxproj @@ -13,7 +13,7 @@ 133CAE8E1B8E5CFD00F6AD92 /* RCTDatePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 133CAE8D1B8E5CFD00F6AD92 /* RCTDatePicker.m */; }; 13456E931ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */; }; 13456E961ADAD482009F94A7 /* RCTConvert+MapKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 13456E951ADAD482009F94A7 /* RCTConvert+MapKit.m */; }; - 134FCB3D1A6E7F0800051CC8 /* RCTContextExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 134FCB3A1A6E7F0800051CC8 /* RCTContextExecutor.m */; }; + 134FCB3D1A6E7F0800051CC8 /* RCTJSCExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 134FCB3A1A6E7F0800051CC8 /* RCTJSCExecutor.m */; }; 13513F3C1B1F43F400FCE529 /* RCTProgressViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */; }; 13723B501A82FD3C00F88898 /* RCTStatusBarManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13723B4F1A82FD3C00F88898 /* RCTStatusBarManager.m */; }; 1372B70A1AB030C200659ED6 /* RCTAppState.m in Sources */ = {isa = PBXBuildFile; fileRef = 1372B7091AB030C200659ED6 /* RCTAppState.m */; }; @@ -121,8 +121,8 @@ 13456E951ADAD482009F94A7 /* RCTConvert+MapKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+MapKit.m"; sourceTree = ""; }; 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTURLRequestDelegate.h; sourceTree = ""; }; 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTURLRequestHandler.h; sourceTree = ""; }; - 134FCB391A6E7F0800051CC8 /* RCTContextExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTContextExecutor.h; sourceTree = ""; }; - 134FCB3A1A6E7F0800051CC8 /* RCTContextExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTContextExecutor.m; sourceTree = ""; }; + 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCExecutor.h; sourceTree = ""; }; + 134FCB3A1A6E7F0800051CC8 /* RCTJSCExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJSCExecutor.m; sourceTree = ""; }; 13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTProgressViewManager.h; sourceTree = ""; }; 13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTProgressViewManager.m; sourceTree = ""; }; 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTStatusBarManager.h; sourceTree = ""; }; @@ -300,8 +300,8 @@ 134FCB381A6E7F0800051CC8 /* Executors */ = { isa = PBXGroup; children = ( - 134FCB391A6E7F0800051CC8 /* RCTContextExecutor.h */, - 134FCB3A1A6E7F0800051CC8 /* RCTContextExecutor.m */, + 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */, + 134FCB3A1A6E7F0800051CC8 /* RCTJSCExecutor.m */, ); path = Executors; sourceTree = ""; @@ -679,7 +679,7 @@ 13A0C2891B74F71200B29F6F /* RCTDevLoadingView.m in Sources */, 13B07FF21A69327A00A75B9A /* RCTTiming.m in Sources */, 1372B70A1AB030C200659ED6 /* RCTAppState.m in Sources */, - 134FCB3D1A6E7F0800051CC8 /* RCTContextExecutor.m in Sources */, + 134FCB3D1A6E7F0800051CC8 /* RCTJSCExecutor.m in Sources */, 14C2CA781B3ACB0400E6CBB2 /* RCTBatchedBridge.m in Sources */, 13E067591A70F44B002CDEE1 /* UIView+React.m in Sources */, 14F484561AABFCE100FDF6B9 /* RCTSliderManager.m in Sources */,