This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
typing animation; need differential electric to do this better?
(e/for [c (->> (y/ap (let [c (y/?> (y/seed elt))]
(y/? (y/sleep 50 c))))
(y/reductions (fn [acc n] (conj acc n)) [])
new)]
(ed/text c))
not immediately.l clear what this is can you post more context pls
also i don’t think m/ap and the other missionary coroutine DSLs are electric compatible yet due to use of mutable arrays in the cloroutine macroexpansion, you’ll need to wrap them in clojure. i believe the symptom of this is they will crash so perhaps you are getting lucky here
good to know. this is just for typing out a string char by char. the only small problem I see with this is that you have to conj into this vector to return from the flow, which you just iterate over for effects anyway with e/for
yes that seems right
typing animation; need differential electric to do this better?if the characters are coming in one by one, in the differential world you could send diffs. But for a small string/collection you shouldn't notice performance issues or delay today. If you already have the characters then animating them sounds like a job for CSS
would if I could, but I need more than dom. I'm aware how much slower it is to do it through missionary, my finger got tired scrolling the flamegraph
oh was this a perf question? your typing indicator snippet is not fast enough in some way? please provide context
no, this is just a best practices question with no practical perf requirement. I do have perf problems with electric (~500ms to render a component) though I haven't done anything to optimize it aside from glancing at the hilarious flamegraph
it's not unexpected that stuff feels jankier than react since it does all the work eagerly, no scheduler or anything
there's most likely low hanging fruit inside electric to improve performance, since we haven't done much profiling and optimizations, only the ones we needed to unblock us or client projects
yeah I don't see it as a priority, but I was expecting to see layout thrashing and I think it was more gc pressure
I have a macro, that returns a e/defn
, but I can’t get it to work. Here is my minimum failing example:
; in file foo
(defmacro defn2 [label args & body]
`(e/defn ~label ~args ~@body))
; in file bar
(defn2 Foo []
(dom/div (dom/text "meh")))
(e/defn Root []
(new Foo))
This fails with
; Encountered error when macroexpanding hyperfiddle.electric/boot.
; Unable to resolve symbol: Foo
; {:file xxxx, :line 41, :column 4, :end-line 41, :end-column 13, :in [(new Foo)]}
; ExceptionInfo: Unable to resolve symbol: Foo
Am I missing something here?did you remember to :require-macros in cljs