Skip to content

Conversation

@SyMind
Copy link
Member

@SyMind SyMind commented Oct 15, 2025

Summary

Cache DependencyId in DynamicEntryPlugin instead of EntryDependency instances to preserve build information across compilations.

Caching instances loses FactorizeInfo and other metadata, preventing proper removal of entry dependency subtrees.

Related links

Checklist

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

@netlify
Copy link

netlify bot commented Oct 15, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 9b0fa1a
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68f0a1a69397f800087df554

@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 Oct 15, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

📦 Binary Size-limit

Comparing 9b0fa1a to chore: Using env to enable sftrace (#11880) by quininer

❌ Size increased by 4.38KB from 47.66MB to 47.67MB (⬆️0.01%)

@SyMind SyMind force-pushed the fix-removed-dependency branch 2 times, most recently from 0e7f548 to 3a18076 Compare October 15, 2025 14:59
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 15, 2025

CodSpeed Performance Report

Merging #11888 will not alter performance

Comparing fix-removed-dependency (9b0fa1a) with main (7c2c4ba)

Summary

✅ 17 untouched

@SyMind SyMind force-pushed the fix-removed-dependency branch from 3a18076 to 2478a2c Compare October 16, 2025 05:40
@SyMind SyMind changed the title fix: should not remove entry dependency in dynamic entry fix: should not dependency instance in DynamicEntryPlugin Oct 16, 2025
@SyMind SyMind changed the title fix: should not dependency instance in DynamicEntryPlugin fix: should not cache dependency instance in DynamicEntryPlugin Oct 16, 2025
@SyMind SyMind marked this pull request as ready for review October 16, 2025 07:48
Copilot AI review requested due to automatic review settings October 16, 2025 07:48
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

Fix caching in DynamicEntryPlugin to store DependencyId instead of EntryDependency instances, preserving FactorizeInfo and enabling correct cleanup of dynamic entry subtrees across compilations.

  • Cache DependencyId per entry/options and rebuild the mapping each compilation
  • Update make() to resolve dependencies by id from the ModuleGraph
  • Add a watch test case ensuring entry subtree is removed when a dynamic 404 entry disappears

Reviewed Changes

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

Show a summary per file
File Description
crates/rspack_plugin_dynamic_entry/src/lib.rs Switch to caching DependencyId behind an async mutex and adjust make() logic to reuse or recreate entry dependencies by id
tests/rspack-test/watchCases/entries/loader-as-dynamic-entry/rspack.config.js Dynamic entry config and plugin to mark missing files for watch, exercising cleanup behavior
tests/rspack-test/watchCases/entries/loader-as-dynamic-entry/test.config.js Test harness config for this watch case
tests/rspack-test/watchCases/entries/loader-as-dynamic-entry/0/404-page-loader.js Loader producing a require of 404.js to form the subtree
tests/rspack-test/watchCases/entries/loader-as-dynamic-entry/2/404.js Fixture to simulate removal of the 404 entry

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SyMind SyMind merged commit c1ffd5c into main Oct 16, 2025
72 of 74 checks passed
@SyMind SyMind deleted the fix-removed-dependency branch October 16, 2025 08:16
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