biff

Michael Nardell 2024-04-07T20:18:20.417049Z

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!

2024-04-07T21:04:44.545669Z

You can do it with Rum's fragment feature: [:<> [:div "first div"] [:div "second div"]]

😮 1
Michael Nardell 2024-04-07T21:44:59.759869Z

Thanks Jacob. I am enjoying learning Biff, and it has been a great entry point to HTMX, XTDB and Tailwind.

2024-04-07T21:45:30.065379Z

glad to hear it!

2024-05-31T00:57:45.171179Z

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 @foo could shed some light on this?

2024-05-31T01:27:03.935789Z

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

2024-05-31T01:56:22.447459Z

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 ?

2024-05-31T02:02:22.475739Z

even for the Out-of-Band feature weavejester's hiccup could be used ?

2024-05-31T02:15:31.138519Z

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.

🙌 1
2024-05-31T02:50:36.620489Z

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.