It looks like ro/row-visible? does not get called when using https://github.com/fulcrologic/fulcro-rad/blob/main/src/main/com/fulcrologic/rad/state_machines/server_paginated_report.cljc. I think this might be a bug. Anyone run into this issue before?
Not a bug
how can filter work as a local function if the server is the only thing that has the data?
Says that right there in the docstring
“server is responsible for sorting and filtering”
Those are the trade-offs. If you want client-side filtering, you want to download all of the data…that is the default report state machine. If you want to avoid the download, then there is no other way to filter/sort/paginate THAN to do it on the server.
Alright, that makes sense then. My thinking was that it could be a combination of both server and client -side filtering so that report controls could be used on the loaded data without doing additional loads. e.g. you might download 100 rows and then use controls to whittle those down in the client. I can see how that would introduce a bunch of complexity without adding so much benefit. ty sir!
You can always customize a new machine to do what you want…but yeah, it would not be easy to use, or a good UX IMO, but YMMV
Wondering how folks are handling routing in react native apps. Are you using the built-in RAD routing or something like react-navigation or expo-router?
I use the built-in stuff, and actually that's part of why I'm working on the new state charts based routing. I'd rather do my application structure with a state chart. Using some sort of external router from the JS ecosystem isn't going to be able to patch your component queries, so it's a pretty bad idea
That’s what I figured as well. Did you just wrap the route components with animated transitions to give it that fancy stacked feeling?
I haven’t done anything of the sort (yet). I’m not the guy to make things pretty
I am able to navigate using the native-history ns in my repl from a report route to a defsc-container dashboard route.
(history/back! @SPA)
=> ({:route ["dashboard"], :params {}} {:route ["properties"], :params {}})
The issue i'm facing is navigating from a form back to the report.
(history/back! @SPA)
=> nilI think I might have it workiing.
Coming back to this. There's no html5-history on mobile. How are you using the built-in routing with history support?
I made my own, e.g. app.ui.rad.routing.native-history that implements the RouteHistory protocol in com.fulcrologic.rad.routing.history. I based it off of com.fulcrologic.rad.routing.html5-history. I did it in haste but just kind of assumed that was what I should do - haven’t really even tested or used it much but let me know if you get stuck I’m happy to send it to you.
I would greatly appreciate it if you could share your solution. I’ll also try statecharts, @tony.kay. However, I seem to recall you mentioning something about it lacking some rad form control support. Is that correct?
I’m using the built-in stuff, primarily because I had just gotten used to it on the browser-side and didn’t want to invest the time figuring something else out.
Thanks for sharing your solution. The route history works, however I am running into a uism issue (error below) when I navigate back rroute/back! in a form.
I am unable pin down the reason for this.
WARN [com.fulcrologic.fulcro.ui-state-machines:?] - UNEXPECTED EVENT: Did not find a way to handle event :ready! in the current active state: :routedDoes something like this work? Like from within a comment when attached to the native cljs repl?
(history/back! @SPA)
Where the history namespace is the one I sent and @SPA is an atom with the app in it.
No, I am using the regular rad route ns.
You could trying sending :event/cancel to the state machine that is in state… a somewhat contrived example from my code is:
(uism/trigger! app [:participant/id (new-uuid 800)] :event/cancel)
That would at least confirm it is working … but if you are using react-native then building up something equivalent to https://github.com/fulcrologic/fulcro-rad-semantic-ui/ is probably where you’ll want to end up. I’m sort of in the middle of it right now, would have to take some time to carve it out though.
fwiw the code in form/cancel! described https://book.fulcrologic.com/RAD.html#_taking_over_rendering is where I figured out the :event/cancel thing.
Ok. I’ll try out the event cancel first. I am using gluestack for my RN app. I have a https://github.com/yoodame/fulcro-gluestack-ui repo started here with ui wrappers and rad renderers. This is my defonce app example. Is your RN application similar to this with expo/fulcro-app?
(defonce app (-> (rad-app/fulcro-rad-app {})
(merge {:cached-images resources/images
:cached-fonts resources/fonts
:client-did-mount (fn [app] (log/info "Client did mount"))
:remotes {:remote (net/fulcro-http-remote {:url ""
:request-middleware (rad-app/secured-request-middleware nil)})}})
(expo/fulcro-app))) Yeah I’m using the bare react native CLI at the moment. I took out the :remotes key but mine looks like:
(defonce APP
(-> (app/fulcro-app
{:shared-fn #(select-keys % #{:root/appearance [:appconfig/id "startup"]})
:render-root! render-root
:hydrate-root! (fn [& _])
:optimized-render! kr/render!
:global-error-action global-error-action})
(btxn/with-batched-reads)
(load-cache/with-load-cache edn-store)
(durable-mutations/with-durable-mutations edn-store (tempid-strategy/->TempIDisRealIDStrategy))))(sent example via dm)