Fork me on GitHub
#shadow-cljs
<
2021-06-01
>
snurppa10:06:23

Anyway to disable/ignore unreachable code warnings when releasing? Seems it is not coming from cljs.analyzer/*cljs-warnings* as for example :warnings-as-errors true has no effect on it 🙂

thheller11:06:24

not sure, maybe :compiler-options {:closure-warnings {:unreachable-code :off}}?

snurppa13:06:54

thanks, indeed it seems so.. however when I try it, I get the following when releasing:

[:front] Compiling ...
{:type :shadow.build.closure/invalid-closure-warning, :key :check-useless-code, :level :off, :shadow.build.log/level :warn}
and the warning is still printed :thinking_face: build release config is:
:release {:compiler-options
          {:warnings-as-errors true
           :closure-warnings   {:check-useless-code :off}}}
At least the ClojureScript docs says that :check-useless-code should be available. Hmm..

snurppa13:06:02

this is with :lein true and [thheller/shadow-cljs "2.14.1"] & [org.clojure/clojurescript "1.10.866"] , i will check the sources tomorrow unless you don’t have any idea from the top of your head, thx :thumbsup:

thheller16:06:47

the docs may be out of date. the closure compiler changes the names of those things constantly.

thheller16:06:49

might just be :useless-code or :uselessCode

snurppa17:06:20

thank you, I found how you used (DiagnosticGroups/getRegisteredGroups) and found from there that it is nowadays "uselessCode" -> :useless-code

thheller11:06:12

the warning is from the closure compiler, not the cljs compiler

👍 3
haywood17:06:12

👋:skin-tone-2: anyone have experience evaluating clojurescript code in the browser within a shadow-cljs project? https://yogthos.net/posts/2015-11-12-ClojureScript-Eval.html I’m following this example but it looks like (empty-state) is missing cljs.core because when I eval (+ 1 1) I get

WARNING: Use of undeclared Var cljs.user/+ at line 1 
but when I clone the repo used in the example (which uses figwheel) it’s working, so just wondering if there is some compiler setting I might need