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

Improve the way cider-jack-in-clojurescript works #2202

Closed
bbatsov opened this issue Feb 12, 2018 · 4 comments
Closed

Improve the way cider-jack-in-clojurescript works #2202

bbatsov opened this issue Feb 12, 2018 · 4 comments
Labels
ClojureScript enhancement good first issue A simple tasks suitable for first-time contributors

Comments

@bbatsov
Copy link
Member

bbatsov commented Feb 12, 2018

Current cider-jack-in-clojurescript is very problematic, as it doesn't really do any attempts to figure out what's the best ClojureScript repl to start for the users project - it just uses a configurable init form to boot the repl, that's mapped to a project type (lein, boot, etc). While this makes sense for cider-jack-in, it doesn't make (almost) any sense for ClojureScript as most of the cljs repls are not tied to build tools at all. We need to do several things to improve the current situation:

  • probe which of the potential repls are supported by the users current environment (e.g. by checking whether their namespaces are bound) and offer the user to select one of them
  • add some function to determine which of the supported repls is the most capable to suggest it as the default (e.g. if figwheel's supported, we should probably go with it, on boot projects we should probably go with the boot cljs repl, etc)
  • add some defcustom just jack-in straight to the default repl (useful for lazy people who are fine with the detection mechanism)

That's a pretty simple, but important task on our way to better cljs support IMO. //cc @gonewest818 @ckoparkar @xiongtx @dpsutton

bbatsov added a commit that referenced this issue Mar 1, 2018
… being used

Now the user will simply be prompted for the REPL they want to start. Later we
should make this smarter - compute a good default based on the project deps,
don't show unsupported options, etc.
bbatsov added a commit that referenced this issue Mar 2, 2018
It basically gives you a way to either default to one ClojureScript
REPL for all your projects or for individual projects (when setting it
via `.dir-locals.el`).
bbatsov added a commit that referenced this issue Mar 5, 2018
The current logic relies mostly on namespace checks, but it can
certainly be improved down the road.

The most important thing is that now users are going to get more
meaningful errors earlier. Before this we'd first create the second
REPL buffer and just get there some obscure errors because the command
didn't check at all if piggieback or the target REPL were even
available.
@mrrodriguez
Copy link

I discussed this on Slack #cider with @dpsutton and putting it here for additional visibility.
One issue I brought up with the current ClojureScript integration in Cider is that it is awkward and brittle to set the cider-cljs-lein-repl because you have to set it to the entire code form string that is used in Cider.

For example, in my Emacs config for this, I have something like:

;; Set to the required key in cider.el const `cider--cljs-repl-types`
(setq cider-cljs-lein-repl
      "(do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))")

I'd like to be able to set the type to "figwheel" and it know the invocation required for that rather than setting it to the actual invocation.

@bbatsov
Copy link
Member Author

bbatsov commented Mar 6, 2018

@mrrodriguez That's already changed on master. See https://github.com/clojure-emacs/cider/blob/master/cider.el#L550

@mrrodriguez
Copy link

Thanks @bbatsov I'll have to check that out soon then.

@bbatsov bbatsov added good first issue A simple tasks suitable for first-time contributors and removed good first issue A simple tasks suitable for first-time contributors low hanging fruit labels May 8, 2019
@vemv
Copy link
Member

vemv commented Aug 24, 2023

Things are fairly refined and decoupled by now

@vemv vemv closed this as completed Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ClojureScript enhancement good first issue A simple tasks suitable for first-time contributors
Projects
None yet
Development

No branches or pull requests

3 participants