Today we finally announced and released Closure (or Closure Library as the JS library is officially known as).
History
Me and Dan Pupius started the JS library at Google a long time ago. At the time there was a lot of good JS code at Google but there was really no order to it and the code was spread out all over the code base. This of course made it hard to discover which in turn lead to the same code being reimplemented over and over. As you might guess the code that existed was not very consistent and sometimes did not even work in the presence of other code. Closure was an attempt to bring a closure to this mess. The name is also a play on the programming language feature as well as the desire to make our js library be a closure of all the existing js code at Google.
At the time we were considering using Dojo as our base for this new library. We were very impressed with Dojo but back then Dojo was too unstable and we had heard too many horror stories of upgrade migration head aches. We also looked at MochiKit which was more stable but it did not really solve any of our problems. (*)
Today
We have had more than 400 Google engineer contributing code to Closure. The code is constantly evolving but I feel like it has stabilized a lot over the last year or so. It is used by almost all of Google’s web applications and the amount of QA and usage these apps have is unheard of for any web application.
I’m very happy that Nathan and Daniel took upon themselves to release this because neither me nor Dan has had the bandwidth to do it.
Future
I hope we can see more code being shared among the different open source JS libraries out there. We would love to be able to goog.require some Dojo code (especially their data model code) and I’m sure they would love to be able to dojo.require our data structures and i18n code.
Closure Compiler
Closure relies heavily on the Closure Compiler to concatenate files, doing static type analysis, as well as code optimizations such as inlining and dead code removal. Closure Library is great for prototyping but it gets slow real fast due to all the network request that are done at startup as well as downloading all the code that you do not really need. The compiler solves both these problems.
Third Party Code
We ended up using both Dojo (we use Acme for goog.dom.query) and we use MochiKit’s Deferred in goog.async.Deferred.
Pingback: Ajaxian » Google releases Closure, the tools behind the JS geniuses()
Pingback: Māris Fogels (mars) 's status on Saturday, 07-Nov-09 21:51:32 UTC - Identi.ca()
Pingback: Closure Compiler – Google Code | Amasijo()
Pingback: Getting Closure: Don’t just use it, don’t just abuse it on Dion Almaer's Blog()
Pingback: Google Closure: 糟糕的JavaScript – JS More()
Pingback: Google Closure: 糟糕的JavaScript – ALuan()
Pingback: Google releases Closure, the tools behind the JS geniuses - Wasif Hafeez()
Pingback: Closure « DesignerLinks()