om

Please ask the channel first, not @dnolen directly!
2017-07-26T11:11:26.872777Z

I'm returning an ast from one of my parsers (associng some params). Does anyone know why the first read is sent with params but when I (om/transact! this [:the/read]) it only sends :the/read to the backend (params missing)?

2017-07-27T09:19:33.620343Z

@anmonteiro I think this might be a bug in compassus. The om.next parser is called twice and the second time it has a different read function. This read doesn't go through my parser and returns a different ast to the one i'm returning.

2017-07-27T09:30:51.888914Z

The second read adds a :query key to the ast which has the correct query with params, but the params are not present in the top level of the ast.

anmonteiro 2017-07-27T16:44:40.756307Z

please open a ticket with a minimal example

2017-08-01T09:57:58.939952Z

Sure, will do.

2017-08-03T09:07:55.500706Z

I have a simple repro but I'm not sure if it's a bug: https://gist.github.com/danielstockton/e4687846f5e3df140fe192fd5fbe336d

2017-08-03T09:08:09.506313Z

The cause seems to be transacting on a component which doesn't have a query.

2017-08-03T09:08:23.511747Z

If I move the transact into the Index component, it works perfectly.

2017-08-03T09:09:04.528275Z

Actually, i'll try removing compassus too, because im not sure if it's a compassus or om problem.

2017-08-03T09:24:46.898274Z

Yes, it's definitely a bug in compassus/parser and I have a simpler repro.

2017-08-03T09:25:59.926846Z

https://gist.github.com/danielstockton/f52f87ac604d3523f10100b964b8b957 If you just change compassus/parser to om/parser it works.

2017-08-03T09:34:48.135025Z

Another repro, showing transact in parent working but not in child: https://gist.github.com/danielstockton/5037d2063b16e81cd067b78d7fff4de0 It all seems to work fine in om.next and in the previous repro which was just using a compassus parser but not compassus/app, it didnt work in either parent or child.

2017-08-03T09:38:35.222844Z

@anmonteiro

2017-07-26T11:11:57.882290Z

I've added a print to my parser and it returns the exact same ast in both cases.

joelgluth 2017-07-26T11:14:55.935928Z

happy to see @bensu here, as one of the answers to my question might be “understand doo”. In general, I want to do some testing of the rendered output of my Om components. Part of my problem is almost certainly that I don’t understand React’s behind-the-scenes behaviour. If I call om.dom/div from within my cljs test in doo just to see what happens (I’m not expecting anything to render here, I just want to see what comes back), doo times out and dies, I assume because some runtime thing is missing - so I guess I need to figure out how to call my Om component functions from the right kind of running React context. Then, next, figure out how to render them individually. Is anyone using cljs.test to do testing of rendered output?

joelgluth 2017-07-26T11:16:13.960536Z

(I realise the meta-mistake here is “attempt to learn React by learning Om instead of before learning Om”, but I’m here now.)

joelgluth 2017-07-26T12:09:48.975233Z

Never mind - I found this https://github.com/bensu/cljs-react-test

joelgluth 2017-07-26T12:09:58.978772Z

Cheers @bensu 🙂

bnvinay92 2017-07-26T13:57:28.136308Z

Do I need to go through om tutorials before going through om-next tutorials?

sundarj 2017-07-26T14:02:03.317678Z

no, you do not - they're distinct

👍 3
2017-07-26T18:03:00.740751Z

Hi @joelgluth, I haven’t worked on that library on a while so the bindings to React.test might be old

2017-07-26T18:03:46.769968Z

but your question is more about the procedure on how to test the render function of components and the examples in that project should show you the structure. Ping me if you have any questions

👍 1
joelgluth 2017-07-26T19:08:27.125721Z

Yup. Got it working with your versions this afternoon, thank you for showing the way forward! I'll have a look at how far it's drifted from current Om tonight; might be one of those "only still working by accident" situations ;)