-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Branch: SWC v2 #10739
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
base: main
Are you sure you want to change the base?
Branch: SWC v2 #10739
Conversation
🦋 Changeset detectedLatest commit: 9e887cc The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CodSpeed Performance ReportMerging #10739 will not alter performanceComparing Summary
|
This branch needs rebase. |
Can you do it? |
No. dev/v2 is a protected branch. |
After several tries to rebase, I created https://github.com/swc-project/swc/tree/v2-rebase Can you rebase this branch instead? |
**Related issue:** - #10553
I think this is ok because this change is not important. |
done |
Thank you! I updated |
Claude finished @kdy1's task —— View job SWC v2 Pull Request ReviewI've completed a comprehensive review of this major version PR focusing on code quality, potential bugs, performance, security, and test coverage. Review Checklist
🚨 Critical Breaking Changes1. React Transform Default Runtime ChangeImpact: HIGH - This affects every JSX transformation by default. // Before v2 (Classic default)
Runtime::Classic(Default::default()) // Uses React.createElement
// After v2 (Automatic default)
Runtime::Automatic(Default::default()) // Uses jsx/jsxs from react/jsx-runtime Migration Required: {
"jsc": {
"transform": {
"react": {
"runtime": "classic" // Add this to maintain v1 behavior
}
}
}
} 2. AST Breaking Change - JSXAttrValueImpact: MEDIUM - Affects tooling that depends on SWC AST structure. Change from 3. JSX Transform Processing OrderImpact: MEDIUM - Architectural change in transform pipeline. Classic JSX transform now runs before the resolver pass (lines 311-334 in config/mod.rs), which could affect custom transforms that depend on scope information. 🔍 Code Quality AssessmentStrengths:
Concerns:
🔒 Security AssessmentHigh Priority Issues:
Medium Priority:
⚡ Performance ImplicationsPositive:
Potential Concerns:
📋 RecommendationsBefore Merging:
For Users:
Code Quality Improvements:// Instead of:
js_minify.as_ref().unwrap()
// Consider:
js_minify.as_ref().expect("js_minify should be Some at this point")
// or proper error handling ✅ Final AssessmentThis is a well-tested major version release with significant but necessary breaking changes. The React transform default change is the most impactful but aligns with modern React practices. Recommendation: APPROVE with caveats
The extensive test coverage (100+ fixtures) and performance benchmarking infrastructure demonstrate good engineering practices. The breaking changes are justified for modernizing SWC's default behavior. Total Files Reviewed: 12 core files + extensive test analysis |
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
No description provided.