om

Please ask the channel first, not @dnolen directly!
levitanong 2017-08-06T02:23:50.219093Z

@cjhowe We’ve built something with oracle, even. Oracle itself is a nightmare, but we’ve made it work. You can run the parser in the backend. For a great example, see here: https://github.com/anmonteiro/om-next-fullstack

claudiu 2017-08-06T05:55:38.849233Z

@cjhowe Working on a project with mysql, no idea about datomic but compared to graphql where you write strings I really love om-next queries and full stack story. Om-next is a bit harder to grasp, but think it's really worth it in the long run (I'm going with fulcro).

2017-08-06T06:35:54.962337Z

ah yes, i heard about fulcro earlier! it's definitely a good project to help with grasping om-next

claudiu 2017-08-06T09:10:27.447760Z

personally like it more. Having queries as read only from local db, seems like a nicer flow, that easier to reason about/debug. Initial state + helper functions make the developer experience a lot nicer 🙂

claudiu 2017-08-06T09:11:37.451666Z

can do that in om-next, but then again, since I like it and it's already written, tested & extensively documented. No point in reinventing the wheel.

claudiu 2017-08-06T09:13:33.457965Z

@cjhowe regarding you question with mysql/datomic. There is also a section in fulcro getting started with examples on how to use it with legacy 'restfull' endpoints (should apply to om-next also).

luchini 2017-08-06T14:21:51.582599Z

I’ve been doing a considerable amount of research over Om-next because the concepts in there are brilliant and potentially great in my line of business.

luchini 2017-08-06T14:23:51.591771Z

I did trip big time recently on something that didn’t seem very clear to me and my team. It seems to be some deep architectural decision that escaped me initially. It spawns out of this on the source: https://github.com/omcljs/om/blob/master/src/main/om/next.cljc#L1589

luchini 2017-08-06T14:25:04.597174Z

> “`transact!` should be called on a component that implements IQuery or has a parent that implements IQuery

luchini 2017-08-06T14:26:39.603893Z

But here’s where it can get confusing. We have a parent that does implement IQuery and a few children that also implement IQuery. The parent’s query is defined combining a series of om/get-query

luchini 2017-08-06T14:27:45.608756Z

In that scenario, if a transact! is triggered from one of the children, the query sent to the parser will be based on the child’s query instead of the parent’s.

luchini 2017-08-06T14:28:10.610597Z

As a user of Om next, there are 3 alternatives to deal with it:

luchini 2017-08-06T14:28:46.613523Z

1. Have an intermediate component between parent and children that does not implement IQuery (it seems to be the way in most tutorials and examples)

luchini 2017-08-06T14:29:15.615541Z

2. Pass a reference to the parent down to the children and make sure transact! is being called on the parent instead of this

luchini 2017-08-06T14:29:56.618629Z

3. Use get-reconciler on the children components to get the root reconciler to pass to transact!

luchini 2017-08-06T14:31:14.625426Z

I’m not totally sure these options really make much sense when explaining Om next to others

luchini 2017-08-06T14:31:52.628348Z

Am I doing something wrong? Did I miss something here? What are your thoughts?

claudiu 2017-08-06T15:25:59.882706Z

@luchini I usually have actions in the parent and send them to children through om/computed. So basically most of the children are dumb in regards to actions.

claudiu 2017-08-06T15:27:10.888455Z

or if you want a refresh on a high level parent component, just add one of the keys the parent has in it's query in transact and it will get updated.

luchini 2017-08-06T15:42:23.959615Z

Interesting @claudiu. I was not familiar with computed. This is an interesting approach.

luchini 2017-08-06T15:44:16.968072Z

It does require a bit more of wiring though and reusability of the child component is now dependent on the interface provided by the parent through the computed props

luchini 2017-08-06T15:45:58.975809Z

I wouldn’t personally mind the mutation query leaking down to the child component because supposedly that’s the main abstraction point anyway (the same way that the IQuery of the component is an abstraction in itself)

luchini 2017-08-06T15:46:49.980092Z

Do you do it this way just to avoid this particular issue or do you have other uses too?

claudiu 2017-08-06T15:47:59.985342Z

that's the way I usually do it in javascript also. Not om-next particular.

claudiu 2017-08-06T15:48:10.986220Z

For example: listing of articles, with delete option. If I use the article component in 3 different listings, the delete functionality might be different. The listing element should not know about it's context, it just gets a onDelete.

luchini 2017-08-06T15:49:28.992081Z

Yes. I’ve done that in JS a lot. I was hoping om-next would remove the need for that abstraction (by having its own separate abstraction system) 😄

claudiu 2017-08-06T15:50:50.998844Z

😄

urbank 2017-08-06T15:51:20.001276Z

@luchini This might be a bad idea, but you could pass a partially applied transact to the child component

urbank 2017-08-06T15:52:05.004824Z

partially applied to the parent component (partial om/transact! parent-this)

luchini 2017-08-06T15:58:34.037380Z

True… 🙂 It’s like option 2 above… but fancier 😄