This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (1)
- # beginners (1)
- # boot (16)
- # capetown (2)
- # cider (1)
- # clara (1)
- # cljs-dev (2)
- # cljsrn (2)
- # clojure-brasil (3)
- # clojure-czech (2)
- # clojure-greece (4)
- # clojure-quebec (2)
- # clojure-russia (3)
- # clojure-spec (8)
- # clojure-sweden (1)
- # clojure-uk (1)
- # clojurescript (8)
- # datomic (12)
- # editors (12)
- # events (1)
- # hoplon (11)
- # off-topic (2)
- # om (56)
- # proton (2)
- # reagent (2)
- # spacemacs (1)
there is some unexpected behaviour here when returning class references from a function, apparently if I call a function that returns an Om component, I lose the ability to calls it's static methods
with the code above ^^^
without advanced compilation it returns
true on both cases, but on advanced it loses the static methods when the instance is returned from a function instead of direct access
@wilkerlucio: see this for a workaround: https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L302
@dnolen: what do you think about making
default-extract-errors public just like
the rationale being that people who override these may still want call the default ones in their overridden implementation and add just a bit of functionality over them
@cmcfarlen: the tempid issue should have been fixed in https://github.com/anmonteiro/compassus/commit/12b2e67da05dbe40bcad766b9163095dbef3cea0
let me know if you want me to push a release
@anmonteiro: Great! Thanks! This change is probably worthy of a release, but not necessary for me atm.
That reminds me though. What do you think about adding a check in set-route! and only transact if the route given is different than the current route?
@anmonteiro: I’m ok with that PR welcome
@dnolen: btw, regarding this issue: https://github.com/omcljs/om/issues/690
we actually don’t really return the result of parsing from transactions
so even though the errors are in the parsing result, they never get returned
@dnolen: gotcha, I’ll submit a PR for that one too, could you reopen?
@dnolen: alright, submitted that PR that makes those fns public, a fix for the
transact! result and one more small fix for
I promise those were the last ones today 😉
@anmonteiro: so specify on a constructor fn gets elided in advanced?
@hueyp: it seems like that’s the case
I can’t really tell you more though, I just know that from reading that part of the code I linked
@hueyp: the Om workaround is really just constructing a JS object the the class’s prototype
yah, but it also means static interfaces need to be implement on the constructor & prototype
@hueyp: static protocols like
Ident are also
specify!ed on the constructor, yeah
but these “static” things are just a workaround for being able to
get-query of a thing before it has been instantiated
@anmonteiro: thanks, but I'm not sure how to use that, just to be clear, my issue not with
IQuery specifically, I use a custom protocol that I would like to call, and the instance of the class comes from a multi-fn, how can I go around that?
@wilkerlucio: why doesnt what I pasted work? Get the method from the prototype and call that?
@anmonteiro: let me show you how I tried:
(implements? r/IRouteMiddleware comp) returns
true, but the call doesn't work, it throws the error
TypeError: Cannot use 'in' operator to search for 'omcljs$reconciler' in undefined
the error stack is not helpful on this, I'm trying to explore a bit more here (but advanced compilation takes a while to do each try)
ok, I figure that the first level call is working, but from the inside of my method I call
(om/get-query this), and aparently on this case it's losing the static methods again, and at this second level the trick doesn't seems to work
this is what the method looks like now (trying to use the trick, not working this time):
@wilkerlucio: I'd say that now you need to do the same at the call site of
@anmonteiro: you mean the
(r/remote-query) on the first snippet?
Oh you did that already
@wilkerlucio: Could you show the stack trace you're getting now and where?
:pseudo-names true in advanced if you're not doing that already
ok, gonna have to change the compilation, just a min
@wilkerlucio: do you confirm that it only happens in advanced?
@anmonteiro: yes, that code works correctly under other optimizations
stack caused by:
I created another snippet completing a minimal case:
@anmonteiro: I noticed something new, if I do the
(js/Object.create (.-prototype c)), the second call doesn't work even without optimizations
but without running the workaround it works correctly for non advanced compilations