PDA

View Full Version : Ext.Loader question



bkraut
5 Oct 2011, 12:16 AM
Hi,

We are working on migration from ExtJS3 to ExtJS4. I've seen all the migration examples etc... As our application is cca 2500 js files big, we are considering to enable Ext.Loader. But since the ExtJS3 we are using jawr, to collect all the js automatically. IF I understand correct, with Loader enabled the files are included but the classes are not loaded? Or js files are not included and they are included on demand?

Ext.Loader.setConfig({enabled:true});

mitchellsimoens
5 Oct 2011, 4:58 AM
Enabling Ext.Loader allows you to load files on demand. Please be aware, that Ext.Loader is meant as a development tool until you go through the build process that will make one JS file with the Ext components you only need and your application JS files in the order based on you using the requires and uses configs in the Ext.define calls. The reason it is not suggested to use in production is it is not optimal to include a single JS file for each class... browser has to open a socket, download, deal with latency, close the socket and execute each file.

bkraut
5 Oct 2011, 6:07 AM
Exactly. That's why I have configured jawr. During development, it includes all the files separately (done automatically), but when I change this in jawr.properties, it creates a single file on demand for production.

This is good, as I do not need to take care of the directory structure. More I can move my files freely and organize my folders according to my needs. Does Ext.Loader influences also extends in class definitions?

I received some answers also in this thread, but for sure I'll have to research this behaviour a little more http://www.sencha.com/forum/showthread.php?149701-ExtJS4-class-system