Now I am working with Ionic3, Angular4 android app. It is taking a while to load initially. I mean I got a black blank screen for few seconds.How can I speed up this and avoid the black screen?
I try to keep up-to-date a post about that subject on the Ionic forum, have a look to https://forum.ionicframework.com/t/app-boot-time-current-state-and-best-practices/
But right now, some keywords about your question would be, I guess
Use lazy loading
: Lazy loading concept allows you to not load and not load all requirements of your pages and components at boot time. For example, really really summarized, if you've got a first page1
and a page2
which use componentA
. Without lazy loading, everything gonna be loaded at boot time. With lazy loading, componentA
not gonna be loaded at boot time because it's not needed for the loading sequence and will only be use later and therefore, you save a bit of time
check your code and the libs you use to spare size: Size of the app is the key. Bigger is your app, slower is your boot
check your statics assets
: could you delete or compact images? could you delete fonts? or could you not embed fonts? again size is the key
do you use rxjs operators? recently it was announced a new way of importing them and therefore to let you only imports the one you need and not all operators, again, it allows to spare size
you could apply this thinking to other libs you use, like lodash or moment.js vs date-fns I guess. Do you import all the libs or only what you need? Think small is beautiful
I hope this helps ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With