Skip to content

Conversation

@CPunisher
Copy link
Contributor

@CPunisher CPunisher commented Dec 12, 2025

Summary

See: CPunisher/swc-experimental@be7913b

SWC doesn't add utf8 boundary check in bump function, although it still works in this cases.
SWC-experimental add utf8 boundary check, thus panic here.

There are some other changes in this pr due to the breaking of SWC-experimental

Checklist

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

@CPunisher CPunisher requested a review from quininer as a code owner December 12, 2025 08:15
Copilot AI review requested due to automatic review settings December 12, 2025 08:15
@netlify
Copy link

netlify bot commented Dec 12, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 2fd7abf
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/693bcf0765861e0008a73698

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Dec 12, 2025
@CPunisher CPunisher enabled auto-merge (squash) December 12, 2025 08:15
Copy link
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 bumps the swc_experimental packages from version 0.1.1 to 0.3.1 to fix UTF-8 boundary checking issues in the template parsing logic. The newer version adds proper UTF-8 boundary checks in the bump function that were previously missing, preventing potential panics when parsing code with UTF-8 characters.

Key changes:

  • Updated three swc_experimental packages to version 0.3.1
  • Migrated code to use new API methods introduced in the updated version
  • Replaced raw scope ID manipulation with safer conversion methods

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
Cargo.toml Bumped versions of swc_experimental_ecma_ast, swc_experimental_ecma_parser, and swc_experimental_ecma_semantic from 0.1.1 to 0.3.1
Cargo.lock Updated dependency checksums and consolidated dependencies (packages now use swc_core instead of individual swc packages)
crates/rspack_core/src/concatenated_module.rs Migrated to new API: replaced FromNodeId trait with NodeIdTrait, changed UNRESOLVED_SCOPE_ID constant to unresolved_scope_id() method, updated scope ID to context conversions to use to_ctxt() method, and changed node.kind field access to node.kind() method calls

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

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 2fd7abf to refactor: replace SourceFile with &str and replace Arc<SourceMap> with Rope in rspack_plugin_javascript (#12404) by CPunisher

🎉 Size decreased by 12.25KB from 48.22MB to 48.20MB (⬇️0.02%)

@github-actions
Copy link
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 project(s) in monorepo.

📁 react-10k

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

📌 Baseline Commit: 3c56e8cd62 | PR: #12404

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

📦 Download Diff Report: react-10k Bundle Diff

📁 react-1k

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

📌 Baseline Commit: 3c56e8cd62 | PR: #12404

Metric Current Baseline Change
📊 Total Size 823.6 KB 823.6 KB 0 B (0.0%)
📄 JavaScript 823.6 KB 823.6 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-1k Bundle Diff

📁 react-5k

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

📌 Baseline Commit: 3c56e8cd62 | PR: #12404

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

📦 Download Diff Report: react-5k Bundle Diff

📁 rome

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

📌 Baseline Commit: 3c56e8cd62 | PR: #12404

Metric Current Baseline Change
📊 Total Size 984.3 KB 984.3 KB 0 B (0.0%)
📄 JavaScript 984.3 KB 984.3 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: rome Bundle Diff

📁 ui-components

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

📌 Baseline Commit: 3c56e8cd62 | PR: #12404

Metric Current Baseline Change
📊 Total Size 2.1 MB 2.1 MB 0 B (0.0%)
📄 JavaScript 2.0 MB 2.0 MB 0 B (0.0%)
🎨 CSS 83.0 KB 83.0 KB 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: ui-components Bundle Diff

Generated by Rsdoctor GitHub Action

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 12, 2025

CodSpeed Performance Report

Merging #12431 will not alter performance

Comparing 12-12-chore/bump (2fd7abf) with main (3c56e8c)

Summary

✅ 17 untouched

@CPunisher CPunisher merged commit 6f3f4de into main Dec 12, 2025
63 checks passed
@CPunisher CPunisher deleted the 12-12-chore/bump branch December 12, 2025 08:40
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