This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-26
Channels
- # aws (1)
- # beginners (15)
- # boot (30)
- # cider (13)
- # cljsrn (16)
- # clojure (458)
- # clojure-dev (15)
- # clojure-france (131)
- # clojure-greece (124)
- # clojure-korea (2)
- # clojure-spec (42)
- # clojure-uk (115)
- # clojure-ukraine (1)
- # clojurescript (103)
- # component (18)
- # cryogen (1)
- # datomic (4)
- # dirac (3)
- # figwheel (1)
- # funcool (13)
- # hoplon (60)
- # luminus (2)
- # off-topic (2)
- # om (28)
- # onyx (45)
- # parinfer (28)
- # pedestal (1)
- # proton (23)
- # re-frame (18)
- # reagent (36)
- # ring (1)
- # ring-swagger (5)
- # untangled (13)
- # vim (9)
@anmonteiro Compassus code is very elegant and pleasant to look at! Lots of test code too!! Congrats and thank you for writing such amazing free software with amazing doc I may add. I really enjoyed reading your blod about om query syntax earlier today as well. You are very talented š
Happy to help :-)
(om.next/class->any reconciler SomeComponent) doesn't always return a component. Through trial and error, I realize that components that aren't rendered aren't found. That's probably expected. Since I have components that only exist so they can have a query and query params, what do I need to do to be able to find those components?
@alpheus Just a stab in the dark really, but maybe render something invisible as a workaround? like a hidden input or something...
@alpheus What are you using instantiated-but-not-rendered components for that you can't use the class for?
Hello, beginnerās question here: I have trouble understanding how the om.next parserās read function works. Iām looking at example in https://github.com/omcljs/om/wiki/Components,-Identity-&-Normalization: the Person componentās IQuery is [:name :points :age], however, there is no implementation of the read multimethod for these keys (not even the default one). I was expecting that the read fn gets called for each key in componentās query, but that seems to be wrong? Whatās the point in specifying keys in the IQuery that are not handled by the read fn?
@dzannotti But whatās the point in declaring these keys in the IQuery fn? get-people
is not touching that.
:list/one [[:person/by-name "John"]...
is a sort of list of symlinks, the read function resolve those symlinks to their real value, and then picks off the keys that the Person component wants and passes them over. However since those are symlinks, the reconciler needs to know what's their identity so it can keeps all components that reference the same symlink target in sync
@bbktsk @dzannotti I have been (or am going through) the same discovery processes as @bbktsk. What is not clear is the code path that a query follows. I think there is some reading being done explicitly in the tutorial code and some "behind the scenes" in the library.. Is that right? The list reads are supplied by tutorial code but the reading of person properties is done by code in the library (maybe db->tree?) Am I close?
@dzannotti I think can see how the read
function (or specifically, get-people
called from read
) resolves the symlinks. But I still do not understand when is the value if Personās IQuery used in this case. Is that during the normalization? When the reconciler receives the non-normalized initial state, it uses it to retrieve necessary information a build a normalized state?
Hmmm. If I replace Personās IQuery with just []
, everything still works, apparently. Thats⦠confusing.
@bbktsk I found you have to do a lot of googling and set up a lot of little experiments to figure out what is going on. After a while you get a a feel for it. Rather than replace with [] try [:some-prop] what happens then?
@alasdair I hope thatās not a trick question š No change, everything works, and the state Iām printing with some debug statements inside still looks the same.
@bbktsk I think what is happening is that the top level query is '[{:list/one [:name :points :age]} {:list/two [:name :points :age]}], the parser breaks this down and finds two joins, it breaks those down and finds the list identifiers, your read function hooks in at this point and returns values for the lists, the standard parser then continues to lookup the [:name :points :age].
@bbktsk no, not a trick question - I was wondering if you're invoking some wild-card behvaiour
@alasdair I do not think thatās the case, if I remove these keys from the IQuery it still works.
Also, not sure what you mean by āstandard parserā - in some examples, I have seen that read
fn has :default
implementation that just reads the key from the state, but thatās not present here.
@bbktsk I think I am in your world of confusion then; I have deleted my copy of the tutorial so can't replicate right now. But what I found very useful was to create a cut down example with a Component that simply displays it's query and its' properties ~ you think plug in different state and query to see what happens.
@bbktsk By standard I meant the db->tree function, if you give it simple, normalized data and a query it will return the result.
@alasdair Iām trying that, but Iām feeling lost a little. Well, a lot š Thanks for help anyway, will try playing with db->tree .
sorry, i was called away, @bbktsk i can say that the feeling of confusion is normal, it takes about 2 weeks to really start understanding om.next and stop going "wtf is this" - after that it's all downhill and everything makes much more sense faster, reading the code for those parts might be helpful too, it's quite readable (beside a few single character named variables)