0
votes

I have 20 Stores in my app. And i'm tunning & minifying my App with sencha build. While debugging I saw a lot of [Ext.Loader] Synchronously loading warnings:

[Ext.Loader] Synchronously loading 'MyApp.store.Store1'; consider adding Ext.require('MyApp.store.Store1') above Ext.onReady

My question is, should I include once all my stores with Ext.requires(['MyApp.store.Store1' ... StoreN]) before Ext.application({ .. }); or should I include only requires: ['MyApp.store.StoreX'] in the Class that uses that store.

2
For development it doesn't matter. For production - all should be minified in a single filezerkms
But for production, do this warnings matter?cualit
[Ext.Loader] Synchronously loading 'MyApp.store.Store1'; consider adding Ext.require('MyApp.store.Store1') above Ext.onReadycualit
add it to requires property of the class that uses them docs.sencha.com/extjs/4.1.1/#!/api/Ext.Class-cfg-requireszerkms
In case of my stores, I use them repeatedly in many classes. Isn't Requiring them only once at the begining of the App better than requiring them repeatedly on every file that uses them ? (this is my main concern)cualit

2 Answers

2
votes

Stores should be placed in the stores configuration of Ext.app.Application or specific controllers.

Then they are not only loaded at the correct time but also registered with StoreManager, so that you can access them with controller.getStore(storeId).

1
votes

The only way I could manage to get rid of all the warnings without going through every file and analyze it's store dependencies, was to add Ext.require(['MyApp.store.Store1' ... 'StoreN'].

Stores are use widely in my App, thats why I thought that requiring them ONCE was better and more practical than requiring them in every file that uses them.

If you see any downsides in this approach please let me know!