Fork me on GitHub
#boot
<
2017-09-04
>
bmaddy04:09:35

What's the recommended way to get a cljs repl working with emacs? If I run boot dev boot repl -c and (start-repl) in the terminal, I seem to get a functional cljs browser repl in my project, but cider-jack-in seems to call boot repl -s wait. cider-jack-in-clojurescript appears to call the same thing but also (somehow) also start a rhino repl. I'd like to be able to call cider-jack-in-clojurescript and have it start my server and browser repl. Does anyone know the best way to do that?

dominicm13:09:51

@bmaddy You can customize the cider-boot-parameters to be dev instead of repl -s wait.

bmaddy03:09:06

Hey, thanks for the tip on this. I still haven't gotten things working right, but I am making progress (I think).

dominicm13:09:10

Not sure about the clojurescript-jack-in specifically though. Don't know how that's configured.

mpenet15:09:59

is there an equivalent of lein :pedantic :abort in boot?

nha15:09:21

@mpenet It is not documented, basically only in a “works for me” state, but I use this task https://github.com/nha/boot-deps/blob/master/src/nha/boot_deps.clj#L159 And I keep my dependencies in a deps.edn file. It writes the exclusions for me, keeping the latest (IIRC).

mpenet15:09:13

I do the same for the deps.edn file heh, it's shared between a project.clj file and the boot file

mpenet15:09:40

this way we can use both depending on what we like

hmaurer19:09:20

Hi! I just started toying with Boot (and new to Clojure). Quick question: what does AOT do and do I need it in my build? To “get started” I used the following build task:

(deftask build
  "Builds an uberjar of this project that can be run with java -jar"
  []
  (comp
   (aot :namespace #{'my-project.core})
   (uber)
   (jar :file "project.jar" :main 'my-project.core)
   (sift :include #{#"project.jar"})
   (target)))

hmaurer19:09:47

This works fine, but if I comment the (aot ... line I get this error:

Error: Could not find or load main class my-project.core

juhoteperi19:09:40

@hmaurer AOT (Ahead of Time compilation) compiles the Clojure code to a Java class. When running the jar using java, the Java class has to be available because java can't compile Clojure code.

hmaurer19:09:55

@juhoteperi Ah I see, so I need to compile ahead of time the namespace containing the -main function?

hmaurer19:09:46

And if I do not provide an entrypoint? Can I build a jar and then run any arbitray function contained in it?

juhoteperi19:09:14

I think aot task requires the namespace option

hmaurer19:09:51

so I need to aot whatever namespaces will be invoked when running the jar?

juhoteperi19:09:35

hmh, no, just the namespace with -main

hmaurer19:09:45

ok. thank you!

juhoteperi19:09:07

uberjar will contain Clojure compiler, and when the main namespace does require otehr ns, it will compile the other namespaces

hmaurer19:09:24

if the jar is not an uberjar, how will this work?

juhoteperi19:09:00

if it is a application, you need to add clojure to classpath yourself, if it is a library, it is not ran with java directly

hmaurer21:09:39

Is it standard when working with a repl to open a repl in server mode (nrepl) then open one or more clients?

danielcompton21:09:34

@hmaurer depends how you work. I do it in Cursive, so I can rely on Cursive's built in REPL, rather than the one from the terminal session I'm running Boot on

hmaurer21:09:50

Mmh I see. On an unrelated note, I was looking for something like http://deps.co a week ago 🙂

danielcompton21:09:42

I imagine Cider has a similar workflow