Skip to content

Commit b307974

Browse files
Merge pr5-request-pattern-filtering into pr7-enhanced-filtering
Successfully resolved merge conflicts by combining: - PR5's cleaner implementation with shouldProvideSharedModule() helper - PR5's improved error handling and warning generation - PR7's nodeModulesReconstructedLookup feature for advanced path reconstruction - PR7's two-stage matching logic (original request + reconstructed path) - PR7's enhanced parent package.json version detection - PR7's advanced prefix filtering with _originalPrefix tracking All functionality from both branches has been preserved while improving code organization and maintainability. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
2 parents 5ac18a4 + 696aae5 commit b307974

File tree

343 files changed

+11889
-7822
lines changed

Some content is hidden

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

343 files changed

+11889
-7822
lines changed

.changeset/enhanced-hoist-container-refs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"@module-federation/enhanced": patch
33
---
44

5-
feat: enhance HoistContainerReferencesPlugin for better module hoisting
5+
enhance HoistContainerReferencesPlugin for better module hoisting
66

77
- Separate handling for container, federation, and remote dependencies
88
- Improved support for `runtimeChunk: 'single'` configuration
99
- Proper remote module hoisting using the new `addRemoteDependency` hook
1010
- Simplified cleanup logic for better performance
1111
- Changed runtime chunk detection to include all chunks with runtime (not just entry chunks)
12-
- Added comprehensive unit tests for the plugin functionality
12+
- Added comprehensive unit tests for the plugin functionality
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@module-federation/manifest": patch
3+
"@module-federation/managers": patch
4+
"@module-federation/enhanced": patch
5+
---
6+
7+
fix: BuildVersion now correctly reads from project's package.json
8+
9+
- Fixed getBuildVersion() to accept optional root parameter for correct directory resolution
10+
- Updated StatsManager to use compiler.context when determining build version
11+
- Ensures buildVersion in mf-manifest.json matches the project's package.json version
12+
- Resolves issue #3835 where buildVersion was reading from wrong package.json location
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@module-federation/rsbuild-plugin': patch
3+
---
4+
5+
fix: add missing vitest imports to rsbuild-plugin test file
6+
7+
Fixes CI test failure by adding missing `describe`, `expect`, and `it` imports from vitest to the test file. This resolves the "ReferenceError: describe is not defined" error that was causing the rsbuild-plugin tests to fail.

.changeset/nx-upgrade-21-2-3.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
"@module-federation/runtime": patch
3+
"@module-federation/enhanced": patch
4+
"@module-federation/rspack": patch
5+
"@module-federation/webpack-bundler-runtime": patch
6+
"@module-federation/sdk": patch
7+
"@module-federation/runtime-tools": patch
8+
"@module-federation/managers": patch
9+
"@module-federation/manifest": patch
10+
"@module-federation/dts-plugin": patch
11+
"@module-federation/third-party-dts-extractor": patch
12+
"@module-federation/devtools": patch
13+
"@module-federation/bridge-react": patch
14+
"@module-federation/bridge-vue3": patch
15+
"@module-federation/bridge-shared": patch
16+
"@module-federation/bridge-react-webpack-plugin": patch
17+
"@module-federation/modern-js": patch
18+
"@module-federation/retry-plugin": patch
19+
"@module-federation/data-prefetch": patch
20+
"@module-federation/rsbuild-plugin": patch
21+
"@module-federation/error-codes": patch
22+
"@module-federation/inject-external-runtime-core-plugin": patch
23+
"@module-federation/runtime-core": patch
24+
"create-module-federation": patch
25+
"@module-federation/cli": patch
26+
"@module-federation/rspress-plugin": patch
27+
---
28+
29+
chore: upgrade NX to 21.2.3, Storybook to 9.0.9, and TypeScript to 5.8.3
30+
31+
- Upgraded NX from 21.0.3 to 21.2.3 with workspace configuration updates
32+
- Migrated Storybook from 8.3.5 to 9.0.9 with updated configurations and automigrations
33+
- Upgraded TypeScript from 5.7.3 to 5.8.3 with compatibility fixes
34+
- Fixed package exports and type declaration paths across all packages
35+
- Resolved module resolution issues and TypeScript compatibility problems
36+
- Updated build configurations and dependencies to support latest versions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"@module-federation/bridge-shared": patch
3+
"@module-federation/bridge-react": patch
4+
"@module-federation/nextjs-mf": patch
5+
"@module-federation/modern-js": patch
6+
"@module-federation/vue3-bridge": patch
7+
"@module-federation/third-party-dts-extractor": patch
8+
"@module-federation/rsbuild-plugin": patch
9+
---
10+
11+
refactor: sink React packages from root to individual packages
12+
13+
- Removed React dependencies from root package.json and moved them to packages that actually need them
14+
- Fixed rsbuild-plugin configuration to match workspace patterns
15+
- Updated tests to handle platform-specific files
16+
- This change improves dependency management by ensuring packages only have the dependencies they actually use
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
"@module-federation/enhanced": minor
3+
---
4+
5+
feat(enhanced): add request pattern filtering support for shared modules
6+
7+
- Add request filtering to ConsumeSharedPlugin for direct matches and resolved consumes
8+
- Add request filtering to ProvideSharedPlugin for direct matches
9+
- Support include/exclude.request filtering with string and RegExp patterns
10+
- Add comprehensive unit tests for request filtering functionality
11+
- Add integration tests for provide-filters with request pattern scenarios
12+
13+
This enables filtering shared modules based on request patterns:
14+
```javascript
15+
shared: {
16+
"./request-filter/": {
17+
include: { request: /components/ }
18+
}
19+
}
20+
```

.changeset/runtime-safety-checks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
fix(enhanced): add runtime safety checks to prevent errors
66

7-
- Add typeof check for oldStartup function in EmbedFederationRuntimeModule to prevent calling undefined function
7+
- Add typeof check for prevStartup function in EmbedFederationRuntimeModule to prevent calling undefined function
88
- Add typeof check for __webpack_require__.x in StartupHelpers to prevent calling undefined function
99
- Add warning logs when these functions are missing to help developers debug issues

.changeset/tidy-foxes-fix.md

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

.github/workflows/build-and-test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,8 @@ jobs:
5555
- name: Print Number of CPU Cores
5656
run: nproc
5757

58-
- name: Warm Nx Cache
59-
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4
60-
6158
- name: Run Build for All
62-
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4 --skip-nx-cache
59+
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4
6360

6461
- name: Check Package Publishing Compatibility
6562
run: |
@@ -69,12 +66,16 @@ jobs:
6966
[ "$pkg" != "packages/chrome-devtools" ] && \
7067
[ "$pkg" != "packages/core" ] && \
7168
[ "$pkg" != "packages/esbuild" ] && \
69+
[ "$pkg" != "packages/modernjs" ] && \
7270
[ "$pkg" != "packages/utilities" ]; then
7371
echo "Checking $pkg..."
7472
npx publint "$pkg"
7573
fi
7674
done
7775
76+
- name: Warm Nx Cache
77+
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4
78+
7879
- name: Run Affected Test
7980
uses: nick-fields/retry@v3
8081
with:

.github/workflows/devtools.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,29 @@ jobs:
3131
node-version: '18'
3232
cache: 'pnpm'
3333

34+
- name: Cache Browsers
35+
uses: actions/cache@v3
36+
id: browsers-cache
37+
with:
38+
path: |
39+
~/.cache/ms-playwright
40+
~/.cache/Cypress
41+
key: ${{ runner.os }}-browsers-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
43+
- name: Set Playwright cache status
44+
run: echo "PLAYWRIGHT_CACHE_HIT=${{ steps.browsers-cache.outputs.cache-hit }}" >> $GITHUB_ENV
45+
3446
- name: Set Nx SHA
3547
uses: nrwl/nx-set-shas@v3
3648

3749
- name: Install Dependencies
3850
run: pnpm install
3951

52+
- name: Install Cypress
53+
run: npx cypress install
54+
4055
- name: Run Affected Build
41-
run: npx nx run-many --targets=build --projects=tag:type:pkg
56+
run: npx nx run-many --targets=build --projects=tag:type:pkg --skip-nx-cache
4257

4358
- name: Configuration xvfb
4459
shell: bash

0 commit comments

Comments
 (0)