fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
Danny Almeida 2021-01-14T02:21:54.012Z

Hi, I'm struggling to understand how to compose an *BlockingOverla*y component and get it's data fed into it. I'm using https://book.fulcrologic.com/#DynamicRouter from the Fulcro book. I would like to replace the javascript alert popup with `BlockingOverlay` component from https://book.fulcrologic.com/#UIBlocking so in :will-leave, when the checkbox is clicked, instead of calling the alert popup, I would like to display the `BlockingOverlay` component by setting it's ui/active? to true. I don't know how to compose the query and get props for the overlay from within `Person` component. I would like to have the overlay to be visible when :ui/modified? is true. Hope Since the person component is using deferred loading with no initial state, I can add the ident for BlockingOverlay in Person data tree. Hope I'm making sense 🙂

yubrshen 2021-01-14T05:51:16.014700Z

@tony.kay I feel that there might be a typo here: https://book.fulcrologic.com/#_create_your_project Create a directory and set up a basic node project:

$ mkdir app
$ cd app
$ mkdir -p src/main src/dev resources/public
$ npm init
... answer the questions or just take defaults ...
$ npm install shadow-cljs react react-dom --save
In it mkdir... should be: mkdir -p src/main/app ... to account for the namespace of app.client I was following the document, and ran into the problem. After fix it, then it worked as documented.

tony.kay 2021-01-14T17:53:33.019300Z

You still have to make the source file, yes, so adding that addl directory would be convenient for some users. If you’re using IntelliJ it will make that for you. If you’re creating the file by hand, then yes you’ll need that directory. Either way it would be fine to pre-create it.

🙏 1
henrik 2021-01-14T16:56:08.015900Z

Is there an example of nested routers to be found somewhere? I'm having trouble getting the child router to initialize, and I'm not sure if I'm missing some crucial component or trick.

đź‘Ť 1
tony.kay 2021-01-14T17:46:17.016500Z

@henrik Make sure you compose in initial state and issue a route command that goes all the way to a leaf target.

đź‘Ť 1
tony.kay 2021-01-14T17:52:19.019200Z

It is legal to move top-level routes by themselves, only if the children have ever been routed to. Routers are independent composable elements. The initial routing story could certainly be improved, but for the moment at least it is up to you to say a route all the way to a leaf target unless you know it is safe to omit sub-paths (because they’ve already been routed before).

henrik 2021-01-15T20:22:23.026300Z

Route issued is full, to the leaf node, and state is composed, at least theoretically. Should a router get-initial-state on its route targets, or should the component mounting the router do get-initial-state for those targets, effectively bypassing the router (in addition to setting up the initial state for the router itself)?

tony.kay 2021-01-15T20:44:51.026600Z

The router does it. Just look at the macro…it just emits an augmented defsc

henrik 2021-01-19T23:32:35.063900Z

Thank you