I am reading up on GWT for the first time, and came across this article on codeplitting. In it, the author states:
If you know which split point in your app will come first, you can improve the app’s performance by specifying an initial load sequence…
Several questions on this:
- What is this “initial load sequence” and how/where do you specify it?
- Why does specifying/configuring the load sequence differently affect app performance? In other words, what is the actual optimization that is performed here?
Thanks in advance!
Well, code splitting just affect to the time spent by the browser to load all the js necessary to run the app, but not the performance of your app (I mean the execution of that js).
If the load of your fragments can be performed randomly, that means that there is an initial amount of js (containing all the common code) which should be downloaded at first, this initial fragment could be large if all fragments share so much code.
If you define a logical sequence of loading, it will allow the compiler to distribute shared code in a better way, so as the fragment 1 includes code which uses 1 and 2, and 2 has code used in 2 and 3 etc, but be aware that If you load 3 before 1, will force the browser to download 1 and 2.