This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-06
Channels
- # announcements (1)
- # beginners (147)
- # boot (9)
- # calva (28)
- # cider (3)
- # circleci (18)
- # cljdoc (54)
- # cljs-dev (55)
- # cljsrn (22)
- # clojure (179)
- # clojure-canada (9)
- # clojure-dev (74)
- # clojure-europe (1)
- # clojure-italy (15)
- # clojure-nl (7)
- # clojure-spec (30)
- # clojure-uk (55)
- # clojurescript (65)
- # core-async (15)
- # cursive (12)
- # datomic (16)
- # events (4)
- # fulcro (25)
- # graalvm (3)
- # joker (2)
- # kaocha (15)
- # keechma (94)
- # off-topic (12)
- # qlkit (2)
- # re-frame (15)
- # reagent (11)
- # reitit (29)
- # remote-jobs (15)
- # rewrite-clj (16)
- # shadow-cljs (73)
- # spacemacs (144)
- # sql (3)
- # tools-deps (11)
- # unrepl (19)
- # vim (35)
thanks @mfikes, I notice that there are a couple of PowerShell scripts, I won’t change those, but I can look at getting Windows coverage via git bash for current sh/bash shell scripts.
Is it possible to turn on *warn-on-infer*
on a project level rather then per file? I’m in the process of adapting a large project for advanced compilation, having externs inference working for entire project would be much more helpful.
I think it could be possible to hook into analyzer and selectively set *warn-on-infer*
for project namespaces
shadow-cljs does this with :infer-externs :auto
but CLJS doesn't support that by default currently
@thheller is it possible to hook this code into cljs compiler?
ok, looking into shadow’s sources then, thanks
perhaps we could get this into figwheel as well
thats basically the logic. if file
is available (ie. not source from a .jar
) then assoc :infer-warning true
cool, thanks!
@thheller I guess shadow also typehints dotted expressions with ^js
to avoid manual hinting? Where is it located in the code?
uhm yeah it does a bunch of stuff regarding externs inference overall to reduce some of the "noise"
@thheller Is it a lot of code in shadow? I’m thinking if this would be possible to have on top on cljs compiler as well
I mean I’d like to have this in a project, not in compiler itself, but as a part of build pipeline.
it is part of the compiler. I decided to simplify and use "untyped" externs inference
https://code.thheller.com/blog/shadow-cljs/2017/11/06/improved-externs-inference.html
so the externs inference in the compiler otherwise is a bit more complicated since it has to propagate type hints more thoroughly
all the code I have for this in shadow-cljs does not do this so it wouldn't work in combination with the stuff in CLJS
but really there are only a couple of points in the compiler that need to be "fixed"
just don't use shadow-cljs as a reference and dig into the actual code in the analyzer a bit
other reason for type hinting driven externs inference is for getting that info from Closure libs into ClojureScript
yeah my concern was more on the npm integration stuff where type hints won't be available anytime soon
It’s super easy to develop with SIMPLE optimizations, but so hard to switch to ADVANCED afterwards 😞
hmm not really. externs inference is already pretty good. just need to tweak a few cases where it reports false positives or things already in externs
one thing that made a big difference was importing all known properties from the closure compiler and don't warn for those
@roman01la warn on infer on the whole project would be undesirable at this point and we're not going to do what shadow does for now
@dnolen I understand. I’ve hacked global inference with :warnings
option set + a custom warnings handler. At least now I can see something.
especially when we spent a ridiculous amount of effort making this stuff better already
well it could use a couple of "fixes" still. IIRC defrecord
generates a infer warning
well that might be because externs inference isn't very useful when using CLJSJS externs and people just don't enable it