This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-14
Channels
- # babashka (43)
- # beginners (47)
- # biff (1)
- # calva (16)
- # cider (7)
- # clerk (6)
- # clj-kondo (39)
- # cljdoc (49)
- # clojure (29)
- # clojure-brasil (1)
- # clojure-europe (93)
- # clojure-losangeles (1)
- # clojure-norway (34)
- # conjure (7)
- # datalevin (8)
- # events (1)
- # gratitude (3)
- # honeysql (6)
- # hyperfiddle (2)
- # introduce-yourself (1)
- # javascript (1)
- # jobs-discuss (9)
- # lsp (3)
- # malli (10)
- # off-topic (8)
- # pedestal (3)
- # rewrite-clj (2)
- # shadow-cljs (17)
- # sql (33)
- # vim (1)
- # xtdb (31)
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)