Skip to content

Instantly share code, notes, and snippets.

@codeasone
Created July 10, 2022 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeasone/6b2edf963915621ee66f938364875cd6 to your computer and use it in GitHub Desktop.
Save codeasone/6b2edf963915621ee66f938364875cd6 to your computer and use it in GitHub Desktop.
Some more shadow-cljs REPL guidance
((nil . ((clojure-directory-prefixes . ("\\`clj[scx]?\\."
"\\`bb\\."))
(cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-global-options . "-A:dev:test:backend:frontend")
(cider-default-cljs-repl . custom)
(cider-custom-cljs-repl-init-form . "(do (user/cljs-repl))")
(eval . (progn
(make-variable-buffer-local 'cider-jack-in-nrepl-middlewares)
(add-to-list 'cider-jack-in-nrepl-middlewares "shadow.cljs.devtools.server.nrepl/middleware"))))))
(ns user
(:require [shadow.cljs.devtools.api :as shadow]
[shadow.cljs.devtools.server :as server]))
(defn cljs-repl
([]
(cljs-repl :app))
([build-id]
(server/start!)
(shadow/watch build-id)
(shadow/nrepl-select build-id)))
@codeasone
Copy link
Author

I'm using this approach with cider-jack-in-clj&cljs to establish sane cider REPL sessions for some projects and it seems to work well, with sesman reporting [*cider-repl %s(cljs:custom)*, *cider-repl %s(clj)*] upon jack-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment