Enabling Closure Compiler.

What is Closure Compiler?

The Closure Compiler (CC) is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls.

Why use closure compiler?

Without Closure Compiler we experience spontaneous failures of Mobile Safari the stack-traces of which lead deeper into JavaScriptCore. It also squeezes the output JS significantly doing similar job a GWT compiler. With CC enabled the app loads faster and works smoother.

How to enable Closure Compiler?

All that is required to enable CC for GWT compilation is to build magnolia_ui project with Maven with a gwt-compile-production profile enabled. The profile is auto-enabled for the builds where BUILD_NUMBER property is specified (set by Hudson). Note that GWT compilation with CC enabled takes much longer time than usual.

  • No labels