shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
snurppa 2021-06-01T10:35:23.299600Z

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 ๐Ÿ™‚

thheller 2021-06-01T11:07:24.300Z

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

thheller 2021-06-01T11:08:12.300400Z

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

๐Ÿ‘ 1
snurppa 2021-06-01T13:18:54.300600Z

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..

snurppa 2021-06-01T13:23:02.300900Z

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:

thheller 2021-06-01T16:13:47.301300Z

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

thheller 2021-06-01T16:14:49.301500Z

might just be :useless-code or :uselessCode

haywood 2021-06-01T17:25:12.303500Z

๐Ÿ‘‹: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

snurppa 2021-06-01T17:30:20.303600Z

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

haywood 2021-06-01T17:43:48.303800Z

update, Iโ€™m reading here https://code.thheller.com/blog/shadow-cljs/2017/10/14/bootstrap-support.html

haywood 2021-06-01T22:22:53.304200Z

stealing from here https://github.com/mhuebert/shadow-bootstrap-example