om

Please ask the channel first, not @dnolen directly!
Desmond 2017-11-10T01:56:41.000193Z

Hi im trying to set up om next with a remote api backed by datomic in a way where i can run the same datalog queries in the browser or on the server. Somehow i got the impression that this would be possible and is even an intended use case thanks to datalog. Its a beautiful idea im just struggling to get it working in the real world. Has anyone done this? Also could anyone point me to some publicly accessible sample code?

Desmond 2017-11-15T06:01:17.000219Z

I realized my mistake was that im not using the pull syntax

ajs 2017-11-10T12:05:15.000085Z

I've been using Om Now on an enterprise project for three years. Now evaluating more modern tools for migration/updating of the project, including reagent, reframe, Om next and rum. Can anyone comment on why you chose Om Next as your library for React?

sundarj 2017-11-10T12:09:08.000176Z

@ajs the model is very simple, and imo rather elegant. i also found it pretty easy to learn. Fulcro (https://fulcrologic.github.io/fulcro ; based on Om Next) is fantastic as well

🦜 1
ajs 2017-11-10T12:09:33.000264Z

Reagent also seems pretty easy

ajs 2017-11-10T12:09:44.000277Z

But Om is more explicit, and I prefer that

sundarj 2017-11-10T12:10:29.000153Z

reagent/re-frame are easier for sure (hence their popularity), but om next is simpler

sundarj 2017-11-10T12:10:53.000071Z

depends what your priorities are

ajs 2017-11-10T12:11:15.000336Z

I see you are making a distinction between easy and simple

sundarj 2017-11-10T12:11:27.000061Z

indeed 😉

sundarj 2017-11-10T12:12:39.000151Z

om next is rather more opinionated, and thus not as familiar. so there is that initial leap, which makes it less easy

ajs 2017-11-10T12:13:07.000012Z

Haven't read the fulcro docs yet but I went thru the Om Next tutorial and it seemed straightforward, yet I read that fulcro adds the missing pieces. What would this missing pieces be?

sundarj 2017-11-10T12:14:13.000006Z

om next is a bit low-level and customisable, which means there is quite a lot of boilerplate and plumbing required to use it directly. fulcro makes a lot of decisions for you, and removes that boilerplate/plumbing

sundarj 2017-11-10T12:14:59.000046Z

fulcro also provides things like routing, networking, colocated initial state, colocated css, and i18n for you

ajs 2017-11-10T12:15:00.000357Z

In reagent I don't like that there is a lot of implicit ambiguity. I think Om Next follows Om Now in being explicit? In reagent, an argument can be a prop, or a child, or neither, just a fn arg for other purposes. I suppose at run time reagent is having to always figure out how to treat args.

sundarj 2017-11-10T12:16:00.000028Z

yeah i would not use reagent directly. re-frame seems decent enough though

ajs 2017-11-10T12:16:41.000061Z

What is i18n?

sundarj 2017-11-10T12:16:57.000068Z

internationalization; support for multiple languages

sundarj 2017-11-10T12:18:19.000023Z

if you haven't seen this yet: https://www.infoq.com/presentations/Simple-Made-Easy i highly recommend it

sundarj 2017-11-10T12:18:39.000105Z

it's rich hickey's best talk imo, and it's a big part of the reason i decided to learn clojure

ajs 2017-11-10T12:19:06.000040Z

Have indeed seen it

sundarj 2017-11-10T12:19:19.000149Z

ah, great 😁

ajs 2017-11-10T12:43:12.000433Z

One thing I like about reagent/reframe is that if two or more components need the results of the same query or calculation, it is only done once and then delivered multiple times. Haven't poured enough into Om Next queries to know if something similar happens there.

ajs 2017-11-10T12:43:48.000257Z

I'm guessing not since queries are mainly just a way to access data but calculations would be separate from that.

sundarj 2017-11-10T12:44:43.000060Z

yep that is how om next queries and mutations work too, if i understand you correctly

ajs 2017-11-10T12:45:21.000056Z

Cool, still some learning to do there

ajs 2017-11-10T12:45:51.000136Z

What's the best source for good tutorials in Next?

sundarj 2017-11-10T12:46:27.000040Z

the Om wiki is good, and the Fulcro Getting Started and Dev guide

sundarj 2017-11-10T12:47:04.000341Z

since Fulcro is based upon Om Next, much of the Fulcro docs applies to stock Om Next

claudiu 2017-11-10T13:55:23.000323Z

@ajs Fulcro also has some great getting started videos 🙂

👍 1
ajs 2017-11-10T21:26:19.000172Z

Why is increment in parens here, from the Om getting started: (om.next/transact! reconciler '[(increment)])

ajs 2017-11-10T21:26:40.000513Z

The mutation looks for a key of just 'increment, quoted.

ajs 2017-11-10T21:27:25.000036Z

But that looks like a fn call

sundarj 2017-11-10T21:32:31.000310Z

@ajs that is just how transactions look. you can also pass them params like '[(mutate {:a 1}) (other-mutate {:b 2})]

ajs 2017-11-10T21:34:35.000019Z

Ok guess I'll need to see more sample apps

sundarj 2017-11-10T21:34:46.000038Z

they do look like function calls, but are just data

ajs 2017-11-10T21:35:12.000222Z

The entire contents of the paren is the single key?

sundarj 2017-11-10T21:35:46.000310Z

the mutation key and the transact mutation syntax are distinct things

sundarj 2017-11-10T21:37:18.000116Z

(-> '[(foo)] first first)
foo

(-> '[(foo)] (conj '(bar)))
[(foo) (bar)]

sundarj 2017-11-10T21:38:12.000108Z

there is a full explanation of query syntax here: https://fulcrologic.github.io/fulcro/guide.html#!/fulcro_devguide.D_Queries

ajs 2017-11-10T21:38:30.000124Z

Thanks

👍 1
sundarj 2017-11-10T21:40:08.000140Z

@ajs and here is the doc on mutations: https://fulcrologic.github.io/fulcro/guide.html#!/fulcro_devguide.G_Mutation