Get access to the library
In order to get the newly released Google Closure Library you need to get it from their subversion repository. Google allow anonymous check out and provide a command for people using a command svn client.
svn checkout http://closure-library.googlecode.com/svn/trunk/ closure-library-read-only
It is pretty simple if you know how to do it but if you never worked with subversion you need to get a client first. There are tons of guides and books on using subversion as it is one of / if not the top source control system available and then it is open source. There are also a lot of free client applications available and some are command line oriented while others provide regular application interfaces or fx. integrate directly into windows explorer. You can find a list of worth using clients here and also get the slik SVN command line client for windows I have used for this article. If you download and install Slik SVN you will find the command line tool in “C:\Program Files\SlikSvn\bin”.As svn put the files it check out in the current folder you should create an environment variable making svn.exe available anywhere.
Open svn.exe in a command line window and you’re ready to check out Closure Library. Type or copy in the command provided above.
Huge but highly structured
When you open up the bag of goodies you will find that in the top folder Google put in a file called “all_tests.html”. This is a preconfigured JsUnut test lab that you can fire off to verify that everything is OK before you start using it. This is best practice for large development projects and expected that Google use this. Having it as part of the package Google provide is to me a sign of quality and maturity that makes me feel good – year really a good first sight impression!
If you want to look into the features you can benefit from using I would suggest starting in the \closure\goog\demos\ folder. In here there is a lot of very nice demo pages illustrating how the Closure features can be used. Again this is smells good and there are more than 100 demo pages making me believe we’re well covered in! Let’s look at a few examples:
The index page
Yes Closure is huge but with tools like this it quickly becomes manageable!
Drawing graphics using Closure is possible but I’m not sure if generating the data for the tiger is simple ;))
Data for the yellow pacman seams resonable simple if I managed to locate it.
Get started using it
I will try Closure out over the next couple of days and plan to post about my experience working with it soon. If you want to try it out yourself you should fire up the article Google provided to give us all a smooth introduction Finding Your Way around the Closure Library. If you have already some experience with Closure please share this in a comment. Also look at the examples and copy some code from there to get started fast!