Fork me on GitHub

what is a proper handling of multiple watch processes? I keep having to cancel and relaunch them because I get confused by what is being shown.


I am unable to find the blogpost or doc segment or github issue where you described how to use it. Please remind me where it is


shadow-cljs server and then its printed on startup shadow-cljs - server version: 2.8.110 running at


so far I was with you, I did open it, but I don't know where from here 🙂


you click builds and "start watch" for whatever builds you want running


I assuming here that you are on a somewhat recent version where the UI actually works


when you click the name of a build it'll take you to the build output of that build and won't distract you with output of the others


The second thing I am trying to watch is tests with puppeteer that I build with :target :node-test


And I am trying to use it in headful mode


Launching it from the UI I don't know where the output it or why the puppeteer windows don't appear


well for one you should never use :autorun true


run it manually ... then you never have to guess where your output is


well, why is there then? 🙂


as for puppeteer ... no clue. never used it.


because people asked for it and I foolishly said yes


ok, but some convenient way to automatically start the browser again when I close it would be really nice since otherwise I will have to repeat this hundreds of times every day


I don't know what you mean


these are automated tests. The browser loads up and does a bunch of things like a manual tester would, then stays open so I can work with it. But when I need to test if my work is good, I close the browser and autorun relaunches it immediatelly. But with your suggestion, I would have to have a separate terminal where I would have it in bash history and every time I close the browser I would hunt this terminal down and press up arrow and enter 🙂


If there is a better flow to write these tests, I am very open to learning it. This is how I am used to do it, but not something I like.


I don't really see how the question is related to shadow-cljs. I do not use puppeteer and have no clue how to use it. if your concern is not using :autorun true you can easily use other tools to achieve the same without being coupled to shadow-cljs. eg. just have that watch the :output-to file of the build and do stuff when it changes?


I want to build a proper "test runner" at some point but its a whole lot of work and not very high priority for me.


It might be unrelated if it doesn't support it already, you are absolutely correct. I will try to look for other solutions


Another reason I used npm scripts to start the watch process was that I could use the same build both for testing and development, with --config-merge. Now it seems I have to create separated builds or use environment variables. Neither option is better than config-merge.


I feel like you are kinda expecting miracles here. I can only make suggestions. Given how little information I have about what you are actually doing they may fit or not. It is up to you to decide what you want to do and how you want to do it.


Sorry if that's how it comes through. I am actually glad I have a place to ask questions and I get some answers. No expectations whatsoever. My understanding was that you are against using environment variables and suggest instead config-merge with goog-define. This option seems not to be available if I follow your most recent suggestion. I do not expect you to have an answer (I don't know how to convey this without explicitly stating it...), but if you do have some suggestion on how to use the UI + use a single :target :node-test build compile watched + then launch the tests with different modes, one for command line testing through npm test, another for development, maybe with chokidar or similar ... but without using environment variables, then I would like to know. Normally I wouldn't ask such detailed questions, I am used to using lots of environment variables in node and even in the browser, I am not even sure what's the reasoning against them.


First you should maybe explain what you are using environment variables for


since environment variables in node builds can just be actual environment variables. I don't see why they need to become part of the build config?


like if you want to access them at runtime just use js/process.env.WHATEVER_ENV_YOU_WANT


I also don't understand how you are using --config-merge to use one build for testing and development.


"shadow-cljs watch test --config-merge \"{:closure-defines {tests.core/TEST_MODE \"tdd\" tests.core/SITE_URL \\\"$LOCAL_NAMESERVER\\\"}}\" "


I didn't think about just using process from node. I was too hung up on finding out what already is there.


if you are running node definitely just use js/process.env. :closure-defines is definitely worse than doing that and pretty much only used by people in browser builds since that can't otherwise access your environment variables


thanks, I will do that


Hello! I have a question about shadow’s watch command. Is it possible to have the artifact built not have a dependency on ws?


I’d like to have watch running and then be able to quickly upload the artifact to AWS as I make code changes without having to do a full build every time

Wilson Velez14:08:26

hi, I’m starting to play with nubank/workspaces and I set a build called cards as explained here:

{:source-paths ["src"]
 :nrepl        {:port 3333}
 :dependencies [[binaryage/devtools "1.0.2"]
                [reagent "1.0.0-alpha2" :exclusions [cljsjs/react cljsjs/react-dom]]
                [nubank/workspaces "1.0.15"]]
 :dev-http     {8080 ["target/" "assets/"]}
 :builds       {:app   {:output-dir "target/"
                        :asset-path "."
                        :target     :browser
                        :modules    {:main {:init-fn app.main/main!}}}
                :cards {:target
                        :ns-regexp  "-(test|cards)$"
                        :output-dir "target/workspaces"
                        :asset-path "workspaces"
                        :preloads   []}}}     

Wilson Velez14:08:23

but when I “watch” the build I’m getting this error http://localhost:9630/build/cards X Compilation failed.

TBD, classpath indexing is gone.
ExceptionInfo: TBD, classpath indexing is gone. (classpath.clj:1225) (classpath.clj:1223) (target.clj:10) (target.clj:9) (target.clj:36) (target.clj:30) (target.clj:61) (target.clj:53)
	clojure.lang.Var.invoke ( (build.clj:162) (build.clj:159) (build.clj:151) (build.clj:407) (build.clj:403) (build.clj:441) (build.clj:434)
	shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:364)
	shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:345)
	shadow.cljs.devtools.server.worker.impl/fn--15030 (impl.clj:440)
	shadow.cljs.devtools.server.worker.impl/fn--15030 (impl.clj:429)
	clojure.lang.MultiFn.invoke (
	shadow.cljs.devtools.server.util/server-thread/fn--14807/fn--14808/fn--14816 (util.clj:285)
	shadow.cljs.devtools.server.util/server-thread/fn--14807/fn--14808 (util.clj:284)
	shadow.cljs.devtools.server.util/server-thread/fn--14807 (util.clj:257) (


@wvelezva see I thought that was fixed. maybe need a different version?


hmm no still open. so I guess not fixed.


Just tried using :karma target for the first time — it works like a charm 👍 Thank you for it!

👍 3
👀 3
Wilson Velez14:08:01

I’m working with the lastest verstions of shadow and workspaces

Wilson Velez14:08:12

should I ask in workspaces channel?


you can just use the :target :browser-test. don't need to use the workspaces target


{:target     :browser-test
 :ns-regexp  "-(test|cards)$"
 :output-dir "target/workspaces"
 :asset-path "workspaces"
 :runner-ns  nubank.workspaces.shadow-cljs.mount
 {:before-load nubank.workspaces.core/before-load
  :after-load  nubank.workspaces.core/after-load}}


might be enough? don't think the custom target does anything else

Wilson Velez14:08:11

ok, thanks @thheller I will give it a try