Thursday, May 17, 2012

Starting Closure

There has never been a better time to start using Closure.

The closure set of tools has been open sourced for a couple of years now and the last piece of the puzzle has landed, namely Closure Stylesheets. Now there is a full set of tools that are out there for you to use, not only that but the tools have been out long enough that there is help available.

Closure tools has been created fir a large team to create large applications. This has been the main hurdle to new developers wanting to learn. Most new developers will begin to learn closure at work in a team. Luckily there are now tools out there to help single programmers start for any size of project. Here is what you need to start:

Closure: The definitive guide

If you want to start with the tolls a great way to start is to understand the thinking behind it. The book will give great insights in to how the tools work and how you can use them. There are great books out there for every library, and closure is no exception.


Plovr is a tool written by Michael Bolin and makes using the library, compiler, templates and tests a breeze.


I'm guessing you already know jquery. Let's face it, it's almost analogous to javascript. One of the concerns that people have is that the closure library is long-winded. The library was written in a functional style and namespaced so you have to type out the namespace then the function and pass in the object you need. JQuery is a bit easier as you already have the object and you can just call functions on that, not only that but you have the famous chaining API. G-Closure lets you use DOM, Array and Object functions in the closure-library like you would JQuery. This means you don't even need to know the library to start, if you know jquery you can already build a webpage using the library.


You probably use backbone.js or some other MVC. Well now closure tools has an MVC too, PlastronJS. If you read this blog you should know all about it by now. It's designed to be familiar but also, like the closure library, have many more features you can choose to call on or disregard depending on your needs.

Et al.

An honorable mention should go towards the closure coffeescript fork which does a great job removing the "wordiness" of the library.

But Wait!

If you were about to go hop off and try Closure Tools for the first time I recommend waiting just a little bit more. Closure Tools now has a meetup which means the community is going to get stronger and the toolset is going to get easier. In fact I'll have another little project to announce very soon that should help you on your way. In the meantime I recommend starting by reading the book and keeping your eyes peeled on this blog for further announcements.


  1. Sold!

    But you forgot one of the best reasons

    ..and type definitions

  2. Apart from this blog the whole community seems to be stone dead though? Community, examples and documentation counts for nothing?

    1. Actually the community is just beginning!

      There is already plenty of help to get going in the form of the book and discussion boards at:!forum/closure-library-discuss &!forum/closure-compiler-discuss

      also check out: It's only just started but it was a promising start and I'm actively encouraging people to put their knowledge on the internet to help others

      There will only be more to come. I'm planning in the next couple of months to put out a "starter pack" which should be good to get you on your feet. It will have all of the above together plus more (IDE packages, closure stylesheet bootstrap etc). When it's done I'm going to do some talks about it and that should build the community even more by making it accessible to single programmers working on single page apps and experiments