Commit Graph

907 Commits

Author SHA1 Message Date
SWC Bot
f5f293e72e chore: Publish crates 2022-10-10 00:56:50 +00:00
Austaras
657e5b3111
feat(es/minifier): Inline more lazily initialized vars (#6089) 2022-10-10 09:53:50 +09:00
SWC Bot
fe51d7aaa2 chore: Publish crates 2022-10-09 00:24:46 +00:00
Donny/강동윤
b0c57458c8
feat(es/minifier): Mark ref to fn as non-call in alias analyzer (#6088) 2022-10-09 09:21:54 +09:00
SWC Bot
818a5cc1eb chore: Publish crates 2022-10-08 04:08:55 +00:00
Donny/강동윤
d0418ebe5b
doc(es/minifier): Document assumptions (#6085) 2022-10-08 13:05:57 +09:00
SWC Bot
969c6eeeeb chore: Publish crates 2022-10-08 03:17:53 +00:00
Donny/강동윤
9ce3df091f
feat(es/minifier): Distinguish calls in alias analyzer (#6080)
**Description:**

This PR improves the alias analyzer by distinguishing call and reference, thus reducing the number of identifiers.

---

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
2022-10-08 03:15:18 +00:00
SWC Bot
3171718e07 chore: Publish crates 2022-10-07 07:48:18 +00:00
IWANABETHATGUY
8003dc8563
feat(es/codegen): Remove the trailing comma of binding patterns (#6078) 2022-10-07 16:45:20 +09:00
SWC Bot
477626b9ff chore: Publish crates 2022-10-07 05:55:53 +00:00
SWC Bot
15044a35b4 chore: Publish crates 2022-10-06 17:30:14 +00:00
Austaras
ac150c7ced
feat(es/minifier): Use usage_count in sequential inliner (#6071) 2022-10-06 17:27:34 +00:00
SWC Bot
d750f0e03c chore: Publish crates 2022-10-06 16:11:15 +00:00
SWC Bot
5f49ac012e chore: Publish crates 2022-10-06 11:38:55 +00:00
SWC Bot
9d6217f036 chore: Publish crates 2022-10-06 09:15:00 +00:00
Austaras
c9427f1ec4
fix(es/minifier): Improve infection analysis (#6044) 2022-10-06 18:12:09 +09:00
SWC Bot
07611a935c chore: Publish crates 2022-10-06 04:50:27 +00:00
Donny/강동윤
38df5978c1
fix(es/minifier): Mark delete as a property mutation (#6063)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6004.
2022-10-06 04:47:58 +00:00
SWC Bot
02a0cd37d7 chore: Publish crates 2022-10-06 02:49:43 +00:00
Donny/강동윤
d65fba134d
fix(es/minifier): Fix infection analysis of sequential inliner (#6053)
**Description:**

This PR fixes the callee issue by fixing the infection analyzer.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6047
2022-10-06 02:46:22 +00:00
SWC Bot
62dd127e3c chore: Publish crates 2022-10-06 02:13:20 +00:00
Donny/강동윤
36d467e7d7
fix(es/minifier): Fix analysis of var declaration after usage (#6043)
**Description:**

`var_initialized` should be `true` even if the declaration of variable comes after its usage.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6039.
2022-10-06 02:09:13 +00:00
SWC Bot
ad58d5daf8 chore: Publish crates 2022-10-06 01:40:03 +00:00
OJ Kwon
fff4b9ce65
build(cargo): Dedup indexmap with known version (#6060) 2022-10-06 01:36:13 +00:00
SWC Bot
f955f34afc chore: Publish crates 2022-10-05 12:25:56 +00:00
Donny/강동윤
e3b55e4bcf
fix(es/minifier): Fix optimization of numeric keys (#6052)
**Description:**

We should not optimize if the key starts with `0`.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6051.
2022-10-05 12:22:28 +00:00
SWC Bot
cad80e39c8 chore: Publish crates 2022-10-05 11:48:18 +00:00
Donny/강동윤
c5fb774487
fix(es/minifier): Don't skip unresolved identifiers (#6050)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6049
2022-10-05 11:44:51 +00:00
SWC Bot
37286e369e chore: Publish crates 2022-10-04 15:22:12 +00:00
SWC Bot
5df3eb1f43 chore: Publish crates 2022-10-04 14:37:35 +00:00
SWC Bot
676831477c chore: Publish crates 2022-10-04 12:46:12 +00:00
SWC Bot
6749e6948e chore: Publish crates 2022-10-04 07:58:11 +00:00
Donny/강동윤
197c4e269d
fix(es/minifier): Don't evaluate String.fromCharCode for non-ascii values (#6033) 2022-10-04 16:46:59 +09:00
SWC Bot
7746bfb31b chore: Publish crates 2022-10-03 09:02:17 +00:00
Austaras
c4850997a2
feat(es/minifier): Inline vars initialized before the declaration (#6027) 2022-10-03 08:58:38 +00:00
SWC Bot
8e67fcc357 chore: Publish crates 2022-10-03 07:31:41 +00:00
Donny/강동윤
877936f626
feat(es/minifier): Clone trivial literals in sequential inliner (#6005)
**Description:**

As our minifier is two-pass by default, this is enough.

At the first pass, we inline all numeric literals using sequential inliner, and minifier can then inline constants correctly in the second pass.
2022-10-03 07:20:48 +00:00
SWC Bot
d620ce60ff chore: Publish crates 2022-10-02 15:36:08 +00:00
SWC Bot
b450e3829b chore: Publish crates 2022-10-02 11:05:09 +00:00
Donny/강동윤
2b627524ac
feat(es/minifier): Ignore return values of ignored IIFEs (#6020)
**Description:**

As we are not using the return value of the function, we can call `ignore_return_value` on the argument of the return statements of IIFE.
2022-10-02 20:01:56 +09:00
Donny/강동윤
1aae503913
test(es/minifier): Organize terser tests (#6015) 2022-10-02 07:00:10 +00:00
SWC Bot
55ea637450 chore: Publish crates 2022-10-01 09:27:16 +00:00
Austaras
61807abf6e
feat(es/minifier): Inline function calls in more cases (#6010) 2022-10-01 18:18:45 +09:00
SWC Bot
b6824ff254 chore: Publish crates 2022-10-01 03:36:56 +00:00
Austaras
31ffd5a01d
fix(es/renamer): Use a separate scope for the name of FnExpr (#6008) 2022-10-01 12:33:19 +09:00
SWC Bot
628b1a8455 chore: Publish crates 2022-09-30 09:47:09 +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
SWC Bot
97c2e3bf71 chore: Publish crates 2022-09-30 08:57:12 +00:00
Donny/강동윤
2ee3ad0066
fix(es/minifier): Don't inline into nested scope (#6002)
**Related issue:**

- https://github.com/vercel/next.js/discussions/30237#discussioncomment-3768734
2022-09-30 08:53:20 +00:00