News for hackers. Stuff that matters.
Re:Converting an existing Backbone.js project to Require.js by possibilistic on Sunday August 25, 2013 @04:16PM (#6273520)
Perhaps someone can clue me in, because I'm still at a loss for why there's so much hype built around Require.js.

I develop JS primarily for the frontend, and I use Grunt, a global namespace, and concat (or similar tooling) to piece things together.

Doesn't r.js execute dependency resolution code at run time? Can all references to r.js be fully compiled out? Even a wrapper like Almond seems to leave behind this kind of extra cruft. I don't want any dependency resolution code in the production build, because that's a problem that needs to be solved at compile time.

Re:Converting an existing Backbone.js project to Require.js by jafaku on Sunday August 25, 2013 @05:53PM (#6273874)
I was thinking the same thing. Why would anyone want this?
Re:Converting an existing Backbone.js project to Require.js by codeonfire on Wednesday August 28, 2013 @01:25AM (#6288172)
Because it's more costly to maintain 10000 line javascript files, you can start to reuse code at something smaller than the package level, you can have better cohesion and less coupling.

The god-file approach to development leads to things like lots of search and replace when something needs renamed, name collision, and duplicated utility code everywhere.

Re:Converting an existing Backbone.js project to Require.js by jafaku on Thursday August 29, 2013 @04:02AM (#6294774)
Wtf, who said anything about a 10k LoC js file?

"possibilistic" said dependency resolution must be done at compile time:

> I don't want any dependency resolution code in the production build, because that's a problem that needs to be solved at compile time.

Re:Converting an existing Backbone.js project to Require.js by codeonfire on Sunday September 01, 2013 @10:41AM (#6310545)
The tool that is mentioned, grunt, appears to resolve dependencies at the package level, not at the module/file level. Dependencies at the package level with no module level resolution tend to cause very large source files because no one is going to make a new package for each unit of code.