Fork me on GitHub

I'm looking to get a node based cljs.main repl with deps.edn up and running with an nrepl server, so I can connect from cider or proto-repl or anything. Seems like a common need, but I'm flailing a bit. Trying to move to deps.edn for new projects after using project.clj until now.


Does someone have a pointer to a gist or resource maybe?


Hm, maybe I should ask this in #clojurescript


@vinai I have my current project with that and it's working great! Didn't really have to do anything special to get it working. Just ran cider-jack-in-cljs 🙂


@dehli What is the deps.edn you are using?


by the way, I also got a lot of information in #clojurescript

👍 1

{:deps {org.clojure/clojurescript {:mvn/version "1.10.238"}
        org.clojure/clojure {:mvn/version "1.9.0"}
        org.clojure/core.async {:mvn/version "0.4.474"}

 :aliases {:test {:extra-deps {olical/cljs-test-runner {:mvn/version "0.1.1"}
                               org.clojure/tools.namespace {:mvn/version "0.3.0-alpha4"}
                               doo {:mvn/version "0.1.10"}}
                  :main-opts ["-m" "cljs-test-runner.main"]}
This is the gist of it. I have some aliases that are used for lint, test, and build (but none for repl)


I'd recommend adding that test alias b/c it will automatically find all your tests and run them for you


so you don't have to have any test runner file


Thank you!

👍 1

are agents still a part of popular/idiomatic clojure? I feel like I rarely see them used

Roy Truelove15:07:59

AFAIK they are, though there’s a very specific use case so that might be why you’re not seeing them often in the wild.


I'm still trying to wrap my head around this one


yeah, I had an application that started out with go-loops and then realized it was way simpler using an agent


haven't seen any other project use it though. thought I remembered someone talking about agents being out of vogue / not used for some reason, but couldn't remember which


I dunno, if I was on a desert island I would much rather have core.async over agents. agent queues are implicit. agents can't explicitly wait to receive a message from a given sender before continuing on to process messages from other senders. agents require you to slice your logic up in to actions, which are are basically callbacks, which core.async's go macro is designed to avoid


but sometime's those restrictions are fine. in which the ceremony of core.async can introduce bugs.


Hi all, anyone know what's the best way to run cljs code from the cli (targeting node)? I've been struggling to get it working Edit: Going to go with a different approach so scratch the question 🙂


$ cat script.cljs
(println "hello")
$ clj -m cljs.main -re node script.cljs


Thanks! I was running into issues with node/require when I went with that approach