This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-24
Channels
- # admin-announcements (1)
- # aws (3)
- # beginners (52)
- # boot (150)
- # braid-chat (1)
- # braveandtrue (5)
- # bristol-clojurians (2)
- # cider (21)
- # cljs-dev (1)
- # cljsfiddle (1)
- # cljsjs (5)
- # cljsrn (4)
- # clojars (3)
- # clojure (236)
- # clojure-berlin (2)
- # clojure-czech (1)
- # clojure-madison (1)
- # clojure-russia (164)
- # clojure-sdn (1)
- # clojure-sg (2)
- # clojure-uk (64)
- # clojurescript (149)
- # core-async (31)
- # cursive (33)
- # datomic (2)
- # devcards (5)
- # funcool (3)
- # hoplon (142)
- # immutant (27)
- # juxt (7)
- # lein-figwheel (6)
- # liberator (6)
- # off-topic (4)
- # om (46)
- # onyx (26)
- # parinfer (5)
- # perun (56)
- # proton (6)
- # re-frame (19)
- # reagent (1)
- # remote-jobs (12)
- # ring-swagger (17)
- # slack-help (2)
- # spacemacs (11)
- # specter (1)
- # untangled (11)
- # yada (3)
anmonteiro: here ya go : http://pastebin.com/VsFqtzZR
@seanirby: it's OK
Now I want to see the queries of your components
anmonteiro: http://pastebin.com/1bBUCGvX The query in question is marked near the bottom
@seanirby: let's do it like this, if you could
provide the defui
implementation without the Object
methods
and the initial state you're passing in
to the reconciler
anmonteiro: http://pastebin.com/3W5YSVuk
@seanirby: perfect, thanks
@seanirby: hrm your data is partially normalized
that's where the error is happening
i guess i assumed that it would work since the data i needed normalized was normalized without issue
well calling tree->db
from the root assumes you want to normalize everything
you might want to normalize your data outside of add-root!
and pass it as an atom to the reconciler
i.e. normalize what's not normalized
merge what's normalized
pass that as the state
i wanted to model this data as how I imagine it would appear from the server. i figure having it partially normalized would be the most efficient
really depends on what the server is returning, doesn't it?
anmonteiro: well its got to be something else. I tried both normalizing only whats necessary like you suggested and I also tried passing in 100% non-normalized data. Both cases result in the same error
I have the following query in a children component: (query [this] '[(:repository {:query ?language}) (:code {:language ?language :repository-full-name ?repository-full-name}) (:language) (:repository-full-name)]) How can I query this in the root component? If I try to do in the root component: (query [this] [(om/get-query children/Children)]) It doesn't work and gives me: No method in multimethod 'haxlife.query/read' for dispatch value: (:repository {:query nil})
If you had a :default multimethod or used a case statement you would be able to debug exactly what is coming in. That might give you some feedback/understanding of how to 'catch' all the keys. You could stick with a case statement as well. It does seem tricky to be catching them when parameters are involved. I've never used parameters so can't help much more.
@cjmurphy: I can see that the issue is with (:repository {:query nil}), but I wonder why the params aren't getting passed as they should
@dnolen: there's an issue (#605) for
(focus->path (focus-query [{[:person/by-id 2] [:id :name]}] [[:person/by-id 2]]))
;; => [:person/by-id] (instead of [[:person/by-id 2]])
may I ask what's the reason behind the current behavior? It seems to me that the change required to make this work is minimal (just remove this line: https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L163 )So, I’m trying to create a form with ON (as the cool kids call it) and a variant of set-query! routing approach outlined by @anmonteiro, the sub component uses local state to keep the intermediate/edited values and I keep seeing "Uncaught #error {:message "No queries exist for component path (pp.core/Root pp.views.integration/EditIntegration)", :data {:type :om.next/no-queries}}” in a variety of situations such as the submit handler and previously when trying to set state at various times in the lifecycle/process … unfortunately a simple example that exhibits the error might be hard to produce (I’m messing with the query in the root view and the local state in the sub/form-editing view) but what might that error mean and what might cause it? Anybody have a good example of a more involved form (than the todomvc example) or a better approach? Thanks in advance.
@juliobarros: which Om version?
@anmonteiro: looks like alpha31
@juliobarros: normally that error means wrong query structure
Ok. Thats possible. I’ve tried different variations of this approach and the current version manages to navigate to the form with the selected item and then gives that message when I try to edit a field. With my tenuous understanding the query is not being changed just the state and the field that renders that piece of the state. … I’ll have to investigate further.
@anmonteiro: btw, thanks for that article. Is there an approach that you would “recommend”. My first thought was that the union query would prefetch data we might not need, and subquery seems to have a that refs limitation.
@juliobarros: I'm happy to have a look at the queries for the 2 components you mentioned and help you figure out what's wrong
wrt. the routing article, the subquery
approach is definitely not for all cases
the set-query!
approach seems to be the most popular, although I have to say I like the union approach best
and you don't need to prefetch unneeded data. If you have the current route in your app-state you can filter the query branches in your parser
Thanks for the info. I may try to implement the union approach to see how I like that. And thanks for the offer, let me study my code a bit more, I could be doing something obviously wrong. My thought was “Its complaining about the query, but I’ve already navigated to this component and modified the query. I’m only trying to mess with the state now … what could be the missing piece”. Thanks again.