This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-17
Channels
- # admin-announcements (9)
- # beginners (96)
- # boot (77)
- # cljs-dev (23)
- # cljsrn (18)
- # clojure (206)
- # clojure-austin (7)
- # clojure-conj (5)
- # clojure-japan (7)
- # clojure-poland (13)
- # clojure-russia (130)
- # clojure-taiwan (1)
- # clojurescript (125)
- # cursive (13)
- # data-science (2)
- # datascript (3)
- # datomic (2)
- # hoplon (24)
- # immutant (5)
- # jobs (4)
- # ldnclj (3)
- # ldnproclodo (2)
- # off-topic (2)
- # om (70)
- # onyx (12)
- # re-frame (6)
- # vim (2)
I'm getting this error when I compile with optimizations advanced. I've been compiling with advanced for a while, so I'm wondering if there's a gotcha I'm missing?
Uncaught #error {:message "No queries exist for component path (#object[jz \"function jz(){React.Component.apply(this,arguments);this.state=null!=
I got that error (non minified) when I transacted in a component where in the query tree it has an ancestor component but in the render tree I short-circuit one of the components by pulling the data out myself and passing to its child. I’m not sure if that is a possibility in your app.
I mean if you got the root query of my app, one of the queries in there came from component X with subcomponent Y, but in my render implementations, I never render X, I just pull out the data correctly to render Y so that Y gets the correct data. If you do that and then try to transact from Y you will get the no queries error.
It all worked until I added a transaction in Y though so I didn’t notice the bug for a while.
hmm, what I am doing is building on https://github.com/jdubie/om-next-router-example and added query params to the page query. I call (set-query! ...) just before doing the (transact! [(route-update ...)]) But all of that happens in the query and render root component
maybe I'll try a minimal mod to that example to capture the idea and see how it works
Well, you also get that error anytime you transact from a component without a query. So the menu-entry from that example for instance.
but if the root component passes a callback to a query-free component, it can call that function which will trigger the transact that's closed over the root's "this", right?
I would expect that you can also have components with queries as children of queryless components but I haven’t tried that.
hmm, actually it seems to be happening in the (set-query! this {:params ...}) that's called in the callback
Huh, I think it’s a bug in Om. I just compiled my app with advance optimizations and one of my transactions that works with optimizations :none also throws that error.
I just wrote some Reagent, and there I have to specify the key explicitly, which makes good sense, since it’s a way for React to know which DOM nodes to mess with when a collection of components is updated.
do you mean React child keys?
@anmonteiro: yes, exactly
look into factory
it supports a :keyfn
to use for the react key
Maybe there’s something I’m missing, but React cannot know if a piece of data that had index k
in one render cycle now has index k+a
in the next render cycle. How can Om know this?
Okay, but compared to React, Om doesn’t warn if there’s no :keyfn
or :react-key
specified? That seems like a defect?
It falls back to generating the key from :om-path
which is more or less like indexes but I could be wrong.
Yes, exactly. React chooses not to use a fallback mechanism. I guess it’s just one of those places where Om is opinionated.
@dnolen: https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L260 - shouldn't that be idx (:om-path (meta props))
?
@joshfrench: Mutation...I was wrong on the shrugged thing
the action is needed on server, too, since parser might run more than once...needs to be side-effect free
i haven’t worked with datomic much but in that case i don’t see how you’d be able to refer back to the transaction from outside of that fn
@joshfrench: I agree. I'm at the conj. I'll ask David about it.
thanks!
He gave a great talk (for me at least)...very rapid, but covered a lot of bits and fleshed out the story nicely if you watch it in slo-mo
The video is still being processed, but here's the link for @dnolen 's talk: https://www.youtube.com/watch?v=MDZpSIngwm4
re: that tempid migration problem i had yesterday, i’m pretty sure it has to do with unions. a simple example works fine, but when i throw unions into the mix i get that behavior where it nukes my app state. i think the telling clue is that when i make a mistake in the simple non-union version, it simply fails to migrate the IDs; it doesn’t blow away my data. https://gist.github.com/joshfrench/3c83bc0f40348dfd528b
@joshfrench: Ah! I never tested tempid migraiton and unions, I guess it's quite possible that they break migrate.
i’ve found other bugs with unions, so very well could be. filed an issue for it.
but thanks for your examples @jannis, they were very helpful in verifying that my transactions were all in the right shape
@jannis: @joshfrench Hey, on the action/tempid/Datomic thing. Just talked to David. It is a TODO to allow collection of return values from actions as part of parse, so that you can post-act on it before sending a response to the client
so, workarounds/hacks are the only way to do it at the moment, but it is intended to eventually go in action
@joshfrench: probably just a bug, will need to look into that
Hi, I think there is a typo on the https://github.com/omcljs/om/wiki/Queries-With-Unions page.
the querey example in the repl starts (in-ns 'om.tutorial.core) when I think it should say (in-ns 'om-tutorial.core)
@tony.kay: thanks for clarifying!
i am working on some docs pages that are just a wrapper around your wiki, because I saw there was an open issue about it. is there a om logo. I am just going to use blue and green like clj/cljs logos.
FYI: My Om Next Overview has been updated to include recent changes in naming. I'm working on the some docs for Mutation and Remotes next...coming soon.
@tony.kay: Your overview has been really helpful–thanks for putting that together