UI must be created before first render, drainMicroTasks when the first page is created#1103
Merged
PanayotCankov merged 1 commit intomasterfrom Dec 6, 2017
Merged
UI must be created before first render, drainMicroTasks when the first page is created#1103PanayotCankov merged 1 commit intomasterfrom
PanayotCankov merged 1 commit intomasterfrom
Conversation
81d342b to
774b0bd
Compare
28f5496 to
b15cf00
Compare
Contributor
Author
|
Btw we should now re-measure the angular overhead on {N} apps, it may turn out it is not as much as we thought it was. |
vakrilov
approved these changes
Dec 4, 2017
Contributor
vakrilov
left a comment
There was a problem hiding this comment.
Make a separate PR with the zone.js patches in:
https://github.com/NativeScript/zone.js -> zone-nativescript branch.
We use this guide to build dist versions of the zone - so it is important to have the patches in the zone repo so they are not lost next time we update the zone.
…t page is created
b15cf00 to
46119de
Compare
Contributor
Author
|
Done the zone.js repo: NativeScript/zone.js@fcca557 @SvetoslavTsenov Test this and let's merge it! |
hshristov
approved these changes
Dec 5, 2017
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the white screen displayed between the launch screen and the initial page view.
Speeds up roughly 300ms startup times for iOS with Angular.
It turns out the UI that is created on viewWillAppear is just a blank Page (we knew that!)
But then few promises resolve leading to the router navigation and building the actual page UI,
these promises are resolved on the main loop, so the iOS have the time to pass a Window layout and render the blank page.
Then, the interesting part, the iOS framework will not run a second layout immediately but will play the intro animation completely, (having 300ms idle time here) and after that run Window layout. In the SDK examples the ListView will start realising cells on that second layout pass and will consume roughly 250ms.
Draining the micro tasks in viewWillAppear will let Angular apps create the UI before the native have a chance to draw a blank screen and will not experience the 300ms. idle delay on startup.
IT IS AWESOME!!!
Now: