PDA

View Full Version : ext.js (dynamic loading) leads to incomplete app-all.js with sencha build



kleins
16 Jun 2011, 11:50 PM
I try to use ext.js and sencha build to compile my own minimal app-all.js with only those Ext classes that I really need. However, my build stays incomplete, not all required classes are included. The reason is obvious, but I cannot see a good way around this, but maybe someone else has already solved this, since it should be a common problem:

sench build (ext-app-builder.js) runs inspects Ext.Loader.history at Ext.onReady. However, some classes are only loaded when the viewport is created in my application's launch-function, i.e. the required ui classes such as tab.Panel.

A call to Ext.require on these classes early on would probably solve the issue, but I find it very useful to leave it all to Ext to decide when to load what and just have to set the xtype myself.

Any suggestions on this?

kumar100
13 Oct 2011, 5:51 AM
Did you solve this problem ? My app-all does not include the required Ext-JS classes .

kleins
13 Oct 2011, 10:03 PM
No, sorry, I never found a satisfying solution to this. I postponed the problem for the moment, since I will still be in development for a few months to come and this only concerns production.
I guess I will have to chose one of the two solutions: Either require the classes early enough so that they are loaded before Ext.onReady or modify the resulting JSBuilder-file and add the classes manually.