Local-first Hypermedia?
—
My wife gifted me a hardcover copy of hypermedia.systems, she's awesome.
Reading through and playing around with htmx, my mind is being blown by fascinating concepts which once felt archaic and outdated to me.
In particular, this new/old idea of HATEOAS really struck me. In short, an application that satisfies HATEOAS (short for "hypermedia as the engine of application state") always makes sure to tag along information about how to interact with a resource when sending along the data.
In contrast, a typical non-HATEOAS JSON api (that I'm used to now a days) is immediately separated from it's context as soon as you receive the data. With HATEOAS, you need nothing more than what is provided from the server.
Think of a letter you get in the mail that contains within it a return envelope, already addressed that you may use to send back information regarding the mail you just received.
This concept is powerful as it can greatly simplifies the client's responsibilities regarding the handling of any data within the hypermedia response, instead the server is now the one soley responsible for the handling and interaction of resources. The client can just focus on serving that interface to the user.
But something keeps nagging at the back of my mind as I read through hypermedia systems, while this simplification and decoupling is very liberating, this runs contrary to what I believe about local -first computing. Local-first priciples dictate that we move the responsibility of storing and handling data to the client, in doing so provide offline-enabled applications that give the user full control of their data, rather than being housed up in some big tech's servers.
Seems like an oxymoron on first read, hypermedia is associated with the internet, so how can it be possible to run offline-first hypermedia applications? But the ideas of hypermedia are not at all opposed to the priciples of local first applications.
Case in point, HyperCard is one of the first real hypermedia applications, and as far as I know, is used entirely offline.
So are there interesting ways of applying the same principles of REST and HATEOAS described in hypermedia systems for local first applications, and is that useful?
The book has given me some interesting threads to pull, I don't really have an answer yet but I think there's something to utilizing hypermedia to make applications where you own your data, in spite of the cloud.
Let me know what ideas you have! Email me at kyle [at] periks [dot] net