swc/crates/swc_ecma_minifier/tests/terser/compress/properties
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
..
accessor_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
accessor_2 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
accessor_boolean test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
accessor_get_set test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
accessor_null_undefined test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
accessor_number test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
accessor_string test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
accessor_this test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
array_hole test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
computed_property test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
const_prop_assign_pure test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
const_prop_assign_strict test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
dont_mangle_computed_property_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
dont_mangle_computed_property_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
dot_properties test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
dot_properties_es5 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
evaluate_array_length test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
evaluate_string_length test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
first_256_chars_as_properties test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
first_256_hex_chars_as_properties test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
first_256_unicode_chars_as_properties test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_869_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_869_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2208_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2208_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2208_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2208_4 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2208_5 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2208_6 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2208_7 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2208_8 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2208_9 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2256 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2321 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2513 fix(es/minifier): Remove hack for built-in class names (#8293) 2023-11-16 09:17:42 +09:00
issue_2816 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2816_ecma6 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2893_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2893_2 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2893_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2893_4 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2893_5 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2893_6 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_2893_7 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_2893_8 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
issue_3188_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_3188_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_3188_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
issue_t64 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_object_assignments_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_object_assignments_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_object_assignments_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_object_assignments_4 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
join_object_assignments_for test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_object_assignments_forin test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_object_assignments_if test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_object_assignments_Infinity test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
join_object_assignments_NaN_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
join_object_assignments_NaN_2 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
join_object_assignments_negative test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
join_object_assignments_null_0 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
join_object_assignments_null_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
join_object_assignments_regex test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
join_object_assignments_return_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_object_assignments_return_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_object_assignments_return_3 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
join_object_assignments_undefined_1 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
join_object_assignments_undefined_2 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
join_object_assignments_void_0 test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
keep_properties test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
lhs_prop_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
lhs_prop_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
literal_duplicate_key_side_effects test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
mangle_debug test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
mangle_debug_suffix test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
mangle_debug_suffix_keep_quoted test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
mangle_debug_true test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
mangle_define_property_arg test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
mangle_private_properties fix(es/renamer): Ensure that param and function body are in same scope (#7271) 2023-04-15 04:19:52 +00:00
mangle_properties test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
mangle_properties_which_matches_pattern test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
mangle_undeclared_properties test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
mangle_unquoted_properties test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
methods_keep_quoted_false test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
methods_keep_quoted_from_dead_code test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
methods_keep_quoted_true test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
native_prototype test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
native_prototype_lhs test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
new_this test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
prop_side_effects_1 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
prop_side_effects_2 test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
skip_undeclared_properties_by_default test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00
sub_properties test(es/minifier): Remove analysis snapshot (#5939) 2022-09-23 13:14:42 +09:00
unsafe_methods_regex test(es/minifier): Remove mangle-only snapshots (#5979) 2022-09-28 21:35:52 +09:00