swc/crates/swc_ecma_transforms_base
Donny/강동윤 7985e02fc8
fix(es/minifier): Remove hack for built-in class names (#8293)
**Description:**

Regarding https://github.com/vercel/next.js/issues/55682, I made a mistake while investigating. I assumed it's `swcMinify`-only but it seems like `node-fetch` is fundamentally incompatible with our minification options.

I thought `node-fetch` works with terser, but it did not, and it **should not**. But as I thought `terser` works, I assumed that `terser` has a hack for `AbortSignal`. And that's how I fixed `swcMinify: true`. The correct fix is `keep_classnames: true` but it will result in +~10% bundle size bloat.
At first, I used the correct way (`keep_classnames: true`), but it resulted in the bundle size bloat, so I mimicked the hack of terser with https://github.com/vercel/next.js/pull/57904.

While working on other minification issues, I found that there's no such hack in `terser` and I need to remove the hack in the SWC minifier.
The repro in https://github.com/vercel/next.js/issues/55682 does not work with `swcMinify: false`, even with next@14. The problem of minifier and node-fetch was not exploited before `serverMinification: true`.


**Related issue:**

 - https://github.com/brix/crypto-js/issues/415
2023-11-16 09:17:42 +09:00
..
benches refactor(swc_node_base): Rename to swc_malloc (#8272) 2023-11-11 19:10:56 +00:00
src fix(es/minifier): Remove hack for built-in class names (#8293) 2023-11-16 09:17:42 +09:00
tests fix(es/codegen): Fix codegen of type-only imports (#8070) 2023-10-06 12:39:56 +00:00
Cargo.toml chore: Publish crates 2023-11-15 23:38:46 +00:00