untangled

NEW CHANNEL: #fulcro
mitchelkuijpers 2016-09-21T09:30:54.000441Z

Just a general question, I am kind of running into problems with the way om.next handles getting remote data. I just read some code of untangled and that makes a lot more sense to me. Is it possible to use that stuff without completely using untangled?

mitchelkuijpers 2016-09-21T09:52:21.000442Z

I mean the way it sends a mutation to load a remote field

2016-09-21T13:28:27.000443Z

@mitchelkuijpers not sure that anybody has tried. just looking through the code it doesn’t appear that it has any strict expectations that an untangled application is being used. you would have to set up your networking to support the data fetch api, which given the amount of time we spent getting it right, I probably wouldn’t recommend just from an effort/benefit tradeoff perspective. I’d definitely be curious to hear what others in the channel think

tony.kay 2016-09-21T15:59:16.000444Z

@mitchelkuijpers So, Untangled exists because Om next has some complexity to it that we believe has a reasonable general-purpose solution. In particular, the need to write a parser is a trade-off that Untangled believes is too costly from a general engineering perspective. At the end of the day, what you have to do (in your parser or in your database) is transform the raw database objects into a shape that will work for your tree. In Untangled, we prefer those transforms happen on user-driven events in a direct data manipulation manner (easy to reason about, lower cost on rendering overhead, generally easier). Loads in Om Next are always some sequence of: mutate something in app state to track that you are loading, return remote from the parser, get/merge the data (typically over top of the place where you marked that you needed to load), etc. It's the same thing over and over, but you end up peppering that logic about in a parser. Untangled wraps the need to do the above sequence in load-data and load-field. They do what you're going to have to do in Om Next...they just make it less work. They also deal with the potential problems of out-of-order completion, parallel queries for the same object (asking for different attributes), deep merge, and other issues that would normally show up in your program as bugs that would be mysterious to you. So, I don't have much interest in supporting the use case of "what can I pick out of Untangled?" The answer is: nothing useful. The main advantage of untangled is reducing the central complexity of Om Next: removing the need for a parser and lots of networking/load logic.

tony.kay 2016-09-21T16:02:13.000445Z

There are trade-offs, and there are missing features that still need added, but we're having great success with it. The problems we've run into (and others using it commercially) have been easy to work with, or resulted in extensions to the framework.

mitchelkuijpers 2016-09-21T16:03:14.000446Z

Aha that makes sense, I'll try it out and maybe switch over then. Thank you for your detailed answer much appreciated! @tony.kay

tony.kay 2016-09-21T16:03:23.000447Z

Check out the getting started videos, for sure

tony.kay 2016-09-21T16:03:40.000448Z

and the tutorial, and docs, etc.

tony.kay 2016-09-21T16:03:49.000449Z

cookbook

tony.kay 2016-09-21T16:04:19.000450Z

http://untangled-web.github.io/untangled/

tony.kay 2016-09-21T16:04:28.000452Z

http://untangled-web.github.io/untangled/docs.html

tony.kay 2016-09-21T16:04:54.000454Z

I also gave a talk at an Unsession in Seattle that is up on YouTube that details some more rationale

tony.kay 2016-09-21T16:07:20.000457Z

I've been doing what I can to make it approachable. Lots of demands on my time, but I do understand that there is a hurdle to Om Next and Untangled. Trying to get people over the hump. This stuff really is so nice to work with. There are "easier" front-end things to get started with, but as soon as you try to do something "real" the easy goes away.

πŸ‘ 3
tony.kay 2016-09-21T16:07:53.000458Z

Untangled/Om Next keep the overall picture much simpler

tony.kay 2016-09-21T16:08:23.000459Z

❀️

2016-09-21T16:29:04.000460Z

We just had our company hackday - I used untangled and I surprised myself by how amazingly fast and easy it was to work with now that I (mostly) get it.

tony.kay 2016-09-21T17:48:59.000461Z

Yeah I was coding something up last night from scratch and was just flying and giggling maniacally about my super-powers πŸ˜‰

