Commit Graph

463 Commits

Author SHA1 Message Date
Donny/강동윤
af1d19554f
feat(dbg-swc): Add command to compare minifier (#4653) 2022-05-13 09:13:23 +00:00
Donny/강동윤
b393773373
feat(debug): Inline dbg-swc (#4651) 2022-05-13 06:05:21 +00:00
Donny/강동윤
9c190f0a8e
fix(es/minifier): Fix optimization of spread (#4639) 2022-05-12 09:20:44 +00:00
Donny/강동윤
79f87e03db
test(es/minifier): Execute more tests (#4636) 2022-05-12 16:28:52 +09:00
SWC Bot
cb5ca547aa chore: Publish crates 2022-05-12 15:14:28 +09:00
Donny/강동윤
56a227ad9d fix(es/minifier): Don't create direct eval (#4634)
- `expr_simplifier`: Preserve `this`.
 - `ExprReplacer`: Inject `0` after inlining eval.
 - `MultiReplacer`: Inject `0` after inlining eval.
2022-05-12 15:14:18 +09:00
SWC Bot
97808349a2 chore: Publish crates 2022-05-11 16:17:07 +00:00
SWC Bot
90569d4673 chore: Publish crates 2022-05-11 04:38:52 +00:00
Donny/강동윤
6a97c7bef8
fix(es/utils): Fix wrong apis (#4604)
# API Changes

## `swc_ecma_utils`

### Renames

 - `find_ids` => `find_pat_ids`
 - `prepend` => `prepend_stmt`
 - `as_bool` => `cast_to_bool`
 - `as_number` => `as_pure_number`
 - `as_string` => `cast_to_string`
 - (`as_pure_bool`, `cast_to_number` is not renamed)
 - `UsageFinder` => `IdentUsageFinder`.
 - `IdentFinder` => `IdentRefFinder`.

## Changes

 - Re-export of `HANDLER` from `swc_common::errors` is removed. Use `swc_common::error::HANDLER` instead.
 - Re-export of `Id` from `swc_ecma_ast` is removed. Use `swc_ecma_ast::Id` instead.
 - `ExprCtx` is used for apis related to `Expr`.
 - `preserve_effects` is now a method of `ExprCtx`. It was a top-level function.
 - `extract_side_effects_to` is now a method of `ExprCtx`. It was a top-level function.
 - `IdentUsageFinder` (previously `UsageFinder`) now takes `Id` instead of `Ident`.
 - `IdentRefFinder` (previously `IdentFinder`) now takes `Id` instead of `Ident`.
 - `ExprExt::is_ident_ref_to` is removed.
 - `Expr::is_global_ref_to` is added.
 - `:🆔:id` is removed. Use `Ident::to_id()` instead.
2022-05-11 04:36:22 +00:00
Donny/강동윤
2c861bd9e5
feat(es/ast): Improve Id APIs (#4614)
# API Changes

 - `Ident` now has `to_id()`. This method is added to allow removing an import.
2022-05-11 12:02:14 +09:00
Donny/강동윤
6918e3a4fb
test(es/minifier): Postpone tests which can be verified by execution tests (#4600) 2022-05-10 14:47:37 +09:00
Donny/강동윤
859dc440b4
fix(es/minifier): Preserve more this (#4599) 2022-05-10 05:20:36 +00:00
Donny/강동윤
d611d543ea
fix(es/fixer): Handle new yield (#4598) 2022-05-10 04:17:11 +00:00
SWC Bot
e52c06fe0d chore: Publish crates 2022-05-10 03:57:45 +00:00
Donny/강동윤
8944a3bdf5
fix(es/minifier): Fix switch with a unknown case (#4597) 2022-05-10 03:55:34 +00:00
SWC Bot
20a7304267 chore: Publish crates 2022-05-10 03:24:33 +00:00
Donny/강동윤
097ff1ddc1
fix(es/minifier): Fix with and NaN (#4596) 2022-05-10 03:21:43 +00:00
Donny/강동윤
2ab7594b4a
fix(es/minifier): Fix switches (#4595) 2022-05-09 21:36:09 +00:00
Donny/강동윤
dd09cdf8b1
fix(es/minifier): Fix handling of NaN (#4593) 2022-05-09 19:08:28 +00:00
SWC Bot
ba406f6120 chore: Publish crates 2022-05-09 16:38:56 +00:00
Donny/강동윤
3521ce09e7
fix(es/minifier): Consider more aliases in sequences pass (#4583) 2022-05-09 16:36:40 +00:00
SWC Bot
51d7078175 chore: Publish crates 2022-05-09 11:27:12 +00:00
Donny/강동윤
8db3442216
fix(es/minifier): Unwrap blocks more carefully (#4586) 2022-05-09 11:24:53 +00:00
SWC Bot
6833bb9c6d chore: Publish crates 2022-05-09 09:17:37 +00:00
Donny/강동윤
7e80c10cba
fix(es/minifier): Don't create an invalid labeled statement (#4581) 2022-05-09 09:15:12 +00:00
Donny/강동윤
56c3010f6b
fix(es/resolver): Fix more try catch issues (#4582) 2022-05-09 17:50:30 +09:00
SWC Bot
d9f168687d chore: Publish crates 2022-05-09 07:19:45 +00:00
Donny/강동윤
e43689b7d5
fix(es/minifier): Preserve more identifiers if eval or with exists (#4580) 2022-05-09 07:17:33 +00:00
SWC Bot
c070b43e5d chore: Publish crates 2022-05-09 05:45:55 +00:00
Donny/강동윤
7fc9bbccd9
feat(config): Make all configuration overridable (#4575) 2022-05-09 05:38:27 +00:00
Donny/강동윤
9e79f9ced6
fix(es/resolver): Fix handling of a complex try catch (#4574) 2022-05-08 10:12:50 +00:00
Donny/강동윤
bf5ee018b3
test(es/minifier): Fix test system (#4571) 2022-05-08 08:27:14 +00:00
SWC Bot
b6136f80e4 chore: Publish crates 2022-05-08 06:15:23 +00:00
Donny/강동윤
af368eead2
fix(es/minifier): Improve sequential inliner (#4570) 2022-05-08 06:12:42 +00:00
SWC Bot
0e26fa41da chore: Publish crates 2022-05-08 04:14:16 +00:00
Austaras
b3b6fd448c
feat(es/minifier): Remove duplicate control flow in nested blocks (#4569) 2022-05-08 13:07:58 +09:00
SWC Bot
f570220ac6 chore: Publish crates 2022-05-07 16:59:41 +00:00
Donny/강동윤
920d9a7678
fix(es/minifier): Fix handling of template literals (#4563) 2022-05-08 01:56:38 +09:00
SWC Bot
20ce370049 chore: Publish crates 2022-05-07 10:13:28 +00:00
Donny/강동윤
f9b6016d4b
fix(es/minifier): Distinguish raw and cooked while joining template literals (#4559) 2022-05-07 10:10:50 +00:00
SWC Bot
947b1b1232 chore: Publish crates 2022-05-07 08:24:51 +00:00
Donny/강동윤
c5b4ef4377
feat(es/minifier): Drop vars using sequential inliner (#4547) 2022-05-07 08:19:56 +00:00
SWC Bot
ec3624c856 chore: Publish crates 2022-05-07 07:25:42 +00:00
Austaras
5d3a01ad35
fix(es/minifier): Skip getter/setter when collapsing vars (#4557) 2022-05-07 16:23:13 +09:00
Donny/강동윤
b0efd00f38
test(es/minifier): Ignore difference of parens (#4546) 2022-05-07 06:08:23 +00:00
SWC Bot
f552c1c11d chore: Publish crates 2022-05-06 05:20:01 +00:00
Kristján Oddsson
3d5d234047
fix(es/minifier): Respect keepClassNames for class expressions (#4536)
Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com>
2022-05-06 05:17:45 +00:00
Donny/강동윤
3d3e3bb1d2
test(es/minifier): Categorize more tests (#4538) 2022-05-06 13:54:32 +09:00
SWC Bot
e4ce388632 chore: Publish crates 2022-05-06 04:10:39 +00:00
Donny/강동윤
a6d404a8c2
chore(repo): Configure prettier (#4523) 2022-05-04 14:25:28 +00:00