Skip to content

fix: context dependencies hash calculation use cache.snapshot configuration#12937

Merged
jerrykingxyz merged 3 commits intomainfrom
jerry/context
Feb 5, 2026
Merged

fix: context dependencies hash calculation use cache.snapshot configuration#12937
jerrykingxyz merged 3 commits intomainfrom
jerry/context

Conversation

@jerrykingxyz
Copy link
Copy Markdown
Contributor

@jerrykingxyz jerrykingxyz commented Feb 4, 2026

Summary

Rspack calculates the directory hash of context dependencies.

  • When calculating immutable paths, this step should be skipped.
  • When calculating managed paths, the package.json file should be used.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings February 4, 2026 07:28
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Feb 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

Rsdoctor Bundle Diff Analysis

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

Found 5 projects in monorepo, 5 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB -8.0 B (-0.0%)
react-1k 825.4 KB -4.0 B (-0.0%)
react-5k 2.7 MB -6.0 B (-0.0%)
rome 984.2 KB +10.0 B (0.0%)
ui-components 2.2 MB +75.0 B (0.0%)
📋 Detailed Reports (Click to expand)

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

📌 Baseline Commit: 0f5a0bd118 | PR: #12934

Metric Current Baseline Change
📊 Total Size 5.7 MB 5.7 MB -8.0 B (-0.0%)
📄 JavaScript 5.7 MB 5.7 MB -8.0 B (-0.0%)
🎨 CSS 21.0 B 21.0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-10k Bundle Diff

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

📌 Baseline Commit: 0f5a0bd118 | PR: #12934

Metric Current Baseline Change
📊 Total Size 825.4 KB 825.4 KB -4.0 B (-0.0%)
📄 JavaScript 825.4 KB 825.4 KB -4.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: react-1k Bundle Diff

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

📌 Baseline Commit: 0f5a0bd118 | PR: #12934

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB -6.0 B (-0.0%)
📄 JavaScript 2.7 MB 2.7 MB -6.0 B (-0.0%)
🎨 CSS 21.0 B 21.0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-5k Bundle Diff

📁 rome

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

📌 Baseline Commit: 0f5a0bd118 | PR: #12934

Metric Current Baseline Change
📊 Total Size 984.2 KB 984.2 KB +10.0 B (0.0%)
📄 JavaScript 984.2 KB 984.2 KB +10.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

📁 ui-components

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

📌 Baseline Commit: 0f5a0bd118 | PR: #12934

Metric Current Baseline Change
📊 Total Size 2.2 MB 2.2 MB +75.0 B (0.0%)
📄 JavaScript 2.0 MB 2.0 MB +75.0 B (0.0%)
🎨 CSS 267.8 KB 267.8 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: ui-components Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label Feb 4, 2026
Copy link
Copy Markdown
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

Updates snapshot directory-hash calculation to respect cache.snapshot configuration (skip immutable paths; treat managed paths via package.json version) and threads SnapshotOptions through the snapshot hashing helpers.

Changes:

  • Pass SnapshotOptions into StrategyHelper/HashHelper and share a PackageHelper via Arc.
  • Update dir_hash to skip immutable children and use PackageHelper::package_version for managed children.
  • Adjust strategy generation behavior for missing file hashes (FailedMissing) and expand hashing logic around symlinks/tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
crates/rspack_core/src/cache/persistent/snapshot/strategy/package_helper.rs Minor struct comment cleanup; no functional change.
crates/rspack_core/src/cache/persistent/snapshot/strategy/mod.rs Plumbs SnapshotOptions into StrategyHelper and shares PackageHelper with HashHelper; updates tests and missing-strategy mapping.
crates/rspack_core/src/cache/persistent/snapshot/strategy/hash_helper.rs Implements immutable/managed path handling in directory hashing; changes file hashing semantics and expands tests.
crates/rspack_core/src/cache/persistent/snapshot/mod.rs Uses the new StrategyHelper::new(fs, options) signature when adding/calculating snapshots.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

📦 Binary Size-limit

Comparing 3d0597f to chore(test): unref makes the server garbage unstable (#12936) by pshu

❌ Size increased by 1.00KB from 48.34MB to 48.34MB (⬆️0.00%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 4, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing jerry/context (3d0597f) with main (d70cdfc)

Open in CodSpeed

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.

@jerrykingxyz jerrykingxyz merged commit ca0b6a5 into main Feb 5, 2026
108 of 112 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/context branch February 5, 2026 04:53
jerrykingxyz added a commit that referenced this pull request Feb 5, 2026
…ration (#12937)

* fix: snapshot watch symlink

* fix: context dependencies use snapshot options

* test: update test case
jerrykingxyz added a commit that referenced this pull request Feb 5, 2026
…ration (#12947)

fix: context dependencies hash calculation use cache.snapshot configuration (#12937)

* fix: snapshot watch symlink

* fix: context dependencies use snapshot options

* test: update test case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug 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.

3 participants