PDA

View Full Version : while loading more javascript files in ViewPort, takes more time to launch..



khadarmeeran
3 Jan 2012, 6:06 AM
I have been loading 40 JavaScript files in the viewport.js... so that application loading time is become too slow
and it takes 1 minuit to show launcher screen.... how to reduce this? is there any way to load remaining
files at the background? or any other way to fix this issue?

initComponent: function() {
Ext.apply(this, {

items: [

{ xtype: 'App.views.Login, id: 'LoginScreen' },
{ xtype: 'App.views.HomeScreen', id: 'Home' },

// like this 40 more different Java script files

]
});
App.views.Viewport.superclass.initComponent.apply(this, arguments);
},

mitchellsimoens
3 Jan 2012, 6:30 AM
You should use a minification tool that will build all your files into one and minify it.

khadarmeeran
3 Jan 2012, 7:06 AM
is there any other way without minification tool?

how could i load the
{ xtype: 'App.views.Home', id: 'Home' }, dynamically with in viewport.js

mitchellsimoens
3 Jan 2012, 7:26 AM
If you want to load your file dynamically then you will have to do this yourself. I would strongly encourage the use of a minification tool.