Google Closure Library在jQuery上提供了什么? [英] What does Google Closure Library offer over jQuery?

查看:108
本文介绍了Google Closure Library在jQuery上提供了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑

  • 业务背景
  • 社区支持
  • 可用扩展名
  • 默认功能集
  • 使用简便
  • 和可靠性

为什么您偏爱另一个?

推荐答案

我将尝试添加我的信息.

I'll try to add my piece of information.

据我了解,Google Closure不仅是另一个JS库,而且还是允许您优化JS代码的一组工具.使用jQuery可为您提供良好的工具和轻量级的库,但不会减少您自己的代码. 关闭编译器将. 关闭检查器可能也很有用,因为有时缩小的代码具有不同的含义行为要比原始行为多,而且调试起来很痛苦.它与 Firebug 集成在一起,并支持单元测试,它们都是当今开发人员最好的朋友.

As I understand it, Google Closure is not only another JS library, but it is also a set of tools that will allow you to optimize your JS code. Working with jQuery gives you good tools and a lightweight library, but it does not minify your own code. The Closure compiler will. The closure inspector may also be useful, as sometimes minified code has a different behavior than the original one, and is a pain to debug. It integrates with Firebug and support unit tests, which are both developers' best friends nowadays.

我猜想,与任何新的VS相对完善的库相比,它将缺乏jQuery所提供的大量扩展和教程.但是,在Google的推动下,应确保支持和可靠性都非常好.当前的文档

I guess that as any new library VS a well established one, it will lack the availability of tons of extensions and tutorial that jQuery has. However, being pushed by Google should ensure that support and reliability will be both pretty good. The current documentation and tutorial both seem really good, too.

尽管Closure的功能看起来不错,但其模块化体系结构也很有希望.我想Google在内部已经使用了很长时间了,这意味着您可以期望以非常优化和可扩展的方式实现所有(以及更多)基本功能.他们正试图将其表示为JavaScript的STL,因此应该完善它.

The features of Closure look decent, though, and its modular architecture is promising, too. I guess Google has been using it internally for a long time, which means that you could expect all basic features (and more) to be implemented, and probably in a very optimized and scalable way. They are trying to present it as the STL of JavaScript, so they should have polished it.

更仔细地研究这些功能之后,与现有的jQuery库相比,这似乎是Web应用程序开发的一大进步.它猜测这会有益于Google的内部开发,但它会检测在线状态(请参见 goog .events.OnlineHandler ),轻松将AJAX请求和JS操作集成到浏览器历史记录中(请参见 goog.History )或它们提供的大量精美小部件(请参见 goog.ui程序包)可能有助于我们所有人构建更出色的Web应用程序;)!

After looking at the features more closely, it seems that this may be a step forward for web-applications development compared to existing libraries as jQuery. It guess it benefits internal developments at Google, but things like detecting the online state (see goog.events.OnlineHandler), easy integration of AJAX requests and JS actions in the browser history (see goog.History), or the legions of great widgets they provide (see goog.ui package) may help all of us building even more awesome webapps ;) !

它带有与Java集成的模板功能(谁说

It comes with templates features that integrates with Java (who said GWT ?), so this may also be another plus for Closure.

最后,它看起来非常简单易用.语法可能比$ jQuery短函数有些冗长,但是有了IDE和自动补全功能,这并不是一个真正的问题.而且,我想我们可以期望Google能够很好地集成到Eclipse之类的IDE中.

Finally, it looks pretty simple to use. The syntax may be a bit more verbose than the short $ jQuery function, but with IDEs and auto-completion, it's not a real problem. Moreover, I'd say we can expect a good integration in IDEs like Eclipse, coming from Google.

根据要求,让我说说有关GWT参考的几句话. Google Web Toolkit是一个Java库,它可以创建启用AJAX的Web界面,并生成(并优化)所需的JavaScript代码.由于Google Closure允许创建可在客户端和服务器端使用的模板(使用JavaScript和Java),因此我猜想不久将可以将它们一起使用(如果还不是这样的话).

as requested, let me say a few words about the GWT reference. Google Web Toolkit is a Java library that allows to create AJAX-enabled web interfaces and that generates (and optimizes) the required JavaScript code. As Google Closure allows to create Templates that can be used both client- and server-side (using JavaScript and Java), my guess is that it will soon be possible to use them jointly (if it's not already the case).

这篇关于Google Closure Library在jQuery上提供了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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