Ajax Blog


JS Linker in Dojo Toolkit

Posted in Ajax News by Dion Almaer on the August 31st, 2006

AOL has been very generous by donating code for the JS Linker for Dojo:

The JavaScript source code can be represented in different levels of granularity. The JavaScript Linker uses the Abstract Syntax Trees (ASTs) representation, which represents the lowest level of detail, to model the source code. One of the main task for this project was to write a JavaCC compatible grammar that strictly follows the ECMA Specification. JavaCC uses this grammar to build a custom parser than can read and analyze the JavaScript source, which in turn, is used to build the JavaScript Linker.

What this means to Alex Russell:

This is the holy grail of JavaScript optimization: removing “dead” code. Dojo already provides a package system to help prevent including too much and a build-time compressor to help reduce the size on the wire of what you do need, but the linker does all of this one better by analyzing the application and figuring out what functions are entirely unused.

JavaScript has some unique issues with packaging, and this will help Dojo coders out a lot.

Source: Ajaxian
Original Article: http://ajaxian.com/archives/js-linker-in-dojo-toolkit

Comments are closed.