This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
I have a quick question. I'm trying to setup my project. I setup deps.edn for backend and I can start the repl from emacs (doom emacs, cider-jack-in-clj) no problem. Now I'm looking to setup frontend environment in the same project with shadow-cljs. So I setup shadow-cljs.edn with :deps pointing to :aliases in deps.edn as shown on shadow-cljs user guide. Now my question is... how do I start both clj repl and cljs repl from doom emacs? I start the backend with cider-jack-in-cli and try to start the cljs repl with cider-jack-in-cljs and it always asks me
A CIDER session with the same connection parameters already exists (....:localhost:36721). Are you sure you want to create a new session instead of using `cider-connect-sibling-clj(s)'?
If I say no... nothing happens. If I start the new session, I can't seem to connect (eval code by C-c C-c)
No cljs REPLs in current session "...:localhost:35683"
I found cider-jack-in-clj&cljs
which seems to be something I'm looking for but now it's saying it can't find ClojureScript
error in process filter: if: ClojureScript is not available. See for details
error in process filter: ClojureScript is not available. See for details
Try performing cider-jack-in-clj&cljs
over https://github.com/reducecombine/icd.scroll which is a sample, small project.
When it asks for a project type, select shadow
When it asks whether it should open a browser, select y
(very important to get cljs eval)
You can also, in the same project, run make
and then cider-connect-clj&cljs
If those work, it's an issue in your repo, else you might need to install npm, or perhaps make it available into emacs
Thank you so much. Looking through the project, I thought my :paths were perhaps the problem. I had "src/clj" and "src/cljs" and folder structures like src/clj/myproj/system.clj and src/cljs/myproj/core.cljs. Once I restructured the project to src/backend/system.clj and src/client/core.cljs, and also shortening my :paths to just "src". I was able to start shadow-cljs watch app.
so that must have been the problem. In emacs, I have to cider-jack-in-cljs
first with shadow-cljs and then cider-connect-sibling-clj
to run both repls. Still gives me error complaining about "ClojureScript is not available" when I just run cider-jack-in-clj&cljs
. Not really sure what is the problem running cider-jack-in-clj&cljs
but at least I can get both repls now.
Happy that you got it! Feel free to suggest documentation or other improvements if you feel something could have been clearer.
Unless I'm misremembering there was a core fn to wrap a value in a vector or list unless it already was -- anyone know what I might be thinking of?
Hmm, doesn't ring a bell. Chatgpt doesn't know it either
You might find skimming the https://clojure.org/api/cheatsheet handy
Something like ensure-vector
doesn't sound general enough to be in core, so I suspect it isn't there
Maybe I'm thinking of something in Elixir 😬 thanks!
(somewhat) related: https://stuartsierra.com/2015/06/10/clojure-donts-heisenparameter
@U051GFP2V i believe he wanted it wrapped if it wasn't a vector 😉
@U0178V2SLAY uh oh that's exactly the kind of function I'm writing... maybe I'll reconsider