top | item 39381016

URI Templates, making and matching URIs in Clojure

8 points| malcolmjuxt | 2 years ago |juxt.pro | reply

2 comments

order
[+] malcolmjuxt|2 years ago|reply
Hi, I'm the author of this article, and the original author of the bidi routing library in Clojure.

Recently, I discovered RFC 6570 and think it's a great basis for a URI router, especially given its designed for creating links too, which is useful in the context of building htmx (and other hypermedia) apps.

[+] hrrld|2 years ago|reply
That's cool - we've used bidi for years on lots of projects and have always just built our links w/ string concatenation. Formalizing this more makes a lot of sense.

With SPAs we've put a decent amount of thought into the tradeoffs between URI length, and putting enough context in each link to reconstitute the app state from a combination of local-storage, data requested from the server, and pure frontend db state (navigation location, parameters, etc...)

Perhaps there's some connection here as well with datafy/nav, there are increasingly spaces where REST-ish graphs of data are arising and capitalizing on the formalism in reference/navigation with something like this seems like a good idea too.