Fork me on GitHub
#biff
<
2023-06-14
>
Jacob O'Bryant05:06:00

My "back in Biff mode" thing got interrupted by federal jury service which lasted a week and a half; finally making some more progress on the Electric integration. Just pushed https://github.com/jacobobryant/biff-electric/commit/5c365eb4fbe0bf216e0e3cb23cbe9731103bd871 which re-implements the example app's UI with Electric instead of htmx. I've at least got a rudimentary understanding of how to use Electric now. Wouldn't mind having a deeper understanding of Missionary. In particular, see https://github.com/jacobobryant/biff-electric/blob/master/src/com/biffweb/examples/electric/signals.clj which shows how to integrate xtdb with electric (not sure if signals is the right term for that namespace, 🤷 ). The xt-signal function is quite general purpose. See also https://github.com/jacobobryant/biff-electric/blob/master/src/app/todo_list.cljc (need to rename that to app.cljc or something, todo_list is just a holdover from the electric starter app) which shows how to use electric to do some simple (reactive) crud. I gotta say, being able to stick a call to submit-tx https://github.com/jacobobryant/biff-electric/blob/master/src/app/todo_list.cljc#LL97-L99 for a submit button is pretty sweet. also, there's basically only one biff-specific thing that's helpful to know: you can use e/*http-request* to get the context map (since biff merges the context/system map with the http request map), https://github.com/jacobobryant/biff-electric/blob/master/src/app/todo_list.cljc#L138. https://github.com/jacobobryant/biff-electric/blob/master/src/app/todo_list.cljc#L154. I like the idea of including electric in "biff core" eventually, after it's more mature and has more documentation; in the mean time, after I get this repo polished up, I'll write up a blog post/how-to guide for it and stick it in the https://biffweb.com/docs/library/. (I am also still thinking that electric and htmx are complementary--probably the approach I'd take is to always start with htmx, and when it starts to get out of hand, then think about introducing electric)

4
👏 18
👍 2
2