News for hackers. Stuff that matters.
Re:Are JS loaders snakeoil? by jpadvo on Wednesday August 10, 2011 @02:11PM (#2869442)
This misses the main point of javascript loaders. The idea is that you take all the scripts that are not essential for immediately rendering the page, and tell the browser that it is okay to render the page before those scripts are loaded. The point is not for those scripts to load faster -- it is to let the user see a rendered page faster.

For example, third party javascript files for social media sharing and liking buttons often take a miserable amount of time to load. Bringing them in asynchronously can dramatically improve the user experience of a site because the user doesn't have to wait for them to load before seeing the real content.

A similar reason is part of why tables are a bad layout strategy for content in HTML. Back in the day, some (all?) browsers would not render a table until everything in it had loaded. So if you put your entire page in a table, and that table had a big image, the image would block the rendering ofthe page.

That is what javascript loaders are about. Non-blocking loading of not-immediately-required resources.

Re:Are JS loaders snakeoil? by zoips on Wednesday August 10, 2011 @02:18PM (#2869475)
I think that misses the point of useful loaders like RequireJS or Dojo's loader. The point of those to enable developers to actually design a modular system with well thought out and declared dependencies. Without them you end up designing a system that is wholly dependent on global namespace pollution and undeclared dependencies. The fact that you get async load is almost entirely irrelevant and focusing on it screams of premature optimization (aka fail).
Re:Are JS loaders snakeoil? by benatkin on Wednesday August 10, 2011 @02:33PM (#2869540)
Those don't need to even be script loaders. Stitch and Browserify do the module stuff just by concatenating them into a script.

They can just be module loaders or module systems.

Re:Are JS loaders snakeoil? by jpadvo on Wednesday August 10, 2011 @03:33PM (#2869809)
I guess saying "main point" was an unnecessary value statement. Different applications will find different aspects of loaders useful.

I should have said that discussion missed the point(s) of script loaders...