Commit Graph

76 Commits

Author SHA1 Message Date
David Sherret
e0bdc0f7c2
fix(es/codegen): Emit ? for an optional computed property (#8481)
**Description:**

Emits optional `?` for a computed property.
2024-01-04 04:48:07 +00:00
David Sherret
d98a28290b
fix(es/codegen): Emit implements clause with commas (#8477) 2024-01-03 06:56:46 +00:00
David Sherret
2076ef8f35
fix(es/codegen): Emit declare keyword for class properties (#8478) 2024-01-03 14:40:01 +09:00
David Sherret
a12eaae0e5
fix(es/codegen): Emit abstract keyword (#8479) 2024-01-03 04:43:45 +00:00
David Sherret
0dd96f85e2
fix(es/codegen): Emit override keyword (#8449)
**Description:**

Emits the `override` keyword.
2023-12-24 10:30:46 +09:00
David Sherret
65dec905c0
fix(es/codegen): Fix codegen of type-only export declarations (#8447)
**Description:**

This fixes the emit for `export type { } from "..."` and `export { type A } from "..."`.
2023-12-22 12:25:52 +09:00
David Sherret
7566ddf0b7
fix(es/codegen): Fix codegen of ts specific syntax in class props (#8426)
**Description:**

This fixes the codegen of private properties with `is_optional` or `definite` and class properties with `definite`.
2023-12-17 06:47:20 +00:00
Redfire
c2d1a6c9fe
chore(deps): Update base64 to v0.21 (#8369) 2023-12-02 11:40:56 +00:00
David Sherret
369fb21e22
fix(es/codegen): Fix codegen of type args of an import type and a type query (#8296) 2023-11-16 02:01:15 +00:00
Donny/강동윤
14ea705f27
build(cargo): Update rustc to nightly-2023-11-04 (#8221)
**Breaking Changes**:

 - `Mark::default()` is now identical as `Mark::new()`.

**Description:**

I want to see if inlining is improved
2023-11-04 21:47:10 +00:00
Donny/강동윤
1a26be2a27
feat(es/codegen): Respect ascii_only: false for StrLit (#8217)
**Related issue:**

 - Closes #8189
2023-11-04 04:15:58 +00:00
Donny/강동윤
39c680d814
fix(es/codegen): Fix codegen of unicode surrogates (#7985)
**Description:**


x-ref: https://vercel.slack.com/archives/C02HY34AKME/p1695334071194139


Reproduction: https://github.com/kdy1/repro-test-mdx-korean



Regression of next.js: `v13.4.11`(swc_core@v0.79.13) => `v13.5.2`
(swc_core@v0.83.12)


 - `next@v13.4.19` works (swc_core@v0.79.59)
 - `next@v13.4.20-canary.3` works (swc_core@v0.79.70)
 -  **`next@v13.4.20-canary.32` fails** (swc_core@v0.83.12)

Commit range:
662f236aa5...e67bf05f9d

- `swc_core@v0.79.70`:
662f236aa5
- `swc_core@v0.83.12`:
e67bf05f9d

Diff: https://gist.github.com/kdy1/047e7e5537c34180d446cb3d5b95fce8

---

I did more investigation by monkey-patching the `next` package.
`.minify()` resolved without an exception.
It means that `.minify()` is producing an invalid ES code.

So... candidates are

 - https://github.com/swc-project/swc/pull/7890
 - https://github.com/swc-project/swc/pull/7876
 - https://github.com/swc-project/swc/pull/7858
 - https://github.com/swc-project/swc/pull/7856
 - https://github.com/swc-project/swc/pull/7853
 - https://github.com/swc-project/swc/pull/7832
2023-09-25 23:36:05 +00:00
Donny/강동윤
ee7575695d
feat(es/codegen): Add an option to print assert for import attributes (#7914)
**Description:**

- `jsc.experimental.keepImportAssertions` is renamed to `jsc.experimental.keepImportAttributes`.
 - `jsc.experimental.emitAssertForImportAttributes` is added.

**Related issue:**

 - Closes #7908
2023-09-05 21:24:25 +09:00
Donny/강동윤
4d3fcb86e4
feat(es/ast): Support import attributes proposal (#7868)
**Related issue:**

 - Closes #7179
2023-08-28 00:29:45 +00:00
Donny/강동윤
f27838dedc
fix(es/codegen): Fix regression of source maps (#7523)
**Related issue:**

 - Closes #7506.
2023-06-13 16:12:45 +00:00
廖应龙
a0da02d0ff
fix(es/codegen): Emit type arguments of jsx element names (#7522) 2023-06-13 03:37:39 +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
David Sherret
3935d02e36
fix(es/codegen): Emit ; for TsImportEqualsDecl (#7464) 2023-05-30 03:22:07 +00:00
Donny/강동윤
40ba242076
fix(es/codegen): Do not create duplicate source map entry (#7309) 2023-05-16 04:12:46 +00:00
David Sherret
0ca05d8b69
fix(es/codegen): Fix codegen of TsModuleDecl (#7319) 2023-04-24 04:15:08 +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
Donny/강동윤
12546c853a
build(cargo): Revert rustc upgrade (#7162)
**Description:**

The `rkyv` bug is not fixed.
2023-03-29 17:48:45 +09: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
magic-akari
8353accb13
fix(es/codegen): Emit type_params for TsConstructSignatureDecl (#7080)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7079.
2023-03-17 02:38:45 +00:00
Donny/강동윤
367ac825f6
refactor(es/parser): Make lexer not generic over Input (#6993)
**Description:**

Currently, it uses `StringInput` as the input type, but I'll refactor it to use `String` or `Vec<u8>` directly to optimize it further.

**Related issue:**

 - https://github.com/swc-project/swc/discussions/6991
2023-02-28 08:20:29 +00:00
Donny/강동윤
df702614e1
fix(es/codegen): Fix codegen of string literals with \x000 (#6838)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6836.
2023-01-20 08:08:58 +00:00
westhide
e9fdac216c
fix(es/codegen): Skip space if jsx attrs is empty (#6823) 2023-01-16 15:23:28 +00:00
Kevin Barabash
5c53a74f55
fix(es/codegen): Fix codegen of TypeScript mapped types (#6621) 2022-12-12 01:58:08 +00:00
Alexander Akait
68d76afe5d
fix(es/codegen): Don't print trailing coma for a rest argument (#6610)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6589.
2022-12-10 00:51:11 +00:00
Donny/강동윤
0967e8f06d
chore(ci): Enforce clippy for all targets (#6299) 2022-10-31 16:59:29 +09:00
Kevin Barabash
083924c0e1
fix(es/codegen): Emit readonly for TsIndexSignature (#6172) 2022-10-16 08:56:56 +09:00
IWANABETHATGUY
8003dc8563
feat(es/codegen): Remove the trailing comma of binding patterns (#6078) 2022-10-07 16:45:20 +09: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/강동윤
2ba88154fc
fix(es/codegen): Align sourcemap with terser (#5657) 2022-09-26 18:12:42 +09:00
Donny/강동윤
1a182ef8d9
perf(es): Optimize memory layout of AST (#5829) 2022-09-20 12:47:21 +09: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/강동윤
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
magic-akari
2b2464271a
fix(es/codegen): Remove redundant ; after export default decl (#5851) 2022-09-14 06:07:15 +00:00
RiESAEX
8adbe1675e
fix(es/parser): Keep comments of the RHS of a binary expression (#5812) 2022-09-11 02:58:06 +00:00
Donny/강동윤
537449e53b
fix(es/codegen): Emit trailing semicolon (#5659) 2022-08-29 10:10:55 +00:00
Austaras
e37b7e8caa
feat(es/codegen): Remove more whitespaces from BinExpr (#5380) 2022-08-04 16:52:06 +09:00
magic-akari
42d8ad26ce
fix(es/codegen): Emit type parameters of class super expression (#5338) 2022-07-29 11:52:13 +00:00
Donny/강동윤
14894ed4c9
fix(atoms): Workaround a bug of rkyv (#5323) 2022-07-28 11:41:15 +09:00
magic-akari
daac26bcfb
fix(es/codegen): Add ; for a generator function (#5292) 2022-07-26 03:05:42 +00:00
Austaras
3f0856db2e
feat(es/codegen): Optimize number and bigint literal (#5223) 2022-07-18 03:27:03 +00:00
Donny/강동윤
b76b4999cc
fix(es/codegen): Fix codegen of some non-ascii characters (#5108) 2022-07-05 10:22:25 +00:00
magic-akari
8df6e047cc
fix(es/codegen): Emit numeric value for Binary and Octal literals (#5083) 2022-07-04 03:49:52 +00:00
magic-akari
ea46eb41e0
fix(es/codegen): Fix numeric literals (#4733) 2022-05-21 14:14:33 +00:00
Donny/강동윤
f1baff4114
fix(es/codegen): Fix numeric literals (#4731) 2022-05-21 20:31:19 +09:00
Kevin Barabash
72fbf692a4
fix(es/codegen): Don't add a newline after an arrow body (#4711) 2022-05-19 07:12:37 +00:00