Skip to content

refactor: split make phase#12186

Merged
hardfist merged 3 commits intomainfrom
yj/split-make
Nov 13, 2025
Merged

refactor: split make phase#12186
hardfist merged 3 commits intomainfrom
yj/split-make

Conversation

@hardfist
Copy link
Copy Markdown
Contributor

@hardfist hardfist commented Nov 13, 2025

Summary

split make phase into build_module_graph and collect_build_module_graph_effects phase which makes artifacts no overlap and has more accurate meaning

  • build_module_graph: build module graph
  • collect_build_module_graph_effects: collect diagnostics & mutations

Followup:

  • change collect_build_module_graph_effects to access &Compilation

Related links

Checklist

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

@netlify
Copy link
Copy Markdown

netlify bot commented Nov 13, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit d00b92a
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6915a77d7f1e1b0007836562

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: refactor labels Nov 13, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 13, 2025

📦 Binary Size-limit

Comparing d00b92a to chore: bump rust toolchain (#12183) by Fy

❌ Size increased by 2.50KB from 47.45MB to 47.45MB (⬆️0.01%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 13, 2025

CodSpeed Performance Report

Merging #12186 will not alter performance

Comparing yj/split-make (d00b92a) with main (b4c08a1)

Summary

✅ 17 untouched

@hardfist hardfist marked this pull request as ready for review November 13, 2025 09:31
Copilot AI review requested due to automatic review settings November 13, 2025 09:31
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

This PR refactors the compilation process by splitting the "make" phase into two distinct phases: build_module_graph (which builds the module graph) and collect_build_module_graph_effects (which collects diagnostics and mutations). This separation provides clearer semantics and prevents artifact overlap.

Key changes:

  • Renamed make() to build_module_graph() and finish() to finish_build_module_graph()
  • Introduced new collect_build_module_graph_effects() phase for collecting diagnostics and mutations
  • Renamed MakeArtifact to BuildModuleGraphArtifact throughout the codebase

Reviewed Changes

Copilot reviewed 25 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/rspack_core/src/compiler/mod.rs Splits compile flow into build_module_graph() and adds collect_build_module_graph_effects() call
crates/rspack_core/src/compiler/rebuild.rs Updates references to renamed artifact swap method
crates/rspack_core/src/compilation/mod.rs Renames methods and artifact type, splits finish logic into two phases
crates/rspack_core/src/compilation/build_module_graph/* Module renamed from make with all internal types and functions updated
crates/rspack_core/src/cache/* Updates cache trait methods to use new artifact type and naming
crates/rspack_plugin_library/src/modern_module_library_plugin.rs Updates artifact field reference
crates/rspack_core/src/stats/mod.rs Updates import path and artifact field reference
crates/rspack_core/src/lib.rs Updates public exports from renamed module
crates/rspack_binding_api/src/compilation/mod.rs Updates artifact field reference in JS bindings
xtask/benchmark/benches/groups/build_chunk_graph.rs Updates benchmark to use new method names
Comments suppressed due to low confidence (7)

crates/rspack_core/src/compilation/build_module_graph/module_executor/mod.rs:37

  • The field name make_artifact is inconsistent with the type BuildModuleGraphArtifact. Consider renaming the field to build_module_graph_artifact for consistency and clarity throughout the struct.
    crates/rspack_core/src/compilation/build_module_graph/mod.rs:59
  • The comment still refers to "make stage" but should be updated to "build_module_graph stage" or "build module graph stage" to match the new naming convention.
    crates/rspack_core/src/compilation/build_module_graph/mod.rs:21
  • The comment still refers to "make phase" but should be updated to "build_module_graph phase" or "build module graph phase" to match the new naming convention.
    crates/rspack_core/src/compilation/build_module_graph/artifact.rs:26
  • The comment refers to "Make Artifact" in the description but should be updated to "Build Module Graph Artifact" for consistency with the renamed type.
    crates/rspack_core/src/compilation/build_module_graph/artifact.rs:17
  • The comment still refers to "Make stage" but should be updated to "BuildModuleGraph stage" or "build module graph stage" to match the new naming convention.
    crates/rspack_core/src/compilation/build_module_graph/mod.rs:61
  • The comment references "make and finish_make" which should be updated to "build_module_graph and finish_build_module_graph" to match the new naming convention.
    crates/rspack_core/src/compilation/build_module_graph/graph_updater/cutout/mod.rs:159
  • The comment reference to "MakeArtifact" should be updated to "BuildModuleGraphArtifact" for consistency.

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@hardfist hardfist merged commit 33f4af2 into main Nov 13, 2025
44 checks passed
@hardfist hardfist deleted the yj/split-make branch November 13, 2025 10:00
Ok(())
}

#[instrument("Compiler:compile", target=TRACING_BENCH_TARGET,skip_all)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add the instrument back?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: refactor 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