tony.kay 2016-09-21T17:49:47.000462Z

:man_in_business_suit_levitating:

mitchelkuijpers 2016-09-21T17:55:10.000463Z

I will try it @tony.kay I have had some big problems with the way remote reads work with vanilla om.next. But it mostly solves a lot of other problems. We are moving away from re-frame to om.next and maybe untangled πŸ™‚

tony.kay 2016-09-21T17:57:21.000464Z

@mitchelkuijpers At the very least: with Untangled you write Om Next code: you just avoid the overhead of writing a parser and a bunch of plumbing. Worst case is you abandon Untangled and write a parser...so you really have nothing to lose

tony.kay 2016-09-21T17:57:37.000465Z

it really is additive

mitchelkuijpers 2016-09-21T17:57:58.000466Z

Damn it.. Now I have to migrate some code

mitchelkuijpers 2016-09-21T17:58:08.000467Z

I guess you are right

tony.kay 2016-09-21T17:59:42.000468Z

And if you abandon it, well, then you "get to play" with process-roots to fix your UI queries for your server, and implement your own remote loading scheme, etc. πŸ˜‰

mitchelkuijpers 2016-09-21T17:59:42.000469Z

Is this still the case? IMPORTANT: NOT READY FOR USE. Clone TodoMVC from github as a template instead or can I try the template?

tony.kay 2016-09-21T17:59:55.000470Z

you can try the template: FYI, I am working on the template TODAY

mitchelkuijpers 2016-09-21T17:59:56.000471Z

Yeah that is exactly what I am fighting with

mitchelkuijpers 2016-09-21T18:00:16.000472Z

especially the cb that sometimes needs a query and sometimes does not need a query

tony.kay 2016-09-21T18:00:18.000473Z

just testing it now

mitchelkuijpers 2016-09-21T18:00:25.000474Z

Awsum I will test it with you then

tony.kay 2016-09-21T18:00:36.000475Z

I can send you a tarball of it in a few if you'd like

tony.kay 2016-09-21T18:00:52.000476Z

it will take more time to integrate my work with the lein template system

mitchelkuijpers 2016-09-21T18:00:54.000477Z

Cool I would like that

tony.kay 2016-09-21T18:01:06.000478Z

making it deployable to Heroku as well

mitchelkuijpers 2016-09-21T18:01:08.000479Z

I just want to test some stuff out

mitchelkuijpers 2016-09-21T18:01:36.000480Z

Aha won’t use that but that’s pretty cool

mitchelkuijpers 2016-09-21T18:01:42.000481Z

I love heroku

mitchelkuijpers 2016-09-21T18:02:16.000482Z

I am going to eat dinner and then I will play around with it, thank you so much for your time @tony.kay

tony.kay 2016-09-21T18:16:08.000483Z

https://github.com/awkay/untangled-template-workspace

tony.kay 2016-09-21T18:16:15.000485Z

still in the works

tony.kay 2016-09-21T18:16:41.000486Z

having trouble with server code refresh, but it mostly works. Feel free to check it out, and you can just pull as I work on it

tony.kay 2016-09-21T18:16:45.000487Z

@mitchelkuijpers ^^^

mitchelkuijpers 2016-09-21T18:17:45.000488Z

@tony.kay Nice thnx ^^

mitchelkuijpers 2016-09-21T18:37:37.000489Z

@tony.kay do I need to make a index-dev.html in the resources folder?

mitchelkuijpers 2016-09-21T18:42:13.000490Z

I have it working nvm

mitchelkuijpers 2016-09-21T19:05:54.000491Z

Very impressed so far.. This could have saved me a lot of time

tony.kay 2016-09-21T19:08:02.000492Z

yeah, it is nice to work with. Turns out my problem was with intellij. pushed a few minor patches to project file, but otherwise it should be pretty good

mitchelkuijpers 2016-09-21T19:08:16.000493Z

The InitialAppState idea is pretty damn nice

tony.kay 2016-09-21T19:08:25.000494Z

yeah...makes things SO fast to prototype

