I have noticed that Scala.JS preserves case class names in the generated JS code.
This is not ideal for 2 reasons:
It exposes the internal implementation details of the project.
It inflates the bundle size somewhat.
Could case class names get renamed to the same name that is used by the Closure compiler? Could an exception be thrown when .toString is called instead?
You could preprocess the IR before it reaches the linker. You can do that by passing the Compile / scalaJSIR setting through whatever filter you’d like.