Skip to content

Commit 6fa3596

Browse files
Merge branch 'main' into share-filter
Includes comprehensive shared filtering improvements: - Enhanced include/exclude filtering for ProvideSharedPlugin and ConsumeSharedPlugin - Added request pattern matching support for fine-grained control - Improved test coverage with focused test suites - Fixed Node.js runtime recursion issues - Updated dependencies and build configurations across monorepo 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
2 parents 9ffc145 + 898da58 commit 6fa3596

File tree

360 files changed

+444950
-8447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

360 files changed

+444950
-8447
lines changed

.changeset/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"@module-federation/enhanced": patch
3+
---
4+
5+
test: implement comprehensive test coverage for ConsumeSharedPlugin
6+
7+
- Add 70+ comprehensive tests for createConsumeSharedModule method covering all critical business logic
8+
- Implement tests for import resolution logic including error handling and direct fallback regex matching
9+
- Add comprehensive requiredVersion resolution tests for package name extraction and version resolution
10+
- Implement include/exclude version filtering tests with fallback version support
11+
- Add singleton warning generation tests for version filters as specified
12+
- Implement package.json reading error scenarios and edge case handling
13+
- Add apply method tests for plugin registration logic and hook setup
14+
- Achieve test coverage parity with ProvideSharedPlugin (70+ tests each)
15+
16+
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.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"@module-federation/enhanced": patch
3+
---
4+
5+
test: add comprehensive test coverage for ProvideSharedPlugin
6+
7+
- Add 73 comprehensive tests covering all critical business logic and edge cases
8+
- Implement complete shouldProvideSharedModule method coverage (15 tests) for version filtering with semver validation
9+
- Add provideSharedModule method tests (16 tests) covering version resolution, request pattern filtering, and warning generation
10+
- Implement module matching and resolution stage tests (20 tests) for multi-stage resolution logic
11+
- Validate business rules: warnings only for version filters with singleton, not request filters
12+
- Cover all critical private methods with proper TypeScript handling using @ts-ignore
13+
- Fix container utils mock for dependency factory operations
14+
- Add performance and memory usage tests for large-scale scenarios
15+
16+
This ensures comprehensive test coverage for ProvideSharedPlugin's complex module sharing logic and prevents regressions.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@module-federation/enhanced": patch
3+
---
4+
5+
test: add comprehensive test coverage for request pattern filtering
6+
7+
- Add integration tests for request pattern filtering in provide-filters test case
8+
- Add test cases verifying modules match/don't match request include filters
9+
- Add unit tests for `extractPathAfterNodeModules` utility function
10+
- Add unit tests for `createLookupKeyForSharing` utility function
11+
- Add test files for request filtering scenarios (components/Button.js, utils/helper.js, etc.)
12+
13+
This enhances test coverage to ensure request pattern filtering functionality works correctly and prevents regressions.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@module-federation/node": patch
3+
"@module-federation/sdk": patch
4+
---
5+
6+
fix(node): prevent infinite recursion in module imports
7+
8+
- Add import cache to prevent infinite recursion when modules have circular dependencies
9+
- Cache import promises to ensure each module is only imported once
10+
- Clear cache on import errors to allow retry attempts
11+
- Add comprehensive test coverage for recursion scenarios
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@module-federation/rsbuild-plugin": patch
3+
---
4+
5+
fix(rsbuild-plugin): add build dependencies configuration to project.json
6+
7+
- Add dependsOn configuration to ensure dependencies are built before the plugin
8+
- Improves build reliability and fixes potential issues when dependencies haven't been built

.changeset/hook-renaming-cleanup.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@module-federation/enhanced": minor
3+
---
4+
5+
feat: implement enhanced layer support with issuerLayer fallback logic
6+
7+
- Add issuerLayer parameter support throughout ConsumeSharedPlugin and related modules
8+
- Implement issuerLayer fallback pattern in module resolution (tries issuerLayer first, then falls back to undefined)
9+
- Add createLookupKeyForSharing utility to generate layer-aware lookup keys (e.g., "(client)react")
10+
- Support layer-specific module sharing configuration with proper precedence rules
11+
- Add comprehensive unit tests for issuerLayer fallback behavior and utility functions
12+
- Fix test infrastructure issues and improve test assertions for better CI stability
13+
14+
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.

.changeset/runtime-safety-checks.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.changeset/shiny-gorillas-tap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/rsbuild-plugin': patch
3+
---
4+
5+
fix(rsbuild-plugin): use detail source.include instead of range regexp

0 commit comments

Comments
 (0)