Skip to content

Commit

Permalink
Merge branch 'main' into amaro-error
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 authored Jan 10, 2025
2 parents c677abf + ae53a35 commit 5fc3dc5
Show file tree
Hide file tree
Showing 64 changed files with 470 additions and 181 deletions.
6 changes: 0 additions & 6 deletions .changeset/pretty-news-chew.md

This file was deleted.

7 changes: 1 addition & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,7 @@ jobs:
fail-fast: false
matrix:
crate:
- better_scoped_tls
- string_enum
# - swc
- swc_bundler
# - swc_ecma_codegen
# - swc_ecma_minifier
- swc_parallel
steps:
- uses: actions/checkout@v4
with:
Expand Down
17 changes: 11 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Changelog
## [unreleased]

### Bug Fixes



- **(es/minifier)** Improve DCE ([#9853](/~https://github.com/swc-project/swc/issues/9853)) ([85fb16c](/~https://github.com/swc-project/swc/commit/85fb16c3a241bbd87066a119357ad560e336457d))


- **(es/parser)** Fix context of dynamic import type ([#9852](/~https://github.com/swc-project/swc/issues/9852)) ([caa7f37](/~https://github.com/swc-project/swc/commit/caa7f370ff2003983a3448a2b7e6f0f6d6224b86))

## [1.10.6] - 2025-01-07

### Performance
Expand Down Expand Up @@ -1518,12 +1529,6 @@



- **(es/lexer)** Optimize lexer ([#9075](/~https://github.com/swc-project/swc/issues/9075)) ([6426928](/~https://github.com/swc-project/swc/commit/6426928b912baa6573b902d7d3c85bcd49b2e823))


- **(es/lexer)** Make lexing of string literals faster ([#9077](/~https://github.com/swc-project/swc/issues/9077)) ([373bac5](/~https://github.com/swc-project/swc/commit/373bac55aaffbe1f6e001c7c6d490797de45114e))


- **(es/lexer)** Reduce allocation while lexing identifiers ([#9076](/~https://github.com/swc-project/swc/issues/9076)) ([69f00b8](/~https://github.com/swc-project/swc/commit/69f00b85d465e882ec33642d6e8ed22dbe3c3fb2))


Expand Down
8 changes: 5 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/dbg-swc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ swc_ecma_codegen = { version = "5.0.1", path = "../swc_ecma_codegen" }
swc_ecma_minifier = { version = "7.0.1", path = "../swc_ecma_minifier", features = [
"concurrent",
] }
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_base = { version = "7.0.0", path = "../swc_ecma_transforms_base" }
swc_ecma_visit = { version = "5.0.0", path = "../swc_ecma_visit" }
swc_error_reporters = { version = "6.0.0", path = "../swc_error_reporters" }
Expand Down
2 changes: 1 addition & 1 deletion crates/jsdoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ anyhow = { workspace = true }
dashmap = { workspace = true }

swc_ecma_ast = { version = "5.0.1", path = "../swc_ecma_ast" }
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
testing = { version = "5.0.0", path = "../testing" }
4 changes: 2 additions & 2 deletions crates/swc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ swc_ecma_loader = { version = "5.0.0", path = "../swc_ecma_loader", features = [
"tsc",
] }
swc_ecma_minifier = { version = "7.0.1", path = "../swc_ecma_minifier" }
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_preset_env = { version = "9.0.0", path = "../swc_ecma_preset_env" }
swc_ecma_transforms = { version = "9.0.0", path = "../swc_ecma_transforms", features = [
"compat",
Expand All @@ -101,7 +101,7 @@ swc_ecma_transforms = { version = "9.0.0", path = "../swc_ecma_transforms", feat
] }
swc_ecma_transforms_base = { version = "7.0.0", path = "../swc_ecma_transforms_base" }
swc_ecma_transforms_compat = { version = "8.0.0", path = "../swc_ecma_transforms_compat" }
swc_ecma_transforms_optimization = { version = "7.0.0", path = "../swc_ecma_transforms_optimization" }
swc_ecma_transforms_optimization = { version = "7.0.1", path = "../swc_ecma_transforms_optimization" }
swc_ecma_utils = { version = "7.0.0", path = "../swc_ecma_utils" }
swc_ecma_visit = { version = "5.0.0", path = "../swc_ecma_visit" }
swc_error_reporters = { version = "6.0.0", path = "../swc_error_reporters" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
//// [accessorsOverrideProperty3.ts]
Animal;
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
//// [accessorsOverrideProperty4.ts]
Animal;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//// [asyncGeneratorParameterEvaluation.ts]
import "@swc/helpers/_/_extends";
import "@swc/helpers/_/_object_destructuring_empty";
import "@swc/helpers/_/_wrap_async_generator";
import { _ as _extends } from "@swc/helpers/_/_extends";
import { _ as _object_destructuring_empty } from "@swc/helpers/_/_object_destructuring_empty";
import { _ as _wrap_async_generator } from "@swc/helpers/_/_wrap_async_generator";
Super;
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//// [asyncGeneratorParameterEvaluation.ts]
import "@swc/helpers/_/_extends";
import "@swc/helpers/_/_object_destructuring_empty";
import { _ as _extends } from "@swc/helpers/_/_extends";
import { _ as _object_destructuring_empty } from "@swc/helpers/_/_object_destructuring_empty";
Super;
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
//// [asyncGeneratorParameterEvaluation.ts]
Super;
6 changes: 6 additions & 0 deletions crates/swc/tests/tsc-references/override19.2.minified.js
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
//// [override19.ts]
class Context {
}
class A {
doSomething() {}
}
CreateMixin(Context, A), CreateMixin(Context, A);
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
//// [overrideInterfaceProperty.ts]
Mup, Mup;
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
//// [foo.ts]
//// [bar.js]
Foo;
4 changes: 2 additions & 2 deletions crates/swc_bundler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ swc_common = { version = "5.0.0", path = "../swc_common" }
swc_ecma_ast = { version = "5.0.1", path = "../swc_ecma_ast" }
swc_ecma_codegen = { version = "5.0.1", path = "../swc_ecma_codegen" }
swc_ecma_loader = { version = "5.0.0", path = "../swc_ecma_loader" }
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_base = { version = "7.0.0", path = "../swc_ecma_transforms_base" }
swc_ecma_transforms_optimization = { version = "7.0.0", path = "../swc_ecma_transforms_optimization" }
swc_ecma_transforms_optimization = { version = "7.0.1", path = "../swc_ecma_transforms_optimization" }
swc_ecma_utils = { version = "7.0.0", path = "../swc_ecma_utils" }
swc_ecma_visit = { version = "5.0.0", path = "../swc_ecma_visit" }
swc_fast_graph = { version = "6.0.0", path = "../swc_fast_graph/" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,13 @@ function copyBytes(src, dst, off = 0) {
return src.byteLength;
}
const DEFAULT_BUF_SIZE = 4096;
class PartialReadError extends Deno.errors.UnexpectedEof {
name = "PartialReadError";
partial;
constructor(){
super("Encountered UnexpectedEof, data only partially read");
}
}
class AbstractBufBase {
buf;
usedBufferBytes = 0;
Expand Down
7 changes: 7 additions & 0 deletions crates/swc_bundler/tests/fixture/deno-9591/output/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,13 @@ function copyBytes(src, dst, off = 0) {
return src.byteLength;
}
const DEFAULT_BUF_SIZE = 4096;
class PartialReadError extends Deno.errors.UnexpectedEof {
name = "PartialReadError";
partial;
constructor(){
super("Encountered UnexpectedEof, data only partially read");
}
}
class AbstractBufBase {
buf;
usedBufferBytes = 0;
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_cli_impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tracing-futures = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
walkdir = { workspace = true }

swc_core = { version = "10.0.1", features = [
swc_core = { version = "10.0.2", features = [
"trace_macro",
"common_concurrent",
"base_concurrent",
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_compiler_base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ swc_config = { version = "1.0.0", path = "../swc_config" }
swc_ecma_ast = { version = "5.0.1", path = "../swc_ecma_ast" }
swc_ecma_codegen = { version = "5.0.1", path = "../swc_ecma_codegen" }
swc_ecma_minifier = { version = "7.0.1", path = "../swc_ecma_minifier" }
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_visit = { version = "5.0.0", path = "../swc_ecma_visit" }
swc_timer = { version = "1.0.0", path = "../swc_timer" }

Expand Down
6 changes: 3 additions & 3 deletions crates/swc_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "swc_core"
repository = { workspace = true }
version = "10.0.1"
version = "10.0.2"
[package.metadata.docs.rs]
features = [
"allocator_node",
Expand Down Expand Up @@ -358,13 +358,13 @@ swc_ecma_codegen = { optional = true, version = "5.0.1", path =
swc_ecma_lints = { optional = true, version = "7.0.0", path = "../swc_ecma_lints" }
swc_ecma_loader = { optional = true, version = "5.0.0", path = "../swc_ecma_loader" }
swc_ecma_minifier = { optional = true, version = "7.0.1", path = "../swc_ecma_minifier" }
swc_ecma_parser = { optional = true, version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { optional = true, version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_preset_env = { optional = true, version = "9.0.0", path = "../swc_ecma_preset_env" }
swc_ecma_quote_macros = { optional = true, version = "6.0.0", path = "../swc_ecma_quote_macros" }
swc_ecma_transforms_base = { optional = true, version = "7.0.0", path = "../swc_ecma_transforms_base" }
swc_ecma_transforms_compat = { optional = true, version = "8.0.0", path = "../swc_ecma_transforms_compat" }
swc_ecma_transforms_module = { optional = true, version = "8.0.0", path = "../swc_ecma_transforms_module" }
swc_ecma_transforms_optimization = { optional = true, version = "7.0.0", path = "../swc_ecma_transforms_optimization" }
swc_ecma_transforms_optimization = { optional = true, version = "7.0.1", path = "../swc_ecma_transforms_optimization" }
swc_ecma_transforms_proposal = { optional = true, version = "7.0.0", path = "../swc_ecma_transforms_proposal" }
swc_ecma_transforms_react = { optional = true, version = "7.0.0", path = "../swc_ecma_transforms_react" }
swc_ecma_transforms_testing = { optional = true, version = "7.0.0", path = "../swc_ecma_transforms_testing" }
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ swc_allocator = { version = "2.0.0", path = "../swc_allocator" }
swc_common = { version = "5.0.0", path = "../swc_common", features = [
"sourcemap",
] }
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_testing = { version = "5.0.0", path = "../swc_ecma_testing" }
swc_malloc = { version = "1.0.0", path = "../swc_malloc" }
testing = { version = "5.0.0", path = "../testing" }
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_compat_bugfixes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ swc_trace_macro = { version = "2.0.0", path = "../swc_trace_macro" }
tracing = { workspace = true }

[dev-dependencies]
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_testing = { version = "7.0.0", path = "../swc_ecma_transforms_testing" }
2 changes: 1 addition & 1 deletion crates/swc_ecma_compat_es2015/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ swc_trace_macro = { version = "2.0.0", path = "../swc_trace_macro" }
tracing = { workspace = true }

[dev-dependencies]
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_testing = { version = "7.0.0", path = "../swc_ecma_transforms_testing" }
2 changes: 1 addition & 1 deletion crates/swc_ecma_compat_es2016/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ swc_trace_macro = { version = "2.0.0", path = "../swc_trace_macro" }
tracing = { workspace = true }

[dev-dependencies]
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_testing = { version = "7.0.0", path = "../swc_ecma_transforms_testing" }
2 changes: 1 addition & 1 deletion crates/swc_ecma_compat_es2017/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ swc_ecma_visit = { version = "5.0.0", path = "../swc_ecma_visit" }
swc_trace_macro = { version = "2.0.0", path = "../swc_trace_macro" }

[dev-dependencies]
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_testing = { version = "7.0.0", path = "../swc_ecma_transforms_testing" }
2 changes: 1 addition & 1 deletion crates/swc_ecma_compat_es2018/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ swc_ecma_visit = { version = "5.0.0", path = "../swc_ecma_visit" }
swc_trace_macro = { version = "2.0.0", path = "../swc_trace_macro" }

[dev-dependencies]
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_testing = { version = "7.0.0", path = "../swc_ecma_transforms_testing" }
2 changes: 1 addition & 1 deletion crates/swc_ecma_compat_es2019/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ swc_ecma_visit = { version = "5.0.0", path = "../swc_ecma_visit" }
swc_trace_macro = { version = "2.0.0", path = "../swc_trace_macro" }

[dev-dependencies]
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_testing = { version = "7.0.0", path = "../swc_ecma_transforms_testing" }
2 changes: 1 addition & 1 deletion crates/swc_ecma_compat_es2020/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ swc_trace_macro = { version = "2.0.0", path = "../swc_trace_macro" }
tracing = { workspace = true }

[dev-dependencies]
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_testing = { version = "7.0.0", path = "../swc_ecma_transforms_testing" }
2 changes: 1 addition & 1 deletion crates/swc_ecma_compat_es3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ swc_ecma_visit = { version = "5.0.0", path = "../swc_ecma_visit" }
swc_trace_macro = { version = "2.0.0", path = "../swc_trace_macro" }

[dev-dependencies]
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_testing = { version = "7.0.0", path = "../swc_ecma_transforms_testing" }
2 changes: 1 addition & 1 deletion crates/swc_ecma_lints/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ codspeed-criterion-compat = { workspace = true }
criterion = { workspace = true }
pretty_assertions = { workspace = true }
swc_ecma_codegen = { version = "5.0.1", path = "../swc_ecma_codegen" }
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_testing = { version = "5.0.0", path = "../swc_ecma_testing" }
swc_ecma_transforms_base = { version = "7.0.0", path = "../swc_ecma_transforms_base" }
swc_malloc = { version = "1.0.0", path = "../swc_malloc" }
Expand Down
4 changes: 2 additions & 2 deletions crates/swc_ecma_minifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ swc_ecma_ast = { version = "5.0.1", path = "../swc_ecma_ast", features = [
"serde",
] }
swc_ecma_codegen = { version = "5.0.1", path = "../swc_ecma_codegen" }
swc_ecma_parser = { version = "6.0.1", path = "../swc_ecma_parser" }
swc_ecma_parser = { version = "6.0.2", path = "../swc_ecma_parser" }
swc_ecma_transforms_base = { version = "7.0.0", path = "../swc_ecma_transforms_base" }
swc_ecma_transforms_optimization = { version = "7.0.0", path = "../swc_ecma_transforms_optimization" }
swc_ecma_transforms_optimization = { version = "7.0.1", path = "../swc_ecma_transforms_optimization" }
swc_ecma_usage_analyzer = { version = "7.0.0", path = "../swc_ecma_usage_analyzer" }
swc_ecma_utils = { version = "7.0.0", path = "../swc_ecma_utils" }
swc_ecma_visit = { version = "5.0.0", path = "../swc_ecma_visit" }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(() => {
"use strict";
class Element { }
class PointElement extends Element {
static id = 'point';
constructor(cfg) {
super();
}
}

// var chart_elements = /*#__PURE__*/ Object.freeze({
// PointElement: PointElement
// });

var chart_elements = /*#__PURE__*/(null && (Object.freeze({
PointElement: PointElement
})));

const registerables = null && ([
chart_elements,
chart_plugins,
]);

console.log('Done 1')
})()
;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('Done 1');
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(() => {
"use strict";
class Element { }


// var chart_elements = /*#__PURE__*/ Object.freeze({
// PointElement: PointElement
// });

var chart_elements = /*#__PURE__*/(null && (Object.freeze({
Element: Element
})));

const registerables = null && ([
chart_elements,
chart_plugins
]);

console.log('Done 2')
})()
;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('Done 2');
7 changes: 7 additions & 0 deletions crates/swc_ecma_minifier/tests/fixture/issues/9823/3/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(function () {
function foo() {

}

console.log('Done')
})()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('Done');
Loading

0 comments on commit 5fc3dc5

Please sign in to comment.