Commit Graph

9242 Commits

Author SHA1 Message Date
SWC Bot
933a7be7b5 chore: Publish 1.7.0-nightly-20240717.1 with swc_core v0.98.0 2024-07-17 19:40:33 +00:00
SWC Bot
02f77f6409 chore: Bump crates
Some checks are pending
CI / Cargo fmt (push) Waiting to run
CI / Cargo clippy (push) Waiting to run
CI / Check license of dependencies (push) Waiting to run
CI / Check (macos-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / Test wasm (binding_core_wasm) (push) Waiting to run
CI / Test wasm (binding_minifier_wasm) (push) Waiting to run
CI / Test wasm (binding_typescript_wasm) (push) Waiting to run
CI / List crates (push) Waiting to run
CI / Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }} (push) Blocked by required conditions
CI / Test node bindings - ${{ matrix.os }} (macos-latest) (push) Waiting to run
CI / Test node bindings - ${{ matrix.os }} (windows-latest) (push) Waiting to run
CI / Test with @swc/cli (push) Waiting to run
CI / Miri (better_scoped_tls) (push) Waiting to run
CI / Miri (string_enum) (push) Waiting to run
CI / Miri (swc) (push) Waiting to run
CI / Miri (swc_bundler) (push) Waiting to run
CI / Miri (swc_ecma_codegen) (push) Waiting to run
CI / Miri (swc_ecma_minifier) (push) Waiting to run
CI / Done (push) Blocked by required conditions
Benchmark / Bench everything (push) Waiting to run
Bot / Start (push) Waiting to run
2024-07-17 10:58:08 +00:00
Donny/강동윤
b9b233cacd
refactor(es/codegen): Revert #9248 (#9266) 2024-07-17 10:56:36 +00:00
SWC Bot
1ae79670c1 chore: Bump crates 2024-07-17 10:31:21 +00:00
Donny/강동윤
efc396377f
test(allocator): Merge test (#9267) 2024-07-17 10:29:39 +00:00
SWC Bot
a92ce51183 chore: Bump crates
Some checks are pending
CI / Cargo fmt (push) Waiting to run
CI / Cargo clippy (push) Waiting to run
CI / Check license of dependencies (push) Waiting to run
CI / Check (macos-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / Test wasm (binding_core_wasm) (push) Waiting to run
CI / Test wasm (binding_minifier_wasm) (push) Waiting to run
CI / Test wasm (binding_typescript_wasm) (push) Waiting to run
CI / List crates (push) Waiting to run
CI / Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }} (push) Blocked by required conditions
CI / Test node bindings - ${{ matrix.os }} (macos-latest) (push) Waiting to run
CI / Test node bindings - ${{ matrix.os }} (windows-latest) (push) Waiting to run
CI / Test with @swc/cli (push) Waiting to run
CI / Miri (better_scoped_tls) (push) Waiting to run
CI / Miri (string_enum) (push) Waiting to run
CI / Miri (swc) (push) Waiting to run
CI / Miri (swc_bundler) (push) Waiting to run
CI / Miri (swc_ecma_codegen) (push) Waiting to run
CI / Miri (swc_ecma_minifier) (push) Waiting to run
CI / Done (push) Blocked by required conditions
Benchmark / Bench everything (push) Waiting to run
Bot / Start (push) Waiting to run
2024-07-17 05:51:34 +00:00
pshu
6ddbfa04db
fix(es/minifier): Collect raw str values for new Tpl element (#9261)
**Description:**

Convert `raw` value to `cooked` for creating a new Tpl element.


**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/9184
2024-07-17 14:50:04 +09:00
SWC Bot
38c8453103 chore: Bump crates
Some checks are pending
CI / Cargo fmt (push) Waiting to run
CI / Cargo clippy (push) Waiting to run
CI / Check license of dependencies (push) Waiting to run
CI / Check (macos-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / Test wasm (binding_core_wasm) (push) Waiting to run
CI / Test wasm (binding_minifier_wasm) (push) Waiting to run
CI / Test wasm (binding_typescript_wasm) (push) Waiting to run
CI / List crates (push) Waiting to run
CI / Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }} (push) Blocked by required conditions
CI / Test node bindings - ${{ matrix.os }} (macos-latest) (push) Waiting to run
CI / Test node bindings - ${{ matrix.os }} (windows-latest) (push) Waiting to run
CI / Test with @swc/cli (push) Waiting to run
CI / Miri (better_scoped_tls) (push) Waiting to run
CI / Miri (string_enum) (push) Waiting to run
CI / Miri (swc) (push) Waiting to run
CI / Miri (swc_bundler) (push) Waiting to run
CI / Miri (swc_ecma_codegen) (push) Waiting to run
CI / Miri (swc_ecma_minifier) (push) Waiting to run
CI / Done (push) Blocked by required conditions
Benchmark / Bench everything (push) Waiting to run
Bot / Start (push) Waiting to run
2024-07-16 10:24:55 +00:00
Levi
baeb9e2df9
fix(es/minifier): Fix panic in bitwise logic and incorrect values (#9258)
**Description:**

This PR fixes all issues listed in #9256 as well as the following:

`1.7976931348623157e+308 << 1.7976931348623157e+308` - swc currently
does not transform this and leaves it as-is

Anything involving low floating-point numbers, like `5e-324`, such as
`5e-324 >> 5e-324`, `5e-324 >> 0` etc - swc currently panics;
https://play.swc.rs/?version=1.6.7&code=H4sIAAAAAAAAA0vTME3VNTYyUbCzUzDQBACkm%2Ft7DgAAAA%3D%3D&config=H4sIAAAAAAAAA32UO3LjMAyG%2B5zCozrFjostcoDtcgYOTYIyvXxoCNCxJuO7L0TJj40hdRI%2B%2FAAJgPh%2B2%2B26E5ruY%2FfNn%2Fwz6IJQ7v9swTGRvrClAxM1muIH6t5v9IQTcjogNNN1Jh3p0gM1Fe5%2F7feLogs5I9wUiy365N34nNPkOBRAfLKxlUPWCInwf%2F3CSv6aAJX6bD%2FkHECnDaI0Kp8IeihSYJND0AOCOusiRJlOqovHLKWYYCWwaih5EHmynnxOnPOVWtBWmWxBQL6AIX8GSca5WJaQryfcp2ELh9r3rc8%2F1HDWoWoScsKltYRPK0Q9Zo%2BkXE1SCWe4UoMZLsX9qfROFaBa0qvulH1a6clfAK5A0IhJR5DiNg%2FH87SmdptKnxyPLI0C5%2FmWbpmg56Iq751Q2akyUMhL3Sxgq4GpskY6zoJXyofeggLneFaE0PjlyRylpDQOkJ0AuL%2FaSVM1A3V%2FhSt8ehAb%2BA%2FfkuQBWzyipuM6xTEecthIEIGO2W44cCsor%2BPCW%2BIyrPOaLPBogBVdKjbwugT4AVBWoe3Ll9ng58ERVR%2Fy4bEmFofrfQ9HnfrHe59X8dvi0MVsa4PLkp%2F6O6%2Fm393D6baF7wfvPH7elC3p9R%2BoYzQdMAYAAA%3D%3D

This PR also fixes `shiftCount` being incorrect and incorrect conversion
between `f64` and `i32`/`u32`. A new API in swc_ecma_utils has been
added, `to_js_int32` and `to_js_uint32` that allows external callers to
convert `f64`s to `i32` and `u32` so they can perform bitwise operations
themselves if they're trying to replicate JavaScript behaviour.

I also believe the updated bit shifting logic should be accessible
externally via swc_ecma_utils, but unsure about this.



**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/9256

---------

Co-authored-by: magic-akari <akari.ccino@gmail.com>
2024-07-16 18:56:05 +09:00
SWC Bot
5a218f7c09 chore: Bump crates
Some checks are pending
CI / Cargo fmt (push) Waiting to run
CI / Cargo clippy (push) Waiting to run
CI / Check license of dependencies (push) Waiting to run
CI / Check (macos-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / Test wasm (binding_core_wasm) (push) Waiting to run
CI / Test wasm (binding_minifier_wasm) (push) Waiting to run
CI / Test wasm (binding_typescript_wasm) (push) Waiting to run
CI / List crates (push) Waiting to run
CI / Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }} (push) Blocked by required conditions
CI / Test node bindings - ${{ matrix.os }} (macos-latest) (push) Waiting to run
CI / Test node bindings - ${{ matrix.os }} (windows-latest) (push) Waiting to run
CI / Test with @swc/cli (push) Waiting to run
CI / Miri (better_scoped_tls) (push) Waiting to run
CI / Miri (string_enum) (push) Waiting to run
CI / Miri (swc) (push) Waiting to run
CI / Miri (swc_bundler) (push) Waiting to run
CI / Miri (swc_ecma_codegen) (push) Waiting to run
CI / Miri (swc_ecma_minifier) (push) Waiting to run
CI / Done (push) Blocked by required conditions
Benchmark / Bench everything (push) Waiting to run
Bot / Start (push) Waiting to run
2024-07-16 03:42:12 +00:00
magic-akari
06bb5338ce
fix(es/minifier): Fix exponentiate operator (#9251)
**Related issue:**

- Closes https://github.com/swc-project/swc/issues/9250.
2024-07-16 03:40:36 +00:00
SWC Bot
f6f359e0a7 chore: Bump crates 2024-07-16 02:49:52 +00:00
Donny/강동윤
970f32398c perf(es/codegen): Use scoped allocator (#9248)
**Description:**

Main:
<img width="711" alt="스크린샷 2024-07-15 오후 8 05 50"
src="https://github.com/user-attachments/assets/508a29e8-744f-4017-a819-b7576e61d287">

new:

<img width="711" alt="스크린샷 2024-07-15 오후 8 05 19"
src="https://github.com/user-attachments/assets/bcf3107d-e843-4fab-8b8a-fc6376705273">
2024-07-16 11:48:18 +09:00
SWC Bot
5cc6449734 chore: Bump crates
Some checks are pending
CI / Cargo fmt (push) Waiting to run
CI / Cargo clippy (push) Waiting to run
CI / Check license of dependencies (push) Waiting to run
CI / Check (macos-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / Test wasm (binding_core_wasm) (push) Waiting to run
CI / Test wasm (binding_minifier_wasm) (push) Waiting to run
CI / Test wasm (binding_typescript_wasm) (push) Waiting to run
CI / List crates (push) Waiting to run
CI / Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }} (push) Blocked by required conditions
CI / Test node bindings - ${{ matrix.os }} (macos-latest) (push) Waiting to run
CI / Test node bindings - ${{ matrix.os }} (windows-latest) (push) Waiting to run
CI / Test with @swc/cli (push) Waiting to run
CI / Miri (better_scoped_tls) (push) Waiting to run
CI / Miri (string_enum) (push) Waiting to run
CI / Miri (swc) (push) Waiting to run
CI / Miri (swc_bundler) (push) Waiting to run
CI / Miri (swc_ecma_codegen) (push) Waiting to run
CI / Miri (swc_ecma_minifier) (push) Waiting to run
CI / Done (push) Blocked by required conditions
Benchmark / Bench everything (push) Waiting to run
Bot / Start (push) Waiting to run
2024-07-15 19:05:16 +00:00
Donny/강동윤
6e098aeeb5
refactor(allocator): Use RAII guard instead of scope (#9254)
**Related issue:**

- https://github.com/swc-project/swc/issues/9253
2024-07-15 19:02:52 +00:00
SWC Bot
d2e96bf40f chore: Bump crates
Some checks are pending
CI / Cargo fmt (push) Waiting to run
CI / Cargo clippy (push) Waiting to run
CI / Check license of dependencies (push) Waiting to run
CI / Check (macos-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / Test wasm (binding_core_wasm) (push) Waiting to run
CI / Test wasm (binding_minifier_wasm) (push) Waiting to run
CI / Test wasm (binding_typescript_wasm) (push) Waiting to run
CI / List crates (push) Waiting to run
CI / Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }} (push) Blocked by required conditions
CI / Test node bindings - ${{ matrix.os }} (macos-latest) (push) Waiting to run
CI / Test node bindings - ${{ matrix.os }} (windows-latest) (push) Waiting to run
CI / Test with @swc/cli (push) Waiting to run
CI / Miri (better_scoped_tls) (push) Waiting to run
CI / Miri (string_enum) (push) Waiting to run
CI / Miri (swc) (push) Waiting to run
CI / Miri (swc_bundler) (push) Waiting to run
CI / Miri (swc_ecma_codegen) (push) Waiting to run
CI / Miri (swc_ecma_minifier) (push) Waiting to run
CI / Done (push) Blocked by required conditions
Benchmark / Bench everything (push) Waiting to run
Bot / Start (push) Waiting to run
2024-07-15 15:26:45 +00:00
Donny/강동윤
d8e8b04cd8
fix(allocator): Remove wrong assertions and add tests (#9252) 2024-07-15 15:25:00 +00:00
SWC Bot
123a9f921b chore: Bump crates 2024-07-15 14:32:19 +00:00
Jimmy Moon
ff5bbdae6a
doc(contributing): Fix deno installation url (#9249) 2024-07-15 14:30:35 +00:00
SWC Bot
cfea948f29 chore: Bump crates 2024-07-15 12:53:31 +00:00
Donny/강동윤
e7ce94b5ee
test: Enable scoped API by default (#9247)
**Description:**

This PR is to profile real performance using codspeed
2024-07-15 12:51:42 +00:00
SWC Bot
887d7a2124 chore: Bump crates 2024-07-15 10:55:49 +00:00
Donny/강동윤
e086f38b0f
chore: Apply cargo-autoinherit (#9244) 2024-07-15 10:54:00 +00:00
SWC Bot
11af5578b7 chore: Update changelog 2024-07-15 10:17:45 +00:00
SWC Bot
cb0ff00c73 chore: Publish 1.7.0-nightly-20240715.2 with swc_core v0.97.5 2024-07-15 10:17:43 +00:00
강동윤 (Donny)
3d40f84976 chore(ci): Fix Wasm publish action 2024-07-15 19:10:35 +09:00
SWC Bot
254b7b99f1 chore: Bump crates 2024-07-15 10:09:31 +00:00
Donny/강동윤
0e79a5b428
fix(es/typescript): Fix transform mode (#9243) 2024-07-15 19:07:55 +09:00
SWC Bot
b2a22ed771 chore: Bump crates 2024-07-15 09:54:45 +00:00
Donny/강동윤
b6333dbcfc
feat(allocator): Implement default mode (#9242)
**Description:**

In the default mode, `Box<T>` and `Vec<T>` should work just like them from std.

**Related issue:**

 - This PR is part of https://github.com/swc-project/swc/pull/9230
2024-07-15 18:53:09 +09:00
SWC Bot
b37cdb3a52 chore: Update changelog
Some checks are pending
CI / Cargo fmt (push) Waiting to run
CI / Cargo clippy (push) Waiting to run
CI / Check license of dependencies (push) Waiting to run
CI / Check (macos-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / Test wasm (binding_core_wasm) (push) Waiting to run
CI / Test wasm (binding_minifier_wasm) (push) Waiting to run
CI / Test wasm (binding_typescript_wasm) (push) Waiting to run
CI / List crates (push) Waiting to run
CI / Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }} (push) Blocked by required conditions
CI / Test node bindings - ${{ matrix.os }} (macos-latest) (push) Waiting to run
CI / Test node bindings - ${{ matrix.os }} (windows-latest) (push) Waiting to run
CI / Test with @swc/cli (push) Waiting to run
CI / Miri (better_scoped_tls) (push) Waiting to run
CI / Miri (string_enum) (push) Waiting to run
CI / Miri (swc) (push) Waiting to run
CI / Miri (swc_bundler) (push) Waiting to run
CI / Miri (swc_ecma_codegen) (push) Waiting to run
CI / Miri (swc_ecma_minifier) (push) Waiting to run
CI / Done (push) Blocked by required conditions
Benchmark / Bench everything (push) Waiting to run
Bot / Start (push) Waiting to run
2024-07-15 07:45:24 +00:00
SWC Bot
0891fb8aba chore: Publish 1.7.0-nightly-20240715.1 with swc_core v0.97.4 2024-07-15 07:45:23 +00:00
SWC Bot
c88b57b615 chore: Bump crates 2024-07-15 06:56:42 +00:00
CPunisher
521161e170
fix(es/minifier): Remove optimization for array pattern (#9241)
**Description:**

This could be an unsound optimization. The issue shows a bad case. 

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/8918
2024-07-15 06:54:53 +00:00
SWC Bot
04061781d9 chore: Bump crates 2024-07-15 06:27:43 +00:00
Parbez
fba79e6f03
fix(es/codegen): Fix codegen of large numeric literals (#9226)
**Description:**

This PR moves the infinite check below the raw number check.


**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/9223
2024-07-15 15:25:13 +09:00
SWC Bot
8c420313bc chore: Bump crates 2024-07-15 06:24:11 +00:00
Donny/강동윤
398dc21e07
feat(allocator): Add a cargo feature (#9239)
**Description:**

This PR is a part of https://github.com/swc-project/swc/pull/9230
2024-07-15 15:22:26 +09:00
강동윤 (Donny)
b6c046890f chore: Publish crates 2024-07-15 15:02:24 +09:00
SWC Bot
52f28bcfa6 chore: Bump crates 2024-07-15 05:27:36 +00:00
Donny/강동윤
4ce2514d1b
perf(allocator): Drop scoped_tls (#9240)
**Description:**

The performance is much better without it.
2024-07-15 14:25:58 +09:00
SWC Bot
e5f925d423 chore: Update changelog
Some checks are pending
CI / Cargo fmt (push) Waiting to run
CI / Cargo clippy (push) Waiting to run
CI / Check license of dependencies (push) Waiting to run
CI / Check (macos-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / Test wasm (binding_core_wasm) (push) Waiting to run
CI / Test wasm (binding_minifier_wasm) (push) Waiting to run
CI / Test wasm (binding_typescript_wasm) (push) Waiting to run
CI / List crates (push) Waiting to run
CI / Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }} (push) Blocked by required conditions
CI / Test node bindings - ${{ matrix.os }} (macos-latest) (push) Waiting to run
CI / Test node bindings - ${{ matrix.os }} (windows-latest) (push) Waiting to run
CI / Test with @swc/cli (push) Waiting to run
CI / Miri (better_scoped_tls) (push) Waiting to run
CI / Miri (string_enum) (push) Waiting to run
CI / Miri (swc) (push) Waiting to run
CI / Miri (swc_bundler) (push) Waiting to run
CI / Miri (swc_ecma_codegen) (push) Waiting to run
CI / Miri (swc_ecma_minifier) (push) Waiting to run
CI / Done (push) Blocked by required conditions
Benchmark / Bench everything (push) Waiting to run
Bot / Start (push) Waiting to run
2024-07-14 15:53:11 +00:00
SWC Bot
e5f6efa97e chore: Publish 1.7.0-nightly-20240714.1 with swc_core v0.97.2 2024-07-14 15:53:09 +00:00
SWC Bot
c04cb0373e chore: Bump crates 2024-07-14 15:45:10 +00:00
Donny/강동윤
8231e3cd4f
feat(es/typescript): Add transform mode back to fast TS strip (#9237) 2024-07-15 00:39:54 +09:00
SWC Bot
38462c6cba chore: Bump crates 2024-07-14 15:39:12 +00:00
Donny/강동윤
8d5670e72b
refactor(allocator): Use & instead of a thread-local (#9235)
**Description:**

This is a part of https://github.com/swc-project/swc/pull/9230. I
profiled the performance, and `thread_local` took too long to get the
address of the thread-local variable. So, I inlined the reference into
the allocator.

# Benchmark result

```

Gnuplot not found, using plotters backend
common/allocator/alloc/std/1000000
                        time:   [4.9478 ms 4.9653 ms 4.9922 ms]
Found 17 outliers among 100 measurements (17.00%)
  4 (4.00%) high mild
  13 (13.00%) high severe

common/allocator/alloc/no-scope/1000000
                        time:   [5.4821 ms 5.4938 ms 5.5068 ms]
Found 17 outliers among 100 measurements (17.00%)
  2 (2.00%) high mild
  15 (15.00%) high severe

common/allocator/alloc/scoped/1000000
                        time:   [3.1401 ms 3.1456 ms 3.1518 ms]
Found 12 outliers among 100 measurements (12.00%)
  3 (3.00%) high mild
  9 (9.00%) high severe

common/allocator/alloc/cached-no-scope/1000000
                        time:   [5.0992 ms 5.1090 ms 5.1198 ms]
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) high mild
  9 (9.00%) high severe

common/allocator/alloc/cached-scoped/1000000
                        time:   [3.0191 ms 3.0230 ms 3.0273 ms]
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) low mild
  1 (1.00%) high mild
  8 (8.00%) high severe
```
2024-07-15 00:37:38 +09:00
SWC Bot
83e75baaed chore: Bump crates
Some checks are pending
CI / Cargo fmt (push) Waiting to run
CI / Cargo clippy (push) Waiting to run
CI / Check license of dependencies (push) Waiting to run
CI / Check (macos-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / Test wasm (binding_core_wasm) (push) Waiting to run
CI / Test wasm (binding_minifier_wasm) (push) Waiting to run
CI / Test wasm (binding_typescript_wasm) (push) Waiting to run
CI / List crates (push) Waiting to run
CI / Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }} (push) Blocked by required conditions
CI / Test node bindings - ${{ matrix.os }} (macos-latest) (push) Waiting to run
CI / Test node bindings - ${{ matrix.os }} (windows-latest) (push) Waiting to run
CI / Test with @swc/cli (push) Waiting to run
CI / Miri (better_scoped_tls) (push) Waiting to run
CI / Miri (string_enum) (push) Waiting to run
CI / Miri (swc) (push) Waiting to run
CI / Miri (swc_bundler) (push) Waiting to run
CI / Miri (swc_ecma_codegen) (push) Waiting to run
CI / Miri (swc_ecma_minifier) (push) Waiting to run
CI / Done (push) Blocked by required conditions
Benchmark / Bench everything (push) Waiting to run
Bot / Start (push) Waiting to run
2024-07-14 07:22:17 +00:00
Donny/강동윤
037dad52f4
fix(allocator): Fix allocator & add benchmark (#9234)
**Related issue:**

 - This PR is a part of https://github.com/swc-project/swc/pull/9230.
2024-07-14 16:20:42 +09:00
SWC Bot
26c5519b66 chore: Bump crates 2024-07-14 04:29:20 +00:00