user800014
user800014

Reputation:

Ext deployed application: ext.js vs ext-all.js - what's a better option?

Looking at the deploy process for an ExtJS 4 application I performed the following steps (using SDK Tools 2.0.0-beta3):

sencha create jsb -a http://localhost:8080/myapp/ -p app.jsb3
sencha build -p app.jsb3 -d .

This created for me all-classes.js and app-all.js. The next step was to switch form ext-all.js to ext.js. Doing that my app stop working. Looking at the console, I noticed that Ext tried to load the required classes separately, from a src folder.

src/AbstractPlugin.js?_dc=1372193551701

So, I'm assuming that ext.js requires the src folder that have the unminified version of the components, and it will do one request for each component that my view require, correct?

In this case ext-all.js would be a better option, but it load all components, even the ones that I don't need (1MB size).

Is there some way to build an ext.js version only with the required components (maybe with SDK tools)?

Upvotes: 2

Views: 6099

Answers (1)

kevhender
kevhender

Reputation: 4405

These 2 files serve different purposes. ext.js contains the core functionality needed to run an application, while ext-all.js contains all of the framework code. The first one will require your components to correctly use the requires and uses config properties to organize your code dependencies properly. Then, when you run Sencha Command to build the app, all of your classes will be combined with the core from ext.js, and all your other dependencies from the ExtJS library that you included, and put into that app-all.js file.

If you are trying to use the Sencha SDK to build your app, I would strongly recommend upgrading to the latest version (Sencha Command version 3, available here: http://www.sencha.com/products/sencha-cmd/download) - they have fixed many, many bugs, and it works very well out of the box using the tutorial located here: http://docs.sencha.com/extjs/4.2.1/#!/guide/command.

Upvotes: 4

Related Questions