fazlulkarimweb / with-next-redux-wrapper-redux-persist

A counter app(or boilerplate) with next redux wrapper, redux persist and redux thunk for your NEXT JS website.
164 stars 38 forks source link

This config removes SSR data #5

Closed HamidTanhaei closed 4 years ago

HamidTanhaei commented 4 years ago

As we we know, most of the bleeding of using NextJS is using it's SSR feature to handle SEO. But this config removes data on start and shows a loading... of Redux persistor.

What is expected? Show real data instead of loading when you open a page at first.

fazlulkarimweb commented 4 years ago

As far as I know, the whole implementation doesn't hurt SEO in any form. If you are worried about rehydration, I can say that rehydration is a process and doesn't hurt SEO. The whole useSWR library is based on rehydration. Vercel is using rehydration features to build their whole sites. Besides, see my rendering screenshot under the "External API Call" section in the last part of the read me file. You can render SSR, SSG & Static HTML with this boilerplate. This is not an SSR only boilerplate.

I guess you are referring to the main author's comment about the usage of redux-persistor with next-redux-wrapper in SSR. That was not about SEO. He was saying that SSR is all about rendering in the server. Rehydration is against the whole idea of SSR. It's just an idea or rationale, not a huge red flag about SEO. I also agree with that notion. If you are saying that rehydration hurts SEO. That's a long discussion! Using SSR on pages that need to be crawled by Search Engine Sites is a bad design decision firstly. In my opinion, you have to use this superpower (SSR) where you have no other way. People use it generally in the auth protected pages where SEO is irrelevant! I can discuss this for hours. If I failed to explain properly, just take this lesson ... this boilerplate doesn't hurt SEO in any form. This boilerplate is SSR agnostic. It can render SSG and Static HTML too. Your SEO will be hurt if you take wrong design decisions lately!

samipshah100 commented 4 years ago

Hi @fazlulkarimweb do we still need to do this with this boilerplate? https://github.com/kirill-konshin/next-redux-wrapper#server-and-client-state-separation