0
votes

I have an application that have more than 7 tabs at home page and each tab is very comprehensive in itself with nested tabs/windows.

I am using EXTJS 4.2 MVC architecture. My question is what approach should I use to load all views/controllers/stores. This does not include proxy calls to web servers as those are only user request based.

  • First Approach: Load all files on application first load by including all controllers in app.js file and those controllers will load all tab specific files. I do have one person resource who is working with ExtJs for long time and suggested that it is OK to load all at once. EXTJS build process will combine all these files in one single file and it will be like ext.js file that is very big in itself and takes very less time to load.
  • Second approach: Only load tab views/controllers when user select that tab. That will require invoking controllers dynamically.

As I am new to ExtJS and have lazy loading mentality. Not sure how it fits in EXTJS world. Please advice me based on your experiences.

1
If you are using sencha cmd to build it will compile all files into one minified file for production. isNull1339weeksdev
Yes thats the plan to use sencha cmd to build project for production. So do you think First approach is right then?Meenakshi
If you plan on using sencha cmd then that approach is supported with the toolset. If you plan on dynamically loading the files required then sencha cmds minified approach would not work. However, if you are worried about load times when not minified, you can switch to ext-all for the framework and then it is only loading your js files seperate which still loads pretty fast (i have taken that approach on a few projects)weeksdev
Thank @weeks for your suggestionMeenakshi

1 Answers

0
votes

As long as you concatenate and minify your files into a single bundle your resource loading time should be reasonable. If you also include a version number at the end of your resource loading url you will get the benefit of browser caching and refresh on demand when you want to update the bundle. You just rev the version and the browse will reload your bundle from the server the next time.

Processing 7 controllers and setting up listeners is an overhead but I doubt you will see a major performance improvement here. Do be mindful of multiple round trips to the server to fetch resources and data. This is where you will see negative impact.