Fork me on GitHub

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)?


@U0CK4CKAP I think this might be a bug in compassus. The 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.


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.


please open a ticket with a minimal example


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


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


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


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


Another repro, showing transact in parent working but not in child: It all seems to work fine in and in the previous repro which was just using a compassus parser but not compassus/app, it didnt work in either parent or child.


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


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?


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


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


no, you do not - they're distinct


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


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


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 ;)