Fork me on GitHub
#nrepl
<
2020-03-23
>
pez06:03:01

A CLJS nREPL server? I must pinch my arm.

djblue15:03:12

For now I'm targeting node/lumo but eventually any javascript runtime with tcp should work. I got calva working with nrepl-cljs by pretending it was nashhorn.

djblue15:03:11

I guess calva checks for a specific string before it trusts its actually a cljs nrepl server.

djblue15:03:41

"To quit, type: :cljs/quit"

pez15:03:57

That's configurable, but yes, by default it waits for that string before it considers the connection complete.

👍 4
pez15:03:40

We will need to modify Calva a bit to support this in a smooth way. And I am eager to do those modifications! 😃

djblue15:03:34

I already pulled down the calva repo for debugging through the first problem. I'm down to pull down any test branches to see how it works :thumbsup:

pez15:03:58

Today Calva makes quite a big assumption that it is connectiong to a CLJ server. To create a sensible Ux we will need to remove that assumption. Which I think might be a pretty heavy rewrite. But also, it isn't all that much code, so should be within reach.

pez16:03:43

Here's a branch where I have started adding a generic project type. Still CLJ and all that, but anyway. I can connect smoothly to babashka's nrepl server at least. https://github.com/BetterThanTomorrow/calva/tree/wip/generic-project-type

thanks 4
pez19:03:20

Thinking about it.... It should be possible to connect to your CLJS repl there, using that branch. Calva will think it is a CLJ repl, but if the files are named as .cljc it would work.

pez06:03:53

As for querying the language from the server, as @bozhidar says, there hasn't been a need for that yet. 😃 But even so, Calva can check the project files and ask the user.

pez06:03:06

(If I understand the question correctly.)

bozhidar08:03:36

@borkdude Feel free to also directly update the library. Probably it’s a good idea to retain compatibility with older Clojure releases, as there is still some usage of Clojure 1.7/1.8 in the wild.

djblue15:03:44

Adding cljs support would be awesome 😄

djblue15:03:30

Since you can't block on reads in cljs, the api can't be the same

bozhidar09:03:06

Well, I guess that’s fine. It can very well be a different library then.

bozhidar09:03:20

As long as it serves the purpose the API doesn’t matter that much.