Fork me on GitHub
#calva
<
2021-10-16
>
craftybones09:10:16

Hello. On a specific setup involving both deps.edn and shadow-cljs I’m running into this issue: https://github.com/clojure-emacs/cider/issues/2812

pez09:10:54

Interesting find. If it works for you, try jacking in to the project as a shadow-cljs project type. (It’s unclear if you do it this way already, but anyway.)

craftybones09:10:45

I’ve jacked in as deps.edn + shadow

craftybones09:10:53

if I jack in just as shadow there are other issues

pez09:10:02

What issues? 😃

craftybones09:10:01

Well, this template has some deps defined in deps.edn and those don’t get found so the app isn’t compiled consequently

craftybones09:10:12

This doesn’t relate to Calva directly

pez09:10:54

Show us the shadow-cljs.edn file if you can, maybe I can see what’s lacking.

craftybones09:10:07

{:deps   true

 :nrepl {:port 8777}

 :builds {:app {:target          :browser
                :output-dir      "resources/public/js/compiled"
                :asset-path      "/js/compiled"
                :modules         {:app {:init-fn craftybones.re-frame-test.core/init
                                        :preloads [devtools.preload]}}
                :devtools        {:http-root    "resources/public"
                                  :http-port    8280
                                  }}}}

pez09:10:47

Are the deps you need in some alias in deps.edn?

craftybones09:10:18

and the deps.edn as follows:

{:paths ["src" "resources"]
 :deps {org.clojure/clojure #:mvn{:version "1.10.1"}
        org.clojure/clojurescript
        {:exclusions [com.google.javascript/closure-compiler-unshaded
                      org.clojure/google-closure-library
                      org.clojure/google-closure-library-third-party]
         :mvn/version "1.10.597"}
        seancorfield/clj-new {:mvn/version "1.0.199"}
        re-com #:mvn{:version "2.7.0"}
        re-frame #:mvn{:version "0.11.0"}
        reagent #:mvn{:version "0.9.1"}
        thheller/shadow-cljs #:mvn{:version "2.8.96"}}
 :aliases
 {:dev {:extra-deps {binaryage/devtools #:mvn{:version "1.0.0"}
                     day8.re-frame/re-frame-10x #:mvn{:version "0.5.1"}
                     day8.re-frame/tracing #:mvn{:version "0.5.3"}}
        :extra-paths ["src" "dev"]}}

craftybones09:10:23

Yes, they are

pez09:10:30

Then instead of :deps true do :deps {:aliases [:dev]}

👍 1
pez09:10:05

The way this works is that shadow-cljs will use clojure to start the project. And it needs to know which aliases to activate.

craftybones09:10:00

Right. Trying

craftybones09:10:18

so, now if I need to shift aliases, I’d have to go change it in shadow-cljs.edn

pez09:10:25

Yes, that’s the downside, but usually I find you don’t need to shift such things often. You can also run the deps project and the shadow project in separate vs code windows. That has another issue, but there also seems to be a workaround for that: https://github.com/BetterThanTomorrow/calva/issues/1313

craftybones09:10:58

Can I run shadow-cljs from command line and just plugin the repl from Calva instead? So don’t jack in basically but just connect to a running repl?

craftybones09:10:38

A small cost to pay I suppose. So far, I’m a little irritated with shadow. A lot of setup as opposed to figwheel

pez09:10:59

Yes, you can do that as well. If you copy the command that Calva uses for jack-in and then adapt it so that you inject the aliases there, that should work.

pez09:10:44

I find shadow setup to be far easier than figwheel, but I guess it is a matter of taste as well.

craftybones09:10:28

Do you know if there’s an easy way of setting up multiple entry points in shadow? Something like extra-mains in figwheel?

pez10:10:40

Not familiar with extra-mains. My Figwheel days are way back. 😀

craftybones09:10:30

Is there a workaround in Calva?

craftybones09:10:32

When I jack in, I run into the same missing instance problem.