This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-26
Channels
- # bangalore-clj (1)
- # beginners (12)
- # boot (48)
- # cider (56)
- # clara (1)
- # cljs-dev (15)
- # clojure (455)
- # clojure-austin (2)
- # clojure-dev (33)
- # clojure-italy (26)
- # clojure-nl (6)
- # clojure-poland (10)
- # clojure-russia (23)
- # clojure-spec (33)
- # clojure-uk (62)
- # clojurescript (37)
- # code-art (2)
- # cursive (12)
- # datomic (48)
- # funcool (1)
- # juxt (16)
- # leiningen (13)
- # off-topic (12)
- # om (23)
- # onyx (16)
- # other-lisps (5)
- # parinfer (2)
- # pedestal (28)
- # re-frame (60)
- # reagent (8)
- # ring (1)
- # ring-swagger (15)
- # spacemacs (5)
- # specter (53)
- # test-check (2)
- # unrepl (8)
- # vim (14)
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 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.
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
Sure, will do.
I have a simple repro but I'm not sure if it's a bug: https://gist.github.com/danielstockton/e4687846f5e3df140fe192fd5fbe336d
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.
https://gist.github.com/danielstockton/f52f87ac604d3523f10100b964b8b957
If you just change compassus/parser
to om/parser
it works.
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.
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.)
Never mind - I found this https://github.com/bensu/cljs-react-test
Hi @joelgluth, I haven’t worked on that library on a while so the bindings to React.test
might be old