tony.kay 2016-09-21T19:08:43.000495Z

I threw together that whole UI so far in about an hour with server interactions

tony.kay 2016-09-21T19:08:48.000496Z

another bit of time for css

mitchelkuijpers 2016-09-21T19:09:27.000497Z

It seems like you pretty much only write mutates and run txes to get remote data am I correct in assuming that?

mitchelkuijpers 2016-09-21T19:10:57.000498Z

Cool website btw

tony.kay 2016-09-21T19:13:14.000499Z

ooops...seems like I lost the HTML files

tony.kay 2016-09-21T19:13:25.000500Z

do you have them?

mitchelkuijpers 2016-09-21T19:13:39.000501Z

I made one myself

mitchelkuijpers 2016-09-21T19:13:40.000502Z

πŸ™‚

tony.kay 2016-09-21T19:13:47.000503Z

that was an accident

tony.kay 2016-09-21T19:13:57.000504Z

I wiped em unintentionally 😞

mitchelkuijpers 2016-09-21T19:14:51.000505Z

No worries, only cost me 5 minutes. untangled will probably save me hours

tony.kay 2016-09-21T19:18:20.000506Z

html pushed

mitchelkuijpers 2016-09-21T19:18:24.000507Z

What is the main pattern to load data? just put it in the componentWillMount?

tony.kay 2016-09-21T19:18:34.000508Z

there are 4 files. One for specs, one for devcards, one for production, and one for dev

mitchelkuijpers 2016-09-21T19:18:55.000509Z

Aha cool i will pull them in

tony.kay 2016-09-21T19:18:59.000510Z

load data happens mainly in two places: 1. There is a start-callback in core.cljs

tony.kay 2016-09-21T19:19:08.000511Z

2. Due to user events

tony.kay 2016-09-21T19:19:57.000512Z

it is possible to put them in componentWillMount, but I have not needed to. Another option is you can write a mutation that uses the helper functions load-data-action to emit a remote request from any arbitrary mutation.

tony.kay 2016-09-21T19:20:07.000513Z

See the cookbook for examples

tony.kay 2016-09-21T19:20:56.000514Z

So, imagine your app just loaded: use started-callback to get initial server state. Then you nav to some page you want to lazy load data for. Make a nav mutation that checks app state for the data, and if it is missing issues a load-data-action call from the :action of the mutation.

tony.kay 2016-09-21T19:21:23.000516Z

that gets you your "load on demand"

mitchelkuijpers 2016-09-21T19:21:37.000517Z

Yeah we currently use secretary, so that would fit very nice

tony.kay 2016-09-21T19:21:40.000518Z

which always want to look into app state to see if it is already there

tony.kay 2016-09-21T19:22:37.000519Z

yeah, with secretary, you just pass the app to transact! to trigger your nav mutation

mitchelkuijpers 2016-09-21T19:22:47.000520Z

Yeah

tony.kay 2016-09-21T19:22:56.000521Z

If you have not checked out the specs and devcards, be sure to try them

tony.kay 2016-09-21T19:23:04.000522Z

cards.html and test.html

mitchelkuijpers 2016-09-21T19:23:13.000523Z

I have to plug this into a existing re-frame codebase so I will probably do it like that

tony.kay 2016-09-21T19:23:45.000524Z

you have to be running all three figwheel builds (the -D options in the instructions)

mitchelkuijpers 2016-09-21T19:24:23.000525Z

Oh I have just started it on the repl

mitchelkuijpers 2016-09-21T19:24:46.000526Z

Works fine

tony.kay 2016-09-21T19:24:52.000527Z

great

tony.kay 2016-09-21T19:24:56.000528Z

spacemacs?

mitchelkuijpers 2016-09-21T19:25:22.000529Z

I actually use ohai-emacs from Bodill

mitchelkuijpers 2016-09-21T19:25:24.000530Z

πŸ˜›

tony.kay 2016-09-21T19:25:36.000531Z

cool. Glad to hear it works for u

adambros 2016-09-21T19:26:18.000533Z

