Avatar for the swc-project user
swc-project
swc
BlogDocsChangelog

Performance History

Latest Results

fix(es/minifier): Preserve objec spread
Austaras:spread
27 minutes ago
fix(es/minifier): Preserve objec spread
Austaras:spread
2 hours ago
Merge branch 'main' into kdy1/fix-issue-12658
kdy1/fix-issue-12658
3 hours ago
Merge branch 'main' into kdy1/fix-issue-12722
kdy1/fix-issue-12722
3 hours ago
Merge branch 'main' into kdy1/fix-issue-12668
kdy1/fix-issue-12668
3 hours ago
feat(es/minifier): Remove more trailing returns with values known to be undefined (#12723) **Description:** The minifier removes a `return` statement at the end of a function when its value is `void x`. It did not remove the statement for other values that are always `undefined`, for example `return a, void b`. The minifier then kept the `return` and the `void`. This PR changes `drop_unused_stmt_at_end_of_fn` to use `get_type` instead of a check for `void`. If the returned expression is known to be `undefined`, the minifier replaces `return <expr>` with `<expr>;`. The expression stays in the output, so side effects do not change. The function result is `undefined` in both forms. Expressions that `get_type` reports as `undefined`: - `void x` - the global `undefined`. A local binding named `undefined` is not matched. - `a = <undefined>` - a sequence, or a conditional, where every value is `undefined` Example: ```js // before return anchor = this.start, void (restorePoint(range.start, anchor), restorePoint(range.end, anchor)); // after anchor = this.start, restorePoint(range.start, anchor), restorePoint(range.end, anchor); ``` Test results: - Fixtures in `crates/swc_ecma_minifier/tests/fixture/pr/12723` cover each case above, an arrow function, and a shadowed `undefined` that must stay. Each fixture has an `expected.stdout`, so the test also checks the result of the minified code. - Three of the new fixtures (`return-assign-void`, `return-seq-void`, `return-seq-void-nested`) fail without this change. The other fixtures pass without it, because other passes already remove `return undefined` and `return a, undefined`. They stay as regression tests. - The output of five existing fixtures gets shorter (`react-ace`, `yui/6`, `react-dom-17.0.2`, terser `issue_1758`, and `projects-size.snapshot.md`). - `cargo test -p swc_ecma_minifier` passes. - CodSpeed reports no change in performance. **BREAKING CHANGE:** **Related issue (if exists):** šŸ¤– Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: DongYun Kang <kdy.1997.dev@gmail.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
main
4 hours ago

Latest Branches

CodSpeed Performance Gauge
0%
fix(es/minifier): Preserve object spread in seq#12733
13 hours ago
23e90d6
Austaras:spread
CodSpeed Performance Gauge
0%
3 hours ago
1482ae8
kdy1/fix-issue-12658
CodSpeed Performance Gauge
0%
3 hours ago
6bfecbe
kdy1/fix-issue-12722
Ā© 2026 CodSpeed Technology
Home Terms Privacy Docs