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
.
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.
@cjmurphy Could be something wiggy about running it in devcards
sorry I’ve been gone for a while…took a trip to Alaska without my computer
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.
The hot code reload is telling.
I seem to remember having a similar problem with a demo that I discovered and fixed…cannot recall the problem though
so you didn’t change the UI code at all, right?
The initial list of phone numbers, From server? Or are you using initial state?
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.
ok, so you see the items loaded from the server. interesting
It’s not getting indexed right
by Om
so that when transact is called, it cannot find what it wants…I’m just not sure why
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
that causes a re-render/re-index
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.
that’s my guess, at least
OH…try adding ident functions to the components in the union
and anything else missing an ident.
when indexing a new component on ui refresh, I think it needs it? Not sure
Yes PhoneList and PhoneEditor don't have ident functions.
they are the same as the router’s (must be, that is)
I am personally a little unclear as to if/when Om needs them in both places 😕
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
let me know if that fixes it
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.
Will do, tomorrow your time.