Fork me on GitHub
#cljs-dev
<
2021-06-09
>
dominicm11:06:57

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

kommen13:06:35

@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

dnolen13:06:49

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

dnolen13:06:32

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

dominicm13:06:14

@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?

dnolen13:06:38

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

dominicm14:06:29

@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?

dnolen14:06:07

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

dnolen14:06:43

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

dnolen14:06:09

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

dominicm14:06:18

@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!

dnolen14:06:18

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

dnolen14:06:37

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

dominicm14:06:48

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

dnolen14:06:35

@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

dnolen14:06:52

(to avoid duplication of effort)

lread17:06:21

I just barely remembered it, hope it helps!