Showing posts with label AMD. Show all posts
Showing posts with label AMD. Show all posts

Friday, 18 January 2013

JavaScript: AMD module dependency analysis with the Java Rhino engine

The Asynchronous Module Definition (AMD) API provides powerful modularization options to JavaScript developers. But this introduces its own problems when it comes to dependency management. As this post demonstrates, Mozilla's Rhino engine offers developers a means to analyze these dependencies.

Saturday, 26 May 2012

Dojo: adding your own loader plugins

define(["dojo/text!./path/some.txt"], function(textData) {

Dojo's AMD loader has some useful contextual loading features. Note the exclamation mark in the dependency. dojo/text! can be used to load character data; dojo/has! can be used to load different modules based on environment.

Writing your own plugin is relatively trivial.

Saturday, 7 April 2012

Dojo: mocking dependencies with DOH

This post demonstrates a way to use the Dojo 1.7 AMD loader to provide mock/stub/fake/dummy artefacts in place of the defined dependencies.

Wednesday, 4 April 2012

Dojo: version 1.7 and the AMD loader

Along with a few other JavaScript libraries, Dojo is making the transition to the Asynchronous Module Definition (AMD) API. This post presents a few minimal files written to make use of it.