Commit Graph

1747 Commits

Author SHA1 Message Date
SWC Bot
f7baf240ba chore: Bump crates 2024-02-07 07:25:27 +00:00
SWC Bot
927b14a2e4 chore: Bump crates 2024-02-07 03:27:01 +00:00
Donny/강동윤
3122e944a8
feat(es/minifier): Implement correct hoist_props (#8593)
**Description:**

 - The option `hoist_props` now does what it's supposed to do.
- Dropping of unused properties now does not drop properties too aggressively.
- The initializer of a dropped variable declaration is now properly visited.
- Indexing with string literals is not marked as a dynamic index anymore. This is required to handle codes like c3f67ceb1e/crates/swc_ecma_minifier/tests/terser/compress/hoist_props/name_collision_1/input.js (L1-L7).
2024-02-07 03:25:27 +00:00
SWC Bot
7a3b5545cd chore: Bump crates 2024-02-06 02:47:51 +00:00
SWC Bot
3ee12cf56d chore: Bump crates 2024-02-06 02:12:03 +00:00
SWC Bot
48524e2ae8 chore: Bump crates 2024-02-05 06:34:30 +00:00
Donny/강동윤
7f2a2c1e40
refactor(es/ast): Improve type definitions of patterns (#8532)
**Description:**

 - Copy `AssignmentTarget` from `oxc`.
 - Use `BindingIdentifier` in more places.

**Related issue:**
 
 - Closes #8026
2024-02-05 15:32:52 +09:00
SWC Bot
47e7b89a1b chore: Bump crates 2024-02-04 06:19:41 +00:00
Donny/강동윤
fd997d3712
feat(es/minifier): Respect more options (#8582)
**Description:**

This PR makes the ES minifier respect more options.

Changes:
 - `reduce_vars` now enables IIFE invoker.
 - `reduce_vars` now enables seq inliner.
 - `top_retain` is now respected by seq inliner.
 - `arguments` is now ignored by seq inliner.

---------

Co-authored-by: austaras <austaras@outlook.com>
2024-02-02 12:35:58 +00:00
Donny/강동윤
a7c5255ad1
fix(es/minifier): Fix top-level check (#8583)
**Description:**

Our logic for checking top-level was wrong.
2024-02-02 01:45:41 +00:00
SWC Bot
ef21736584 chore: Bump crates 2024-02-02 01:19:28 +00:00
SWC Bot
386c391081 chore: Bump crates 2024-02-02 00:43:47 +00:00
Donny/강동윤
18e0b53fbb
feat(es/minifier): Inline more IIFE arguments (#8584)
**Description:**

We can inline more.
2024-02-02 09:42:15 +09:00
SWC Bot
429c1bae44 chore: Bump crates 2024-01-31 08:50:09 +00:00
SWC Bot
f5ee6d1d7f chore: Bump crates 2024-01-30 04:42:21 +00:00
Donny/강동윤
8b86638970
test(es/minifer): Update the passing terser test list (#8573) 2024-01-30 04:40:52 +00:00
SWC Bot
ba1da1de3c chore: Bump crates 2024-01-29 10:27:13 +00:00
SWC Bot
a5c56a9e14 chore: Bump crates 2024-01-28 12:35:38 +00:00
Donny/강동윤
07634a05ba
fix(es/codegen): Do not produce octal literals (#8565) 2024-01-28 12:34:03 +00:00
SWC Bot
160043a2d3 chore: Bump crates 2024-01-27 04:57:56 +00:00
SWC Bot
5f9b7b4c8b chore: Bump crates 2024-01-25 07:20:48 +00:00
SWC Bot
c3fd9d081e chore: Bump crates 2024-01-24 02:04:25 +00:00
Donny/강동윤
043ee85d08
fix(common): Fix source map generation with inputSourceMap (#8546)
**Description:**

- This PR fixes the source map generation when `inputSourceMap` is specified.
- This PR fixes `minify()` not accepting parsed source map in the option.


**Related issue:**

 - Closes #8372.
2024-01-24 02:02:45 +00:00
Donny/강동윤
aa70131c55
fix(es/minifier): Fix a bug related to inliner and the variable scoping (#8542)
**Related issue:**

 - Closes #8246
2024-01-24 01:12:02 +00:00
SWC Bot
2d15177ca9 chore: Bump crates 2024-01-23 08:38:01 +00:00
SWC Bot
12be23cfb5 chore: Bump crates 2024-01-23 04:25:38 +00:00
SWC Bot
990f291d43 chore: Bump crates 2024-01-21 15:30:11 +00:00
SWC Bot
9c23f1cf38 chore: Bump crates 2024-01-21 12:37:38 +00:00
SWC Bot
6210bf19de chore: Bump crates 2024-01-21 03:08:11 +00:00
SWC Bot
1ca0d65c29 chore: Bump crates 2024-01-21 02:34:11 +00:00
SWC Bot
e63a5c7e95 chore: Bump crates 2024-01-19 02:14:55 +00:00
Donny/강동윤
9f1ce3acd6
fix(es/codegen): Fix codegen of \\0 (#8433)
**Related issue:**

 - Closes #8431
2024-01-19 02:11:05 +00:00
SWC Bot
fefe9636f0 chore: Publish crates 2024-01-19 01:27:20 +00:00
SWC Bot
3c00098dbe chore: Publish crates 2024-01-19 00:45:54 +00:00
Donny/강동윤
4946a11137
fix(es/minifier): Fix a bug in tpl string <-> string logic (#8510)
**Related issue:**

 - Closes #8496
2024-01-19 00:44:19 +00:00
SWC Bot
0763e7e6d6 chore: Publish crates 2024-01-16 04:43:01 +00:00
SWC Bot
99d74f319f chore: Publish crates 2024-01-16 04:01:42 +00:00
SWC Bot
37d36eb24b chore: Publish crates 2024-01-14 08:12:45 +00:00
SWC Bot
9cf91a375b chore: Publish crates 2024-01-09 18:56:56 +00:00
Donny/강동윤
f7c4934e59
fix(es/minifier): Correctly escape more characters (#8490)
**Related issue:**

 - Closes #8484
2024-01-09 18:55:25 +00:00
SWC Bot
a73ddc221e chore: Publish crates 2024-01-09 18:27:36 +00:00
SWC Bot
d9a79a0a39 chore: Publish crates 2024-01-04 12:28:02 +00:00
SWC Bot
4e860c988d chore: Publish crates 2024-01-04 04:49:50 +00:00
SWC Bot
8997ed1547 chore: Publish crates 2024-01-04 04:25:54 +00:00
Austaras
82bd8070cb
fix(es/resolver): Resolve top-level undefined, NaN, and Infinity correctly (#8471)
**Description:**

For following code
```js
var NaN = 1
console.log(NaN)
```
Result would be

|Envirnoment|Result|
|-|-|
|Non strict script(browser, nodejs repl)|NaN|
|Non strict script(nodejs script)|1|
|Strict script(browser, nodejs repl)|runtime error|
|Strict script(nodejs script)|1|
|ESM|1|

So SWC choose to behave like browser in script mode and confirm to esm
standard.


**Related issue:**

 - Closes #8465
2024-01-04 04:24:14 +00:00
SWC Bot
68b9646681 chore: Publish crates 2024-01-03 20:18:10 +00:00
SWC Bot
f2ede40e38 chore: Publish crates 2024-01-03 06:58:23 +00:00
SWC Bot
cddb0165bb chore: Publish crates 2024-01-03 05:41:28 +00:00
SWC Bot
a4e91af934 chore: Publish crates 2024-01-03 04:45:13 +00:00
Austaras
b676e75cdd
test(es/minifier): Enable script mode for terser_exec and mangle (#8474) 2024-01-02 06:00:26 +00:00