Hi there! Thanks for asking about this. The naming of these project types in Calva is a bit confusing, even if I don't really know what else to name them. Which project type to use depends on how the project is configured.
A shadow-cljs project can be configured so that you can start it with either shadow-cljs or with deps.edn. Most often just one of them is used. This is not Calva specific, but rather just about how the project is supposed to be started. The Calva project types are configurations + some code that will start the project.
The shadow-cljs project type starts the development REPL with a command line like:
npx shadow-cljs watch -d cider/cider-nrepl:0.27.4 <build-id-1> [<build-id-2> ...]
This is how you have configured your project above to be started, so that's why this works.
The deps.edn + shadow-cljs project type starte the REPL with a command line like:
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.9.0"},cider/cider-nrepl {:mvn/version,"0.27.4"}}}' -M<alias-1>[<alias-2>...] -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
I can't recall right now what is needed in deps.edn
for this to work, but anyway, there needs to be things there to support this. (Some :main
config that will start the shadow-cljs watcher.) Your project is not configured for it, which is why the that project type doesn't work. (Calva error handling here is not good, so you do not get proper messages about what goes wrong.)
In both cases, once the Clojure REPL is started, Calva will:
- Connect to this REPL.
- Clone the nREPL (the protocol used for the REPL connection) session. This is the Calva
clj
session and will be used in .clj
files, as well is .cljc
files when Calva is configured to do that. (This is a toggle, which you can access via the status bar.)
- Make yet another clone of the nREPL session. This will be the Calva
cljs
session and be used with .cljs
files, and for .cljc
files depending on that toggle.
- ”Promote” the
cljs
session to a ClojureScript REPL. Calva uses the shadow-cljs development API for this. The same commands as you would from the REPL prompt if you did this from a terminal.
- Select one of the builds watched. Again using the shadow-cljs development API
Note that outside of Calva you can do these steps manually. I can recommend to do it now and then to de-mystify what Calva does at Jack-in and connect. But when connecting Calva, better let Calva do it, because Calva will then be able to update some of its state, so that the UI reflects which REPL is being used and such.
This answers, I hope, when to select which project type in Calva.
You are rather asking about when to use one or the other project setup. I'll let other people answer that, because it is outside my field of expertise. But I can say that I prefer to try use shadow-cljs for starting the dev REPL. I think that most often works.