Why has Underscore.js removed AMD support?

1.3.0 - January 11, 2012 Removed AMD (RequireJS) support from Underscore. If you want to use Underscore with RequireJS, you can download it as a regular script, wrap or fix your copy, or download the forked version.

Why would they do that? Somebody knows? Since they added it just a few months ago (in October), and AMD (asynchronous module definition) is said to be far superior to CommonJS modules.

Update: as of December 2013, this was confirmed again.

+65
javascript requirejs js-amd
Jan 25 2018-12-12T00:
source share
4 answers

Jeremy gave his arguments in the comments of the command :

Yeah. Not supporting a specific script loader will certainly facilitate the work of all users.

I apologize for pooling support in the first place.

He also tweeted a little more about the change (link from a later comment ):

... because AMD support disrupts regular Underscore being embedded on pages that also use Require.js ...

+56
Jan 25 2018-12-12T00:
source share

Underscore developers thought that AMD support might break support for non-AMD scripts. This is actually not the case, as you may have a script that supports AMD, but also works as a deployment without AMD.

Now there is a replacement for Underscore: Lo-Dash . Which, along with other features not included in Underscore, includes dual AMD / non AMD.

+30
Jul 22 2018-12-12T00:
source share

I felt the need to add to this rather old question.

Both Backbone and Underscore now support AMD :

Discussions (although the basic one is a little puzzling, as there is a clear discrepancy between the tone of the discussion and the actual result):

+10
Dec 18 '13 at 2:40
source share

ES5-shim provides many functions such as underscore and lodash (array.forEach (), array.map (), etc.).

ES5-shim initially supports AMD , unlike underscore and lodash, it does not add additional copies of the things that your browser may already provide. Rather, it adds native ES5 features to older browsers.

When IE8 and other old browsers go extinct, you can simply remove the ES5-shim dependency without having to transcode the code, for example using lodash or underlining.

+1
Jan 16 '13 at 15:23
source share



All Articles