Fork me on GitHub
#calva
<
2023-07-25
>
Dallas Surewood12:07:01

So, having an issue. For fullstack apps, Calva recommends jacking in with the "Sbadow-cljs" setting pointing shadow-cljs.edn deps to your deps.edn file like this. :deps {:aliases [:shadow :dev :flow]} What I'm not clear on is whether there's a way to do this in different builds of shadow-cljs. This seems to be a top level option and it means I can't just have a release build and a dev build like when I'm launching from just Clojure + deps.edn. Is there no way around this? Otherwise I'm just adding from the :aliases field based on what I'm doing

pez13:07:33

I’m not completely sure I understand the question, but you can provide aliases via a custom repl connect sequence, cljAliases. Is that what you need?

Dallas Surewood13:07:25

So I'm starting from jack-in. There's a part in the calva docs that recommends using shadow-cljs vs deps.edn + shadow.cljs. When doing that, it starts with npx shadow-cljs. It lets me pick different shadow-cljs builds, but the shadow-cljs builds can't pick different deps.edn builds. They just go off the top level aliases

// shadow-cljs.edn
{:nrepl {:port 7002}
 :deps {:aliases [:shadow :dev :flow]}
 :builds       {:prod {:target     :browser
                      :output-dir "target/classes/cljsbuild/public/js"
                      :asset-path "/js"
                      :modules    {:app {:entries app.core]
                                         :init-fn app.core/init!}}
                      :devtools {:watch-dir "resources/html"}}}}
So :prod will always use :dev in deps.edn Is there a way around this? Calva is fairly hard to use without doing these aliases in a full stack app.

Dallas Surewood13:07:20

For instance, I could take out :dev and :flow from the aliases and just have it use CLJS stuff, but then I have to run it with the deps.edn + shadow.cljs, which the Calva docs recommend against for logging reasons

Dallas Surewood14:07:39

Looks like you already asked this, Pez, so I'm gonna continue this thread here https://clojurians.slack.com/archives/C6N245JGG/p1655282618808169 Only thing is my build uses ClojureStorm (part of flowstorm) which involves overriding the default clojure compiler. Not really something I want to do in Prod

pez16:07:23

I don’t think we recommend either way any longer. It’s rather a preference/depends on what goes in the shadow-cljs output.

pez16:07:32

Calva and shadow-cljs do have mechanisms for specifying the aliases with the repl start command line.

Dallas Surewood17:07:11

For Calva, I don't believe there's a way to do this without making a custom jack-in command, right?. You can specify the shadow-cljs build but not the clj aliases it uses

Ingy döt Net15:07:43

Lingy 0.1.19 just dropped https://metacpan.org/release/INGY/Lingy-0.1.19/view/lib/Lingy.pm • Adds initial nREPL support (thanks @pez!!) • Clojure's own @pez is now a Lingy author

clojure-spin 2
🎉 2