14
votes

Bit of an abstract question, but I'm surprised I'm not finding it already:

Now that Dojo has gone all AMD with 1.7, How does it compare to RequireJS, Lab, Head, etc...

Edit: I realize lab and head aren't AMD loaders. To clarify:

I'm liking how Dojo is splitting it's core out into small, concise, single-purpose modules. (I'd assume these module would work with any AMD loader now, though I haven't tested that) This leaves dojo.js itself barely more than an AMD loader.

So the question is: As an AMD loader, how does Dojo stack up. In terms of how well if follows the spec, speed, size, efficiency, whatever. It's the new kid in a very heated topic it seems, but I've heard surprisingly little about it.

1
Great question... I've yet to see performance data. It would also be interesting to compare them based on their various optimization tools. FWIW, requirejs was the work of @jrburke, a Dojo committer who did some excellent work on the original loader and cross-domain module loading. AMD was sort of the next generation loader for Dojo. In my experience, cross-loader compatibility isn't all that good yet. There are some things that may need to be nailed down in the spec, such as the behavior of the immediate require() call, also inconsistencies in how plugin modules are handled. - peller

1 Answers

9
votes

4 different things.

Dojo is a toolkit which has been converted to use AMD and ships with an implementation of an AMD loader and optimization tools. requirejs is a loader which also implements AMD and may be used with various toolkits (Dojo support is still lacking) There are some other AMD implementations like curl.js. I don't believe lab.js or head.js implement AMD

If you're asking how the AMD implementations differ or how consistent the spec is... excellent question. If you're asking about the pros and cons of an AMD implementation vs non-AMD, that requires a different matrix. One such comparison can be found on SO.