PDA

View Full Version : Unification of JS and CSS



neethul
24 Sep 2013, 9:36 AM
Would like to know the expert view on the following:

We have written a Hybrid Application with 15 workflows to perform automization from mobile device for Sales/Field Force users. Each workflow is designed with MVC pattern. Assume that each workflow has around 15 files.
Which means that the Mobile App contains 225+ files and 15 custom CSS files. Finally the app is created as .ipa(for iOS devices) and .apk(for Android

Basically when a user interested on a particular workflow then the store/model/views &controllers are loaded once on demand. i.e other workflow files may not get loaded if the user is not interested.

We heard 'Unification' concept of making all the 225 files into one file and it will get loaded once during the App initialization.

I would like to know, applying the Unification here does it make any sense? i.e I am claiming that it is an overhead of loading all the files(model/store/controller/views) at the boot up even though if the user is not interested on all the 15 workflows.

Please share your views on the above approach?

Kurt001
24 Sep 2013, 10:43 AM
I guess there is no easy answer to this.
Are you destroying views, routing, minifying the app already?

Basically your custom views are not taking up that much space as the basic components do (e.g. Ext.Button), so I usually would not worry about that. My last app had about 150 views and that was no problem, but I only had one CSS file.
Are you doing compelte new look and feels in the different workflows. If not, you might be able to get all css changes in in file (most likely you are using a button design for all workflows and only here and there different styles).

Did you already do "sencha app build package"?

neethul
25 Sep 2013, 9:50 AM
We are creating the views only once and refilling the data when the user is navigating the same views back and forth. The views will be get destroyed only when logout.

Entire application is completely customized according to client requirement. It will like an iOS app. i.e Top Panel, Bottom panel, TAB controls, List background image etc..

Initially the 15 CSS will be loaded along with Sencha Tocuh generated CSS in a sequence at the boot up and later it was unified into 1 file.

What you mean by 'sencha app build package'?
Can you please explain the benefit?

Kurt001
25 Sep 2013, 10:20 AM
Lets say you use PhoneGap to build APK and IPA.
To do so you need a 'www' folder, which contains your Sencha Touch project.
Usually you will have all these files in controllers, views, models,... and the Sencha sources.

If you go to the Sencha root folder and open a command line, type 'sencha app build package'.
This will create a new folder: 'built'
In there you will find your Sencha project minified and as one file only.
This will give you huge loading time boost.