swc-project / swc

Rust-based platform for the Web
https://swc.rs
Apache License 2.0
31.14k stars 1.23k forks source link

Support Mangle Properties cache #5386

Closed dispalt closed 5 months ago

dispalt commented 2 years ago

Describe the feature

So esbuild implements something for this: https://esbuild.github.io/api/#mangle-cache its basically to make mangle properties worth it by persisting over multiple files. Webpack via terserPlugin does the same with nameCache any chance we could get something like that in swc?

I like the way esbuild does it, it's subtle but you keep feeding it the same map and it grows. Obviously you can't use this feature and run files in parallel.

Babel plugin or link to the feature description

No response

Additional context

No response

dispalt commented 1 year ago

Do you think you'll get to this, I guess I could take a crack at it...

kdy1 commented 1 year ago

It would be nice if you work on it, but I'm not sure about the API

kdy1 commented 1 year ago

Basically name mangler works in parallel, even for a single file

dispalt commented 1 year ago

Hmm, yeah that is a problem, but it must keep track of the renames successfully within a single file, right? Otherwise I would imagine it wouldn't work...

kdy1 commented 1 year ago

Yes

swc-bot commented 4 months ago

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

kdy1 commented 2 months ago

I'll work on this