Skip to content

Commit 225d081

Browse files
2heal1ScriptedAlchemycursoragent
authored
docs: announce v2 stable version (#4401)
Co-authored-by: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
1 parent c38d1be commit 225d081

25 files changed

+748
-65
lines changed

apps/website-new/docs/en/_nav.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
{
2828
"text": "Blog",
29-
"link": "/blog/announcement",
29+
"link": "/blog/index",
3030
"activeMatch": "/blog/"
3131
},
3232
{
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
[
2+
"index",
23
"announcement",
34
"hoisted-runtime",
45
"error-load-remote",
56
{
67
"type": "file",
78
"name": "node",
89
"label": "Module Federation on Node.js, Made Easy"
10+
},
11+
{
12+
"type": "file",
13+
"name": "v2-stable-version",
14+
"label": "MF 2.0 Stable Release"
915
}
1016
]
Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
# Overview
1+
---
2+
title: Overview
3+
sidebar: false
4+
---
5+
# Module Federation Blog
26

3-
## Changelog
7+
Find the latest posts and release announcements about Module Federation here.
48

5-
Please visit [GitHub - release](https://github.com/module-federation/universe/releases) to view the changes for each version of Module Federation 2.0.
9+
## [Module Federation 2.0 Stable Release](./v2-stable-version)
610

7-
## Semantic Version
11+
> February 10, 2026
812
9-
Module Federation 2.0 follows the [Semantic Versioning](https://semver.org/lang/zh-CN/) semantic version specification.
13+
Module Federation 2.0 is officially stable, bringing shared dependency tree shaking and a Modern.js v3 plugin to make integration easier.
1014

11-
- Major version: contains incompatible API changes.
12-
- Minor version: contains backward compatible features and fixes.
13-
- Patch version: contains backwards compatible bug fixes.
15+
## [Module Federation on Node.js: From Usable to Ergonomic](./node)
1416

15-
:::tip
16-
Module Federation 2.0 is currently in 0.x version, so minor version may also contain some breaking changes.
17-
:::
17+
> January 23, 2026
1818
19-
## Release cycle
19+
Learn how to use Module Federation in Node.js, including runtime-only consumption, Rspack/Webpack integration, and producer-side build configuration.
2020

21-
- Module Federation 2.0 will release several patch versions every week.
21+
## [Handling Remote Module Rendering Errors](./error-load-remote)
22+
23+
> September 9, 2025
24+
25+
Fallback strategies for remote module load/render failures: network retries, the errorLoadRemote hook, and React ErrorBoundary.
26+
27+
## [Release Announcement](./announcement)
28+
29+
> April 26, 2024
30+
31+
Announces the official release of Module Federation 2.0 and introduces core capabilities like runtime decoupling, type safety, devtools, and the Manifest protocol.
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# MF 2.0 Stable Release: Balancing Developer Productivity and Extreme Performance
2+
3+
One year ago, we open-sourced Module Federation 2.0 ([MF 2.0](https://module-federation.io/en/blog/announcement.html)), and since then we have received a wealth of valuable feedback and suggestions from the community. We believe that a modern frontend framework must not only improve collaborative development efficiency, but also provide a core engine that enables extreme performance. With this in mind, we have spent the past year deeply refining MF 2.0 and expanding its capabilities.
4+
5+
Today, we are pleased to announce that **MF 2.0 is now officially stable**. The stable release delivers powerful performance optimizations, covers a broader range of deployment scenarios, and significantly improves the developer experience.
6+
7+
## End-to-End Performance Optimization System
8+
MF 2.0 systematically restructures the performance pipeline of micro-frontend applications across four stages: **build, asset loading, rendering, and data fetching**.
9+
10+
These capabilities do not exist in isolation; they work together to form an end-to-end performance optimization system tailored for module federation scenarios.
11+
12+
**All capabilities support incremental adoption**. You can enable them gradually as needed without performing a big-bang rewrite of your current architecture, and without compromising the stability of existing systems.
13+
14+
### Tree Shaking for Shared Dependencies
15+
Traditional shared dependencies avoid duplicate loading, but to ensure completeness, shared libraries are often **bundled and exposed as whole packages**. Even if you only use a small portion, you still have to load the entire library, which causes bundle sizes to grow continuously.
16+
17+
In **MF 2.0**, this problem is addressed:
18+
19+
**Shared dependencies now support tree shaking.**
20+
21+
By simply enabling `treeShaking`, MF can perform on-demand pruning of shared dependencies without sacrificing the dynamic nature of module federation. It retains only the modules that are actually likely to be used, significantly reducing the size of shared bundles while remaining fully compatible with existing projects.
22+
23+
![](https://module-federation-assest.netlify.app/document/announcement/blog/v2-stable-version/enable-shared-tree-shaking.png)
24+
25+
MF 2.0 provides two modes to fit different scenarios:
26+
27+
- **runtime-infer**: Zero external dependencies and ready to use out of the box. At runtime, MF first attempts to reuse already-loaded tree-shaken shared bundles; if their capabilities are insufficient, it automatically falls back to loading the full dependency to ensure functional completeness. You can improve reuse effectiveness with `usedExports`.
28+
29+
- **server-calc**: A mode where the server or CI system analyzes dependency usage across multiple applications and produces a globally optimal shared-pruning result, suitable for large systems.
30+
31+
A **visual analysis dashboard** is also provided, making it easy to see how shared dependencies are used and what bundle size savings they deliver.
32+
33+
For a large component library like **Ant Design**, when an application only uses the Badge, Button, and List components, the shared bundle size is about **1404.2 KB** without shared-dependency tree shaking. After enabling tree shaking, the actual loaded size drops to **344.0 KB**, reducing unnecessary code by approximately **75.5%**.
34+
35+
36+
![Configuration](https://module-federation-assest.netlify.app/document/announcement/blog/v2-stable-version/set-config.png)
37+
![Analysis result](https://module-federation-assest.netlify.app/document/announcement/blog/v2-stable-version/analyze-result.png)
38+
39+
### Server-Side Rendering (SSR)
40+
SSR generates full HTML on the server and returns it directly to the browser, so pages can render without waiting for client-side hydration. This dramatically improves **first-screen performance** and **SEO**. For medium-to-large web applications, SSR has effectively become a standard capability.
41+
42+
However, in micro-frontend architectures, SSR has historically been difficult to implement. Early MF versions did not cover this capability, forcing developers to choose between **architectural flexibility** and **performance benefits**.
43+
44+
In **MF 2.0**, this trade-off is eliminated.
45+
46+
You can use **MF SSR** directly within **{ props.framework || 'Modern.js' }**, giving micro-frontend applications high-performance SSR capabilities as well.
47+
48+
{ props.ssr || '' }
49+
50+
### Isomorphic Data Prefetching
51+
MF 2.0 introduces a new **isomorphic data fetching solution** that supports both **SSR and CSR** scenarios. It provides built-in **`prefetch`** and **`cache`** APIs for unified data prefetching and cache management, ensuring stable and predictable performance across different rendering modes.
52+
53+
By leveraging preloading and caching, pages can prepare critical data before rendering, preventing repeated requests and waterfall loading, which significantly improves both initial load and interactive responsiveness.
54+
55+
{ props.dataSolution || '' }
56+
57+
58+
{ props.serverPreload || '' }
59+
60+
61+
### Rust-Powered Capabilities
62+
In large projects, **manifest generation** often becomes a performance bottleneck during the build phase. MF 2.0 moves this core capability to a **Rust implementation**, taking advantage of Rust’s high performance and memory safety to substantially reduce the time required to generate manifests.
63+
64+
At the same time, **AsyncStartUp** has also been rewritten in Rust. You no longer need to configure asynchronous entry points to get equivalent capabilities, and related first-screen performance risks are effectively eliminated, making the application startup path simpler, more stable, and more efficient.
65+
66+
{ props.deploy || '' }
67+
68+
## More Powerful Debugging System
69+
MF 2.0 builds a comprehensive debugging system around **observability and debuggability**. It makes shared dependencies, module relationships, and potential side effects **visible, traceable, and detectable in advance**, greatly reducing uncertainty when developing and integrating dynamic applications.
70+
71+
### Side Effect Scanner
72+
Before consuming a remote module, teams often need to assess whether it pollutes global variables, registers event listeners, or affects style scopes—uncertainties that significantly increase the cost of adopting micro-frontends.
73+
74+
MF 2.0 provides a **Side Effect Scanner** that statically analyzes build outputs and identifies the following side effects:
75+
76+
- Global variables
77+
- Event listeners
78+
- CSS selector impact scope
79+
80+
The accompanying **CLI tool** can automatically perform scans and output results, allowing consumers to understand the risks before integration and thereby significantly lower the cost of onboarding federated modules.
81+
82+
### Chrome Extension for Dependency Visualization
83+
We have fully upgraded the existing Chrome extension with a new UI and stronger debugging capabilities, making the runtime state of module federation **visible, queryable, and verifiable**.
84+
85+
- **Smart sidebar sync**
86+
The panel automatically follows the current page without manual refresh or reconnection, providing a smoother debugging experience.
87+
88+
89+
- **Shared dependency visualization**
90+
The new **Shared** panel clearly shows shared dependency loading on the current page, for example:
91+
- Whether React is successfully shared
92+
- Which shared version is actually in use
93+
- Whether your sharing strategy is working as expected
94+
![Shared dependencies visualization](https://module-federation-assest.netlify.app/document/announcement/blog/v2-stable-version/chrome-shared.png)
95+
96+
- **Fast dependency graph navigation**
97+
You can search for any module in the dependency graph, and see its upstream and downstream relations in a clear hierarchy, making complex dependencies easy to reason about.
98+
99+
![Dependency graph](https://module-federation-assest.netlify.app/document/announcement/blog/v2-stable-version/chrome-dep.png)
100+
101+
- **Data trimming mode**
102+
When there are many modules, you can enable trimming mode to reduce the size of proxy data and avoid injection failures caused by localStorage limits.
103+
*Trimmed data only affects preloading analysis, not actual behavior, so it is safe to enable.*
104+
105+
106+
## Richer Ecosystem
107+
108+
MF now supports the major **bundlers, application frameworks, and UI stacks**, and can run reliably across different technical ecosystems, helping teams introduce module federation without changing their existing technology choices.
109+
110+
- **Bundler**: Webpack / Rspack / Rollup / Rolldown
111+
112+
- **Build Tool**: Rsbuild / Vite / Metro
113+
114+
- **Framework/Tool**: Modern.js / Next.js / Rspress / Rslib / Storybook
115+
116+
- **UI Library**: React / Vue / React Native
117+
118+
![MF 2.0 ecosystem](https://module-federation-assest.netlify.app/document/announcement/blog/v2-stable-version/ecosystem.png)
119+
120+
On top of this, MF 2.0 extends module federation capabilities into more critical development and delivery scenarios:
121+
122+
### Node.js
123+
Module federation can now be used directly in the **Node.js runtime**, so remote modules can be consumed not only by the browser but also by **SSR, BFF, and Node service layers**, enabling a unified delivery model for modules across frontend and backend.
124+
125+
### Rspress Documentation Splitting
126+
In **Rspress**, MF supports splitting and loading remote modules by document or route, allowing large documentation sites to be **decomposed and released independently via module federation**, which is ideal for multi-team documentation and knowledge platforms.
127+
128+
### Rstest
129+
Within the **Rstest** testing system, module federation can load remote modules in a real runtime manner, enabling micro-frontend and MF applications to perform **integration tests and end-to-end tests that closely mirror production**, avoiding the gap between tests and real runtime behavior.
130+
131+
## Changes
132+
### Version Changes (Minor Changes)
133+
We prioritize **stability and compatibility**, so this upgrade contains no breaking changes and only introduces a few minor updates. The key changes are:
134+
135+
### Minor Changes
136+
137+
- The default value of `library.type` is changed from `var` to `global`.
138+
- `runtimePlugins` now support configuration parameters.
139+
140+
## What's Next?
141+
### React Server Components
142+
React Server Components (RSC) represent a revolutionary step forward in the React ecosystem. Compared to MF x SSR, the combination of MF x RSC can deliver even better performance (with much smaller bundles) and safer data handling. We have already validated this approach in basic demos and will provide stronger support and integration in Modern.js.
143+
144+
### AI-friendly Design
145+
We are gradually enriching MF with **the contextual information and metadata required for AI to use components and modules**, including capability boundaries, usage constraints, runtime environments, and dependency relationships. We also plan to introduce **quantitative scoring and confidence mechanisms** so that component assets can be understood, evaluated, and selected by AI.
146+
147+
{ props.aiFriendly || '' }
148+
149+
{ props.next || '' }

apps/website-new/docs/en/configure/_meta.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,25 @@
6868
"type": "file",
6969
"name": "experiments",
7070
"label": "experiments"
71+
},
72+
{
73+
"type": "file",
74+
"name": "injectTreeShakingUsedExports",
75+
"label": "injectTreeShakingUsedExports"
76+
},
77+
{
78+
"type": "file",
79+
"name": "treeShakingDir",
80+
"label": "treeShakingDir"
81+
},
82+
{
83+
"type": "file",
84+
"name": "treeShakingSharedExcludePlugins",
85+
"label": "treeShakingSharedExcludePlugins"
86+
},
87+
{
88+
"type": "file",
89+
"name": "treeShakingSharedPlugins",
90+
"label": "treeShakingSharedPlugins"
7191
}
7292
]

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,9 @@ type ModuleFederationOptions = {
2828
dts?: boolean | PluginDtsOptions;
2929
// Use a virtual runtime entrypoint instead of writing a temporary file to disk
3030
virtualRuntimeEntry?: boolean;
31+
injectTreeShakingUsedExports?: boolean;
32+
treeShakingDir?: string;
33+
treeShakingSharedPlugins?: Array<string>;
34+
treeShakingSharedExcludePlugins?: Array<string>;
3135
};
3236
```

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ interface SharedConfig {
2222
shareScope?: string;
2323
import?: string | false;
2424
allowNodeModulesSuffixMatch?: boolean;
25+
treeShaking?: TreeShakingConfig;
26+
}
27+
28+
interface TreeShakingConfig {
29+
mode: 'server-calc' | 'runtime-infer';
30+
usedExports?: string[];
2531
}
2632

2733
```
@@ -108,7 +114,7 @@ Enables a fallback lookup that matches shared modules by the portion of their re
108114

109115
> Previously this option was called `nodeModulesReconstructedLookup`.
110116
111-
{/*
117+
112118
## treeShaking
113119

114120
- Type: `TreeShakingConfig`
@@ -117,9 +123,9 @@ Enables a fallback lookup that matches shared modules by the portion of their re
117123

118124
Configures tree-shaking behavior for shared dependencies. Enabling tree shaking for shared dependencies can reduce the size of the shared bundle.
119125

120-
> Only takes effect when using Rspack as the bundler.
121-
*/}
122-
{/*
126+
> Rspack is the recommended bundler for this capability, and the docs/examples prioritize Rspack usage.
127+
128+
123129
### usedExports
124130

125131
- Type: `string[]`
@@ -137,7 +143,7 @@ Manually **add** the exports used from the shared dependency.
137143
Configures the loading strategy for tree-shaken shared dependencies.
138144

139145
- `runtime-infer`: infers based on the consumer’s `usedExports`. If the provider’s `usedExports` satisfies the consumer’s `usedExports`, it uses the provider’s `shared`; otherwise it uses the consumer’s own `shared`. If neither satisfies the requirement, it falls back to the full bundle.
140-
- `server-calc`: decides whether to load the shared dependency based on the Snapshot delivered by the server. */}
146+
- `server-calc`: decides whether to load the shared dependency based on the Snapshot delivered by the server.
141147

142148
### filename
143149

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

3-
用于输出 tree shaking 共享 fallback 资源的目录。
3+
The directory used to output tree-shaking shared fallback assets.
44

5-
- 类型:`string`
6-
- 是否必填:否
7-
- 默认值:`undefined`
5+
- Type: `string`
6+
- Required: No
7+
- Default: `undefined`
88

9-
当启用共享依赖 tree shaking 功能时,Module Federation 会将未使用的共享模块导出拆分出来。该选项指定了这些 fallback 资源的输出目录。
9+
When shared dependency tree shaking is enabled, Module Federation will extract the exports of unused shared modules. This option specifies the output directory for those fallback assets.
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# treeShakingSharedExcludePlugins
22

3-
配置在构建共享依赖 tree shaking/fallback 过程中需要排除的插件名称。
4-
5-
- 类型:`string[]`
6-
- 是否必填:否
7-
- 默认值:`['HtmlWebpackPlugin','HtmlRspackPlugin']`
8-
9-
允许用户指定一组插件名称,这些插件在构建共享依赖 tree shaking/fallback 过程 时将被忽略或不参与处理。
3+
Configures the plugin names to exclude during the shared dependency tree shaking/fallback process.
104

5+
- Type: `string[]`
6+
- Required: No
7+
- Default: `['HtmlWebpackPlugin','HtmlRspackPlugin']`
118

9+
Allows users to specify a list of plugin names. These plugins will be ignored and will not participate in the shared dependency tree shaking/fallback process.

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# treeShakingSharedPlugins
22

3-
允许用户显式指定哪些插件应该参与 shared 模块的第二次 treeshaking 过程。
3+
Allows users to explicitly specify which plugins should participate in the second tree-shaking pass for shared modules.
44

5-
- 类型:`string[]`
6-
- 是否必填:否
7-
- 默认值:`undefined`
5+
- Type: `string[]`
6+
- Required: No
7+
- Default: `undefined`
88

9-
如果设置了 `shared.treeShaking.mode` 为 'server-calc',那么在部署服务中,会重新构建需要 tree shaking 的共享依赖,此时仅构建共享依赖,不会加载原项目的构建配置。
10-
如果你的项目有特殊的构建配置,例如设置了 externals ,那么你可以把这些构建配置集成到一个 NPM Package ,然后在 `treeShakingSharedPlugins` 中填写此插件的名称和版本,这样就可以在第二次 treeshaking 过程中参与 shared 模块的 treeshaking 过程。
9+
If `shared.treeShaking.mode` is set to `'server-calc'`, the deployment service will rebuild the shared dependencies that need tree shaking. In this process, only the shared dependencies are built, and the original project's build configuration is not loaded.
1110

12-
例如提供了一个插件 `my-build-plugin`,它会设置 `externals`
11+
If your project relies on special build configuration—for example, setting `externals`—you can package that configuration into an NPM package, then provide the plugin name and version in `treeShakingSharedPlugins`. This allows the plugin to participate in the second tree-shaking pass for shared modules.
12+
13+
For example, suppose you provide a plugin `my-build-plugin` that sets `externals`:
1314

1415
```ts title='my-build-plugin'
1516
class MyBuildPlugin {
@@ -22,7 +23,7 @@ class MyBuildPlugin {
2223
export default MyBuildPlugin;
2324
```
2425

25-
将此插件发布的版本为 `0.0.2` ,那么此时只需要在 `treeShakingSharedPlugins` 中填写插件的名称和版本即可:
26+
If you publish this plugin as version `0.0.2`, you only need to specify its name and version in `treeShakingSharedPlugins`:
2627

2728
```ts title='module-federation.config.ts'
2829

0 commit comments

Comments
 (0)