require.js Isn’t Too Bad after All

I remember working with require.js a while ago in conjunction with Backbone. I stumbled upon it in some tutorial that used it, so I used it as well, not really knowing why.

What I remember is, that the experience was pretty unpleasant, mainly because I spent a lot of time looking for forks of the libraries I wanted to use and then spending even more time when new versions were available. (I also remember a lot of strange errors…)

One year passed.

Turns out require has addressed this issue since then with something called shim (why is it called like that?). It allows you to turn any JS library into a require module, like this: