Fork me on GitHub
#fulcro
<
2018-04-08
>
d4hines00:04:16

Looks like the issue is that Survey is only rendering once, and the new values never get passed to it. I need to somehow refresh it on each transaction,

d4hines00:04:56

From the Dev Guide: >Refresh the subtree starting at the component that ran transact!. If it was the reconciler, run from root. If Suvey is calling transact, why isn't it's subquery built from Questions getting handed to it again?

cjmurphy00:04:11

@d4hines If you make the rendering mode :keyframe there should be no rendering issues.

d4hines00:04:59

There aren't any (visible) rendering issues. I'm trying to send the data to the server, but I can't seem to do so.

cjmurphy00:04:01

Does your defmutation have a remote?

d4hines00:04:15

Yes, just the default.

d4hines00:04:54

Oh, wait, I'm mixing things up. The submit mutation is called by Survey, but the value changes are called by the children Questions. My guess is that i need pass the value changes as a computed call back, and run the transact them from the parent Survey.

cjmurphy00:04:41

I believe you could also pass the function that does the transact! into the child.

cjmurphy00:04:14

Using computed props yes.

d4hines00:04:32

Yeah, that's what I'm trying right now. It's definitely re-rendering now! Sweet! Unfortunately, I've crossed a wire somewhere because all the values are, "p1__81540__81541__auto_"

d4hines00:04:27

Turns out the above issue was I missing the the unquote.

d4hines00:04:09

It's working now! Thanks @cjmurphy

nbdam08:04:32

I'm playing with new fulcro css (2.5.0-beta1). Css localization does not seem when selector references multiple classes (eg. :.menuitem.selected - only menuitem gets localized). Maybe the problem is that fulcro-css.css/localize-name looks only at prefix?

tony.kay16:04:39

Hm…sounds like a bug. Might submit an issue. I though I had a test for that case.

piotrek09:04:22

Hello @tony.kay. I was playing with https://github.com/fulcrologic/semantic-ui-wrapper/ to make it work with shadow-cljs according to your suggestions. I have come up with the following: https://gist.github.com/pbzdyl/d884d927d2b60e42a4d39a086f66dcfc

piotrek09:04:21

If you take a look at the gist you will noticed that I reused some of the code used in fulcro.client.alpha.dom (which is now just fulcro.client.dom) so one can use kw for ids and css classes etc.

piotrek09:04:00

When I was doing that I was wondering if it would be possible to include a public API in fulcro providing factory apply doing what it’s doing in my gist so it doesn’t have to be repeated by anyone wrapping other react components with cljs wrappers?

piotrek09:04:49

I also noticed that prim/factory also generates factory fn which doesn’t work as dom factory functions from fulcro.client.dom. I think it would be useful to have at least prim/factory to return a function that would also support optional id/css kw and optional props arguments. We could even provide a way to have macros so some of the processing would be done during compile time (like with fulcro.client.dom). Was it considered/discussed? If yes, what was the decision and why?

tony.kay16:04:29

The factory is already pretty complicated inside, most components need props from the query, and components rarely need CSS from the parent…and you can always make your own wrapper if it comes up for you a lot.

tony.kay16:04:49

semantic UI react wrappers are an outlier, not the norm

tony.kay16:04:09

and even then, you don’t really put CSS on them..they are the css wrappers

piotrek17:04:37

OK, I got it - thanks @tony.kay

eoliphant13:04:56

Hi, I’m just diving into the CSS support. as I understand it, I need to have parent components css-include their immediate children in order for the upsert to work? How does this work with routers? My current structure is Root -> MyRouter -> Page[x], and I don’t see where I can declare css-includes on the router. I’ve tried having Root’s :css-includes refer to the pages directly and that doesn’t seem ot work either

tony.kay16:04:59

@eoliphant The composition of CSS is for your convenience…you can upsert CSS from any component, and it will bring whatever is included.

tony.kay16:04:05

so you only compose in things that have css…and for a router you’d just list all of the children that have css

tony.kay16:04:44

in other words, you don’t have to have include on every component…you can skip as many as you want…(which is true for components without queries as well, for composing queries)…you skip composing the ones “in the middle” as if they aren’t there…because to the CSS (or query) system, they aren’t

eoliphant16:04:29

ok gotcha that makes sense