JasonWyatt

This blog is full of stuff, and things.

Find my resume.

permalink

“Closure Tools”, Google’s New JavaScript Toolkit

Yesterday, Google open-sourced three major JavaScript utilities/libraries as a group called “Closure Tools”:

Closure Compiler

From Google:

The Closure Compiler is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what’s left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls.

Not only does this sound practical and useful, I’d be curious to know what I could learn from Closure Compiler about better/faster JavaScript coding practices. It mentions minification, but I wonder how obsfucated the code becomes or if minification can be switched off to leave the code readable.

Closure Library

From Google:

The Closure Library is a broad, well-tested, modular, and cross-browser JavaScript library. You can pull just what you need from a large set of reusable UI widgets and controls, and from lower-level utilities for DOM manipulation, server communication, animation, data structures, unit testing, rich-text editing, and more.

I feel a combination of skepticism and excitement about Closure Library. I’m skeptical because I feel like this is yet-another JavaScript framework on top of the many popular/successful ones out there: jQuery, Dojo, Prototype, YUI, etc. Not to mention the fact that Google already has a JavaScript framework: Google Web Toolkit.

However, I’m hopeful Closure Library will be a lower-level toolset than GWT and will provide more flexibility. Google has a reputation for having some of the best AJAX/JS coders on the planet working for them and I’d love to see what they came up with.

Closure Templates

From Google:

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.

Without having tried them out for myself (yet), these sound to me a lot like Dojo’s Templates. I’m really curious to see how Google solved this problem. Hopefully it fits well within the designer/developer relationship and doesn’t force too much JavaScript on designers.

Even given my skepticism, I can’t wait to start playing with these new tools! Learning a new way of doing things is always good, and who knows - it might turn out to be my next favorite set of web technology…

Read the Original Article

blog comments powered by Disqus