Fork me on GitHub
#calva
<
2018-11-30
>
slipset08:11:37

I’m not sure if it makes sense to do this all on the commandline.

slipset08:11:42

Here’s why:

slipset08:11:57

Hang on I’m wrong 🙂

slipset08:11:08

It does make sense, thanks for not listening 🙂

pez09:11:04

I want to make Calva able to connect without having to instruct the users about setting up project.clj or deps.edn in any particular way. As our still unsolved session with @mateus.pimentel.w from yesterday, reminds about.

slipset10:11:16

You will need to instruct the user to add the server-bits to his/her deps.edn

slipset10:11:38

:aliases
 {:nrepl-server {:extra-deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"}
                              cider/cider-nrepl {:mvn/version "0.19.0-SNAPSHOT"}
                              refactor-nrepl {:mvn/version "2.3.1"}}
                 :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}

slipset10:11:09

But, as mentioned in the github issue, calva can connect by issuing

slipset10:11:13

clj -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} 
                     cider/cider-nrepl {:mvn/version "0.19.0-SNAPSHOT"}
                     refactor-nrepl {:mvn/version "2.3.1"}}}' -m nrepl.cmdline --connect --host localhost --port 49832

slipset10:11:34

instead of lein repl :connect localhost 49832

bozhidar15:11:47

This might also be a good option for you, while the EDN stuff are brewing.

bozhidar15:11:18

@slipset You’ll need to use nREPL 0.4+ in the deps, though, as tools.nrepl didn’t have clj integration at all.

pez16:11:15

Thanks, will check!

pez17:11:00

Why doesn’t fastlane suppor transit+edn, @bozhidar? I suspect I am getting something wrong here. 😃

pez18:11:38

@slipset, can we start the server with only command line args too? An equivalent to lein repl, I guess.

pez18:11:02

I can confirm that the client connect works. Even if the interaction is a bit less stellar than the leiningen version is.

slipset18:11:07

I guess problem is that you want to read the projects deps.edn when you start the server up.

lilactown18:11:39

I think that the REPL client should just be a jar

lilactown18:11:55

that way it'll work regardless of what tools the user has installed on their system

lilactown18:11:02

(unless I'm misreading what we're discussing)

pez18:11:18

@slipset, what do you mean “you want to read the project’s deps.ed”?

pez18:11:32

@lilactown, there are at least two issues in play here. One is freeing Calva of an unnecessary dependency on leiningen and the other to make the “Getting started with Calva” less painful than it currently is.

slipset18:11:08

I mean you want to start the repl in the context of a project. To be able to evaluate forms and stuff.

pez18:11:42

For starting the client, I want to explore how far we can get with the tools that regardless are needed for Clojure development, before we consider bundling something.

slipset18:11:27

So, in order to do that, the nrepl server has to load the libs that the project depends on. Hence the need to have a deps.edn in place.

lilactown18:11:42

right, so we need to: 1. Start the user's application with an nREPL server 2. Connect to the nREPL server with a client we control

pez18:11:29

@slipset, yes, but I’d like for Calva to not have any requirements on what should be in the deps.edn file.

lilactown18:11:02

#1 will depend on what kind of project the user is in. it could be shadow-cljs, boot, deps.edn, leiningen, figwheel

pez18:11:34

The way Cider does it, if I have understood things correctly, is to inject what it needs on the command line it uses to start the server.

slipset18:11:38

Then you’re back at square one where Calva has to start the nrepl server with extra-deps, ie calva-jack-in

pez18:11:58

Yes, Calva jack-in is what I am talking about. 😃

slipset18:11:44

@pez yes, but cider has two modes: cider-connect, which is what Calva has today, and which is what I’m trying to augment so that Calva can connect without having lein installed. cider-jack-in is the other mode, where cider also starts the nrepl server, and injects the appropriate middle wares.

pez18:11:55

I think Calva should come configured with some tasks to start lein, boot, clj and shadow servers.

lilactown18:11:05

@slipset so that would be #2

lilactown18:11:15

I think those are orthogonal

pez18:11:30

You have solved the Calva connect case for clj, @slipset. 😃 I am pushing it one step further. Call me greedy.

slipset18:11:26

@pez exactly :) that was also the issue I filed. There is another issue which is cider-jack-in, IIRC

pez18:11:58

Now I need to bake pizza to my family. Please continue the discussion without me.

pizzaspin 4
pez18:11:14

Agreed, @slipset. Feel invited to open another issue.

slipset18:11:49

Have a great Friday @pez! I’m done with the 🍕and on my way out to 🛹

pez18:11:29

Where do you live, @slipset?

slipset21:11:01

Oslo, Norway.

pez21:11:50

That’s what I guessed! But skating a friday night in latest November in Oslo?

slipset21:11:49

Where you at? Stockholm?

pez21:11:18

Ah, indoor!

pez21:11:28

Yes, Stockholm,

slipset21:11:04

Nice, I worked there from 96-01 or so.