Commit Graph

381 Commits

Author SHA1 Message Date
Donny/강동윤
a417ff4d86
feat(allocator): Add maybe types (#9278) 2024-07-19 13:22:34 +09:00
SWC Bot
201f58dc7b chore: Bump crates
Some checks failed
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) Has been cancelled
2024-07-18 14:05:38 +00:00
Donny/강동윤
a31fb58399
feat(allocator): Feature gate nightly via macros (#9274)
**Description:**

We can make swc faster without dropping support for stable rustc.
2024-07-18 14:03:58 +00:00
강동윤 (Donny)
aea4f45c73 chore: Publish crates 2024-07-18 08:31:54 +09: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
Donny/강동윤
e343eb6de2
feat(allocator): Implement SwcAlloc (#9232)
**Related issue:**

 - This is a part of https://github.com/swc-project/swc/pull/9230
2024-07-14 13:27:41 +09:00
SWC Bot
fd94562f02 chore: Bump crates 2024-07-12 04:14:55 +00:00
Donny/강동윤
b2491e5461 refactor(common): Drop SyntaxContext from AST nodes (#9175) 2024-07-12 13:13:20 +09:00
Donny/강동윤
e7b9c552a7
chore(ci): Configure codspeed (#9189) 2024-07-10 15:20:27 +09:00
SWC Bot
87315daf27 chore: Bump crates 2024-07-06 06:21:53 +00:00
Donny/강동윤
3638e97c80
feat(es/testing): Improve comment testing story (#9150)
**Description:**

This PR makes `PluginCommentProxy` work by default in `test_fixture()`. This PR adds a scoped-local to `swc_common`, and uses it from `swc_ecma_transforms_testing`.

It can't be tested in the main repository, though. We cannot enable `plugin_mode` of `swc_common` in the main SWC repository.


**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/9149.
2024-07-06 06:20:01 +00:00
SWC Bot
568b3b37a5 chore: Bump crates 2024-06-21 08:51:36 +00:00
Donny/강동윤
e423d1bced
feat(common): Add fallible methods to swc_common::SourceMap (#9090)
**Description:**

This PR will make `swc_ecma_codegen` not `panic` for invalid spans.
2024-06-21 17:49:43 +09:00
Donny/강동윤
7698eaa006
perf(common): Use Chars in StringInput (#9073)
**Description:**

Now it's possible
2024-06-18 03:45:56 +00:00
SWC Bot
071e5be80d chore: Bump crates 2024-06-18 02:56:14 +00:00
Donny/강동윤
c3a8c0b567
refactor(common): Simplify StringInput implementation (#9071) 2024-06-18 11:54:34 +09:00
SWC Bot
f8c2c4791a chore: Bump crates 2024-06-16 05:31:45 +00:00
Donny/강동윤
cdd20cd163
fix(common): Revert Use SourceMap::adjust_mappings (#9058)
**Description:**

https://github.com/getsentry/rust-sourcemap/pull/91 should fix this
issue, but let's revert #9052 for now.

# Context

`swc_core` regressed.

Caught by https://github.com/vercel/next.js/pull/66902

```
 ⚠ Linting is disabled.
  ▲ Next.js 15.0.0-canary.34

 ✓ Checking validity of types
   Creating an optimized production build ...
Panic: PanicInfo { payload: Any { .. }, message: Some(attempt to add with overflow), location: Location { file: "/Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sourcemap-8.0.1/src/encoder.rs", line: 89, col: 13 }, can_unwind: true, force_no_backtrace: false }
Backtrace:    0: backtrace::backtrace::libunwind::trace
             at /Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/libunwind.rs:93:5
      backtrace::backtrace::trace_unsynchronized::<<backtrace::capture::Backtrace>::create::{closure#0}>
             at /Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/mod.rs:66:5
      backtrace::backtrace::trace::<<backtrace::capture::Backtrace>::create::{closure#0}>
             at /Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/backtrace/mod.rs:53:14
      <backtrace::capture::Backtrace>::create
             at /Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/capture.rs:176:9
      <backtrace::capture::Backtrace>::new
             at /Users/kdy1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.68/src/capture.rs:140:22
   1: next_swc_napi::init::{closure#0}
             at packages/next-swc/crates/napi/src/lib.rs:85:29
   2: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/6f3df08aadf71e8d4bf7e49f5dc10dfa6f254cb4/library/alloc/src/boxed.rs:2077:9
      std::panicking::rust_panic_with_hook
             at /rustc/6f3df08aadf71e8d4bf7e49f5dc10dfa6f254cb4/library/std/src/panicking.rs:799:13
   3: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/6f3df08aadf71e8d4bf7e49f5dc10dfa6f254cb4/library/std/src/panicking.rs
```
2024-06-16 14:30:01 +09:00
SWC Bot
10eab94d81 chore: Bump crates 2024-06-14 14:47:30 +00:00
Donny/강동윤
eda2e45691
feat(common): Use SourceMap::adjust_mappings (#9052) 2024-06-14 14:45:58 +00:00
강동윤 (Donny)
7ac3b0a7dc chore: Bump crates 2024-04-29 09:56:27 +09:00
magic-akari
cc1432a12f
chore: Apply cargo autoinherit (#8902) 2024-04-29 00:54:45 +00:00
SWC Bot
4410d62317 chore: Bump crates 2024-04-17 05:44:33 +00:00
Donny/강동윤
f9459a8adf
build(cargo): Update rustc to nightly-2024-04-16 (#8870) 2024-04-17 05:42:11 +00:00
SWC Bot
0af201043a chore: Bump crates 2024-04-16 02:24:47 +00:00
Donny/강동윤
ca9c76b46f
build(cargo): Update rustc to nightly-2024-04-03 (#8821) 2024-04-16 02:20:47 +00:00
SWC Bot
586ab9a4a4 chore: Bump crates 2024-04-12 04:48:39 +00:00
magic-akari
c0d901eac6
doc(swc_core): Resolve build issue with --all-features flag (#8848)
**Related issue:**

- Closes #8829
2024-04-12 04:47:08 +00:00
Donny/강동윤
207582ff25
chore(deps): Update dependencies (#8810) 2024-04-04 15:07:49 +09:00
SWC Bot
2091a06259 chore: Bump crates 2024-04-03 02:35:12 +00:00
Donny/강동윤
4f9ab8151d
fix(common): Fix source index for inputSourceMap (#8800)
**Related issue:**

 - Closes #8789
2024-04-03 02:33:25 +00:00
SWC Bot
dbf930a2c9 chore: Bump crates 2024-03-25 04:20:57 +00:00
Donny/강동윤
f8681c9299
chore(deps): Update sourcemap to v8.0.0 (#8771)
**Related issue:**

 - https://github.com/getsentry/rust-sourcemap/pull/77
2024-03-25 13:18:49 +09:00
SWC Bot
82d1b8e49a chore: Bump crates 2024-03-17 13:04:54 +00:00
Kyuuhachi
f2300dadbf
refactor(common): Debug-print spans more compactly (#8746)
**Description:**

`dbg!()` output on ASTs is kinda verbose,

```rs
ExprStmt {
    span: Span {
        lo: BytePos(
            37,
        ),
        hi: BytePos(
            50,
        ),
        ctxt: #0,
    },
    expr: Lit(
        Str(
            Str {
                span: Span {
                    lo: BytePos(
                        37,
                    ),
                    hi: BytePos(
                        49,
                    ),
                    ctxt: #0,
                },
                value: "use strict",
                raw: Some(
                    "\"use strict\"",
                ),
            },
        ),
    ),
}
```

A lot of the space is wasted on spans — 9 lines per span, even though
it's pretty much unimportant cruft. This PR changes that to just one
line per span:

```rs
ExprStmt {
    span: 37..50#0,
    expr: Lit(
        Str(
            Str {
                span: 37..49#0,
                value: "use strict",
                raw: Some(
                    "\"use strict\"",
                ),
            },
        ),
    ),
}
```

While not a statistically meaningful measurement, in my tests (sample
size = 1) this change reduces the `dbg!()` of a 1103-byte script from
5597 to 2885 lines, which is a 48% reduction. In `{:?}` mode it goes
from 40034 to 25457 chars, or 37% reduction.
2024-03-17 13:03:14 +00:00
SWC Bot
98aa9824d5 chore: Bump crates 2024-03-04 10:08:47 +00:00
SWC Bot
7c5113b6a9 chore: Bump crates 2024-02-22 02:56:23 +00:00
Donny/강동윤
6726b631e6
build(cargo): Update rustc to nightly-2024-02-06 (#8618) 2024-02-13 13:32:49 +09: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
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
Donny/강동윤
043ee85d08
fix(common): Fix source map generation with inputSourceMap (#8546)
**Description:**

- This PR fixes the source map generation when `inputSourceMap` is specified.
- This PR fixes `minify()` not accepting parsed source map in the option.


**Related issue:**

 - Closes #8372.
2024-01-24 02:02:45 +00:00
SWC Bot
2d15177ca9 chore: Bump crates 2024-01-23 08:38:01 +00:00
SWC Bot
6210bf19de chore: Bump crates 2024-01-21 03:08:11 +00:00
SWC Bot
1ca0d65c29 chore: Bump crates 2024-01-21 02:34:11 +00:00
Donny/강동윤
014a6cda82
fix(common): Remove < and > from Display impl of FileName::Custom (#8530)
**Description:**

It caused a problem for next.js
2024-01-21 02:32:35 +00:00
SWC Bot
595f13c019 chore: Publish crates 2023-12-08 07:18:16 +00:00
SWC Bot
0bde652b5c chore: Publish crates 2023-12-08 01:58:57 +00:00