Commit Graph

57 Commits

Author SHA1 Message Date
Donny/강동윤
6be1f7075d
fix(es/minifier): Fix a bug about eval of name mangler (#7615)
**Description:**

 - Repro: https://github.com/avitorio/swcminify-debug


**Related issue:**

 - https://github.com/vercel/next.js/discussions/30237#discussioncomment-6288339
2023-07-18 01:09:00 +00:00
Donny/강동윤
336b1d8b4d
fix(es/minifier): Don't inline conditionally initialized vars (#6751)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6750.
 - Closes https://github.com/swc-project/swc/issues/6780.
2023-01-11 06:01:56 +00:00
Donny/강동윤
655f6744c5
fix(es/minifier): Fix infinite loop (#6300)
**Related issue:**

 - https://github.com/vercel/next.js/issues/42171.
2022-11-01 16:32:52 +00:00
Donny/강동윤
cc848db80e
feat(es/minifier): Mark more expressions as pure (#6204) 2022-10-20 05:06:32 +00:00
Donny/강동윤
286334c4d0
feat(es/minifier): Drop vars from sequential inliner (#5993)
**Description:**

This PR renames `CloningMultiReplacer` to `Finalizer` and makes it handle the removal of unused variables. Also, this PR improves the sequential inliner so we can drop variables within a single pass.
2022-09-30 09:43:31 +00:00
Donny/강동윤
0cfc724018
test(es/minifier): Add tests for benchmark files (#5986) 2022-09-29 09:41:13 +09:00
Donny/강동윤
9d1974248d
fix(es/minifier): Fix skipping logic of sequential inliner (#5956)
**Description:**

This PR implements `is_skippable_for_seq` fully.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5935.
2022-09-26 15:05:52 +00:00
Donny/강동윤
93964a82ea
test(es/minifier): Remove analysis snapshot (#5939)
**Description:**

This PR removes analysis snapshots as it disturbs code review process
2022-09-23 13:14:42 +09:00
Donny/강동윤
e303f7e853
fix(es/minifier): Fix analysis of assignments (#5924)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5910
2022-09-21 11:33:25 +00:00
Donny/강동윤
0bbcfe15ee
test(es/minifier): Add a test for a fixed issue (#5897) 2022-09-19 17:25:49 +09:00
Donny/강동윤
32a73fbf22
fix(es/minifier): Fix calculation of character frequency (#5772) 2022-09-07 04:46:21 +00:00
Donny/강동윤
9d29abcd5b
chore(es/minifier): Fix size calculator script (#5767) 2022-09-06 22:23:57 +09:00
Donny/강동윤
60ce462215
feat(es/minifier): Align name mangler with terser (#5763) 2022-09-06 21:37:58 +09:00
Donny/강동윤
8827c38faf
feat(es/minifier): Make DCE single-pass (#5699) 2022-09-01 16:30:21 +00:00
Donny/강동윤
a06e6e9ce5
fix(es/minifier): Fix alias analyzer (#5639) 2022-08-26 10:06:25 +00:00
Donny/강동윤
d44bbffa02
fix(es/minifier): Revert alias analyzer work (#5634) 2022-08-26 08:45:49 +00:00
Donny/강동윤
00e635b9ea
fix(es/minifier): Improve alias analyzer (#5500) 2022-08-26 07:56:40 +00:00
Donny/강동윤
d81fe67e4b
feat(es/minifier): Improve gzipped size (#5631) 2022-08-26 05:23:01 +00:00
Donny/강동윤
a46669d334
test(es/minifier): Add snapshots of compressed libraries (#5389) 2022-08-04 08:32:59 +00:00
Donny/강동윤
84a1ef856a
test(es/minifier): Update the golden list (#5378) 2022-08-03 21:17:47 +09:00
Donny/강동윤
6552d1a6f7
perf(es/minifier): Make postcompress pass parallel (#5374) 2022-08-03 06:20:04 +00:00
Donny/강동윤
4fdbe40c74
feat(es/minifier): Remove duplicate var declarations (#5373) 2022-08-03 13:05:56 +09:00
Donny/강동윤
64a99461ec
fix(es/minifier): Change default es version to es5 (#5333) 2022-07-29 02:40:14 +00:00
Donny/강동윤
96cec97b2c
fix(es/minifier): Don't inline a function if we need referential equality (#4665) 2022-05-15 09:37:34 +00:00
Donny/강동윤
e43689b7d5
fix(es/minifier): Preserve more identifiers if eval or with exists (#4580) 2022-05-09 07:17:33 +00:00
Donny/강동윤
a6d404a8c2
chore(repo): Configure prettier (#4523) 2022-05-04 14:25:28 +00:00
Donny/강동윤
50b20496cd
refactor(es/minifier): Cleanup (#4489) 2022-04-30 07:00:21 +00:00
Donny/강동윤
effc85df57
fix(es/minifier): Disable some passes for hoist_props (#4468) 2022-04-28 08:32:03 +00:00
Donny/강동윤
c45b0df877
chore(es/minifier): Update debugging utils (#4467) 2022-04-28 05:19:08 +00:00
Donny/강동윤
aa19b65f9c
fix(es/minifier): Don't drop arguments to an IIFE without body (#4419) 2022-04-24 15:27:51 +00:00
Donny/강동윤
9b34ecfd2e
test(es/minifier): Categorize tests (#4410) 2022-04-24 12:11:02 +00:00
Donny/강동윤
ab88637937
test(es/minifier): Split tests into improvement and stabilization (#4409) 2022-04-23 13:40:28 +00:00
Donny/강동윤
4c9e5c01ef
perf(es/minifier): Add some fast-path to the MultiReplacer (#4408) 2022-04-23 19:53:21 +09:00
Donny/강동윤
efdf93d910
chore(es/minifier): Add a script to instrument real-world inputs (#4399) 2022-04-22 10:37:04 +00:00
Donny/강동윤
375cc5975a
fix(es/minifier): Disable conditionals by default (#4391) 2022-04-22 10:44:53 +09:00
Donny/강동윤
922299a490
fix(es/minifier): Don't drop labels if required (#4370) 2022-04-20 13:34:21 +00:00
Donny/강동윤
4a8b1dad1d
test(es/minifier): Organize tests (#4375) 2022-04-20 15:52:03 +09:00
Donny/강동윤
4b1590e72f
fix(es/minifier): Apply name mangler even more (#4368) 2022-04-19 09:14:15 +00:00
Donny/강동윤
2563c7f8ff
chore(es/minifier): Improve scripts (#4339) 2022-04-17 19:53:47 +09:00
Donny/강동윤
14c74f50c0
chore(es/minifier): Organize scripts (#4347) 2022-04-17 10:16:40 +00:00
Austaras
df0d572b4f
chore(es/minifier): Update terser test references (#4297) 2022-04-10 06:50:52 +00:00
Donny/강동윤
c961371c31
fix(es/minifier): Fix handling of eval (#4273) 2022-04-08 08:56:28 +00:00
Donny/강동윤
86072b57f9
test(es/minifier): Prepare porting more rules from terser (#3779) 2022-02-28 13:49:10 +00:00
Donny/강동윤
ac1d4058f2
fix(es/minifier): Fix analyzer (#3557)
swc_ecma_utils:
 - `collect_decls`: Support paramters of arrow expressions.

swc_ecma_minifier:
 - `analyzer`: Fix `has_property_mutation`.
2022-02-14 15:47:16 +09:00
Donny/강동윤
a7f0e84bbf
feat(es/minifier): Drop useless assignments (#3528)
testing:
 - Allow skipping diff using an environment variable `DIFF`.

swc_ecma_minifier:
 - `pure`: Drop useless assignemnts.
2022-02-11 08:43:48 +00:00
Donny/강동윤
8dab3d92b1
perf(es/minifier): Remove useless operations like eager call to .span() (#3512)
swc_ecma_minifier:
 - Merge variable for inlining.
 - Remove useless call to `.span()`.
2022-02-10 12:00:41 +00:00
Donny/강동윤
57204e39cd
fix(es/minifier): Don't inline functions used as arguments (#3320)
swc_ecma_minifier:
 - Preserve a variable initialized with a function expression if it's used as an argument.
2022-01-20 16:06:23 +09:00
Donny/강동윤
74fd353053
fix(es/minifier): Fix bugs (#3238)
swc_ecma_minifier:
 - `collapse_vars`: Respect `mutated`. (Closes #2679)
 - Add a test for https://github.com/vercel/next.js/issues/31084.
2022-01-12 16:57:54 +09:00
Donny/강동윤
12dd0a6c1f
fix(es/minifier): Fix optimization of assignment expressions (#3231)
swc_ecma_minifier:
 - Check if the operator is `=` before optimizing assignment with a binary expression.
2022-01-12 08:26:56 +09:00
Donny/강동윤
78720c4c91
fix(es/minifier): Fix handling of inlined call to a hoisted function (#3223) 2022-01-11 19:37:06 +09:00