This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-27
Channels
- # aleph (2)
- # announcements (7)
- # beginners (74)
- # clj-kondo (23)
- # cljdoc (3)
- # cljsrn (3)
- # clojure (42)
- # clojure-android (1)
- # clojure-uk (4)
- # clojuredesign-podcast (10)
- # clojurescript (4)
- # figwheel-main (19)
- # fulcro (19)
- # hoplon (4)
- # jobs (5)
- # juxt (8)
- # off-topic (5)
- # pathom (40)
- # perun (3)
- # shadow-cljs (56)
Hey there, been fiddling with a toy project to learn Shadow and core.async, and I'm somewhat confused by behavior. It's possibly just me not understanding how core.async works.
I'm using a third party JS library in a Node script, and outputting to a Node script. When I use that lib API with callbacks, everything works fine, but when I sub in core.async stuff things still work but Node hangs rather than exiting when the callback completes
Is that just inherent to the way that core.async works when outputting to a script rather than the browser, or am I misusing core.async in some other way?
since the browser never exits you just might be waiting for something else that keeps the node process alive
for example when using a :node-script
build with watch
the websocket connection used for the watch itself will keep the process alive
Well, I have code examples if you're up for a super-quick look. http://chiselapp.com/user/jaccarmac/repository/junkcode/artifact/932673eaa4187131: Callback-enabled, exits after printing. http://chiselapp.com/user/jaccarmac/repository/junkcode/artifact/31587b684a610646: core.async, doesn't exit after printing.
I'm using watch
but only for the compilation part (or so I thought), running the output script manually each time.
(that's not the way things are going to be permanently, was only worried about the happy path)
In the failure case I'm pulling a nil
out of the channel at the end thanks to the close, though.
Skimmed the docs and mistakenly believed that hot code reloading was only happening if I explicitly setup hooks.
Is there a way to have Shadow treat warnings as errors?
if I were dealing with CLJS directly I鈥檇 call cljs.analyzer/with-warning-handlers
but that seems to have no effect in shadow
@anmonteiro there is not but happy to add a flag or something
@thheller would love that. we鈥檇 like to treat most warnings as errors
or add a "new" key for something like :warnings-as-errors true/false
or :warnings-as-errors #{:only :these}
@thheller I like a hybrid of some of those
{:warnings {:undeclared-var :error}}
wait that doesn鈥檛 allow for the other one
I think I prefer the :warnings-as-errors true
for all and with a set for more control
> I could either add {:warnings :error}
to treat all warnings as errors
> {:warnings {:undeclared-var :error}}
to pick specific things that should be errors
actually these two are not mutually exclusive