Giter Club home page Giter Club logo

Comments (13)

ptaoussanis avatar ptaoussanis commented on June 4, 2024 2

@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:

  1. Set the taoensso.elide-deprecated JVM property to "true", or
  2. Set 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.

from timbre.

oakmac avatar oakmac commented on June 4, 2024 2

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.

from timbre.

ptaoussanis avatar ptaoussanis commented on June 4, 2024 2

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.

from timbre.

oakmac avatar oakmac commented on June 4, 2024 2

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]}}}}}

from timbre.

ptaoussanis avatar ptaoussanis commented on June 4, 2024 2

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.

from timbre.

yenda avatar yenda commented on June 4, 2024 1

@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

from timbre.

finalfantasia avatar finalfantasia commented on June 4, 2024

@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:

  1. Set the taoensso.elide-deprecated JVM property to "true", or

  2. Set 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!

from timbre.

finalfantasia avatar finalfantasia commented on June 4, 2024

Closing this issue as we were able to suppress these warnings by disabling a ClojureScript compiler flag (:fn-deprecated) in our shadow-cljs.edn

from timbre.

ptaoussanis avatar ptaoussanis commented on June 4, 2024

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!

from timbre.

p-himik avatar p-himik commented on June 4, 2024

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

from timbre.

ptaoussanis avatar ptaoussanis commented on June 4, 2024

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

from timbre.

yenda avatar yenda commented on June 4, 2024

@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

from timbre.

ptaoussanis avatar ptaoussanis commented on June 4, 2024

@yenda Thanks for investigating Eric! I'll add the suggested workaround to the next Encore release. Much appreciated! Cheers :-)

from timbre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.