在大型企业应用程序中使用ClientBundle? [英] Use ClientBundle in a large Enterprise Application?

查看:106
本文介绍了在大型企业应用程序中使用ClientBundle?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在用GWT构建一个大型企业应用程序(数十个模块),并且需要决定是否使用ClientBundle。我很好奇StackOverflow GWT社区视为交易者的利弊,并为这样的用例提供破坏者。



就我们目前看到的而言:


$ b $ p 优点




  • 所有图像/ css文件占用消除了服务器资源的消耗

  • 由于上述原因,客户端加载速度更快(即内嵌图像url)
  • CSS名称被混淆,因此命名空间冲突消除了

  • CSS自动优化/验证

  • 未使用的CSS类已被删除(上)

  • Java参考将类名替换为可重构的css接口
  • 对类名的UiBinder引用被替换为可重构的css接口
  • 没有更大的main.css由于资源是特定于模块绑定的,因此失败



缺点


  • 对于维护,CSS在混淆模式下变得不可读,或者在调试模式下非常冗长

  • 所有开发人员必须了解Java,CSS,HTML细微差别

  • CSS3和其他规则(即@ font-face)本地不支持GWT
  • 增加编译时间



谢谢!

解决方案

我一直在大量使用客户端软件包 m-gwt

困扰我的一件事是设备没有开发模式的样式。因此,样式可能意味着重新编译完整的应用程序。

大多数情况下,所有CSS3规则都可以通过使用文字函数在ClientBundle中使用,所以应该没问题。它可以通过@media查询获得一些小技巧。你可以注入一个简单的文本资源作为一个解决方法,但它的一种丑陋。



当你在谈论几个gwt模块时,考虑使用多个客户端软件包,这样你就可以仍然使用分割点来控制下载文件的大小(取决于你的.js文件的大小)

我在几个大的gwt应用程序中使用了clientbundles,对我来说编译时检查和重构支持击败仍在客户端捆绑中的小怪癖。


We're building a large enterprise application (dozens of modules) with GWT and need to decide whether to use ClientBundle or not. I was curious what pros/cons the StackOverflow GWT community view as deal makers and deal breakers for such a use case.

As far as we see it currently:

Pros

  • All images/css files that take up server resources to download are eliminated
  • Client loads faster because of the above (i.e. inlined image urls)
  • CSS names are obfuscated, so namespace collisions are eliminated
  • CSS is automatically optimized / verified
  • Unused CSS classes are eliminated (above)
  • Java reference to class names are replaced with refactorable css interfaces
  • UiBinder reference to class names are replaced with refactorable css interfaces
  • No more big "main.css" fails as resources are module bundle specific

Cons

  • For maintenance CSS becomes either unreadable in obfuscated mode, or extremely verbose in debug mode
  • More steps needed for basic CSS work (like adding class)
  • All devs must know Java,CSS,HTML nuances
  • CSS3 and other at-rules (i.e. @font-face) are not supported by GWT natively
  • Increased compilation times

Thanks!

解决方案

I have been using client bundle heavily in m-gwt.

One thing that was bothering me was styling for devices that did not have dev mode. So styling could mean recompiling the complete app.

Mostly all CSS3 Rules can be used in ClientBundle by using the literal function, so that should be okay. It gets a little tricker with @media queries. You can inject the css as a simple textresource as a workaround, but its kind of ugly.

When you are talking about several gwt modules, consider using multiple clientbundles so you can still use split points to keep the download file size under control (Depending on how big your .js files get)

I have used clientbundles in several big gwt apps and for me compile time checking and refactoring support beats the little quirks that are still in client bundles.

这篇关于在大型企业应用程序中使用ClientBundle?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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