Skip to content

Conversation

@kdy1
Copy link
Member

@kdy1 kdy1 commented Oct 28, 2025

Description:

@kdy1 kdy1 added this to the Planned milestone Oct 28, 2025
@kdy1 kdy1 self-assigned this Oct 28, 2025
@kdy1 kdy1 requested a review from a team as a code owner October 28, 2025 03:34
@kdy1 kdy1 enabled auto-merge (squash) October 28, 2025 03:34
@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

⚠️ No Changeset found

Latest commit: e3b0b90

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@claude
Copy link
Contributor

claude bot commented Oct 28, 2025

Claude finished @kdy1's task —— View job


PR Review: Add default-features = false

Review Progress:

  • Read and analyze the changed Cargo.toml file
  • Evaluate impact of disabling default features
  • Check alignment with codebase guidelines
  • Provide comprehensive feedback on code quality, bugs, performance, security, and test coverage
  • Submit final review

📋 Review Summary

This PR adds default-features = false to 5 internal SWC dependencies in crates/binding_macros/Cargo.toml. The changes are solid and recommended.

Positive Aspects

Performance & Binary Size:

  • Excellent alignment with CLAUDE.md guideline ecmascript parser #1: "Write performant code. Always prefer performance over other things"
  • Reduces binary size by excluding unnecessary features, especially important for WASM bindings
  • Only the most significant impact is on swc crate, which disables ["es3", "lint", "isolated-dts"] by default

Code Quality:

  • Clean, minimal change that follows Rust best practices
  • Consistent application across all internal SWC dependencies
  • Maintains optional feature activation through the existing binding_wasm feature

🔍 Technical Impact Analysis

What gets disabled:

  • swc crate: ES3 compatibility transforms, linting functionality, and isolated TypeScript definition generation
  • Other crates (swc_common, swc_ecma_ast, swc_ecma_visit): Already have empty default = [], so no impact

Runtime behavior:

  • ✅ No breaking changes - features are still available via explicit activation
  • ✅ Binding macros only need core functionality, not the disabled features
  • ✅ WASM bindings remain fully functional

🔒 Security & Stability

  • ✅ No security concerns - only removes optional compilation features
  • ✅ No API changes or behavioral modifications
  • ✅ Dependencies remain the same, just with reduced default surface area

🧪 Test Coverage

  • ✅ No additional tests needed - this is a build configuration change
  • ✅ Existing tests will continue to work as features are still available when explicitly enabled
  • ✅ CI should verify that builds complete successfully

🎯 Recommendation

✅ APPROVE - This is a well-executed optimization that:

  1. Reduces compilation overhead and binary size
  2. Follows the codebase's performance-first philosophy
  3. Maintains backward compatibility
  4. Uses Rust's feature system correctly

The change is particularly valuable for WASM builds where bundle size matters significantly.


@kdy1 kdy1 disabled auto-merge October 28, 2025 03:41
@kdy1 kdy1 merged commit 85d855f into main Oct 28, 2025
171 checks passed
@kdy1 kdy1 deleted the kdy1/size4 branch October 28, 2025 03:41
@github-actions
Copy link
Contributor

Binary Sizes

File Size
swc.linux-x64-gnu.node 32M (32959328 bytes)

Commit: 8e6342a

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 28, 2025

CodSpeed Performance Report

Merging #11193 will not alter performance

Comparing kdy1/size4 (e3b0b90) with main (4c6df95)

Summary

✅ 138 untouched
⏩ 13 skipped1

Footnotes

  1. 13 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@kdy1 kdy1 modified the milestones: Planned, v1.14.0 Oct 29, 2025
@swc-project swc-project locked as resolved and limited conversation to collaborators Nov 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants