-
-
Notifications
You must be signed in to change notification settings - Fork 733
chore(deps)!: bump swc_core to v46 #12032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack canceled.
|
📦 Binary Size-limit
❌ Size increased by 36.88KB from 47.81MB to 47.84MB (⬆️0.08%) |
CodSpeed Performance ReportMerging #12032 will not alter performanceComparing Summary
|
|
📝 Benchmark detail: Open
|
6d08ddb to
2ffc289
Compare
There was a problem hiding this 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 pull request upgrades the SWC (Speedy Web Compiler) core dependencies from version 45.0.1 to 46.0.2, along with related SWC ecosystem packages. This is a major infrastructure update that requires changes throughout the codebase to adapt to breaking API changes in how SWC handles string atoms and UTF-8 encoding.
Key changes:
- Upgrade of
swc_corefrom 45.0.1 to 46.0.2 and related SWC packages - Migration from
AtomtoWtf8Atomfor handling potentially invalid UTF-8 strings - Addition of
to_atom_lossy(),to_string_lossy(), andas_atom()conversions throughout the codebase - Test snapshot updates reflecting changes in code generation (variable naming in deconfliction scenarios)
Reviewed Changes
Copilot reviewed 32 out of 34 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Updates SWC package versions to 44.0.0-46.0.2 range, removes swc_ecma_lexer dependency |
| Cargo.lock | Lock file updates for new SWC versions and hstr 3.0.1 |
| pnpm-lock.yaml | Updates @swc/plugin-remove-console from 9.1.0 to 10.0.0 |
| tests/rspack-test/package.json | Updates @swc/plugin-remove-console dependency version |
| crates/swc_plugin_ts_collector/src/*.rs | Migrates from Atom to Wtf8Atom for enum handling and type exports |
| crates/rspack_plugin_javascript/src/**/*.rs | Adds lossy conversions for string literals and atoms throughout parser |
| crates/rspack_util/src/atom.rs | Adds ModuleExportNameExt trait for consistent atom access |
| crates/rspack_util/src/fx_hash.rs | Exports indexmap publicly |
| tests/rspack-test/statsAPICases/exports.js | Updates hash value in snapshot |
| tests/rspack-test/esmOutputCases/deconflict/**/*.snap.txt | Updates variable naming in snapshots |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| EnumMemberValue::Number(n) => Some(EvaluatedInlinableValue::new_number(n)), | ||
| EnumMemberValue::String(s) => Some(EvaluatedInlinableValue::new_string(s)), | ||
| EnumMemberValue::String(s) => Some(EvaluatedInlinableValue::new_string( | ||
| s.to_atom_lossy().into_owned(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should use Wtf8Atom here? Enum values may contain unpaired surrogates.
| pub fn eval_str(str: &Str) -> BasicEvaluatedExpression<'_> { | ||
| let mut res = BasicEvaluatedExpression::with_range(str.span().real_lo(), str.span().real_hi()); | ||
| res.set_string(str.value.to_string()); | ||
| res.set_string(str.value.to_string_lossy().to_string()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use Wtf8Atom or Wtf8Buf here for the string type?
| EnumMemberValue::Unknown => None, | ||
| }; | ||
| (id, value) | ||
| (id.to_atom_lossy().into_owned(), value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum name would contain unpaired surrogates as well
Summary
Bump swc related crates.
.to_lossyboundary segmentation might not be optimal.Related links
breaking changes:
LiteralwithStringLiteralin JSXAttrValue type swc-project/swc#10763Checklist