Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common Tooling library #30

Open
volrath opened this issue Jan 1, 2018 · 10 comments
Open

Common Tooling library #30

volrath opened this issue Jan 1, 2018 · 10 comments

Comments

@volrath
Copy link
Member

volrath commented Jan 1, 2018

By Common Tooling I refer to all tooling features that can be shared and reused by UNREPL clients.

In slack @pesterhazy and I were discussing on the best way to accommodate for this. Current options on the table are:

  1. Mono repo: React style, they have react, react-server, react-dom, ... all in the same REPL.
  2. Separate repo: each client would be responsible to consume this repo, either by including it as a jar file or as a submodule/subtree.

Currently we lean to the second option. This repo/library should be as thin as possible in term of dependencies.

Dependencies should be 'shaded' at build/release time with something like MrAnderson (see also Unrepl/unravel#64)

Clients may also have to shade their inclusion of this library.

@SevereOverfl0w
Copy link
Member

I feel strongly about preferring 2 over 1.

A clojure tooling library should be agnostic to anything except clojure & various hosts. Unrepl the protocol is designed such that the kind of hacks present in cider-nrepl to iron over bencode limitations are not necessary.

I think the basis for this library should be cider-nrepl, as it's overall a very solid library. It's fairly (but not perfectly) well separated in terms of util and bencode adaptation. There's a lot of gold in there.

Dependencies are a minor concern due to the shading. Although size is still a factor of course. This is the decision made by cider-nrepl itself.

@volrath
Copy link
Member Author

volrath commented Jan 1, 2018

I forgot to mention cider-nrepl, but I 100% agree with @SevereOverfl0w that there's a lot of great things in there and maybe even working on splitting cider-nrepl into two libraries could benefit everyone, as @bbatsov has stated before.

My comment on dependencies is just related to size. Shading is a must :)

@bbatsov
Copy link
Contributor

bbatsov commented Jan 1, 2018

Well, as a said before - it's not even a lot of work. Someone just has to find the time to do sit down, do it and write some documentation. Obviously the process can be gradual and we can move things gradually there. The most common things can go to this new library, the more nuanced can stay.

Btw, there's also a lot of gold in https://github.com/clojure-emacs/refactor-nrepl

I even have a cool name in mind for such a shared library - orchard :D

If everyone agrees with such a course of action I can even create one placeholder repo for this. Ultimately it seems to me that regardless of the communication protocol, the concerns you end up in the end are pretty much the same. That's well evidenced by the fact that a lot the code in the early days of CIDER came straight from swank-clojure - I guess few people remember that things like the original completion clojure-complete and the Clojure inspector came pretty much straight from there.

Dependencies are a minor concern due to the shading. Although size is still a factor of course. This is the decision made by cider-nrepl itself.

Size is really an issue only if you decide to eagerly load everything, which generally doesn't make sense.

@bbatsov
Copy link
Contributor

bbatsov commented Jan 1, 2018

I also forgot to mention https://github.com/clojure-emacs/cljs-tooling - another library we've created to support ClojureScript in CIDER. It's completely cider-agnostic by default. Not sure how exactly do you handle completions and stuff in unrepl, so this might also be useful.

@pesterhazy
Copy link
Contributor

@bbatsov
Copy link
Contributor

bbatsov commented Jan 24, 2018

A small progress update - https://github.com/clojure-emacs/orchard is steadily growing and growing. A lot of functionality was moved from cider-nrepl there already, and things are looking good overall. Now it's time to polish the API and write some docs. 😉

@bbatsov
Copy link
Contributor

bbatsov commented Jan 24, 2018

https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/complete.clj

We're still debating what exactly to do about it, as it just a thin wrapper over compliment and cljs-tooling, and there's not much to extract really. We'll likely move cljs-tooling to orchard, though.

@mauricioszabo
Copy link

I'm trying something here: https://github.com/mauricioszabo/repl-tooling

The difference is that I'm using ClojureScript to target Atom (and VSCode, and NeoVIM, etc), but so far I'm not having too much success in wrapping things. Also, my approach is a little different (I'm trying to send/receive commands, support break, refactor things, wrap middlewares in socket REPL, etc)

@bbatsov
Copy link
Contributor

bbatsov commented Sep 2, 2018

@mauricioszabo We've got a counter-party to orchard for ClojureScript - https://github.com/clojure-emacs/cljs-tooling It supports self-hosted Clojure since version 0.3, so you might also take a look at it.

I'm not sure what the aim of your project is exactly, but I'm reasonably sure that we've covered at least the basics with the libraries we've developed around CIDER so far.

@mauricioszabo
Copy link

@bbatsov Ok, I've added a README in my project to explain better what I want to do with it. But mostly, I want a library to work as an UNREPL client, or Socket REPL (in Clojure, ClojureScript, Lumo, Plank, etc) client so I can have a base lib to integrate in any editor.

I've looked at cljs-tooling and I'll probably use it for AutoComplete and other things (one of the targets of the project is to auto-detect which REPL feature we can use, so for instance, if it detects it's on Clojure and Compliment is present, it'll use it as autocomplete; if it detects it's on Lumo, it'll use Lumo's autocomplete, and so on).

It's still on it's infancy, but so far I'm able to connect Atom (my editor of choice) in a REPL, send a command, capture its output and render in a view with Reagent. Next, I'll try some tooling with NeoVIM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants