MetaScroll went through a major rewrite of the search client during the last weeks. I switched from using jQuery as the core JavaScript library to Google’s Closure Library.

The reason I chose Closure is the hope for a better overall performance due to less encapsulation, as well as a smaller footprint of the JavaScript Code.

The Google Closure Library allows one to pick the required modules according to one’s needs, quite similar to the import or require routines known from other languages like Java. The resulting client code is a lot larger than the “old” jQuery using version, due to the more explicit coding style of Closure. But this effect changes drastically after the compilation of the JavaScript source code using the Google Closure Compiler with its ADVANCED_OPTIMIZATIONS-setting: The compilation process reduces the size of the code base with all its dependencies from ~815kB to ~55kB! If you want to learn more about how the compiler achieves this reduction you can find a brief overview in the documentation. After all, the rewrite resulted in a size decrease of around 40kB, from ~95kB incl. jQuery to now ~55kB with Closure.

During the rewrite I also reworked some of the older parts of the code, to aid and increase the speed of future developments, which you will get to see quite soon! If you have an idea or feature wish as well, just let me know!