有人知道Google的google closure 使用这个东西吗?npm上的这个是怎么玩的

Google Closure编译器从Java转向JavaScript
查看: 660|
评论: 0|原作者: csdn|来自: csdn
摘要: 为了优化和转换JavaScript代码而生的Google Closure编译器,将不再需要Java来执行。相反,Java源代码现在可以编译成JavaScript代码,在Node.js或浏览器下运行。依赖于Java的Closure于2009年由Google引入。 ...
为了优化和转换JavaScript代码而生的Google Closure编译器,将不再需要Java来执行。相反,Java源代码现在可以编译成JavaScript代码,在Node.js或浏览器下运行。依赖于Java的Closure于2009年由Google引入。本周的支持很多的特性,比如箭头函数等,也提供了一些ES2015的替代品。它可以进行语法检查和类型检查,并提供警告。Google提醒,一些特性现在并不稳定,效率也没有Java版本的高。这次升级并不是用JavaScript对Closure的重写。要使用新版本的话,开发者需要通过NPM添加依赖,或者通过Gulp build系统使用。Google的软件开发工程师Sam Thorogood表示,“如果你想从需要Java的Google Closure编译器迁移过来的话,需要对gulp.src()或其替代品先载入JavaScript,然后进行编译。鉴于编译器是运行在纯JavaScript上的,所以编译器不能直接从文件系统读取或写入文件。”Github的release note指出,不使用Gulp或Webpack插件的开发者需要通过标签来指定一部分代码。Closure现使用Apache 2.0协议。
上一篇:下一篇:
快毕业了,没工作经验,
找份工作好难啊?
赶紧去人才芯片公司磨练吧!!Google Closure编译器从Java转向JavaScript - 推酷
Google Closure编译器从Java转向JavaScript
作者:Paul Krill 翻译 :赖信涛 责编 :仲培艺
为了优化和转换JavaScript代码而生的Google Closure编译器,将不再需要Java来执行。相反,Java源代码现在可以编译成JavaScript代码,在Node.js或浏览器下运行。依赖于Java的Closure于2009年由Google引入。
的特性,比如箭头函数等,也提供了一些ES2015的替代品。它可以进行语法检查和类型检查,并提供警告。Google提醒,一些特性现在并不稳定,效率也没有Java版本的高。
这次升级并不是用JavaScript对Closure的重写。要使用新版本的话,开发者需要通过NPM添加依赖,或者通过Gulp build系统使用。
Google的软件开发工程师Sam Thorogood表示,“如果你想从需要Java的Google Closure编译器迁移过来的话,需要对 gulp.src() 或其替代品先载入JavaScript,然后进行编译。鉴于编译器是运行在纯JavaScript上的,所以编译器不能直接从文件系统读取或写入文件。”Github的release note指出,不使用Gulp或Webpack插件的开发者需要通过标签来指定一部分代码。
Closure现使用Apache 2.0协议。
已发表评论数()
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
主题不准确
没有分页内容
图片无法显示
视频无法显示
与原文不一致Please note that GitHub no longer supports old versions of Internet Explorer.
We recommend upgrading to the latest , , or .
If you are using IE 11, make sure you .
JavaScript
Nothing to show
Nothing to show
New pull request
Latest commit
Aug 25, 2016
committed with
When a descriptor set file is bundled with a JAR or WAR it'd be nice to be
able to load it as a resource.
This adds addFileDescriptorSetFromByteSource
and reimplements addFileDescriptorSetFromFile in terms of it.
-------------
Created by MOE:
MOE_MIGRATED_REVID=
Closure Templates
Closure Templates are a client- and server-side templating system that helps you
dynamically build reusable HTML and UI elements. They have a simple syntax
that is natural for programmers, and you can customize them to fit your
application's needs.
In contrast to traditional templating systems,in which
you must create one monolithic template per page, you can think of
Closure Templates as small components that you compose to form your user
interface. You can also use the built-in message support to easily localize
your applications.
Closure Templates are implemented for both JavaScript and Java, so that you can
use the same templates on both the server and client side. They use a data model
and expression syntax that work for either language. For the client side,
Closure Templates are precompiled into efficient JavaScript.
What are the benefits of using Closure Templates?
Convenience. Closure Templates provide an easy way to build pieces of HTML
for your application's UI and help you separate application logic from
Language-neutral. Closure Templates work with JavaScript or Java. You can
write one template and share it between your client- and server-side code.
Client-side speed. Closure Templates are compiled to efficient JavaScript
functions for maximum client-side performance.
Easy to read. You can clearly see the structure of the output HTML from
the structure of the template code. Messages for translation are inline for
extra readability.
Designed for programmers. Templates are simply functions that can call
each other. The syntax includes constructs familiar to programmers.
You can put multiple templates in one source file.
A tool, not a framework. Works well in any web application environment
in conjunction with any libraries, frameworks, or other tools.
Battle-tested. Closure Templates are used extensively in some of the largest
web applications in the world, including Gmail and Google Docs.
Secure. Closure Templates are contextually autoescaped to reduce the risk
Getting Started
Download the latest
Work through .
Work through .
Read the .
Options for Getting Help
Look through the .
Post a question to the
mailing list.
Using Closure Templates with other open source frameworks
There are many Closure Template integrations with other popular open source
frameworks. Here are a few options for getting started:
You can't perform that action at this time.
You signed in with another tab or window.
to refresh your session.
You signed out in another tab or window.
to refresh your session.}

我要回帖

更多关于 google closure编辑器 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信