top | item 41110868

(no title)

peterhunt | 1 year ago

The main benefit is the flexibility to seamlessly move this logic from server to client and vice versa without rewriting all of your code.

Purely server rendered apps tend to have much slower interactions and exhibit weird behaviors so it is valuable to be able to do some stuff on the client.

discuss

order

timr|1 year ago

This is a straw man. There's no such thing as a "purely server rendered app", and never has been (except maybe in the pre-JS days of the internet). At the end of the day, all webpages are produced by a server, and rendered by a client.

The only reason that server-rendered apps are "slower" is because people don't think about what they're doing, and leap right to 100% client-side rendering. Very few things actually need the latency guarantees of client-side rendering.

timw4mail|1 year ago

And when you have to go to the server to get data, it's often slow with a client-side 'app' anyway.

The client-side part doesn't make data transfer any faster.

peterhunt|1 year ago

Calling this argument a strawman is pretty dismissive and is not a technical arugment. There are lots of client side interactions that do not need to be blocked on data from the server. Popup menus, modals, collapsible lists, rich text editing etc.

Also think about what actually has to happen when you interact with a server rendered app vs a client rendered app. Once the client app is booted you don't have to pay network latency, html parsing, FOUC etc on every interaction as you would with a server rendered app.