Skip to content

fix: module reasons when the module has layer#1418

Merged
yifancong merged 3 commits intomainfrom
fix/module-reasons
Nov 26, 2025
Merged

fix: module reasons when the module has layer#1418
yifancong merged 3 commits intomainfrom
fix/module-reasons

Conversation

@yifancong
Copy link
Contributor

@yifancong yifancong commented Nov 25, 2025

Summary

When there are two identical modules but different layers, it will lead to the problem that the module of a layer has no reasons.

Related Links

Copilot AI review requested due to automatic review settings November 25, 2025 12:01
@netlify
Copy link

netlify bot commented Nov 25, 2025

Deploy Preview for rsdoctor ready!

Name Link
🔨 Latest commit 0a71bb5
🔍 Latest deploy log https://app.netlify.com/projects/rsdoctor/deploys/6925a624afb13400086aa34f
😎 Deploy Preview https://deploy-preview-1418--rsdoctor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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 adds layer-aware module lookup functionality to fix issues with module reasons when modules have layers. The key change is adding an optional layer parameter to the getModuleByFile method to enable filtering modules by their layer property.

  • Added optional layer parameter to getModuleByFile method across the type definition, implementation, and usage
  • Updated dependency resolution in webpack transform to use layer information when looking up modules
  • Added comprehensive test coverage for layer-based module filtering scenarios

Reviewed changes

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

File Description
packages/types/src/sdk/module.ts Added optional layer parameter to getModuleByFile method signature
packages/graph/src/graph/module-graph/graph.ts Implemented layer filtering logic in getModuleByFile method
packages/core/src/build-utils/build/module-graph/webpack/transform.ts Updated appendDependency to pass layer when resolving module dependencies
packages/graph/tests/module-graph.test.ts Added comprehensive test coverage for layer-based module filtering including edge cases

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

yifancong and others added 2 commits November 25, 2025 20:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@yifancong yifancong requested a review from fi3ework November 25, 2025 13:10
@yifancong yifancong merged commit 24834f0 into main Nov 26, 2025
8 checks passed
@yifancong yifancong deleted the fix/module-reasons branch November 26, 2025 12:28
@yifancong yifancong mentioned this pull request Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants