Re:We Fell Out of Love with Next.js and Back in Love with Ru...
by stavros on Saturday May 03, 2025 @05:20PM
(#43882416)
Right, but validation logic and state transferred by the server isn't in-memory state. The fact that the pages completely reload on each request clears a lot of cruft that doesn't get cleared on pages whose lifetime is tens or hundreds of views.
Re:We Fell Out of Love with Next.js and Back in Love with Ru...
by tomnipotent on Saturday May 03, 2025 @05:30PM
(#43882488)
Every SPA I come across, especially when using React, uses persistent state so that in-memory changes are synced to cookie/localStorage/server so they survive refreshes. Every popular state management library even supports this natively. And all of that state combined still requires less memory than any of the images loaded, or the JS bundles themselves.
Re:We Fell Out of Love with Next.js and Back in Love with Ru...
by actsasbuffoon on Saturday May 03, 2025 @06:17PM
(#43882823)
I absolutely loathe that. State is the source of most bugs. If the page crashes then refreshing it should clear out the state and let me try again.
Anecdotally, it seems like I encounter a lot more web apps these days where refreshing doesn’t reset the state, so it’s just broken unless I dig into dev tools and start clearing out additional browser state, or removing params from the URL.
Knock it off with all the damn state! Did we forget the most important lesson of functional programming; that state is the root of all evil?
Re:We Fell Out of Love with Next.js and Back in Love with Ru...
by SkepticalWhale on Saturday May 03, 2025 @08:15PM
(#43883417)
Minimizing state simplifies the codebase but it’s a trade off.
There are times the user experience is just objectively better with more state, and you have to weigh the costs.
If I am filling out a very long form (or even multi-page form) I don’t really want all that state lost if I accidentally refresh the page.
Re:We Fell Out of Love with Next.js and Back in Love with Ru...
by tomnipotent on Saturday May 03, 2025 @06:59PM
(#43883049)
I can remember vastly more instances where I've been frustrated as a user of an app or website by losing state, than remember state.
Every form also normally ends up duplicating validation logic both in JS for client-side pre-submit UX and server-side with whatever errors it returns for the JS to then also need to support and show to the user.