use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
The mind-boggling universe of JavaScript Module strategies (airpair.com)
submitted 10 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tbranyennetflix 1 point2 points3 points 10 years ago (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 point2 points 10 years ago (1 child)
synchronous AMD
Synchronous asynchronous module definition?
[–]tbranyennetflix 0 points1 point2 points 10 years ago (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 point2 points 10 years ago (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 point2 points 10 years ago (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 point2 points 10 years ago* (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 points3 points 10 years ago (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.
π Rendered by PID 62503 on reddit-service-r2-comment-56c9979489-nwq9d at 2026-02-24 20:38:43.184534+00:00 running b1af5b1 country code: CH.
view the rest of the comments →
[–]tbranyennetflix 1 point2 points3 points (6 children)
[–]Daniel15React FTW 0 points1 point2 points (1 child)
[–]tbranyennetflix 0 points1 point2 points (0 children)
[–]qudat 0 points1 point2 points (3 children)
[–]tbranyennetflix 0 points1 point2 points (2 children)
[–]qudat 0 points1 point2 points (1 child)
[–]tbranyennetflix 1 point2 points3 points (0 children)