This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-05
Channels
- # architecture (23)
- # bangalore-clj (2)
- # beginners (93)
- # cider (27)
- # cljsjs (2)
- # clojure (66)
- # clojure-russia (9)
- # clojure-spec (28)
- # clojure-uk (3)
- # clojurescript (47)
- # cursive (2)
- # data-science (2)
- # datomic (10)
- # editors (9)
- # emacs (4)
- # figwheel (3)
- # figwheel-main (1)
- # hyperfiddle (2)
- # jobs (1)
- # nrepl (59)
- # off-topic (2)
- # onyx (10)
- # pedestal (1)
- # re-frame (13)
- # reagent (9)
- # reitit (17)
- # shadow-cljs (8)
- # tools-deps (4)
- # vim (2)
@bozhidar what is the closest to bleeding edge combo of cider-nrepl and nrepl I can use? I tried 0.19-SNAPSHOT with 0.4.4 and that wouldn’t work. Then tried 0.18-SNAPSHOT with 0.4.0 and that seems to work swell.
It is a small figwheel project that I use when hacking on Calva. I have placed all tooling dependencies in profiles.clj
. This works:
{:repl {:plugins [[cider/cider-nrepl "0.18.0-SNAPSHOT"]]
:dependencies [[nrepl "0.4.0"]
[cider/piggieback "0.3.5"]
[figwheel-sidecar "0.5.16"]]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}}
I recall there was something wrong with 0.4.0, so it’s a bad idea to depend on it. The newer, the better.
Can’t imagine how - piggieback 0.3.5 had a hard dep on tools.nrepl, so nREPL 0.4 would not load such middleware 🙂
This crashes:
{:repl {:plugins [[cider/cider-nrepl "0.19.0-SNAPSHOT"]]
:dependencies [[nrepl "0.4.4"]
[cider/piggieback "0.3.8"]
[figwheel-sidecar "0.5.17-SNAPSHOT"]]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}}
The nREPL dep you’ve added is completely ignored and cider-nrepl 0.19 has a hard dep on nREPL 0.4, which I removed in 0.18.
@pez See https://github.com/nrepl/lein-nrepl if you want to run 0.4 with lein
I want to write as simple instructions to Calva users as possible. Calva does not yet start the repls and inject stuff so people have to fiddle with these dependencies still.
The version number is a bit misleading, but I needed a way to be able to distribute this to people willing to test it.
See the CLI instructions here http://nrepl.readthedocs.io/en/latest/usage/
Basically you can just add cider-nrepl 0.18-SNAPSHOT to the example for piggieback and everything will work just fine.
I am bad at ignoring things 😃 Can confirm that 0.19 didn’t crash things at startup if using the latest lein-nrepl plugin. But some Calva features stopped to work.
I saw that in the lein-nrepl instructions you placed cider-nrepl in :dependencies
and not in :plugins
.
I am not sure what the difference is. But notice that 0-19 does not work if I keep it in :plugins
, but 0.18 does.
The plugin simply overwrites Lein’s repl
profile config, but when you’re not using lein repl
you don’t want to do this.
Very simply put - the plugin generates something like this section:
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}}
0.19 doesn’t work because it generates the config, but as Lein is running an incompatible version of nREPL it can’t understand the config.
0.18 on the other hand checks to see if you’re running the old nREPL and uses it API if that’s the case, otherwise it switches to the new one’s API.
https://github.com/clojure-emacs/cider-nrepl/commit/15d87747f790d300b0f13eef2e5bdc87b9dfd4ec
Also, if I move 0.18 to :dependencies
the repl starts nicely, but some Calva features stop to work. They work if I keep 0.18 in :plugins
.
(Full profile):
{:plugins [[nrepl/lein-nrepl "0.1.1"]]
:dependencies [[cider/cider-nrepl "0.18.0-SNAPSHOT"]
[nrepl "0.4.4"]
[cider/piggieback "0.3.8"]
[figwheel-sidecar "0.5.17-SNAPSHOT"]]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}
And as lein nrepl
doesn’t care about the lein repl
config it won’t be affected negatively by a cider-nrepl used as a plugin, either.
I’ll do that then, since that’s the config that works. Can I ask for advice about what to instruct Calva users to use? It might be a bit confusing with the above profile, since tools.nrepl will be used anyway, but it seems apt to prepare things for when it is time to move to nrepl.
Generally they can just keep using lein repl
like before for a while, so for now you don’t really need to change any instructions. Changes are needed only people using the cli.