Unfortunately that is really just a syntactic alternative to script
tags suffering from the same need for manual dependency management.
for example:
jingo.init({
repos: {
main:'./'
},
inc: {
jqueryui: '
https://ajax.googleapis.com/ajax/libs/jqueryui/
1.8.16/jquery-ui.min.js'.
jquery: '
http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/
jquery.min.js',
underscore: './js/underscore/underscore.js'
}
});
This is broken because I've "included" jqueryui before its dependency
jquery. I could fix it by reordering them, but that isn't any closer
to dependency management than managing the script tags myself.
The reason this fails is that jqueryui file doesn't define its own
dependencies "except in its project documentation". Neither do jquery
or underscore but they get away with it because they don't have any
dependencies. Through the trivial exercise of wrapping these in jingo
module envelopes I get to say goodbye to manual dependency
management. If I don't want to do that I can manage them myself via
script tags. There is certainly nothing wrong with that approach
particularly if you want to load them from google's CDN.