This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-18
Channels
- # announcements (19)
- # babashka (30)
- # beginners (51)
- # biff (12)
- # calva (20)
- # cider (27)
- # clara (20)
- # clj-kondo (19)
- # clojure (128)
- # clojure-canada (1)
- # clojure-dev (5)
- # clojure-europe (29)
- # clojure-nl (1)
- # clojure-norway (48)
- # clojure-uk (5)
- # clojurescript (6)
- # clr (37)
- # core-async (17)
- # cursive (2)
- # data-oriented-programming (2)
- # datahike (1)
- # datomic (5)
- # emacs (22)
- # exercism (1)
- # funcool (17)
- # humbleui (15)
- # jobs (1)
- # malli (44)
- # off-topic (11)
- # podcasts-discuss (1)
- # pomegranate (1)
- # react (1)
- # remote-jobs (1)
- # shadow-cljs (25)
- # tools-build (12)
- # tools-deps (70)
- # xtdb (24)
Can I integrate a client side router into Reitit or is there a strategy for that? To clarify, I mean a changing URL in the address bar that matches what’s going on in the app.
Perfect. htmx… sigh… 😍
I'm curious about what the use case is? usually if I want to change the url, I just do a regular link/form post without htmx and load the whole page. hx-push-url might help to make the navigation slightly faster I suppose. though hx-boost is also worth looking at for that; I usually have that switched on.
(to answer original question, you can do client side routing with reitit, but that's more a thing you'd use if you're always using clojure script etc for the frontend)
Well (and I hardly know what I’m talking about)… my app content changes when a menu item is clicked… but hard refreshing the browser page returned me to the state prior to the menu item click. That made me realize a link to, say, https://foobar.tld/app/some-detail-page may not get me there. However, I may have gone the wrong way about setting up the menu link to some-detail-page in the first place. I just just swapped the returned htmx onto a target that was the main div of my SPA.
Actually, I’m pretty embarrassed: https://biffweb.com/ clearly has all this sorted out.
It seems to reload on clicking, say, Docs… at any rate, I need to just study what’s going on there.
tl:dr I was asking about client side routing in my clumsy efforts to implement routing in general.
Someone in this channel shared a link to a book which I found helpful, it’s about building dynamic webpages with htmx. I found hx-boost takes care of most of my page-navigation concerns. Check out chapter 6 if you don’t have time to read the entire thing - here’s a direct link: https://hypermedia.systems/book/htmx-in-action/
http://Biffweb.com is just a regular static site, no htmx there 🙂. As far as navigation is concerned, it might help to think in terms of regular multi-page sites, with a different route for each page, rather than htmx. and then mainly use htmx for state changes within a particular page (for example, hitting the like button on a post).
Thank you! That’s helpful. ⭐