2 ms·
> Also, we make Backbone, $ and _ globals so we don't have to inject them in every single module. We don't; we explicitly define every dependency, always, so t
by Cthulhu_ 14y ago
> Also, we make Backbone, $ and _ globals so we don't have to inject them in every single module.
We don't; we explicitly define every dependency, always, so that it does not make any assumptions about the environment it runs in (a webpage with jquery / underscore included via script tags, for example). Second, our end-product is a single .js with Backbone and some other dependencies all combined into it. (we're not allowed to use a CDN)
- paduc 14y agoThat sounds like a pretty good reason not to make those globals. We did it when we realized 100% of our modules had those three dependencies. Haven't found a drawback yet.