Ext部署的应用程序:ext.js vs ext-all.js - 什么是更好的选择? [英] Ext deployed application: ext.js vs ext-all.js - what's a better option?

查看:108
本文介绍了Ext部署的应用程序:ext.js vs ext-all.js - 什么是更好的选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看 ExtJS 4应用程序的部署过程我执行了以下步骤(使用SDK Tools 2.0.0-beta3):

Looking at the deploy process for an ExtJS 4 application I performed the following steps (using SDK Tools 2.0.0-beta3):

sencha create jsb -a http://localhost:8080/myapp/ -p app.jsb3
sencha build -p app.jsb3 -d .

为我创建的 all-classes.js app-all.js 。下一步是将窗体 ext-all.js 切换到 ext.js 。做我的应用程序停止工作。看着控制台,我注意到,Ext试图从 src 文件夹中分别加载所需的类。

This created for me all-classes.js and app-all.js. The next step was to switch form ext-all.js to ext.js. Doing that my app stop working. Looking at the console, I noticed that Ext tried to load the required classes separately, from a src folder.

src/AbstractPlugin.js?_dc=1372193551701

所以,我'假设 ext.js 需要具有未最终版本的组件的 src 文件夹,它将会对于我的观点需要的每个组件的一个请求是否正确?

So, I'm assuming that ext.js requires the src folder that have the unminified version of the components, and it will do one request for each component that my view require, correct?

在这种情况下, ext-all.js 将一个更好的选择,但它加载所有组件,甚至我不需要的组件(1MB大小)。

In this case ext-all.js would be a better option, but it load all components, even the ones that I don't need (1MB size).

有没有办法构建一个 ext.js 版本只包含所需的组件(可能使用SDK工具)?

Is there some way to build an ext.js version only with the required components (maybe with SDK tools)?

推荐答案

这两个文件用于不同的目的。 ext.js 包含运行应用程序所需的核心功能,而 ext-all.js 包含所有的框架代码。第一个将要求您的组件正确使用要求使用配置属性来正确组织代码依赖关系。然后,当您运行Sencha Command构建应用程序时,所有的类将与 ext.js 中的核心组合,以及ExtJS库中的所有其他依赖项你包括了,并把这个 app-all.js 文件。

These 2 files serve different purposes. ext.js contains the core functionality needed to run an application, while ext-all.js contains all of the framework code. The first one will require your components to correctly use the requires and uses config properties to organize your code dependencies properly. Then, when you run Sencha Command to build the app, all of your classes will be combined with the core from ext.js, and all your other dependencies from the ExtJS library that you included, and put into that app-all.js file.

如果你试图使用Sencha SDK来构建你的应用程序,我会强烈地推荐升级到最新版本(Sencha Command version 3,可以在这里: http://www.sencha.com/products/sencha-cmd/download ) - 他们修复了许多许多错误,它使用位于这里的教程非常好的开箱即用: http:/ /docs.sencha.com/extjs/4.2.1/#!/guide/command

If you are trying to use the Sencha SDK to build your app, I would strongly recommend upgrading to the latest version (Sencha Command version 3, available here: http://www.sencha.com/products/sencha-cmd/download) - they have fixed many, many bugs, and it works very well out of the box using the tutorial located here: http://docs.sencha.com/extjs/4.2.1/#!/guide/command.

这篇关于Ext部署的应用程序:ext.js vs ext-all.js - 什么是更好的选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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