re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
zach 2020-12-14T01:34:52.435100Z

Hi! i was wondering if anyone had tips on using the leiningen re-frame template with doom emacs?

zach 2020-12-14T20:10:06.452300Z

Ah, thank you! I’ve got piggyback added, but still not working 😕 . I’ll move this to the emacs channel though!

zach 2020-12-14T02:23:11.439500Z

Basically my confusion is around what i should expect. I have some experience with a clojure app made with compojure, and apps built with bb. In both cases, when I connect to the repl from emacs, I can evaluate code in the buffer and see the results inline, e.g (+ 1 2 3 4) => 10

zach 2020-12-14T02:23:41.439700Z

I’ve made a new re-frame app with lein new re-frame , and started it by running lein deps and lein watch

zach 2020-12-14T02:24:36.439900Z

I can connect to browser repl by running cider connect cljs and choosing localhost:8777. I can then, in the repl , run commands like (js/alert "hi") and see that alert box in my browser.

zach 2020-12-14T02:26:10.440100Z

however, if i write new code and do ,ee to evaluate, nothing happens. I am unclear if this means that I have the project set up incorrectly, or if I am misunderstanding how that repl connection works. should i be able to evaluate sexp’s in my namespace, and not just the cljs.user namespace? thank, you!

2020-12-14T03:48:27.441600Z

I think it belongs to the emacs Channel, but did you check if you had cider-piggyback in your deps?

Adriaan Callaerts 2020-12-14T08:28:45.447500Z

Goodmorning all! I'm looking for a way to redefine app-db for a subtree of components. Practical use-case: I want to visualize different variations of the same component that uses subscriptions side-by-side using devcards. Before anyone suggest a best-practice to avoid this: The stateful behaviour is too complex (multiple subscriptions on multiple levels of nesting) to split up into a dumb component to put in devcards and control with a connected component in the actual app. Otherwise I would definitively do that (and am in fact doing that for most other components)

Adriaan Callaerts 2020-12-14T08:31:11.447700Z

I tried with with-redefs inside my devcard which didn't work. Probably because the card itself isn't the function doing the actual "rendering", so I guess the with-redefs is either coming in too early or too late to actually have an effect on the child components of the card

p-himik 2020-12-14T08:31:24.447900Z

I think using <iframe> with completely different apps would be the best and the simplest.

phronmophobic 2020-12-14T08:32:01.448200Z

see https://github.com/day8/re-frame/issues/137 for a long explanation

Adriaan Callaerts 2020-12-14T08:39:09.448700Z

Thanks for those pointers! I'll have a read of that issue thread and see where that leads me. Iframes seems a bit cumbersome to me, since that means I would have to make extra stub apps which contain only the component that I want to test. Seems like a lot of boilerplate for what I'm trying to do?

Adriaan Callaerts 2020-12-14T08:49:58.448900Z

Hmm, seeing the debate on that github thread and how A) there's no clear solution to this yet(!) and B) a lot of ideas around a solution seem to involve leveraging react context... I think I'll go with using context myself for this usecase. I'm lucky that the "subscribing" logic in my case is isolated in one component for now which is just repeated on multiple nesting-levels. So I'll replace that component with one that instead of doing a subscribe, gets its value from context and then wrap the higher-level component in a context provider which will get its value from the former subscription. (Sort-of) Again thanks for the pointers!!

👍 1
clyfe 2020-12-14T17:41:26.449500Z

Is anyone actively working on re-frame's EPs?

superstructor 2020-12-14T18:47:17.450600Z

Yes we are regularly re-visiting these, esp we have a pretty good plan re • https://github.com/day8/re-frame/blob/master/docs/EPs/002-ReframeInstances.mdhttps://github.com/day8/re-frame/blob/master/docs/EPs/003-ReusableComponents.md Any contributions or discussion is absolutely welcome 🙂 I recently enabled 'GitHub Discussions' for re-frame which may be a good forum discussing EPs ? https://github.com/day8/re-frame/discussions

👍 1
clyfe 2020-12-14T20:05:16.452100Z

(defn frame []
  {:app-db            (ratom {})
   :kind->id->handler (atom {})
   :event-queue       (->EventQueue :idle empty-queue {})})
Anything else stateful in re-frame?