Fork me on GitHub
#shadow-cljs
<
2019-09-06
>
gerred01:09:21

anyone encounter this while making a build report?

gerred01:09:23

"Could not locate shadow/cljs/build_report__init.class"

gerred01:09:09

think I ran into the problem 🙂

gerred01:09:51

yep PEBKAC

mccraigmccraig13:09:34

is it possible to connect a repl to a :node-test watch ? i'm guessing not, but it would be nice

thheller13:09:22

is node-repl not enough?

thheller13:09:34

node-test disables REPL and hot-code loading so it doesn't interfere with actually running tests

mccraigmccraig13:09:39

what i actually wanted was hot-code loading in the node-repl

mccraigmccraig13:09:11

i want a nice workflow for writing cljs tests - ideally combining repl exploration alongside clojurescript.test execution

thheller13:09:00

that is probably all possible already. if you describe what a want a bit more I can tell you how to set it up

mccraigmccraig13:09:19

sure - i've got a bunch of .cljc/cljs tests which i'm running with a shadow-cljs watch <node-test-target> - i'd like to be able to do repl exploration with hot-code-loading on the same code the tests are exercising

mccraigmccraig13:09:47

i can do shadow-cljs node-repl for exploration, but there's no reloading afaics

thheller13:09:01

so you are using :autorun I presume? for the node-test build?

thheller13:09:26

the issue with :node-test is that it is supposed to exit the process once it has run all tests

thheller13:09:33

I'm not going to change that part

mccraigmccraig13:09:54

yep, i figured that was why i couldn't run a repl against that target

mccraigmccraig13:09:31

i'm not attached to doing it any particular way though... i just want to be able to combine repl exploration with running tests

thheller13:09:37

it is technically possible to enable the hot-reload for node-repl but it is not currently accessible in a nice way

thheller13:09:57

well you can just run the tests from the REPL?

thheller13:09:15

just call (cljs.test/run-all-tests) or so

mccraigmccraig13:09:56

but can i get hot-reload in the node-repl, so i can iterate ?

thheller13:09:19

well .. the problem is that it won't do anything useful

thheller13:09:38

you are better off using the REPL to reload the files

mccraigmccraig13:09:04

oh, can i (require ... :reload) in the repl ?

thheller13:09:24

load-file works a bit better so I'd use that

thheller13:09:48

most editors have a built-in function for that. dunno what you are using

mccraigmccraig13:09:47

i'm using emacs, but i haven't been using CIDER for cljs stuff, 'cos i'm already using it for clj stuff, and running multiple CIDER sessions concurrently is painful

thheller13:09:06

cider definitely has something for load-file

mccraigmccraig13:09:20

yep, but i'm just using a terminal for cljs repl atm

thheller13:09:20

I gotta go, be back in an hour or so

mccraigmccraig13:09:38

np, i'll play around with CIDER and see what i can get to work.. thanks @thheller

mccraigmccraig15:09:18

got it all working with CIDER and the node-repl @thheller - sadly CIDER doesn't integrate nicely with cljs.test (in the way it does with clojure.test) but the repl / reload workflow is great

mccraigmccraig16:09:38

so i ended up starting a shadow server with : shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.0 -d refactor-nrepl:2.4.0 -d cider/cider-nrepl:0.21.2-SNAPSHOT node-repl then i could do M-x cider-connect-cljs and choose a shadow repl and node-repl build, and it works about 100x better than any cljs repl i ever used before

👍 4