130 likes | 302 Views
Michael Robertson Yuta Takayama. Google Closure Tools. * Google Closure Tools are open source versions of tools used in many of Google's sites and web applications. * These tools include: * JavaScript optimizer (Closure Compiler) * Comprehensive JavaScript library (Closure Library)
E N D
Michael Robertson Yuta Takayama Google Closure Tools
* Google Closure Tools are open source versions of tools used in many of Google's sites and web applications. * These tools include: * JavaScript optimizer (Closure Compiler) * Comprehensive JavaScript library (Closure Library) * Templating system for Java and JavaScript (Closure Templates) * JavaScript style checker/fixer (Closure Linter) * Enhanced stylesheet language (Closure Stylesheets) * Can each be used individually or altogether
Closure Compiler * Compiles JavaScript into compact and high-performance code * Checks syntax, variable references, and types plus warns against common problems * Removes dead code and rewrites and minimizes the rest * Reduces the size of the JavaScript files by making them more efficient leading to faster loads and less bandwidth needs
Closure Compiler * Works only on files that contain only JavaScript (not embedded in HTML) * Can use closure compiler with other JavaScript minifiers * Available for all platforms that run Java (compiler is written in Java)
Closure Library * Cross-browser and server-agnostic JavaScript library * Large number of reusable UI widgets and controls * Base JavaScript library for many Google products such as: * Gmail * Maps * Docs * Google+ * and more...
Closure Templates * Client- and server-side templating system to build reusable HTML and UI elements * Simple syntax and customizable * Small components that can be composed to form the UI * Implemented for both Java and JavaScript * Works well in any web application environment to be used with any other libraries, frameworks, or other tools * Used in Gmail and Google Docs
* Secure - Closure Templates are contextually auto-escaped to reduce the risk of XSS * XSS - “Cross-site scripting” * Type of insecurity vulnerability that enables attackers to inject client-side script into Web pages viewed by other users Closure Templates
Closure Linter * Utility that checks JavaScript files for style issues such as operator placement, missing semicolons, spacing, the presence of JsDoc annotations, and more * Used on Gmail, Google Docs, and other Google products * Enforces the guidelines set in the Google JavaScript Style Guide * Can automatically fix common errors
Closure Stylesheets * Supports a number Google extensions to the standard CSS language → Can define and use variables, functions, conditionals, and mixins in your stylesheet * Stylesheets are more readable and maintainable * An included tool can compile the stylesheet down into standard CSS and supports minification, linting, directionality (right-to-left flipping), and class renaming
https://developers.google.com/closure/ For More Information