untangled

NEW CHANNEL: #fulcro
tony.kay 2017-02-24T00:00:18.004275Z

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

tony.kay 2017-02-24T00:00:58.004276Z

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

tony.kay 2017-02-24T00:01:26.004277Z

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

tony.kay 2017-02-24T00:01:46.004278Z

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

tony.kay 2017-02-24T00:02:08.004279Z

but the depth of the overall db data structure is 2

tony.kay 2017-02-24T00:02:23.004280Z

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

tony.kay 2017-02-24T00:02:46.004281Z

the :person/mate example

tony.kay 2017-02-24T00:03:39.004282Z

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

tony.kay 2017-02-24T00:04:19.004283Z

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

tony.kay 2017-02-24T00:04:30.004284Z

they are the roots

qqq 2017-02-24T00:07:12.004285Z

@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.kay 2017-02-24T00:07:42.004286Z

yep

tony.kay 2017-02-24T00:08:10.004287Z

it's really quite simple...just different

qqq 2017-02-24T00:08:54.004288Z

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

tony.kay 2017-02-24T00:08:59.004289Z

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.kay 2017-02-24T00:10:38.004290Z

@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.kay 2017-02-24T00:11:03.004291Z

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

qqq 2017-02-24T00:11:49.004292Z

@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

qqq 2017-02-24T00:12:05.004293Z

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

tony.kay 2017-02-24T00:12:34.004294Z

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

tony.kay 2017-02-24T00:13:04.004295Z

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

qqq 2017-02-24T00:13:13.004296Z

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

qqq 2017-02-24T00:13:26.004297Z

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

tony.kay 2017-02-24T00:14:02.004298Z

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.kay 2017-02-24T00:14:45.004300Z

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

tony.kay 2017-02-24T00:15:00.004301Z

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

tony.kay 2017-02-24T00:15:09.004302Z

but "complicated" is the wrong word

tony.kay 2017-02-24T00:15:46.004303Z

om/next is less approachable

tony.kay 2017-02-24T00:15:54.004304Z

Untangled aims to make that better

tony.kay 2017-02-24T00:16:04.004305Z

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

qqq 2017-02-24T00:16:35.004306Z

this is getting 'preachy' 🙂

qqq 2017-02-24T00:17:22.004307Z

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.kay 2017-02-24T00:18:04.004308Z

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.kay 2017-02-24T00:18:15.004309Z

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

tony.kay 2017-02-24T00:18:17.004310Z

there is that (problem)

tony.kay 2017-02-24T00:20:48.004312Z

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

qqq 2017-02-24T00:31:18.004313Z

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

qqq 2017-02-24T00:31:41.004314Z

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

qqq 2017-02-24T00:31:55.004315Z

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

qqq 2017-02-24T00:32:42.004316Z

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

tony.kay 2017-02-24T00:34:58.004317Z

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.kay 2017-02-24T00:35:33.004318Z

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.kay 2017-02-24T00:39:52.004319Z

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 🙂

qqq 2017-02-24T00:50:44.004320Z

@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.kay 2017-02-24T00:52:24.004321Z

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.kay 2017-02-24T00:52:30.004322Z

I'm not much of a sales guy

qqq 2017-02-24T01:01:36.004323Z

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.kay 2017-02-24T01:03:46.004324Z

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

tony.kay 2017-02-24T01:04:33.004325Z

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

qqq 2017-02-24T01:05:14.004326Z

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

qqq 2017-02-24T01:05:36.004327Z

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

tony.kay 2017-02-24T01:06:38.004328Z

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

qqq 2017-02-24T01:08:13.004329Z

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.kay 2017-02-24T01:08:31.004330Z

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

tony.kay 2017-02-24T01:09:08.004331Z

compare and contrast against other popular options

qqq 2017-02-24T01:09:14.004332Z

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

tony.kay 2017-02-24T01:09:24.004333Z

I love that series

tony.kay 2017-02-24T01:09:37.004334Z

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

qqq 2017-02-24T01:09:46.004335Z

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

tony.kay 2017-02-24T01:09:52.004336Z

multicursors, structural editing, VIM bindings, etc.

qqq 2017-02-24T01:12:06.004338Z

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

qqq 2017-02-24T01:12:12.004339Z

I want a QUERY which just selects EVERYTHING

tony.kay 2017-02-24T01:12:53.004340Z

