Fork me on GitHub
#untangled
<
2017-02-24
>
tony.kay00:02:18

it is a graph database, and idents are the graph edges. The table entries are the nodes

tony.kay00:02:58

There will be some top-level keys that do nothing but act as roots of trees

tony.kay00:02:26

{ :root [:table 1]
  ...tables...}

tony.kay00:02:46

You can have any number of top-level keys that point into your graph

tony.kay00:02:08

but the depth of the overall db data structure is 2

tony.kay00:02:23

the depth of the graph is potentially infinite (recursive loops)

tony.kay00:02:46

the :person/mate example

tony.kay00:02:39

The UI query traverses this graph to produce a data tree for the UI

tony.kay00:02:19

so all of the keys in the root query will appear as top-level keys in your db

tony.kay00:02:30

they are the roots

qqq00:02:12

@tony.kay: alright, so we squint, untangled state = really a db, since it's a COLLECTION of TABLES (with keyword = table, id = pointer to row of table) ui components = (data->dom (some-query)) because ui components have two parts: (1) what do I need to render this UI (the query part) (2) how do I render the data (the data->dom) part is the above correct?

tony.kay00:02:10

it's really quite simple...just different

qqq00:02:54

alot of the om/dom + the datomic-pull syntax really hides this

tony.kay00:02:59

To anyone interested in Untangled and related tech: I'm going to be at clj west. I'm willing to do an Unsession around anything there is interest in. Open to suggestions. Let me know.

tony.kay00:02:38

@qqq I wouldn't say it hides anything. It exposes exactly what is needed and no more. A query + a render + a way to understand where in the database a given UI component's data lives (ident)

tony.kay00:02:03

It is true that you cannot get to "graph db" from just that

qqq00:02:49

@tony.kay: by "hide" I meant in the sense that a neighbor playing loud rock music "hides" the beethoven sonata you're trying to listen

qqq00:02:05

the idea is still there, but the first thing a n00b sees is the datomic pull syntax / om/dom stuff

tony.kay00:02:34

of course. It is an unfortunate truth of abstract concepts: knowing what/how/why of something is not self-evident

tony.kay00:02:04

I can show you syntax for Haskell Monads, but you'll be reading for a few weeks to "get it"

qqq00:02:13

I'm coming from regent/re-frame, and basically everyone told me how complicated om/next would be -- and in many ways, I don't disagree with them; this really unfortunately makss the elegance of untangled

qqq00:02:26

tony.kay: actually, I've written monad transformers myself 🙂

tony.kay00:02:02

Rich Hickey said it best: as developers, many of us are too enamored with "easy". Can I start using it right now and not have to think? Is it already familiar?

tony.kay00:02:45

Good developers are open to learning and the wider context of simplicity, which is not necessarily always easy

tony.kay00:02:00

well, it is never initially easy...cause it is new/foreign

tony.kay00:02:09

but "complicated" is the wrong word

tony.kay00:02:46

om/next is less approachable

tony.kay00:02:54

Untangled aims to make that better

tony.kay00:02:04

but you still have to step up and learn somethin' 🙂

qqq00:02:35

this is getting 'preachy' 🙂

qqq00:02:22

I do think the docs can be improved a bit though; it wasn't until I got the untangled todomvc server/client example working that I realized "untangled makes it worthwhile to learn om/next"

tony.kay00:02:04

Feel free to make suggestions. But make sure you've looked over what's available. I've done a lot of work on the docs/videos

tony.kay00:02:15

or perhaps you meant the Om docs in the Om project.

tony.kay00:02:17

there is that (problem)

tony.kay00:02:48

You have visited the Untangled website/docs/videos, right?

qqq00:02:18

@tony.kay: I'm curently working through the untangled devguide

qqq00:02:41

I can't comment on the other resources; but for the dev guide, it

qqq00:02:55

's not until I get halfway through that I come across something that can't be easily done in re-frame

qqq00:02:42

I believe that if the full client/server power was shown off earlier, there'd be more converts

tony.kay00:02:58

Yep: data-driven wins once you go beyond simple examples. But that is the problem: you have to get to the "in the large" problems before it pays off...but then, that is what most of us are building: stuff that gets large.

tony.kay00:02:33

so keeping someone's attention long enough to get there is hard. That is a good observation, though. More advocates stressing the full-stack story.

tony.kay00:02:52

or even the in-the-large story. You can make a mess in anything. As things get large, better abstractions lead to an ability to keep things simpler. Still, people still manage to tangle up Untangled 🙂

qqq00:02:44

@tony.kay: I agree that untangled is the right framework. I also think that more users = more libraries, more bug reports, faster bug fixes. In this sense, a way to make people immediately aware what untangle offers over other frameworks would be beneficial.

tony.kay00:02:24

Always open to suggestions/contributions. I have a feeling it is advertising some of the stuff we already have as resources (e.g. videos) in a venue that gets more visibility

tony.kay00:02:30

I'm not much of a sales guy

qqq01:02:36

