Exploring Google's JavaScript development tool Closure

Source: Internet
Author: User

BKJIA quick translation] Today, Google released its internal JavaScript development tool Closure and contributed it to the open-source community. While winning the praise, let's take a look at what it actually has.

  • Multi-image explanation: Google Wave Program Development
  • Is Google's Web Toolkit (GWT) The future of Web development?
  • Android 2.0 API released by Google has been greatly improved
  • Google Wave alliance agreement announces self-built services
  • Google discloses its JavaScript tool: Closure Co

Closure Compiler

The Closure compiler is a JavaScript optimizer that generates compact, high-performance JavaScript code for Web applications. It removes unnecessary Code and is rewritten and optimized to keep your body small, in order to run faster on the browser's JavaScript engine, this compiler will also check the syntax, variable reference and type, and warn against common JavaScript traps, these features help you write less bugs, programs that are easier to maintain. You can also use the Closure checker, which is a Firebug extension used to debug hard-to-read code.

Because JavaScript developers are a diverse group, Google has also designed many methods to run the Closure compiler and has a built-in command line tool. If you want to be lazy, google also provides an online page where you can put your JavaScript code into the text input box on the page to help you compile the code, or call the RESTful API to complete the compilation. In addition, Google provides the famous Firefox extension Page Speed, allowing developers to conveniently view the performance of webpages in Firefox.

Closure Library

The Closure library is a widely used, strictly tested, modular, and cross-browser JavaScript library. Web developers can reuse it directly through dragging on their user interfaces.

JavaScript lacks a class library similar to STL or JDK. Now, Google Closure brings us a "Standard JavaScript library ", this makes it easier to create large and complex Web applications. This library needs to be used with the Closure compiler. You can make your project more complex to use namespaces and type checks), or make your project lightweight and quick to use assembly ). The Closure Library provides a clean utility for common tasks, so you can spend time writing your applications without thinking about writing your own tools and browser abstractions.

Closure Template

Closure templates, formerly Web templates, improve JavaScript efficiency through pre-compilation. Closure templates have a set of simple syntax that can be quickly mastered by programmers. They are different from traditional template systems, you can regard a Closure template as a small component, and then assemble it to form a formal Web page. Therefore, you no longer need to design a large template for each page.

Closure templates are implemented using JavaScript and Java, so you can use the same template on the server and client.

Summary

The Closure compiler, Closure library, Closure template, and Closure checker are still under development. Google calls them 20% projects, but even so, thousands of people are already distributing them, and contribute code and patches to these tools. Currently, all Closure tools are applied to Google product development. This is why Google believes that they should be contributed and shared with Web developers all over the world.

Source: Closure team blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.