refactor: remove support for nested importModule usage#12111
Merged
jerrykingxyz merged 1 commit intomainfrom Nov 7, 2025
Merged
refactor: remove support for nested importModule usage#12111jerrykingxyz merged 1 commit intomainfrom
jerrykingxyz merged 1 commit intomainfrom
Conversation
✅ Deploy Preview for rspack canceled.
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the module execution flow in the compilation process by introducing a deferred startup mechanism and extracting module graph repair logic.
- Changed
hook_before_maketo return a closure that spawns the task loop, allowing better control over when execution starts - Extracted
calc_repair_tasksfrom therepairfunction to enable reuse of task calculation logic - Added
from_module_graphmethod toModuleTrackerto reconstruct tracker state from existing module graph
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/compiler/compilation.rs | Modified to call the returned closure from hook_before_make after restoring module_executor |
| crates/rspack_core/src/compilation/make/module_executor/module_tracker.rs | Added from_module_graph method to create tracker from existing module graph state; simplified entry module handling |
| crates/rspack_core/src/compilation/make/module_executor/mod.rs | Refactored hook_before_make to return a closure that starts the task loop; integrated cutout and repair logic |
| crates/rspack_core/src/compilation/make/graph_updater/repair/mod.rs | Extracted calc_repair_tasks function from repair to enable task calculation reuse |
| crates/rspack_core/src/compilation/make/graph_updater/mod.rs | Made cutout module public |
| crates/rspack_core/src/compilation/make/graph_updater/cutout/mod.rs | Added add_need_check_issuer_module helper method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
📦 Binary Size-limit
❌ Size increased by 256bytes from 47.89MB to 47.90MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #12111 will not alter performanceComparing Summary
|
955dc9d to
6772032
Compare
6772032 to
edd00f4
Compare
LingyuCoder
approved these changes
Nov 7, 2025
jerrykingxyz
added a commit
that referenced
this pull request
Nov 12, 2025
This reverts commit a2ba295.
hardfist
pushed a commit
that referenced
this pull request
Nov 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Nested use of
importModulecan easily lead to unexpected situations, such as circular calls. In most cases, nested use is also not the behavior expected by users. This PR will throw an error directly when nested calls are made.Related links
Checklist