> treating URL parameters as your single source of truth... a URL like /?status=active&sortField=price&sortDir=desc&page=2 tells you everything about the current view Hard disagree that there can be a single source of truth. There are (at least) 3 levels of state for parameter control, and I don't like when libraries think they can gloss over the differences or remove this nuance from the developer: - The "in-progres…
> All of those questions and more will vary between applications. One size does not fit all. all of those come from the fundamental "requirement" set out earlier to have no in-page state, but still require the webpage to behave as tho it did. If you remove this requirement, then it will be like how it was back in the 2000's era web pages! And the url does indeed contain the single source of truth - there are no infli…
URL-Driven State in HTMX
61–70 of 188 posts
Re: URL-Driven State in HTMX
#62Re: URL-Driven State in HTMX
#63The example URL here, though, is still not (helpfully) bookmarkable because the contents of page 2 will change as new items are added. To get truly bookmarkable list URLs, the best approach I've seen is ‘page starting from item X’, where X is an effectively-unique ID for the item (e.g. a primary key, or a timestamp to avoid exposing IDs).
Re: URL-Driven State in HTMX
#64Earlier quoted context omitted.
> All of those questions and more will vary between applications. One size does not fit all. all of those come from the fundamental "requirement" set out earlier to have no in-page state, but still require the webpage to behave as tho it did. If you remove this requirement, then it will be like how it was back in the 2000's era web pages! And the url does indeed contain the single source of truth - there are no infli…
The example they used for "in progress" state was form inputs. Don't you count those as in-page state?
So you cannot have both a webpage that is not an app, but maintain an app-like behaviour. Trying to do so is a cursed problem, and it might succeed with high effort, but ultimately not worth it.
Re: URL-Driven State in HTMX
#65Note that you can store longer state (at least 64K; more not tested) in the fragment (`location.hash`); obviously only the client gets to see this, but it's better than nothing (and JS can send it to the server if really needed). For parameters the server does need to see, remember that params need not be &-separated kv pairs, it can be arbitrary text. Keys can usually be eliminated and just hard-coded in the web pag…
When people start using or buying your software you are going to quickly find out that 64K won't work
Re: URL-Driven State in HTMX
#66Re: URL-Driven State in HTMX
#67I think people are now ready for php. I bet it will be reinvented on top of nodejs.
Re: URL-Driven State in HTMX
#68I think people are now ready for php. I bet it will be reinvented on top of nodejs.
Re: URL-Driven State in HTMX
#69Re: URL-Driven State in HTMX
#70I think people are now ready for php. I bet it will be reinvented on top of nodejs.