nrepl

https://github.com/nrepl/nrepl || https://nrepl.org
pez 2020-03-23T06:35:01.051200Z

A CLJS nREPL server? I must pinch my arm.

djblue 2020-03-23T15:31:12.056300Z

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.

djblue 2020-03-23T15:33:11.056500Z

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

djblue 2020-03-23T15:33:41.056700Z

"To quit, type: :cljs/quit"

pez 2020-03-23T15:34:57.056900Z

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

๐Ÿ‘ 1
pez 2020-03-23T15:36:40.057200Z

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

djblue 2020-03-23T15:43:34.057400Z

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:

pez 2020-03-23T15:47:58.058300Z

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.

pez 2020-03-23T16:39:43.058500Z

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

1
pez 2020-03-23T19:14:20.058800Z

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.

pez 2020-03-23T06:39:53.053600Z

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.

pez 2020-03-23T06:40:06.054Z

(If I understand the question correctly.)

bozhidar 2020-03-23T08:27:36.056Z

@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.

bozhidar 2020-03-24T09:58:06.059500Z

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

bozhidar 2020-03-24T09:58:20.059700Z

As long as it serves the purpose the API doesnโ€™t matter that much.

djblue 2020-03-23T15:44:44.057600Z

Adding cljs support would be awesome ๐Ÿ˜„

djblue 2020-03-23T15:45:20.057800Z

I have an implementation here https://github.com/djblue/nrepl-cljs/blob/master/src/nrepl/bencode.cljs

djblue 2020-03-23T15:46:30.058100Z

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