Fork me on GitHub

I’ve finally updated the book so that I can switch the Lein template to shadow-cljs by default. A new version of the leiningen template is on clojars: - Uses shadow-cljs (I no longer support fighwheel at all) - The server is a hand-rolled, secure (CSRF, etc.) server - Now using nubank/workspaces instead of devcards - The template now uses mount instead of component - I dropped demos of i18n - There is a very obvious comment in the README and source on where you’d integrate Pathom, since it is what you should be using on the server for queries. This release is more in line with current best practices. Shadow-cljs is just better for real development. Period. Workspaces is much more flexible and extensible than devcards. The hand-rolled server is easy enough, and uses standard best practices and Ring Defaults. There are no longer options on the generator…just lein new fulcro application-name

❤️ 24
🎉 20
👍 20

@UCTNL1JNN case u missed it


Thanks, I really did miss it


Updated book is live. Please let me know if there are errors/ommissions.


Omission: src/main/app/api/read.clj is missing in the template


oh…the book mentions that but it isn’t in the template? Hm…guess I just need to tell you to create it or something


client :render-mode :keyframe is no longer the template default, is this on purpose ?


never was a good idea I don’t think


under there's an example with: (:require ["react-motion" :refer [Motion spring]] -- I think this should be (:require ["react-motion" :refer (Motion spring)] to be valid shadow-cljs syntax


About api/read.clj, in addition to creating it and writing queries, should we also require it from another ns to get the queries to stick to the right multi method?


I said that in the book...didn't I? @U06ANT2JK @U7BDL0WKU I was not aware of [] vs () making any diff


I recall hearing it in either the book or videos, but didn’t see it in the new version on first sight


Am going through again


@tony.kay what’s the nubank/workspace equivalent for :inspect-data true?


@U06ANT2JK Fulcro Inspect 🙂


Cool. Is there a config option for Fulcro Inspect to always fully open up the data tree?


I guess searching for something and pressing enter is the quickest


@eoliphant I’m not sure what you mean. I usually hook fulcro.server/server-mutate as the server-side pathom mutate hook so I can just use Fulcro’s defmutation on both sides…is that what you’re asking?


hey sorry about that lol. I think I have all the server stuff figured out, i have pathom mutations/queries working fine on the server. But I also have a few 'client-only' pathom mutations that I've used to abstract/wrap some 3rd party libs' JS APIs. based on some back and forth on the subject a while ago. Granted I have have misunderstood some of it.

(defmutation call-aws-or-something ..
 (action []
  (.callSomething aws-js ...)

; after
(pc/defmutation call-aws-or-something ...)
(def client-parser (p/async-parser ...  call-aws-or-something)..

(defmutation call-aws-or-something ..
 (action []
  (client-parser {}.. } )
Just trying to figure out if that is the recommended approach.


You’d probably be better off adding a remote for it, and then making the normal defmutation choose that remote. Pathom, I think, has a fulcro remote wrapper that can act as a remote for a local pathom parser


ah ok gotcha


Wow, the new dev setup is REALLY nice.


hi @tony.kay (and of course the other Fulcro contributors), can I just say I'm super blown away and grateful for the huge amount of work you have done on Fulcro so far, not only in making it imho the best front end/full stack Clojure[script] framework available, but also in creating simply amazing documentation and training! Since starting to get into it 2 weeks ago (after having previously used everything from Om to Re-frame to Rum to Luminus) I've been constantly amazed and impressed 🙂 I'm just happy that I found out about it early enough in our product's development that we've been able pivot and rebuild what we had so far completely in Fulcro. It's been a dream! And then I just joined this channel only to find out you've made a new version of the template which includes quite a few of the things on my to-do list to add to my project, what perfect timing 😄

☝️ 4
fulcro 4

I wanted to ask you though about your comments in the book about shadow-cljs being faster (and perhaps better) than figwheel, but the examples in your book all used lein-figwheel which as I understand has been deprecated some time ago. Have you tried using figwheel-main ( and comparing that to shadow-cljs? In my not very expert opinion, figwheel-main is miles ahead of where lein-figwheel was!


Yes I read that this morning, I'm guessing the author was also using lein-figwheel (but how can I know, since they never mention which figwheel!). It's a big problem that people often say "figwheel" without specifying which one they mean or even realizing that there's 2 completely different things which fall under that name. Perhaps figwheel-main should have been named something more distinct to avoid this confusion!


Yep. Also dont know about figwheel main, apart from podcasts. That's mainly because can't really find anything wrong with shadow-cljs. :)


Also curious about a comparison :)


for me the biggest downside of shadow-cljs is that it depends on node, meaning for my CI build step I need an image with both clojure AND node installed which is a bit annoying/time consuming. But if you're going to use some node packages in your build anyway then there's no issue there 🙂 Figwheel-main also has nicer REPL tools imho and nicer in-page feedback for warnings/errors, but those might be just a matter of taste.


Would be keen to hear what someone more experienced has to say though as I'm quite new to front-end work!


So, the compiler tweaks the @U05224H0W has done around caching and NPM integration are pretty great. When I want to use something in my production work (and you will want to), it’s usually a very simple matter. With stock cljs I can’t tell you how many times I had to do things like clean the sources in order to get something working again. You’re right. I have not used figwheel-main, but my complaint was never really with figwheel, but more with many of the behaviors of the stock compiler.


Hot code reload is a relatively trivial manner…in cljs it is just websocket push of the new js file…getting the compiler to work well, well, that is a different matter, and with shadow it “just works”…something I appreciate very much.


I’ve updated the book’s comments. I had not intended to make figwheel sound bad…I think Bruce’s stuff is great, and figwheel isn’t even what I’m suggesting you move away from…I was trying to point out that shadow-cljs is a better overall production experience than the stock compiler (even though it uses the stock compiler internally). It is, however, the case that you no longer need figwheel once you’re using shadow.


sorry, i couldn’t resist..


*no criticism implied, nor offence intended…. is this first fulcro meme??