News for hackers. Stuff that matters.
Re:RequireJS 2.0 draft by combataircraft on Tuesday May 01, 2012 @01:21PM (#3915403)
RequireJS is very expensive and it's NOT CommonJS. It claims that CommonJS is not-optimal for browser and offers you to put your source code inside of an awkward container for optimizing. It's not smart.

Let me introduce you OneJS: http://github.com/azer/onejs

It simply converts any CommonJS package into a single, stand-alone JavaScript file. It means, you can structure your client-side project just like a NodeJS project and you can convert your NodeJS project to a single file just like a client-side project.

Unlike Browserify, OneJS is unobtrusive [1], provides an accurate implementation of CommonJS specs [2] and the output it produces is suitable for splitting and having async dependencies.

[1] A chess website built with OneJS: http://multiplayerchess.com/mpc.js

[2] ExpressJS built with OneJS, with all dependencies: https://gist.github.com/2415048

Re:RequireJS 2.0 draft by stephan83 on Tuesday May 01, 2012 @01:52PM (#3915561)
That looks cool, will look into it. Does it support the http node core module, like browserify?
Re:RequireJS 2.0 draft by combataircraft on Tuesday May 01, 2012 @04:23PM (#3916221)
Here are the core modules it supports; http://news.ycombinator.com/item?id=3915403

browserify-http can be used by OneJS as well but I don't see any point of emulating http module on client-side. I prefer using libraries supporting both platforms, such as boxcars; http://github.com/azer/boxcars