Thursday, July 14th, 2005

Dojo Package System Explained

Category: Dojo, Editorial

The Dojo Toolkit is a very mature piece of JavaScript. One of the interesting pieces is the package system which has been explained by Dylan Schiemann

The packaging system allows you to list a single script include file, which will then find and fetch packages as they are needed for your application, from the Dojo source tree. This means in the simplest case, no build process is required, and yet there is no need to include a script tag for every script file that is to be loaded.

Additionally, the packaging system allows for the creation of a compressed package file that contains all of the script code needed for your app, no more, and no less, through an Ant build step.

If you have ever seen a ton of <script …> tags in your pages, or wished for a rich packaging system, then you will grok the need.

Posted by Dion Almaer at 12:45 am
1 Comment

+++--
3.5 rating from 12 votes

1 Comment »

Comments feed

I think we’ll be seeing a lot more lazy loading of JS. Cameron Shorter – Mapbuilder lead – recently pointed out how Mapbuilder does something similar to load widgets on demand…

http://mapbuilder.sourceforge.net/mapbuilder/docs/design/index.html#mapbuilder

The Mapbuilder object is responsible for loading and initialising required script files. The scripts required is determined from the Config file. The Mapbuilder object loads the scripts in order of dependency, periodically checking the load status. When all scripts have loaded, the javascript objects are initialised which triggers the rendering of widgets.

Comment by Michael Mahemoff — July 14, 2005

Leave a comment

You must be logged in to post a comment.