cljs-dev

borkdude 2025-09-13T18:19:56.673149Z

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

borkdude 2025-10-04T07:31:51.836829Z

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

dnolen 2025-10-04T11:39:21.974229Z

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?

borkdude 2025-10-04T11:49:36.700969Z

👍

borkdude 2025-10-04T12:51:41.203759Z

Added code + test: https://clojure.atlassian.net/browse/CLJS-3451

dnolen 2025-10-04T13:47:22.448209Z

@borkdude https://github.com/clojure/clojurescript/pull/269 - I think you had a typo? I fixed that bit

borkdude 2025-10-04T13:47:53.465329Z

yes, typo. thanks

dnolen 2025-10-04T14:07:27.114239Z

merged

borkdude 2025-10-04T14:07:43.713219Z

thanks!

thheller 2025-09-13T18:35:39.017539Z

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

borkdude 2025-09-13T18:36:21.183439Z

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

thheller 2025-09-13T18:38:55.798319Z

oh, missed that. makes sense.