View Full Version : Code Splitting

20 Jul 2011, 6:41 AM
Is there the notion of "code splitting" in Sencha Touch? I am not talking about just having several js files, but breaking up the initial download of resources needed to load the app. Looking at the demos, I couldn't tell. It seems most of them load all js files in index.html

If not, how do people handle it in large project? do you break the app into several small apps, each with its own app html?

I have working with Ext GWT for our desktop web app. Before GWT introduced code splitting, we had many customers complaining the web page takes long time to load initially. With code splitting, it really fixes all that issues with our larger web apps (http://code.google.com/webtoolkit/doc/latest/DevGuideCodeSplitting.html). Is there similar concept in Sencha Touch?

Since mobile web app performance and responsiveness is even more demanding, I'd like to know best practices and patterns used on large Sehcha Touch projects (potentially 1000+ classes).

20 Jul 2011, 1:27 PM
its a completely different framework (based on dojo) but there may be some interesting concepts in here...


it can make the code lean for targeted builds and has some interesting ideas for reducing the amount of code your app actually depends on - amongst a few other things ;-) - which is killer for mobile web.

not saying it is the answer but perhaps but it might address the odd thing.

what you are suggesting is runtime dependancy checking and dynamic loading / JIT compiling the code as you need it rather than right at the start?

it's an interesting problem and one that on a sencha vid i'd seen somebody talking about performance of compiling JS and suggesting you don't necessarily want one large chunk of JS like the way we've been going with standard desktop browser sites.

we're probably only really scratching the surface of these kinda things as we fight to keep dom's small, downloads to a minimum, download when necessary etc...

i'm building a fairly large sencha app myself and am just getting into thinking about these kind of issues - we need some hardcore sencha users to get involved in these threads.