Skip to content

Conversation

@jerrykingxyz
Copy link
Contributor

@jerrykingxyz jerrykingxyz commented Dec 18, 2025

Summary

Create a new crate rspack_tools and add compare command to compare .cache directory generated by different os.

Relevant RFC: #12218

Related links

Checklist

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

Copilot AI review requested due to automatic review settings December 18, 2025 08:27
@netlify
Copy link

netlify bot commented Dec 18, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 470d5dd
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69492359b2ddc50008dd2ab3

@github-actions github-actions bot added release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack. labels Dec 18, 2025
@jerrykingxyz jerrykingxyz marked this pull request as draft December 18, 2025 08:27
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 introduces the rspack_kit crate, a comprehensive toolkit for debugging and testing rspack internals, with initial focus on comparing cache directories across different operating systems to validate portable cache functionality. The implementation adds a CLI tool and library for deep comparison of cache structures, module graphs, dependencies, and metadata.

  • Adds new rspack_kit crate with CLI and library interfaces for cache comparison
  • Implements scopes() method in Storage trait to enumerate all available cache scopes
  • Modifies CI workflows to generate and compare caches between Linux and Windows builds

Reviewed changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
crates/rspack_kit/src/main.rs CLI entry point with clap-based command parsing for compare command
crates/rspack_kit/src/lib.rs Library exports for public API
crates/rspack_kit/src/compare/mod.rs Core comparison logic for storage directories and scopes
crates/rspack_kit/src/compare/snapshot.rs Snapshot scope comparison implementation
crates/rspack_kit/src/compare/build_dependencies.rs Build dependencies scope comparison implementation
crates/rspack_kit/src/compare/occasion/meta.rs Meta occasion scope comparison implementation
crates/rspack_kit/src/compare/occasion/make.rs Make occasion scope comparison with DependencyId mapping
crates/rspack_kit/src/compare/occasion/mod.rs Occasion module exports
crates/rspack_kit/src/utils.rs Utility functions for iterator comparison
crates/rspack_kit/src/debug_info.rs Hierarchical debug context tracking
crates/rspack_kit/README.md Comprehensive documentation with usage examples
crates/rspack_kit/Cargo.toml Package configuration and dependencies
crates/rspack_kit/LICENSE MIT license for the new crate
crates/rspack_storage/src/lib.rs Adds scopes() method to Storage trait
crates/rspack_storage/src/pack/mod.rs Implements scopes() for PackStorage
crates/rspack_storage/src/pack/manager/mod.rs Implements scopes() in ScopeManager with tests
crates/rspack_core/src/cache/persistent/storage/memory.rs Implements scopes() for MemoryStorage
crates/rspack_core/src/cache/persistent/snapshot/strategy/mod.rs Custom PartialEq for Strategy to support cross-platform comparison
crates/rspack_core/src/cache/persistent/snapshot/mod.rs Exports Strategy and SCOPE constant publicly
crates/rspack_core/src/cache/persistent/occasion/mod.rs Makes make and meta modules public
crates/rspack_core/src/cache/persistent/occasion/meta/mod.rs Exports SCOPE constant publicly
crates/rspack_core/src/cache/persistent/occasion/make/mod.rs Exports SCOPE constant publicly
crates/rspack_core/src/cache/persistent/occasion/make/module_graph.rs Exports SCOPE constant publicly
crates/rspack_core/src/cache/persistent/mod.rs Exports public modules and simplifies CacheableContext
crates/rspack_core/src/cache/persistent/cacheable_context.rs Simplifies CacheableContext to empty struct
crates/rspack_core/src/cache/persistent/build_dependencies/mod.rs Exports SCOPE constant publicly
.github/workflows/reusable-build-test.yml Adds cache generation and upload steps for Node 20
.github/workflows/ci.yml Adds check-cache job to compare Linux and Windows caches
Cargo.lock Adds rspack_kit package entry

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (1f0a6a93e5) does not have baseline artifacts. Using commit 744de43689 for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

Found 5 projects in monorepo, 1 project with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 823.4 KB 0
rome 984.3 KB -28.0 B (-0.0%)
react-5k 2.7 MB 0
ui-components 2.1 MB 0
📋 Detailed Reports (Click to expand)

📁 rome

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

📌 Baseline Commit: 744de43689 | PR: #12424

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

📦 Download Diff Report: rome Bundle Diff

Generated by Rsdoctor GitHub Action

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 18, 2025

CodSpeed Performance Report

Merging #12499 will not alter performance

Comparing jerry/compare (470d5dd) with main (744de43)

Summary

✅ 16 untouched
⏩ 1 skipped1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

📦 Binary Size-limit

Comparing 470d5dd to chore: remove logic of parallelCodeSplitting (#12424) by Fy

❌ Size increased by 3.63KB from 47.87MB to 47.87MB (⬆️0.01%)

@jerrykingxyz jerrykingxyz force-pushed the jerry/compare branch 9 times, most recently from efc08b8 to e14dcb3 Compare December 19, 2025 04:36
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

Copilot reviewed 29 out of 30 changed files in this pull request and generated 5 comments.


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

@jerrykingxyz jerrykingxyz marked this pull request as ready for review December 22, 2025 09:00
LingyuCoder
LingyuCoder previously approved these changes Dec 22, 2025
@stormslowly
Copy link
Contributor

workflow parts, LGTM

@jerrykingxyz jerrykingxyz changed the title feat: add rspack_kit to compare .cache from different os feat: add rspack_tools to compare .cache from different os Dec 23, 2025
@jerrykingxyz jerrykingxyz merged commit 4891406 into main Dec 23, 2025
55 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/compare branch December 23, 2025 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants