glenjamin / ultimate-hot-reloading-example

Hot reload all the things!
963 stars 93 forks source link

Flash of style on start up #15

Open donaldpipowitch opened 8 years ago

donaldpipowitch commented 8 years ago

When opening the app the app is initially unstyled, because the styles will be injected asynchronous. It would be nice to get rid of that.

glenjamin commented 8 years ago

I'm not aware of a good way to do this.

The production build would use extract text plugin to load styles early, but I don't think there's a way to do this and still have CSS in the bundle hot reloaded

donaldpipowitch commented 8 years ago

Maybe you could use the extract text plugin for development, too, and handle reloading of CSS just with a classic livereload server.

glenjamin commented 8 years ago

That sounds like it could work

kale1d0code commented 7 years ago

Hi don't know if you guys have come across this? https://github.com/HumbleSpark/react-ssr-critical-styles this should sort out above the fold css

namnm commented 7 years ago

We can achieve this using jsdom-global package. We will add global dom environment into Node. Every time we prepare html to return, we can add the style tags into that html from jsdom-global. I will make some tweaks and see if it works.

gajus commented 7 years ago

Or you could have a look at https://github.com/gajus/usus.