Fork me on GitHub
#om
<
2017-05-29
>
pasi10:05:14

hey. Just getting started with Om/Om.next. Couple quick(?) questions. First, I've read some Clojure guides and I have a (very) basic grasp of Clojure syntax now. Is there anything I should really know before diving into Om/Om,next language syntax/features wise? Second, I looked at some Om(next) docs yesterday and a lot of them had "under heavy development warnings". I guess they're still the docs I should be reading? Third, "Note: this tutorial is for Om, not Om Next" - I assume learning Om carries over to Om next and the "basic tutorial" at https://github.com/omcljs/om/wiki/Basic-Tutorial is still somewhat valid?

danielstockton10:05:09

@pasi There isn't much carry over from om to om.next, you should start with the om next quick start.

jimmy11:05:36

@pasi If you are new to Clojure, I recommend you to start with some thing like Rum, Reagent and Reframe first if you want to build something. Otherwise, if you are learning, just go with Om.next directly.

pasi11:05:32

I use React, Redux & co based stack at work quite extensively so I'm particularly interested in Om Next. Broadening my horizons etc.

danielstockton11:05:29

@nxqd Why do you recommend those first?

jimmy11:05:19

@danielstockton It's based on my experience, I find it's easier for Clojurescript newbie to try out with those framework first since they are easier to work with, and you can build a prototype easily. It's not the same for Om.next. If they are experienced, then they are free to choose 🙂

claudiu11:05:06

@pasi I’m also switching from react, redux. Om-next has quite the learning curve unfortunately. I found rum & reframe a lot easier. There is also untangled (om-next framework).

claudiu11:05:02

I found tony kay’s videos really helpful most of the stuff applies to om-next https://www.youtube.com/playlist?list=PLVi9lDx-4C_T_gsmBQ_2gztvk6h_Usw6R

danielstockton11:05:53

Fair enough, it seems to be a common viewpoint. I've looked at re-frame/reagent very briefly but didn't really grasp it any easier than om.

claudiu11:05:20

imho the docs and examples are better. For om next I think that the documentation and examples don’t really explain the overview that well. Spent a lot of time re-reading and trying to get my head around them.

claudiu11:05:00

Would have really loved to see something like https://github.com/kriasoft/react-starter-kit for om-next. There is a live version here https://demo.reactstarter.com/

danielstockton11:05:03

I think I was sold on the philosophy of om.next (dnolen talks etc...) before I actually knew anything about it. It seemed like how we should be building UIs. With reagent/re-frame (and incidentally boot vs lein), I see lots of blog posts, documentation, people telling me to use them, but never really heard a convincing argument other than that (to motivate me to dive deeper).

danielstockton11:05:31

I was similarly sold on Clojure at the beginning, on abstract ideas rather than 'well everyone else is using X'

danielstockton11:05:38

I think if I had gone by number of blog posts and documentation, I would still be writing ruby.

claudiu11:05:39

It’s just hard to get a working template. 🙂 Personally can’t turn back because the end result is just so much cleaner 🙂

pasi11:05:36

I actually made some mental notes about the sort of things I'd like to see in Om next documentation

pasi11:05:00

it's kinda hard to objectively identify pain points when you're not super comfortable with the syntax itself. I think React docs are a great example of well-written, informative docs but I've never read them not knowing JS quite well.

pasi12:05:50

in the spirit of trying to actually give some useful feedback.. some of the docs are bit heavy on jargon and occasionally I felt like some extra info would be great. I'm talking about https://github.com/omcljs/om/wiki/Quick-Start-(om.next) specifically here: >"The reconciler accepts novelty". Novelty? What? A quick explanation of what novelty means here would help a lot. The routing section is okay content wise but a lot of "web app people" probably associate "routing" with views, rather than client-server side information transfer. Parsing & query expressions chapter could maybe provide a little more context and quickly gets quite technical. I guess explaining what "parsing" means in the context of client-server architecture would help. Also little more time could maybe be spent on explaining query expressions.

claudiu12:05:59

@pasi also, for getting started I found the Overview of Om Next and om tutorial most helpful. First link from community resources https://github.com/omcljs/om/wiki

danielstockton12:05:28

@pasi I think routing is used in the usual context in the docs i.e. switching views.

pasi12:05:32

I should add that so far I really like the ideology of Om next and at the very least, I hope I can take some of its thinking back to JS world.

jimmy12:05:23

@danielstockton Don't get me wrong, om.next is really good. I have worked with 3 frameworks. Just to make sure if he/she is a newcomer, they can start with those 3 frameworks then go further exploring om.next. It would be more encouraging.

adamvh15:05:49

@pasi you may want to look at untangled-web

adamvh15:05:00

which is a framework built on top of om next

adamvh15:05:53

om next itself is powerful and flexible, but also somewhat bare-bones. untangled makes some opinionated choices to make the "getting started" process easier, and, as a bonus, there's a sweet dev guide that you clone that comes with a bunch of live-reloading examples

pedroteixeira22:05:54

anyone know if is https://github.com/arohner/om-html the "current way" to use hiccup like sintax with om.next? or is there a better alternative? I had to patch this one to work with latest clojure spec.alpha

fz23:05:36

Is it safe to directly invoke the :action of a mutation function from another to "chain" mutations? Is this the best/recommended way to chain mutations?

(defmethod mutate 'bar [_ _ _] {:action (fn [] …)})
(defmethod mutate 'foo [_ _ _] (((mutate 'bar '_ '_ '_) :action)))

anmonteiro23:05:15

@fz can’t you (om/transact! this [(foo) (bar)]) ?

fz23:05:52

I don't think so … in this case, this is being used as an Untangled post-mutation, which AFAIK only allows a single symbol. Happy to ask in #untangled if this question is more specific to that …