Skip to content

chore: bump swc_core from 55 to 56 and swc-experimental from 0.4.1 to 0.5.0#12906

Merged
hardfist merged 5 commits intomainfrom
02-02-chore/bump-swc
Feb 3, 2026
Merged

chore: bump swc_core from 55 to 56 and swc-experimental from 0.4.1 to 0.5.0#12906
hardfist merged 5 commits intomainfrom
02-02-chore/bump-swc

Conversation

@CPunisher
Copy link
Copy Markdown
Contributor

@CPunisher CPunisher commented Feb 2, 2026

Summary

SWC: https://github.com/swc-project/swc/blob/main/CHANGELOG-CORE.md

  1. API BREAKING: SWC disable module transformation feature by default (feat(swc): Make module transforms optional via module feature swc-project/swc#11509). However, rspack depends on it to transform the typescript config files.
  2. Performant combined AST traversal (WIP by kdy). This will reduce the visit passes of javascript syntax lowering.
  3. (es/minifier) Remove inlined IIFE arg and param
  4. Lots of bug fixes

SWC-experimental: https://github.com/CPunisher/swc-experimental/releases/tag/v0.5.0

  1. API BREAKING: Temporarily remove free_node.

A a faster preorder visit based on the node array has been tried in #12369,
which depends on free_node during parsing.
However, a better mutability story on swc_experimental is designing and free_node is removed temporarily.
Once it's finished, this function will be reverted back.

  1. Deduplicate strings in the AST using https://crates.io/crates/string-interner and reference them via u32 IDs. While this degrades parser performance, it is expected to improve subsequent analysis performance. This is a breaking change but rspack doesn't use it currently.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@CPunisher CPunisher requested a review from quininer as a code owner February 2, 2026 05:51
Copilot AI review requested due to automatic review settings February 2, 2026 05:51
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Feb 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades SWC dependencies from version 55 to 56 for swc_core and from 0.4.1 to 0.5.0 for swc-experimental packages. The upgrade includes a refactoring of the identifier collection logic in concatenated_module.rs to use a visitor pattern instead of node array iteration, as the free_node API was temporarily removed from swc-experimental.

Changes:

  • Upgraded swc_core and related packages (swc, swc_ecma_minifier, swc_html_minifier) to their latest versions
  • Upgraded swc-experimental packages (swc_experimental_ecma_ast, swc_experimental_ecma_parser, swc_experimental_ecma_semantic) from 0.4.1 to 0.5.0
  • Refactored collect_ident function to use the visitor pattern, porting logic from utils::IdentCollector

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
Cargo.toml Updated version constraints for swc_core (55.0.0 → 56.0.0), swc (53.0.0 → 54.0.0), swc_ecma_minifier (43.0.0 → 44.0.0), swc_html_minifier (43.0.0 → 44.0.0), and swc-experimental packages (0.4.1 → 0.5.0)
crates/rspack_workspace/src/generated.rs Updated the generated swc_core version string from "55.0.0" to "56.0.0"
crates/rspack_core/src/concatenated_module.rs Refactored collect_ident to use visitor pattern; updated imports to include Visit, VisitWith, ObjectPatProp, and Prop; changed function signature to accept Module instead of Semantic
Cargo.lock Comprehensive lockfile update reflecting all transitive dependency changes from the version bumps, including new dependencies like string-interner and swc_ecma_regexp family

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 2, 2026

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 5 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB -11.0 B (-0.0%)
react-1k 825.4 KB -11.0 B (-0.0%)
react-5k 2.7 MB -11.0 B (-0.0%)
rome 984.2 KB -8.0 B (-0.0%)
ui-components 2.2 MB -67.0 B (-0.0%)
📋 Detailed Reports (Click to expand)

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

📌 Baseline Commit: 953025ee89 | PR: #12900

Metric Current Baseline Change
📊 Total Size 5.7 MB 5.7 MB -11.0 B (-0.0%)
📄 JavaScript 5.7 MB 5.7 MB -11.0 B (-0.0%)
🎨 CSS 21.0 B 21.0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-10k Bundle Diff

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

📌 Baseline Commit: 953025ee89 | PR: #12900

Metric Current Baseline Change
📊 Total Size 825.4 KB 825.4 KB -11.0 B (-0.0%)
📄 JavaScript 825.4 KB 825.4 KB -11.0 B (-0.0%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-1k Bundle Diff

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

📌 Baseline Commit: 953025ee89 | PR: #12900

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB -11.0 B (-0.0%)
📄 JavaScript 2.7 MB 2.7 MB -11.0 B (-0.0%)
🎨 CSS 21.0 B 21.0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-5k Bundle Diff

📁 rome

Path: ../build-tools-performance/cases/rome/dist/rsdoctor-data.json

📌 Baseline Commit: 953025ee89 | PR: #12900

Metric Current Baseline Change
📊 Total Size 984.2 KB 984.2 KB -8.0 B (-0.0%)
📄 JavaScript 984.2 KB 984.2 KB -8.0 B (-0.0%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: rome Bundle Diff

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

📌 Baseline Commit: 953025ee89 | PR: #12900

Metric Current Baseline Change
📊 Total Size 2.2 MB 2.2 MB -67.0 B (-0.0%)
📄 JavaScript 2.0 MB 2.0 MB -67.0 B (-0.0%)
🎨 CSS 267.8 KB 267.8 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: ui-components Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 2, 2026

📦 Binary Size-limit

Comparing c5404ac to feat: support import.defer() for statical path (#12900) by Gengkun

❌ Size increased by 62.50KB from 48.31MB to 48.37MB (⬆️0.13%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 2, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing 02-02-chore/bump-swc (c5404ac) with main (953025e)

Summary

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@CPunisher CPunisher requested a review from hardfist February 2, 2026 06:35
@hardfist hardfist merged commit 2f3aa4e into main Feb 3, 2026
49 of 51 checks passed
@hardfist hardfist deleted the 02-02-chore/bump-swc branch February 3, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants