John Barton (2014-01-27T23:14:30.000Z)
domenic at domenicdenicola.com (2014-01-31T14:44:03.328Z)
Guy Bedford, based on experiences within the requirejs and commonjs worlds, has a much better solution for these scenarios. (It's also similar to how npm works). Your jQuery should depend upon the name X, but you Loader should map the name X when loaded by jQuery to the new version in Loader.normalize(). The table of name mappings can be configured at run time. For example, if some other code depends on X at 1.6 and jQuery needs X at 1.7, they each load exactly the version they need because the normalized module names embed the version number. This is the proper solution, not one based on overwriting the module registry. To be sure, because of the overhead loading code on slow networks these kinds of multi-version scenarios are less attractive in the browser, but the fix is the adapt the code. Guy's project has a bit more: https://github.com/guybedford/systemjs