starlightprivate / flash2

nodejs app
0 stars 0 forks source link

Feature/async css load #169

Open asharma-ror opened 7 years ago

asharma-ror commented 7 years ago

This change is Reviewable

luckyluke317 commented 7 years ago

pick something quickly - merge this if it's bug free

asharma-ror commented 7 years ago

@sledderGIT

As discussed with you in PM async CSS loading itself means that other things like HTML or JS will not wait for CSS to be loaded. Async CSS has this downside that user will see HTML page without styles until the CSS are loaded.

Solution to avoid this is to add some critical CSSes in HEAD of page so that the page does not look bad till complete CSS is loaded.

I have tried the loadCSS and its not the true asynchronous way to load CSS. https://github.com/filamentgroup/loadCSS/blob/master/src/loadCSS.js That is why I have implemented our own solution using XMLHTTP request solution. And this will let browsers fetch CSS, JS in parallel increasing the page load speed.

I am keeping this low priority as for today I guess we have other things on priority.

luckyluke317 commented 7 years ago

lets merge and see the results?