Fork me on GitHub

Hi all (and I guess, Particularly @tony.kay !), I'm extremely intrigued by the promise of fulcro for a new product.I think it might solve a bunch of practical problems I've struck in the past. I was thinking something in Clojure solves a lot of it, when I stumbled across fulcro, while trying to find out what happened to Om-next As it won't just be me, I'll need to convince others. My concern is it seems there's quite a learning curve to productivity, before it might all click in place. Particularly as my collaborators have little or no clojure experience, vs my little to some :-). The immediate use case is relatively simple, and per @tony.kay's response to this reddit question for this project it may scarcely matter what we use. But it will inform future direction. Therefore, I'm interested in the most compelling resources/approaches you know? I've watched, and recommended Tom Toor's presentation. I've started working through the book and have the very basics going from the template. I found walkable's realworld implementation, but lein run just doesn't work

(Caused by: java.lang.IllegalArgumentException: No method in multimethod 'init-key' for dispatch value: :fulcro.module/cljs-build-options)  and the project hasn't been touched for a year. 
The last time I was looking at fulcro (6 months ago, maybe?) it seemed the book and template project was in a limbo between 2.x and 3. I get the impression that 3 is now the place to start?

👍 1

imo watching the youtube tutorial videos (;t=1s) makes the documentation a lot more digestible

👍 2

@U2LUY0P8B author here. Fulcro 3 has been around for a while. Although Fulcro 2 and 3 share the core ideas, v3 is packed with lots of well thought ways of doing things. You should stick to it instead. The said realword app was developed by me as a way to learn Fulcro 2 myself, so it contains quite a few limitations as a new learner

👍 1

both Fulcro and Duct framework are amazing frameworks, however I don't recommend trying both of them at once. Get familiar with one of them first

👍 1

thanks @UPH6EL9DH I had started watching them on a commute, but on a phone screen, so not the most absorptive 🙂 I'll definitely go through them at my computer


thanks @U0E2YV1UZ I recognised the name immediately 😉 part of the reason fulcro is so appealing is it reminds me of a lot of the patterns I had in an surprisingly novel inhouse framework I was lucky enough to work on in a bank for a number of years, but updated for the web. But then how all of these ideas apply to a language I'm infatuated with, but not aufait/fluent in... well that's the kicker 🙂


Hey, Fulcro 3 is definitely the one to look at, 2 is only for legacy


this is a learning curve, but it also depends on your background


• js/jvm experience • functional programing • intelliJ or emacs experience • etc


fortunately fulcro is well documented and the book explains everything


I know Clojure(Script) quite well and have worked with Om and Reagent + Re-frame in the past, as well as with React and JS. So I have quite a good starting point yet I experience there is indeed quite a learning curve. I am quite excited about the promise of Fulcro, that's why I am working hard to learn it enough to try to sell it to my team instead of TypeScript+React+Redux. If you are quite new to ClojureScript and your needs don't warrant the use of Fuclro, I would strongly consider starting with Reagent (+ Re-frame). I think it is much easier to start with and it worked well on my previous teams. Come back to Fulcro when you have experiences with ClojureScript frontend development. That's my 2 cents. On the other hand, if you have the time to really dive into Fulcro, learn it well, implement something in it before selling it to your team, then feel free to go ahead 🙂

👍 1

Interesting perspective @U0522TWDA. I have some personal project experience with Reagent and Reframe. I recently watched Tom Toor's talk too, and found his arguments convincing. However, Fulcro does seem like a lot to digest. Also, the fact that you're recommending Reagent and Reframe for starters gives me pause. It seems like a good SPA framework should be helpful for beginners and experienced alike. It seems like learning an "inferior" framework before moving on to a superior one would be a waste of time.


Fulcro is "batteries included" - it gives you more but requires more investment from you. Reagent is not inferior, is just better match for different products.


I'm looking for an example of how to use data from a third party REST API in my Fulcro application. Can anyone point me towards such a thing?


I'm guessing I would need to use something like clj-http in a Pathom resolver to achieve that?


