vrac

amano 2025-04-22T12:04:44.925719Z

Perhaps, can I write component-local events and component-local subscriptions with signaali? If I can, then I can write re-usable components. A function may accept parameters for si-frame global events and si-frame global subscriptions and return a vrac component. That is my theory for re-usable vrac components.

2025-04-22T14:03:46.384679Z

This is one way of doing it, but I recommend to wait until the DSL is ready.

amano 2025-04-22T14:05:02.763209Z

Are you preparing a DSL for mixing component-local events and component-local subscriptions and the global ones?

2025-04-22T14:05:38.705799Z

Not exactly, but it will help a lot with it.

2025-04-22T14:08:05.930399Z

The DSL is supposed to help with representing the user's intent, and to help reading it in a programmatic way.

2025-04-22T14:08:45.770749Z

Please share some snippets about how you see component-local events and subscriptions.

2025-04-22T14:08:52.246419Z

I am interested.

amano 2025-04-22T14:09:43.627799Z

I don't have snippets. I just have vague ideas at this point. I imagined a UIx defui component where missionary dishes out component subscriptions.

amano 2025-04-22T14:10:38.142149Z

Global subscriptions are not reusable without component function parameters, and some subscriptions should be local to components.

2025-04-22T14:13:36.491469Z

Without a snippet of pseudo-code, it's hard to see what a component-local subscriptions and event should be.

amano 2025-04-22T14:16:16.215049Z

(defui a-component
  []
  (ui-code
    (set-up-missionary (fn [x] (* x 2)))
    (:on-click (fn [e] (push-something-to-missionary)))
    (subscribe-to missionary's-output)))
My UI programming knowledge is not great at this point.

amano 2025-04-22T14:17:23.492859Z

Basically, if you type 3 into an input box, you see 6 in another input box because missionary propagates 6 to it.

amano 2025-04-22T14:18:45.354409Z

Event handler pushes a value to reactive system. The system publishes a transformed value. Widgets subscribe to the transformed value locally inside defui.

amano 2025-04-22T14:18:56.330959Z

Basically, a closure. Everything is contained in defui macro.

2025-04-22T14:22:07.816299Z

I am not sure how missionary works with Signaali

2025-04-22T14:22:29.849829Z

It would be simpler to write it directly using signaali

2025-04-22T14:22:51.812409Z

But yeah, I see what you mean.

amano 2025-04-22T14:23:05.522439Z

That code is not really correct for missionary. It is just a generic pseudo-code.