This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-06
Channels
- # babashka (62)
- # beginners (52)
- # calva (37)
- # clj-kondo (23)
- # cljs-dev (13)
- # clojure (18)
- # clojure-europe (7)
- # clojure-sg (1)
- # clojure-spec (27)
- # clojurescript (37)
- # datomic (14)
- # events (2)
- # fulcro (9)
- # graalvm (12)
- # helix (1)
- # introduce-yourself (1)
- # keyboards (3)
- # lsp (3)
- # missionary (24)
- # nextjournal (7)
- # pedestal (3)
- # polylith (15)
- # re-frame (5)
- # reitit (4)
- # releases (2)
- # shadow-cljs (54)
- # testing (7)
- # uncomplicate (4)
Is anyone using Calva with Fulcro? And if so, do you know of a recommended setup which improves code navigation?
Here’s one example. Looking at it now it may be due to a clj-kondo misconfiguration somewhere. Though it does have some words about Fulcro there.
So obviously it can’t do things like ‘find refs to PlaceHolderImage’ because that s showing as an undefined symbol.
Sorry - yes it was exactly that - I had the config.edn telling clj-kondo to use the com.fulcrologic/fulcro config inside the com.fulcrologic folder instead of inside the .clj-kondo folder.
Awesome. Cab you share how you set it up? Thinking we should have a page about using Calva with Fulcro in the spirit of some of the other using Calva with X pages there.
Borkdude has some fulcro setup in https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md.
@U0ETXRFEW @U0522TWDA I’ve updated the gist again (fingers crossed) testing against @U0522TWDA’s Fulcro course materials at https://github.com/holyjak/fulcro-intro-wshop. It gets rid of clj-kondo redness apart from a couple of places in src/holyjak/fulcro_exercises/puzzles where the toggle-color mutation is called with no args and clj-kondo wants 1.
@U0522TWDA - I’m really appreciating going through this material - it’s excellent. And its one of the few good examples I’ve found so far that gives good Calva instructions.
Happy to hear that! Kudos for Calva instructions go to Peter :-)
I thought he may have had a hand! It got me over the bit that kept tripping me up - working with both a clj and cljs repl.
The problem with the assertion arity is that it differ in cljs and Clj and kondo doesn't understand which one applies there :(
One problem I had to fix in the course repo was the .clj-kondo directory structure. Something seemed to be at the wrong level. I ended up with:
.clj-kondo
├── com
│ └── fulcrologic
│ └── fulcro
│ └── clj_kondo_hooks.clj
├── com.wsscode
│ ├── async
│ │ └── config.edn
│ └── pathom
│ └── config.edn
└── config.edn
FYI fulcro now has kondo config baked in and you can use kondo CLI to import it into your project. Though it might need some improvements :) @U0ETXRFEW Would it make sense to detect that a project's dependencies have kondo config to import and offer to do that (and open the config file with the kondo's output instructing what to add there)?
It seems weird you would have to change the dir structure...
You have
.
├── com.fulcrologic
│ └── fulcro
│ ├── com
│ │ └── fulcrologic
│ │ └── fulcro
│ │ └── clj_kondo_hooks.clj
│ └── config.edn
└── com.wsscode
├── async
│ └── config.edn
└── pathom
└── config.edn
Maybe what makes most sense is that clj-kondo picks all these drugs up and merges them in some predictable order? WDYT, @U04V15CAJ ?
I’m probably not understanding what’s necessary in .clj-kondo/config.edn. From the docs I’d expect it to need {:config-paths [“com.filcrologic/fulcro” “com.wsscode/async” “com.wsscode/pathom”]} to connect up. That doesn’t work for me but my gist does.
@U0522TWDA @U0ETXRFEW. Grrrr stupid typo was the problem! filcrologic in that config.edn
@U0YBFTSLS does the kondo config that comes with Fulcro work for you? If not, could you be so kind and submit a PR to improve it? See https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#importing for importing the default one.
This is a long thread and I may have missed some points. Is everything solved now? The clj-kondo/config repo is probably stale concerning fulcro and I should remove those in favor of fulcros own config
@U04V15CAJ this is what I was referring to: > FYI fulcro now has kondo config baked in and you can use kondo CLI to import it into your project. > Would it make sense to detect that a project’s dependencies have kondo config to import and offer to do that (and open the config file with the kondo’s output instructing what to add there)? I wonder… if the project has kondo config baked in, can clj-kondo pick the config up there w/o the user having to import anything?
@U0ETXRFEW Right now no. clj-kondo could do this, but I've chosen not to since a config may contain mistakes and then clj-kondo would not work, etc. so the selection of configs is explicit instead of implicit
Yeah, I actually spoke with less thinking than usual. Fulcro is a library. … I was thinking about the case where the project would have kondo config in its deps.edn.
I am getting the following message but I am not sure where the Calva Connection log it - I see the Calva Output window but not a log file — everything compiles fine with a browser build but the repl can’t connect
Connecting cljs repl: shadow-cljs...
; The Calva Connection Log might have more connection progress information.
; Error while connecting cljs REPL: TypeError: Cannot read property 'search' of undefined