-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle Internal Class renames #6
Comments
Don't the tools like terser or uglifyes support internal classes renaming? |
@artfiedler Or I misunderstood something? Can you please elaborate a bit please? P.S: thanks for good testing the transformer. Good to know that someone else uses it as well 😂 |
@artfiedler can you provide repo with repro of this issue? It looks weird and I don't think that we need to discuss how to minify JS properly - we need to start from TypeScript first IMO. We use this transformer in https://github.com/tradingview/lightweight-charts with rollup and terser to minify JS and it seems that no exceeded class names in the bundle:
I just don't understand what generates |
Nothing "generates" the internal api object other than the programmer programs a class to define the exposed api. I'm not really going to go and build a fake project just to do exactly what that sample up above does... Basically what happens is all the private module code gets placed inside a closure so it can mediate the access to the exposed api. Maybe rollup does something similar for you, but I don't use rollup, so I don't know... there seems to be a new module type or packager system every 6 months so I don't keep following the edge and stick with what I know and works ... lol |
I'm sorry, but without that example it'd be hard to "fix" this issue. I understand your concern, without additional information and samples (which I use as test cases to pin the behavior) it might be impossible to get correct what are you proposing here. And actually, it looks like the issue due transpiling rather than JS itself (which we trying to solve in this transformer). If you change output form es5 to es6+ you'll get other output, which might be handled by minifier correctly (but as I said - we can't check it without repro). |
I'll try and get you a small sample, but keep in mind javascript compiles as typescript ;) |
It would be nice if this transformer could also determine internal class names via the entry points and mangle them, if mangling like terser is not feasible then possibly just map class names and the export.classname to a prefixed random set of characters, like cl$AZa
The text was updated successfully, but these errors were encountered: