This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-20
Channels
- # adventofcode (140)
- # beginners (107)
- # boot (120)
- # boot-dev (1)
- # clara (13)
- # cljs-dev (9)
- # clojure (107)
- # clojure-argentina (5)
- # clojure-art (16)
- # clojure-dev (23)
- # clojure-greece (19)
- # clojure-italy (5)
- # clojure-russia (2)
- # clojure-serbia (3)
- # clojure-spec (27)
- # clojure-sweden (1)
- # clojure-uk (15)
- # clojurescript (134)
- # cursive (5)
- # data-science (10)
- # datomic (23)
- # duct (28)
- # fulcro (48)
- # garden (5)
- # hoplon (2)
- # instaparse (1)
- # klipse (7)
- # leiningen (8)
- # lumo (36)
- # off-topic (72)
- # om (4)
- # onyx (37)
- # perun (4)
- # re-frame (64)
- # reagent (86)
- # remote-jobs (1)
- # shadow-cljs (59)
- # spacemacs (16)
- # sql (1)
- # uncomplicate (6)
- # unrepl (90)
hmm, the reagent with-let
macro results in some externs inference warnings:
https://github.com/reagent-project/reagent/blob/master/src/reagent/ratom.clj#L48
Cannot infer target type in expression (. c__50784__auto__ -ratomGeneration)
Cannot infer target type in expression (. with-let79468 -generation)
alright, so what seems to work is your way^^ for the symbol that is bound outside of the syntax quote,
v (with-meta (gensym "with-let") {:tag 'clj})
and an inline ^clj
for the symbol that is bound within the quote
(when-some [^clj c# reagent.ratom/*ratom-context*] ...)
i am seeing some deftype- or protocol-related type hint errors that show up the first time I run a build, but not after (unless i rm -rf target
)
41 | (deftype GZIPPacker [packer]
-------^------------------------------------------------------------------------
Cannot infer target type in expression (. (. GZIPPacker -prototype) -taoensso$sente$interfaces$IPacker$)
--------------------------------------------------------------------------------
42 | taoensso.sente.interfaces/IPacker
43 | (pack [_ x]
44 | (try
45 | (->> x (pack packer) (gzip))
I see those warnings sometimes when working on shadow-cljs itself, have not figured out where they come from either
ok, so the warnings remain during reload. but if i stop the process, and then start another watch
process, the warnings are gone (until i remove the caches)
seems to happen in some even very simple cases of implementing protocols. the sente thing is probably easiest to debug/reproduce as it’s all open source. another example from my repo --
(defprotocol IExplain
(explain [this value]))
(defrecord ExplainStruct [struct-schema]
IExplain
(explain [this value] (first (struct/validate value struct-schema))))
results in
24 | (defrecord ExplainStruct [struct-schema]
-------^------------------------------------------------------------------------
Cannot infer target type in expression (. (. ExplainStruct -prototype) -my-app$lib$forms$IExplain$)
--------------------------------------------------------------------------------
25 | IExplain
26 | (explain [this value] (first (struct/validate value struct-schema))))
can you run shadow-cljs clj-repl
and then (require 'shadow.build.cljs-hacks :reload)
and compile again?
I’m confused how they warnings go away with cache since any warning should prevent the cache from being written in the first place
sente does some weird elide-require
stuff but besides that nothing that should interfere with the compile
ok so i have 1) started a shadow server, 2) started a watch process, and I see all the warnings. Then I 3) did the clj-repl
command above, and 4) edited a file to trigger the watch. Now the warnings are gone.
yeah thats behaviour I see when working on shadow-cljs
itself. just never saw it when using it as a lib.
@mhuebert found it, fixed in [email protected]
. cljs.core
was force-loaded after the hacks so it was overwriting them again.
@thheller shadow-cljs
emits an undeclared var warning for letfn
forms if the bindings are not in the right order
see https://github.com/funcool/bide/pull/16 for an example
@davidst fixed in [email protected]
.