(query [this] ['*])

tony.kay 2017-02-24T01:13:10.004341Z

you need the quote since * is a symbol

tony.kay 2017-02-24T01:13:44.004342Z

but that won't follow joins

tony.kay 2017-02-24T01:13:47.004343Z

of course

qqq 2017-02-24T01:19:00.004344Z

(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.kay 2017-02-24T01:20:27.004345Z

um, neither of those is right 🙂

tony.kay 2017-02-24T01:20:52.004346Z

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

tony.kay 2017-02-24T01:20:54.004347Z

makes more sense

tony.kay 2017-02-24T01:21:09.004348Z

ex2-child wants all of its properties

tony.kay 2017-02-24T01:21:27.004349Z

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

qqq 2017-02-24T01:21:47.004351Z

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

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

qqq 2017-02-24T01:21:54.004352Z

which I believe is the same as what you wrote

tony.kay 2017-02-24T01:21:55.004353Z

that is reasonable

tony.kay 2017-02-24T01:21:58.004354Z

yes

qqq 2017-02-24T01:22:02.004355Z

but I'm getting different results

qqq 2017-02-24T01:22:16.004356Z

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

qqq 2017-02-24T01:22:26.004357Z

this is section G, mutation exercises

tony.kay 2017-02-24T01:22:58.004359Z

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

qqq 2017-02-24T01:23:21.004360Z

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

tony.kay 2017-02-24T01:23:29.004361Z

no

tony.kay 2017-02-24T01:23:35.004362Z

there is nothing to the syntax 🙂

tony.kay 2017-02-24T01:23:39.004363Z

this is an Om-ism

tony.kay 2017-02-24T01:24:01.004364Z

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

tony.kay 2017-02-24T01:24:10.004365Z

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

qqq 2017-02-24T01:24:40.004366Z

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

tony.kay 2017-02-24T01:25:14.004367Z

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.kay 2017-02-24T01:25:34.004368Z

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

qqq 2017-02-24T01:25:34.004369Z

one last thing

qqq 2017-02-24T01:25:45.004370Z

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

qqq 2017-02-24T01:25:50.004371Z

clearly I'm not understanding this part

tony.kay 2017-02-24T01:26:27.004372Z

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).

qqq 2017-02-24T01:26:50.004373Z

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

qqq 2017-02-24T01:26:53.004374Z

got it; thanks!

tony.kay 2017-02-24T01:27:53.004375Z

Untangled modifies nothing about how the queries and normalization work.

tony.kay 2017-02-24T01:28:20.004376Z

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

tony.kay 2017-02-24T01:29:02.004377Z

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

qqq 2017-02-24T01:29:16.004378Z

well, clearly I didn't understand them fully

qqq 2017-02-24T01:29:18.004379Z

I'll look at them again

tony.kay 2017-02-24T01:29:36.004380Z

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

qqq 2017-02-24T01:29:37.004381Z

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

qqq 2017-02-24T01:30:07.004382Z

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

tony.kay 2017-02-24T01:30:44.004383Z

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

tony.kay 2017-02-24T01:31:39.004384Z

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

tony.kay 2017-02-24T01:31:47.004385Z

gnight 🙂

qqq 2017-02-24T01:32:17.004386Z

thanks for all your help; take care

qqq 2017-02-24T04:58:53.004387Z

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 ?

cjmurphy 2017-02-24T05:26:51.004388Z

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.

qqq 2017-02-24T05:27:47.004389Z

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

qqq 2017-02-24T10:18:29.004390Z

@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 😕

qqq 2017-02-24T11:47:37.004391Z

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

mitchelkuijpers 2017-02-24T15:06:55.004393Z

@qqq It takes a while but it is worth it

qqq 2017-02-24T16:36:28.004394Z

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.kay 2017-02-24T18:04:39.004395Z

@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.kay 2017-02-24T18:12:10.004396Z

@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.

mitchelkuijpers 2017-02-24T19:41:42.004397Z

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

wilkerlucio 2017-02-24T20:04:11.004398Z

@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

wilkerlucio 2017-02-24T20:05:13.004399Z

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 🙂

qqq 2017-02-24T20:16:48.004400Z

@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.kay 2017-02-24T20:19:50.004401Z

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

tony.kay 2017-02-24T20:19:59.004402Z

The intention was for them to actually target such ppl

tony.kay 2017-02-24T20:20:24.004404Z

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

tony.kay 2017-02-24T20:20:45.004405Z

crawl -> walk

qqq 2017-02-24T20:21:47.004406Z

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"

qqq 2017-02-24T20:22:33.004407Z

if this section: https://untangled-web.github.io/untangled/reference/reference.html#_untangled_server_and_full_stack_integration had actual sample code, I'd probably be complete

adambros 2017-02-24T22:10:44.004408Z

@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

qqq 2017-02-24T22:33:21.004410Z

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

qqq 2017-02-24T22:33:56.004411Z

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

qqq 2017-02-24T22:34:04.004412Z

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

adambros 2017-02-24T22:36:30.004413Z

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

adambros 2017-02-24T22:39:34.004415Z

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

qqq 2017-02-24T22:42:17.004417Z

looks like I really should watch these videos 🙂

adambros 2017-02-24T22:43:55.004418Z

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

qqq 2017-02-24T22:44:30.004419Z

the one thing that I hate about screen casts

qqq 2017-02-24T22:44:35.004420Z

is inability to random access the code

qqq 2017-02-24T22:44:52.004421Z

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" ?

qqq 2017-02-24T22:45:22.004422Z

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?

qqq 2017-02-24T22:45:33.004423Z

[ / end rant ]

qqq 2017-02-24T23:28:59.004424Z

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

qqq 2017-02-24T23:29:12.004425Z

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

qqq 2017-02-24T23:30:24.004426Z

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

👍 1
😆 1