cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
dominicm 2021-06-09T11:06:57.153100Z

@dnolen Where is that documented? I vaguely recalled that but couldn't see it at https://clojurescript.org/reference/compiler-options

kommen 2021-06-09T13:15:35.154600Z

@dominicm wrote about my findings regarding this a whlie ago, not sure if it is still current, but it probably is https://nextjournal.com/kommen/clojurescript-warnings-as-errors

dnolen 2021-06-09T13:17:49.155100Z

@dominicm huh I guess not yet documented ... :warning-handlers

dnolen 2021-06-09T13:18:32.155900Z

what's missing is support for this from build config - i.e. a namespaced symbol like in the other cases - that would a be good simple patch

dominicm 2021-06-09T13:30:14.156800Z

@dnolen That nextjournal article above is exactly what we ran into 😄 Could that find it's way onto the docsite somewhere, either as a guide or as part of the compiler options reference?

dnolen 2021-06-09T13:38:38.157500Z

@dominicm while that is one possible way, would prefer to fix it so a custom script is not required and doc that instead

dominicm 2021-06-09T14:33:29.158100Z

@dnolen are you thinking that a built-in warning-handler could be provided, or that the :warnings-as-errors should be implemented as well as documenting the warning handlers?

dnolen 2021-06-09T14:34:07.158700Z

there is built in warning handler - and no I'm not interested in a new thing

dnolen 2021-06-09T14:34:43.159400Z

but we could process :warning-handlers - if it's a sequence of symbols then resolve them

dnolen 2021-06-09T14:35:09.159900Z

this is done elsewhere - the goal being that you can avoid writing build scripts

dominicm 2021-06-09T14:39:18.161100Z

@dnolen oh for sure. The part of the nextjournal guide I was thinking should go into a cljs guide was the particular handler they wrote:

(fn [warning-type env extra]
     (when (warning-type cljs.analyzer/*cljs-warnings*)
      (throw
       (cljs.analyzer/error
        env
        (cljs.analyzer/error-message warning-type extra)))))
But that could be used alongside symbol resolution!

dnolen 2021-06-09T14:40:18.162Z

this is an enhancement over what I am suggesting be done first

dnolen 2021-06-09T14:40:37.162800Z

but I'm also ok w/ it as a separate ticket - i.e. some ns w/ this handler

dominicm 2021-06-09T14:40:48.163Z

It is, yep 🙂 Sorry, I'm suggesting multiple things at once around documentation.

dnolen 2021-06-09T14:46:35.164500Z

@plexus let me know what your bandwidth is for these various macroexpand to require bugs - I can tackle it in the near future if you can't get to it - mostly just checking if you are looking into it

dnolen 2021-06-09T14:46:52.164900Z

(to avoid duplication of effort)

lread 2021-06-09T17:17:07.166Z

@dominicm your convo rang a bell, I might have worked on something related eons ago in https://clojure.atlassian.net/plugins/servlet/mobile?originPath=%2Fbrowse%2FCLJS-3074#issue/CLJS-3074?

dnolen 2021-06-09T17:34:16.166300Z

@lee hey, nice!

lread 2021-06-09T17:58:21.167Z

I just barely remembered it, hope it helps!