PDA

View Full Version : What is in 'sencha-touch.js'?



wilzdezign
27 Oct 2011, 7:03 AM
Trying to see what I can use as a simple demo for the 'sencha-touch.js' file. It seems even using the Ext.Loader I must use the 'sencha-touch-all.js'.

Or is the 'sencha-touch.js' the final file used after JBuilder that breaks down the components that is only used in the current app. If so, what are the components in the 'sencha-touch.js' that comes in the download?

robl
27 Oct 2011, 12:13 PM
Trying to see what I can use as a simple demo for the 'sencha-touch.js' file. It seems even using the Ext.Loader I must use the 'sencha-touch-all.js'.

Or is the 'sencha-touch.js' the final file used after JBuilder that breaks down the components that is only used in the current app. If so, what are the components in the 'sencha-touch.js' that comes in the download?

I asked the same question last week and have yet to receive a response. In fact, many of my questions have not received a response -- probably because of SenchaCon. However, I hope that the Sencha team takes the time to go thru them and respond. ST 2.x is promising but we need assistance with it.

Jacky Nguyen
2 Nov 2011, 10:39 AM
sencha-touch.js and sencha-touch-debug.js are both the core portions of the framework. The debug version is meant for development, the other one is for production.

sencha-touch-debug.js:

- is not minified
- has Ext.Loader enabled by default
- has pre-mappings of alternateClassNames / xtypes for all built-in classes in the framework for convenience during development.

Bottom line is you should include sencha-touch-debug.js during development, and switch to sencha-touch.js during production.

robl
7 Nov 2011, 5:52 PM
Thanks but please explain the -all vs no -all versions.

Jacky Nguyen
7 Nov 2011, 6:00 PM
sencha-touch.js and sencha-touch-debug.js are both the core portions of the framework

while sencha-touch-all.js (sencha-touch-all-debug.js) is everything available in the framework combined. Two reasons why you shouldn't use them:

1. Unless your application uses most of everything we offer, it generally overkills in terms of file size and code execution performance. Production custom builds are always better.

2. sencha-touch-all-debug.js is huge (~70,000 lines) and it's very difficult to debug with debuggers, as compared to making use of Ext.Loader to have everything loaded and listed separated.

robl
7 Nov 2011, 6:07 PM
What is in the core vs. not in the core? I understand that you should always use the minimal code necessary but how do I know that I'm using non-core functionality?

The way I see ST organized is: Base, Components, Views, Data, and Utilities. Not sure what is considered 'core'.

Jacky Nguyen
7 Nov 2011, 6:12 PM
Core mainly consists of:

- The Class System
- The "lang" package (Ext.Function, Ext.Object, Ext.Array, etc...)
- Ext.Element

Any other classes you use are non-core, which means they are optional. The framework is designed to be loosely-coupled

wilzdezign
8 Nov 2011, 1:10 PM
Thanks for the update. So my goal is to get down to 'sencha-touch.js' once I learn the Loader part, if say I only wanted Panel, TabBar, and Button.

For now I will stick with the 'sencha-touch-all.js' until I get the Loader down