Ext.Loader同步加载。我应该分开()我所有的商店吗? [英] Ext.Loader Synchronously loading. Should I Ext.require() all my stores?

查看:156
本文介绍了Ext.Loader同步加载。我应该分开()我所有的商店吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有20个商店我正在调查用sencha构建来缩小我的应用程序。
调试时我看到很多[Ext.Loader]同步加载警告:

  [Ext.Loader]同步加载'MyApp.store.Store1';考虑添加Ext.require('MyApp.store.Store1')在Ext.onReady 

我的问题是在Ext.application({..})之前,我应该将一次包含Ext.requires(['MyApp.store.Store1'... StoreN])的所有商店。或者我应该仅包含使用该商店的类中的['MyApp.store.StoreX']。

解决方案

只有这样,我可以设法摆脱所有的警告,而不必经历每个文件,并分析它的存储依赖,是添加Ext.require(['MyApp.store.Store1'...'StoreN']。



商店在我的应用程序中广泛使用,这就是为什么我认为要求他们ONCE比在使用它们的每个文件中要求更好,更实用。 / p>

如果您在这种方法中看到任何缺点,请让我知道!


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.

解决方案

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!

这篇关于Ext.Loader同步加载。我应该分开()我所有的商店吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