Archive for June 2011
Notes from “Web Application Development with Closure Compiler” talk by Alan Leung on 6/22/11
Alan visited Twitter on 6/22 and presented an introductory talk on Google’s Closure compiler for JavaScript. Alan is tech lead on Closure team.
Here are the slides:
http://acleung.com/twitter_talk.pdf
Notes
* JavaScript was originally designed for small DOM operations. Now that we’re building large-scale apps in JS, we can use some help.
* Google uses Closure for all but a couple products
* The Closure compiler can perform ~55 optimization passes, including linting code, validating function definitions, performing gzip-optimized compression, trimming dead branches
* Closure can also provide compile-time constants, e.g., “if(INTERNAL){…”, and trim unused branches that result
* Closure uses a graph coloring heuristic for variable renaming
A nice button
input[type=submit] {
font-size: inherit;
padding: 0.5ex 1ex;
margin: 0;
border: 1px solid #ccc;
/* http://border-radius.com/ */
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
/* http://www.colorzilla.com/gradient-editor/ */
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #cccccc 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#cccccc 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#cccccc 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#cccccc 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #ffffff 0%,#cccccc 100%); /* W3C */
}