I'm trying to get around this problem: start from scratch ==> people have to go through om/next + datomic/pull before starting to see power of untangled start with existing codebase ==> have to pick boot vs lein, cursive vs emacs, etc ... so some group of ppl put off, and it becomes fragile to maintain

tony.kay01:02:46

yeah, we already decided lein+cursive. Most widely approachable...and with nREPL support the emacs ppl are covered.

tony.kay01:02:33

existing code base: we have the cookbook, todo mvc, template, and videos

qqq01:02:14

btw, the todo mvc is out dated, it uses a version of data-fetch that doesn't work wil the devguide

qqq01:02:36

hmm, maybe the docs are fine, and the problem is I'm using emacs + boot 🙂

tony.kay01:02:38

data-fetch API has had additions (and deprecations) but I don't think any of it has been removed. But worth checking

qqq01:02:13

I have the weirdest bug: ` (. js/console log (= (om/get-query Ex2-Child) [:id :n])) ;; returns true (query [this] [{:items [:id :n]}]) ;; works fine (query [this] [{:items (om/get-query Ex2-Child)}]) ;; fails to extract data

tony.kay01:02:31

Maybe I should suggest a clj-west Unsession on "Why Om Next/Untangled?"

tony.kay01:02:08

compare and contrast against other popular options

qqq01:02:14

http://www.parens-of-the-dead.com/ <-- this is what switched me from vim to emacs

tony.kay01:02:24

I love that series

tony.kay01:02:37

IntelliJ + IdeaVIM gets you most of the way there (on editing at least)

qqq01:02:46

I don't know if the untangled videos hit that level -- as I don't use cursive.

tony.kay01:02:52

multicursors, structural editing, VIM bindings, etc.

qqq01:02:06

does (query [this] QUERY) have an equivalent for SELECT * ?

qqq01:02:12

I want a QUERY which just selects EVERYTHING

tony.kay01:02:53

(query [this] ['*])

tony.kay01:02:10

you need the quote since * is a symbol

tony.kay01:02:44

but that won't follow joins

qqq01:02:00

(om/get-query Ex2-Child) // returns ['*]

(query [this] [{:items ['*]}]) // returns {:items [{:id 1, :n 3} {:id 2, :n 9}]}
(query [this] (om/get-query Ex2-Child)) // returns {:items [{:child/by-id 2} {:child/by-id 2}]}
I'm completely confused

tony.kay01:02:27

um, neither of those is right 🙂

tony.kay01:02:52

(query [this] [{:items (om/get-query Ex2-Child)}])

tony.kay01:02:54

makes more sense

tony.kay01:02:09

ex2-child wants all of its properties

tony.kay01:02:27

some other component wants to join through other to (one-or-many) Ex2-Child

qqq01:02:47

sorry, (was copying/pasting from other machine) for the second one, I meant to write

(query [this] [{:items (om/get-query Ex2-Child)}])

qqq01:02:54

which I believe is the same as what you wrote

tony.kay01:02:55

that is reasonable

qqq01:02:02

but I'm getting different results

qqq01:02:16

one of them returns the idents, the other one resolves the idents

qqq01:02:26

this is section G, mutation exercises

tony.kay01:02:58

a join should use the query of the thing being joined to

qqq01:02:21

would a less patient person say "the problem is you don't understand datomic pull syntax" ?

tony.kay01:02:35

there is nothing to the syntax 🙂

tony.kay01:02:39

this is an Om-ism

tony.kay01:02:01

the get-query adds metadata to the query. So when you compose queries using get-query it augments the query data structure

tony.kay01:02:10

when you manually type it you don't get the metadata

qqq01:02:40

are you saying "the existence of metadata changes the way the query is evaluated" ?

tony.kay01:02:14

so, I don't have enough context (and I have to leave to meet someone, so I cannot take the time to establish that context), but yes: the metadata affects how things work. Normalization in particular

tony.kay01:02:34

it is how normalization gets done. If you don't have it, your initial database gets hosed (not normalized)

qqq01:02:34

one last thing

qqq01:02:45

can you point me at docs to read on how metadta normalization, and querying works?

qqq01:02:50

clearly I'm not understanding this part

tony.kay01:02:27

David Nolen's tutorial on normalization on the Om wiki. The dev guide certainly tries to explain it. My clojure west unsession (youtube from last year).

qqq01:02:50

okay, so this is a Om query issue, not an untangle issue

qqq01:02:53

got it; thanks!

tony.kay01:02:53

Untangled modifies nothing about how the queries and normalization work.

tony.kay01:02:20

from a component/default database format perspective. Untangled adds a lot of the glue.

tony.kay01:02:02

The dev guide sections on app state database and queries is possibly the most approachable source...but you've done those already

qqq01:02:16

well, clearly I didn't understand them fully

qqq01:02:18

I'll look at them again

tony.kay01:02:36

The gory details of how the algorithm works: thats the Om tree->db function.

qqq01:02:37

let me ask you one more question, without proviidng context:

qqq01:02:07

should: (query [this] ['*]) and (query [this] '[*]) be equivalent (note the order or ' vs [ ). If not, why not?

tony.kay01:02:44

I do not (immediately) see a reason for a difference. But quoting is one of those weird things

tony.kay01:02:39

I never use that query syntax, so I cannot speak to reality 🙂

tony.kay01:02:47

gnight 🙂

qqq01:02:17

thanks for all your help; take care

qqq04:02:53

okay, so I've just read through parts of the devguide a second time; I don't see this part: where is the claim that: om/get-query adds metadata and may effect how the query is run stated ?

cjmurphy05:02:51

It is talked about quite a lot in various docs. As long as you always use get-query for subqueries in your components I don't think you will be hurt too much. I just did a google search: 'om next query metadata' - plenty of info there.

qqq05:02:47

The first two links are to parts of the om wiki, which I've already read.

qqq10:02:29

@tony.kay: finally got to section H: http://untangled-web.github.io/untangled/guide.html#!/untangled_devguide.H_Server_Interactions it may be that I'm slow, but it took me 2 days to get through the basics of untangled to get to the interesting (networking) part 😕

qqq11:02:37

https://github.com/untangled-web/untangled-ui <-- is the only way to view the components to clone the repo and run it locally ? 🙂

mitchelkuijpers15:02:55

@qqq It takes a while but it is worth it

qqq16:02:28

Is there a "minimal" untangled client/server example? The todo-mvc is > 600 LOC, I'm looking for something at ~ 50LOC where it's minimal client/server, and nothing else.

tony.kay18:02:39

@qqq have you tried the getting started videos? I know you are not interested in the Cursive parts, but there is a lot of info in there, and many ppl have found them easier to get going on. I'd be interested in your experience

tony.kay18:02:10

@mitchelkuijpers @wilkerlucio @currentoor @jasonjckn @therabidbanana I've proposed a "Why Om Next/Untangled" Unsession at clj west. I'd be really interested in input you might have on your experience with competing popular tools and why you are here. I don't have a lot of explicit experience with things like Re-frame et al, so it would be helpful to have some external input. In particular, if any of you would be willing to have a skype/hangout/voice chat of some sort in the coming weeks it would be really helpful. Trying to do some community building.

mitchelkuijpers19:02:42

I am in @tony.kay we are still migrating away from re-frame

wilkerlucio20:02:11

@tony.kay the major Untangled selling point to me is: you gonna have to write this anyway, so better have this as a library we can all collaborate on instead of trying to rewrite every time

wilkerlucio20:02:13

I was really impressed on the beginning, when I was trying to write my own, and then you came with Untangled solving the exact same stuff I was doing, so was love at first sight 🙂

qqq20:02:48

@tony.kay: I randomly sampled a few snippets of the getting started videos: please corrrect me if I'm wrong: (1) those videos don't start from scratch (2) those videos jump into an existing code base

tony.kay20:02:50

@qqq I'd like to know if the getting started videos seem to advanced for a cljs dev that has no Om Next

tony.kay20:02:59

The intention was for them to actually target such ppl

tony.kay20:02:24

and yes, it is an existing code base, but not a big one

tony.kay20:02:45

crawl -> walk

qqq20:02:47

this is not a comment on the videos, but at this point, I actually find the "untangle reference manual" to be better written than the "untangle devguide"

adambrosio22:02:44

@qqq I’m planning on working on server documentation on the weekend and/or next week, so I’ll make sure I add code samples to that while im there

qqq22:02:21

@adambros: if I can find the following 1 example, I can do the rest on my own

qqq22:02:56

so the simplest untangle example is a counter ;;

current count is: N
[ click this button to increment N ]
now, the simplest example I would want -- is one where N is stored remotely

qqq22:02:04

I can't find this example anywhere; is this example available?

adambrosio22:02:30

i dont think i’ve seen that example, but the gist of is that you would do :remote true in the client mutation, and implement a server mutation to update the server state

adambrosio22:02:34

ah sorry, you also want index=7, "server basics"

qqq22:02:17

looks like I really should watch these videos 🙂

adambrosio22:02:55

personally i like watching videos at 1.5x speed, but that can be too fast if you arent used to it

qqq22:02:30

the one thing that I hate about screen casts

qqq22:02:35

is inability to random access the code

qqq22:02:52

now, to see a particular page of code, it's "hmm, let me guess which minute/second time stamp was this on the screen at" ?

qqq22:02:22

someone needs videos that are synched with git tags; so at any point, I can say "in video X, at time MM:SS", what does the git repo look like?

qqq22:02:33

[ / end rant ]

qqq23:02:59

@tony.kay : i watched through the first 4 videos; info per minute is like 100x higher than readig devguide

qqq23:02:12

not sure if this is due to video being awesome, or due to learning first from devguide

qqq23:02:24

@adambros : it also appears, starting with video 5, that these videos have precisely the git tags I wanted 🙂