fix: context dependencies hash calculation use cache.snapshot configuration#12937
fix: context dependencies hash calculation use cache.snapshot configuration#12937jerrykingxyz merged 3 commits intomainfrom
Conversation
Rsdoctor Bundle Diff Analysis
Found 5 projects in monorepo, 5 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 romePath:
📦 Download Diff Report: rome Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff Generated by Rsdoctor GitHub Action |
There was a problem hiding this comment.
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
SnapshotOptionsintoStrategyHelper/HashHelperand share aPackageHelperviaArc. - Update
dir_hashto skip immutable children and usePackageHelper::package_versionfor managed children. - Adjust strategy generation behavior for missing file hashes (
Failed→Missing) 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.
crates/rspack_core/src/cache/persistent/snapshot/strategy/hash_helper.rs
Show resolved
Hide resolved
crates/rspack_core/src/cache/persistent/snapshot/strategy/hash_helper.rs
Show resolved
Hide resolved
📦 Binary Size-limit
❌ Size increased by 1.00KB from 48.34MB to 48.34MB (⬆️0.00%) |
Merging this PR will not alter performance
Comparing Footnotes
|
…ration (#12937) * fix: snapshot watch symlink * fix: context dependencies use snapshot options * test: update test case
Summary
Rspack calculates the directory hash of context dependencies.
package.jsonfile should be used.Related links
Checklist