Fork me on GitHub

@tony.kay wow, the video's on reducers and hooks are what I've been wondering about for a long time. Since I like hooks a lot I wanted to ask "how about a use-query hook?" but didn't want to impose something that costs a lot of work on you. It's very useful to see how to go about extending fulcro with it. Very informative to see a couple of approaches! Thanks.


See use-query-subscription


And use-child-sales


@mruzekw thanks! use-query-subscription was exactly what was shown in the video 🙂


Oh, right haha


might look into using workspaces as well.. Not sure if it'll be worth it. Do you use it?


I haven't used it much. Can't vouch for it either way


used defcards a while back, I can see the use for it when you have a complicated UI that is composed in a lot of different ways. Always found the "shows environmental coupling" feature interesting.


Well if you're using fulcro, I'd definitely give workspaces a look, if only cause a major user of Fulcro, NuBank, made it

Jakub HolĂ˝ (HolyJak)07:06:45

@bbss ☝️ uses Fulcro 2, Tony has a fork in his GH updated to F3


Ah, thanks for saving me some time when I inevitably would have run in to that!


will do :thumbsup:


Is Fulcro Inspect currently broken by any chance? Chromium 83.0.4103.97 on Linux. The toolbar icon correctly states "Fulcro app detected!" but when I click the Fulcro Inspect tab it says "No app connected."


It does this to me pretty much randomly. Have you tried reloading? Closing/opening devtools? Closing that tab entirely to garbage collect it? Usually one of those fixes it for me.


I tried closing and reopening the entire browser, without success


Hm. That's unfortunate. Must be a different bug than I'm experiencing.


Hmm I noticed I can right-click into the inspector window and say "inspect" to open a separate window with chrome dev tools. There I get "Error: no reader function for tag fulcro/tempid."


Well, that is especially interesting, since I see this in my fulcro inspect:


@U2APCNHCN I was running into that problem as well, and added a fix for it recently ( you may want to try installing from the chrome store again to get an up to date version


Oh neat, that fixed it, thanks!


When the Clojure REPL is starting I'm getting an error I don't understand: "Caused by: java.lang.Exception: Unable to resolve spec: :com.fulcrologic.rad.attributes/attribute". It seems to be saying that the guardrails defined function new-attribute (in file com.fulcrologic.rad.attributes.cljc), that returns an ::attribute , can't find the >def for ::attribute, even although it is right there 4 lines above.


It comes from 'Syntax error macroexpanding' a defattr . Which makes sense because the defattr macro calls new-attribute .


When I disable guardrails the problem goes away.


Hey friends, if I wanted to generate a completely static html export of my app. Is there a way to do this in Fulcro? I'm going for something along the lines of what's provided by Next.js or Gatsby.


@coetry Yes. If you’re doing it from js (i.e. node or within the browser) you can just use React’s server render code, which does exactly that. On the JVM (Clojure) you can also do that in Fulcro (which you cannot in others) because there is an implementation of the base factories. See Server Side rendering in docs. The down-side in JVM is if you use js components, they won’t render, and you have to write you UI in CLJC.

Jakub HolĂ˝ (HolyJak)18:06:07

Hello! What is the right way to load data into the root of the DB? I have this component, loading a list of deals (having a pathom resolver from :deals to a list of things):

(defsc HotDeals [this {:keys [deals]}]
  {:query [{[:deals '_] (comp/get-query Deal)}]
   :componentDidMount (fn [this] (df/load! this :deals this))}
I think this is wrong as it will load {:deals [...]} from Pathom and place it under :deals in the DB so that I end up with {:deals {:deals [..]}} , no? How to correct it? Thank you!

Jakub HolĂ˝ (HolyJak)19:06:25

Hm, perhaps I should have instead used (df/load! this :deals Deal) which will send the correct query to Pathom and store it as expected....

👍 3