strues/react-universal-boiler

jumping css while rendering the page in production

Closed this issue · 9 comments

yarn start
It start like this:

image

and it render like this:
image

This is a big issue I think. Do you have any idea what is the problem here?

It seems that the SSR is not doing all the work on the server-side.
Usually I can disable js on the client with SSR app and the app should render perfectly.
Here this is the result of disabling js (top right of the screenshot):
screen shot 2017-06-22 at 10 20 05 pm

The head tag is kind of empty.

If I re-enable js, refresh and wait 1 second:
screen shot 2017-06-22 at 10 22 16 pm
Now head include the inline style and the meta.

Do you know how to get the full SSR behavior with with boilerplate?

I see what you're saying. I'll need to play around with styled-components some more. What's going on is the stylesheet generated by styled-components isn't populating in the head with JS disabled.

but this work should be done on the ssr side right? yeah ssr make it a little more complicated.
I found this boilerplate that does exactly that on the redux-ssr branch:
https://github.com/diegohaz/arc
It looks very nice.

@rolele Nearly have a perfect implementation in place. Should be finished later this afternoon.
edit:
Much beter...

screen shot 2017-06-23 at 4 20 12 pm

that is a great news. I like this starter very much. and I like to know that it is the basis of your boldr repo ( so it is a proof that it scales) thanks for the good work. I will test that and study your commit as soon as it is done.

Any news on this one?

@rolele You should not have any more issues with css not loading properly when JS is disabled.

There is PR https://github.com/strues/react-universal-boiler/pull/18 where I've shown how to fix css jumping issue.

@strues thanks for awesome boilerplate!