Skip to content
Chuck Dumont edited this page Aug 21, 2015 · 67 revisions

The purpose of this wiki is to provide useful information about the JavaScript Aggregator project. The JavaScript Aggregator (or, throughout this wiki, the Aggregator) is an OSGi servlet that provides aggregation and code minification services to an AMD loader that supports the loader extension API. At the time of this writing, the Dojo loader in Dojo 1.7.3 and greater supports this API, and Dojo 1.7.1 or 1.7.2 may be used with this patch http://bugs.dojotoolkit.org/ticket/14198.

AMD stands for Asynchronous Module Definition. The AMD API specifies a mechanism for defining modules such that the module and its dependencies can be asynchronously loaded. Organizing JavaScript code into modules aids development by promoting modularization and code reuse, but can result in an excessive number of requests, impacting the performance of web applications.

There are two general approaches to resolving this problem:

  • Static layer builds - collections of minified and aggregated modules organized into pre-defined layers that are defined by developers
  • On-demand module aggregation and minification performed by some server-side process

The JavaScript Aggregator is an instance of the later approach. It utilizes a client-side component that hooks into extensions provided by an AMD loader in order to collect and combine requests for multiple modules into a single HTTP request/response. In addition to module aggregation, the Aggregator also provides:

##Extensibility

The Aggregator supports extensibility through the eclipse extension registry which is supported by the OSGi framework. Four extension points are provided. They are:

Transparency

A major design goal for the project is that it's use is transparent to the application. This means that the Aggregator does not impose any coding requirements or provide any API for use by the client application (other than requiring a loader config property). If your application is written to use an AMD loader, and that loader supports the loader extension API, then you may start using the Aggregator by providing a bit of config information and loading the script that contains the loader extension code. And you can easily switch between using, or not using, the Aggregator simply by choosing whether or not to load the loader extension code.

Downloading

Binaries may be downloaded from the project page on OpenNTF

Table of Contents

You can’t perform that action at this time.