strues / react-universal-boiler

A bold way to begin your next great universal React application. Uses Webpack 3, React 16, Redux, and more for a great developer experience.
MIT License
65 stars 11 forks source link

jumping css while rendering the page in production #16

Closed rolele closed 7 years ago

rolele commented 7 years ago

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?

rolele commented 7 years ago

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?

strues commented 7 years ago

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.

rolele commented 7 years ago

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.

strues commented 7 years ago

@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
rolele commented 7 years ago

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.

rolele commented 7 years ago

Any news on this one?

strues commented 7 years ago

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

otmjka commented 7 years ago

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

otmjka commented 7 years ago

@strues thanks for awesome boilerplate!