Commit Graph

3635 Commits

Author SHA1 Message Date
Donny/강동윤
2ba88154fc
fix(es/codegen): Align sourcemap with terser (#5657) 2022-09-26 18:12:42 +09:00
SWC Bot
b5027f00a0 chore: Publish crates 2022-09-25 02:23:02 +00:00
Donny/강동윤
b219fa2f01
feat(dbg-swc): Add a size debugger for next.js (#5945) 2022-09-25 11:18:53 +09:00
SWC Bot
e1f421b6af chore: Publish crates 2022-09-25 01:36:48 +00:00
John Daly
cdd69d0145
fix(es/parser): Allow as in destructuring assignment (#5948) 2022-09-25 10:29:33 +09:00
SWC Bot
e5ba9636ac chore: Publish crates 2022-09-24 03:36:47 +00:00
Donny/강동윤
3c3529cb84
build(rustc): Update rustc (#5943)
**Description:**

This PR updates rustc, and fix some performance bugs of `swc_common`.
2022-09-24 03:33:47 +00:00
SWC Bot
8a5ed1e0ba chore: Publish crates 2022-09-23 07:50:26 +00:00
Donny/강동윤
5cddb4c734
feat(es/typescript): Support TS 4.9 (#5938)
**Description:**

This PR adds satisfaction expression to the AST and parser.
2022-09-23 16:41:56 +09:00
SWC Bot
ae14211f04 chore: Publish crates 2022-09-23 05:25:48 +00:00
Donny/강동윤
97647861bf
fix(es/minifier): Track aliasing via assignments (#5940) 2022-09-23 14:22:41 +09:00
SWC Bot
ae6c344fe5 chore: Publish crates 2022-09-23 04:19:14 +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
SWC Bot
15d21651c9 chore: Publish crates 2022-09-22 14:28:07 +00:00
Donny/강동윤
7bcaaef4f7
feat(es/minifier): Mangle labels (#5934)
**Description:**

This PR adds code to mangle labels.
2022-09-22 23:24:05 +09:00
SWC Bot
8dbef496cf chore: Publish crates 2022-09-22 13:58:09 +00:00
Donny/강동윤
e16827cc9d
feat(es/minifier): Drop cycles in nested functions (#5933) 2022-09-22 13:54:49 +00:00
SWC Bot
098a021a43 chore: Publish crates 2022-09-22 13:18:22 +00:00
Donny/강동윤
5314ac5d02
feat(es/minifier): Use char frequency data for property manglers (#5932) 2022-09-22 22:14:26 +09:00
SWC Bot
0879a0504a chore: Publish crates 2022-09-22 10:25:54 +00:00
Donny/강동윤
e9c704182b
feat(es/minifier): Improve analysis of reassignments (#5931) 2022-09-22 10:22:18 +00:00
SWC Bot
60bcdf768a chore: Publish crates 2022-09-22 09:22:14 +00:00
Donny/강동윤
f2224132c1
fix(es/minifier): Prepend vars when dropping vars in a for loop initializer (#5930)
**Description:**

The minifier appends initializer of for statements instead of prepending it.

**Related issue:**

- https://github.com/vercel/next.js/discussions/30237#discussioncomment-3704795
2022-09-22 09:18:41 +00:00
SWC Bot
a2b3063784 chore: Publish crates 2022-09-22 06:57:15 +00:00
Jason
64694dc7d5
fix(css/parser): Report an error for invalid layer in @import (#5928) 2022-09-22 06:53:34 +00:00
SWC Bot
5e82dd63af chore: Publish crates 2022-09-22 06:19:31 +00:00
Donny/강동윤
ac7b066d9a
feat(es/minifier): Inline rest parameters of IIFE (#5929) 2022-09-22 06:16:29 +00:00
SWC Bot
f5d42aa2b6 chore: Publish crates 2022-09-22 03:56:27 +00:00
Donny/강동윤
565bf317f6
feat(es/minifier): Evaluate more expressions (#5926) 2022-09-22 03:53:14 +00:00
SWC Bot
4c3813dbcc chore: Publish crates 2022-09-22 03:16:22 +00:00
Jason
1dc5307069
feat(css/minifier): Minify the name of @keyframes (#5894)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5889.

Co-authored-by: 一丝 <percyley@qq.com>
2022-09-22 03:12:50 +00:00
SWC Bot
043c95307e chore: Publish crates 2022-09-21 15:12:52 +00:00
Donny/강동윤
19ce2737b1
feat(es/minifier): Collapse let without init (#5909)
**Description:**

This patch applies the variable collapsing logic for the variables declared with `var` to the variables declared with `let`. This requires some patch about the behavior of visitors about `BlockStmt`, so this patch includes relevant changes.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5696.
2022-09-21 15:04:29 +00:00
SWC Bot
1cf0e2369b chore: Publish crates 2022-09-21 12:22:25 +00:00
Donny/강동윤
31711e76af
test(es/minifier): Add an execution test for a fixed issue (#5925)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5914.
2022-09-21 12:19:14 +00:00
SWC Bot
a9270a8475 chore: Publish crates 2022-09-21 11:36:41 +00: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
SWC Bot
60417bdf77 chore: Publish crates 2022-09-21 10:58:05 +00:00
Donny/강동윤
0b34bcb40e
test(es/minifier): Add a test for a wrong issue (#5923) 2022-09-21 19:52:52 +09:00
SWC Bot
6e560644e5 chore: Publish crates 2022-09-21 08:24:14 +00:00
Jason
10cdbed05e
fix(css/parser): Fix infinite loop about @import and layer (#5919) 2022-09-21 08:21:04 +00:00
SWC Bot
ce6b0886d1 chore: Publish crates 2022-09-21 07:40:12 +00:00
Shu Ding
72429d8801
feat(swc_core): Expose tty feature of swc_common as common_tty (#5920)
**Description:**

This PR adds a `common_tty` feature to swc_core which enables `tty-emitter` for `swc_common` to make the colored terminal output available.
2022-09-21 16:37:08 +09:00
SWC Bot
8a9cc7dd2a chore: Publish crates 2022-09-21 07:33:40 +00:00
Donny/강동윤
fe40d8312b
test(es): Accept arguments (#5916)
**Description:**

This PR adds a way to provide arguments to `exec_node_js`.
2022-09-21 16:23:10 +09:00
Donny/강동윤
6d1e5c77f1 chore: Publish crates 2022-09-21 09:59:44 +09:00
SWC Bot
be81c4737e chore: Publish crates 2022-09-20 08:32:27 +00:00
Donny/강동윤
a9873e505d
perf(es/minifier): Optimize analyzer (#5908) 2022-09-20 08:21:39 +00:00
SWC Bot
1898d6686a chore: Publish crates 2022-09-20 06:44:48 +00:00
Donny/강동윤
1df72430a5
perf(es/minifier): Invoke DCE only before the first compression (#5907)
**Description:**

Invoke DCE only before the first compression. I verified that this patch does not affect the compression rate of the real-world inputs greatly.
2022-09-20 15:41:26 +09:00
SWC Bot
cb2044234a chore: Publish crates 2022-09-20 04:32:30 +00:00
Donny/강동윤
6bbd3f4c14
perf(es/minifier): Make more passes parallel (#5906)
**Description:**

We only unwrap parenthesis in precompress optimizer, so I refactored it. Also, as it's embarrassingly parallel, I parallelized it.
2022-09-20 04:29:08 +00:00
SWC Bot
5c2b1bb15d chore: Publish crates 2022-09-20 03:51:28 +00:00
Donny/강동윤
1a182ef8d9
perf(es): Optimize memory layout of AST (#5829) 2022-09-20 12:47:21 +09:00
SWC Bot
26b9f1fc23 chore: Publish crates 2022-09-20 01:50:11 +00:00
Alexander Akait
2bf24195f2
feat(css/parser): Parse more math functions in @media (#5904) 2022-09-20 10:45:49 +09:00
SWC Bot
8c112c371b chore: Publish crates 2022-09-19 15:11:28 +00:00
Donny/강동윤
aacf7aaf80
feat(es/minifier): Drop function identifier in a single pass (#5901)
**Description:**

We only inline function declarations if `ref_count` is 1, so we don't need to preserve the name of the function.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5682.
2022-09-19 15:07:56 +00:00
SWC Bot
345e955265 chore: Publish crates 2022-09-19 13:37:22 +00:00
SWC Bot
a18625c0d0 chore: Publish crates 2022-09-19 12:25:00 +00:00
Austaras
83c7887600
fix(es/minifier): Remove more pure calls (#5900) 2022-09-19 12:21:15 +00:00
SWC Bot
65296b4a68 chore: Publish crates 2022-09-19 08:28:54 +00:00
Donny/강동윤
0bbcfe15ee
test(es/minifier): Add a test for a fixed issue (#5897) 2022-09-19 17:25:49 +09:00
SWC Bot
b93d740396 chore: Publish crates 2022-09-19 07:49:46 +00:00
Donny/강동윤
4e656af1ec
feat(es/minifier): Drop variable from the sequential inliner (#5896)
**Description:**

We now drop variable declarations if we are going to eliminate the only usage.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5693.
2022-09-19 07:40:04 +00:00
SWC Bot
7db72e8232 chore: Publish crates 2022-09-18 10:02:24 +00:00
Donny/강동윤
20d071bdc7
test(es/plugin): Add a noop plugin (#5892)
**Description:**

The plugin is used for benchmark and verification of rkyv.
2022-09-18 09:54:06 +00:00
SWC Bot
473f5c4111 chore: Publish crates 2022-09-17 00:13:31 +00:00
Alexander Akait
5645e810df
perf(html/parser): Improve performance (#5884) 2022-09-17 00:10:08 +00:00
SWC Bot
6b684ca162 chore: Publish crates 2022-09-16 23:17:15 +00:00
OJ Kwon
2d4d04d06b
feat(es/plugin): Enable plugin for bytecheck flags (#5885)
**Description:**

Fixes oversight to enabling plugin when plugin-bytecheck is enabled.
2022-09-16 23:07:11 +00:00
IWANABETHATGUY
7d6d04b421
fix(es/codegen): Drop the last comma in an array literal (#5877)
**Description:**

Drop the last comma in an array literal.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5692.
2022-09-16 15:48:28 +09:00
Donny/강동윤
f0ca487848 chore: Publish crates 2022-09-16 15:46:25 +09:00
SWC Bot
c953ff414c chore: Publish crates 2022-09-16 03:28:09 +00:00
Alexander Akait
57e9f9c88e
fix(html/parser): Reflect the fix for a bug in spec (#5779) 2022-09-16 03:24:49 +00:00
SWC Bot
99094def0e chore: Publish crates 2022-09-16 02:47:08 +00:00
OJ Kwon
1ba151fe95
feat(swc_core): Enable bytecheck for plugin (#5878) 2022-09-16 11:43:59 +09:00
SWC Bot
ca6325ca7d chore: Publish crates 2022-09-16 01:07:09 +00:00
Will Binns-Smith
73c48a8e6e
feat(preset-env/base): Implement more traits for BrowserData and Version (#5879)
**Description:**

This derives additional common traits for these public structs.
2022-09-16 01:04:13 +00:00
SWC Bot
52c17f3056 chore: Publish crates 2022-09-15 14:49:03 +00:00
Donny/강동윤
c3fa96b21b
fix(es/minifier): Fix unicode handling (#5875) 2022-09-15 14:45:33 +00:00
SWC Bot
5cf78b0213 chore: Publish crates 2022-09-15 13:20:59 +00:00
Donny/강동윤
0d492bfce1
test(es/modules): Add tests for jsc.paths (#5876)
**Description:**

Those issues were wrong.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/4890
 - Closes https://github.com/swc-project/swc/issues/5214
2022-09-15 13:17:48 +00:00
SWC Bot
dd2a7c1cd1 chore: Publish crates 2022-09-15 08:53:05 +00:00
SWC Bot
69bf533571 chore: Publish crates 2022-09-15 07:03:50 +00:00
magic-akari
90d311c042
fix(es/minifier): Fix handling of .toFixed call without an argument (#5868) 2022-09-15 16:00:36 +09:00
SWC Bot
9f182c555c chore: Publish crates 2022-09-15 06:56:26 +00:00
SWC Bot
1d633e8ba7 chore: Publish crates 2022-09-15 06:08:07 +00:00
Donny/강동윤
991a34e0c2
fix(es/minifier): Remove fake_block while calculating next scope (#5869)
**Description:**

We now remove `fake_block` mark from `with_ctx`.

**Related issue:**
 - Closes https://github.com/swc-project/swc/issues/5865
2022-09-15 06:04:47 +00:00
SWC Bot
ec8bb432b9 chore: Publish crates 2022-09-15 05:23:46 +00:00
OJ Kwon
092b7281d0
refactor(es/ast): Apply rkyv-bytecheck flag (#5866) 2022-09-15 05:20:46 +00:00
SWC Bot
92eea2fece chore: Publish crates 2022-09-15 04:20:45 +00:00
Alexander Akait
7f62fa6227
perf(html): Reduce memory usage (#5867) 2022-09-15 04:17:05 +00:00
SWC Bot
73ee9d6784 chore: Publish crates 2022-09-15 03:06:15 +00:00
magic-akari
006c7fb56e
fix(es/compat): Fix handling of objects in generator (#5861) 2022-09-15 12:02:48 +09:00
SWC Bot
b972c7a815 chore: Publish crates 2022-09-14 15:09:25 +00:00
Donny/강동윤
dfb01bde71
refactor: Refactor code using clippy (#5863)
**Description:**

I temporarily updated rustc to use newer version of `cargo clippy`.
2022-09-14 15:05:59 +00:00
SWC Bot
55a4e18991 chore: Publish crates 2022-09-14 13:00:55 +00:00
Austaras
63fb0c4ad3
feat(es/minifier): Move assign with seq init into seq (#5847) 2022-09-14 12:57:18 +00:00
SWC Bot
03096ff072 chore: Publish crates 2022-09-14 10:22:06 +00:00
SWC Bot
d35792f424 chore: Publish crates 2022-09-14 07:56:20 +00:00
Donny/강동윤
4cde553811
fix(es/ast): Revert #5798 (#5798) (#5855)
This reverts commit 37f42df877.
2022-09-14 16:52:46 +09:00
SWC Bot
8432c0a1ad chore: Publish crates 2022-09-14 07:19:24 +00:00
OJ Kwon
37f42df877
refactor(es/ast): Apply rkyv-bytecheck flag (#5798)
**Description:**

This PR updates ast* related package's rkyv bytecheck flags.
2022-09-14 16:16:18 +09:00
SWC Bot
0c24841274 chore: Publish crates 2022-09-14 06:54:54 +00:00
Donny/강동윤
32f18068ad
fix(es/minifier): Preserve more side effects (#5853)
**Description:**

We now preserve more side effects.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5680.
2022-09-14 06:51:56 +00:00
SWC Bot
0a56a2d5ab chore: Publish crates 2022-09-14 06:10:39 +00:00
magic-akari
2b2464271a
fix(es/codegen): Remove redundant ; after export default decl (#5851) 2022-09-14 06:07:15 +00:00
SWC Bot
ad4b0d200c chore: Publish crates 2022-09-14 05:05:55 +00:00
Donny/강동윤
a5f7b6946f
fix(es/minifier): Don't replace parameters of IIFE if it's recursive (#5852)
**Description:**

While investigating, I found that problem is not the analysis of recursive functions. Instead, it was a problem with the IIFE evaluator, which replaces parameters even if it's recursive.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/5846
2022-09-14 05:02:14 +00:00
SWC Bot
9d5439281a chore: Publish crates 2022-09-14 03:03:29 +00:00
OJ Kwon
c0da2e998a
fix(swc_core): Fix reexport of testing (#5848) 2022-09-14 11:59:36 +09:00
SWC Bot
3f4e469913 chore: Publish crates 2022-09-13 10:35:40 +00:00
Donny/강동윤
0284c1bf40
test(es/transforms): Enable tests for fixed issues (#5845) 2022-09-13 10:32:00 +00:00
SWC Bot
76d22dfeb1 chore: Publish crates 2022-09-13 07:46:53 +00:00
magic-akari
bf759819e4
fix(es/modules): Improve compatibility with cjs-module-lexer (#5835) 2022-09-13 07:43:41 +00:00
SWC Bot
cae41739d5 chore: Publish crates 2022-09-13 06:48:34 +00:00
Donny/강동윤
fe3072b12a
perf(es/minifier): Reduce type sizes (#5843) 2022-09-13 06:45:33 +00:00
SWC Bot
c624c3de03 chore: Publish crates 2022-09-13 06:06:00 +00:00
Donny/강동윤
b6cf9750ec
perf(es/minifier): Make the expression simplifier more parallel (#5841)
**Description:**

It was not parallel enough.
2022-09-13 06:02:44 +00:00
SWC Bot
d16fb9a8cf chore: Publish crates 2022-09-13 05:04:36 +00:00
Alexander Akait
ccd618ce54
perf(html/minifier): Improve performance (#5838) 2022-09-13 14:01:41 +09:00
SWC Bot
abc722c6f8 chore: Publish crates 2022-09-13 04:46:38 +00:00
Alexander Akait
211b0a93fd
feat(css/minifier): Compress @media and @supports (#5828) 2022-09-13 04:43:41 +00:00
SWC Bot
d8c1e4a62e chore: Publish crates 2022-09-13 03:56:39 +00:00
Austaras
8567a38c4a
feat(es/minifier): Extend inlining of identifiers to multi-usage (#5832) 2022-09-13 03:52:47 +00:00
SWC Bot
6cb280fdb5 chore: Publish crates 2022-09-13 03:09:24 +00:00
Alexander Akait
b691fec7b7
perf(html/minifier): Improve performance (#5840) 2022-09-13 03:06:08 +00:00
SWC Bot
b2c0fbd7ba chore: Publish crates 2022-09-13 02:19:15 +00:00
magic-akari
10637b006f
fix(es/parser): Handle more TS1185 (#5834) 2022-09-13 02:16:22 +00:00
SWC Bot
35b88e3adc chore: Publish crates 2022-09-12 22:34:21 +00:00
OJ Kwon
856d741ec7
feat(swc_core): Export testing utilities (#5839)
**Description:**

This PR exports general testing utilities from swc_core.
2022-09-12 22:31:26 +00:00
SWC Bot
2df19176fb chore: Publish crates 2022-09-12 05:16:53 +00:00
Donny/강동윤
10484edbf7
perf(es/parser): Optimize memory layout (#5833)
**Description:**

I boxed `BigIntValue` in the `Token` type to make `TokenAndSpan` smaller and made the parser use `Vec` instead of `SmallVec` for token contexts.
2022-09-12 05:14:09 +00:00
SWC Bot
9f28c246dc chore: Publish crates 2022-09-12 04:34:08 +00:00
Donny/강동윤
24004270d9
perf(atoms): Reduce size of Atom (#5831)
**Description:**

This patch reduces the memory footprint.
2022-09-12 04:31:17 +00:00
SWC Bot
485632ae03 chore: Publish crates 2022-09-12 01:14:29 +00:00
Alexander Akait
1803874f14
fix(css/minifier): Fix minification of universal selectors (#5826) 2022-09-12 01:11:36 +00:00
SWC Bot
bfb06f1248 chore: Publish crates 2022-09-12 00:28:51 +00:00
SWC Bot
c92474ee13 chore: Publish crates 2022-09-11 23:40:40 +00:00
Alexander Akait
b531410ea9
fix(css/minifier): Compress alpha (#5825) 2022-09-11 23:37:35 +00:00
SWC Bot
7811ceea3b chore: Publish crates 2022-09-11 13:59:34 +00:00
Donny/강동윤
4f119b2693
perf(css): Optimize memory layout of ast types (#5823) 2022-09-11 13:56:48 +00:00
SWC Bot
fb2c33e132 chore: Publish crates 2022-09-11 09:28:02 +00:00
Donny/강동윤
9e81c2639b
perf(css/minifier): Merge passes and reduce clone (#5822) 2022-09-11 18:24:53 +09:00
SWC Bot
35736a313d chore: Publish crates 2022-09-11 07:19:34 +00:00
Donny/강동윤
4fa5a2778b
perf(css/minifier): Merge more passes into the compressor (#5821) 2022-09-11 16:16:45 +09:00
SWC Bot
70f1be9919 chore: Publish crates 2022-09-11 06:26:58 +00:00
Donny/강동윤
f523502f4c
perf(css/minifier): Merge passes (#5820)
**Description:**

A single visitor is better for performance.
2022-09-11 15:24:02 +09:00
SWC Bot
2b1e73737f chore: Publish crates 2022-09-11 06:21:56 +00:00