Skip to content

Commit 56a42e5

Browse files
fromcelticparkfacebook-github-bot
authored andcommitted
remove "prepareReact" call from the iOS bridge
Reviewed By: alexeylang Differential Revision: D6581907 fbshipit-source-id: ca4bd4beef6d75305133a2b2c7de62e65e5aa3da
1 parent 33a2e53 commit 56a42e5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

React/CxxBridge/RCTCxxBridge.mm

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,8 @@ - (void)executeSourceCode:(NSData *)sourceCode sync:(BOOL)sync
739739
{
740740
// This will get called from whatever thread was actually executing JS.
741741
dispatch_block_t completion = ^{
742+
// Log start up metrics early before processing any other js calls
743+
[self logStartupFinish];
742744
// Flush pending calls immediately so we preserve ordering
743745
[self _flushPendingCalls];
744746

@@ -1013,16 +1015,19 @@ - (void)_runAfterLoad:(RCTPendingCall)block
10131015
}
10141016
}
10151017

1016-
- (void)_flushPendingCalls
1018+
- (void)logStartupFinish
10171019
{
10181020
// Log metrics about native requires during the bridge startup.
1019-
uint64_t nativeRequiresCount = [self->_performanceLogger valueForTag:RCTPLRAMNativeRequiresCount];
1021+
uint64_t nativeRequiresCount = [_performanceLogger valueForTag:RCTPLRAMNativeRequiresCount];
10201022
[_performanceLogger setValue:nativeRequiresCount forTag:RCTPLRAMStartupNativeRequiresCount];
1021-
uint64_t nativeRequires = [self->_performanceLogger valueForTag:RCTPLRAMNativeRequires];
1023+
uint64_t nativeRequires = [_performanceLogger valueForTag:RCTPLRAMNativeRequires];
10221024
[_performanceLogger setValue:nativeRequires forTag:RCTPLRAMStartupNativeRequires];
10231025

10241026
[_performanceLogger markStopForTag:RCTPLBridgeStartup];
1027+
}
10251028

1029+
- (void)_flushPendingCalls
1030+
{
10261031
RCT_PROFILE_BEGIN_EVENT(0, @"Processing pendingCalls", @{ @"count": [@(_pendingCalls.count) stringValue] });
10271032
// Phase B: _flushPendingCalls happens. Each block in _pendingCalls is
10281033
// executed, adding work to the queue, and _pendingCount is decremented.

0 commit comments

Comments
 (0)