Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings for using private vars (ClojureScript) #36

Open
immoh opened this issue Nov 12, 2018 · 5 comments
Open

Warnings for using private vars (ClojureScript) #36

immoh opened this issue Nov 12, 2018 · 5 comments

Comments

@immoh
Copy link

immoh commented Nov 12, 2018

Using [org.clojure/clojurescript "1.10.439"] will produce lot of warning about private vars:

WARNING: var: cljs.pprint/level-exceeded is not public at line 12 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/*current-level* is not public at line 12 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/*current-length* is not public at line 12 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/*current-level* is not public at line 12 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/*current-length* is not public at line 12 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/*current-level* is not public at line 12 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/start-block is not public at line 12 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/end-block is not public at line 12 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/level-exceeded is not public at line 24 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/*current-level* is not public at line 24 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/*current-length* is not public at line 24 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/*current-level* is not public at line 24 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/*current-length* is not public at line 24 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/*current-level* is not public at line 24 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/start-block is not public at line 24 target/out/pjstadig/util.cljc
WARNING: var: cljs.pprint/end-block is not public at line 24 target/out/pjstadig/util.cljc
@arichiardi
Copy link
Collaborator

Yep, ClojureScript has become stricter but these warnings are unavoidable because the lib is using hidden APIs from cljs.pprint

@nenadalm
Copy link
Contributor

nenadalm commented Oct 7, 2019

warnings could be probably removed by using var indirection as described here: https://clojurescript.org/news/2018-11-02-release#_warnings_on_private_var_use (I intend to give it a try some time after current pr gets merged).

@pjstadig
Copy link
Owner

pjstadig commented Oct 7, 2019

I've merged and released version 0.10.0.

@pesterhazy
Copy link

@pjstadig thanks for looking into this. Unfortunately, I'm still seeing the same issue with 0.10.0

[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid \(ツ)/
[Figwheel] Compiling build common:test to "target/public/719998b2-df4b-4b86-9793-3f821d281369/js/app.js"
[Figwheel:WARNING] Compile Warning   target/public/cljs-out/common:test/pjstadig/util.cljc   line:12  column:3

  var: cljs.pprint/level-exceeded is not public

   7                [pjstadig.print :as p]
   8                [cljs.test :refer [inc-report-counter! testing-vars-str testing-contexts-str get-current-env]]]))
   9    #?(:cljs (:import [goog.string StringBuffer])))
  10
  11  (defn- print-seq [aseq]
  12    (pp/pprint-logical-block
        ^---
  13     (pp/write-out (ffirst aseq))
  14     (p/rprint " ")
  15     (pp/pprint-newline :linear)
  16     ;; [pjs] this is kind of ugly, but it is a private var :(
  17     ;; always print both parts of the [k v] pair

[Figwheel:WARNING] Compile Warning   target/public/cljs-out/common:test/pjstadig/util.cljc   line:12  column:3

  var: cljs.pprint/*current-level* is not public

   7                [pjstadig.print :as p]
   8                [cljs.test :refer [inc-report-counter! testing-vars-str testing-contexts-str get-current-env]]]))
   9    #?(:cljs (:import [goog.string StringBuffer])))
  10
  11  (defn- print-seq [aseq]
  12    (pp/pprint-logical-block
        ^---
  13     (pp/write-out (ffirst aseq))
  14     (p/rprint " ")
  15     (pp/pprint-newline :linear)
  16     ;; [pjs] this is kind of ugly, but it is a private var :(
  17     ;; always print both parts of the [k v] pair

[Figwheel:WARNING] Compile Warning   target/public/cljs-out/common:test/pjstadig/util.cljc   line:12  column:3

  var: cljs.pprint/*current-length* is not public

   7                [pjstadig.print :as p]
   8                [cljs.test :refer [inc-report-counter! testing-vars-str testing-contexts-str get-current-env]]]))
   9    #?(:cljs (:import [goog.string StringBuffer])))
  10
  11  (defn- print-seq [aseq]
  12    (pp/pprint-logical-block
        ^---
  13     (pp/write-out (ffirst aseq))
  14     (p/rprint " ")
  15     (pp/pprint-newline :linear)
  16     ;; [pjs] this is kind of ugly, but it is a private var :(
  17     ;; always print both parts of the [k v] pair

[Figwheel:WARNING] Compile Warning: var: cljs.pprint/*current-level* is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:12  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/*current-length* is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:12  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/*current-level* is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:12  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/start-block is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:12  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/end-block is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:12  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/level-exceeded is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:24  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/*current-level* is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:24  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/*current-length* is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:24  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/*current-level* is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:24  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/*current-length* is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:24  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/*current-level* is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:24  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/start-block is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:24  column:3
[Figwheel:WARNING] Compile Warning: var: cljs.pprint/end-block is not public  target/public/cljs-out/common:test/pjstadig/util.cljc   line:24  column:3

From figwheel.main's deps.edn

                              pjstadig/humane-test-output {:mvn/version "0.10.0"}

@nenadalm
Copy link
Contributor

@pesterhazy I don't think that warnings were removed yet. It waits till somebody sends PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants