Commit Graph

875 Commits

Author SHA1 Message Date
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
Donny/강동윤
10fb645552
chore(ci): Merge CI scripts (#5999)
**Description:**

This PR merges CI scripts, and make integration tests use patched crates.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5540.
2022-09-30 16:57:15 +09:00
SWC Bot
2f626e95eb chore: Publish crates 2022-09-30 07:16:28 +00:00
OJ Kwon
af64217f19
build(cargo): Introduce workspace deps (#5997) 2022-09-30 13:43:32 +09:00
SWC Bot
447e2449d9 chore: Publish crates 2022-09-29 11:06:36 +00:00
Donny/강동윤
aeb7f300a8
feat(es/minifier): Invoke sequential inliner for inlined IIFEs (#5991)
**Description:**

Inlined IIFEs have the exact pattern sequential inliner wants, so it's good to invoke it.
2022-09-29 11:03:06 +00:00
SWC Bot
da7ced9de1 chore: Publish crates 2022-09-29 10:20:18 +00:00
Donny/강동윤
f8358fbe2b
fix(es/minifier): Remove wrong variable joiner pass (#5992)
**Description:**

We had two passes for joining variables. This PR removes one in the full optimizer, which is wrong.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5989.
2022-09-29 19:11:18 +09:00
Donny/강동윤
48b83fb69d chore: Publish crates 2022-09-29 15:50:48 +09:00
Donny/강동윤
af8236d689 fix(es/minifier): Remove print 2022-09-29 15:50:21 +09:00
SWC Bot
f86ff4fa7c chore: Publish crates 2022-09-29 05:19:48 +00:00
Austaras
1a11cfd46f
feat(es/minifier): Improve fn-local analysis for better inlining (#5955) 2022-09-29 14:16:28 +09:00
SWC Bot
18123fb7b0 chore: Publish crates 2022-09-29 02:19:57 +00:00
Donny/강동윤
c411e5d552
feat(es/minifier): Drop more variables while invoking IIFE (#5987) 2022-09-29 02:15:56 +00:00
Donny/강동윤
0cfc724018
test(es/minifier): Add tests for benchmark files (#5986) 2022-09-29 09:41:13 +09:00
SWC Bot
189f9b482f chore: Publish crates 2022-09-29 00:08:42 +00:00
Donny/강동윤
0067f719dd
fix(es/minifier): Don't panic on jsx or ts (#5984) 2022-09-29 00:05:13 +00:00
SWC Bot
c499e2054d chore: Publish crates 2022-09-28 22:57:51 +00:00
SWC Bot
57ef438d9b chore: Publish crates 2022-09-28 14:23:58 +00:00
Donny/강동윤
08f6e81d8e
feat(es/minifier): Ignore more return values (#5981) 2022-09-28 14:20:37 +00:00
SWC Bot
1c9870a744 chore: Publish crates 2022-09-28 13:44:08 +00:00
Donny/강동윤
bc2c0f4133
fix(es/codegen): Fix codegen of a negative number (#5980)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5912.
2022-09-28 13:40:07 +00:00
Donny/강동윤
8c4873f81e
test(es/minifier): Remove mangle-only snapshots (#5979)
**Description:**

We don't have to store snapshots of all fixtures.
2022-09-28 21:35:52 +09:00
SWC Bot
d75addbdec chore: Publish crates 2022-09-28 10:37:40 +00:00
SWC Bot
7c2d6a9f67 chore: Publish crates 2022-09-28 09:23:36 +00:00
Donny/강동윤
e37bb55101
perf(es/minifier): Optimize MultiReplacer (#5977)
**Description:**

This PR splits the `MultiReplacer` into two variants. The first one is the cloning version, and this is parallel. The other one is the non-cloning version, which is not parallel.
2022-09-28 09:19:30 +00:00
SWC Bot
c23c07fc50 chore: Publish crates 2022-09-28 08:16:52 +00:00
Donny/강동윤
0e69890764
feat(es/minifier): Evaluate more literals in comparison (#5976)
**Description:**

I'll fix the performance issue with a follow-up PR.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/4415.
2022-09-28 08:07:55 +00:00
SWC Bot
b5be765a87 chore: Publish crates 2022-09-28 05:39:30 +00:00
Austaras
aff4ea5f44
fix(es/minifier): Preserve exports in DCE (#5973) 2022-09-28 05:35:51 +00:00
SWC Bot
f655488cfa chore: Publish crates 2022-09-27 13:57:39 +00:00
SWC Bot
a5918422bf chore: Publish crates 2022-09-27 11:52:21 +00:00
SWC Bot
3eecf954b3 chore: Publish crates 2022-09-27 08:41:58 +00:00