I've lost count of how many times I've broken production because of ClojureScript's advanced compilation and use of the dot + dash (.-) JS property access operator.

My advice: Never use .-

#clojurescript

TIL: It seems that ^js metadata has a _global_ effect. This might bite you if you remove ^js from one function; things might break somewhere else
We've been recently using the js-interop library (https://github.com/applied-science/js-interop) but our codebase has a lot of `.-` property access still in use from the past. And we're slowly migrating away from those...
GitHub - applied-science/js-interop: A JavaScript-interop library for ClojureScript.

A JavaScript-interop library for ClojureScript. Contribute to applied-science/js-interop development by creating an account on GitHub.

GitHub
@rap1ds Ugh, now that you mention it, it seems obvious, but oh dear.

@Ardubal Yeah indeed, kinda obvious but at the same time unusual.

What I don't know is if there's order dependency, I mean, what happens if the compiler compiles `my-fn-2` first? Will it mangle `.-something`? Or is there separate analysis phase where the compiler first checks which names should not be mangled? 🤷

@rap1ds As far as I know, ClojureScript does more or less the same as Clojure: compile each toplevel form separately in the order given.
@rap1ds Weird.  I can't remember if I've ever bumped into this. But then again I don't use it that much (e.g., 31 instances in 16137 lines of code). Shadow-CLJS + advanced here. Maybe there's some difference in approach.