Fork me on GitHub
#fulcro
<
2020-08-07
>
tbrooke02:08:52

Does anyone have an example of Fulcro with Crux ?

nivekuil02:08:40

https://github.com/souenzzo/graph-demo is endorsed by the crux team although crux has matured a bit since

👍 3
nivekuil02:08:03

I'm also using fulcro with crux, just a novice at this point, but it seems clear that fulcro (absent RAD's db adapters) is quite unopinionated about the database so there's no particular challenge there. I think the brand new projection syntax in crux is a much more natural mapping to fulcro/pathom

lgessler07:08:44

i'm using crux in a (non-rad) fulcro app i'm developing, can't promise anything about code quality but at least you can see the naïve approach 😅 https://github.com/lgessler/glam/tree/master/src/main/glam/crux

tbrooke14:08:26

Thanks I’ll take a look - I’m looking at RAD butit seems clear that it is modular so I can leave off the db adapter

cjsauer15:08:28

A crux db adapter would be cool

dvingo15:08:49

Has anyone added general undo support for fulcro? I imagine you'd do something like this (https://swannodette.github.io/2013/12/31/time-travel/) and store the history vector on the fulcro app, but I wonder if there are any code samples for fulcro to look at

dvingo15:08:44

for now I'd like a simple undo stack - no fancy redo/tree undo

dvingo15:08:54

I am also thinking about how you'd have some domain actions that are composed of a few mutations, so "undo" would have to potentially traverse back into the undo history a few entries

tony.kay17:08:24

@danvingo F2 had this built-in, but no one used it so I dropped it in 3. It’s simple enough with the new pluggable tx system to add it back…or for that matter you could add wrapper function around transact itself that could capture that history. Navigating to it is as simple as resetting the state atom and scheduling a render

tony.kay17:08:34

Here are some other interesting things around this: What if you had checkpoints just before a full-stack operation (i.e. a form save) so that you could do an optimistic save (i.e. route away from the form immediately), but in error-action if the form returned an error you could clear the network queue (all other full-stack things would be behind that one) and time-travel them back to the last known good point. I started to implement that some time ago, but just didn’t…but time travel for full-stack error handling in an otherwise optimistic app is new direction to go in SPAs that I think is interesting.

dvingo18:08:12

I think this is a good idea to enable fairly straight forward support of resetting after a network failure

tony.kay17:08:10

Of course the support viewer concept is just a transit encoding of that history sent to a server for developers to use in reconstructing what was going on in the UI..in that case it is also nice to add in the history of tx’s as annotations on each history node

lgessler18:08:58

backtrack app state on error does sound pretty nice

lgessler18:08:02

implementing undo in general sounds hard though right? if an undo takes you back past the point of a full stack mutation i think you'd have to always ensure that you trigger an inverse mutation right

lgessler18:08:26

unless your server-side data store also somehow supports an undo operation

dvingo18:08:21

yea, was just thinking through why I thought up wanting this and realized the server is going to have to be involved for anything meaningful

dvingo18:08:45

specifically I was thinking of undoing an accidental deletion - that goes full stack

lgessler18:08:23

i feel like you'd have to do extra work to account for the fact that other clients might have done things that would make the true "inverse" even more complicated

lgessler18:08:44

if your db supports it one stupid way to implement it would be to rollback the entire db state but obviously other users might not appreciate that

lgessler18:08:07

not as easy as it was in desktop apps!

dvingo18:08:46

with crux it becomes possible to reset an entity, but it would still require thinking through relationships

3
lgessler21:08:50

is there any standard advice for code re-use among different handlers in a uism? i find i'm often having to repeat things like lets

nivekuil22:08:54

does fulcro support render-as-you-fetch like react with suspense? https://reactjs.org/docs/concurrent-mode-suspense.html

Jakub Holý (HolyJak)18:08:26

What do you want to achieve? I think you would typically use a deferred route and use the router and it's built-in states to display a loader or something. You could also trigger both fetch and dr/target-ready in parallel in route-deferred so that the component renders while you are fetch (and you would wrap the content in (if (target-data) display-data display-loader)

souenzzo22:08:50

@kevin842 fulcro never used "fetch-on-render" or "fetch-then-render" I'm not sure if we can call "render as you fetch" in fulcro, it's more like "know what you fetch. always render" (?!) On Scaling Full-Stack Applications - Wilker Lucio da Silva presentation, wilker talked about some EQL/pathom integration that allows partial responses for EQL queries.