@alex.sheluchin you can • make requests from pathom resolvers/mutations (with clj-http or any other http client) • make requests from browser (with ajax-cljs or cljs-http or anything) the more interesting question is how to normalize/store/sync 3rd party data, but that depends on the problem

👍 1

Do you happen to know of any resources that explain these points explicitly?


I guess the best resources are just those libs READMEs, it’s actually pretty straightforward: make a request => process the result. In case of clj-http you’d probably want to go with a synchronous version (default), so that’s just one function call.


The normalize/store/sync part depends on your problem and stack. Like, you might want to have a scheduled job for syncing, or to use Datomic’s report-queue, or you might just make a request every time you need this data, or... so that depends


in case you make requests from browser, say with ajax-cljs, it might be something like

  {:uri             ""
   :method          :get
   :headers         {...}
   :format          (json-request-format)
   :response-format (json-response-format {:keywords? true})
   :params          {...}
   :handler         (fn [[ok? result]]
                      (when ok?
                        (comp/transact! app [(save-result {:result result})])))})
where save-result might be something like
(defmutation save-result [{:keys [result]}]
  (action [{:keys [state]}] (swap! state assoc ::result result)))
and then you can access it from components via link query


or you may save it as an attribute of particular component and access just like any other attr (without link query)


something like that inside of save mutation

(swap! state assoc-in [:component/id :my/component :result] result)


and then

(defsc MyComponent [this {:keys [result]}]
  {:query [:result]
   :ident (fn [] [:component/id :my/component])}
  (dom/div result))


Thanks very much! This should be plenty enough direction for me to try it out.


i am having the hardest of times doing a simple df/load like this one

(df/load this :dataico/analytics-data nil
    {:target (conj admin-analytics-ident :ui/analytics-data)})


I get data back in an array but I get errors deep in mutation land that say

core.cljs:1226 Uncaught Error: :dataico/analytics-data is not ISeqable
    at Object.cljs$core$seq [as seq] (core.cljs:1226)
    at mutations.cljc:311
    at core.cljs:4406


I do this elsewhere and it works fine .. the return is an array of data but something wants an ISequable


 [{#inst "2020-02-01T05:00:00.000-00:00"
   {:count 3, :active true, :paid-up true},
   :company/id #uuid "87b86c2e-19a5-4434-be61-ba395dc14e53",
   :name "Acme"}]}


@dansudol what’s on line 311 of mutations.cljc (or is that my mutations ns?)


its this line Tony

(fn [m] (some-> m seq first meta add-progress))


I’d guess m is the keyword


in the function



and you don’t expect it to be


put a log/spy in there


errr .. i can do that /


I am trying to set breakpoint in there now and see what i see


looks like it gets the data but there is error on formatting

In CLJS DevTools 0.9.10, an exception was raised during value formatting.


use js/console.log before the thread


m is :dataico/analytics-data


in the other m values i saw where all maps or arrays with 5 empty things


you can't do a df/load with just a keyword ( I think that is a bug in F2 )


I added params to the df/load like so

(df/load this :dataico/analytics-data
    {:params {:term       "moo"}})
and now the query to pathom looks like
[:dataico/analytics-data {:term "moo"})]


which is >> Iseqable <<


load should accept nil for the component…has for quite some time


don't follow you, i was using nil like


(df/load this :dataico/analytics-data nil {}) 


already .. the fix was to add params to make the query from :dataico/analytics-data to [:dataico/analytics-data {:params blah}]


I'm getting this error in the console and hot reload is not working: > failed to load com.fulcrologic.fulcro.specs.js Error: Unable to resolve spec: :edn-query-language.ast/node


Anyone know what the reason might be?


@alex.sheluchin could be you’re pinning your EQL dependency to an earlier version. Might also make sure you guardrails.edn (if you have one) is set to emit specs.


failures to resolve specs means just that: we use specs in various ways to do loose type checking at dev time. For some reason the definition of that spec is missing in your build.


Is it likely to also be the reason for hot reload not working, or is that more likely to be something else?


that is the only reason