Fork me on GitHub

Is anyone using Calva with Fulcro? And if so, do you know of a recommended setup which improves code navigation?


What are you missing from the 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.


…. it must be my clj-kondo config…


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.

❤️ 2
🙏 1

I seem to have ended up with this though …. gist to follow.


@U0ETXRFEW @U0522TWDA I’ve updated the gist again (fingers crossed) testing against @U0522TWDA’s Fulcro course materials at 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.

❤️ 1
Jakub Holý (HolyJak)14:11:50

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.

Jakub Holý (HolyJak)14:11:54

The problem with the assertion arity is that it differ in cljs and Clj and kondo doesn't understand which one applies there :(


Yep - that makes sense.


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:

├── com
│   └── fulcrologic
│       └── fulcro
│           └── clj_kondo_hooks.clj
├── com.wsscode
│   ├── async
│   │   └── config.edn
│   └── pathom
│       └── config.edn
└── config.edn

Jakub Holý (HolyJak)14:11:29

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)?

Jakub Holý (HolyJak)14:11:20

It seems weird you would have to change the dir structure...


I’ll go check again what it was before I messed with it…


You have

├── com.fulcrologic
│   └── fulcro
│       ├── com
│       │   └── fulcrologic
│       │       └── fulcro
│       │           └── clj_kondo_hooks.clj
│       └── config.edn
└── com.wsscode
    ├── async
    │   └── config.edn
    └── pathom
        └── config.edn


@U0522TWDA So it may be me misconfiguring .clj-kondo/config.edn

👍 1

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

👍 1
Jakub Holý (HolyJak)15:11:25

@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 for importing the default one.


Your course repo now works for me

🎉 1

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


It's an output channel in vs code. What project type are you selecting when connecting?




:builds {:frontend {:target :browser :modules {:main {:init-fn accord-cljs.core/init}} :compiler-options {:optimizations :none}}}}