Skip to content

Conversation

@jerrykingxyz
Copy link
Contributor

@jerrykingxyz jerrykingxyz commented Dec 8, 2025

Summary

The lazy barrel might add some connections without building the parent module. This PR will update the parent module of any additional dependencies to ensure the persistence cache remains intact.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings December 8, 2025 06:34
@netlify
Copy link

netlify bot commented Dec 8, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 2aab180
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69367182ecdd7b0008f950de

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Dec 8, 2025
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 fixes a bug in persistent cache saving for lazy barrel optimization by ensuring all affected modules are properly tracked. The issue was that newly added dependencies were not being synced to cache because only "updated" dependencies (those added, removed, then re-added) were being considered.

Key Changes:

  • Changed cache save logic from affected_dependencies.updated() to affected_dependencies.active() to capture both newly added and updated dependencies
  • Expanded test coverage to include a third compiler run to validate cache persistence across multiple builds
  • Added clarifying comments about dependency tracking in both process_dependencies and factorize tasks

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/rspack_core/src/cache/persistent/occasion/make/mod.rs Fixed cache save to use active() instead of updated() to capture all affected dependencies
crates/rspack_core/src/compilation/build_module_graph/graph_updater/repair/process_dependencies.rs Added comment explaining why all dependencies are marked here
crates/rspack_core/src/compilation/build_module_graph/graph_updater/repair/factorize.rs Added comment explaining why dependencies from multiple sources are marked
tests/rspack-test/cacheCases/make/lazy-barrel/test.js Added two more test transitions (lines 8-11) to test cache persistence
tests/rspack-test/cacheCases/make/lazy-barrel/index.js Added third compiler run (COMPILER_INDEX == 2) to validate cache across multiple builds
tests/rspack-test/cacheCases/make/lazy-barrel/lib/index.js Simplified diff display (no functional change to the exported values)

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Rsdoctor Bundle Diff Analysis

Found 5 project(s) in monorepo.

📁 react-10k

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

📌 Baseline Commit: 730b2bd30d | PR: #12381

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

📦 Download Diff Report: react-10k Bundle Diff

📁 react-1k

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

📌 Baseline Commit: 730b2bd30d | PR: #12381

Metric Current Baseline Change
📊 Total Size 823.6 KB 823.6 KB 0 B (0.0%)
📄 JavaScript 823.6 KB 823.6 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-1k Bundle Diff

📁 react-5k

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

📌 Baseline Commit: 730b2bd30d | PR: #12381

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

📦 Download Diff Report: react-5k Bundle Diff

📁 rome

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

📌 Baseline Commit: 730b2bd30d | PR: #12381

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

📦 Download Diff Report: rome Bundle Diff

📁 ui-components

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

📌 Baseline Commit: 730b2bd30d | PR: #12381

Metric Current Baseline Change
📊 Total Size 2.1 MB 2.1 MB 0 B (0.0%)
📄 JavaScript 2.0 MB 2.0 MB 0 B (0.0%)
🎨 CSS 83.0 KB 83.0 KB 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: ui-components Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

📦 Binary Size-limit

Comparing 2aab180 to refactor: optimize runtime multiple line string literal (#12381) by harpsealjs

❌ Size increased by 384bytes from 47.69MB to 47.69MB (⬆️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 8, 2025

CodSpeed Performance Report

Merging #12384 will not alter performance

Comparing jerry/pc (2aab180) with main (730b2bd)

Summary

✅ 17 untouched

@jerrykingxyz jerrykingxyz enabled auto-merge (squash) December 8, 2025 07:59
@jerrykingxyz jerrykingxyz merged commit 63d2389 into main Dec 8, 2025
111 of 116 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/pc branch December 8, 2025 08:05
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.

[Bug]: buildCache conflicts with lazyBarrel causing ESModulesLinkingError on secondary dev server start

3 participants