This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-16
Channels
- # announcements (25)
- # babashka (15)
- # beginners (14)
- # calva (60)
- # circleci (1)
- # clerk (1)
- # clj-kondo (13)
- # cljdoc (7)
- # clojure (45)
- # clojure-austin (1)
- # clojure-bay-area (1)
- # clojure-brasil (4)
- # clojure-dev (9)
- # clojure-europe (24)
- # clojure-norway (105)
- # clojure-uk (2)
- # clojurescript (6)
- # conjure (1)
- # core-typed (4)
- # cursive (4)
- # datalevin (1)
- # datomic (25)
- # emacs (31)
- # fulcro (3)
- # humbleui (10)
- # hyperfiddle (19)
- # jobs (2)
- # luminus (3)
- # malli (13)
- # nbb (5)
- # off-topic (16)
- # polylith (2)
- # portal (7)
- # releases (2)
- # shadow-cljs (5)
- # sql (8)
Hmm, how do I debug this error? I looked around for a client DOM effect inside an e/server
but I don't see any.
7 | (def electric-main
8 | (hyperfiddle.electric/boot ; Electric macroexpansion - Clojure to signals compiler
---------^----------------------------------------------------------------------
Encountered error when macroexpanding hyperfiddle.electric/boot.
Unable to resolve symbol: hyperfiddle.electric-dom2/new-node
{:file "myproject/core.cljc", :in [hyperfiddle.electric-dom2/new-node]}
ExceptionInfo: Unable to resolve symbol: hyperfiddle.electric-dom2/new-node
hyperfiddle.electric.impl.compiler/analyze-form (compiler.clj:647)
hyperfiddle.electric.impl.compiler/analyze-form (compiler.clj:632)
hyperfiddle.electric.impl.compiler/eval11125/analyze--11131/fn--11136/fn--11137 (compiler.clj:700)
hyperfiddle.electric.impl.compiler/eval11125/analyze--11131/fn--11136 (compiler.clj:699)
hyperfiddle.electric.impl.compiler/eval11125/analyze--11131 (compiler.clj:688)
hyperfiddle.electric/boot (electric.cljc:378)
hyperfiddle.electric/boot (electric.cljc:373)
clojure.core/apply (core.clj:671)
clojure.core/apply (core.clj:662)
Solved. I had,
(e/defn SomeView []
(dom/div ...))
;; lower down:
(e/server (SomeView.)
And was calling it from an e/server
block. Fixed with this:
(e/defn SomeView []
(e/client
(dom/div ...)))
Is there an example of how to use Missionary from Electric? I don't see one here, but may be missing it: https://github.com/hyperfiddle/electric/tree/0a63292a9baa7783c7f647e4cfffeaf5055e9f64/src-docs/user/missionary e.g. how to sleep from Electric with m/sleep.
search m/sleep it's been discussed
Bit of a shower thought β electric's semantics are more or less exactly what you want out of a polyglot build tool like bazel
(the major gap that I see being that the state of electric's nodes obviously don't persist between process restarts)
not familiar with bazel but yes agree, "effect system" structure unifies a huge amount of infrastructure that today is disjoint
I maintain a list:
β’ hot take: the following technologies unify under the umbrella concept of "functional effect system" β¦ Kubernetes β¦ Erlang process supervision β¦ Microsoft Orleans β¦ Akka β¦ Rx β¦ Zio β¦ Cloud Haskell β¦ Clojure's Missionary β¦ Electric Clojure β¦ Unix, Windows (process/program/task manager) β¦ Java threads, OS threads β¦ Frontend rendering with signals
β’ value prop β functional effect systems β¦ cancellation β¦ concurrency and backpressure combinators β¦ composability / referential transparency β coordinate large scale effect fabrics β¦ glitch-free event propagation β¦ correct error handling by default (process supervision) β¦ resource lifecycle (RAII) β strong resource cleanup guarantees
β’ List of relevant topics: β¦ Process supervision (trees) β¦ Observable sharing (DAGs) β¦ Graceful termination β¦ Self-healing software β¦ Resilience β¦ Actors β¦ Signals and event streams / FRP β¦ functional effects β¦ concurrency and backpressure
> Bit of a shower thought β electric's semantics are more or less exactly what you want out of a polyglot build tool like bazel > Or the semantics for a "thing to manage your system" like integrant or component. Feels like integrant solves the narrow, parochial version, whereas electric solves the general version. On that sidenote, JVM only Electric could make sense - for cases where one wants the reactivity, but don't want reactive web clients.

> JVM only Electric could make sense CLJS only could be useful as well for that matter. Essential allowing Electric reactivity without requiring the websocket connection. (And then disallowing e/server & e/client when there is no connection)
JVM and JS only i think already works (just don't use e/client e/server) β the e/run
unit test entrypoint mocks out the network. However the runtime overhead for network management is still present (may not matter)
Indeed electric dynamic scope is roughly competitive with Component and other DI frameworks
We don't advertise it because we have not done like a requirements analysis to figure out exactly what we have and don't have for a general purpose DI use case like that ... we're super focused on web UI. Using Electric for a different use case likely will have rough edges or some mismatches with how Clojure programmers might be accustomed to structuring your systems, we don't know yet