Fork me on GitHub
Adrian Smith13:12:06

I had the same issue on the public fulcro react native template, I also uncommented the code in shadow.edn to no avail

Adrian Smith13:12:36

I had to show a video of it working from the youtube series when demoing it during a workshop


@sfyire Try downgrading to ^1


Hi. Does anyone have experience with fulcro-garden-css? I am a newbie to Fulcro and need to colocate CSS with my components. The instructions are kind of sparse. I would appreciate any code snippets of actual use...


Do I create a special component to hold my CSS?

Chris O’Donnell18:12:09

If I want to run some async code, like getting an access token (which may involve a remote request to refresh an expired token), as part of the request process in the client, is it recommended to write my own remote client implementation? It looks to me like request middleware has to be synchronous.


but it is on fulcro 2 at the moment, not the latest major version so there are slight differences in how the CSS is injected, but co-location at the component level is mostly identical


@codonnell correct request middleware needs to by synchronous, don’t do IO there I would add a client side pathom resolver and do all the async stuff in there, here’s an example where i do that rest networking is a custom remote with a client-side pathom parser, in the post-file-to-alpr-api resolver i do all my IO, you can conditionally do your token refresh in there (the same place you do your actual request)


since these resolvers can be async

Chris O’Donnell19:12:57

I already have a fulcro server with a pathom parser server-side. Is there a way to connect them easily?


oh yeah if you have control of the server than just use that


make a mutation refresh-token and call it before your other load/mutation


IO is sequential by default

Chris O’Donnell19:12:36

I could do that, I suppose, but it feels silly to do that before every remote load/mutation. (Thanks for helping btw!)


you could add global-eql-transform and prepend your remote transaction automatically


though you shouldn’t need to re-auth on every IO, i’d reconsider that

Chris O’Donnell19:12:15

I'm using an auth library which automatically does the IO to refresh the token when necessary and just exposes a promise-returning get-access-token function.

Chris O’Donnell19:12:32

I can verify from the network tab that it's not refreshing the access token on every request; agreed that would be a bit crazy.

Chris O’Donnell19:12:01

I will look into global-eql-transform; thanks for the suggestion!


you could also write your own comp/transact! wrapper function, just calls the get-access-token then calls comp/transact! when the promise resolves

fulcro 4

that’s probably the saner approach


Thanks @currentoor! That helped. Now i need to integrate semantic ui with custom CSS.


@hadilsabbagh18 what’s to integrate? just add a css tag in your HTML and classes to your dom elements (which we have a nice concise keyword literal syntax for)


(div :.ui.inverted.dimmer {:classes [(when printing? "active")]}
  (div :.ui.loader))


and my pleasure


How does dom differ from localized-dom?


use the localized dom only when you want to use custom css, use the regular dom otherwise


Ok, thanks.


i alias localized dom to ldom and regular dom to dom


localized dom is slower


regular dom performs a bunch of backflips at compile time to give you the best possible performance