We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Faster, smaller, better: Compiling your application together with OpenLayers 3

Formal Metadata

Title
Faster, smaller, better: Compiling your application together with OpenLayers 3
Title of Series
Part Number
144
Number of Parts
193
Author
Contributors
License
CC Attribution 3.0 Germany:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date2016
LanguageEnglish

Content Metadata

Subject Area
Genre
Abstract
OpenLayers 3 uses the Closure Compiler to compile JavaScript to better JavaScript. Developed by Google, the Closure Compiler is more than just a code minifier. Variable and function names are not only shortened, based on static code analysis a number of optimizations are applied, like dead-code removal or function inlining. Of special interest is the type checking and a syntax check which allows to detect errors at an early stage which otherwise would only emerge during runtime. You can use OpenLayers 3 without getting in touch with the Closure Compiler. But once you compile your application together with OpenLayers, you will benefit from a few interesting advantages. First, because the compiler removes unused code, only that part of OpenLayers that is actually used in your application, will be included in the build. Because only a fraction of the extensive functionality of OpenLayer is often required, the build size can be reduced considerably which results in faster loading times. The compilation of your application together with OpenLayers also makes it easier to extend OpenLayers with custom components. Notably, the application code is also analyzed and checked by the Closure Compiler, so that you benefit for example from the type checking. This talk introduces the Closure Compiler, which offers a robust platform for the development of complex web-mapping applications with OpenLayers. Advantages, special characteristics and experiences from own projects will be presented. Tobias Sauerwein (Camptocamp) Beraudo Guillaume (Camptocamp)
Keywords