cljs-dev 2025-09-13

today I copied munge-str from cljs.core since it was private for one of my own projects. it's also used in cljs.compiler via a var indirection because it's private: https://github.com/clojure/clojurescript/blob/ddf3cfe14e71b342fbe29ff858c620752ccfc4cb/src/main/clojure/cljs/compiler.cljc#L145 Perhaps we can just make it public? It's convenient to have a version of munge that does the same thing as Clojure, i.e. not do anything related to reserved JS keywords

ping @dnolen do you agree with making munge-str public? so far I've needed this in two projects: a version of munge that doesn't do the "is this reserved in JS" thing and conforms more like the Clojure behavior

I think it's ok to make public. If you want to make a patch - perhaps adding a docstring to both munge and munge-str would be good?

yes, typo. thanks

side note: careful with using anyhing from cljs.compiler/cljs.analyzer. it brings in a whole bunch of code that cannot be removed via DCE. so best to have your own munge function that doesn't do that if thats the only thing you actually use from those namespaces

yeah I was just suggesting to make cljs.core/munge-str public - this is used in cljs.compiler via a hack, not defined there

oh, missed that. makes sense.