This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-01
Channels
- # aleph (71)
- # aws (1)
- # bangalore-clj (4)
- # beginners (36)
- # boot (153)
- # cider (23)
- # clara (9)
- # cljs-dev (67)
- # cljsjs (2)
- # cljsrn (22)
- # clojure (348)
- # clojure-argentina (4)
- # clojure-austin (12)
- # clojure-berlin (9)
- # clojure-dusseldorf (6)
- # clojure-france (4)
- # clojure-italy (4)
- # clojure-russia (358)
- # clojure-spain (2)
- # clojure-spec (28)
- # clojure-uk (109)
- # clojurescript (130)
- # core-typed (1)
- # cursive (35)
- # datascript (6)
- # datomic (18)
- # emacs (12)
- # hoplon (4)
- # klipse (64)
- # lein-figwheel (13)
- # leiningen (3)
- # luminus (4)
- # lumo (51)
- # mount (22)
- # off-topic (83)
- # om (22)
- # om-next (8)
- # onyx (3)
- # pedestal (8)
- # perun (6)
- # portland-or (2)
- # re-frame (50)
- # ring (8)
- # ring-swagger (5)
- # untangled (10)
- # yada (9)
WARNING: Use of undeclared Var schema.core/RegExp at line 356 /home/juho/.boot/cache/tmp/home/juho/Source/***/***/4i8/-uc8bn7/js/main.out/schema/core.cljs
WARNING: Use of undeclared Var bidi.bidi/RegExp at line 232 /home/juho/.boot/cache/tmp/home/juho/Source/***/***/4i8/-uc8bn7/js/main.out/bidi/bidi.cljc
This was with :advanced
build
And second run also reproduced this
I'll hope this is consistent and try bisecting the cause
332 is good and 333 bad: https://github.com/clojure/clojurescript/commit/d961e66edfd3d62f80bed18418c597ee1f569e85
makes sense, as the error from Schema is related to extend-protocol
@juhoteperi that does seem like a Schema bug to me
@juhoteperi linking to the source code of bidi and schema here would be useful.
https://github.com/juxt/bidi/blob/master/src/bidi/bidi.cljc#L230 https://github.com/plumatic/schema/blob/master/src/cljx/schema/core.cljx#L355
interestingly bidi has another extend-protocol
related to js/RegExp
that doesn't cause warning: https://github.com/juxt/bidi/blob/master/src/bidi/bidi.cljc#L99
@juhoteperi huh - ok so that seems we can easily make a minimal case
in Schema case all methods take 1 arg, in bidi 2
Also, I can still only reproduce this when doing :advanced
build
Didn't try making standalone test project yet, but I tried to make test case to cljs.compiler-tests
, but didn't succeed reproducing problem there
@juhoteperi I think under advanced there may be cases where we try to resolve type hints
Ah, :static-fns true
seems to cause this!
that defaults to true with :advanced
(let [cenv (env/default-compiler-env {:static-fns true})]
(binding [ana/*unchecked-if* false]
(capture-warnings
(env/with-compiler-env cenv
(comp/emit
(ana/analyze
aenv
'(do (defprotocol Foo
(spec [this]))
(extend-protocol Foo
js/RegExp
(spec [this] true)))))))))
Should something like this work? Currently I see lots of warnings: WARNING: Use of undeclared Var cljs.core/not at line 229@juhoteperi you need to analyze with cljs.compiler/with-core
macro
Okay. No warnings now.
(defprotocol X
(x [x]))
(defprotocol Y
(y [y]))
(extend-protocol X
js/RegExp
(x [x]
(y x)))
(extend-protocol Y
js/RegExp
(y [y]
:y))
(defprotocol X
(x [x]))
(defprotocol Y
(y [y]))
(extend-type js/RegExp
X
(x [this]
(y this)) ;; << warning here
Y
(y [this]
:y))
Yep, I can reproduce the warning with that code on real project
[[:undeclared-var "WARNING: Use of undeclared Var cljs.user/RegExp at line 244 "]]
Now I got the test case to generate the warning
And attached patch with a test case
which is broken.. oops (fixed now)
@juhoteperi sweet!
@anmonteiro merged your package.json patch - thanks
👍 awesome
We should make a note to update the guide when the next version is released
Since JSONStream is no longer required
I'm fixing CLJS-1925 now
it's the consequence of something I didn't fix correctly a while ago
@anmonteiro When you mentioned using React from Npm, did you refer to node_modules/react/react.js
or node_modules/react/dist/react.js
Hmm, the JavaScript modules guide at least uses just require("react")
@juhoteperi https://github.com/anmonteiro/om/commit/686921531c7bcbbd75804e6b9240b12d92eaaa5f
I'm testing packaging npm files as jars
ah, the problem is that I eagerly package fbjs
and other dependencies, that are not really needed for browser use
Currently process-js-modules
tries to process all the files defined in foreign-libs
I wonder if it would be possible to only process required files
Now I need to be careful to only package files that can be processed by Closure
@juhoteperi I’m pretty sure it doesn’t do that? I thought only if :module-type
is set
Yes, I meant foreign-libs with module-type set
another possibility is looking into dependency_mode=STRICT
feature of Closure Compiler
just attached a patch to http://dev.clojure.org/jira/browse/CLJS-1925
@dnolen the issue was caused by an improper fix to CLJS-1607 (previous patch of mine) which is now fixed in the patch I just attached