This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-28
Channels
- # arachne (2)
- # aws (5)
- # aws-lambda (5)
- # beginners (4)
- # boot (25)
- # cljs-dev (270)
- # cljsjs (1)
- # cljsrn (72)
- # clojars (5)
- # clojure (201)
- # clojure-belgium (5)
- # clojure-brasil (4)
- # clojure-italy (2)
- # clojure-korea (2)
- # clojure-russia (24)
- # clojure-spec (24)
- # clojure-uk (22)
- # clojurebridge (1)
- # clojurescript (125)
- # cloverage (3)
- # cursive (41)
- # datomic (37)
- # dirac (4)
- # emacs (2)
- # hoplon (421)
- # lein-figwheel (1)
- # leiningen (5)
- # luminus (2)
- # mount (1)
- # off-topic (18)
- # om (44)
- # om-next (4)
- # onyx (44)
- # pedestal (3)
- # proton (9)
- # re-frame (21)
- # reagent (21)
- # ring-swagger (12)
- # specter (9)
- # sql (2)
- # untangled (62)
- # vim (16)
@peeja I had ran into a similar issue regarding the aliasing, my solution was to create what I call "placeholder nodes", a placeholder node will move the join one level down, but still remain at same logical access level, in your case for example, the solution would be to write the query as [{:ph/user-for-subcomponent [{:app/current-user (om/get-query User)}]} {:app/current-user [:user/name]}]
in my parser, I treat any keyword with a ph
namespace as a placeholder node, it calls the parser again sending the children
@wilkerlucio Yeah, I've been thinking about doing something like that.
@peeja cool, please let me know if figure another way of doing it
@anmonteiro FWIW, I'm configuring our parser to skip over the root keys (the route key) in its queries and read route component queries as if they were at the root. In fact, I'm not sure why it's terribly useful to have the root key of the queries my parser sees be the route key. If that turns out to be a common pattern for Compassus users, maybe it would be worth having an option that would treat route component queries as root queries built into Compassus?
@peeja let me see if I understand what you’re saying. You mean that if you have this (sub)query:
{:index [:page/title :page/content]
:about [:page/title :page/content :other/key]}
you’re making the parser ignore :index
and :about
and dispatch on the specific keys that make the underlying route query?gotcha
definitely open to think about a knob to handle that in Compassus
feel free to open an issue
I want each route to have access to the same keys, which (roughly) match the root keys of the app state
@peeja also I think at this point you already have some knowledge on the inner workings of Compassus? 🙂
if that’s the case, feel free to suggest alternatives
I think this is actually something we could solve easily in: https://github.com/compassus/compassus/blob/master/src/main/compassus/core.cljc#L131
instead of returning [{route subq}]
, just return subq
@peeja it would be great if we could just infer this based on the type of parser that the user is feeding us
PRs more than welcome as long as you include tests!
@peeja “type” is probably the wrong phrasing
I’m thinking about somehow inferring that your app feeds a parser like what you described above so we should just dispatch on the subq
but that’s probably not a very good idea as it would not be a very self-documenting behavior
also not sure if there’s some sound heuristic to infer that, given that parsers can either be simple functions, multimethods, core.match
matchers etc.
There's also nothing stopping you from using a key as both a route key and a key in the route's subquery
It's unfortunate that there's no way to call a parser and get its mutation description (`:value` and :action
) without actually executing the action
that would be acessable from the defmulti if its accessable at all? Dont know much about metadata on multimethods.
@anmonteiro that was a really fast response. I’ll play with that idea https://anmonteiro.com/2016/01/exploration-patterns-om-next-part-2
yeah, I got the email
and BTW, thanks for the server side rendering work. it makes playing around and testing so much easier
by the way, @anmonteiro any chance you could follow up with david on the contributor agreement? 😛
@levitanong I don’t have special access to him or anything, he’s normally responsive when you ping him here for example
Oh, okay then!
@dnolen Hello! Sorry to bother you, but I sent you an email a few days ago about the contributor agreement. Have you received it?
@dnolen Hurrah! Thanks 😄
Is it expected behavior for a Component defined by defui to have a different value when referenced in a static method vs non-static method?
(defui Component
static SomeProtocol
(protocol-imp [this] (println Component)) ;; returns some expected representation of Component, complete with meta
Object
(render [this] (println Component))) ;; returns some fn
hmm, if a transaction re-reads an some attribute for an entity and the server doesn’t respond with the entity’s ident attribute, the data won’t get properly normalized. Does this mean the server needs to both know what attribute is being used as part of the entity’s ident and that it should always be included in the response?