Fork me on GitHub
#untangled
<
2016-07-01
>
wilkerlucio10:07:47

@tony.kay: can we add this support (https://github.com/omcljs/om/pull/709/files) for chained reading of idents on the Untangled read function?

wilkerlucio10:07:23

what you think?

wilkerlucio10:07:41

after more testing I'm thinking its another Om issue, trying to figure it out

anmonteiro11:07:02

@wilkerlucio: pretty sure what you just opened is not an issue

anmonteiro11:07:17

The query doesn't seem right to me

anmonteiro11:07:48

Something like [{:a [:x :foo]}] would work with my fix

anmonteiro11:07:14

But I think you're abusing unions with th query you posted

wilkerlucio11:07:17

yes, but in my case I have an union at that point

anmonteiro11:07:48

i.e. The shape of the data doesn't match the union query

wilkerlucio11:07:12

I dont understand why not

wilkerlucio11:07:28

the way I see it, it has a multiple ident, and at the last point on the chain it has an union

wilkerlucio11:07:39

I have multiple types of data, so I really need that union there

anmonteiro11:07:50

I'll have to be in front of a computer to say more :-)

wilkerlucio11:07:58

but instead of using the last ident as the union keyer, it's using the first of the ident chain

wilkerlucio11:07:08

it's almost working right

wilkerlucio11:07:30

except the reference for the union is coming from the first ident of the chain, and I think the correct would be to use the last, makes sense?

anmonteiro11:07:06

Probably makes sense, I'll try it out in a bit and let you know

wilkerlucio11:07:52

and just fyi: I was trying that with your update in place

wilkerlucio11:07:03

if we confirm that as an issue, maybe it's a good idea to put in the same PR as the other

wilkerlucio11:07:09

@anmonteiro: just to let you know, my actual case is even a bit more complicated than the case I posted on the issue, the minimum for it is this:

wilkerlucio11:07:07

I was able to fix the one from my issue (to get the correct ident from a follow), but on this last case it's being more tricky

wilkerlucio11:07:11

the difference on this case is that one of the keys on the query path is an ident

wilkerlucio11:07:39

so I'm missing the loop at some point

wilkerlucio11:07:21

ducky typing is awesome, ok, the minimal case can be reduced, as:

wilkerlucio11:07:14

the issue now seems reduced to cases where an ident key points to an union

anmonteiro11:07:46

agreed that it should go in the same PR

wilkerlucio11:07:21

@anmonteiro: my changes on the db->tree that solves the first issue (the one at github)

wilkerlucio11:07:42

I added that v entry on the let, the second one

wilkerlucio12:07:04

I'm starting to think those are 2 different issues: 1 - unions on indent chains, 2 - unions for subqueries of an ident query

anmonteiro12:07:32

updated my patch to fix this stuff too

wilkerlucio12:07:38

@anmonteiro: thank you so much! that fixed all my issues 😄

anmonteiro12:07:22

@wilkerlucio: there might be one more failing case lying around, there

anmonteiro12:07:34

but I really don’t have time to test it out now

anmonteiro12:07:00

if you want to cover all the bases, you could try to make an example where the join key is an ident chain

anmonteiro12:07:16

although I’m not sure whether that should be allowed or not 🙂

wilkerlucio12:07:32

@anmonteiro: my real case is one of that, and it worked here

tony.kay16:07:31

@wilkerlucio: Just FYI, you can use the latest Om version with Untangled. We put Om in a provided scope so you can stay current.

wilkerlucio16:07:24

@tony.kay: thanks, my current workflow to use Om master is not very good... I've copied the Om files into a folder under my src and added as a source path

tony.kay16:07:51

Why not use checkouts?

wilkerlucio16:07:55

I tried before using lein checkouts, but I couldn't figure how to make it work

wilkerlucio16:07:14

the compilation always seems to fallback on some pre-installed version

tony.kay16:07:41

oh, it should work. We do it for debugging all the time. You have to use the correct version as a dependency in your dependecies AND make checkouts AND include it in your source paths.

tony.kay16:07:05

And you'll need to publish a local jar of the version listed on master

wilkerlucio16:07:41

can you please clarify the last step? how I a publish a local jar?

tony.kay16:07:43

We use a script to do that last bit:

tony.kay16:07:03

which requires you have lein localrepo plugin installed

tony.kay16:07:11

like in your user profile

wilkerlucio16:07:15

so, I need to go into the checkouts, make a system link, and also compile the jar, is that correct?

tony.kay16:07:27

right, from om master, run that script

tony.kay16:07:36

symlink from checkouts to om

wilkerlucio16:07:39

you talked about source paths, do I also need to add any extra source paths too?

tony.kay16:07:42

add to source paths

tony.kay16:07:58

you want BOTH the top-level (clojure) source-paths (for macros)

tony.kay16:07:05

and cljsbuild source paths

wilkerlucio16:07:38

what I should add there? checkouts/om?

tony.kay16:07:53

the source dir

tony.kay16:07:02

checkouts/om/src/main I think

tony.kay16:07:21

you need to point source paths at the sources 🙂

tony.kay16:07:39

checkouts just makes it possible for lein to know to ignore the dependency jar

tony.kay16:07:58

but it will only do that if the version in checkouts matches the version you say you want

wilkerlucio16:07:06

I'll try that 🙂

wilkerlucio17:07:06

@tony.kay: it works, so much better! thank you!

jasonjckn19:07:21

(merge-state! reconciler ui/Root {:current-tab (initial-state (ui/which-tab->tabui tab))})

jasonjckn19:07:26

I get the error no Ident on Root

jasonjckn19:07:34

how do I merge into root?

jasonjckn19:07:56

i opted for this code

jasonjckn19:07:57

(om/merge! reconciler
                        {:current-tab (initial-state (ui/which-tab->tabui tab))}
                        (om/get-query ui/Root))

jasonjckn19:07:01

seems to get the job done

jasonjckn19:07:21

i guess technically this code does less rendering 🙂

jasonjckn19:07:23

(merge-state! reconciler ui/TabUnion (initial-state (ui/which-tab->tabui tab)))
             (reset-ref! env :current-tab [tab :tab]))