Skip to content

Instantly share code, notes, and snippets.

@tggreene
Last active April 2, 2020 09:13
Show Gist options
  • Save tggreene/d894baa220a45d1e0444a31ed23b427f to your computer and use it in GitHub Desktop.
Save tggreene/d894baa220a45d1e0444a31ed23b427f to your computer and use it in GitHub Desktop.
Setting up refactor-nrepl with shadow-cljs

shadow-cljs plays nicely with cider-nrepl courtesy of this little fella, however, not so much love for cider-nrepl's little brother refactor-nrepl.

Unfortunately there's no project agnostic way of loading nrepl middleware with the nrepl launched by shadow-cljs using user config alone (as stated here), but you can ask nrepl to configure middleware for itself with ~/.nrepl/nrepl.edn.

I have a working setup with the following (with shadow-cljs > 0.2.39 and nrepl 0.6.0):

~/.clojure/deps.edn

{:aliases {:cider {:extra-deps {cider/cider-nrepl {:mvn/version "0.25.0-SNAPSHOT"}
                                refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"}}}}}

~/.shadow-cljs/config.edn

{:deps-aliases [:cider]}

~/.nrepl/nrepl.edn

{:middleware [refactor-nrepl.middleware/wrap-refactor]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment