PDA

View Full Version : Code for loading dependencies on deployment



wallysalomon
1 Mar 2014, 1:41 PM
Sencha Docs (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.Loader) says that for deployment code, dynamic loading should not be used. Does it mean that I should explicitly set Ext.require() for the narrowest dependency chain possible and absolutely avoid Ext.Loader.setConfig({ enabled: true }); found almost everywhere?

Or would I better use Sencha Cmd to compile the needed libraries to a single file and load it once in the html and just stick to the Ext.create() syntax advocated on the docs (under the "Synchronous Loading on Demand" section)?

I suspect I am mixing up a few concepts here. Can anyone provide some light on this? Thanks

brian428
2 Mar 2014, 11:04 PM
If you don't want runtime loading of required classes, then you'll have to either use Cmd to compile your app into a single .js file, or use some other mechanism to do this (possibly an ANT/Maven/Gradle task where you define the proper order for the files and concatenate them into a single file).