cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
bozhidar 2021-01-20T07:11:17.050300Z

CIDER doesn't really check anything in the user configs and optimistically injects everything that's needed. The assumption was always that if someone tweaked their project config for some particular reason they probably know how to tweak CIDER's config as well.

bozhidar 2021-01-20T07:11:23.050500Z

KISS 🙂

pez 2021-01-20T07:28:21.050700Z

That’s what Calva does too. Which brings me back to the question if I am wrong to expect to see the middleware injected? Calva adds this to the command line:

-- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.piggieback/wrap-cljs-repl"]'
CIDER doesn’t, on my colleagues machine. So he has to add it to his global lein config or in the project. I can live with it added to the project, but I’d prefer not to have it there and rely on injection by the editors.

bozhidar 2021-01-20T07:35:47.051Z

I just tested this locally and the Piggieback injection works fine.

bozhidar 2021-01-20T07:36:03.051200Z

That's the CIDER command line invocation - /home/bozhidar/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"0.8.3\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.5\"\] -- repl :headless :host localhost

bozhidar 2021-01-20T07:36:13.051400Z

(for Lein at least)

bozhidar 2021-01-20T07:36:23.051600Z

I have to check if it's some problem with tools.deps.

bozhidar 2021-01-20T07:37:10.051800Z

For leiningen the middlewares get the added by the Lein plugin, as it's a bit simpler this way.

bozhidar 2021-01-20T07:37:31.052Z

Not sure why decided to do this differently.

pez 2021-01-20T07:55:42.052200Z

> For leiningen the middlewares get the added by the Lein plugin, as it’s a bit simpler this way. So, the -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.5\"\] takes care of it?

pez 2021-01-20T07:58:13.052400Z

The full Calva comand line in our project looks like so:

lein update-in :dependencies conj '[nrepl,"0.8.3"]' -- update-in :dependencies conj '[clj-kondo,"2020.04.05"]' -- update-in :dependencies conj '[cider/piggieback,"0.5.2"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.25.6"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.nrepl/cider-middleware"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.piggieback/wrap-cljs-repl"]' -- with-profile +test,+dev,+script repl :headless
Maybe it is overkill, but it works. 😃 With CIDER we got some intermittent piggieback complaints, and I started to suspect that missing middleware injection, but then it is probably something else causing the friction.

Nassin 2021-01-20T22:57:09.054300Z

Curious, why doesn't WARNING: When invoking clojure.main, use -M show up in the *Messages* buffer when doing cider-jack-in?

dpsutton 2021-01-20T22:58:51.054700Z

it probably shows up in the nrepl buffer. output from the process doesn't really go in messages

Nassin 2021-01-20T23:00:33.054900Z

oh ok

dpsutton 2021-01-20T23:02:18.055400Z

we need to migrate CIDER to use the -M version and let people upgrade

dpsutton 2021-01-20T23:02:23.055700Z

-M -m i mean

dpsutton 2021-01-20T23:02:37.056100Z

there's a ticket i need to do with aliases and mains as well. probably do both PRs at the same time

Nassin 2021-01-20T23:03:45.056700Z

Cool, guess it harmless for now

dpsutton 2021-01-20T23:04:01.056900Z

yeah. its just a warning

Nassin 2021-01-20T23:04:44.057800Z

is this the issue? https://github.com/clojure-emacs/cider/issues/2941

dpsutton 2021-01-20T23:04:45.057900Z

and not a warning about the program is in an unknown state but just its changing and won't support it in the future but its fine for now

dpsutton 2021-01-20T23:04:58.058300Z

yeah that's the one. you interested in working on it?

dpsutton 2021-01-20T23:05:11.058600Z

i think it won't be bad at all. just a bit of string editing

dpsutton 2021-01-20T23:05:43.059300Z

i'm happy to help with questions. and in fact i think its so simple that i could do it independently so i make sure to think of all the possible pitfalls and help you through you landing the PR if you like

dpsutton 2021-01-20T23:05:49.059500Z

more contributors = better CIDER

Nassin 2021-01-20T23:07:36.060800Z

I could take a look, my emacs foo is very limited at this stage but I'll take you on the 'help with questions' 😉

dpsutton 2021-01-20T23:08:34.061600Z

totally. feel free to ping me here. there's also a discord server that you could join. its kinda more geared towards dev stuff so this would be perfect for you to ask questions there too

Nassin 2021-01-20T23:09:36.062700Z

There needs to be some clojure cli tool version detection I guess? to not break old versions

Nassin 2021-01-20T23:11:41.063800Z

like -M -m won't work with older versions

dpsutton 2021-01-20T23:11:42.063900Z

there's no good way to do it. you'd have to grep the version out of a bunch of stuff. i imagine we just go towards the most current behavior and ask people update

Nassin 2021-01-20T23:12:28.065100Z

ok

dpsutton 2021-01-20T23:13:25.066Z

yeah. but that's kinda inevitable. CIDER can't work with lein 2.7.3. you're kinda expected to upgrade. And the clojure cli tools are developed by Alex so changes are thoughtful and no backwards breaking changing (in theory. there have been some but Alex is awesome and thoughtful and this isn't a big problem at all)

Nassin 2021-01-20T23:15:54.066300Z

fair