I'm trying to show easy to understand error to a library users about moved function. Is creating a macro with same name as the function, and throwing :cljs/analysis-error
at all a good idea?
(defn- source-info [env]
(when (:line env)
{:file (ana-api/current-file)
:line (:line env)
:column (:column env)}))
(defmacro render
[& body]
(throw (ex-info "reagent.core/render function was moved to reagent.dom namespace in Reagent v1.0"
(assoc (source-info &env) :tag :cljs/analysis-error)))
nil)
I don't think so
I think analysis errors should be reserved for compiler problems
just write a regular function, and throw a reagent error
this is how core.async deals w/ <!
etc. outside of go block