3 ms·
I don't know about you, but "cookies, querystring parameters, server-side sessions, and form submissions" to me are an order of magnitude simpler, though dated
by 1_player 6y ago
I don't know about you, but "cookies, querystring parameters, server-side sessions, and form submissions" to me are an order of magnitude simpler, though dated and not very flexible, than any modern JS client-side state and persistency layer.
- snowl 6y agoSee: mobx
- ebiester 6y agoForm submissions are brutally bad the moment a back button comes in. I remember so many "The client used the back button in a multi-page form and part of the form disappeared for them" bugs.
- 1_player 6y agoThey're not if coded correctly and using the correct redirect/HTTP response code.
- exclusiv 6y agoYes. You redirect after POST.
- ebiester 6y agoYeah. I remember dozens of edge cases that involved errors and back buttons and flash scope and on at least one occasion, jquery plugins. Or back buttons and CSRF tokens and flash scope... Or, let's talk about a common use case. Someone starts filling in a form, and then they need to look at another page to get more information. (This other page may take too long to load and isn't worth putting in the workflow, or it was cut from scope to place the information twice.) So, they go out to another page, then back, and are flustered because they were part way through the work. So, if you want this to work, you're going to need state management in the client anyway. (Usually using SessionStorage these days, I'd presume?) So, then, we've already done part of the work for state management. You are then playing the "which is right, the server or the client" game. You accumulate enough edge cases and UX tweaks, and you're half way down the SPA requirements anyway. Now, hopefully Hotwire will solve a large number of these problems. I'm going to play with it, but the SPA approaches have solved so many of the edge cases via code and patterns.
- webmaven 6y ago> but the SPA approaches have solved so many of the edge cases via code and patterns. Part of the problem has also been ameliorated by larger screens and browser tabs.