swc/crates/swc_ecma_minifier/tests
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-full feat(es/minifier): Swap bin expr to save paren (#8277) 2023-11-14 16:45:24 +00:00
fixture fix(es/minifier): Remove hack for built-in class names (#8293) 2023-11-16 09:17:42 +09:00
full fix(es/minifier): Remove hack for built-in class names (#8293) 2023-11-16 09:17:42 +09:00
mangle fix(es/codegen): Remove extra spaces in AssignPatProp and KeyValuePatProp (#7488) 2023-06-07 05:08:35 +00:00
pass-1 feat(es/minifier): Swap bin expr to save paren (#8277) 2023-11-14 16:45:24 +00:00
pass-default feat(es/minifier): Implement trivial optimizations (#6256) 2022-11-02 01:21:32 +00:00
projects build(cargo): Update rustc to nightly-2023-11-04 (#8221) 2023-11-04 21:47:10 +00:00
terser/compress fix(es/minifier): Remove hack for built-in class names (#8293) 2023-11-16 09:17:42 +09:00
compress.rs refactor(swc_node_base): Rename to swc_malloc (#8272) 2023-11-11 19:10:56 +00:00
eval.rs perf(es/ast): Shrink size of Expr (#7041) 2023-03-09 13:34:11 +00:00
exec.rs refactor(swc_node_base): Rename to swc_malloc (#8272) 2023-11-11 19:10:56 +00:00
format.rs feat(es/minifier): Support format.inline_script (#8252) 2023-11-14 21:37:05 +00:00
mangle.rs feat(es/codegen): Add an option to print assert for import attributes (#7914) 2023-09-05 21:24:25 +09:00
passing.txt feat(es/minifier): Respect inline level and preserve native names (#8205) 2023-11-02 08:59:59 +09:00
postponed.txt fix(es/minifier): Abort seq inliner if b can short-circuit (#8128) 2023-10-18 03:44:36 +00:00
terser_exec_base.js refactor(es/minifier): Make rust-analyzer fast, really (#4746) 2022-05-23 16:16:05 +09:00
terser_exec.rs refactor(swc_node_base): Rename to swc_malloc (#8272) 2023-11-11 19:10:56 +00:00
TODO.txt feat(es/minifier): Respect inline level and preserve native names (#8205) 2023-11-02 08:59:59 +09:00