This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-19
Channels
- # beginners (37)
- # boot (96)
- # cider (23)
- # clara (2)
- # cljs-dev (40)
- # clojars (1)
- # clojure (149)
- # clojure-conj (1)
- # clojure-dev (2)
- # clojure-dusseldorf (5)
- # clojure-france (82)
- # clojure-italy (1)
- # clojure-nlp (1)
- # clojure-russia (13)
- # clojure-spec (24)
- # clojure-uk (62)
- # clojurescript (131)
- # core-async (13)
- # core-logic (7)
- # data-science (1)
- # datomic (10)
- # defnpodcast (3)
- # docker (4)
- # emacs (3)
- # events (4)
- # hoplon (68)
- # klipse (4)
- # leiningen (1)
- # off-topic (5)
- # om (140)
- # onyx (16)
- # pedestal (24)
- # planck (10)
- # proton (2)
- # re-frame (9)
- # reagent (4)
- # remote-jobs (1)
- # ring-swagger (16)
- # untangled (5)
- # vim (8)
- # yada (30)
please consider this minimal case:
the resulting idents are [:a 1]
and [:b 2]
, I expected it to generate 2 tables (`:a` and :b
) but only table :a
is generated, and the item [:b 2]
ends up there
and this results in the further queries to miss for the :b
@wilkerlucio: seems like https://github.com/omcljs/om/commit/baaf4510d9970f1d9aa8dfcbe28bc89242bae87b
Try master?
@anmonteiro thanks, I was trying last, and I was unable to make a test case failing (so seems to be fixed on master :)), but at same time I'm having issues to use the master version on my project, I tried using lein install
on Om and using the snapshot, but it seems to keep holding on the old version here
@wilkerlucio: that just seems like a caching issue unrelated to Om
If you're a Cursive user, I've heard a lot about it caching too much
Can't confirm though, I use emacs
yeah, can be it, I'm cursive user
ha, just tried again and now it's working 🙂
@wilkerlucio great! so you confirm you issue is fixed in master then?
yes, the issue is fixed in master
hey guys… can someone help me to refresh my mind. why would in read
method if I set :value locally it works, but fetching from remote would fetch the data but won’t put that data into the state atom?
@anmonteiro hrm, strangely when I try to run the Om tests with 1.9.293 I get a bunch of failures, have you seen this?
@dnolen trying now
@anmonteiro at the REPL
same for boot test
@dnolen does rolling back ClojureScript fix it?
@anmonteiro yes 229 works
right, stupid question, master is passing
@anmonteiro seems related to protocol change ...
@dnolen could it be the implements?
patch
yeah, exactly
@dnolen should we not use implements?
?
or what’s the problem?
I’m just going to hack this in for now - but this probably means we need a standard way to do this
I still don’t get what the problem is
we do specify!
, shouldn’t it take care of that?
@anmonteiro line 296
the advanced
stuff
@dnolen by standard way, you mean compiler support for static methods in JS classes?
and change ClojureScript to use that, and then anybody can use it that’s doing low-level stuff like this
so Om is not compatible with CLJS 1.9.293
yeah, it’s in cljs.util
or something right?
at least you found it early enough
@anmonteiro going to cut, anything else need going in here?
@dnolen minor one, but this one could go in if @ethangracer has submitted a CA: https://github.com/omcljs/om/pull/707
other than that good to go
@anmonteiro don’t have a CA for them
not important anyway
can be fixed in a further release
@dnolen typo, it’s 47 🙂
hey guys… so I am modifying ast in read method (on the fly) then doing {:remote modified-ast}
, but it still sending unmodified one… why?
@ag Can you verify that your modified-ast
is actually being computed and returned there?
@dnolen When I did that, it complained that it was nil
(or the query became nil
? I don't remember now)
@peeja might be… interesting.. if I modify ast’s children - that doesn’t work… if I assoc params to entire ast - works
@ag because the ast->query
function actually uses the :query
in the AST to convert back and not the children
@ag Right, so after you make your changes, try dissoc
ing the :query
from the AST and see if it works
@anmonteiro oh.. ok… then you’re the person who can advise me. If query of the ast is something like this:
[({:color/header [:color-id :name]} {:color-id nil})]
what would be the best way to set the params? Compassus merges whatever route-params you give it into the state. So my plan was to traverse ast’s :children and replace params with what in route-params
sounds like a plan
but that’s not working…oh… what if after modifying ast I do ast->query and then query->ast
that would work
but Om should be enhanced in that respect
it’s kinda heavy for your app to be doing ast->query
and query->ast
all the time
IMO if Om Next sees a :query
in the AST it can just use it because it’s faster
otherwise (you dissoc) it should just re-compute the whole query
as David said, the AST stuff is kinda half-baked
meh… you’re guys are smart… you’d come up with something.. me? I just want to build "Hello world" apps
esp. ast->query
@ag btw still haven’t gotten around to try your example
was it caused by the issue you opened in Compassus?
or do I still need to look at it? 🙂
@anmonteiro oh no… I have found a way.. the issue is still relevant in terms that it should still enforce default value whether third param or not.
yeah, it’s definitely a bug
I can actually fix it right away
Does Om currently provide any tools that might help with merging two queries? I'm trying to do something like:
(query-merge
[{:person/parent [:person/favorite-color]}
:person/favorite-color]
[{:person/parent [:person/date-of-birth]}
:person/date-of-birth])
and get
[{:person/parent [:person/date-of-birth
:person/favorite-color]}
:person/date-of-birth
:person/favorite-color]
@ag btw the merge issue sounds sketchy
I’d try to understand what the actual underlying problem is
could be an issue in Compassus, but at first it doesn’t sound like it
@anmonteiro I’ll try to work on cleaner repro sample
btw… I also stumbled a couple of times on error at (.forceUpdate c)
in init!
which doesn’t happen all the time and it’s easy to fix by just wrapping it in (when c ,,,
@ag that’s probably here, no? https://github.com/compassus/oriens/blob/master/resources/leiningen/new/oriens/core.cljs#L50
also I found it’s a bad idea to name main entry point to cljs app with a bang. e.g. init!
JS doesn’t understand bangs.
that’s just the template, not a compassus bug
@peeja btw I commented here: https://github.com/compassus/compassus/issues/12
@anmonteiro yeah, I know. not saying it’s a bug
whenever you get a chance to read
eh… guys… running om/ast->query om/query->ast
now modified my ast. turning it from type :join into type :root. Can I tell it not to do that?
@ag heh, that’s right
use om.next.impl.parser/expr->ast
btw fixed your issue, want me to cut a snapshot release?
@anmonteiro it’s alright, I don’t think it’s necessary… I’ll wait for more stuff/fixes… up to you though
@ag just #12 (and #16 if we confirm it’s a bug) holding up next release
eh, guys… now. when I try to modify ast using
om/ast->query
om.next.impl.parser/expr->ast
it still manges the ast… so if it’s a simple query it works. but if the ast contains query like this:
[({:color/header [:color-id :name]
:color/details [:id :description :title]} {:color-id nil})]
it seems to be cutting off the second part completely. leaving it with
({:color/header [:color-id :name]} {:color-id “3”})
so yeah…
1) om.next.impl.parser/ast->expr
retrieves query from an ast, but it doesn not set query params based on the key :params
in the ast.
2) ast->query does retrieve query from ast and sets the params based of :params
key of the ast, BUT. it modifies the query, if you have a join query it takes only the first item in it. e.g. :
`[({:foo/foo [:id] :bar/bar [:id]} {:id ~’?id})]
will lose its :bar partwhen you run (parser env query)
is there a way to pass parameters to all involved dispatch methods?