Skip to content

Conversation

@kdy1
Copy link
Member

@kdy1 kdy1 commented Nov 1, 2025

Description:

This PR

  • Removes a cargo workspace at ./bindgins.
  • Moves crates in bindings to the top level workspace.

Related issue:

@kdy1 kdy1 added this to the Planned milestone Nov 1, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 1, 2025

⚠️ No Changeset found

Latest commit: edad7c1

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 Nov 1, 2025

Claude finished @kdy1's task —— View job


PR Review: Merge Cargo Workspaces

Review Tasks:

  • Analyze workspace structure changes
  • Review dependency management updates
  • Examine CI workflow modifications
  • Investigate performance regressions
  • Check for security and stability concerns
  • Provide comprehensive feedback

Summary

This PR successfully consolidates the SWC cargo workspaces by removing the nested ./bindings workspace and integrating all binding crates into the top-level workspace. The change is structurally sound and follows Rust workspace best practices.

Code Quality & Best Practices ✅

Positive aspects:

  • Clean workspace consolidation: The move from nested to flat workspace structure is well-executed
  • Proper dependency management: All workspace dependencies are correctly referenced using { workspace = true }
  • Consistent versioning: All binding crates maintain version 0.1.0 with publish = false
  • Path references updated: All inter-crate dependencies correctly use relative paths (../../crates/...)

Potential Issues & Concerns ⚠️

1. CI Workflow Incompleteness (Critical)

The CI workflow still contains references to the old bindings workspace structure:

  • CI.yml:183: (cd bindings/${{ matrix.pkg }} && ./scripts/test.sh)
  • CI.yml:300: cargo test --manifest-path ./bindings/binding_core_wasm/Cargo.toml
  • CI.yml:305: cargo test --manifest-path ./bindings/swc_cli/Cargo.toml --features plugin
  • CI.yml:447: (cd ./bindings && cargo clean)

Impact: These commands will likely fail since there's no longer a separate workspace in ./bindings/

2. Performance Regressions (Moderate)

CodSpeed reports 8.56% performance degradation with 7 regressions:

  • CSS lexer benchmarks showing 8%+ slowdown
  • HTML document visitor benchmarks with 3%+ regressions

Root cause analysis needed: This could be due to:

  • Different optimization flags between workspaces
  • Changes in dependency resolution
  • Profile configuration differences

3. Build Script Path Dependencies (Low)

Several binding crates have build scripts that may reference workspace-relative paths. While the current setup looks correct, runtime verification is recommended.

Security Considerations ✅

No security concerns identified:

  • No new dependencies introduced
  • No changes to sensitive code paths
  • Dependency versions remain consistent
  • All crates maintain publish = false as expected

Test Coverage Recommendations

  1. Verify CI pipeline: Ensure all binding tests still pass with the new workspace structure
  2. Performance benchmarking: Run full benchmark suite to confirm performance regressions are acceptable
  3. Build verification: Test that all target platforms build correctly with the consolidated workspace

Recommendations

High Priority

  1. Fix CI workflows: Update all references to the old bindings workspace structure in CI.yml
  2. Performance investigation: Analyze the root cause of the 8.56% performance regression

Medium Priority

  1. Verify build process: Ensure npm build scripts in packages still work correctly
  2. Test matrix validation: Confirm all binding test scripts function with the new structure

Low Priority

  1. Documentation update: Consider updating any workspace-related documentation
  2. Cleanup verification: Ensure no orphaned configuration files remain from the old structure

Overall Assessment

Rating: Approve with Required Changes

The workspace consolidation is architecturally sound and follows Rust best practices. However, the CI workflow issues must be addressed before merging to prevent build failures. The performance regression warrants investigation but shouldn't block the merge if the cause is understood and acceptable.

The change significantly simplifies the project structure and will make maintenance easier long-term.


@codspeed-hq
Copy link

codspeed-hq bot commented Nov 1, 2025

CodSpeed Performance Report

Merging #11213 will degrade performances by 8.56%

Comparing kdy1/merge-ws (edad7c1) with main (1430489)1

Summary

⚡ 6 improvements
❌ 19 regressions
✅ 113 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
css/lexer/bootstrap_5_1_3 10 ms 11 ms -8.27%
css/lexer/foundation_6_7_4 8.2 ms 9 ms -8.56%
css/lexer/tailwind_3_1_1 1.6 ms 1.8 ms -8.5%
es/codegen/colors 70.9 µs 68 µs +4.14%
es/codegen/with-parser/colors 154.7 µs 159.5 µs -3.04%
es/codegen/with-parser/large 1.1 ms 1.2 ms -2.99%
es/minifier/libs/d3 388.8 ms 397.7 ms -2.22%
es/minifier/libs/lodash 112.2 ms 115.1 ms -2.47%
es/preset-env/usage/property 116 µs 112.7 µs +3%
es2020_nullish_coalescing 310.2 µs 291.5 µs +6.42%
parse_and_babelify_angular 157.3 ms 161.6 ms -2.65%
parse_and_babelify_backbone 15.2 ms 15.6 ms -2.3%
parse_and_babelify_yui 66.2 ms 68.3 ms -3.09%
github 40.8 ms 42.3 ms -3.47%
stackoverflow 35.3 ms 36.3 ms -2.61%
css_spec 191.8 ms 196.1 ms -2.21%
github 40.2 ms 41.7 ms -3.4%
stackoverflow 35.5 ms 37.5 ms -5.18%
html/document/visitor/compare/fold_span 1.2 ms 1.2 ms -3.11%
html/document/visitor/compare/fold_span_panic 1.2 ms 1.2 ms -3.12%
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Footnotes

  1. No successful run was found on main (c19b6aa) during the generation of this report, so 1430489 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

Binary Sizes

File Size
swc.linux-x64-gnu.node 31M (31821320 bytes)

Commit: 70c6ad6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Flatten repository structure

2 participants