swc-project
swc
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
refactor(es/minifier): Move drop_console and unsafes from Pure to Optimizer (#11388) ## Summary - Moved `drop_console` functionality from the `Pure` optimization pass to the `Optimizer` pass - Moved `drop_arguments_of_symbol_call` (unsafe Symbol handling) from `Pure` to `Optimizer` - Updated both implementations to use `Optimizer` context instead of `Pure` context - Integrated the calls into `Optimizer`'s `VisitMut` implementation ## Changes - Renamed `crates/swc_ecma_minifier/src/compress/pure/drop_console.rs` ā `crates/swc_ecma_minifier/src/compress/optimize/drop_console.rs` - Renamed `crates/swc_ecma_minifier/src/compress/pure/unsafes.rs` ā `crates/swc_ecma_minifier/src/compress/optimize/unsafes.rs` - Updated `Optimizer` to call `drop_console()` and `drop_arguments_of_symbol_call()` - Removed these calls from `Pure` pass ## Test plan - [ ] Run execution tests: `./scripts/exec.sh` in `crates/swc_ecma_minifier` - [ ] Run fixture tests: `./scripts/test.sh` in `crates/swc_ecma_minifier` - [ ] Verify minification behavior remains unchanged - [ ] Confirm no regressions in existing test suites š¤ Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
main
16 hours ago
Create lovely-ghosts-doubt.md
kdy1/merge-pure
17 hours ago
refactor(es/parser): Distinguish JsxText from Str (#11387) **Description:** Since JSXText is always valid utf8 string, this pr adds `TokenValue::JsxText(Atom)` to avoid unnecessary conversion between `Wtf8Atom` and `Atom`
main
18 hours ago
Create neat-moose-mate.md
12-19-refactor/jsx-text-token-value
18 hours ago
Add TokenValue::JsxText
12-19-refactor/jsx-text-token-value
20 hours ago
feat(es/transformer): Implement statement injection for static properties Implement static property initialization using statement_injector: - Add pending_class_stmt_stack to track statement addresses - Implement enter_stmt hook to capture class declaration addresses - Complete emit_static_initializers to generate: * Static property assignments (C.prop = value) * Private static property WeakMap.set calls * Private static accessor WeakMap.set calls * Private method function declarations The implementation uses enter_stmt to store the statement pointer, then injects statements after the class declaration via statement_injector. Note: Tests are still failing - static initializers are not being emitted. Further investigation needed to understand why statement_injector is not working as expected. š¤ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
kdy1/port-class-properties
21 hours ago
fix(es/minifier): Prevent unsafe sequence merging in `super()` calls (#11381) **Description:** This fixes a bug where assignments were incorrectly merged into `super()` arguments, breaking evaluation order. `super()` calls were falling through to generic assignment logic without the safety checks applied to normal function calls. Fix: Added explicit handling for `Callee::Super` in `merge_sequential_expr`. This now verifies that arguments are "skippable" (safe) before allowing any sequence merging, ensuring correct execution order. **Related issue:** - https://github.com/web-infra-dev/rspack/issues/12492
main
1 day ago
fix(es/transformer): Fix variable declaration for nullish coalescing in else-if branches (#11384) ## Summary Fixes #11379 This PR adds a test case and expected output to verify the fix for issue #11379, where the nullish coalescing operator in `else if` statements was causing missing variable declarations. ## Changes - Added test case in `crates/swc/tests/fixture/issues-11xxx/11379/input/index.js` - Added expected output in `crates/swc/tests/fixture/issues-11xxx/11379/output/index.js` ## Root Cause & Fix The issue was already resolved by the var injector refactoring in #11383. The refactoring ensures that all temporary variables (like `_obj_x` and `_obj_y`) are properly declared at the top of the scope, preventing `ReferenceError` at runtime. ## Test Results Both `_obj_x` and `_obj_y` are now correctly declared: ```javascript var _obj_x, _obj_y; var obj = {}; if (((_obj_x = obj.x) !== null && _obj_x !== void 0 ? _obj_x : 0) > 0) { console.log("x"); } else if (((_obj_y = obj.y) !== null && _obj_y !== void 0 ? _obj_y : 0) > 0) { console.log("y"); } ``` All tests pass: `cargo test -p swc --test projects --test tsc` š¤ Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
main
1 day ago
Active Branches
feat(es/transformer): Merge `class_properties` pass
last run
21 hours ago
#11386
CodSpeed Performance Gauge
+19%
[Meta] Port single-pass compiler from oxc
last run
15 days ago
#11292
CodSpeed Performance Gauge
0%
feat(test): Migrate from test262-parser-tests to full test262 suite
last run
1 month ago
#11290
CodSpeed Performance Gauge
0%
Ā© 2025 CodSpeed Technology
Home
Terms
Privacy
Docs