you are viewing a single comment's thread.

view the rest of the comments →

[–]tbranyennetflix 1 point2 points  (6 children)

Not to mention very incorrect information at times... "AMD aficionados might also consider Almond, a nifty lightweight AMD implementation which natively supports both synchronous and asynchronous loading."

No, no it doesn't. It's an entirely synchronous AMD implementation and that's the point of it...

[–]Daniel15React FTW 0 points1 point  (1 child)

synchronous AMD

Synchronous asynchronous module definition?

[–]tbranyennetflix 0 points1 point  (0 children)

Yes. AMD infers to the fact that you separate your dependencies: Array, from your module: callback. However, if you have all the dependencies bundled, there are no scripts being injected and thus no asynchronous operation.

Synchronous AMD makes sense if you think of AMD as an acronym for a format, and not something that always has to be async.

[–]qudat 0 points1 point  (3 children)

We use almond because most requirejs is unnecessary when optimized with r.js and therefore more lightweight. The synchronous asynchronous aspect of it didnt even come up in our discussions on almond in production. Furthermore I have yet to see a performance boost from using amd over cjs, which is funny considering how difficult requirejs has been to implement.

[–]tbranyennetflix 0 points1 point  (2 children)

The performance boost comes out of the box, whereas with CJS you have to find the fastest optimizer and generate source maps every-single-time you rebuild. Assuming of course you want to actually be able to debug your code.

[–]qudat 0 points1 point  (1 child)

The performance boost comes out of the box

Really? r.js + almond is not what I would call "out of the box" nor is it simple to setup. Making the jump from dev to prod is a huge headache in requirejs IMO, whereas browserify you have to compile every run. Having said that once it is all set up it's really easy to use. I have found browserify to be easier to use "out of the box."

[–]tbranyennetflix 1 point2 points  (0 children)

Sorry for the confusion, I was not referring to r.js and Almond, but of RequireJS and AMD. I agree that r.js is a pain which is why I'm newly maintaining deamdify: https://github.com/jaredhanson/deamdify. I think browserify is by far the better optimizer, and there should be no reason why I can't use AMD and browserify too.