Fork me on GitHub
#untangled
<
2017-06-22
>
cjmurphy03:06:31

Just playing with app.basic-ui. My understanding is that the same keyword is sometimes used as an edge, and sometimes as the the id value in an ident - for instance the keyword :friends (and :enemies). Perhaps it would it make understanding easier if there's some differentiation, so two different keywords used, for example: :friend-edge and :friend-id?

tony.kay12:06:22

cjmurphy: I agree some clarity would be helpful. The biggest problem is collisions. Thus the recommendation (that I sometimes ignore) that things be namespaced. The edge vs. table. Tables do typically have /by-id or something, which makes them obvious. I worry more about a load that overwrites a root-level edge.

tony.kay12:06:38

@eric.shao contributions welcome. I don’t personally need react native, so I don’t have a lot of motivation…unless you want to fund such an effort 😉

tony.kay12:06:39

@claudiu I didn’t realize merge alt unions it didn’t work on the server. You can open an issue. The server-side rendering could use some love. It is low on my personal priority list, but I’d be glad for help cleaning it up. The whole satisfies, implements, etc story between server and client is fun.

gardnervickers12:06:50

Ah great new, I'll keep an eye on that issue. We've disabled pathopt before to try and avoid problems with our query struture but for our app the performance hit was too high.

tony.kay12:06:31

@gardnervickers Oh! that’s great news

tony.kay12:06:44

you should comment on the issue to encourage a fix

tony.kay12:06:49

stay on the older version for now, as long as it is working for you. I assume you’ve moved transacts towards the root as a workaround for the errors

gardnervickers12:06:15

I was trying to reproduce the issue yesterday but I didn't make much progress.

tony.kay12:06:19

which are: “no queries found…” and index OOB exceptions on reconcile.

tony.kay12:06:40

Unfortunately, recent versions of Untangled were clamping pathopt to ON

tony.kay12:06:47

even though there was an option to turn it off

tony.kay12:06:23

BTW: I’m in a Starbucks in the middle of Montana at the moment on a road trip. Need to head out soon.

tony.kay12:06:02

@wilkerlucio Hm. Did you resolve that?

wilkerlucio12:06:45

@tony.kay: I was able to get around it, it seems something odd is going when the root component requires only keys not present on the data, my fix was to add a :ui/react-key at my initial state, so it always have at least this one present, I might have some time to look on it later and try to pinpoint more exactly whats going on

tony.kay12:06:04

I have seen cases where an empty db causes db->tree to not return data for a node. Never heard of that causing problems for root, but I guess if your query gives back nothing, then shouldComponentUpdate might prevent a render? But not an initial render 😕

tony.kay12:06:39

I didn’t change anything except pathopt…it should not have caused any regressions.

tony.kay12:06:22

cjmurphy: I agree some clarity would be helpful. The biggest problem is collisions. Thus the recommendation (that I sometimes ignore) that things be namespaced. The edge vs. table. Tables do typically have /by-id or something, which makes them obvious. I worry more about a load that overwrites a root-level edge.

cjmurphy12:06:46

Not so much edge/join verses table, but edge/join verses what goes into the second place of an ident. In your example :friends was used as both.

tony.kay12:06:28

OH, I see 🙂

tony.kay12:06:36

yeah, using keywords as IDs can be confusing I guess

cjmurphy12:06:25

I quite liked :the-one!

tony.kay12:06:53

let me think on that some. Perhaps a careful naming update on that guide would be good. Perhaps even doing something silly like starting every ident table name with TABLE. 😄 I knew he was :the-one!

tony.kay12:06:14

table.people/by-id

cjmurphy12:06:31

Then also join.people and id.people.

tony.kay12:06:48

hm. less loving those 😕

tony.kay12:06:35

If you’re looking at an app state, idents make it obvious what is a join. In a component, the query makes it obvious. Not seeing the need for a naming convention in general on those

tony.kay12:06:52

but at root, those get confusing

cjmurphy12:06:01

Not so much a convention I was thinking, just to help people when they see :friends used in many different ways for the example.

tony.kay12:06:49

so, this is only really a concern on the root node. How about :root/prop-name?

tony.kay12:06:09

move the root-level props “out of the way” so to speak…then all that’s left is tables.

claudiu12:06:31

@tony.kay 'The whole satisfies, implements, etc story between server and client is fun.' Is there anywhere where I can find this working, or how should I go about solving this ?

tony.kay12:06:43

@claudiu Read om/next.cljc. There are a few places where it is split out.

claudiu12:06:53

ok 🙂 will try to see if I can get it working. Got a bit stuck on that one since I was expecting it to work 🙂

tony.kay12:06:17

@claudiu Sorry about that. As far as I knew it was.

cjmurphy12:06:23

So :root/prop-name means it is an edge used on the root component? Just :friends the id part of the ident. I supposes there is no ns used for :friends, so its available...

tony.kay12:06:41

:root/ means it is off of the root node as a prop OR edge

tony.kay12:06:55

everything else would then be table names, since nothing else could get there

tony.kay12:06:20

unless a load loaded something there without that prefix, but I generally :target loads so I can use something convenient for the server naming in the load query.

cjmurphy12:06:18

[:person-list/by-id :friends] [:person-list/by-id :enemies] was how I understood it. So here these keyswords are not tables, not joins/edges, they are ids.

tony.kay12:06:53

idents are always [TABLE ID]…the assoc-in, update-in, get-in path of the entity

cjmurphy12:06:28

Yeah I know - was just saying to help with understanding for people.

tony.kay12:06:57

right, and if the root edges were like :root/friends it would be clear, since there wouldn’t be a name collision

tony.kay13:06:12

the ID could still be :friends

claudiu13:06:23

@tony.kay Will add a issue and in the meantime try to see if I can find a fix. Really slow progress (wedding in 2 months is killing my free time & I'm new to clojure). But would love to help out with untangled if I can. Thank you 🙂

cjmurphy13:06:23

True - just have a difference is all that is needed.

tony.kay13:06:06

yeah, and I’m trying to solve the other issues I’ve been wanting to help ppl with: stomping on root props/edges with loads, and making the app state a little easier to read from root.

cjmurphy13:06:28

You look to one :friends, then look to another, you want them to mean the same thing.

tony.kay13:06:41

yep. I gotta hit the road. Happy Untangling!

cjmurphy13:06:03

np thanks! simple_smile