I read a good chunk of the Hypermedia book and much of the argument is an appeal to authority around the fact that "real" REST design uses HATEOAS and well because Roy Fielding said so in 2000.
Yes, I get that duplicating state on the client and the server is a headache. But are people really doing that? You're just moving the state toward the client and keeping the backend much more thin. Are we going to ignore the past twenty or so years of CPU improvements? I'm not saying just yolo it and do loads of pointless expensive work on the client but 5G and modern phones should have some place in this calculus.
The latter half of your comment seems to assume that the primary reason for hateoas would be performance. I'm sure many people would make that argument, and I do think it makes sense even today, but that's not really why I'm into it.
I personally find consuming JSON APIs cumbersome and prone to errors. It seemed like a great idea when we first started doing it, but these days I'm keen to explore other options. I'm under no illusion that HTMX doesn't have it's own tradeoffs, but I like the return-to-tradition approach it's taking.
I can definitely get on board with that idea. It is indeed cumbersome dealing with some JSON api that you may or may not have written. The amount of boilerplate you must write in react just to fetch the freaking thing and do some work an display a result is rough compared to the same thing in django-htmx.
But we are talking mostly about developer-experience here and while that is great, it is a compromise compared to user experience. Getting a little delay for an ajax call on much many more interactions is a thing and its there. Maybe that makes sense for many but it should be noted just like deciding to write a react PWA instead of a fully native ios app is a tradeoff for developer experience (or a dozen other reasons) instead of user experience.
Getting a little delay for an ajax call on much many more interactions is a thing and its there.
HTMX has a preload extension which has fully eliminated these delays in my experience. YMMV of course but so far both my UX and DX are dramatically improved over what the previous SPA offered
Comments
I read a good chunk of the Hypermedia book and much of the argument is an appeal to authority around the fact that "real" REST design uses HATEOAS and well because Roy Fielding said so in 2000.
Yes, I get that duplicating state on the client and the server is a headache. But are people really doing that? You're just moving the state toward the client and keeping the backend much more thin. Are we going to ignore the past twenty or so years of CPU improvements? I'm not saying just yolo it and do loads of pointless expensive work on the client but 5G and modern phones should have some place in this calculus.
The latter half of your comment seems to assume that the primary reason for hateoas would be performance. I'm sure many people would make that argument, and I do think it makes sense even today, but that's not really why I'm into it.
I personally find consuming JSON APIs cumbersome and prone to errors. It seemed like a great idea when we first started doing it, but these days I'm keen to explore other options. I'm under no illusion that HTMX doesn't have it's own tradeoffs, but I like the return-to-tradition approach it's taking.
I can definitely get on board with that idea. It is indeed cumbersome dealing with some JSON api that you may or may not have written. The amount of boilerplate you must write in react just to fetch the freaking thing and do some work an display a result is rough compared to the same thing in django-htmx.
But we are talking mostly about developer-experience here and while that is great, it is a compromise compared to user experience. Getting a little delay for an ajax call on much many more interactions is a thing and its there. Maybe that makes sense for many but it should be noted just like deciding to write a react PWA instead of a fully native ios app is a tradeoff for developer experience (or a dozen other reasons) instead of user experience.
HTMX has a preload extension which has fully eliminated these delays in my experience. YMMV of course but so far both my UX and DX are dramatically improved over what the previous SPA offered
Type synchronization is becoming a very popular story. Now I get IDE awareness of all my endpoints and whether I'm using them right.