jrburke/backbone — comment on commit 57c2029117649452c6cf4d3337e03f5d52bb8331
File:  line 0
By jrburke:

Hi @jdalton. If your examples, Benchmark.js is closest to this use case since it has a dependency. However, Benchmark.js is different from Backbone in that Backbone needs one of its dependencies, underscore, to be available as part of its definition -- the dependency is used as part of setting up Backbone. So, it needs to be available as the main factory function for Backbone executes. The structure in this patch allows that, as well as allow AMD loaders to scan for that dependency and do proper dependency resolution and loading.

While comparing your examples with what I did in this patch, I did realize that "root" could be passed in instead of have the goofy var root before the define call, I fixed that in [this commit](https://github.com/jrburke/backbone/commit/786d4536c627cfa0ed10f51234ec2aae1d223e85).

If you have other more concrete suggestions, I am open to them, but so far this felt like the cleanest, least disruptive change to the main body of the Backbone definition and kept the bulk of the adapter boilerplate and checks at the bottom of the file.