Commit Graph

666 Commits

Author SHA1 Message Date
SWC Bot
1f3726dc64 chore: Publish crates 2023-11-06 04:49:46 +00:00
Donny/강동윤
b745ed7ac8
perf(es/minifier): Remove needless operations for char freq analysis (#8222)
**Description:**

This skips a string search operation, which is quite costly, without affecting the output.
2023-11-06 13:46:43 +09:00
SWC Bot
48e5c9ad54 chore: Publish crates 2023-11-06 04:18:48 +00:00
SWC Bot
edb46c3c71 chore: Publish crates 2023-11-04 21:49:01 +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
SWC Bot
71448552e5 chore: Publish crates 2023-11-04 04:19: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
SWC Bot
4594a7bea4 chore: Publish crates 2023-11-04 01:37:57 +00:00
SWC Bot
2b35e6c159 chore: Publish crates 2023-11-02 22:20:35 +00:00
SWC Bot
b77d99d4b8 chore: Publish crates 2023-10-30 01:41:47 +00:00
SWC Bot
67b0a7f258 chore: Publish crates 2023-10-25 23:01:44 +00:00
SWC Bot
5450f5808a chore: Publish crates 2023-10-23 22:03:16 +00:00
SWC Bot
6f9c6424d7 chore: Publish crates 2023-10-20 13:33:17 +00:00
SWC Bot
34b01672ad chore: Publish crates 2023-10-18 04:24:27 +00:00
SWC Bot
1183c32e3c chore: Publish crates 2023-10-11 14:05:36 +00:00
SWC Bot
34e03c4661 chore: Publish crates 2023-10-08 00:41:50 +00:00
Donny/강동윤
a5621bb30a
chore(xtask): Migrate scripts to xtask (#8072)
This PR adds

 - `xtask clean`
 - `xtask bench`
2023-10-06 14:44:53 +00:00
SWC Bot
5c6c82bc6a chore: Publish crates 2023-10-06 12:41:57 +00:00
Edward Faulkner
6f45b4693e
fix(es/codegen): Fix codegen of type-only imports (#8070) 2023-10-06 12:39:56 +00:00
SWC Bot
a6527bf9ab chore: Publish crates 2023-10-06 00:12:18 +00:00
SWC Bot
78e12595a4 chore: Publish crates 2023-09-26 03:59:50 +00:00
Donny/강동윤
f07bb482e6
fix(es/codegen): Fix codegen of optional chaining expr with a comment (#8005)
**Related issue:**

 - Closes #8004
2023-09-26 03:58:02 +00:00
SWC Bot
b74a9f4357 chore: Publish crates 2023-09-25 23:38:00 +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
SWC Bot
e146ff7d8e chore: Publish crates 2023-09-25 01:42:53 +00:00
magic-akari
9c9a538f23
refactor(es/typescript): Reimplement TypeScript pass (#7202)
**Description:**

## Bugfixes
- Exported `let`/`var` declarations in TypeScript namespaces should be mutable.
- Fix missing declaration of complex exported patterns in TypeScript namespaces.
- Preserve concrete TS namespaces.

## New Features
- Introducing [Verbatim Module Syntax](https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax).
- Enum value will now be inlined whenever possible within a single module, optimizing runtime performance.
- Constant enums will be automatically eliminated when feasible, This can reduce bundle size.
- Added support for cross-referencing enum values.

## Deprecated
`TsEnumConfig` is deprecated
  - The `treat_const_enum_as_enum` transform option is deprecated.
  - The `ts_enum_is_readonly` assumption option is deprecated.

**BREAKING CHANGE:**

TypeScript Config is changed.


**Related issue:**

 - Closes #5197
 - Closes #5259 
 - Closes #7177
 - Closes #7453
 - Closes #7676 
 - Closes #7681
 - Closes #7791 
 - Closes #7961
2023-09-25 01:41:00 +00:00
SWC Bot
0d0f04689c chore: Publish crates 2023-09-11 08:33:49 +00:00
Donny/강동윤
dac8888829
fix(es/codegen): Use emitAssertForImportAttributes (#7936)
**Description:**

 - Add `format.emitAssertForImportAttributes` to `minify()`
 - Use `jsc.experimental. emitAssertForImportAttributes`.

**Related issue (if exists):**

 - Closes #7926
 - Closes #7928
2023-09-11 08:31:46 +00:00
SWC Bot
5431010c75 chore: Publish crates 2023-09-10 07:00:21 +00:00
magic-akari
2da58959c2
fix(es/codegen): Emit leading comments for ExprStmt (#7916) 2023-09-10 06:58:26 +00:00
SWC Bot
4623b3e07f chore: Publish crates 2023-09-05 12:26:15 +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
SWC Bot
d1ec49e3e5 chore: Publish crates 2023-08-31 13:25:10 +00:00
SWC Bot
853b4803ad chore: Publish crates 2023-08-30 02:26:08 +00:00
Donny/강동윤
01cbd6edbd
chore(deps): Update memchr (#7891) 2023-08-30 02:23:57 +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
Lewis Liu
122d14c0d3
fix(es/codegen): Fix placing of comments of yield arguments (#7858)
**Description:**

Looks like the bug I ran into had nothing to do with the changes in
#7856, since it's reproducible without it. Looks like it might have only
surfaced now because https://github.com/swc-project/swc/pull/7853
changed the default value of `jsc.minify.format.comments`? Added a
minimal test case here with the expected result.

Here's the actual output:

```js
 export var padding = '';
 export function exec2({ commands }) {
     return __awaiter(this, void 0, void 0, function*() {
         for(let i2 = 0; i2 < commands.length; i2++){
             let command = commands[i2];
             yield // some-comment
             function({ command }) {
                 command();
             }({
                 command,
                 handleError
             });
         }
     });
 }
```

The comment ends up getting added after the yield, which makes the
output invalid.

Going to see if I can figure out a fix tomorrow, but let me know if you
have any ideas on where to start looking in the meantime!
2023-08-27 23:36:50 +00:00
SWC Bot
2be46c920c chore: Publish crates 2023-08-27 18:25:51 +00: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
0d036b4915 chore: Publish crates 2023-08-16 19:11:18 +00:00
Donny/강동윤
04921f301a
fix(es/codegen): Add quotes to property names when ascii_only is true (#7820)
**Related issue:**

 - Closes #7805.
2023-08-16 19:09:27 +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
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
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
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
1e6ade8cfa chore: Publish crates 2023-08-07 20:01:21 +00:00
SWC Bot
97289b4edc chore: Publish crates 2023-08-06 20:31:13 +00:00
SWC Bot
d3b516d692 chore: Publish crates 2023-07-28 05:59:26 +00:00
SWC Bot
026101b71e chore: Publish crates 2023-07-20 05:57:51 +00:00
SWC Bot
26d79444c6 chore: Publish crates 2023-07-13 02:09:23 +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
cba986807a chore: Publish crates 2023-06-30 07:43:11 +00:00
SWC Bot
efc1afd96a chore: Publish crates 2023-06-29 14:15:31 +00:00
Donny/강동윤
bcd5a1d666
feat(es/compat): Implement transform for explicit resource management (#7376)
**Related issue:**

 - Closes #7316.
 - Closes #7369.
2023-06-29 14:13:43 +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
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
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
Donny/강동윤
6e5d8b3cf1
feat(es/codegen): Support preamble (#7551)
**Related issue:**

 - Closes #7475.
2023-06-20 14:35:46 +09: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
db85bf3ee2 chore: Publish crates 2023-06-13 16:14:41 +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
SWC Bot
275db1baec chore: Publish crates 2023-06-13 03:39:28 +00:00
廖应龙
a0da02d0ff
fix(es/codegen): Emit type arguments of jsx element names (#7522) 2023-06-13 03:37:39 +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
cea1237c5e chore: Publish crates 2023-06-12 01:39:32 +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
b6b4b0fd2e chore: Publish crates 2023-06-07 03:03:16 +00:00
David Sherret
a343e7ccae
feat(es/codegen): Add ability to set indentation string via rust api (#7494)
**Description:**

This adds the ability to set the indentation string of JsWriter via the Rust API. The motivation behind this change is to allow people to use other indentations in the emit output like tabs or two spaces via the Rust API.
2023-06-07 03:01:16 +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
David Sherret
3935d02e36
fix(es/codegen): Emit ; for TsImportEqualsDecl (#7464) 2023-05-30 03:22:07 +00:00
SWC Bot
a85816d505 chore: Publish crates 2023-05-25 04:54:11 +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
47114702ef chore: Publish crates 2023-05-23 05:30:42 +00:00
SWC Bot
135c4fd16b chore: Publish crates 2023-05-18 08:20:26 +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/강동윤
40ba242076
fix(es/codegen): Do not create duplicate source map entry (#7309) 2023-05-16 04:12:46 +00:00
SWC Bot
5e3d156aca chore: Publish crates 2023-05-15 03:20:03 +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
Donny/강동윤
166e77c2b3
chore(es): Enable tracing spans for release builds (#7379) 2023-05-11 13:59:53 +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
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
767284e27f chore: Publish crates 2023-04-29 13:28:01 +00:00
SWC Bot
e7911ee594 chore: Publish crates 2023-04-26 01:25:19 +00:00
Samuel Eisenhandler
7e99e5fd2c
fix(es/codegen): Emit type arguments for call expressions (#7335) 2023-04-26 01:23:13 +00:00
SWC Bot
923ed13b6a chore: Publish crates 2023-04-24 09:25:42 +00:00
SWC Bot
5400648de8 chore: Publish crates 2023-04-24 04:17:24 +00:00
David Sherret
0ca05d8b69
fix(es/codegen): Fix codegen of TsModuleDecl (#7319) 2023-04-24 04:15:08 +00:00
SWC Bot
f2a38e808a chore: Publish crates 2023-04-21 06:13:37 +00:00
SWC Bot
7fd1e93434 chore: Publish crates 2023-04-19 21:54:39 +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
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
8e5cb60183 chore: Publish crates 2023-04-12 12:33:03 +00:00
SWC Bot
f31f67c7fb chore: Publish crates 2023-04-11 07:05:27 +00:00
Donny/강동윤
e35097fd8c
fix(es/codegen): Respect ascii_only for identifiers (#7247)
**Related issue:**

 - https://github.com/swc-project/swc/issues/7240.
2023-04-11 07:03:19 +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
c6b28f91cc chore: Publish crates 2023-04-05 05:17:51 +00:00
SWC Bot
a679dbe9aa chore: Publish crates 2023-04-02 22:16:24 +00:00
SWC Bot
b94fbed4c9 chore: Publish crates 2023-03-31 06:17:53 +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
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
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
Donny/강동윤
08fa94fc73
refactor(es/codegen): Extract code from generic functions to reduce compile time (#7127) 2023-03-23 04:37:02 +00:00
SWC Bot
0195f536ef chore: Publish crates 2023-03-22 11:50:07 +00:00
SWC Bot
212af9b0a7 chore: Publish crates 2023-03-21 08:48:30 +00:00
SWC Bot
cda09e44c3 chore: Publish crates 2023-03-21 07:21:46 +00:00
SWC Bot
8902741084 chore: Publish crates 2023-03-17 02:40:31 +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
SWC Bot
60ccdab60e chore: Publish crates 2023-03-16 02:20:24 +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
136c498c80 chore: Publish crates 2023-03-12 04:52:09 +00:00
Donny/강동윤
085c6f35f1
fix(es/ast): Fix memory layout (#7062)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7061.
2023-03-12 04:50:28 +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
0b0e61beb6 chore: Publish crates 2023-03-11 03:44:48 +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
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
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
1a368def06 chore: Publish crates 2023-03-05 07:30:48 +00:00
SWC Bot
0ade738e43 chore: Publish crates 2023-03-03 02:49:46 +00:00
SWC Bot
a504e2a11d chore: Publish crates 2023-02-28 08:23:25 +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
SWC Bot
bbb3615af7 chore: Publish crates 2023-02-28 06:42:16 +00:00
Donny/강동윤
37533a23fd
feat(es/parser): Support auto accessors (#6981) 2023-02-28 06:39:25 +00:00
SWC Bot
94138c801c chore: Publish crates 2023-02-28 06:04:29 +00:00
SWC Bot
9e05f4c2d2 chore: Publish crates 2023-02-22 14:20:23 +00:00
SWC Bot
6496796c59 chore: Publish crates 2023-02-22 06:52:59 +00:00
SWC Bot
786f8180ad chore: Publish crates 2023-02-20 05:31:02 +00:00
SWC Bot
b9212cfee0 chore: Publish crates 2023-02-10 02:51:53 +00:00
SWC Bot
cade201a1f chore: Publish crates 2023-02-10 02:30:18 +00:00
SWC Bot
a566f9c999 chore: Publish crates 2023-02-08 05:17:01 +00:00
SWC Bot
e65699c755 chore: Publish crates 2023-02-07 14:35:38 +00:00
SWC Bot
0bb4dc2c3d chore: Publish crates 2023-01-29 14:56:26 +00:00
SWC Bot
5a5a7d70e4 chore: Publish crates 2023-01-27 06:59:44 +00:00
SWC Bot
8fc1b651b1 chore: Publish crates 2023-01-26 02:11:53 +00:00
SWC Bot
8863e31446 chore: Publish crates 2023-01-20 08:11:11 +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
SWC Bot
b1f3eb74df chore: Publish crates 2023-01-16 15:26:01 +00:00
westhide
e9fdac216c
fix(es/codegen): Skip space if jsx attrs is empty (#6823) 2023-01-16 15:23:28 +00:00
SWC Bot
a5707ae7c1 chore: Publish crates 2023-01-15 06:45:26 +00:00
SWC Bot
cd06479a43 chore: Publish crates 2023-01-11 03:00:59 +00:00
SWC Bot
52dada97ff chore: Publish crates 2023-01-10 06:03:34 +00:00
Donny/강동윤
3f0f664c48
fix(es/codegen): Skip lo of a program if body is not empty (#6773)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6767.
2023-01-10 06:01:14 +00:00
SWC Bot
478b1fe458 chore: Publish crates 2023-01-10 05:10:48 +00:00
magic-akari
019cf37199
feat(es/typescript): Support const modifier on type parameters (#6672)
**Related issue:**

 - https://github.com/microsoft/TypeScript/pull/51865.
2023-01-10 05:08:29 +00:00
SWC Bot
a225efe363 chore: Publish crates 2023-01-08 04:59:27 +00:00
Justin Ridgewell
2b503c16d5
fix(es/codegen): Fix LineCol calculation of printed files (#6763)
**Description:**

There were several issues with the way we updated the current `LineCol` position during the printing of the generated file:

- We used `chars` and `char_indices` (UTF-32) instead of `encode_utf16` (UTF-16) chars.
- JS uses UCS-2 (basically UTF-16) for its strings, and source maps default to that implicitly.
- `\r` was incorrectly handled
  - it didn't add a `line_start`; only `\n` did
- `\r\n` was incorrectly handled
- It was trying to let the `\n` path handle the `line_start`, but it called
`chars.next()` which ate the `\n` char.

I also took the opportunity to avoid the `Vec` allocations and reduced some code duplication.

See the
[before](https://evanw.github.io/source-map-visualization/#ODEzAC8qKgogKiBmb28KICogQHBhcmFtIGRhdGEgZm9vCiAqIEByZXR1cm5zIGZvbwogKi8gZXhwb3J0IGNvbnN0IGZpeHVwUmlza0NvbmZpZ0RhdGEgPSAoZGF0YSk9PnsKICAgIGlmICh4KSB7CiAgICAgICAgcmV0dXJuIDEyMzsKICAgIH0gZWxzZSB7CiAgICAgICAgcmV0dXJuIDQ1NjsKICAgIH0KfTsKCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWRhdGE6YXBwbGljYXRpb24vanNvbjtiYXNlNjQsZXlKMlpYSnphVzl1SWpvekxDSnpiM1Z5WTJWeklqcGJJbWx1Y0hWMExuUnpJbDBzSW5OdmRYSmpaWE5EYjI1MFpXNTBJanBiSWk4cUtseHlYRzRnS2lCbWIyOWNjbHh1SUNvZ1FIQmhjbUZ0SUdSaGRHRWdabTl2WEhKY2JpQXFJRUJ5WlhSMWNtNXpJR1p2YjF4eVhHNGd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hKUVVGTlFTeHpRa0ZCYzBJc1UwRkJRME1zVFVGQmIwTTdTVUZEZEVVc1NVRkJTVU1zUjBGQlJ6dFJRVU5NTEU5QlFVODdTVUZEVkN4UFFVRlBPMUZCUTB3c1QwRkJUenRKUVVOVUxFTkJRVU03UVVGRFNDeEZRVUZGSW4wPTQ0NgB7InZlcnNpb24iOjMsInNvdXJjZXMiOlsiLi9hcHAuanMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXHJcbiAqIGZvb1xyXG4gKiBAcGFyYW0gZGF0YSBmb29cclxuICogQHJldHVybnMgZm9vXHJcbiAqL1xyXG5leHBvcnQgY29uc3QgZml4dXBSaXNrQ29uZmlnRGF0YSA9IChkYXRhOiBhbnkpOiB0eXBlcy5SaXNrQ29uZmlnVHlwZSA9PiB7XHJcbiAgaWYgKHgpIHtcclxuICAgIHJldHVybiAxMjM7XHJcbiAgfSBlbHNlIHtcclxuICAgIHJldHVybiA0NTY7XHJcbiAgfVxyXG59OyJdLCJuYW1lcyI6WyJmaXh1cFJpc2tDb25maWdEYXRhIiwiZGF0YSIsIngiXSwibWFwcGluZ3MiOiJBQUFBOzs7O0NBSUMsR0FDRCxPQUFPLElBQU1BLHNCQUFzQixTQUFDQyxNQUFvQztJQUN0RSxJQUFJQyxHQUFHO1FBQ0wsT0FBTztJQUNULE9BQU87UUFDTCxPQUFPO0lBQ1QsQ0FBQztBQUNILEVBQUUifQ==)


**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6694.
2023-01-08 13:57:26 +09:00
SWC Bot
1161360d54 chore: Publish crates 2023-01-06 03:49:20 +00:00
SWC Bot
790c478a7a chore: Publish crates 2023-01-04 07:29:33 +00:00
SWC Bot
61245739ea chore: Publish crates 2022-12-21 03:03:05 +00:00
SWC Bot
913230d02a chore: Publish crates 2022-12-20 06:11:34 +00:00