This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-26
Channels
- # announcements (17)
- # babashka (68)
- # beginners (8)
- # biff (14)
- # calva (25)
- # cherry (10)
- # clj-kondo (1)
- # clj-on-windows (12)
- # cljsrn (6)
- # clojure (134)
- # clojure-berlin (1)
- # clojure-europe (33)
- # clojure-nl (4)
- # clojure-norway (6)
- # clojure-uk (10)
- # clojurescript (9)
- # datalevin (8)
- # datomic (34)
- # docker (1)
- # emacs (31)
- # fulcro (6)
- # honeysql (8)
- # java (7)
- # joyride (14)
- # kaocha (7)
- # malli (11)
- # nbb (4)
- # off-topic (11)
- # pedestal (14)
- # rdf (53)
- # re-frame (6)
- # reagent (39)
- # reitit (2)
- # releases (9)
- # rewrite-clj (14)
- # shadow-cljs (97)
- # specter (1)
- # testing (5)
- # tools-deps (12)
- # vim (4)
- # xtdb (9)
I'm trying to migrate my company from leiningen to deps.edn. I've got it mostly working (step by step), and i'm currently stuck on a repl-related issue. in leiningen's project.clj, i can say :repl-options {:init-ns crossbeam.dev :init (start) :nrepl-middleware [cider.nrepl/cider-middleware]}
This will pass the middleware to nrepl, start up the repl, and then enter crossbeam.dev
and execute crossbeam.dev/start
before passing control to me. In deps.edn, I have :aliases {:repl {:main-opts ["-e" "(require,'crossbeam.dev),(in-ns,'crossbeam.dev),(start)" "-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"
This seems to be the same (except for printing #object[clojure.lang.Namespace 0x70949361 "crossbeam.dev"]
as it loads), but I'm unsure that it's doing the same thing. Is this roughly correct?
If you're on Clojure 1.10 or later, that could be "-e" "((requiring-resolve '
and if you're on a recent CLI version you should be able to omit those ,
but otherwise, yeah, that seems right.
I forgot about requiring-resolve, but I'd like for the repl to start in
, which is why I wrote it like that.
Cool, thank you
If I find myself writing that much code in an alias, I tend to put it in a function in .clj
file and just do a requiring-resolve
invocation on it.
I've never understood why anyone cares what ns the REPL starts in -- it is going to track whatever REPL you're eval'ing code from your editor with anyway?
(and I never type into a REPL -- I don't even have the REPL visible in my editor)
At this point, I've also moved any app start stuff into REPL command snippets in VS Code/Calva, so that I can start a "bare" REPL without it starting any processes -- and then I can control what is started/stopped.
(but if you want all your devs to be able to start the app the same way, it makes sense in a .clj
file in the repo so everyone can invoke it that way)
But we have ~20 apps so we tend to start/stop different apps depending on what part of the repo we're working in 🙂
Sadly, we have a somewhat complicated docker set up and need a consistent entrypoint for our devs of varying clojure experience. Good point about the repl, you’ve made me realize that I can remove the in-ns stuff because we run the repl headless (in docker). Should have noticed that already.
Thanks for the input