Re-Frame: Build web apps in ClojureScript and React
41–50 of 57 posts
Re: Re-Frame: Build web apps in ClojureScript and React
#42Earlier quoted context omitted.
And yet I've also had people tell me the opposite - they say they liked the water cycle analogy, even more than the subsequent dominoes narrative. Hmm. Hard to know what to do about such conflicting feedback.
If you try to come up with lots of clever analogies and complex stories, layered with lots of self-congratulatory enthusiasm, some people will get it or like it, many will not. On the other hand, if you write simply and just get to the point, everyone will benefit. Leave out the editorials and just say what needs to be said so developers can use their time on their code. You could easily remove 80% of the words in al…
Re: Re-Frame: Build web apps in ClojureScript and React
#43Re: Re-Frame: Build web apps in ClojureScript and React
#44Earlier quoted context omitted.
The re-frame docs and "marketing" speak, like on its front github page, would do very well to remove a lot of the self-congratulatory tone, frankly. A lot of it reads like someone very impressed with themselves rather than text about how to use an actual tool.
Thanks, I'll keep that in mind.
Re: Re-Frame: Build web apps in ClojureScript and React
#45Earlier quoted context omitted.
I've run a team with re-frame and a team with reagent (and a convention of a single state atom.) Reagent by itself scaled far better. I use re-frame if it's a company convention, but I'd far rather just ditch it. Plain reagent has no unnecessary function registry; mutations are done with `(swap! my-cursor foo/update-foo bar)` rather than the extra overhead of `(dispatch [::foo/update-foo bar])`. This also helps new p…
Three things that would make re-frame better, if you want them: - A supported/blessed way to switch out the entire app-db entirely for the purposes of testing - Use of symbols rather than namespaced keywords for function dispatch - Docs that give alternate strategies for code organization (fine to have the events.cljs convention, but would be nice to see some viewpoints like having one per child ns similar to angular…
- I'm wondering if re-frame-test might help?
- That ship has sailed a long time ago. And, even if it hadn't, I diagree that symbols would be better.
- I'm unfamiliar with angular's code. The Resources section lists larger apps which you can inspect.Re: Re-Frame: Build web apps in ClojureScript and React
#46Earlier quoted context omitted.
Very happy re-frame user here - I was pleased to see the 1.0 release recently and I like the sound of the new developments. Personally I do appreciate the amount of conceptual framing (pun intended!) contained in the re-frame docs. It's one thing to know the syntax for, say, declaring a subscription, but it's something else to know what subscriptions are for . For me, Re-frame's value-add is that it provides a bunch…
Docs on builtin effects were added last week. http://day8.github.io/re-frame/api/ Then click "Builtin effects" in the left Nav. I'm actually working on the API docs at the moment and wrestling with codox and markdown interaction.
Re: Re-Frame: Build web apps in ClojureScript and React
#47Earlier quoted context omitted.
If you try to come up with lots of clever analogies and complex stories, layered with lots of self-congratulatory enthusiasm, some people will get it or like it, many will not. On the other hand, if you write simply and just get to the point, everyone will benefit. Leave out the editorials and just say what needs to be said so developers can use their time on their code. You could easily remove 80% of the words in al…
I've lost track of how many times you have posted pretty much exactly the same thing. Seems slightly fixated.
Re: Re-Frame: Build web apps in ClojureScript and React
#48Earlier quoted context omitted.
Thanks, I'll keep that in mind.
Please don’t listen to the peanut gallery. The re-frame docs are in a league of their own and most of us appreciate the enormous effort put in to make them awesome. Keep rocking.
Re: Re-Frame: Build web apps in ClojureScript and React
#49Earlier quoted context omitted.
At this point I think it's safe to say---clojurescript has proven itself and is not a risk. An excellent language, good libraries (Metosin's ambidextrous router, Reitit, stands out here), the best development story with Figwheel, and oh, dead code elimination for free , as the cljs compiler leverages Google's Closure (not to be mistaken for Clojure) compiler. Not to mention that cljs is actually a better fit for Reac…
Conversely, I found the experience pretty terrible when I worked on a big cljs/reagent/reframe/figwheel app over the course of a couple of years. It was slow, prone to runtime errors (though not as much as JavaScript), and often presented weird edge-cases at the intersection between the Lisp world and the React world. The company ended up abandoning all this stuff after having been big Clojure/ClojureScript evangelis…
Re: Re-Frame: Build web apps in ClojureScript and React
#50Earlier quoted context omitted.
Three things that would make re-frame better, if you want them: - A supported/blessed way to switch out the entire app-db entirely for the purposes of testing - Use of symbols rather than namespaced keywords for function dispatch - Docs that give alternate strategies for code organization (fine to have the events.cljs convention, but would be nice to see some viewpoints like having one per child ns similar to angular…
Answers to your three points: - I'm wondering if re-frame-test might help? - That ship has sailed a long time ago. And, even if it hadn't, I diagree that symbols would be better. - I'm unfamiliar with angular's code. The Resources section lists larger apps which you can inspect.
It'd be hard to change that aspect of the API now, and I wouldn't recommend you do it; but right now, editor completion and new-user understanding is just better on the reagent side. They do this:
(defn assoc-foo [db bar]
(assoc db :foo bar))
(defn fetch-new-foo [db bar]
(go
(let [bar (
whereas re-frame would make you do this: (re-frame/reg-event-db
::assoc-foo
(fn [db [_ bar]]
(assoc db :foo bar)))
(re-frame/reg-fx
::pull-from-channel
(fn [{:keys [f event]}]
(go
(let [resp (
The first one has a lot going for it; swap! is part of the standard library, has a bunch of docs for free, etc.; any clojure editor will pick up on the use of assoc-foo as a function and give you arity warnings if you pass too many parameters, etc.I've looked at the larger apps - the way I've seen people be most successful if if they have a child namespace with events, subs, & views laid out on a per namespace basis (`my-ns.events, my-ns.subs, my-other-ns.events, my-other-ns.subs`.) Partially due to the tone the docs take, there's always some pushback as to whether that's the re-frame way to do things, and I'd love to just be able to avoid that whole conversation in the future.