-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LogBox - lazily initialize on iOS, use sync APIs
Summary: Update LogBox on iOS to lazily initialize, using a synchronous RCTSurface, behind RCTSharedApplication checks. This results in faster of LogBox, without keeping around a long lived window in the background, and only used when LogBox is used. On Android, we still start the react app in the background but we create a dialog when it's shown and then destroy it when it's hidden. Once we have the sync APIs on android we can update it to use the same strategy. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D18925538 fbshipit-source-id: 1a72c39aa0fc26c8ba657d36c7fa7bc0ae777eb9
- Loading branch information
1 parent
19bf202
commit 586d55d
Showing
7 changed files
with
151 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 55 additions & 59 deletions
114
Libraries/LogBox/__tests__/__snapshots__/LogBoxNotificationContainer-test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,62 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`LogBoxNotificationContainer should render inspector with logs, even when disabled 1`] = ` | ||
<NativeLogBoxVisibility | ||
visible={false} | ||
> | ||
<View | ||
style={ | ||
Object { | ||
"bottom": 0, | ||
"left": 0, | ||
"position": "absolute", | ||
"right": 0, | ||
"top": 0, | ||
} | ||
<View | ||
style={ | ||
Object { | ||
"bottom": 0, | ||
"left": 0, | ||
"position": "absolute", | ||
"right": 0, | ||
"top": 0, | ||
} | ||
> | ||
<LogBoxInspector | ||
logs={ | ||
Array [ | ||
LogBoxLog { | ||
"category": "Some kind of message", | ||
"codeFrame": undefined, | ||
"componentStack": Array [], | ||
"count": 1, | ||
"isComponentError": false, | ||
"level": "warn", | ||
"message": Object { | ||
"content": "Some kind of message", | ||
"substitutions": Array [], | ||
}, | ||
"stack": Array [], | ||
"symbolicated": Object { | ||
"error": null, | ||
"stack": null, | ||
"status": "NONE", | ||
}, | ||
} | ||
> | ||
<LogBoxInspector | ||
logs={ | ||
Array [ | ||
LogBoxLog { | ||
"category": "Some kind of message", | ||
"codeFrame": undefined, | ||
"componentStack": Array [], | ||
"count": 1, | ||
"isComponentError": false, | ||
"level": "warn", | ||
"message": Object { | ||
"content": "Some kind of message", | ||
"substitutions": Array [], | ||
}, | ||
"stack": Array [], | ||
"symbolicated": Object { | ||
"error": null, | ||
"stack": null, | ||
"status": "NONE", | ||
}, | ||
LogBoxLog { | ||
"category": "Some kind of message (latest)", | ||
"codeFrame": undefined, | ||
"componentStack": Array [], | ||
"count": 1, | ||
"isComponentError": false, | ||
"level": "error", | ||
"message": Object { | ||
"content": "Some kind of message (latest)", | ||
"substitutions": Array [], | ||
}, | ||
"stack": Array [], | ||
"symbolicated": Object { | ||
"error": null, | ||
"stack": null, | ||
"status": "NONE", | ||
}, | ||
}, | ||
LogBoxLog { | ||
"category": "Some kind of message (latest)", | ||
"codeFrame": undefined, | ||
"componentStack": Array [], | ||
"count": 1, | ||
"isComponentError": false, | ||
"level": "error", | ||
"message": Object { | ||
"content": "Some kind of message (latest)", | ||
"substitutions": Array [], | ||
}, | ||
] | ||
} | ||
onChangeSelectedIndex={[Function]} | ||
onDismiss={[Function]} | ||
onMinimize={[Function]} | ||
selectedIndex={-1} | ||
/> | ||
</View> | ||
</NativeLogBoxVisibility> | ||
"stack": Array [], | ||
"symbolicated": Object { | ||
"error": null, | ||
"stack": null, | ||
"status": "NONE", | ||
}, | ||
}, | ||
] | ||
} | ||
onChangeSelectedIndex={[Function]} | ||
onDismiss={[Function]} | ||
onMinimize={[Function]} | ||
selectedIndex={-1} | ||
/> | ||
</View> | ||
`; |
Oops, something went wrong.