Google has just announced that it is open-sourcing a set of tools its own developers use to build some of the company’s most well known products, including Gmail, Google Docs, and Google Maps.
The first tool is called the Closure Compiler, which helps developers optimize their JavaScript code by removing extra portions of comments and code. The Compiler also has a sister program called Inspector — a plugin for Firebug that allows developers to view their optimized code in the browser, with all of their original variable names and other data restored (typically optimized code strips variable names and formatting that makes it very difficult to read). Google is also releasing the Compiler as a web app and a RESTful API.
Google’s second release is a Library that includes many common functions used for building JavaScript apps. Here’s how Google’s blog post describes it:
The Closure Library is a JavaScript library that provides many features that are useful for building web applications across browers. It helps to abstract browser differences and provides clean class and function interfaces for common tasks. Besides DOM interaction and UI tools, the library includes tools for arrays, objects, string manipulation and much more. The library also implements a namespacing and import standard, which helps keep scripts small and load fast when used with the Closure Compiler.
Finally, Google is releasing a new set of templates for Java and JavaScript:
Closure Templates simplify the task of dynamically creating HTML and have an easy-to-read syntax. They allow you to write templates for reusable HTML and UI elements that can be used within JavaScript or on the server side in Java. They also have excellent run-time performance because they are never parsed on the client side.









This is going to come in very useful!! Ill have to write about this over at Crenk.com
This Crenk.com sounds very interesting. Tell me more!
Google’s business is right now aligned with better user experience on the web. They will do everything in their power for that to happen. No surprises.
Awesome. But I think the o3d library is future of rich web which google open sourced. I’m building one.
Apples and oranges.
Short analysis of the closure javascript library compared to jquery:
– Smaller overhead, as it seems that its not needed to load the whole library.
– Incomparably harder to learn syntax
– More functionality (toolbars, canvas, gears), though these kind of functions do exist as plugins for jquery as well
– Not neatly organised (not as perfectionized), visible in for example the naming of some functions
My personal conclusion:
– I will probably use jquery for dom manipulation and most basic work and load the necessary closure libraries for specific tasks.
Cool, now they just need to make it so you could paste in a while HTML file with JavaScript and it will optimize the whole thing.
The insane complexity of their Hello World examples makes me fucking hostile.
Awesome & helpful JS optimizer tool for AJAX hackers. Thanks GOOG!
Tried http://closure-...ppspot.com/home and entered http://google.com
It gave 27 errors on Google home page. Awesome !!!
Ouch.. It was only for js files !!
Sounds like they are prepping tools for developers to build addons for chrome…the easier it is to develop for chrome, the more devs will give it a shot.
Interesting thought, and not something I’ve seen mentioned elsewhere.
A common set of javascript libraries for Chrome, Google Apps extensions, Google App Engine based sites, would be very interesting.
The Closure libraries seem quite bulky. Powerful, but possibly not honed enough to be approachable for the average developer, who will still no doubt stick to jQuery for most client development.
This is very interersting stuff.
Excellent. Because Google’s web apps are so elegant, fast, and well-behaved. With such a focus on aesthetics and usability.
It’s great. We are already using lots of these kind of open source solutions. Yahoo has also similar products and solutions for developer. It is good to see that the big player are supporting the open source community.
For those that wish to use the Closure Compiler automagically inside of TextMate I threw this little bundle together today:
https://groups....c51721d85ee5209
Thats really nice. I wish there was a mention of already available open source libraries, like jQuery and YUI … and how do they compare with this one.