Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Register as AMD module, but still export a global #431
This is in response to this commit, which came out of reports of issues using underscore in an AMD environment.
From what I have heard, the issues are mainly when trying to also use backbone. Those issues could be resolved by merging this pull request.
But in general, if underscore prefers to not get reports of issues with an AMD loader, this pull request also exports a global even if define() is available. This is the same approach that jQuery uses. Ideally this would not be needed, but modular development is just getting bootstrapped on the web, and during this bootstrap period, this approach avoids issues.
If pull requests are not the way you prefer to have this conversation, please let me know what avenue works best.
Thanks for the pull request, but I'm afraid that I've been mulling over this issue since the original AMD commit, and have pretty well decided on yanking it.
Since the original AMD addition, I think that the volume of confused users trying to load Underscore correctly has only increased. There have been any number of things: