This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-18
Channels
- # bangalore-clj (1)
- # beginners (36)
- # boot (119)
- # braid-chat (16)
- # cider (14)
- # cljs-dev (34)
- # cljsrn (7)
- # clojars (9)
- # clojure (91)
- # clojure-austin (1)
- # clojure-bangladesh (1)
- # clojure-dusseldorf (5)
- # clojure-israel (1)
- # clojure-russia (3)
- # clojure-spec (6)
- # clojure-uk (7)
- # clojurescript (11)
- # community-development (1)
- # core-async (5)
- # cursive (6)
- # datomic (11)
- # dirac (12)
- # funcool (24)
- # leiningen (5)
- # luminus (5)
- # off-topic (2)
- # om (69)
- # om-next (16)
- # overtone (4)
- # perun (19)
- # re-frame (23)
- # reagent (38)
- # specter (7)
- # uncomplicate (9)
- # yada (4)
@peeja https://github.com/compassus/compassus/commit/b63876a806bb03b3e462754136bfcd24fdf2001b
Uh oh. Now I'm getting the dreaded error: No queries exist for component path (compassus.core/ui_32146 frontend.core/ProjectsPage frontend.core/OrgListItem) or data path [:compassus.core/route-data :app/current-user :user/organizations]
It appears to be because the props have the path [:compassus.core/route-data :app/current-user :user/organizations]
, but the indexer has indexed the component as [:compassus.core/route-data [:app/current-user _] :user/organizations 0]
.
I don't think my parser's doing anything wrong; the structure of its response is what comes out of db->tree
@peeja looks like a bug, but I thought we never constructed paths with links in the indexer
can you produce a minimal case?
I think so
@peeja actually I see the bug https://github.com/omcljs/om/blob/master/src/main/om/next.cljc#L1786
but this one might not be that simple to figure out, can you open an issue?
@peeja that test is supposed to fail
that’s not the bug
class-path != data-path
the query should contain the link
the data path maybe shouldn't
but this is a tricky one
that’s probably right
this condition should probably flatten the links it finds
cljs.user=> (om/focus->path [{[:a '_] [{:foo [:b :c]}]}])
[[:a _] :foo]
this is probably right
that’s the actual path of the query
so for the tweak should happen in full-query
@peeja probably worth tweaking the issue title and description, seems a bit misleading now that we have this information
BTW it’s really great you approaching all this from a new angle
I appreciate we finding all these bugs before beta 🙂
Huh, are there any tests that call full-query
? I don't see any. Should the test be at a different level?
@peeja there are no tests for full-query
, probably worth adding some
problem is that we need an assembled indexer to call it 🙂
you can probably get away by using with-redefs
for get-indexer
because you want to test at the point that we already have qs
that make sense?
(Component. #js {:omcljs$reconciler r :omcljs$path [the path you want the component to have]})
@peeja and there’s a slightly different version for the :clj
branch
you can find it in the test suite
Okay, updated with correct info (as far as I know) and a test: https://github.com/omcljs/om/issues/773
@peeja try applying the commits on these 2 branches and see if your issues are gone: https://github.com/anmonteiro/om/tree/om-772 https://github.com/anmonteiro/om/tree/om-773
@anmonteiro 773 works great for me. 772 still has one problem: if there's a component with that ident as its ident
, and there's a component with the ident in its query, the logic short-circuits and fails to find the second one. Here's a version which finds both: https://github.com/Peeja/om/commit/23556d04f8bd1b1e62784c3aefef1b0b57226fae
@peeja yep, definitely an overlook. Thanks for the added test, I’ll use that to fix the PR
.. and ping you when it’s done!
@anmonteiro There's implementation on there too, if it looks good
will have to study it carefully
It's just a union of the two searches. There's no keyword?
or ident?
check, but I don't think that check is really necessary: if you supply a bogus key, you just won't find anything in the index.
@peeja yeah I’ve noticed that, and I agree
still have to look more closely because of perf reasons
e.g. set/union
might not be as performant as into
with a transducer
I’ll look in a few
It probably should be, whether it turns out to be or not. If you find it isn't, that may be worth raising as a ClojureScript issue.
Oh, actually, it looks like it's almost literally into
: https://github.com/clojure/clojurescript/blob/r1.7.170/src/main/cljs/clojure/set.cljs#L19-L29
@peeja into
with sets just works fine so no need to introduce the clojure.set
dependency at all
cljs.user=> (into #{1 2} #{3 4 2})
#{1 2 3 4}
other than that the code is almost the same as yours, just s/union/into