Skip to content

Commit 6519b8b

Browse files
Merge branch 'main' into fix-reduce-csp-false-positives
2 parents 69a2bbe + 30e737e commit 6519b8b

File tree

71 files changed

+4326
-6142
lines changed

Some content is hidden

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

71 files changed

+4326
-6142
lines changed

.changeset/ai-calm-dog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@module-federation/enhanced": minor
3+
---
4+
5+
Updated ModuleFederationPlugin to enhance configuration capabilities and target environment identification.
6+
7+
- Introduced `definePluginOptions` to manage DefinePlugin settings.
8+
- Added `FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN` to handle disabling of snapshot optimizations via experiments.
9+
- Implemented environment target detection (`web` or `node`) based on compiler options and experiments.
10+
- Consolidated DefinePlugin application with the newly constructed `definePluginOptions`.

.changeset/ai-sleepy-cat.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@module-federation/sdk": minor
3+
---
4+
5+
Introduced environment-specific handling for `createScriptNode` and `loadScriptNode` functions and added build optimization options.
6+
7+
- Declared `ENV_TARGET` constant to differentiate between 'web' and 'node' environments.
8+
- Modified `createScriptNode` and `loadScriptNode` to execute only in Node.js environment.
9+
- Throws an error if attempted in a non-Node.js environment.
10+
- Added logging for debugging purposes.
11+
- Introduced `optimization` options in `ModuleFederationPluginOptions`.
12+
- Added config for `disableSnapshot` and `target` environment optimizations.

.changeset/ai-sleepy-lion.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@module-federation/runtime-core": minor
3+
---
4+
5+
Add conditional functionality for snapshots and optimize entry loading.
6+
7+
- Introduced FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN constant to control snapshot functionality.
8+
- Default to include snapshot functionality if constant is not defined.
9+
- Simplified plugin loading logic to check USE_SNAPSHOT flag.
10+
- Added ENV_TARGET constant to differentiate between web and node environments.
11+
- Extracted duplicated logic for handling remote entry loaded into `handleRemoteEntryLoaded` function.
12+
- Refactored entry loading to use conditional environment checks with `ENV_TARGET`.

.changeset/bright-beds-obey.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/runtime-core': patch
3+
---
4+
5+
Allow extensions other than .js for non-manifest entries
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@module-federation/rspack": minor
3+
---
4+
5+
Update Rspack ModuleFederationPlugin to support enhanced configuration capabilities and environment targeting.
6+
7+
- Injects `FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN` and `ENV_TARGET` as global constants using DefinePlugin, based on the new `experiments.optimization` options.
8+
- Ensures parity with the Webpack plugin for build-time optimizations and environment-specific code paths.
9+
- Enables tree-shaking and feature toggling in the runtime and SDK for both Rspack and Webpack builds.

.changeset/spotty-buttons-cough.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/storybook-addon': patch
3+
---
4+
5+
fix type error with nx update

.cursor/mcp.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"mcpServers": {
3+
"nx-mcp": {
4+
"url": "http://localhost:9442/sse"
5+
}
6+
}
7+
}

.cursorignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
**/coverage/
55
**/dist/
66

7-
# Documentation and config files
8-
**/*.yaml
9-
**/*.yml
10-
11-
127
# Explicitly ignore specific packages
138
packages/typescript/
149
packages/native-*
@@ -24,7 +19,6 @@ webpack/test/
2419
webpack/benchmark/
2520
tools/
2621
.husky/
27-
.github/
2822
.verdaccio/
2923

3024

@@ -33,7 +27,6 @@ tools/
3327
.cursorignore
3428
jest.preset.js
3529
babel.config.json
36-
nx.json
3730
LICENSE
3831
.nxignore
3932
netlify.toml

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
checkout-install:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 30
1213
steps:
1314
- name: Checkout Repository
1415
uses: actions/checkout@v3
@@ -26,23 +27,39 @@ jobs:
2627
node-version: '18'
2728
cache: 'pnpm'
2829

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

3245
- name: Install Dependencies
3346
run: pnpm install
3447

3548
- name: Install Cypress
49+
# if: steps.browsers-cache.outputs.cache-hit != 'true'
3650
run: npx cypress install
3751

3852
- name: Check Code Format
3953
run: npx nx format:check
4054

55+
- name: Print Number of CPU Cores
56+
run: nproc
57+
4158
- name: Warm Nx Cache
42-
run: npx nx run-many --targets=build --projects=tag:type:pkg
59+
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4
4360

4461
- name: Run Build for All
45-
run: npx nx run-many --targets=build --projects=tag:type:pkg --skip-nx-cache
62+
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4 --skip-nx-cache
4663

4764
- name: Check Package Publishing Compatibility
4865
run: |
@@ -63,7 +80,7 @@ jobs:
6380
with:
6481
max_attempts: 2
6582
timeout_minutes: 10
66-
command: npx nx affected -t test --parallel=3 --exclude='*,!tag:type:pkg' --skip-nx-cache
83+
command: npx nx affected -t test --parallel=3 --exclude='*,!tag:type:pkg'
6784

6885
- name: Run Affected Experimental Tests
6986
uses: nick-fields/retry@v3

.github/workflows/devtools.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
jobs:
1414
main:
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 30
1617
steps:
1718
- name: Checkout Repository
1819
uses: actions/checkout@v3

0 commit comments

Comments
 (0)