hyperfiddle

hrtmt brng 2025-08-11T11:20:51.508949Z

Will Hyperfiddle be only for data visualisation or also for data editing?

Dustin Getz (Hyperfiddle) 2025-08-11T12:09:39.109099Z

ha ha yes we are here to solve crud

Dustin Getz (Hyperfiddle) 2025-08-11T12:10:08.637729Z

๐Ÿ‘ 3
๐Ÿ‘€ 1
telekid 2025-08-11T13:57:31.500929Z

I'm having a bit of a morning RCF head-scratcher. See this small gist: https://gist.github.com/telekid/8fa492501322806dbb4f8cc698443864

telekid 2025-08-11T13:59:36.283719Z

Given this docstring:

hyperfiddle.rcf/tap
  
Function to push value to async queue, e.g. `(tap 42)`. RCF redefines this var in tests context. For REPL
convenience, defaults to println outside of tests context.
And the fact that [:connecting] and [:connected] are being printed rather than appearing on the tap queue, I wonder if there is something weird going on. (Probably just haven't had enough coffee today, though.)

Geoffrey Gaillard 2025-08-11T14:01:00.128009Z

have you tried with rcf/tap?

telekid 2025-08-11T14:01:47.690209Z

Good thought, just tried it though with no dice.

telekid 2025-08-11T14:03:10.362299Z

Gist updated with namespace block and explicit rcf/tap

๐Ÿ‘€ 1
Geoffrey Gaillard 2025-08-11T14:28:50.545349Z

The docstring is misleading. rcf/tap is rebound in the context of tests, but not as a clojure dynamic binding. Here is a workaround:

(def ^:dynamic *tap* (constantly nil))

(defn client-connect []
  (m/observe
    (fn [!]
      (*tap* [:connecting])
      (! :a)
      (*tap* [:connected])
      (fn []))))

(tests
  (binding [*tap* rcf/tap]
    (let [cancel
          ((m/reduce {} nil (client-connect))
           {} {})]
      % := [:connecting]
      % := [:connected]
      (cancel))))

telekid 2025-08-11T14:40:30.814599Z

Got it. Should I open an issue? Or is this working as intended?

Geoffrey Gaillard 2025-08-11T14:49:28.335939Z

I think the behavior can be justified. The docstring could def be improved. Up to you if you want to open an issue.

telekid 2025-08-11T15:24:11.418219Z

Cool, makes sense. Thanks for the workaround, I think I'm unblocked. It gets a little messy when threads are thrown into the mix โ€“ I've updated the nextjournal to demonstrate.

xificurC 2025-08-11T16:40:18.042629Z

you'd have the same issues with clojure.test/is

๐Ÿ‘ 1
xificurC 2025-08-11T16:41:23.285239Z

if you really need to you can pass it lexically

(defn client-connect [tap] ... (tap [:connecting]))
(tests ... (client-connect tap))

๐Ÿ™ 1
Girish Redekar 2025-08-11T19:40:57.153159Z

Hi folks, I'm curious if anyone here has used Electric along with a component library like Ant.Design (or anything else, doesn't have to be React). Are there any open-source examples I could look at? (I'm fully onboard with using making the network transparent, but don't want to handwrite UI components/styling either. Feel free to tell me if I'm understanding this wrong. That writing UI-components is a worthwhile tradeoff over writing network-glue).

tobias 2025-08-12T12:47:20.992879Z

For internal tools that just need to look โ€œgood enoughโ€ Iโ€™ve used https://bulma.io/ Itโ€™s CSS only (no JS) so easy to use with Electric without any special wiring

๐Ÿ‘€ 2
๐Ÿ™ 2
oฮปv 2025-08-11T19:44:45.725979Z

At Itonomi we're building an Electric component system based on the Norwegian government's design system https://designsystemet.no. https://github.com/itonomi/komponentkassen

๐Ÿ‘ 2
oฮปv 2025-08-11T19:48:10.922099Z

I've also done some experiments with writing very high-level components. For example a full-stack log in / sign up page as one higher-order Electric function. iirc it had a form something like (e/fn Authentication [LogIn SignUp] ...) so that you only provide the callbacks to hook into your auth system and the rest was handled by the Electric component. There's definitely a lot to explore in this area, I think ๐Ÿค“

Girish Redekar 2025-08-11T20:01:20.658449Z

Got it, thanks @post972! Will check this out.

oฮปv 2025-08-11T20:28:06.694739Z

Cheers

oฮปv 2025-08-11T20:29:42.508119Z

I should say this is very much work in progress, but I'm very interested in feedback and discussion ๐Ÿ˜„

Dustin Getz (Hyperfiddle) 2025-08-11T21:12:19.937839Z

Several teams, including us internally, are building component systems - ideally headless so you can BYO markup. We have one that we use on projects but it's sophisticated and in motion so consulting projects only at this point

Dustin Getz (Hyperfiddle) 2025-08-11T21:13:07.935229Z

I would not say this is necessarily a one size fits all situation either, there are dozens of different React ecosystem choices