This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (1)
- # aws (6)
- # babashka (17)
- # beginners (30)
- # calva (12)
- # cider (25)
- # circleci (2)
- # clojure (42)
- # clojure-australia (8)
- # clojure-czech (1)
- # clojure-europe (30)
- # clojure-france (52)
- # clojure-italy (2)
- # clojure-nl (16)
- # clojure-serbia (3)
- # clojure-uk (10)
- # clojurescript (40)
- # core-async (5)
- # cursive (24)
- # datalog (7)
- # datomic (8)
- # emacs (4)
- # events (1)
- # figwheel-main (3)
- # fulcro (2)
- # helix (5)
- # heroku (1)
- # kaocha (6)
- # leiningen (3)
- # malli (11)
- # music (5)
- # off-topic (20)
- # practicalli (1)
- # re-frame (4)
- # react (8)
- # reitit (14)
- # rewrite-clj (5)
- # rum (2)
- # schema (2)
- # shadow-cljs (23)
- # vrac (28)
- # wasm (4)
- # xtdb (12)
- # yada (5)
My next milestone will be to implement https://github.com/day8/re-frame/tree/master/examples/simple in Vrac.
I rewrote it already: https://github.com/green-coder/vrac-simple-sample/blob/master/src/simple/core.cljc
It is not working, but it shows how the event handler will look like.
Explanations here: https://twitter.com/VincentCantin/status/1383143229932015621
In vrac, where does the path come from?
> In Vrac, the "output" can be passed in the event next to the "input". Paths are unknown to the user. Trying to grok this. It seems like passing the "output" (I would call it a reference) is re-frame's work around for making updates less coupled to specific parts of the app db. Trying to understand vrac's approach.
:logic in Vrac are meant to be interpreted offline. They encode meaning instead of process.
As a result, if the human can understand what's going on while reading the event handler after reading the instruction manual, then a program can do the same and generate the code needed for the "process".
In Vrac, the path is conceptually passed alongside the value. It's as if the path was a metadata of the value.
so where does the path come from?
from the caller of the event triggering.
for the example
[:time-color-change 34562], is the path in that event somewhere?
In this specific example, there is no path conveyed with 34562
(:time-color nil) describe a data somewhere.
In Pathom's terms, that can be read as "the data reachable using
:time-color in the global context".
nil is the global context
(:time-color my-timer) would be the time-color in the context of a specific timer.
so the component dispatching the event would presumably pass
'(:time-color my-timer) as part of the event?
It could, yes.
In practice in Vrac, the user has very little need to call
(v/dispatch event) directly. Most of the time, the events would be dispatched from the Vrac component's "render function".
I do think the path dependence that's common in most frameworks is a challenge. membrane has some similar ideas (see https://blog.phronemophobic.com/reusable-ui-components.html). I still think there's lots of interesting ideas yet to be explored so I'm curious to see how vrac approaches the problem. I've been using the term "reference" to describe paths like
> I do think the path dependence that's common in most frameworks is a challenge It's a handicap, mostly 🙂
Vrac plays a lot with the references, under the hood.
I am happy that you find the idea interesting.
When I say "reference", it doesn't necessarily mean just a "reference type" like an atom. Here's the definition I came up with: Reference: Data that uniquely identifies an entity within a data model.
Yes, that's what I understood.
> In practice in Vrac, the user has very little need to call `(v/dispatch event)` directly. Most of the time, the events would be dispatched from the Vrac component's "render function". What does that mean?