Permalink
Browse files

Move bindKeys to RCTBridge setUp

Reviewed By: shergin

Differential Revision: D4794788

fbshipit-source-id: 0839829f4ed010bf2fb2574092a8f68f4c95341a
  • Loading branch information...
javache authored and facebook-github-bot committed Mar 31, 2017
1 parent 8daf985 commit e12e57eb77a22497c9616791056b29f2cbf0c0e7
Showing with 15 additions and 22 deletions.
  1. +0 −1 React/Base/RCTBatchedBridge.m
  2. +8 −13 React/Base/RCTBridge.m
  3. +7 −7 React/Base/RCTModuleMethod.m
  4. +0 −1 React/CxxBridge/RCTCxxBridge.mm
@@ -596,7 +596,6 @@ - (void)stopLoadingWithError:(NSError *)error
* Prevent super from calling setUp (that'd create another batchedBridge)
*/
- (void)setUp {}
- (void)bindKeys {}
- (void)reload
{
View
@@ -190,8 +190,6 @@ - (instancetype)initWithDelegate:(id<RCTBridgeDelegate>)delegate
_launchOptions = [launchOptions copy];
[self setUp];
RCTExecuteOnMainQueue(^{ [self bindKeys]; });
}
return self;
}
@@ -207,15 +205,6 @@ - (void)dealloc
[self invalidate];
}
- (void)bindKeys
{
RCTAssertMainQueue();
#if TARGET_IPHONE_SIMULATOR
RCTRegisterReloadCommandListener(self);
#endif
}
- (void)didReceiveReloadCommand
{
[self reload];
@@ -306,14 +295,20 @@ - (Class)bridgeClass
- (void)setUp
{
Class bridgeClass = self.bridgeClass;
RCT_PROFILE_BEGIN_EVENT(0, @"-[RCTBridge setUp]", nil);
_performanceLogger = [RCTPerformanceLogger new];
[_performanceLogger markStartForTag:RCTPLBridgeStartup];
[_performanceLogger markStartForTag:RCTPLTTI];
Class bridgeClass = self.bridgeClass;
#if RCT_DEV
RCTExecuteOnMainQueue(^{
RCTRegisterReloadCommandListener(self);
});
#endif
// Only update bundleURL from delegate if delegate bundleURL has changed
NSURL *previousDelegateURL = _delegateBundleURL;
_delegateBundleURL = [self.delegate sourceURLForBridge:self];
@@ -104,13 +104,13 @@ static RCTNullability RCTParseNullabilityPostfix(const char **input)
// returns YES if execution is safe to proceed (enqueue callback invocation), NO if callback has already been invoked
static BOOL RCTCheckCallbackMultipleInvocations(BOOL *didInvoke) {
if (*didInvoke) {
RCTFatal(RCTErrorWithMessage(@"Illegal callback invocation from native module. This callback type only permits a single invocation from native code."));
return NO;
} else {
*didInvoke = YES;
return YES;
}
if (*didInvoke) {
RCTFatal(RCTErrorWithMessage(@"Illegal callback invocation from native module. This callback type only permits a single invocation from native code."));
return NO;
} else {
*didInvoke = YES;
return YES;
}
}
SEL RCTParseMethodSignature(NSString *, NSArray<RCTMethodArgument *> **);
@@ -766,7 +766,6 @@ - (void)handleError:(NSError *)error
* Prevent super from calling setUp (that'd create another batchedBridge)
*/
- (void)setUp {}
- (void)bindKeys {}
- (void)reload
{

0 comments on commit e12e57e

Please sign in to comment.