a Web Application • Design by using Closure Library widgets • Build and compress the JavaScript codes (deployment) • Extend Closure Libraries • Q. & A.
build the UI of applications. • Hide the cross-browser issues • Object (prototype)-oriented Design • Closure Compiler • Analysis and optimize the JavaScript code • Compress the size of code • Closure Template • Used to build HTML template (dynamic content) • Building template by either JavaScript or Java. • Closure Linter • A JavaScript code style checker • Guideline is Google JavaScript Style Guide
JavaScript code, and render it on a DOM element. • Decorate: Use HTML to construct the structure of the component, and then, `decorate` (bind) it in JavaScript. <div id="namelist" class="goog-menu"> <div class="goog-menuitem">Alice</div> <div class="goog-menuitem">Bob</div> <div class="goog-menuitem">Charles</div> </div> HTML mockup: Decorate in JavaScript: var menu = new goog.ui.Menu(); menu.decorate(goog.dom.getElement('namelist'));
Your application doesn’t use every JavaScript code • Load dependencies every time the application executes may increase the application’s response time => poor experience • Use Closure Builder to calculate dependencies... • Extract necessary JavaScript files • Compress these JavaScript files into ONE JavaScript file