-
-
Notifications
You must be signed in to change notification settings - Fork 357
feat(enhanced): implement layer-aware module sharing with comprehensive test coverage (PR9) #3915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ScriptedAlchemy
wants to merge
13
commits into
main
Choose a base branch
from
pr9-implementation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
28f9c5f
chore: improve test output clarity and remove problematic test directory
ScriptedAlchemy aad6e9e
feat(enhanced): comprehensive ProvideSharedPlugin test coverage (#3969)
ScriptedAlchemy 4c6df8f
chore: remove generated code coverage files
ScriptedAlchemy e9372fb
chore: x
ScriptedAlchemy 58442a7
PR8: SharePlugin - Unified API (#3914)
ScriptedAlchemy a3f59d6
Apply suggested changes
ScriptedAlchemy cf24e4f
Apply suggested changes
ScriptedAlchemy 073e5f6
Apply suggested changes
ScriptedAlchemy b8bc356
chore: clean up changeset descriptions
ScriptedAlchemy cfb3e6c
Merge branch 'main' into pr9-implementation
ScriptedAlchemy 03e4d39
chore: tests
ScriptedAlchemy bc073dc
fix(enhanced): fix ModuleNotFoundError mock implementation in tests
ScriptedAlchemy 80a7180
fix(enhanced): correct ModuleNotFoundError mock formatting
ScriptedAlchemy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"@module-federation/enhanced": patch | ||
--- | ||
|
||
test: implement comprehensive test coverage for ConsumeSharedPlugin | ||
|
||
- Add 70+ comprehensive tests for createConsumeSharedModule method covering all critical business logic | ||
- Implement tests for import resolution logic including error handling and direct fallback regex matching | ||
- Add comprehensive requiredVersion resolution tests for package name extraction and version resolution | ||
- Implement include/exclude version filtering tests with fallback version support | ||
- Add singleton warning generation tests for version filters as specified | ||
- Implement package.json reading error scenarios and edge case handling | ||
- Add apply method tests for plugin registration logic and hook setup | ||
- Achieve test coverage parity with ProvideSharedPlugin (70+ tests each) | ||
|
||
This addresses the requirement for "immense test coverage for consume share plugin and provide share plugin to cover all its very complex logic" and ensures comprehensive testing of multi-stage module resolution, layer matching, version filtering, and error handling. | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"@module-federation/enhanced": patch | ||
--- | ||
|
||
test: add comprehensive test coverage for ProvideSharedPlugin | ||
|
||
- Add 73 comprehensive tests covering all critical business logic and edge cases | ||
- Implement complete shouldProvideSharedModule method coverage (15 tests) for version filtering with semver validation | ||
- Add provideSharedModule method tests (16 tests) covering version resolution, request pattern filtering, and warning generation | ||
- Implement module matching and resolution stage tests (20 tests) for multi-stage resolution logic | ||
- Validate business rules: warnings only for version filters with singleton, not request filters | ||
- Cover all critical private methods with proper TypeScript handling using @ts-ignore | ||
- Fix container utils mock for dependency factory operations | ||
- Add performance and memory usage tests for large-scale scenarios | ||
|
||
This ensures comprehensive test coverage for ProvideSharedPlugin's complex module sharing logic and prevents regressions. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
"@module-federation/enhanced": minor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make this a patch and update it based on the actual changes in the pr (if any) otherwise delete |
||
--- | ||
|
||
feat: implement enhanced layer support with issuerLayer fallback logic | ||
|
||
- Add issuerLayer parameter support throughout ConsumeSharedPlugin and related modules | ||
- Implement issuerLayer fallback pattern in module resolution (tries issuerLayer first, then falls back to undefined) | ||
- Add createLookupKeyForSharing utility to generate layer-aware lookup keys (e.g., "(client)react") | ||
- Support layer-specific module sharing configuration with proper precedence rules | ||
- Add comprehensive unit tests for issuerLayer fallback behavior and utility functions | ||
- Fix test infrastructure issues and improve test assertions for better CI stability | ||
|
||
This completes PR9: Enhanced Layer Support as defined in the incremental PR plan, enabling more granular control over shared module resolution based on issuer layers. |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line