Thursday, November 5, 2009

Google releases Closure Tools!

Today Google released a suite of JavaScript tools that are used to construct massive web applications such as Gmail and Google Docs. The suite is named Closure Tools, and I think you'll find it superior to existing offerings, particularly with respect to minifying JavaScript. The post on the Google Code blog links to a ton of new code and documentation, so trying to determine where to start can be overwhelming.

I used all of these tools when I worked at Google, so there is a lot I could write about them, but for now I'm just going to try to convince you that the Closure Compiler is not your ordinary JavaScript minifier. There is a web version of the Compiler that you can play with to convince yourself that it is worth learning more about. If you go to the site, you will see the following code:

function hello(name) {
alert('Hello, ' + name);
hello('New user');

Using the Compile button to run the Compiler, try each of the options to the right of the Optimization: label when compiling the sample code. The compiled code appears in the first tab on the right side of the screen. Note that running with the Advanced option, the code is compiled down to:

alert("Hello, New user");

Now that's some serious inlining! Can your minifier do that? Probably not. To get the maximum benefit out of Closure Tools, you should fix your JavaScript code so that it compiles in Advanced mode. Reading Google's article on advanced compilation is the quickest way to learn what the Compiler expects from your JavaScript, and it should also give you an idea of what other optimizations the Compiler is capable of.


  1. If you constantly find yourself fumbling through each of your essay papers then having our services will take the load off your shoulders considerably. With our online essay writing help services, you will be able to unlock the potential to receive many laurels for your performance.

    Write my essay for me

  2. Entryways are very significant for different reasons, these entryways ensure that creepy crawlies. different bugs don't go into the house, little children and pets wait at home
    Aluminum screen supplier

  3. Such a wonderful article. Your blog is great. If you want to read interestingarticles on educational topic, you have to visit a site

  4. Our buyers are our assets. And we don’t hesitate to go the extra mile to Halal Meat Near Me serve them with the best. We make sure no one waits and keep shelves full of groceries 24 hours a day.

  5. Dr. Samra-Latif Estafan is committed to helping you Botox/Xeomin Aesthetic achieve wellness and total health through a holistic and integrative approach to dedicated healthcare.

  6. Law Offices Of Rizwan M. Khalid is here to protect your legal rights and help defend you in need. Immigration clients are served throughout the United States and the world. Other legal Top Philadelphia Law Firms services are offered only in New Jersey and Pennsylvania.

  7. Kabobi serves you Halal food. We offer you healthy and delicious Kabobeesh Menu food. You can order a variety of food from our Halal food menu, which would be served to you in minutes.

  8. Williamson Caterers is a preferred caterer for williamson restaurant venues and historic locations throughout the region. We also bring our services to your home, place of worship, office, school or any unique location you may find.

  9. On the off chance that you continually end up mishandling through every one of your article Accounting Homework Help papers, at that point having our administrations will take the heap off your shoulders impressively. A particularly brilliant article. Your blog is incredible. On the off chance that you need to peruse intriguing articles on instructive themes.

  10. Hello. Your article is great. I am very happy to visit interesting blogs. I started using article writing services. I know I can get any help.