Permalink
Browse files

remove "prepareReact" call from the iOS bridge

Reviewed By: alexeylang

Differential Revision: D6581907

fbshipit-source-id: ca4bd4beef6d75305133a2b2c7de62e65e5aa3da
  • Loading branch information...
fromcelticpark authored and facebook-github-bot committed Dec 26, 2017
1 parent 33a2e53 commit 56a42e57d05ff609e8fce35dcb5e9db7938db801
Showing with 8 additions and 3 deletions.
  1. +8 −3 React/CxxBridge/RCTCxxBridge.mm
@@ -739,6 +739,8 @@ - (void)executeSourceCode:(NSData *)sourceCode sync:(BOOL)sync
{
// This will get called from whatever thread was actually executing JS.
dispatch_block_t completion = ^{
// Log start up metrics early before processing any other js calls
[self logStartupFinish];
// Flush pending calls immediately so we preserve ordering
[self _flushPendingCalls];
@@ -1013,16 +1015,19 @@ - (void)_runAfterLoad:(RCTPendingCall)block
}
}
- (void)_flushPendingCalls
- (void)logStartupFinish
{
// Log metrics about native requires during the bridge startup.
uint64_t nativeRequiresCount = [self->_performanceLogger valueForTag:RCTPLRAMNativeRequiresCount];
uint64_t nativeRequiresCount = [_performanceLogger valueForTag:RCTPLRAMNativeRequiresCount];
[_performanceLogger setValue:nativeRequiresCount forTag:RCTPLRAMStartupNativeRequiresCount];
uint64_t nativeRequires = [self->_performanceLogger valueForTag:RCTPLRAMNativeRequires];
uint64_t nativeRequires = [_performanceLogger valueForTag:RCTPLRAMNativeRequires];
[_performanceLogger setValue:nativeRequires forTag:RCTPLRAMStartupNativeRequires];
[_performanceLogger markStopForTag:RCTPLBridgeStartup];
}
- (void)_flushPendingCalls
{
RCT_PROFILE_BEGIN_EVENT(0, @"Processing pendingCalls", @{ @"count": [@(_pendingCalls.count) stringValue] });
// Phase B: _flushPendingCalls happens. Each block in _pendingCalls is
// executed, adding work to the queue, and _pendingCount is decremented.

0 comments on commit 56a42e5

Please sign in to comment.