Commit Graph

5843 Commits

Author SHA1 Message Date
Donny/강동윤
2c63b31143
test(es/parser): Add a test for << (#8634)
**Related issue:**

 - Closes #7621.
2024-02-13 06:33:11 +00:00
SWC Bot
6cca7cbfe8 chore: Bump crates 2024-02-13 05:14:07 +00:00
magic-akari
e5d6de0ea9
fix(es/compat): Visit AssignExpr right branch in FnEnvHoister (#8633)
**Related issue:**

- Closes #8632
2024-02-13 05:12:41 +00:00
SWC Bot
52b6fd8808 chore: Bump crates 2024-02-13 04:34:24 +00:00
Donny/강동윤
6726b631e6
build(cargo): Update rustc to nightly-2024-02-06 (#8618) 2024-02-13 13:32:49 +09:00
SWC Bot
9ad0f9fedb chore: Bump crates 2024-02-13 02:58:35 +00:00
David Sherret
21a447f35a
fix(es/decorators): Do not insert duplicate constructors (#8631)
**Description:**

Doesn't insert a duplicate ctor when the ctor uses overloads in TS.


**Related issue:** 

 - Closes #8630.
2024-02-13 02:57:03 +00:00
SWC Bot
89bd0c8f7d chore: Bump crates 2024-02-10 03:42:34 +00:00
Donny/강동윤
4e0d240895
build(plugin): Update wasmer to v4.2.5 (#8624)
**Description:**

This is required to update rustc.
2024-02-10 03:40:55 +00:00
SWC Bot
6270c52c55 chore: Bump crates 2024-02-08 05:59:42 +00:00
SWC Bot
906cca43c1 chore: Bump crates 2024-02-08 01:51:17 +00:00
Donny/강동윤
132be95173
fix(es/plugin): Fix schema version issue (#8621) 2024-02-08 10:49:38 +09:00
Donny/강동윤
95236e9abe
fix(es/parser): Fix detection of use strict directive (#8617)
**Description:**

Directives should be at the start of the file, and this PR changes the parser to match only at the start of a file.

**Related issue:**

 - Closes #8616.
2024-02-07 15:01:58 +00:00
SWC Bot
f7baf240ba chore: Bump crates 2024-02-07 07:25:27 +00:00
Donny/강동윤
c0beba7708
test(es): Update tsc conformance test suite (#8615) 2024-02-07 07:23:54 +00:00
SWC Bot
8febd34a76 chore: Bump crates 2024-02-07 03:54:31 +00:00
Donny/강동윤
e5585e99f1
chore(preset-env): Update browserslist-rs (#8614) 2024-02-07 03:52:42 +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
yannkaiser
9e6dad9baf
fix(es/parser): Rescan << as < when parsing type args (#8607)
**Description:**

The related issue is a product to the fact that the lexer sees a `<<`
token in `fun<<T>...` and therefore parses the type args as an arrow
function.

This PR adds the handling of the "split" of `<<` when beginning to parse
type args.

I am open for suggestions, I still find this a bit odd (in
`parse_ts_type_args()`):
```rs
if is!(p, "<<") {
    p.input.cut_lshift();
} else {
    expect!(p, '<');
}
```

**Related issue:**

 - Closes #7187
 - Closes #8209
 - Closes #8581
2024-02-06 14:31:14 +00:00
David Sherret
7d724d8ea3
fix(es/parser): Fix parsing of dynamic source phase imports (#8611) 2024-02-06 03:20:30 +00:00
SWC Bot
7a3b5545cd chore: Bump crates 2024-02-06 02:47:51 +00:00
David Sherret
5a773061db
fix(es/parser): Set class property to abstract or override even in error states (#8610)
**Description:**

Ensures that a class property with `abstract` or `override` is marked as such in the AST, even in error states.
2024-02-06 02:46:21 +00:00
SWC Bot
3ee12cf56d chore: Bump crates 2024-02-06 02:12:03 +00:00
David Sherret
d87fef0fea
chore(config): Remove an empty file in swc_config (#8609) 2024-02-06 02:10:31 +00:00
SWC Bot
7517c4f98f chore: Bump crates 2024-02-05 11:26:46 +00:00
Donny/강동윤
16e9d4ca31
fix(es/quote): Fix code generation of AssignTarget (#8604) 2024-02-05 20:25:09 +09:00
SWC Bot
ae6debdcb3 chore: Bump crates 2024-02-05 11:07:48 +00:00
Donny/강동윤
ef916614f1
fix(es/quote): Support AssignTarget, really (#8603) 2024-02-05 20:05:51 +09:00
SWC Bot
4f139d4f27 chore: Bump crates 2024-02-05 10:51:34 +00:00
Donny/강동윤
6a48be4b6b
fix(es/quote): Allow variables typed AssignTarget (#8602)
**Description:**

This is required to fix https://github.com/vercel/turbo/pull/7272


**Related issue:**

 - https://github.com/vercel/turbo/pull/7272
2024-02-05 19:50:03 +09:00
SWC Bot
94f7b3d378 chore: Bump crates 2024-02-05 08:53:54 +00:00
강동윤 (Donny)
d03f15cfc2 chore: Publish crates 2024-02-05 16:07:23 +09: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
magic-akari
d480ab9ae8
fix(es/resolver): Skip property in JSX member (#8598)
**Related issue:**

 - Close #8528
2024-02-04 06:17:52 +00:00
magic-akari
2a70a6b1d4
fix(es/typescript): Handle exported JSX binding name in TypeScript namespace (#8596)
**Related issue:**

 - Closes #8594
2024-02-03 02:10:21 +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/강동윤
872a47b851
test(es/testing): Ensure that test_inline! is working properly (#8590)
**Related issue:**

 - Closes #8586
2024-02-02 03:17:43 +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
yannkaiser
8413a6c48e
fix(es/lexer): Fix typo in package keyword (#8589)
**Description:**

There is a typo in the ES lexer for the keyword `package`.

**Related issue:**

- Closes #8588
2024-02-02 10:17:48 +09: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
Donny/강동윤
8c322250b7
fix(es/codegen): Fix codegen of async methods with decorators (#8575)
**Related issue:**

 - Closes #4311
2024-01-31 08:48:30 +00:00
SWC Bot
d006482bd9 chore: Bump crates 2024-01-31 04:38:19 +00:00
Donny/강동윤
82bc061b8c
fix(cli): Make Rust CLI use sourcemap code from the swc crate (#8576)
**Related issue:**

 - Closes #8495
2024-01-31 04:36:41 +00:00
Donny/강동윤
d81596cd2b
fix(es/proposals): Support using using keyword with functions (#8574)
**Related issue:**

 - Closes #8570
 - https://github.com/babel/babel/pull/16150
2024-01-30 15:55:43 +09:00