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:

// ADD YOUR CODE HERE
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.

23 comments:

  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

    ReplyDelete
  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

    ReplyDelete
  3. Such a wonderful article. Your blog is great. If you want to read interestingarticles on educational topic, you have to visit a site https://exclusive-paper.net/essays/free-speech-examples/gender-discrimination-persuasive-speech-outline.php.

    ReplyDelete
  4. 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.

    ReplyDelete
  5. 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.

    ReplyDelete
  6. 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.

    ReplyDelete
  7. 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.

    ReplyDelete
  8. 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.

    ReplyDelete
  9. 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.

    ReplyDelete
  10. Prolific Studio as an Animation Company offers a wide and extensive range of animated video production services with creative ideas and flawless designs in competitive prices make an animated logo and affordable packages. We focus on delivering quality animations.

    ReplyDelete
  11. BangJackets is serving several customers currently. Our customer products range from Hikers, climbers, skiers, snowboarders, bikers to mountaineers’ jackets, russell crowe real leather jacket mens and many other categories both in males and females. BangJackets cooperate with the premium courier services working internationally across the globe to bring you the best and efficient shipping and delivery solutions.

    ReplyDelete
  12. This challenge blog is something interesting and unique . Do u know how to write a 1200 word essay as for me this is also a little chalenge ?

    ReplyDelete
  13. This website was... how do you say it? Relevant!! I finally found something that helped me. If you are flying to your destination and transiting through Turkey, you will need to obtain a visa transit Turkey. This visa allows you to travel through Turkey.

    ReplyDelete
  14. We specialize in providing ecommerce business license, consultancy & services based company license and trading license services in Freelance visa Ajman. We also offer Freelance Visa ajman services company in Dubai.

    ReplyDelete
  15. Chase My Cloud is the leading online vape shop in Pakistan, providing uwell online vape shop and other best vape flavours in Pakistan. Buy online vape from best vape shop in Pakistan.

    ReplyDelete
  16. Shoppingalleria is the top online shopping store in karachi providing beauty care products, mobile gadgets kitchen home items online and kids accessories and schools kids items, buy home and kitchen accessories in karachi

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. This is often this kind of an incredible resource that you are providing as well as you give it absent without having Charge. I actually like looking at web page which have an idea of the worth of presenting a top quality source without paying a dime.สล็อตออนไลน์

    ReplyDelete
  19. Thank you for the great article.If you are getting errited in blocking sites then you can check our article about Node Unblocker this article helps you how to access a restricted site.

    ReplyDelete
  20. Thank you for sharing such an excellent post. Keep posting! https://goo.gl/maps/KJPuMZ1fFNyTSm1F6

    ReplyDelete