Fork me on GitHub
#cider
<
2021-11-22
>
macrobartfast05:11:05

I’m trying to create a single project with a clj backend and a cljs frontend… hence I have both a deps.edn and a shadow-cljs.edn (don’t know if that’s correct)… when I cider-jack-in-clj everything works on the clj side… when I cider-jack-in-cljs everything works on the cljs side… but when I cider-jack-in-clj&cljs the clj side has numerous compilation problems on the requires of the first namespace I evaluate… thoughts?

macrobartfast05:11:15

update: I also don’t get a cljs repl apparently when using cider-jack-in-clj&cljs.

dpsutton06:11:53

jack-in-clj&cljs is when you can create a clojure and clojurescript repl in the same process. since you are using shadow you cannot do this. because shadow is a separate process from your clojure backend process

dpsutton06:11:05

for instance, if you were using figwheel-main, you would start up two repls, and in one you would just require figwheel.main.api or whatever the namespace is that cranks up the cljs stuff. and then you have "upgraded" one of the clj repls into a cljs repl. but for your setup you start two different programs so this technique won't work for you

dpsutton06:11:39

that function has probably caused more confusion than benefit and perhaps removed. just start your two repls independently because they are independent

macrobartfast06:11:29

This is so helpful! Thank you for helping me to understand this.

👍 1
dpsutton06:11:07

at the top of the repls should be a startup command and a command that turns your cljs repl into a cljs repl. I put those in the startup text to take some of the mystery out of the tooling. I think if you see those two you'll get some more insight why this doesn't work

macrobartfast06:11:54

ah cool… lemme look at that now.

macrobartfast06:11:18

Ah, yep… that’s really helpful, actually.

macrobartfast06:11:36

And using cider-drink-a-sip now since reading about it there. 🙂

cider 1
bozhidar11:11:48

@macrobartfast That's the greatest, yet most underappreciated command in all of CIDER!

cider 3
Leah Neukirchen14:11:08

i wish M-x cider-connect had an own history ring for the port number...

bozhidar14:11:59

@leah I guess this should be easy to implement. I typically connect to a locally running server instance, that's why I never thought much about storing the ports (in my case they are typically random). I guess this also makes a lot of sense for remote hosts. Feel free to file a ticket on the subject.

Leah Neukirchen18:11:13

Yeah, I guess I could let it autoconnect too. Thanks!

bozhidar14:11:30

Btw, have you seen this:

bozhidar14:11:33

(setq cider-known-endpoints
  '(("host-a" "10.10.10.1" "7888")
    ("host-b" "7888")))

bozhidar14:11:04

Might be useful in your use case (assuming you want to connect to the same port on the same host).

Carsten Behring17:11:55

Do people here have an opinion on the role of Emacs in the upcoming "wave of devcontainers" paired with "in-browser software development" ? In this, every open-source project will configure "centrally" one development setup (including tools + IDE + IDE configuration). This does match badly IMHO with Emacs (technically and philosophically), unless we address this.

solf20:11:22

Is there such a wave coming? 😱

solf20:11:02

Is it about something like the gitpods from github? (not 100% sure about the name)

solf20:11:27

gitpods do not force a specific IDE if I remember correctly

bozhidar07:11:19

I see value in using containers for local development, but I don't see much value in forcing people to use specific development tools.

justinbarclay16:11:27

I hope I never have to worry about that issue. But, there has been some work done getting emacs working on gitpods: https://github.com/emacs-lsp/lsp-gitpod

Carsten Behring20:11:39

One way to address this in Emacs would be to have a way to support "devcontainers". There is not accepted standard yet, but VSCode specifies a "json file", which allows (VSCode for teh moment) to build automatically an Docker image from a Dockerfile and it runs on startup commands on it, so you get a docker container running, with all tools installed inside. Big parts of that json file are independent of VSCode or any IDE, so could be in theory used cross IDE.

Carsten Behring20:11:58

Docker is not a big subject for Clojure development thanks to the JVM.

Carsten Behring17:11:51

And companies might then follow.