Closed finalfantasia closed 4 months ago
@finalfantasia Hi Salam, thanks for letting me know about this.
It seems that Shadow-CLJS is warning about the use of deprecated vars, even by other deprecated vars. That seems wrong to me, especially since it seems to include warnings about a deprecated var calling itself with a different arity.
Anyway, depending on what other Taoensso libs you're using - it may be possible to eliminate the warnings with one of the following:
taoensso.elide-deprecated
JVM property to "true", orTAOENSSO_ELIDE_DEPRECATED
ENV var to "true"One easy way to do (1) is by adding a :jvm-opts ["-Dtaoensso.elide-deprecated=true"]
key to your Leiningen project.clj or equivalent.
That'll cause all deprecated Taoensso vars to be completely elided at compile-time.
Please let me know if that helps, otherwise I'll see about filing an issue against Shadow-CLJS since I suspect that the current behaviour isn't intentional.
@finalfantasia Hi Salam, thanks for letting me know about this.
It seems that Shadow-CLJS is warning about the use of deprecated vars, even by other deprecated vars. That seems wrong to me, especially since it seems to include warnings about a deprecated var calling itself with a different arity.
Anyway, depending on what other Taoensso libs you're using - it may be possible to eliminate the warnings with one of the following:
Set the
taoensso.elide-deprecated
JVM property to "true", orSet the
TAOENSSO_ELIDE_DEPRECATED
ENV var to "true"One easy way to do (1) is by adding a
:jvm-opts ["-Dtaoensso.elide-deprecated=true"]
key to your Leiningen project.clj or equivalent.That'll cause all deprecated Taoensso vars to be completely elided at compile-time.
Please let me know if that helps, otherwise I'll see about filing an issue against Shadow-CLJS since I suspect that the current behaviour isn't intentional.
Will do. Thanks for the prompt response!
Closing this issue as we were able to suppress these warnings by disabling a ClojureScript compiler flag (:fn-deprecated
) in our shadow-cljs.edn
we were able to suppress these warnings by disabling a ClojureScript compiler flag (:fn-deprecated) in our shadow-cljs.edn
Thank you @finalfantasia! 🤓
EDIT: Please see this comment below for the recommended fix.
Thanks Chris, Salam! 👍
Though just a heads-up that completely disabling deprecated var warnings might not be something you want long-term. It's easy to forget about, and could cause you to miss important warnings later.
Ideally the irrelevant warnings should be stopped upstream, Eric created a shadow-cljs issue here.
And in case there's still any bothersome Encore warnings after that (and after updating your Taoensso dependencies), you could selectively suppress any remaining warnings with the method I mentioned above.
I believe that might also be a safer choice in the meantime (while waiting for a possible shadow-cljs fix) since it's more selective.
Though just a heads-up that completely disabling deprecated var warnings might not be something you want long-term. It's easy to forget about, and could cause you to miss important warnings later.
Here is what an example shadow-cljs.edn
file might look like with the JVM option set:
{:dependencies [...]
:source-paths [...]
:jvm-opts ["-Dtaoensso.elide-deprecated=true"]
:builds
{:app {:target :browser
:output-dir "public/assets/app/js"
:asset-path "/assets/app/js"
:modules {:main {:entries [my.app]}}}}}
Re-opening until the shadow-cljs issue is fixed.
For anyone running into this in the meantime, please see here for the recommended workaround.
Sorry for the trouble!
@ptaoussanis That fix doesn't work with at least Encore 3.74.1 and Timbre 6.3.1 because the latter relies on enc/limiter
, which is deprecated.
@p-himik Thanks for the heads-up Eugene 🙏
@everyone I've just pushed Encore v3.74.2 to Clojars that just removes the deprecation metadata in the meantime until shadow-cljs can be fixed.
Again apologies for all the trouble on this.
@ptaoussanis actually it is not an issue in shadow-cljs but in clojurescript itself:
deps.edn
{:deps {org.clojure/clojurescript {:mvn/version "1.11.54"}
com.taoensso/timbre {:mvn/version "6.3.1"}
}}
src/hello_world/core.cljs
(ns hello-world.core
(:require [taoensso.timbre :as log]))
(log/info "Hello")
(println "Hello world!")
yenda@project2503:~/test-warning$ clj -M -m cljs.main -c hello-world.core
WARNING: taoensso.encore/compile-ns-filter is deprecated at line 6125 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/rate-limiter* is deprecated at line 6202 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/rate-limiter* is deprecated at line 6209 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/rate-limiter* is deprecated at line 6211 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/distinctv is deprecated at line 6266 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/-swap-val! is deprecated at line 6306 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/sub-indexes is deprecated at line 6334 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/sub-indexes is deprecated at line 6343 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/sentinel? is deprecated at line 6349 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/singleton? is deprecated at line 6352 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
@ptaoussanis could be related to this 6 years old issue that will likely never be fixed. The workaround could be to add ^:deprecation-nowarn
as mentionned in the issue https://clojure.atlassian.net/browse/CLJS-2000
@yenda Thanks for investigating Eric! I'll add the suggested workaround to the next Encore release. Much appreciated! Cheers :-)
Closing, should now be resolved with https://github.com/taoensso/timbre/releases/tag/v6.4.0.
Again, apologies for all the noise on this issue.
We updated Timbre from 6.2.1 to 6.3.1 and started seeing these deprecation warnings in our log, which, I think, are logged by Shadow-CLJS/Closure compiler. I found some articles about globally disabling these deprecation warnings at the compiler level but I'm not sure that's the right thing to do here (i.e., we would still like to keep that feature for our own deprecated functions):