Render but where and when?

Render but where and when?

NextJS rendering

I've learned about NextJS rendering, therefore, this is my next public learning log, as well as this, is a crucial part of the framework. Just let's make it clear - this writing is not a tutorial just my log hence I don't deep dive into this topic.....just scratching the surface.

Static Site Generation (SSG)

With NextJS we can pre-generate our site which is built with React components in build time. It means the NextJS takes our JS code and transform it into HTML before any request.

Client-side Rendering (CSR)

Oh, it is an interesting one. We write a backbone HTML and attach a JS that manipulates the DOM. Actually, It builds the whole site after delivering it to the browser.

Server-side Rendering (SSR)

I like this concept but I can not tell why. Maybe, I think it's funny (yep...I know it - strange). So, the HTML is transformed from JS in this way, too and it is done on the server like SSG but not in build time but in each request.

Conclusion

The point is we generate HTML from JavaScript (React in this case) and the question is where and when. We do this on the server whit SSG and SSR and the client with CSR. It happens before everything with SSG (pre-rendering) and on the fly with CSR and SSR.

Thanks' for reading :)