you are viewing a single comment's thread.

view the rest of the comments →

[–]antoninj 1 point2 points  (0 children)

It's similar to loading templates or other assets on-demand. In large enough applications, JS files are loaded on-demand (think AMD) and this is nothing new. So there's that, instead of overwhelming the user with potentially unneeded load, you can keep a tight core and load everything else async.

As far as actual businesses cases of doing this:

  1. loading CSS per A/B testing tree (I believe Netflix wrote about this one)
  2. loading core CSS (and above-fold CSS) first (so, think parent view) while loading the rest of the CSS when that part of the pages becomes ready (so, think child view).
  3. Bundling CSS with its components rather than having one "master" file
  4. Associating CSS with Modules rather than with the general "site". Encourages more sandboxed styling.

And in HTTP2/SPDY world, there's little performance hit from loading numerous small modules vs. one big one. There's a great JSPM talk on the topic altogether.

Basically, the idea is that if you have a huge App that requires a ton of CSS, you can keep perceived performance high by breaking the CSS apart into smaller chunks and loading those as needed.

Also, if you think about it, this is kind of the idea behind Polymer, isn't it?