Fork me on GitHub
#beginners
<
2018-07-09
>
vinai11:07:28

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.

vinai11:07:47

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

vinai11:07:54

Hm, maybe I should ask this in #clojurescript

dehli13:07:31

@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 🙂

vinai13:07:19

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

vinai13:07:37

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

👍 1
dehli13:07:12

{: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)

dehli13:07:40

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

dehli13:07:14

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

vinai13:07:51

Thank you!

👍 1
lilactown15:07:35

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.

arnaud_bos20:07:48

I'm still trying to wrap my head around this one https://twitter.com/mtnygard/status/971179035593240581

lilactown20:07:03

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

lilactown20:07:46

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

hiredman21:07:06

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

lilactown21:07:39

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

dehli15:07:23

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 🙂

dmitryn08:07:35

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

dehli17:07:14

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