I am working on an app that is about 700K in size, and so I decided to look at this great new 2.0 feature to reduce the initial download. The app is pretty moduralized, so it seemed like a good candidate for code splitting -- each module should download its code only once it's accessed for the first time. After playing around with the split points, I've, for the most part, achieved the desired behavior, but I am running into a problem with the "left over code" chunk.
Different modules within the app reuse the same components (usually UI widgets, but sometimes business components as well). Since these reused components are not specific to any one module's split point, they all go into this general "left over code" bucket, which is fine. The problem is that since there is only one leftover bucket, *everything* ends up in it, including even very small UI pieces that may be required by the initial download, but are shared with other modules eslewhere in the app. The end result is that I've cut down the initial download to 120K, but what I'm observing is that right after the initial download, the app is downloading the leftover chunk, which is quite large in size since it contains all of the common components of the app. This seems a bit counter-productive. So my questions are as follows: - Is there some nice way to split up the leftover chunk? Ideally what I'd like is to have a chunk which contains just the common components required by the initial download, and then another chunk which has the modules' common components, which is to be downloaded only once one of the modules is accessed. - If not, is there some other pattern that can be recommended to prevent this almost-initial download of the leftover code chunk? Thanks! -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
