November 09, 2009

Get Google's own JavaScript tools

The company publishes tool kit to help developers of Web applications.

All indications are that Google is a keen supporter of open web standards. Almost all services offered by the company, is based on HTML, CSS and JavaScript, although it also used Flash for some services, such as YouTube.

This has of course given the company a lot of experience including JavaScript-intensive applications. There is limited with good tools for this type of development, but Google has the resources to create their own tools. Yesterday, the company made some of these available also for external developers.

The tools that are now released as open source, called Closure Tools, and currently consists of four parts.

Closure Compiler is an optimization tool for JavaScript. Like other similar tools, such as this, compresses the code by removing unnecessary text and space, in addition to including the variable name be as short as possible. This means that the code is less demanding to download, but it will also run faster on your browser's JavaScript engine.

In addition to the compression, the compiler checks the syntax, variable references and types, as well as to warn of common JavaScript pitfalls. This will help developers to write Web applications with fewer errors.

The compiler can also be used with an extension to the Firefox extension Firebug. This is called Closure Inspector and will make it easier to debug the sometimes confusing code Closure Compiler creates.

Closure Compiler can be run in different ways. One is as a command-line tools, but it is also available as a web application where the developer can provide the code through a text box or a Restful-based programming interface. The compiler has also been integrated with Google's Page Speed, who is also an extension to Firebug.

In addition to the compiler, Google now Closure Library. This is a new, but according to Google tested JavaScript library that offers broad functionality, including reusable widgets and controls for user interfaces, low-level tools for DOM, server communication, animation, data structures, and  unit testing.

The last part of today's Closure Tools is Closure Templates. This is a template system that will help developers dynamically build reusable HTML and user interface elements, for both client and server side. The templates are based on, respectively, JavaScript and Java. According to Google, one can see on Closure Templates that small components that the developer can put the same to form a user interface, instead of having one large template per page.

According to Google Closure Tools components has for long been a central part of the JavaScript infrastructure for Google web applications, including Gmail and Google Docs. All the parts were originally made as so-called 20 percent projects, that is, on the one day a week that Google's developers can work on projects that are not mentioned in their job description.

Free Website Hosting