Skip to content

Commit 593cbc9

Browse files
Merge branch 'main' into fix-reduce-csp-false-positives
2 parents 6519b8b + 1e24dc3 commit 593cbc9

File tree

76 files changed

+386
-130
lines changed

Some content is hidden

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

76 files changed

+386
-130
lines changed

.changeset/ai-calm-dog.md

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

.changeset/ai-sleepy-cat.md

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

.changeset/ai-sleepy-lion.md

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

.changeset/brave-boats-tan.md

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

.changeset/bright-beds-obey.md

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

.changeset/nervous-cougars-heal.md

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

.changeset/nice-windows-stare.md

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

.changeset/quiet-bottles-unite.md

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

.changeset/rspack-define-env-constants.md

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

.changeset/spotty-buttons-cough.md

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

.changeset/swift-kiwis-argue.md

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

apps/modernjs/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @module-federation/modernjsapp
22

3+
## 0.1.95
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [82b8cac]
8+
- Updated dependencies [0eb6697]
9+
- @module-federation/enhanced@0.14.0
10+
311
## 0.1.94
412

513
### Patch Changes

apps/modernjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@module-federation/modernjsapp",
33
"private": true,
4-
"version": "0.1.94",
4+
"version": "0.1.95",
55
"scripts": {
66
"reset": "npx rimraf ./**/node_modules",
77
"dev": "modern dev",

apps/router-demo/router-remote5-2005/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# remote5
22

3+
## 1.1.2
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [26f8a77]
8+
- Updated dependencies [d237ab9]
9+
- @module-federation/rsbuild-plugin@0.14.0
10+
- @module-federation/bridge-react@0.14.0
11+
312
## 1.1.1
413

514
### Patch Changes

apps/router-demo/router-remote5-2005/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "remote5",
33
"private": true,
4-
"version": "1.1.1",
4+
"version": "1.1.2",
55
"scripts": {
66
"dev": "rsbuild dev",
77
"build": "rsbuild build",

apps/website-new/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# website-new
22

3+
## 1.1.2
4+
5+
### Patch Changes
6+
7+
- @module-federation/error-codes@0.14.0
8+
39
## 1.1.1
410

511
### Patch Changes

apps/website-new/docs/en/configure/experiments.mdx

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Experiments
22

3-
The `experiments` configuration is used to enable experimental capabilities in the plugin.
3+
The `experiments` configuration enables advanced and experimental capabilities in the plugin.
44

55
- Example
66

@@ -30,9 +30,9 @@ new ModuleFederationPlugin({
3030

3131
## asyncStartup
3232

33-
- Type: `boolean`
34-
- Required: No
35-
- Default: `false`
33+
- **Type:** `boolean`
34+
- **Required:** No
35+
- **Default:** `false`
3636

3737
When `asyncStartup` is enabled, all Module Federation entrypoints will initialize asynchronously by default. This means:
3838

@@ -46,17 +46,17 @@ When using this mode, all entrypoints will initialize asynchronously. If you're
4646

4747
## externalRuntime
4848

49-
- Type: `boolean`
50-
- Required: No
51-
- Default: `false`
49+
- **Type:** `boolean`
50+
- **Required:** No
51+
- **Default:** `false`
5252

5353
After setting `true`, the external MF runtime will be used and the runtime provided by the consumer will be used. (Please make sure your consumer has `provideExternalRuntime: true` set, otherwise it will not run properly!)
5454

5555
## provideExternalRuntime
5656

57-
- Type: `boolean`
58-
- Required: No
59-
- Default: `false`
57+
- **Type:** `boolean`
58+
- **Required:** No
59+
- **Default:** `false`
6060

6161
::: warning note
6262
Make sure to only configure it on the topmost consumer! If multiple consumers inject runtime at the same time, the ones executed later will not overwrite the existing runtime.
@@ -70,9 +70,9 @@ This object contains flags related to build-time optimizations that can affect t
7070

7171
### disableSnapshot
7272

73-
- Type: `boolean`
74-
- Required: No
75-
- Default: `false`
73+
- **Type:** `boolean`
74+
- **Required:** No
75+
- **Default:** `false`
7676

7777
When set to `true`, this option defines the `FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN` global constant as `true` during the build. In the `@module-federation/runtime-core`, this prevents the `snapshotPlugin()` and `generatePreloadAssetsPlugin()` from being included and initialized within the FederationHost.
7878

@@ -83,11 +83,15 @@ When set to `true`, this option defines the `FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLU
8383
* Features relying on the manifest, such as dynamic remote discovery, manifest-based version compatibility checks, advanced asset preloading (also handled by the removed `generatePreloadAssetsPlugin`), and potentially runtime debugging/introspection tools, will not function correctly or will be unavailable.
8484
* Use this option only if you do not rely on these manifest-driven features and prioritize a minimal runtime footprint.
8585

86+
:::warning
87+
**Caution:** Setting `disableSnapshot: true` will disable the mf-manifest protocol. This means you will lose TypeScript syncing support and hot module replacement (HMR) for federated modules. If you are only using `.js` remotes (not manifest-based remotes), you will not lose any functionality as the `js` remotes do not support these capabilities anyways.
88+
:::
89+
8690
### target
8791

88-
- Type: `'web' | 'node'`
89-
- Required: No
90-
- Default: Inferred from Webpack's `target` option (usually `'web'`)
92+
- **Type:** `'web' | 'node'`
93+
- **Required:** No
94+
- **Default:** Inferred from Webpack's `target` option (usually `'web'`)
9195

9296
This option defines the `ENV_TARGET` global constant during the build, specifying the intended execution environment.
9397

@@ -100,3 +104,21 @@ This option defines the `ENV_TARGET` global constant during the build, specifyin
100104
* Includes the necessary Node.js-specific functions from the SDK (`createScriptNode`, `loadScriptNode`) in the bundle, allowing the federated application to function correctly in Node.js.
101105

102106
Explicitly setting this value is recommended to ensure the intended optimizations are applied, especially in universal or server-side rendering scenarios.
107+
108+
### Impact of Optimization Flags on `remoteEntry.js` Size
109+
110+
The following table demonstrates how different combinations of the `disableSnapshot`, `target: 'web'`, and `externalRuntime` optimization flags affect the size of the generated `remoteEntry.js` file. These measurements can help you choose the right trade-off between runtime features and bundle size for your use case.
111+
112+
| Optimization Flags | remoteEntry.js | Gzip Size | Brotli Size |
113+
|---------------------------------------------|:--------------:|:---------:|:-----------:|
114+
| No optimization flags enabled | 69K | 21437 B | 19024 B |
115+
| `disableSnapshot: true` | 65K | 20096 B | 17860 B |
116+
| `target: 'web'` | 60K | 19314 B | 17105 B |
117+
| Both enabled | 56K | 17998 B | 15982 B |
118+
| Both enabled + `externalRuntime: true` | 14K | 5381 B | 4703 B |
119+
| Both disabled + `externalRuntime: true` | 22K | 8222 B | 7269 B |
120+
121+
**Notes:**
122+
- Enabling both `disableSnapshot` and `target: 'web'` provides the greatest reduction in bundle size, especially when combined with `externalRuntime: true`.
123+
- Using the external runtime (`externalRuntime: true`) can dramatically reduce the size of your remote entry, but requires that the consumer provides the runtime.
124+
- Smaller bundle sizes can lead to faster load times and improved performance, but may disable certain features (see above for details on what each flag does).

apps/website-new/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "website-new",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"private": true,
55
"scripts": {
66
"dev": "rspress dev",

packages/bridge/bridge-react-webpack-plugin/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @module-federation/bridge-react-webpack-plugin
22

3+
## 0.14.0
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [82b8cac]
8+
- @module-federation/sdk@0.14.0
9+
310
## 0.13.1
411

512
### Patch Changes

packages/bridge/bridge-react-webpack-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@module-federation/bridge-react-webpack-plugin",
3-
"version": "0.13.1",
3+
"version": "0.14.0",
44
"publishConfig": {
55
"access": "public"
66
},

packages/bridge/bridge-react/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @module-federation/bridge-react
22

3+
## 0.14.0
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [82b8cac]
8+
- Updated dependencies [677aac9]
9+
- @module-federation/sdk@0.14.0
10+
- @module-federation/bridge-shared@0.14.0
11+
312
## 0.13.1
413

514
### Patch Changes

packages/bridge/bridge-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@module-federation/bridge-react",
3-
"version": "0.13.1",
3+
"version": "0.14.0",
44
"publishConfig": {
55
"access": "public"
66
},

packages/bridge/bridge-shared/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @module-federation/bridge-shared
22

3+
## 0.14.0
4+
5+
### Patch Changes
6+
7+
- 677aac9: vue.js has router option added to the vue3-bridge
8+
39
## 0.13.1
410

511
## 0.13.0

packages/bridge/bridge-shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@module-federation/bridge-shared",
3-
"version": "0.13.1",
3+
"version": "0.14.0",
44
"publishConfig": {
55
"access": "public"
66
},

packages/bridge/vue3-bridge/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# @module-federation/bridge-vue3
22

3+
## 0.14.0
4+
5+
### Patch Changes
6+
7+
- 677aac9: vue.js has router option added to the vue3-bridge
8+
- Updated dependencies [82b8cac]
9+
- Updated dependencies [677aac9]
10+
- @module-federation/sdk@0.14.0
11+
- @module-federation/bridge-shared@0.14.0
12+
- @module-federation/runtime@0.14.0
13+
314
## 0.13.1
415

516
### Patch Changes

packages/bridge/vue3-bridge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/module-federation/core",
88
"directory": "packages/vue3-bridge"
99
},
10-
"version": "0.13.1",
10+
"version": "0.14.0",
1111
"publishConfig": {
1212
"access": "public"
1313
},

packages/chrome-devtools/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @module-federation/devtools
22

3+
## 0.14.0
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [82b8cac]
8+
- @module-federation/sdk@0.14.0
9+
310
## 0.13.1
411

512
### Patch Changes

packages/chrome-devtools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@module-federation/devtools",
3-
"version": "0.13.1",
3+
"version": "0.14.0",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

packages/cli/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @module-federation/cli
22

3+
## 0.14.0
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [82b8cac]
8+
- Updated dependencies [0eb6697]
9+
- @module-federation/sdk@0.14.0
10+
- @module-federation/dts-plugin@0.14.0
11+
312
## 0.13.1
413

514
### Patch Changes

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@module-federation/cli",
3-
"version": "0.13.1",
3+
"version": "0.14.0",
44
"type": "commonjs",
55
"description": "Module Federation CLI",
66
"homepage": "https://module-federation.io",

packages/create-module-federation/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# create-module-federation
22

3+
## 0.14.0
4+
35
## 0.13.1
46

57
## 0.13.0

0 commit comments

Comments
 (0)