Commit Graph

6116 Commits

Author SHA1 Message Date
Donny/강동윤
6ce112cfeb
feat(es/transforms): Add an API for returning metadata to JS (#9022) 2024-06-05 10:37:28 +00:00
강동윤 (Donny)
2b81d72333 chore: Workaround the bug of cargo-mono 2024-06-05 15:46:04 +09:00
Donny/강동윤
6fa79be081
feat(es/transforms): Add experimental output API for transforms (#9000)
**Description:**

This interface will provide a way to emit some outputs from transforms. This data will be emitted back to the JS caller.
2024-06-05 15:38:28 +09:00
SWC Bot
668a11d50d chore: Bump crates 2024-06-05 06:32:40 +00:00
SWC Bot
03edd92dc8 chore: Bump crates 2024-06-05 06:07:36 +00:00
Donny/강동윤
555e71cfd5
fix(es/es2015): Remove needless unreachable! (#9021)
**Related issue:**

 - Closes #9020
2024-06-05 06:05:22 +00:00
SWC Bot
277843e2e9 chore: Bump crates 2024-06-04 09:53:19 +00:00
Donny/강동윤
3bf31148ba
perf(es/parser): Add feature named tracing-spans (#9019) 2024-06-04 18:51:25 +09:00
강동윤 (Donny)
2fb890cf20 chore: Publish crates 2024-06-04 09:09:39 +09:00
SWC Bot
1496ed1814 chore: Bump crates 2024-06-02 10:34:24 +00:00
Donny/강동윤
9f8e24a76c
fix(es/minifier): Fix evaluation of -0 as a string (#9011)
**Related issue:**

 - Closes #9010

---------

Co-authored-by: magic-akari <akari.ccino@gmail.com>
2024-06-02 19:32:44 +09:00
SWC Bot
1f911f9d19 chore: Bump crates 2024-06-02 03:37:22 +00:00
Donny/강동윤
2879a4d42b
fix(es/minifier): Do not index a string with a surrogate pair (#9013)
**Related issue:**

 - Closes #9008
2024-06-02 03:35:43 +00:00
SWC Bot
04c183933a chore: Bump crates 2024-06-02 03:12:32 +00:00
Donny/강동윤
8a29577cc5
fix(es/minifier): Fix comparison of -0.0 (#9012)
**Related issue:**

 - Closes #9007
2024-06-02 03:10:55 +00:00
SWC Bot
d44ec65e36 chore: Bump crates 2024-06-01 14:20:10 +00:00
Donny/강동윤
0d9ecf39c1
fix(es/resolver): Fix hoisting of const and let (#8987)
**Description:**

 - Repro: https://github.com/kdy1/repro-next-66237

**Related issue:**

 - https://github.com/vercel/next.js/issues/66237
2024-06-01 23:18:34 +09:00
SWC Bot
629d59cb18 chore: Bump crates 2024-05-31 03:15:29 +00:00
Donny/강동윤
e764ff6f64
fix(es/minifier): Preserve unused special properties (#9005)
**Related issue:**

 - https://github.com/vercel/next.js/issues/66378
2024-05-31 03:13:43 +00:00
SWC Bot
74a1fd4341 chore: Bump crates 2024-05-31 00:57:55 +00:00
Donny/강동윤
da70ebed69
feat(x): Initialize project (#8999)
**Description:**

SWC X will be a cross-module optimizer that utilizes an enormous amount of information. After merging this, I'll experiment with several approaches.
2024-05-31 00:56:21 +00:00
SWC Bot
993eccbf9c chore: Bump crates 2024-05-31 00:33:36 +00:00
Donny/강동윤
09121a61cc
fix(es/es2015): Fix injection location of this for getter/setter properties (#8993)
**Related issue:**

 - Closes #8992

---------

Co-authored-by: magic-akari <akari.ccino@gmail.com>
2024-05-31 00:32:00 +00:00
SWC Bot
b534d03591 chore: Bump crates 2024-05-30 14:02:56 +00:00
Donny/강동윤
cc8c1550dd
feat(es/minifier): Detect TypeScript enum initialization pattern (#8986)
**Description:**

We can optimize
```js
var Foo;
Foo || Foo = {};
```

This code looks strange, but 
```ts
enum Foo {
    a = 1,
    b = 2,
}
```

transpiles to

```js
var Foo;
(function(Foo) {
    Foo[Foo["a"] = 1] = "a";
    Foo[Foo["b"] = 2] = "b";
})(Foo || (Foo = {}));

```

and after minification it becomes

```js
var Foo, Foo1;
(Foo1 = Foo || (Foo = {}))[Foo1.a = 1] = "a", Foo1[Foo1.b = 2] = "b";

```
2024-05-30 14:01:07 +00:00
SWC Bot
e07be900b9 chore: Bump crates 2024-05-30 09:49:05 +00:00
SWC Bot
1267e3ecd4 chore: Bump crates 2024-05-30 06:32:29 +00:00
Donny/강동윤
a81a01f629
fix(es/jest): Handle @jest/globals (#8994)
**Description:**

- We have two `jest` pass. One in `@swc/core` (via _hidden.jest flag), and one in the plugin. This PR fixes only the core one.

However, the linked issue is wrong because the code tries to break the rules of ESM specification. So, although this PR closes the issue, the final form is not the issue the author wanted.

**Related issue:**

 - Closes https://github.com/swc-project/plugins/issues/310
2024-05-30 15:30:45 +09:00
Donny/강동윤
c0dc5e44ab
test(es/minifier): Update the passing terser test list (#8984) 2024-05-27 22:45:44 +09:00
SWC Bot
ab32e694a0 chore: Bump crates 2024-05-26 12:43:18 +00:00
Donny/강동윤
51e0639ede
fix(es/es2015): Fix typeof comparions with "object" (#8976)
**Related issue:**

 - Closes #8971
2024-05-26 21:41:23 +09:00
SWC Bot
7c62a79d9b chore: Bump crates 2024-05-24 05:12:45 +00:00
Donny/강동윤
a753c8d191
fix(es/minifier): Mark usage in TaggedTpl as ref (#8975)
**Related issue:**

 - Closes #8974
2024-05-24 05:11:00 +00:00
Donny/강동윤
2a43df4984
fix(es/minifier): Fix comparison of -0.0 and 0 (#8973)
**Related issue:**

 - Closes #8972
2024-05-24 09:16:42 +09:00
SWC Bot
eaffeb8dab chore: Bump crates 2024-05-23 05:20:02 +00:00
Donny/강동윤
95472e4037
test(es/decorators): Add tests written by evanw (#8967)
**Description:**

Add https://github.com/evanw/decorator-tests as partially ignored tests so we can work on decorator fixes gradually.
2024-05-23 14:18:32 +09:00
Donny/강동윤
a4567998b0
fix(es/codegen): Accept &impl Node instead of impl Node (#8969) 2024-05-23 12:13:13 +09:00
SWC Bot
85e4eaa507 chore: Bump crates 2024-05-23 02:25:14 +00:00
Donny/강동윤
e80fd41ea8
feat(es/codegen): Add to_code (#8968)
**Description:**

This is a utility function for printing an AST node as a string
2024-05-23 02:23:32 +00:00
SWC Bot
ea14fc8e59 chore: Bump crates 2024-05-22 02:29:02 +00:00
Donny/강동윤
545ec51b51
fix(es/minifier): Add type check to & and | (#8965)
**Related issue:**

 - Closes #8964
2024-05-22 11:27:00 +09:00
SWC Bot
59e310d0fe chore: Bump crates 2024-05-21 01:22:57 +00:00
Donny/강동윤
ced63a973e
feat(plugin/runner): Add description about wasi and file system (#8963)
**Description:**
 
 - x-ref:
https://vercel.slack.com/archives/C01QNLABZJ8/p1715816821287309?thread_ts=1715793483.177469&cid=C01QNLABZJ8
2024-05-21 01:21:27 +00:00
SWC Bot
4fc3c66f8f chore: Bump crates 2024-05-18 01:45:56 +00:00
Donny/강동윤
f960d52364
refactor(bindings): Make @swc/core a subpackage (#8625)
**Description:**

This is for consistency and future extensions.
2024-05-18 09:23:06 +09:00
Donny/강동윤
02729f24d8
fix(es/minifier): Abort property hoisting on eval (#8957)
**Description:**

 - Repro: https://github.com/kdy1/repro-next-46887-2


**Related issue:**

- https://github.com/vercel/next.js/issues/46887#issuecomment-2113264586
2024-05-16 11:35:45 +09:00
SWC Bot
f681924023 chore: Bump crates 2024-05-16 02:11:50 +00:00
Donny/강동윤
255485e373
fix(es/minifier): Abort array property inliner if the array is used as a ref (#8956)
**Description:**

Repro:
 - https://github.com/kdy1/repro-next-46887

**Related issue:**

 - https://github.com/vercel/next.js/issues/46887
2024-05-16 11:09:41 +09:00
SWC Bot
53e1ae2e1b chore: Bump crates 2024-05-14 00:56:51 +00:00
Donny/강동윤
ff60960afe
doc(es/typescript): Fix example (#8952)
**Related issue:**

 - Closes #8950
2024-05-14 00:55:06 +00:00