top | item 46139328

(no title)

heldrida | 2 months ago

Do you really need React Server Conponents or even Server Side Rendering?

discuss

order

henryfjordan|2 months ago

Before SSR (unless you were using PHP I guess) you had to ship a shell of a site with all the conditionals being decided only AFTER the browser has gotten all the HTML + JS pulled down. If you need to make any API calls, you've delayed rendering by hundreds of milliseconds or worse (round trip to your server)

With SSR, those round trips to the server could be down to single-digit milliseconds assuming your frontend server is in the same datacenter as your backend. Plus you send HTML that has actual content to be rendered right away.

A truly functional pageload can go from seconds to milliseconds, and you're transferring less data over the wire. Better all around at the expense of running a React Server instead of a static file host.

jazzypants|2 months ago

Thank you. It's disappointing that you have to say this on a website full of supposedly technically proficient people.

quentindanjou|2 months ago

It's very use-case dependent.

SSR can be a game-changer in domains like e-commerce. But completely useless for some other use case.

RSC advantages are a bit more complex to explain, because even a simple portfolio website would benefit from it. Contrary to the common belief created by long-term ReactJS dev, RSC simplifies a lot of the logic. Adapting existing code to RSC can be quite a mess and RSC is a big change of mindset for anybody used to ReactJS.

venturecruelty|2 months ago

Yes. Web applications were impossible before these libraries.

Levitating|2 months ago

If you truly believe that than we must really be moving backwards

jacquesm|2 months ago

No, they were not. They required a lot more round-trips to the server though, and rendering the results was a lot harder. But if you think of a browser as an intelligent terminal there is no reason why you couldn't run the application server side and display the UI locally, that's just a matter of defining some extra primitives. Graphical terminals were made first in the 60's or so.

gloosx|2 months ago

Of course you do, in certain cases making less round-trips to the server is just straight more efficient