Fork me on GitHub
#om
<
2016-11-04
>
snoonan00:11:12

I have a gap in my understanding of the Query part of a component. I see in examples that Ident is used to figure out what part of the query is used to match changes against the component to re-render, but the component is defined to have a Query that is located somewhere in the db already (it is wrapped as a subquery that targets the component). Is there any way to also query and depend on a 'out of scope' value in the tree, like :current-selected as well, or is it expected that selection markup is dealt with in the parent and passed in as computed values (or something else).

snoonan01:11:07

Thanks, I remember skimming thru this early, but obviously forgot.

anmonteiro08:11:16

@sineer: you might want to look at om.next/subquery

jannis10:11:50

Has anyone had problems with Om Next and ClojureScript 1.9.293? I tried updating an app that I'm writing and my root component query wasn't executed, instead the reconciler's state (in my case: a DataScript db) was passed to it as props. Odd. I might try again later with a minimal app to see if I ran reproduce it outside my more complex setup.

anmonteiro10:11:04

@jannis yes, you need to be on alpha47

jannis10:11:33

I think I tried that combination. I'll quickly re-run again.

anmonteiro10:11:56

Om relies on some compiler internals to make static methods work in advanced builds

anmonteiro10:11:15

some of that logic changed in ClojureScript 1.9.293

jannis10:11:22

advanced as in advanced optimizations? This is a non-optimized build.

anmonteiro10:11:33

yes, as in advanced. but it doesn't matter, it affects every build

anmonteiro10:11:39

these are the relevant code bits

jannis10:11:14

You're right, I just built again with 1.9.293 and alpha47 and it works. Doh, my bad. Thanks 🙂

anmonteiro10:11:00

glad it works

jannis10:11:43

Me too 🙂

levitanong11:11:45

@anmonteiro I filed an issue, but I’d like to confirm a hunch I have. Currently, advanced compilation breaks when dom/clipPath is present. Does this have anything to do with the unsupported tags issue?

anmonteiro11:11:16

@levitanong my first thought would be to include externs for SVG

levitanong12:11:04

@anmonteiro what functions and vars would be in the externs? Isn’t clipPath already inside om?

anmonteiro12:11:38

@levitanong right but you need to prevent the Closure Compiler from munging the clipPath prop

anmonteiro12:11:54

e.g.: when we inline stuff, the generated JavaScript will look like: React.DOM.clipPath or something

anmonteiro12:11:04

so the Closure Compiler needs to know that it can't munge clipPath to something random thing

anmonteiro12:11:18

@levitanong try adding the externs above to your build and let me know if it fixed it

danielstockton12:11:02

can compassus be made to work with datascript ?

anmonteiro12:11:31

@danielcompton Haven't thought about that use case, but I'm happy to make the necessary changes to support it

danielstockton12:11:10

ok, i havent looked into it enough yet, was just wondering if there were any design choices that completely ruled it out

anmonteiro12:11:22

not that I'm aware!

danielstockton12:11:33

i'll dig a bit deeper then, thanks

anmonteiro12:11:57

I think we actually assume that the app state is an atom 🙂

danielstockton12:11:26

im asking because i know there are still problems with set-query! and datascript, don't know how it works internally though

anmonteiro12:11:41

right, set-query! is still a problem in Om

anmonteiro12:11:51

but Compassus doesn't use set-query!

danielstockton12:11:02

ah right, in that case perhaps it can be made to work somehow?

anmonteiro12:11:24

we just need to stop assuming that the app state will be an atom

anmonteiro12:11:36

@danielstockton can you open an issue so that I don't forget to look into that?

levitanong12:11:50

@anmonteiro Hmm… I’m not sure if I’m using the externs wrong, or if it’s really not working. I gotta run, so I’ll have to put this off. Will study more about it tomorrow or later tonight.

tobiash14:11:09

@anmonteiro Do you have ideas on how login could be implemented using compassus? maybe it would be useful to have place to hook auth before route changes?

anmonteiro15:11:41

@tobiash I think that's a userland concern

anmonteiro15:11:47

I give you the set-route! primitive

anmonteiro15:11:58

you can choose to call it or not, depending whether the user is authenticated

anmonteiro15:11:22

or is there something else I'm forgetting?

tobiash15:11:20

no, thats fine. I was just asking because many routing libraries include something like that

tobiash15:11:22

but i am already wrapping compassus to sync it up with the RN navigator anyway

anmonteiro15:11:57

@tobiash routing in Compassus is about swapping the top-level component that is shown in your app, nothing else

anmonteiro15:11:17

of course we provide hooks for you to implement, e.g. URL navigation

anmonteiro15:11:46

which in your example doesn't make sense because you're building a RN app.

anmonteiro15:11:04

so right there is an advantage of not including it by default 🙂

tobiash15:11:19

yes, i like very much how unopinionated it is atm

tobiash15:11:45

btw, thank you for the 1.0.0, it's working great so far and it's much easier to write parser and send functions now

anmonteiro15:11:08

awesome, appreciate the feedback. I find it more intuitive as well