Skip to content

Commit 3239d48

Browse files
docs: renew the brand (#2359)
Co-authored-by: ScriptedAlchemy <zackaryjackson@bytedance.com>
1 parent e019b57 commit 3239d48

Some content is hidden

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

45 files changed

+1152
-183
lines changed

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,26 @@ jobs:
4646
- name: Run Affected Test
4747
run: npx nx affected -t test --parallel=3 --exclude='*,!tag:type:pkg'
4848

49-
- name: E2E Test for Next.js Dev
50-
run: |
51-
pnpm run app:next:dev &
52-
sleep 1 &&
53-
npx wait-on tcp:3001 &&
54-
npx wait-on tcp:3002 &&
55-
npx wait-on tcp:3000 &&
56-
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=2 &&
57-
lsof -ti tcp:3000,3001,3002 | xargs kill
58-
59-
- name: E2E Test for Next.js Prod
60-
run: |
61-
pnpm run --filter @module-federation/3002-checkout --filter @module-federation/3000-home --filter @module-federation/3001-shop build &&
62-
pnpm run app:next:prod &
63-
sleep 2 &&
64-
npx wait-on tcp:3001 &&
65-
npx wait-on tcp:3002 &&
66-
npx wait-on tcp:3000 &&
67-
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=1 &&
68-
lsof -ti tcp:3000,3001,3002 | xargs kill
49+
# - name: E2E Test for Next.js Dev
50+
# run: |
51+
# pnpm run app:next:dev &
52+
# sleep 1 &&
53+
# npx wait-on tcp:3001 &&
54+
# npx wait-on tcp:3002 &&
55+
# npx wait-on tcp:3000 &&
56+
# npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=2 &&
57+
# lsof -ti tcp:3000,3001,3002 | xargs kill
58+
59+
# - name: E2E Test for Next.js Prod
60+
# run: |
61+
# pnpm run --filter @module-federation/3002-checkout --filter @module-federation/3000-home --filter @module-federation/3001-shop build &&
62+
# pnpm run app:next:prod &
63+
# sleep 2 &&
64+
# npx wait-on tcp:3001 &&
65+
# npx wait-on tcp:3002 &&
66+
# npx wait-on tcp:3000 &&
67+
# npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=1 &&
68+
# lsof -ti tcp:3000,3001,3002 | xargs kill
6969

7070
- name: E2E Test for ModernJS
7171
run: npx nx run-many --target=test:e2e --projects=modernjs --parallel=1 && lsof -ti tcp:4001 | xargs kill

README.md

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44

55
# Module Federation
66

7+
<p align="center">
8+
<a href="https://www.npmjs.com/package/@module-federation/runtime?activeTab=readme">
9+
<img src="https://img.shields.io/npm/v/@module-federation/runtime?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
10+
</a>
11+
<a href="https://npmcharts.com/compare/@module-federation/runtime?minimal=true">
12+
<img src="https://img.shields.io/npm/dm/@module-federation/runtime.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" />
13+
</a>
14+
<a href="https://github.com/web-infra-dev/rspack/blob/main/LICENSE">
15+
<img src="https://img.shields.io/npm/l/@module-federation/runtime?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
16+
</a>
17+
</p>
18+
19+
`Module Federation 2.0` differs from the `Module Federation` built into `Webpack5` by providing not only the core features of module export, loading, and dependency sharing but also additional dynamic type hinting, `Manifest`, `Federation Runtime`, and `Runtime Plugin System`. These features make `Module Federation` more suitable for use as a micro-frontend architecture in large-scale `Web` applications.
20+
721
## 💡 What is Module Federation?
822

923
- Module Federation is a concept that allows developers to share code and resources across multiple JavaScript applications
@@ -12,47 +26,30 @@
1226

1327
- Module Federation reuses common dependencies between modules as much as possible
1428

15-
[Learn more](https://module-federation.io/)
16-
17-
## 🔥 What does universe offer?
1829

19-
The universe repository provides a set of tools to enhance module federation's capabilities. These include:
30+
## ✨ What new features does Module Federation 2.0 provide?
2031

21-
- [Module Federation Runtime](https://module-federation.io/guide/basic/runtime.html)
22-
- [Rspack Module Federation](https://module-federation.io/guide/basic/rspack.html)
23-
- [Webpack Module Federation](https://module-federation.io/guide/basic/webpack.html)
24-
- [Next.js Module Federation](https://module-federation.io/guide/framework/nextjs.html)
32+
* 🎨 Module Federation Runtime
33+
* 🧩 Runtime Plugins System
34+
* 📝 Manifest
35+
* 🚀 Dynamic type prompt
36+
* 🛠️ Chrome Devtool
2537

2638
## 📚 Getting Started
2739

2840
To get started with Module Federation, see the [Quick Start](https://module-federation.io/guide/start/quick-start.html).
2941

3042

31-
## 📦 Packages
32-
33-
Some of the underlying dependencies of the past are listed here, and [enhanced](https://module-federation.io/) access is recommended for direct use.
34-
35-
- [Node Module Federation](./packages/node)
36-
- [Storybook addon for Module Federation](./packages/storybook-addon)
37-
- [Native federation typescript](./packages/native-federation-typescript)
38-
- [Utilities](./packages/utilities)
39-
4043
# 🧑‍💻 Community
4144

42-
Come and chat with us on [Discussions](https://github.com/module-federation/core/discussions)! The Module federation team and users are active there, and we're always looking for contributions.
45+
Come and chat with us on [Discussions](https://github.com/module-federation/universe/discussions) or [Discord](https://discord.gg/n69NnT3ACV)! The Module federation team and users are active there, and we're always looking for contributions.
4346

4447
# 🤝 Contribution
4548

4649
> New contributors welcome!
4750
4851
Please read the [Contributing Guide](https://github.com/module-federation/core/blob/main/CONTRIBUTING.md).
4952

50-
# Credits
51-
52-
Thanks to:
53-
54-
- The [vite-plugin-federation](https://github.com/originjs/vite-plugin-federation) project created by [@ruleeeer](https://github.com/ruleeeer), `@module-federation/runtime` fork `vite-plugin-federation` semver logic used to verify version
55-
5653
# 🙌 Code of Conduct
5754

5855
This repo has adopted the Code of Conduct. Please check [Code of Conduct](./CODE_OF_CONDUCT.md) for more details.

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
"activeMatch": "/plugin/"
1616
},
1717
{
18-
"text": "Community",
19-
"link": "/community/showcase",
20-
"activeMatch": "/community/",
18+
"text": "Showcase",
19+
"link": "/showcase/index",
20+
"activeMatch": "/showcase/"
21+
},
22+
{
23+
"text": "Ecosystem",
24+
"activeMatch": "/ecosystem/",
2125
"items": [
22-
{
23-
"text": "Showcase",
24-
"link": "/community/showcase/"
25-
},
2626
{
2727
"text": "Module Federation Examples",
2828
"link": "https://github.com/module-federation/module-federation-examples"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[ "announcement"]
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Announcement
2+
3+
> April 24, 2024
4+
5+
Today, we are thrilled to announce the official launch of Module Federation 2.0! Module Federation 2.0 is a new version introduced by the [ByteDance Web Infra](https://github.com/web-infra-dev) team and [@Zack Jackson](https://github.com/ScriptedAlchemy). It resolves numerous issues from the previous Module Federation, building upon ByteDance's internal practices and the original community ecosystem.
6+
7+
## Why Develop Module Federation 2.0?
8+
9+
Module Federation, as a pivotal feature introduced by Webpack 5 over three years ago, has been widely adopted as a module sharing solution. It is favored by large web projects for its efficiency and simplicity in large web application development and team collaboration. However, broader adoption has also surfaced new challenges:
10+
11+
- **Lack of Best Practices**: As an integral plugin of Webpack 5 without a dedicated site, Module Federation has lacked comprehensive best practices for various configurations and scenarios.
12+
- **Runtime and Build Tool Coupling**: Previously, Module Federation's Runtime was tightly coupled with the build tool, which made it impossible to load remote MF modules without the build tool. This necessitated a ground-up implementation of Module Federation in all build tools, leading to high maintenance costs and a lack of standardization.
13+
- **Type Safety**: Unlike traditional NPM packages, Module Federation's runtime loading characteristic lacks TypeScript type hints, presenting a disadvantage.
14+
- **Debugging Tools**: As a micro-frontend architecture pattern, Module Federation lacks tools for analysis and debugging to accommodate new development practices, increasing team collaboration costs.
15+
- **Deployment Platforms**: Module Federation primarily used remoteEntry.js for remote module loading and provisioning in the past. It lacked a universal protocol to integrate with deployment platforms for more controlled resource and version management.
16+
17+
## Introduction to Module Federation 2.0 Features
18+
19+
### New Module Federation Documentation Site
20+
21+
The new documentation includes detailed scenarios and features of Module Federation, from creating with Rspack to using Module Federation, with enhanced explanations and introductions to the plugin's configuration!
22+
23+
![](@public/blog/announcement/module-federation-doc.png)
24+
25+
### More Flexible Module Loading in Module Federation
26+
27+
The new version of Module Federation has extracted the Runtime capabilities, previously built into Webpack, into a standalone SDK. This allows for dynamic registration of remote modules, loading, registering Shared, module preloading, and runtime plugin usage, independent of the build tool, offering stronger control over the loading process.
28+
29+
```typescript
30+
import { init, loadRemote } from '@module-federation/enhanced/runtime';
31+
32+
init({
33+
name: '@demo/app-main',
34+
remotes: [
35+
{
36+
name: "@demo/app1",
37+
entry: "http://localhost:3005/mf-manifest.json",
38+
alias: "app1"
39+
},
40+
{
41+
name: "@demo/app2",
42+
entry: "http://localhost:3006/remoteEntry.js",
43+
alias: "app2"
44+
},
45+
],
46+
});
47+
48+
loadRemote("app2/util").then((md) => {
49+
md.add(1, 2, 3);
50+
});
51+
```
52+
53+
### Unified Module Federation Build Tool Runtime
54+
55+
The new Rspack and Webpack Module Federation plugins are based on the new Runtime implementation. Build tools are no longer directly coupled with Module Federation Runtime logic and can benefit from the plugin mechanism and preload capabilities provided by the new Runtime. Other build tools can also implement Module Federation based on this standard, reducing maintenance costs and maintaining a unified runtime standard.
56+
57+
### Type Hints
58+
59+
The new Module Federation introduces a significant feature: dynamic module type hinting capabilities! This resolves the issue of TypeScript project type invalidation when transitioning from local to dynamic remote modules. The new Module Federation plugin automatically generates and consumes remote types, providing a type hot update experience akin to npm link when all projects are running locally.
60+
61+
![](@public/blog/announcement/demo-type-hint.gif)
62+
63+
### Module Federation Devtool
64+
65+
Module Federation Devtool is a debugging tool developed specifically for Module Federation. It allows for a clear visualization of the dependency relationships between Module Federation modules, including Expose and Shared settings. Additionally, this Devtool enables the proxying of online Module Federation modules to the offline environment, maintaining a hot update development experience!
66+
67+
![](@public/blog/announcement/chrome-devtool-display.gif)
68+
69+
### Manifest Protocol
70+
71+
The Manifest file is generated after building a project with the new Module Federation plugin. It contains foundational information related to Module Federation, including remoteEntry, shared, exposes, remotes, and type information. This data can analyze the dependency relationships between Module Federation projects and enable the creation of a material platform that integrates with various deployment platforms for better control over module versions and canary deployments. The build plugin and runtime can directly consume this file protocol, which can provide additional advanced functionalities. The new dynamic type hinting is based on this file protocol.
72+
73+
![](@public/blog/announcement/manifest-file.gif)
74+
75+
## Acknowledgments
76+
77+
The development of the new Module Federation would not have been possible without the inspiration and support from various projects in the community. We pay tribute and express our gratitude to:
78+
79+
- [Webpack Module Federation](https://webpack.js.org/concepts/module-federation/), from which the new Module Federation was forked and redesigned.
80+
- The [Module Federation Universe](https://github.com/module-federation/core) repository, which provided the foundation for the new Module Federation.
81+
- The [Rspack](https://github.com/web-infra-dev/rspack) project, which implemented Module Federation based on the Module Federation Runtime, ensuring full compatibility with the Rspack ecosystem.
82+
83+
## Future Plans
84+
85+
### Enhancing Developer Experience
86+
87+
Despite the introduction of dynamic type hints and Chrome devtool in the new version, the capabilities of the Chrome devtool remain limited. We aim to enhance the debugging tools for Module Federation, such as by adding visualization for shared reuse.
88+
89+
### Providing High-Performance Solutions
90+
91+
As a micro-frontend architecture solution, Module Federation also faces the "request waterfall problem" inherent to micro-frontend architectures. Module Federation will offer high-performance solutions, such as Server-Side Rendering (SSR) and Data prefetching.
92+
93+
### Collaborating with Community Partners
94+
95+
Currently, the new features of Module Federation 2.0 are supported on Webpack and Rspack build tools only. Module Federation provides a range of foundational SDK capabilities, which other build tools can encapsulate. Module Federation primarily serves as a module sharing solution, and we plan to collaborate with upper-level frameworks to offer more best practices based on the Module Federation micro-frontend architecture to meet the development needs of large web applications.
96+
97+
98+
Please note that markdown syntax requires specific handling for code blocks and links. In the provided translation, `typescript` is used for the code block language identifier, and image links are represented with placeholder markdown syntax since the actual paths were not provided. Adjust the image paths as needed when implementing the markdown content.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Overview
2+
3+
## Changelog
4+
5+
Please visit [GitHub - release](https://github.com/module-federation/universe/releases) to view the changes for each version of Module Federation 2.0.
6+
7+
## Semantic Version
8+
9+
Module Federation 2.0 follows the [Semantic Versioning](https://semver.org/lang/zh-CN/) semantic version specification.
10+
11+
- Major version: contains incompatible API changes.
12+
- Minor version: contains backward compatible features and fixes.
13+
- Patch version: contains backwards compatible bug fixes.
14+
15+
:::tip
16+
Module Federation 2.0 is currently in 0.x version, so minor version may also contain some breaking changes.
17+
:::
18+
19+
## Release cycle
20+
21+
- Module Federation 2.0 will release several patch versions every week.

apps/website-new/docs/en/community/v0-1.mdx renamed to apps/website-new/docs/en/blog/v0-1.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
We have recently released the **v0.1** version of **[Module Federation Enhanced](https://github.com/module-federation/core)** (You can simply think of it as the early version of Module Federation 2.0.)!
66

7-
`Module Federation Enhanced` differs from the `Module Federation` built into `Webpack5` by providing not only the core features of module export, loading, and dependency sharing but also additional dynamic type hinting, `Manifest`, `Federation Runtime`, and `Runtime Plugin`. These features make `Module Federation` more suitable for use as a micro-frontend architecture in large-scale `Web` applications.
7+
`Module Federation 2.0` differs from the `Module Federation` built into `Webpack5` by providing not only the core features of module export, loading, and dependency sharing but also additional dynamic type hinting, `Manifest`, `Federation Runtime`, and `Runtime Plugin System`. These features make `Module Federation` more suitable for use as a micro-frontend architecture in large-scale `Web` applications.
88

99
### 🔥 Features
1010

@@ -22,7 +22,7 @@ We have recently released the **v0.1** version of **[Module Federation Enhanced]
2222

2323
### 💡 Next Steps
2424

25-
`Module Federation Enhanced` is still in rapid iteration and plans to introduce more powerful new features.
25+
`Module Federation 2.0` is still in rapid iteration and plans to introduce more powerful new features.
2626

2727
For example, we are developing the **Module Federation Chrome Devtool**, a user-friendly `Module Federation` debugging and proxy tool that can directly proxy online project `Module Federation` modules to local and enable real-time hot updates. It provides a visual dependency graph that allows you to see the `Module Federation` dependency relationships and `Shared` settings.
2828

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

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/website-new/docs/en/guide/basic/runtime.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,11 +412,11 @@ registerRemotes([
412412
413413
`Federation Runtime` is one of the main features of the new version of `Module Federation`. It supports registering shared dependencies at runtime, dynamically registering and loading remote modules, and can expand the capabilities of `Module Federation` at runtime through `Plugin`. Build plugins are based on the basic implementation of Runtime.
414414
415-
There are the following differences between `Federation Runtime` and `Builder Plugin`:
415+
There are the following differences between `Federation Runtime` and `Compiler Plugin`:
416416
417-
| Federation Runtime | Builder Plugin |
417+
| Federation Runtime | Compiler Plugin |
418418
| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
419-
| Can be used independently of build plugins, and can directly use pure runtime for module loading in projects like `webpack4` | Build plugins require webpack5, Rspack, Vite, or above |
419+
| Can be used independently of build plugins, and can directly use pure runtime for module loading in projects like `webpack4` | Build plugins require Webpack5, Rspack, Vite, or above |
420420
| Supports dynamic registration of modules | Does not support dynamic registration of modules |
421421
| Does not support loading modules with `import` syntax | Supports loading modules synchronously with `import` syntax |
422422
| Supports `loadRemote` for loading modules | Supports `loadRemote` for loading modules |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
["index", "setting-up-env", "quick-start", "features", "glossary"]
1+
["index", "setting-up-env", "quick-start", "features", "glossary", "npm-packages"]

0 commit comments

Comments
 (0)