News for hackers. Stuff that matters.
Re:Browser-require.js brings "require" to the browser (just ... by sjs on Monday January 31, 2011 @10:36AM (#2161747)
> When a module is required, we fetch it's javascript as a string using a synchronous XHR.
Re:Browser-require.js brings "require" to the browser (just ... by arthurschreiber on Monday January 31, 2011 @10:50AM (#2161826)
Obviously, that's meant for development only and that's why it also ships with it's own compiler for production (where I seriously hope they don't use a synchronous XHR to fetch the compiled code).
Re:Browser-require.js brings "require" to the browser (just ... by marcuswestin on Monday January 31, 2011 @10:52AM (#2161836)
no, it does not :)
Re:Browser-require.js brings "require" to the browser (just ... by scotth on Monday January 31, 2011 @10:40AM (#2161773)
Right. What need does this project meet?

Sounds like a great way to create a lousy user experience.

Re:Browser-require.js brings "require" to the browser (just ... by marcuswestin on Monday January 31, 2011 @10:51AM (#2161828)
The synchronous XHR requests are only used in your development environment. For production, use `node browser-require/compile.js`, which will compile all your required javascript modules into a single file. It really doesn't make sense to asynchronously request all of your javascript files on production pages.
Re:Browser-require.js brings "require" to the browser (just ... by slexaxton on Monday January 31, 2011 @11:55AM (#2162172)
Actually it makes a ton of sense to asynchronously require javascript files on your production page. If you load them asynchronously and in parallel, you can often get much better performance than one single request (serially).

http://blog.getify.com/2009/11/labjs-why-not-just-concat/