This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-21
Channels
- # announcements (1)
- # babashka (39)
- # beginners (91)
- # cider (9)
- # clj-kondo (10)
- # cljsrn (1)
- # clojure (54)
- # clojure-europe (45)
- # clojure-italy (2)
- # clojure-nl (1)
- # clojure-spec (39)
- # clojure-uk (21)
- # clojurescript (7)
- # core-typed (1)
- # cursive (9)
- # data-science (1)
- # datomic (2)
- # docker (3)
- # emacs (11)
- # figwheel-main (11)
- # fulcro (19)
- # java (1)
- # juxt (1)
- # kaocha (68)
- # malli (7)
- # meander (5)
- # off-topic (76)
- # pedestal (1)
- # re-frame (6)
- # reveal (1)
- # rum (2)
- # shadow-cljs (48)
- # sql (6)
- # tools-deps (47)
- # vim (8)
- # xtdb (23)
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 usually http://localhost:9630
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
Launching it from the UI I don't know where the output it or why the puppeteer windows don't appear
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
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. https://github.com/kimmobrunfeldt/chokidar-cli 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.
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
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
hi, I’m starting to play with nubank/workspaces and I set a build called cards as explained here: https://github.com/nubank/workspaces#with-shadow-cljs
{: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 nubank.workspaces.shadow-cljs.target
:ns-regexp "-(test|cards)$"
:output-dir "target/workspaces"
:asset-path "workspaces"
:preloads []}}}
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.
shadow.build.classpath/get-all-resources (classpath.clj:1225)
shadow.build.classpath/get-all-resources (classpath.clj:1223)
nubank.workspaces.shadow-cljs.target/find-namespaces-by-regexp (target.clj:10)
nubank.workspaces.shadow-cljs.target/find-namespaces-by-regexp (target.clj:9)
nubank.workspaces.shadow-cljs.target/resolve-cards-and-tests (target.clj:36)
nubank.workspaces.shadow-cljs.target/resolve-cards-and-tests (target.clj:30)
nubank.workspaces.shadow-cljs.target/process (target.clj:61)
nubank.workspaces.shadow-cljs.target/process (target.clj:53)
clojure.lang.Var.invoke (Var.java:384)
shadow.build/process-stage/fn--13688 (build.clj:162)
shadow.build/process-stage (build.clj:159)
shadow.build/process-stage (build.clj:151)
shadow.build/resolve (build.clj:407)
shadow.build/resolve (build.clj:403)
shadow.build/compile (build.clj:441)
shadow.build/compile (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 (MultiFn.java:234)
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)
java.lang.Thread.run (Thread.java:745)
@wvelezva see https://github.com/nubank/workspaces/issues/42. I thought that was fixed. maybe need a different version?
Just tried using :karma
target for the first time — it works like a charm 👍 Thank you for it!
I’m working with the lastest verstions of shadow and workspaces
should I ask in workspaces channel?
{:target :browser-test
:ns-regexp "-(test|cards)$"
:output-dir "target/workspaces"
:asset-path "workspaces"
:runner-ns nubank.workspaces.shadow-cljs.mount
:devtools
{:before-load nubank.workspaces.core/before-load
:after-load nubank.workspaces.core/after-load}}
ok, thanks @thheller I will give it a try