Fork me on GitHub
#fulcro
<
2021-11-08
>
Timofey Sitnikov12:11:18

Good morning, I must be missing something, please help. The first set of statements print on the REPL, the second set, after the (swap! ... block do not, why? I thought that each block within (do should execute till the end?

tony.kay13:11:13

env is not an atom. Swap is throwing

tony.kay13:11:32

you want (:state env)

1
Timofey Sitnikov13:11:10

Ahhh, got it, thank you ...

sheluchin15:11:30

Do the tabular RAD reports have a mechanism for performing an action on row click (without adding controls) or is that just handled by defining your own row UI with an :onClick function? I want to to have the tabular report show a graph in a separate div when a row is clicked. A component with a router would be one way, but I'm wondering if RAD has something for it that I'm missing in ro.

Jakub Holý (HolyJak)15:11:03

I don't rhino there is anything like that but might be wrong

👍 1
tony.kay16:11:05

no. The default state machine uses row clicks to select (highlight) the row, and there is currently no additional hook

tony.kay16:11:05

but it seems a reasonable thing to have a hook for. I'm in the code of RAD right now. I'll add a task marker to add such a hook

tony.kay16:11:57

well, actually, there is already something that would work

sheluchin16:11:10

Please enlighten me 🙂

tony.kay16:11:14

ro/link or ro/links

tony.kay16:11:56

the former is deprecated, but the latter will turn a column into a custom link

tony.kay16:11:33

that doesn't interfere with the entire row...I'll still add one for clicking on the row itself

sheluchin16:11:39

Yeah, I was wondering about that one. So the function part is self explanatory, but what would the key be? If I wanted it to apply to the whole row, just use the same fn on all the column names?

tony.kay16:11:52

right...whole row is what isn't supported (yet)

sheluchin16:11:30

Gotcha. That's good enough for my current needs, but it does seem like hook support for the entire row would be helpful. Thank you!

sheluchin17:11:38

Also, using ro/links wraps the column text in an a tag, which may not be desirable. It makes sense for a single-column action but as a workaround for the per-row action the wrapping is not desirable. I'm sure you're aware of this but wanted to point it out while we're talking about the options.

tony.kay17:11:04

you can always use a column formatter to do exactly what you want for a column

tony.kay17:11:28

I just pushed a rad-1.1 branch on RAD and SUI plugin. If you use deps, you can try latest commits on those branches to get the on-row-select

👀 1
tony.kay17:11:37

I'm doing a bit of refactoring, so I'd be interested to know if anything breaks. Mainly I made an optimized wrapper for form fields, which if I screwed something up might break subtle things, like validation messageson fields or something. See with-field-context

tony.kay17:11:06

and I also exposed more helpers for when you want to take control of rendering a form

sheluchin17:11:03

I'm not making use of any forms so far, just doing some scraping and building reports from the data. Afraid I won't be of much help to test forms at the moment.

tony.kay17:11:32

no worries. I'll get to testing it. Just wanted you to try your report link and see if that does it for you

tony.kay17:11:43

Any breakage will be trivial to fix

sheluchin17:11:45

Pulling 952278690222ed38d09eb15b28f13f09726d04ce.

tony.kay17:11:02

you needs both libs

tony.kay17:11:11

rad sui and rad

tony.kay17:11:27

the option is defined in RAD and implemented in the UI plugin

sheluchin17:11:44

Got it. I'll try it out and let you know if it does the thing.

sheluchin17:11:09

Yep, looks like exactly what I was asking about. I don't understand how you get that implemented so quickly but I sure am grateful for it.

tony.kay18:11:10

😄 You just happened to hit me while I was about to do a commit related to forms in both those libs.

stuartrexking22:11:45

How would I use render props https://reactjs.org/docs/render-props.html with a react component in Fulcro. I want to use https://headlessui.dev/react/disclosure with the open prop.

Jakub Holý (HolyJak)22:11:38

You mean use their React component in a Fulcro component and have it render another Fulcro component?

Jakub Holý (HolyJak)23:11:21

See comp/with-parent-context In https://book.fulcrologic.com/#ReactMotion - could that help?

tony.kay03:11:31

You can also use the hooks ns with things like use-component to create raw functions that act as components, then use low-level react factory. on that function. At that point it is pretty much 100% a React js component.

bmaddy22:11:19

Has anyone else been able to get the cljs repl working with emacs for https://github.com/fulcrologic/fulcro-rad-demo? I keep getting

error in process filter: user-error: The shadow-cljs ClojureScript REPL is not available.  Please check  for details
and I'm not sure how to debug it. Please let me know if #shadow-cljs is a more appropriate place to ask this.

Jakub Holý (HolyJak)22:11:41

Do other editors work? And yes, I would ask in #shadow-cljs or/and #cider

bmaddy02:11:34

I don't have any other editors set up to work with Clojure, so I haven't tried. I'll check the other channels.

Jakub Holý (HolyJak)11:11:30

Have you got it fixed?

bmaddy19:11:41

Nope, no progress. In #cider, bozhidar said it looks like it's not finding the shadow-cljs library. I'm not sure why though.

bmaddy22:11:51

I figured it out. It turns out I was connecting to a clj repl insterad of a cljs one. I thought I was supposed to connect to a clj one and it would start a cljs repl, but I was wrong.

🎉 1
Jakub Holý (HolyJak)22:11:58

Glad to hear you figured it out!