google / closure-compiler

A JavaScript checker and optimizer.
https://developers.google.com/closure/compiler/
Apache License 2.0
7.35k stars 1.14k forks source link

Properly shade com.google.code.gson:gson #3523

Open nigredo-tori opened 4 years ago

nigredo-tori commented 4 years ago

The "shaded" JAR of closure-compiler includes all the classes in com.google.gson without shading (renaming). This can lead to confusing errors far downstream - for example, I came upon this issue when sbt-dependency-check raised a NoMethodError, which turned out to be caused by my project using scala-js. I am definitely not the first one to experience this.

Is there a reason why com.google.gson is bundled rather than shaded? What is the "preferred" way to deal with such problems downstream?

concavelenz commented 4 years ago

I'm not sure, I expect it can be shaded but no one noticed. Perhaps a PR is appropriate