Can UISM instances be actors in other UISM instances? It seems that it's possible, but kinda weird since actors are idents and the only way to trigger UISM events is via the id (not ident). Maybe I'm just missing the helper fn?
Technically yes. Anything with an ident can be an actor, but of course I/O integration is around UI components, so that is not really the intention.
I’d typically say what you want to do is send other UISM IDs as event data, and store that in the local store of the UISM…really all you typically want to do is “signal” other state machines…so that is enough, and you know what “table” they live in, so having their ID means you know where to look in state if you wanted to gaze into them to look for things like “current state”
Cool, that works.
I have a problem with a component here. I load all data needed in :will-enter
, and that component shows up with the correct data very quickly (as I expect it to). But... after it has shown up with all the data expected, for some reason there is a ton of work going on server-side still, for over 10 seconds even with a small dataset of less than 100 entries. Whatever action I try to trigger client-side gets queued and blocks until the server is done with that mysterious thing. Did anyone have that before, and can maybe give me some pointers how to figure out what's going on?
Take a stack trace(s) of the server to see what is it doing. Perhaps something somehow triggered by the resolver you invoked?
Fulcro RAD Datomic runs this one for every single account in the entire system after my actual query I posted above has been run and the results are already displayed:
_rad.database-adapters.datomic:-385 - Running [:account/first-name :account/last-name :account/roles :account/job-title :account/headline :account/photo :account/email :account/email-verified? {:account/approved [:tenant/id]} :password/hashed-value :password/iterations :password/salt :account/accepted-tos-version :account/bio {:account/languages [:language/id]} {:account/vendor-type [:vendor-type/id]} :account/vc-contact :account/location {:account/vendor-specialism [:vendor-specialism/id]} {:account/vendor-skills [:vendor-skill/id]} {:account/vendor-geo-expertises [:vendor-geo-expertise/id]} {:account/vendor-industry-experiences [:vendor-industry-experience/id]} {:account/worked-with [:external-company/id]} :account/password-reset-id {:account/links [:link/id]} :account/created :time/created] on entities with :account/id : [[:account/id #uuid "95a2dbec-ba46-4463-8e5d-5a6eddba95b2"]]
And this query doesn't exist anywhere in my code base. This is every existing attribute where ao/identities
is set to :account/id
. I have no idea why it gets triggered, and why only in this one case
I wouldn't be loading in :will-enter
. I would load in one of three places - start up, user event or timer event. And none of these require :will-enter
.
If you call the df/load
just from a button do you get the same problem?
I will try that tomorrow morning, but a button is not really an option. Might help for debugging the problem though, thanks!
Also you don't show the resolver or the call site. I'm happy to try to replicate. Button just for debugging the problem, to see if it still happens when simple invocation.
I realise :will-enter
just means 'been routed to' and that examples in the book and RAD use it for doing serious work, including loading. So I should have been a bit more nuanced in what I said before. But nothing wrong with taking routing out of the picture. How did it go?
When a mutation throws, the stacktrace being logged does not contain any information about what's happening in the mutation. It stops right before, more or less at com.fulcrologic.fulcro.algorithms.tx-processing/run-actions!
.
This is of course very hard to work with. Is this behavior normal or is something wrong on my side of things?
nothing Fulcro is doing.
Use exception breakpoints in js console
more informative anyway
has anyone in here written a guide on how to add an http-remote to fulcro? looks like the book is out of date
When you look here: https://github.com/fulcrologic/fulcro-rad-demo/blob/master/src/shared/com/example/client.cljs#L33 You can override the remote config by doing:
(defonce app (rad-app/fulcro-rad-app
{:remotes {:some-remote (net/fulcro-http-remote {:url "/other-api"})}
:client-will-mount (...etc)}))
The fulcro-rad-app
just wraps the normal fulcro-app
btw: https://github.com/fulcrologic/fulcro-rad/blob/develop/src/main/com/fulcrologic/rad/application.cljc#L84
oh awesome, thanks!