Search code examples
sencha-touchsencha-touch-2sencha-touch-2.1

Difference between Sencha-touch-all and Sencha-touch.js library files?


Still not clear with this. I am testing with simple login form (Version is 2.2.1 and no external CSS or JS). After looking up the resource consuming, I am confused with js should i prefer either (sencha-touch.js or sencha-touch-all.js) for development and production. By default the microloader maps to sencha-touch.js. Should i change it?

sencha-touch.js --> enter image description here

sencha-touch-all.js --> enter image description here

Here it just give only 29 hits to server but downloading 4 mb of file which is larger than sencha-touch


Solution

  • sencha-touch.js will be making a request to individual source files for each component your app requires in. sencha-toucha-all.js includes all components by default.

    See this guide in the docs for more info: http://docs.sencha.com/touch/2.3.0/#!/guide/building

    More specifically, this is what you should be doing: - use sencha-touch.js in development - have each of your files require in all the sencha touch components/proxies etc it needs - when you want to go to production, use the sencha app build command in your terminal to build to a single, minified javascript file which then contains all your code and all the sencha touch code your app needs.