Commit Graph

1751 Commits

Author SHA1 Message Date
Austaras
8db968a25d
refactor(es/minifier): Remove mutated and mutation_by_call_count (#7890)
**Description:**

`mutated` can be seen as a combination of `reassigned` and `has_property_mutation`, and `mutation_by_call_count` is simply useless.
2023-08-30 03:01:29 +00:00
SWC Bot
853b4803ad chore: Publish crates 2023-08-30 02:26:08 +00:00
SWC Bot
aa8ad10ad8 chore: Publish crates 2023-08-29 10:23:30 +00:00
Austaras
87a47bfb2c
fix(es/minifier): Report is_fn_local even if var is hoisted (#7876)
**Related issue:**
 - Closes #7847
2023-08-29 10:21:14 +00:00
SWC Bot
c31f05a675 chore: Publish crates 2023-08-29 05:47:51 +00:00
SWC Bot
4a2c24bbec chore: Publish crates 2023-08-29 05:06:03 +00:00
SWC Bot
562f5e1eb3 chore: Publish crates 2023-08-28 00:31:39 +00:00
Donny/강동윤
4d3fcb86e4
feat(es/ast): Support import attributes proposal (#7868)
**Related issue:**

 - Closes #7179
2023-08-28 00:29:45 +00:00
SWC Bot
5d25307a1a chore: Publish crates 2023-08-27 23:38:50 +00:00
SWC Bot
2be46c920c chore: Publish crates 2023-08-27 18:25:51 +00:00
SWC Bot
5c96b8545d chore: Publish crates 2023-08-25 13:48:47 +00:00
SWC Bot
7986566128 chore: Publish crates 2023-08-25 07:25:19 +00:00
SWC Bot
9c69caf665 chore: Publish crates 2023-08-25 06:07:50 +00:00
SWC Bot
f79ca54584 chore: Publish crates 2023-08-25 04:49:30 +00:00
Lewis Liu
ae8cd9430d
fix(es/minifier): Don't remove exports (#7856) 2023-08-25 13:47:42 +09:00
SWC Bot
7b5cb902a5 chore: Publish crates 2023-08-24 12:58:41 +00:00
SWC Bot
a9a6928a4e chore: Publish crates 2023-08-24 08:20:56 +00:00
SWC Bot
da5bc1084d chore: Publish crates 2023-08-24 07:37:21 +00:00
Austaras
65db1badff
refactor(es/minifier): Pre-calculate reassigned (#7832) 2023-08-24 07:35:26 +00:00
SWC Bot
662f236aa5 chore: Publish crates 2023-08-22 02:06:20 +00:00
Donny/강동윤
7fe01e64dd
fix(es/minifier): Don't inline properties if the var is not fn-local (#7839)
**Related issue:**

 - https://github.com/vercel/next.js/issues/54192.
2023-08-22 11:04:15 +09:00
SWC Bot
becea47a2d chore: Publish crates 2023-08-17 18:11:16 +00:00
Donny/강동윤
31de19ece2
fix(es/minifier): Preserve more analysis data upon inlining (#7823)
**Related issue:**

 - Closes #7821.
2023-08-17 18:09:02 +00:00
SWC Bot
9dbfadb48d chore: Publish crates 2023-08-17 14:38:07 +00:00
SWC Bot
ebbc9292e3 chore: Publish crates 2023-08-17 05:18:03 +00:00
Austaras
f8ca366cc1
fix(es/minifier): Abort seq inliner if var is not fn_local or reassigned (#7804)
**Description:**

It turns out that the original implementation of `infect`is incomplete
because it cannot cover function param, and the new implementation
introduced in #7772 is redundant because what
[terser](https://github.com/terser/terser/blob/master/lib/compress/tighten-body.js#L909C18-L909C28)
do is basically checking `fn_local`


**Related issue:**

 - Closes #7784
2023-08-17 05:15:59 +00:00
SWC Bot
a6a5ec30cd chore: Publish crates 2023-08-17 04:37:14 +00:00
Donny/강동윤
05990a98fd
fix(es/minifier): Preserve cooked while compressing template literals (#7773)
**Related issue:**

 - Closes #7770
2023-08-17 04:35:07 +00:00
SWC Bot
05200ad352 chore: Publish crates 2023-08-17 04:03:33 +00:00
SWC Bot
0d036b4915 chore: Publish crates 2023-08-16 19:11:18 +00:00
SWC Bot
e9dfe879d9 chore: Publish crates 2023-08-16 18:04:14 +00:00
SWC Bot
d5495eeb9a chore: Publish crates 2023-08-16 14:18:56 +00:00
David Sherret
b43e38d3f9
refactor: Use ahash from swc_common in more places (#7815)
**Description:**

Uses ahash from swc_common in more places. This allows for more easily
swapping out ahash with rustc_hash.
2023-08-16 23:16:52 +09:00
SWC Bot
2dc88ef147 chore: Publish crates 2023-08-16 13:26:52 +00:00
SWC Bot
a671afa0aa chore: Publish crates 2023-08-16 02:12:39 +00:00
SWC Bot
023042dfb9 chore: Publish crates 2023-08-15 15:29:35 +00:00
SWC Bot
0f66ee315a chore: Publish crates 2023-08-14 15:47:58 +00:00
SWC Bot
74d446f759 chore: Publish crates 2023-08-14 01:35:45 +00:00
SWC Bot
b5dcce03c1 chore: Publish crates 2023-08-10 08:01:19 +00:00
SWC Bot
be58d36c42 chore: Publish crates 2023-08-10 02:50:53 +00:00
Donny/강동윤
552d9aa344
fix(es/minifier): Do not drop properties used via this (#7785)
**Related issue:**

 - Closes #7783.
2023-08-10 02:48:35 +00:00
SWC Bot
e90b555790 chore: Publish crates 2023-08-09 20:44:26 +00:00
Donny/강동윤
eff0caca2b
feat(es/minifier): Support mangle.eval (#7777)
**Related issue:**

 - Closes #7754
2023-08-09 20:42:12 +00:00
SWC Bot
0edc4207f4 chore: Publish crates 2023-08-09 20:04:15 +00:00
Austaras
ef8d12154d
fix(es/minifier): Abort seq inliner if a same var is defined in outer scope (#7772)
**Description:**

The algorithm here is directly copied from terser, I don't if it's correct or can be improved, but it does fix the issue.


**Related issue:**

 - Closes #7749
2023-08-09 20:01:59 +00:00
SWC Bot
c04ca528b8 chore: Publish crates 2023-08-09 09:19:00 +00:00
SWC Bot
1c2eb88a60 chore: Publish crates 2023-08-09 05:00:38 +00:00
SWC Bot
83983f49c8 chore: Publish crates 2023-08-07 22:56:50 +00:00
Donny/강동윤
f7afe7edec
refactor(es/minifier): Support stable rustc (#7734) 2023-08-07 22:55:00 +00:00
SWC Bot
14906e279f chore: Publish crates 2023-08-07 22:20:08 +00:00
Donny/강동윤
b45649b8d6
fix(es/codegen): Don't strip necessary escape characters (#7687)
**Related issue:**

 - Closes #7678.
2023-08-07 22:17:59 +00:00
SWC Bot
0219eebeb9 chore: Publish crates 2023-08-07 21:31:50 +00:00
SWC Bot
1323c25ed6 chore: Publish crates 2023-08-07 20:38:40 +00:00
Donny/강동윤
36ccbec061
fix(es/minifier): Abort on Array.slice with start >= end (#7745)
**Related issue:**

 - Closes #7742.
2023-08-07 20:36:15 +00:00
SWC Bot
1e6ade8cfa chore: Publish crates 2023-08-07 20:01:21 +00:00
SWC Bot
51d17b66ad chore: Publish crates 2023-08-06 22:16:01 +00:00
SWC Bot
434472a678 chore: Publish crates 2023-08-06 21:44:26 +00:00
SWC Bot
97289b4edc chore: Publish crates 2023-08-06 20:31:13 +00:00
SWC Bot
d0ea6bdd84 chore: Publish crates 2023-08-03 02:45:17 +00:00
SWC Bot
e22cdccedd chore: Publish crates 2023-08-02 22:04:35 +00:00
Donny/강동윤
3873f58499
fix(es/minifier): Mark args of news as references (#7743)
**Related issue:**

 - Closes #7739.
2023-08-03 07:02:15 +09:00
SWC Bot
1a5a3313cf chore: Publish crates 2023-07-31 04:12:06 +00:00
Austaras
5ea6f27eb0
fix(es/minifier): Handle synthesized export default expression (#7707)
**Related issue:**

 - Closes #7634.
2023-07-31 04:10:18 +00:00
SWC Bot
ef306256d2 chore: Publish crates 2023-07-31 03:33:30 +00:00
Donny/강동윤
e8c58cfd77
fix(es/utils): Fix string evaluation of array literals (#7731)
**Related issue:**

 - Closes #7714.
2023-07-31 03:31:37 +00:00
SWC Bot
640318c616 chore: Publish crates 2023-07-28 16:59:14 +00:00
Donny/강동윤
f901b417d1
fix(es/minifier): Do not drop used properties (#7702)
**Related issue:**

 - Closes #7700.
 - Closes #7710.
2023-07-28 16:57:07 +00:00
SWC Bot
d3b516d692 chore: Publish crates 2023-07-28 05:59:26 +00:00
SWC Bot
9a57f8ab6d chore: Publish crates 2023-07-28 05:22:07 +00:00
SWC Bot
3f3de2e316 chore: Publish crates 2023-07-28 04:42:31 +00:00
SWC Bot
4c43d5aa3d chore: Publish crates 2023-07-25 03:32:13 +00:00
Donny/강동윤
a26dbce981
fix(es/minifier): Abort seq inliner using visitor (#7699)
**Related issue:**

 - Closes #7697.
2023-07-25 03:30:33 +00:00
SWC Bot
cd98859482 chore: Publish crates 2023-07-25 02:56:16 +00:00
Austaras
bf723625b0
refactor(es/minifier): Respect top-level when invoking IIFE (#7690) 2023-07-25 02:53:55 +00:00
SWC Bot
11efd4e7c5 chore: Publish crates 2023-07-24 04:39:18 +00:00
SWC Bot
aff07b1a0a chore: Publish crates 2023-07-21 02:00:00 +00:00
magic-akari
241c04ab4a
fix(es/minifier): Only cast global Infinity/undefined/NaN (#7684)
**Related issue:**

 - Closes #7683.
2023-07-21 01:57:39 +00:00
SWC Bot
026101b71e chore: Publish crates 2023-07-20 05:57:51 +00:00
SWC Bot
c61dd52909 chore: Publish crates 2023-07-20 02:37:25 +00:00
Austaras
9893bd2d43
refactor(es/minifier): Respect toplevel and module options (#7671) 2023-07-20 11:35:08 +09:00
SWC Bot
3c89bdfd99 chore: Publish crates 2023-07-18 04:13:08 +00:00
Donny/강동윤
a65be14a00
fix(es/minifier): Do not reuse identifier used for import bindings (#7639)
**Related issue:**

 - Closes #7634.
2023-07-18 04:11:00 +00:00
SWC Bot
7c12060b70 chore: Publish crates 2023-07-18 01:10:44 +00:00
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
SWC Bot
3930f77b54 chore: Publish crates 2023-07-17 07:19:08 +00:00
SWC Bot
bed73c168c chore: Publish crates 2023-07-14 20:56:32 +00:00
Austaras
04b0f6d823
feat(es/minifier): Drop recursively used var declaration (#7649) 2023-07-15 05:54:34 +09:00
SWC Bot
26d79444c6 chore: Publish crates 2023-07-13 02:09:23 +00:00
SWC Bot
e4f9f734ad chore: Publish crates 2023-07-07 04:09:05 +00:00
Donny/강동윤
19ba714ea1
fix(es/minifier): Don't drop unused properties of top-level vars (#7638)
**Related issue:**

 - Closes #7635.
2023-07-07 04:07:13 +00:00
SWC Bot
1fe263903d chore: Publish crates 2023-07-07 02:17:07 +00:00
SWC Bot
2ef760357f chore: Publish crates 2023-07-06 03:29:42 +00:00
SWC Bot
735a82d6a4 chore: Publish crates 2023-07-05 03:52:51 +00:00
Donny/강동윤
b34f1adbcc
build(cargo): Update rustc to 2023-07-03 (#7623) 2023-07-05 03:50:43 +00:00
SWC Bot
7544ea960b chore: Publish crates 2023-07-04 07:01:59 +00:00
SWC Bot
984fdc8ef5 chore: Publish crates 2023-07-04 06:25:39 +00:00
Austaras
4f866de878
fix(es/minifier): Add usage to inlined ident eagerly (#7597)
**Related issue:**

 - Closes #7591.
2023-07-04 06:23:49 +00:00
SWC Bot
9214427667 chore: Publish crates 2023-07-04 05:49:44 +00:00
Austaras
ff1ad95b59
feat(es/minifier): Compress common sub expressions in sequences (#7587) 2023-07-04 05:47:37 +00:00
SWC Bot
9cb9f055ba chore: Publish crates 2023-07-04 05:13:14 +00:00
Donny/강동윤
47d2edd4dc
feat(es/minifier): Drop unused properties (#7534)
**Related issue:**

 - Closes #7472.
2023-07-04 05:11:33 +00:00
SWC Bot
cf902d3808 chore: Publish crates 2023-07-03 01:54:53 +00:00
SWC Bot
cba986807a chore: Publish crates 2023-06-30 07:43:11 +00:00
SWC Bot
3aee9a23aa chore: Publish crates 2023-06-30 02:15:04 +00:00
SWC Bot
efc1afd96a chore: Publish crates 2023-06-29 14:15:31 +00:00
SWC Bot
be33efaecd chore: Publish crates 2023-06-29 07:52:19 +00:00
SWC Bot
ed9a4ae5bc chore: Publish crates 2023-06-27 15:25:59 +00:00
Donny/강동윤
a685c88c61
fix(es/minifier): Don't drop assignments to unused top-level variables (#7581)
**Related issue:**

 - Closes #7568
2023-06-27 15:24:06 +00:00
SWC Bot
7f2ace5d3f chore: Publish crates 2023-06-27 02:16:08 +00:00
Donny/강동윤
398e922ca0
feat(es/minifier): Inline constants even if they are exported (#7583)
**Related issue:**

 - Closes #7575.
2023-06-27 02:14:09 +00:00
SWC Bot
b4ae28b053 chore: Publish crates 2023-06-26 04:02:12 +00:00
SWC Bot
4efefb0f4e chore: Publish crates 2023-06-23 02:28:10 +00:00
SWC Bot
8c1436aaf5 chore: Publish crates 2023-06-22 13:40:52 +00:00
Donny/강동윤
d57d0d3ad3
build(cargo): Update deps (#7566) 2023-06-22 13:37:35 +00:00
SWC Bot
33355cf707 chore: Publish crates 2023-06-22 07:43:38 +00:00
Donny/강동윤
d12dc70c91
build(cargo): Update deps (#7564) 2023-06-22 07:40:41 +00:00
SWC Bot
f9c5265bde chore: Publish crates 2023-06-21 15:44:11 +00:00
SWC Bot
c9f2838071 chore: Publish crates 2023-06-21 09:40:25 +00:00
Donny/강동윤
07a858030c
feat(es/minifier): Enable hoist_props by default (#7535) 2023-06-21 18:38:35 +09:00
SWC Bot
690ca6c8e1 chore: Publish crates 2023-06-21 07:27:39 +00:00
Donny/강동윤
3ad07a7d2e
feat(es/minifier): Support __NO_SIDE_EFFECTS__ (#7532)
**Related issue:**

 - Closes #7525.
2023-06-21 07:25:29 +00:00
SWC Bot
c023a03d7b chore: Publish crates 2023-06-21 03:18:22 +00:00
SWC Bot
8b765e6763 chore: Publish crates 2023-06-20 05:37:57 +00:00
SWC Bot
f27d6ea58c chore: Publish crates 2023-06-20 05:05:01 +00:00
SWC Bot
69b034931e chore: Publish crates 2023-06-20 04:14:44 +00:00
SWC Bot
fec056f5db chore: Publish crates 2023-06-20 03:21:20 +00:00
SWC Bot
44aac8fe27 chore: Publish crates 2023-06-19 05:51:51 +00:00
SWC Bot
2669fc214a chore: Publish crates 2023-06-19 03:20:19 +00:00
SWC Bot
d38c40914e chore: Publish crates 2023-06-19 03:02:08 +00:00
SWC Bot
0859b76ed0 chore: Publish crates 2023-06-16 06:46:25 +00:00
SWC Bot
b9acc83fa7 chore: Publish crates 2023-06-16 02:59:35 +00:00
SWC Bot
39276402bf chore: Publish crates 2023-06-14 05:01:49 +00:00
SWC Bot
db85bf3ee2 chore: Publish crates 2023-06-13 16:14:41 +00:00
SWC Bot
275db1baec chore: Publish crates 2023-06-13 03:39:28 +00:00
SWC Bot
08574e690b chore: Publish crates 2023-06-12 08:04:50 +00:00
SWC Bot
96895b1f3f chore: Publish crates 2023-06-12 06:49:35 +00:00
Donny/강동윤
aa83584634
refactor(es/ast): Reimplement optional chaining (#7441)
**Related issue:**

 - Closes #7003.
 - Closes #7156.
2023-06-12 06:47:40 +00:00
SWC Bot
d8f5158963 chore: Publish crates 2023-06-12 02:24:36 +00:00
SWC Bot
cea1237c5e chore: Publish crates 2023-06-12 01:39:32 +00:00
SWC Bot
b46bcf3f50 chore: Publish crates 2023-06-08 05:08:56 +00:00
SWC Bot
37634a758d chore: Publish crates 2023-06-08 04:15:29 +00:00
Austaras
7f9f0b8bce
fix(es/minifier): Infect mutation when assigning a property (#7503) 2023-06-08 04:13:42 +00:00
SWC Bot
89bee900e4 chore: Publish crates 2023-06-07 05:10:31 +00:00
David Sherret
064bcf4854
fix(es/codegen): Remove extra spaces in AssignPatProp and KeyValuePatProp (#7488)
Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
2023-06-07 05:08:35 +00:00
SWC Bot
f634c3ad2f chore: Publish crates 2023-06-07 04:25:48 +00:00
Austaras
62075faeaa
feat(es/minifier): Remove unused labels (#7478) 2023-06-07 04:23:40 +00:00
SWC Bot
b6b4b0fd2e chore: Publish crates 2023-06-07 03:03:16 +00:00
SWC Bot
61dc611da3 chore: Publish crates 2023-06-05 04:47:07 +00:00
SWC Bot
9de08611e1 chore: Publish crates 2023-06-02 15:24:25 +00:00
Donny/강동윤
65ce5d1081
perf(es/minifier): Make minifier not overly generic (#7483)
**Description:**

Generics cause binary bloat.

**Related issue:**

 - https://github.com/vercel/next.js/pull/50365
2023-06-03 00:22:30 +09:00
SWC Bot
d6bbbc332d chore: Publish crates 2023-05-31 01:59:26 +00:00
Donny/강동윤
e506635f74
fix(es/minifier): Don't generate generator arrows (#7466)
**Related issue:**

 - Closes #7457.
2023-05-31 01:57:13 +00:00
SWC Bot
a63905aa2c chore: Publish crates 2023-05-30 05:18:06 +00:00
SWC Bot
076b4d4023 chore: Publish crates 2023-05-30 03:24:10 +00:00
SWC Bot
a85816d505 chore: Publish crates 2023-05-25 04:54:11 +00:00
SWC Bot
8d52500a9a chore: Publish crates 2023-05-25 04:00:53 +00:00
Austaras
0cd2b61b05
feat(es/minifier): Inline for loop variables (#7445) 2023-05-25 03:59:02 +00:00
SWC Bot
6c3ff01a53 chore: Publish crates 2023-05-24 07:48:00 +00:00
SWC Bot
c1f2b4a09f chore: Publish crates 2023-05-24 06:59:37 +00:00
SWC Bot
b95cd8444e chore: Publish crates 2023-05-24 06:27:35 +00:00
SWC Bot
f9f0cc2380 chore: Publish crates 2023-05-24 05:44:06 +00:00
SWC Bot
8872b41272 chore: Publish crates 2023-05-23 06:25:54 +00:00
SWC Bot
47114702ef chore: Publish crates 2023-05-23 05:30:42 +00:00
SWC Bot
12b966ea21 chore: Publish crates 2023-05-22 03:23:50 +00:00
SWC Bot
b2c9bb47a0 chore: Publish crates 2023-05-19 04:37:45 +00:00
Austaras
40d2bf7ec3
fix(es/minifier): Prevent inlining vars assigned outside current function scope (#7414)
**Related issue:**

 - Closes #7412.
2023-05-19 13:35:50 +09:00
SWC Bot
135c4fd16b chore: Publish crates 2023-05-18 08:20:26 +00:00
SWC Bot
31d7b88555 chore: Publish crates 2023-05-18 01:21:08 +00:00
Austaras
5dbbbea2ef
fix(es/minifier): Mark all function params as potential property mutation (#7409)
**Description:**

This issue is more severe than I originally thought. It raises not in
array indexing, but in function calls and property mutation. We should
treat all function arguments as potentially be property mutated,
otherwise following example

```js
class A {
	a = 1

	toString() {
		return this.a
	}
}

const a = new A()

function foo(x) {
	x.a++
}

const b = a + 1

foo(a)

console.log(b)
```

would be error(It should log 2, but logs 3 after compress).

As the result, massive regressions is unavoidable, since some of these
optimizations may indeed cause error. Part of them can be mitigated with
following optimization -- allow inline of ident even if its original
value is mutated. Consider

```js
export function foo(x) {
   const y = x
   x.a = 1
   y.b = 2
}
```

If x is a primitive value, all mutations to its properties are ignored;
if x is a object, then y refers to the same object no matter what
mutation is performed.

And there's still room for more, currently following code
```js
export function foo(x) {
    const y = Math.floor(x);
    g(y);
}
```
But I'd rather do it in a separate PR.


**Related issue:**

 - Closes #7402.
2023-05-18 01:19:17 +00:00
SWC Bot
a2a544a0ae chore: Publish crates 2023-05-17 13:12:20 +00:00
SWC Bot
8052d4dabd chore: Publish crates 2023-05-17 04:53:45 +00:00
SWC Bot
da0c612d85 chore: Publish crates 2023-05-16 05:18:57 +00:00
SWC Bot
d3db7edd51 chore: Publish crates 2023-05-16 04:14:36 +00:00
Donny/강동윤
f9cdd741c2
test(es/minifier): Enable more terser tests (#7396) 2023-05-16 03:21:08 +00:00
SWC Bot
5e3d156aca chore: Publish crates 2023-05-15 03:20:03 +00:00
SWC Bot
5d30437206 chore: Publish crates 2023-05-15 02:27:59 +00:00
SWC Bot
a71d5b2180 chore: Publish crates 2023-05-14 05:23:11 +00:00
SWC Bot
e88ae37a0c chore: Publish crates 2023-05-12 00:47:49 +00:00
SWC Bot
7655aaa42a chore: Publish crates 2023-05-11 14:02:24 +00:00
SWC Bot
65785bdf21 chore: Publish crates 2023-05-10 04:19:21 +00:00
Donny/강동윤
041b491466
feat(es/parser): Implement explicit resource management (#7322)
**Description:**

 - Add `UsingDecl`.
 - Add `UsingDecl` to `Decl`.
 - Rename `VarDeclOrPat` to `ForHead`.
 - Add `UsingDecl` to `ForHead`.
 - Implement parser for using declarations.

**Related issue:**

 - #7316.
2023-05-10 04:16:44 +00:00
SWC Bot
6432e1f5c5 chore: Publish crates 2023-05-10 03:33:12 +00:00
Donny/강동윤
1dced17998
fix(es/minifier): Fix remapping of vars upon inlining (#7362)
**Related issue:**

 - Closes #7331.
2023-05-10 03:31:15 +00:00
SWC Bot
e1c9182e1c chore: Publish crates 2023-05-09 05:47:00 +00:00
SWC Bot
7fc9b00443 chore: Publish crates 2023-05-08 03:40:27 +00:00
SWC Bot
aef5ac4812 chore: Publish crates 2023-05-06 03:56:38 +00:00
SWC Bot
e9f3371c5f chore: Publish crates 2023-05-02 02:13:33 +00:00
SWC Bot
4ad18beca3 chore: Publish crates 2023-04-29 13:48:25 +00:00
SWC Bot
767284e27f chore: Publish crates 2023-04-29 13:28:01 +00:00
SWC Bot
b80ceaed03 chore: Publish crates 2023-04-29 13:21:14 +00:00
Donny/강동윤
246300ae25
feat(es/minifier): Drop expressions using sequential inliner (#6936) 2023-04-29 22:19:00 +09:00
SWC Bot
e7911ee594 chore: Publish crates 2023-04-26 01:25:19 +00:00
SWC Bot
d67f9bfd75 chore: Publish crates 2023-04-25 10:06:32 +00:00
SWC Bot
923ed13b6a chore: Publish crates 2023-04-24 09:25:42 +00:00
SWC Bot
51f3840609 chore: Publish crates 2023-04-24 05:25:39 +00:00
SWC Bot
5400648de8 chore: Publish crates 2023-04-24 04:17:24 +00:00
SWC Bot
f2a38e808a chore: Publish crates 2023-04-21 06:13:37 +00:00
SWC Bot
c8e6774070 chore: Publish crates 2023-04-20 08:28:29 +00:00
SWC Bot
af8e158948 chore: Publish crates 2023-04-20 07:35:26 +00:00
SWC Bot
7fd1e93434 chore: Publish crates 2023-04-19 21:54:39 +00:00
SWC Bot
0e4d764f90 chore: Publish crates 2023-04-19 11:27:00 +00:00
SWC Bot
0d4fe74ab5 chore: Publish crates 2023-04-19 07:24:45 +00:00
Donny/강동윤
0aab90c005
fix(es/minifier): Fix a inliner bug related to Script (#7288)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7287.
2023-04-19 07:22:48 +00:00
SWC Bot
1c530b8919 chore: Publish crates 2023-04-18 02:46:59 +00:00
SWC Bot
f7355420dd chore: Publish crates 2023-04-15 14:52:40 +00:00
Donny/강동윤
4c06a56e52
fix(es/minifier): Use UTF16 length for str.length (#7275)
**Related issue:**

 - Closes #7274.
2023-04-15 14:50:52 +00:00
SWC Bot
d90d14fc23 chore: Publish crates 2023-04-15 13:58:51 +00:00
SWC Bot
9e752bd1aa chore: Publish crates 2023-04-15 04:21:44 +00:00
Austaras
93a264c9a4
fix(es/renamer): Ensure that param and function body are in same scope (#7271)
**Description:**

The problem arises in L235 of swc_ecma_transforms_base/src/rename/mod.rs

```rs
unit!(visit_mut_fn_decl, FnDecl, true);
```

which calls `get_map` and evals to

```rs
node.visit_children_with(&mut v);
```

with `FnDecl` and `Analyzer` in L132. However, in `Analyzer`, a visit to raw function was not overloaded, so function arguments and function body are considered different scopes.

**Related issue:**

 - Closes #7261.
2023-04-15 04:19:52 +00:00
SWC Bot
42c4b07f34 chore: Publish crates 2023-04-15 03:29:04 +00:00
SWC Bot
db9320c051 chore: Publish crates 2023-04-15 02:19:38 +00:00
SWC Bot
5f0660667f chore: Publish crates 2023-04-14 23:50:14 +00:00
SWC Bot
e6cffb7581 chore: Publish crates 2023-04-13 08:41:47 +00:00
SWC Bot
8fc527343b chore: Publish crates 2023-04-13 05:52:04 +00:00
SWC Bot
604667d522 chore: Publish crates 2023-04-13 03:25:23 +00:00
Donny/강동윤
a44fea1ec8
fix(es/minifier): Fix handling of optional chaining when hoist_props is enabled (#7246)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7228.
2023-04-13 03:23:29 +00:00
SWC Bot
8e5cb60183 chore: Publish crates 2023-04-12 12:33:03 +00:00
SWC Bot
d4782ee526 chore: Publish crates 2023-04-12 11:46:53 +00:00
SWC Bot
f31f67c7fb chore: Publish crates 2023-04-11 07:05:27 +00:00
SWC Bot
33ff2ba7c4 chore: Publish crates 2023-04-11 04:50:23 +00:00
Donny/강동윤
559d1202bc
feat(es/minifier): Support PURE comment of seq exprs (#7245)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7241.
2023-04-11 04:48:11 +00:00
SWC Bot
80e125a386 chore: Publish crates 2023-04-11 02:13:17 +00:00
SWC Bot
2a662350e6 chore: Publish crates 2023-04-10 10:47:52 +00:00
SWC Bot
ab9e793fa8 chore: Publish crates 2023-04-10 08:48:13 +00:00
SWC Bot
2204b7809b chore: Publish crates 2023-04-10 03:42:39 +00:00
SWC Bot
bb80c659b3 chore: Publish crates 2023-04-07 01:46:34 +00:00
SWC Bot
4b9cfbb4dd chore: Publish crates 2023-04-06 13:48:37 +00:00
SWC Bot
150e54dc3a chore: Publish crates 2023-04-06 08:56:53 +00:00
SWC Bot
c6b28f91cc chore: Publish crates 2023-04-05 05:17:51 +00:00
SWC Bot
a22a8a70ed chore: Publish crates 2023-04-05 04:37:50 +00:00
Donny/강동윤
73bc29eeb0
fix(es/minifier): Don't remove used var decl (#7200)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7194.
2023-04-05 04:35:37 +00:00
SWC Bot
c8fca9a054 chore: Publish crates 2023-04-04 03:07:51 +00:00
SWC Bot
ad7daddeb8 chore: Publish crates 2023-04-04 01:50:35 +00:00
SWC Bot
ae2362e97b chore: Publish crates 2023-04-03 08:15:39 +00:00
SWC Bot
a679dbe9aa chore: Publish crates 2023-04-02 22:16:24 +00:00
SWC Bot
b7366fd5ce chore: Publish crates 2023-04-01 05:42:08 +00:00
SWC Bot
b94fbed4c9 chore: Publish crates 2023-03-31 06:17:53 +00:00
magic-akari
3ca954b9f9
fix(es/helpers): Use snake_case for helpers (#7147)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7144.
 - Closes https://github.com/swc-project/swc/issues/7118.
2023-03-31 15:15:21 +09:00
SWC Bot
7d69b79a9e chore: Publish crates 2023-03-31 03:23:35 +00:00
SWC Bot
bf1e55d27b chore: Publish crates 2023-03-30 08:48:31 +00:00
SWC Bot
6a015550ba chore: Publish crates 2023-03-30 08:40:29 +00:00
SWC Bot
b1fb6b655f chore: Publish crates 2023-03-30 08:08:20 +00:00
Donny/강동윤
0259a7465f
build(cargo): Update rustc to nightly-2023-03-20 (#7170)
**Description:**

This PR also updates `rkyv` to `=0.7.40`.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6807.
2023-03-30 08:06:02 +00:00
SWC Bot
44062d6fa5 chore: Publish crates 2023-03-29 08:50:54 +00:00
Donny/강동윤
12546c853a
build(cargo): Revert rustc upgrade (#7162)
**Description:**

The `rkyv` bug is not fixed.
2023-03-29 17:48:45 +09:00
SWC Bot
d74103739a chore: Publish crates 2023-03-29 06:26:30 +00:00
Donny/강동윤
e445502072
build(cargo): Update rustc to nightly-2023-03-28 (#7154)
**Description:**

This PR also updates `rkyv` to `=0.7.40`.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6807.
2023-03-29 06:24:19 +00:00
SWC Bot
03f7a2d8d7 chore: Publish crates 2023-03-27 06:41:36 +00:00
SWC Bot
47f15f9f28 chore: Publish crates 2023-03-27 06:04:11 +00:00
SWC Bot
8fe52a12b3 chore: Publish crates 2023-03-27 04:31:35 +00:00
Donny/강동윤
30bc086052
refactor(ast): Make serde optional (#7138)
**Description:**

Turbopack does not use `serde` of swc AST types.
2023-03-27 13:28:42 +09:00
Donny/강동윤
28261985b0
chore(cargo): Refactor Cargo.toml to reduce merge conflict (#7139) 2023-03-24 13:46:42 +09:00
SWC Bot
6635d54128 chore: Publish crates 2023-03-24 02:42:16 +00:00
SWC Bot
4eef5532a4 chore: Publish crates 2023-03-23 09:42:52 +00:00
SWC Bot
b178ff5661 chore: Publish crates 2023-03-23 09:19:33 +00:00
SWC Bot
42f71431bf chore: Publish crates 2023-03-23 05:19:01 +00:00
SWC Bot
e77bc0a62f chore: Publish crates 2023-03-23 04:39:01 +00:00
SWC Bot
f81ac50c2a chore: Publish crates 2023-03-23 04:00:14 +00:00
SWC Bot
0195f536ef chore: Publish crates 2023-03-22 11:50:07 +00:00
SWC Bot
8c5a1f140a chore: Publish crates 2023-03-22 06:33:46 +00:00
Donny/강동윤
6d9763e8c0
fix(es/renamer): Don't use symbols used by declarations if eval exists (#7116)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6971.
 - Closes https://github.com/swc-project/swc/issues/7094.
2023-03-22 06:31:43 +00:00
SWC Bot
e37666bb6e chore: Publish crates 2023-03-22 02:26:23 +00:00
Donny/강동윤
610e1bb581
fix(es/minifier): Don't inline into arrow heads (#7099)
**Related issue:**

 - https://github.com/vercel/next.js/issues/47005
2023-03-22 02:24:13 +00:00
SWC Bot
1aa9a98b27 chore: Publish crates 2023-03-21 09:29:42 +00:00
SWC Bot
212af9b0a7 chore: Publish crates 2023-03-21 08:48:30 +00:00
Donny/강동윤
6a570a334c
fix(es/ast): Fix EqIgnoreSpan impl of Number (#7112)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7111.
2023-03-21 08:46:22 +00:00
SWC Bot
cda09e44c3 chore: Publish crates 2023-03-21 07:21:46 +00:00
SWC Bot
f40175b960 chore: Publish crates 2023-03-20 05:30:14 +00:00
SWC Bot
85c51a81e7 chore: Publish crates 2023-03-20 02:03:09 +00:00
SWC Bot
d6cc123d62 chore: Publish crates 2023-03-19 02:59:07 +00:00
Austaras
0f09e356c3
feat(es/resolver): Make scope context identical to the vars (#7095) 2023-03-19 11:57:14 +09:00
SWC Bot
17356bca25 chore: Publish crates 2023-03-17 03:24:05 +00:00
Anders Kaseorg
493a4f7042
fix(es/minifier): Remove wrong optimization of new RegExp(…) (#7091) 2023-03-17 03:22:02 +00:00
SWC Bot
8902741084 chore: Publish crates 2023-03-17 02:40:31 +00:00
SWC Bot
5f4fea2a5b chore: Publish crates 2023-03-16 03:37:09 +00:00
SWC Bot
60ccdab60e chore: Publish crates 2023-03-16 02:20:24 +00:00
SWC Bot
b14e6b9e54 chore: Publish crates 2023-03-15 02:33:33 +00:00
Donny/강동윤
86295ba8f2
fix(es/minifier): Preserve delete of unresolved variables (#7072)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7045.
2023-03-15 02:31:08 +00:00
Donny/강동윤
963c460613
refactor: Fix lints using clippy from nightly-2023-03-13 (#6920) 2023-03-14 04:56:21 +00:00
SWC Bot
6bf5f03884 chore: Publish crates 2023-03-13 08:34:46 +00:00
SWC Bot
3da6d18d47 chore: Publish crates 2023-03-13 03:27:50 +00:00
SWC Bot
45fba897c6 chore: Publish crates 2023-03-13 01:59:04 +00:00
SWC Bot
136c498c80 chore: Publish crates 2023-03-12 04:52:09 +00:00
SWC Bot
4015714633 chore: Publish crates 2023-03-12 03:57:57 +00:00
SWC Bot
2486e6b6bf chore: Publish crates 2023-03-11 12:14:51 +00:00
SWC Bot
fa627e178a chore: Publish crates 2023-03-11 10:43:53 +00:00
SWC Bot
0b0e61beb6 chore: Publish crates 2023-03-11 03:44:48 +00:00
SWC Bot
fd26f467a1 chore: Publish crates 2023-03-11 00:32:35 +00:00
SWC Bot
d4ebb5e6ef chore: Publish crates 2023-03-10 06:28:00 +00:00
SWC Bot
02e9e49733 chore: Publish crates 2023-03-10 03:54:16 +00:00
SWC Bot
e0d4220264 chore: Publish crates 2023-03-09 14:21:23 +00:00
SWC Bot
03488a3fb6 chore: Publish crates 2023-03-09 13:36:17 +00:00
Donny/강동윤
a9fe1d2d22
perf(es/ast): Shrink size of Expr (#7041)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7019.
2023-03-09 13:34:11 +00:00
Donny/강동윤
f378a14888
perf(es/parser): Use SmartString as the buffer (#7033) 2023-03-09 08:07:40 +00:00
SWC Bot
0f09789c43 chore: Publish crates 2023-03-08 06:52:40 +00:00
HeYunfei
8bfef35c1b
perf(es/utils): Introduce NodeIgnoringSpan (#7030) 2023-03-08 06:49:41 +00:00
SWC Bot
50ee7d1c83 chore: Publish crates 2023-03-08 04:57:40 +00:00
SWC Bot
56aac6783b chore: Publish crates 2023-03-08 02:51:08 +00:00
SWC Bot
79549c0f20 chore: Publish crates 2023-03-07 14:50:22 +00:00
SWC Bot
e93c79b479 chore: Publish crates 2023-03-07 04:13:14 +00:00