| ▲ | yawaramin 3 days ago | |||||||||||||
> D*'s authors are pretty adamant that this is an anti-pattern The Datastar authors are wrong about this. History push is a very important part of the hypermedia-driven application approach. Because URLs are super important. And we want to make sure that the correct URL is shown for the currently-loaded view, and that the view is reproducible given the URL (as much as possible) so that bookmarking and copy-pasting to send URLs just works as expected. A really nice article came out about this just recently: https://alfy.blog/2025/10/31/your-url-is-your-state.html I also wrote a bit more about it here: https://dev.to/yawaramin/why-hx-boost-is-actually-the-most-i... | ||||||||||||||
| ▲ | nchmy 3 days ago | parent [-] | |||||||||||||
Thanks very much for a thoughtful reply and link to your article. I look forward to reading it. As it turns out, I shared that very same article in the Datastar discord the other day! Here's some other good ones that I found while digging into the topic, for anyone who cares. * https://warpspire.com/posts/url-design/ * https://blog.jim-nielsen.com/2023/examples-of-great-urls/ * https://www.w3.org/Provider/Style/URI * https://www.hanselman.com/blog/urls-are-ui I strongly agree that good urls are very important. But I don't see how D* prevents correct urls/history at all... You can click anchor links just fine for pages that are genuinely separate pages. If its just a sub page, filter etc, then i think in many cases it should only swap into the dom without updating the history. Moreover, am I wrong to think that if you use hx-boost to swap in fragments, then the URL that gets updated/saved in history wouldn't actually load the same page if you loaded it from a bookmark? That wouldn't happen with non-boosted anchor links. Anyway, I'm not the best person to take up this argument. If you are interested at all in some respectful debate on the topic, it would be great if you came by the datastar discord where there's definitely people who would be better able to engage with it. I'd be eager to observe from the sidelines | ||||||||||||||
| ||||||||||||||