you should be able to just call (start-figwheel) and it will start up everything or you can call it with a vector of build id strings eg: (start-figwheel [β€œdev”])

mitchelkuijpers 2016-09-21T19:26:45.000535Z

I will probably put untangled in our boot.build. Would you ever be interested in a boot option for the template?

mitchelkuijpers 2016-09-21T19:27:00.000536Z

Yeah works like a charm @adambros

adambros 2016-09-21T19:27:22.000537Z

i wouldnt mind, just shoot a PR on untangled-template whenever you got it

adambros 2016-09-21T19:27:46.000538Z

ill be updating it once tony figures out what he wants with his version

mitchelkuijpers 2016-09-21T19:28:02.000539Z

Cool will put that on my todo list

tony.kay 2016-09-21T19:29:09.000540Z

yeah, boot is on the TODO list, but none of us use it (yet), and we don't have the horsepower to maintain it. So at present any Boot pointers will be included sort of as documentation YMMV

mitchelkuijpers 2016-09-21T19:33:30.000541Z

Sure I wouldn’t mind helping out

mitchelkuijpers 2016-09-21T19:33:40.000542Z

I’ll have todo it anyways

mitchelkuijpers 2016-09-21T19:36:10.000543Z

Am I correct in assuming that I could just use my own endpoint on which I have an om/parser running which returns transit?

tony.kay 2016-09-21T19:37:11.000544Z

um...sort of.

tony.kay 2016-09-21T19:37:24.000545Z

let me think...there was some caveat

tony.kay 2016-09-21T19:37:48.000546Z

Oh. The error handling mechanism establishes some standards...which are undocumented

tony.kay 2016-09-21T19:38:01.000547Z

but for the most part, yes

tony.kay 2016-09-21T19:38:17.000549Z

You'd probably want to dupe the unhappy path stuff, but it is a small amount of stuff

tony.kay 2016-09-21T19:38:28.000550Z

and it needs a bit more baking anyhow

mitchelkuijpers 2016-09-21T19:38:56.000551Z

No problem.. we are currently using catacumba but figuring out how to integrate will not be hard I think

mitchelkuijpers 2016-09-21T19:39:04.000552Z

I guess I have a nice weekend project

tony.kay 2016-09-21T19:39:29.000553Z

no, the server stuff is all convenience except for some of the error handling formats that Untangled expects at the network layer. Easy enough to emulate

mitchelkuijpers 2016-09-21T19:40:13.000554Z

Oh I see the code

mitchelkuijpers 2016-09-21T19:40:22.000555Z

That stuff is trivial to reuse

tony.kay 2016-09-21T19:40:33.000556Z

should be

mitchelkuijpers 2016-09-21T19:40:41.000557Z

Cool I don’t see any roadblocks, thank you so much for convincing me

tony.kay 2016-09-21T19:40:50.000558Z

yeah, for that matter, just hook our api handler into your stack

mitchelkuijpers 2016-09-21T19:41:38.000561Z

Yeah I already found that, I can simply install ring middleware in catacumba

tony.kay 2016-09-21T19:41:45.000562Z

welcome. I think a lot of ppl still see Untangled as a competing framework to Om Next...we're just trying to make it easier

mitchelkuijpers 2016-09-21T19:42:25.000563Z

Yeah, I also saw it that way

tony.kay 2016-09-21T19:42:45.000564Z

Not sure how to fix that messaging. Maybe make that more prominent on the home page

mitchelkuijpers 2016-09-21T19:43:43.000565Z

I’ll tell it to everyone πŸ˜‰

tony.kay 2016-09-21T19:43:51.000566Z

@ethangracer Did you just patch post-sweep?

tony.kay 2016-09-21T19:44:03.000567Z

@mitchelkuijpers thanks! Word of mouth doesn't hurt πŸ™‚

tony.kay 2016-09-21T19:44:19.000568Z

I see the Jira, but no PR

2016-09-21T19:44:42.000569Z

@tony.kay are you talking about the story in jira? I’m pretty positive we fixed it ages ago, I haven’t seen mutation symbols in app state for quite some time

tony.kay 2016-09-21T19:44:59.000570Z

oh...ok, I honestly hadn't checked πŸ˜•

tony.kay 2016-09-21T19:45:12.000571Z

I just saw the story close and didn't see a UC change

2016-09-21T19:45:26.000572Z

yeah I marked it as already fixed

2016-09-21T19:45:41.000573Z

not sure when but I think it happened during a data fetch refactor

tony.kay 2016-09-21T19:45:53.000574Z

just FYI, I fixed the related network bug where the app stops trying to do network ops when it gets a malformed response

tony.kay 2016-09-21T19:46:32.000576Z

just added an exception try/catch...whcih should have been there anyway.

2016-09-21T19:46:39.000577Z

huh

2016-09-21T19:46:50.000578Z

didn’t even realized that was a thing

2016-09-21T19:46:55.000579Z

thanks πŸ™‚

tony.kay 2016-09-21T19:47:18.000580Z

you remember seeing (in console) malformed response '<' or something like that?

2016-09-21T19:47:26.000581Z

ohh yes

tony.kay 2016-09-21T19:47:37.000582Z

yeah...if you got that, you were dead. Reload required

2016-09-21T19:47:47.000583Z

awesome. yeah that was a pain

tony.kay 2016-09-21T19:48:29.000584Z

on 0.5.6 SNAPSHOT on clojars

2016-09-21T19:48:44.000585Z

excellent

2016-09-21T19:49:01.000586Z

also meant to ask, given the om is going to beta soon, where are we with untangled going to β€œbeta”?

2016-09-21T19:49:48.000587Z

it would be nice to have more docs but the code itself feels pretty solid

tony.kay 2016-09-21T19:49:57.000588Z

Largely a change to public facing messaging and docs, yeah

tony.kay 2016-09-21T19:50:12.000589Z

Feel free to bang out more docs πŸ™‚

tony.kay 2016-09-21T19:50:26.000590Z

I keep finding more stuff to do πŸ˜•

tony.kay 2016-09-21T19:50:40.000591Z

want to get the ref guide and tutorial beefed up for sure

tony.kay 2016-09-21T19:51:00.000592Z

We have a lot of cool stuff that isn't even documented

tony.kay 2016-09-21T19:51:05.000593Z

protocol support

2016-09-21T19:51:13.000594Z

yeah

tony.kay 2016-09-21T19:51:16.000595Z

extra routes

tony.kay 2016-09-21T19:51:19.000596Z

pre hook

tony.kay 2016-09-21T19:51:22.000597Z

etc

2016-09-21T19:51:25.000598Z

do we have protocol tests for todomvc?

tony.kay 2016-09-21T19:51:30.000599Z

don't think so

2016-09-21T19:51:54.000600Z

ok, I can write those up pretty quickly in the near future

2016-09-21T19:52:15.000601Z

and definitely want to add more to the ref guide as well

adambros 2016-09-21T19:54:20.000602Z

config env vars

2016-09-21T19:56:10.000603Z

untangled datomic migrations

2016-09-21T19:56:28.000604Z

list goes on

tony.kay 2016-09-21T19:56:35.000605Z

yeah...all of those

tony.kay 2016-09-21T19:57:29.000606Z

initial app state - that one was HUGE on impact to devs

tony.kay 2016-09-21T19:57:52.000608Z

I've documented that in cookbook at least

mitchelkuijpers 2016-09-21T20:02:02.000609Z

I have a problem where my server gives me 500 with a load-field and then the client keeps trying eternally

mitchelkuijpers 2016-09-21T20:02:15.000610Z

