Fork me on GitHub
#fulcro
<
2019-04-23
>
levitanong06:04:28

I seem to be running into issues with uism/trigger-remote-mutation on safari. works fine on chrome though.

levitanong06:04:38

anyone else running into this?

levitanong08:04:22

oops, looks like things weren’t working because of the actor needing to be mounted

levitanong08:04:46

Though i still find it odd that it the requests happened in chrome and firefox anyway, but not safari

danielstockton12:04:55

Does colocated css get inserted on the fly, or is everything there on page load?

kszabo12:04:42

you insert it explicitly

kszabo12:04:27

so you can do both

danielstockton12:04:13

Right, but say I have a style that is conditional on something on state. Does it insert extra styles dynamically when state updates, or is every branch precalculated and inserted on page load?

danielstockton12:04:58

I need to be able to generate the exact same styles to insert inline server side (not necessarily for server side rendering)

kszabo12:04:59

I don’t think Fulcro supports dynamic CSS

kszabo12:04:26

you instead should declare your styles using component local css + localized class names

danielstockton12:04:43

Ok, I actually don't want dynamic css, because i don't want the overhead and i want to be able to reuse the css outside of a react app

jackson18:04:52

Howdy all, I have a form with a select as the first element. The select is working fine and loading options from the server no problem. I'd like some of the other form inputs to provide defaults based on the chosen select option at the top but I'm having a difficult time with this. Is there an example that anyone can provide? I'm just using basic html, no bootstrap or anything fancy.

tony.kay19:04:06

@jackson.reynolds So, you select something in the first thing, and that should trigger the load of defaults for the others, right? So, each of those inputs has some query for their ‘defaults’…so, onChange of the first one, trigger loads that target the others (using the newly selected value)

tony.kay19:04:50

@danielstockton once the app is running and you inject the css onto the page, then anything on the page will see it….if you’re saying you want to export that css for other pages (that don’t even use React) then you can do that as well, though there isn’t any built-in function from Fulcro…use cljc for your components and you can pull the garden stuff from the components in CLJ, and use garden’s mechanisms to translate it to css…so on a server you could just serve that as a CSS resource from a URL, etc.

tony.kay19:04:58

(live) update semantics are up to you…some of the default injection stuff tries to prevent refresh for efficiency.

danielstockton19:04:26

Ok @tony.kay, sounds good, and yes, that was what I was looking to do. I didn't like how cljss injected things dynamically, and I found it very difficult to compose styles.

jackson20:04:26

@tony.kay I understand at a high level.. the default config data I want loads fine from the server inside the onChange, it's getting the other inputs to refresh with new data that isn't happening.

tony.kay20:04:21

you need to add a follow-on read to the transaction ( of :refresh for load) that includes the keywords on which that data is queried…that’s how fulcro figures out what needs to be refreshed in the UI

jackson20:04:36

yep. Tried :refresh with the load. Tried refresh!. There's something fundamental I'm missing.

jackson20:04:27

:target sometimes changes things in :ui/root {..} sometimes changes things in the root of the db?

tony.kay20:04:01

:target is simply an assoc-in path. :refresh is a vector of keywords (that appear in component queries somewhere). Fulcro keeps an index of which components query for which keywords…so it can derive the list of mounted components fomr that.