This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
I was trying to use the HTMX Out-of-Band feature. If I understand correctly, I need to provide two elements in the the response: first one for the target, the second specifies another element id and adds the hx-swap-oob. The biff/render function may not support this "forked" response, and I was thinking of writing my own render function to handle this kind of response. Please let me know if I am missing something if there is something already built in that I can use. Thanks!
You can do it with Rum's fragment feature: [:<> [:div "first div"] [:div "second div"]]
Thanks Jacob. I am enjoying learning Biff, and it has been a great entry point to HTMX, XTDB and Tailwind.
glad to hear it!
Excuse me for intruding. Is this fragment feature one of the reasons of the rum library usage in Biff? I noticed that rum is called whenever static HTML needs to be rendered. Perhaps @U7YNGKDHA could shed some light on this?
Originally I picked Rum because it worked the same on clj and cljs--this was before I switched Biff to use htmx instead of cljs. plain hiccup would also be fine, or this: https://github.com/lambdaisland/hiccup
I decided to try htmx for a small project at home that I'll possibly use at work if things go right, and biff is reference implementation in clojure. I'm watching https://biffweb.com/p/the-design-of-biff/video right now. I already have a base code with sierra component, postgres, reitit. Is it possible/feasible to use code of biffweb with sierra's component ?
even for the Out-of-Band feature weavejester's hiccup could be used ?
the re loadable routes in biff are dope. I've accomplished the reloading bit (not the refresh on save) following the metosin doc https://gist.github.com/geraldodev/20b70704bdede9b91608a535f8423164 the routes needs to be functions.
yep, any of them will be fine for out-of-band. for regular hiccup you should be able to render a list to get multiple top-level elements, but if nothing else you can always call hiccup on each individual element and then put the results together with str
.