fix: module reasons when the module has layer#1418
Merged
Conversation
✅ Deploy Preview for rsdoctor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
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
layerparameter togetModuleByFilemethod 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
fi3ework
approved these changes
Nov 25, 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
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