i try to run this: (f/load-field this :users :fallback 'users/server-down)

tony.kay 2016-09-21T20:02:33.000611Z

what does your server-down do?

mitchelkuijpers 2016-09-21T20:02:33.000612Z

and this is my query

(query [this]
    [:id
     [:current-user '_]
     {:users (om/get-query User)}])

mitchelkuijpers 2016-09-21T20:02:49.000613Z

I added that because I thought that might solve the issue

tony.kay 2016-09-21T20:02:54.000614Z

and what triggers your load-field?

tony.kay 2016-09-21T20:03:03.000615Z

looping is caused by your code

mitchelkuijpers 2016-09-21T20:03:03.000616Z

componentDidMount

mitchelkuijpers 2016-09-21T20:03:05.000617Z

hmm

mitchelkuijpers 2016-09-21T20:03:09.000618Z

lol yeah that is my mistake

tony.kay 2016-09-21T20:03:10.000619Z

oh yeah, like I said, don't do that πŸ˜‰

mitchelkuijpers 2016-09-21T20:03:21.000621Z

yeah you are right

tony.kay 2016-09-21T20:03:50.000622Z

you have to have an ident for load-field to work, and you have to implement the server bit correctly. 500 is all you too πŸ™‚

mitchelkuijpers 2016-09-21T20:04:19.000623Z

No that is because the query is invalid

mitchelkuijpers 2016-09-21T20:04:23.000624Z

I implemented the server bit

tony.kay 2016-09-21T20:04:34.000625Z

The generated server query will be a join on the ident { [:user 1] [...] }

mitchelkuijpers 2016-09-21T20:04:39.000626Z

Aha ok

tony.kay 2016-09-21T20:04:49.000627Z

which is why it needs an ident

tony.kay 2016-09-21T20:05:08.000628Z

load-field is really just a helper for load-data that derives the query for you

mitchelkuijpers 2016-09-21T20:05:23.000629Z

So I should not need it?

tony.kay 2016-09-21T20:05:36.000630Z

you don't "need" it...but it does make things easier

tony.kay 2016-09-21T20:05:49.000631Z

read the code...it is only a couple of lines

tony.kay 2016-09-21T20:06:05.000632Z

pull the query, focus it on the field, join it with the ident

tony.kay 2016-09-21T20:06:10.000633Z

then do what load-data does

mitchelkuijpers 2016-09-21T20:06:51.000634Z

Ah ok I’ll read it

mitchelkuijpers 2016-09-21T20:24:30.000635Z

Ah now I get it.. It is for loading extra data of certain entities with a id, so for example to get the posts of a user

tony.kay 2016-09-21T20:35:20.000636Z

zactly

tony.kay 2016-09-21T20:35:47.000637Z

lazy load stuff you didn't know you needed yet, related to something you already have

tony.kay 2016-09-21T20:36:16.000638Z

also puts a marker in place so you can easily show a spinner in that spot

tony.kay 2016-09-21T20:36:24.000639Z

in render

tony.kay 2016-09-21T20:36:43.000640Z

(marker in app database where the data will appear)

tony.kay 2016-09-21T20:36:51.000641Z

examples in cookbook

tony.kay 2016-09-21T20:37:05.000642Z

gotcha there is to remember to query for UI fetch-state

mitchelkuijpers 2016-09-21T20:41:38.000643Z

Yeah saw that

grzm 2016-09-21T21:38:00.000644Z

I'm trying to reset my app state on user log out and getting an Invariant Violation: malformed Ident. error. I'm using the same state that I'm initializing the app with, so I'm kinda confused at what the difference would be resetting the state as opposed to initializing it. Would the difference have to do with me initializing with a data structure (which is denormalized) as opposed to an atom?

grzm 2016-09-21T21:39:08.000645Z

You guys are great rubber duckies. I'm thinking that I need to swap it with the normalized state, not the denormalized one I initialized it with. And I can probably use tree-&gt;db to normalize my initial state.

grzm 2016-09-21T21:43:41.000646Z

Well, that was a good idea, but still got the same error πŸ˜•

tony.kay 2016-09-21T21:44:26.000647Z

@grzm interesting. Are you forcing a re-render from root?

tony.kay 2016-09-21T21:44:37.000648Z

could be Om is trying to render a sub-tree and there is no state for it

tony.kay 2016-09-21T21:44:56.000649Z

I'd unmount it and re-mount it

grzm 2016-09-21T21:45:26.000650Z

That could be. I'll give that a shot. Where would I put the code to unmount and remount the root?

tony.kay 2016-09-21T21:45:47.000651Z

make some top-level function. Make sure you're keeping the app in an atom

tony.kay 2016-09-21T21:45:58.000652Z

then just run umount/mount on the app

tony.kay 2016-09-21T21:46:07.000653Z

I've never tried it...you're in untested territory πŸ™‚

grzm 2016-09-21T21:46:07.000654Z

Cool. That makes sense.

grzm 2016-09-21T21:46:28.000655Z

Yay! I was pretty happy that I figured out how to reset history.

tony.kay 2016-09-21T21:46:31.000656Z

you will need to make the normalized db, and there you're right: db-&gt;tree

tony.kay 2016-09-21T21:47:22.000661Z

ah. those might be nice to have in the lib, now that you mention it

tony.kay 2016-09-21T21:47:44.000662Z

in fact, it totally makes sense what you're trying to do on logout

tony.kay 2016-09-21T21:47:59.000663Z

clean it up nicely and perhaps we can integrate it as part of the app interface

grzm 2016-09-21T21:48:10.000664Z

I think it should even be added to om proper, actually. It's independent of untangled.

tony.kay 2016-09-21T21:48:22.000665Z

good luck there πŸ™‚

grzm 2016-09-21T21:48:28.000666Z

But, yeah, will do πŸ™‚

tony.kay 2016-09-21T21:48:55.000667Z

default db format vs custom format. Not general enough for Om, and initial app state isn't available in a general sense liek it can be with Untangled

grzm 2016-09-21T21:49:12.000668Z

Oh, I meant just the reset history function.

tony.kay 2016-09-21T21:49:18.000669Z

oh, yeah, that one I agree

grzm 2016-09-21T22:20:02.000670Z

@tony.kay Is this what you had in mind for remounting?

(defn remount-app! []
  (let [reconciler (:reconciler @app)]
    (om.next/remove-root! reconciler (gdom/getElement app-mount-point))
    (om.next/add-root! reconciler ui/Root (gdom/getElement app-mount-point))))

tony.kay 2016-09-21T22:20:26.000671Z

oh, no, sorry

tony.kay 2016-09-21T22:20:38.000672Z

there is a mount/unmount in Untangled

tony.kay 2016-09-21T22:20:44.000673Z

part of the application interface

tony.kay 2016-09-21T22:21:25.000674Z

actually, looking back at the interface:

grzm 2016-09-21T22:21:27.000677Z

I see mount. I don't see unmount

tony.kay 2016-09-21T22:21:30.000678Z

we have reset-state

tony.kay 2016-09-21T22:21:37.000679Z

you're right on the unmount...oversight I think

grzm 2016-09-21T22:21:49.000680Z

I tried that, too. That gave me the same invariant error.

tony.kay 2016-09-21T22:22:42.000681Z

If you do your remount (with a reset-state in the middle), that is what I was talking about

grzm 2016-09-21T22:22:46.000682Z

I'll pound on it some more

grzm 2016-09-21T22:23:04.000683Z

gotcha. (I think)

tony.kay 2016-09-21T22:25:57.000685Z

yeah, looking over the code to refresh my memory. What you're suggesting (with a reset-state using db->tree) will likely work fine.

tony.kay 2016-09-21T22:27:05.000686Z

Technically, it would work "better" to do this through a mutation, and just include a root query key as a follow-on read

tony.kay 2016-09-21T22:27:53.000687Z

you can do a swap! on state in a mutation, query the Root query and initial app state to make the normalized "new" state

tony.kay 2016-09-21T22:28:07.000688Z

As I'm thinking about it, that would be the better approach.

grzm 2016-09-21T22:39:27.000689Z

That makes sense.

grzm 2016-09-21T22:39:40.000690Z

And feels cleaner

grzm 2016-09-21T22:44:10.000691Z

Is there a general root query key or should I just add a key for something the root requires?

grzm 2016-09-21T22:44:33.000692Z

For the follow-on read