untangled

NEW CHANNEL: #fulcro
cjmurphy 2017-05-16T00:09:30.694358Z

The full stack untangled-ui demo uses a mock network. https://untangled-web.github.io/untangled-ui/guide.html#!/untangled.ui.Forms__10_Full_Stack_Demo But I've got it going using a real client / server setup. If I do a trick it works fine. When first up I see the list of phone numbers in the browser window, but clicking on them doesn't work. What I get is "No queries exist at the intersection of component path (app.root/Root app.ui/TopLevelRouter app.ui/TopLevelRouter-Union app.ui/PhoneList) and data path [[:screen/phone-list :tab]]" in the browser console. The trick to get everything to work is to make figwheel do some reloading of app.core by commenting out :refresh, letting figwheel hot reload, then un-commenting the :refresh.

cjmurphy 2017-05-16T00:12:11.716511Z

I haven't changed any of the code, just made it full stack and obviously in different namespaces. Here's where I need to make the change https://github.com/chrismurrph/csv-to-csv/blob/master/src/client/app/core.cljs.

tony.kay 2017-05-16T22:28:49.775865Z

@cjmurphy Could be something wiggy about running it in devcards

tony.kay 2017-05-16T22:29:28.783750Z

sorry I’ve been gone for a while…took a trip to Alaska without my computer

cjmurphy 2017-05-16T23:05:47.202039Z

Glad you're back and out from the wild! Yes I think it is something more interesting than some simple timing problem. I did try putting in an artificial delay for the client<->server round trip - simply because that's what I see as the main difference between mock and real server - but that didn't help.

tony.kay 2017-05-16T23:06:38.211879Z

The hot code reload is telling.

tony.kay 2017-05-16T23:07:21.219909Z

I seem to remember having a similar problem with a demo that I discovered and fixed…cannot recall the problem though

tony.kay 2017-05-16T23:08:44.234799Z

so you didn’t change the UI code at all, right?

tony.kay 2017-05-16T23:11:51.268497Z

The initial list of phone numbers, From server? Or are you using initial state?

cjmurphy 2017-05-16T23:19:46.351052Z

I didn't change the code. Just wanted to move to client/server situation, for my own re-learning of Untangled. app.api/server-state has all the initial phone numbers, on the server. make-phone-number is now a function only available on the server.

tony.kay 2017-05-16T23:30:10.458766Z

ok, so you see the items loaded from the server. interesting

tony.kay 2017-05-16T23:36:03.516612Z

It’s not getting indexed right

tony.kay 2017-05-16T23:36:06.517189Z

by Om

tony.kay 2017-05-16T23:36:24.520032Z

so that when transact is called, it cannot find what it wants…I’m just not sure why

cjmurphy 2017-05-16T23:36:24.520045Z

Yes - I can get them to load perfectly as long as I do the comment/un-comment trick: https://github.com/chrismurrph/csv-to-csv/blob/master/src/client/app/core.cljs#L19

tony.kay 2017-05-16T23:36:37.522164Z

that causes a re-render/re-index

tony.kay 2017-05-16T23:37:33.531089Z

you could probably get an equivalent “fix” by adding a no-op transact to a button at the root of the UI so the thing re-renders.

tony.kay 2017-05-16T23:37:48.533487Z

that’s my guess, at least

tony.kay 2017-05-16T23:39:03.545688Z

OH…try adding ident functions to the components in the union

tony.kay 2017-05-16T23:39:25.549222Z

and anything else missing an ident.

tony.kay 2017-05-16T23:40:50.563037Z

when indexing a new component on ui refresh, I think it needs it? Not sure

cjmurphy 2017-05-16T23:41:31.569465Z

Yes PhoneList and PhoneEditor don't have ident functions.

tony.kay 2017-05-16T23:41:46.571865Z

they are the same as the router’s (must be, that is)

tony.kay 2017-05-16T23:42:01.574291Z

I am personally a little unclear as to if/when Om needs them in both places 😕

tony.kay 2017-05-16T23:42:57.583338Z

I suspect when it does a refresh render and tries to minimize refresh it needs the ident in order to properly index the (refreshed) component

tony.kay 2017-05-16T23:44:33.598705Z

let me know if that fixes it

cjmurphy 2017-05-16T23:44:49.601120Z

As an app programmer I always used to use idents for panels as well as entities, so would never normally have come across this issue, if indeed that is the fix.

cjmurphy 2017-05-16T23:45:19.606116Z

Will do, tomorrow your time.