Cleanup bridge init, measure native module init time

This commit is contained in:
Pieter De Baets
2015-08-21 11:33:04 -07:00
parent 8d07df4a22
commit eab390aecb
6 changed files with 90 additions and 87 deletions

View File

@@ -186,8 +186,8 @@ static RCTBridge *RCTCurrentBridgeInstance = nil;
_bundleURL = bundleURL;
_moduleProvider = block;
_launchOptions = [launchOptions copy];
[self bindKeys];
[self setUp];
[self bindKeys];
}
return self;
}
@@ -214,21 +214,18 @@ RCT_NOT_IMPLEMENTED(-init)
object:nil];
#if TARGET_IPHONE_SIMULATOR
RCTKeyCommands *commands = [RCTKeyCommands sharedInstance];
// reload in current mode
[commands registerKeyCommandWithInput:@"r"
modifierFlags:UIKeyModifierCommand
action:^(__unused UIKeyCommand *command)
{
action:^(__unused UIKeyCommand *command) {
[[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification
object:nil
userInfo:nil];
}];
#endif
}
- (RCTEventDispatcher *)eventDispatcher
@@ -260,6 +257,11 @@ RCT_NOT_IMPLEMENTED(-init)
return _batchedBridge.loading;
}
- (BOOL)isValid
{
return _batchedBridge.valid;
}
- (void)invalidate
{
RCTAssertMainThread();