From fc6e27514436d86601c4c662ee555e16b0782ec0 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 16 Nov 2025 16:12:59 +0800 Subject: [PATCH 1/2] docs: improve english clarity --- .../en/guide/advanced/module-federation.mdx | 12 ++-- website/docs/en/guide/start/features.mdx | 70 +++++++++---------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/website/docs/en/guide/advanced/module-federation.mdx b/website/docs/en/guide/advanced/module-federation.mdx index 9614190645..e0ab239daf 100644 --- a/website/docs/en/guide/advanced/module-federation.mdx +++ b/website/docs/en/guide/advanced/module-federation.mdx @@ -1,6 +1,6 @@ # Module Federation -Module Federation is an architectural pattern for decomposing JavaScript applications—similar to server-side microservices that lets you share code and resources between multiple JavaScript applications (or micro-frontends). +Module Federation is an architectural pattern for decomposing JavaScript applications. Similar to server-side microservices, it lets multiple JavaScript applications (or micro-frontends) share code and resources. The Rspack team works closely with the Module Federation maintainers to deliver first-class support. @@ -25,14 +25,14 @@ Module Federation (MF) currently offers multiple major versions; choose the one The key characteristics of each version are: -| Version | Description | Features | Use Cases | -| ------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | -| MF v2.0 | Enhanced version of Module Federation, implemented based on Module Federation v1.5 | - Provides additional out-of-the-box features such as dynamic TS type hints, Chrome DevTools, preloading, etc.
- Better suited for micro-frontend architecture supporting large-scale web applications
- Includes all features of Module Federation 1.5
| Projects that need to use advanced capabilities of MF 2.0 | -| MF v1.5 | Version built into Rspack | - Supports module export, module loading, dependency sharing capabilities of Module Federation v1.0
- Added runtime plugin functionality, enabling users to extend the behavior and functionality of module federation
| Projects that don't need to use the extra capabilities of MF 2.0 | +| Version | Description | Features | Use Cases | +| ------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | +| MF v2.0 | Enhanced version of Module Federation, built on Module Federation v1.5 | - Provides additional out-of-the-box features such as dynamic TS type hints, Chrome DevTools, preloading, etc.
- Better suited for micro-frontend architecture supporting large-scale web applications
- Includes all features of Module Federation 1.5
| Projects that need MF 2.0's advanced capabilities | +| MF v1.5 | Version built into Rspack | - Supports module export, module loading, dependency sharing capabilities of Module Federation v1.0
- Added runtime plugin functionality, enabling users to extend the behavior and functionality of module federation
| Projects that don't need the extra capabilities of MF 2.0 | ### Module Federation v2.0 -[Module Federation 2.0](https://module-federation.io/blog/announcement.html) provides additional out-of-the-box features based on Module Federation, such as dynamic TS type hints, Chrome devtools, Runtime plugins, and preloading, which makes Module Federation better suited for micro-frontend architecture supporting large-scale web applications. Module Federation v2.0 is implemented based on v1.5. +[Module Federation 2.0](https://module-federation.io/blog/announcement.html) provides additional out-of-the-box features based on Module Federation, such as dynamic TS type hints, Chrome devtools, Runtime plugins, and preloading, making it better suited for large-scale micro-frontend architectures. You need to install the additional [@module-federation/rsbuild-plugin](https://npmjs.com/package/@module-federation/rsbuild-plugin) plugin to use Module Federation v2.0. diff --git a/website/docs/en/guide/start/features.mdx b/website/docs/en/guide/start/features.mdx index d8f0c65640..a642387c5f 100644 --- a/website/docs/en/guide/start/features.mdx +++ b/website/docs/en/guide/start/features.mdx @@ -4,24 +4,24 @@ All the main features that Rsbuild supports. ## JavaScript -| Features | Description | Links | -| -------------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| Rspack | Use Rspack as the bundler by default | | -| SWC compilation | Transform and minify JavaScript and TypeScript code using SWC by default | | -| TS compilation | TypeScript files are compiled using SWC by default | | -| Code minification | Code minification is enabled by default in production mode | | -| Polyfill injection | Optional feature, inject core-js and other polyfills | | -| SourceMap generation | Source maps are generated in development mode by default | | -| Alias | Optional feature, set import alias | | -| Babel compilation | Optional feature, use Babel to transform JavaScript and TypeScript code | | -| Node outputs | Optional feature, build bundles that run in Node.js environment | | -| Web Workers | Optional feature, use Web Workers | | -| Browserslist | Optional feature, use browserslist to specify which browsers should be supported in your web application. | | -| Compatibility check | Optional feature, analyze if there are incompatible advanced syntax in the outputs within the current browser scope | | -| Environment variable | Optional feature, inject environment variables or expressions into the code | | -| Node polyfill | Optional feature, inject polyfills for Node core modules on the browser side | | -| Type check | Optional feature, run type checker to check for type issues in code | | -| Module Federation | Optional feature, dynamically load modules and share dependencies | | +| Features | Description | Links | +| -------------------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| Rspack | Use Rspack as the bundler by default | | +| SWC compilation | Transform and minify JavaScript and TypeScript code using SWC by default | | +| TS compilation | TypeScript files are compiled using SWC by default | | +| Code minification | Code minification is enabled by default in production mode | | +| Polyfill injection | Optional feature, inject core-js and other polyfills | | +| SourceMap generation | Source maps are generated in development mode by default | | +| Alias | Optional feature, set import alias | | +| Babel compilation | Optional feature, use Babel to transform JavaScript and TypeScript code | | +| Node outputs | Optional feature, build bundles that run in Node.js environment | | +| Web Workers | Optional feature, use Web Workers | | +| Browserslist | Optional feature, use browserslist to specify which browsers should be supported in your web application. | | +| Compatibility check | Optional feature, scan build outputs for advanced syntax that isn't supported by the target browsers | | +| Environment variable | Optional feature, inject environment variables or expressions into the code | | +| Node polyfill | Optional feature, inject polyfills for Node core modules on the browser side | | +| Type check | Optional feature, run type checker to check for type issues in code | | +| Module Federation | Optional feature, dynamically load modules and share dependencies | | ## CSS @@ -54,14 +54,14 @@ All the main features that Rsbuild supports. ## Server -| Features | Description | Links | -| ----------------- | ------------------------------------------------------------------------------ | --------------------------------------------------------------- | -| Public dir | Use the public directory as the directory for serving public assets by default | | -| SSR | Optional feature, implement server-side rendering | | -| Proxy | Optional feature, proxy requests to the specified service | | -| Open page | Optional feature, automatically open page in browser when starting server | | -| HTTPS | Optional feature, enable HTTPS server | | -| Custom middleware | Optional feature, use custom middleware | | +| Features | Description | Links | +| ----------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------- | +| Public dir | Serves public assets from the `public` directory by default | | +| SSR | Optional feature, implement server-side rendering | | +| Proxy | Optional feature, proxy requests to the specified service | | +| Open page | Optional feature, automatically open page in browser when starting server | | +| HTTPS | Optional feature, enable HTTPS server | | +| Custom middleware | Optional feature, use custom middleware | | ## UI framework @@ -81,12 +81,12 @@ All the main features that Rsbuild supports. | Features | Description | Links | | ---------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| Image assets | Support for import image assets in code | | -| Font assets | Support for import font assets in code | | -| Video assets | Support for import video assets in code | | -| Wasm assets | Support for import WebAssembly assets in code | | -| Node addons | Support for import Node.js addons in code | | -| Inline static assets | Small assets are inlined into JS by default | | +| Image assets | Support importing image assets in code | | +| Font assets | Support importing font assets in code | | +| Video assets | Support importing video assets in code | | +| Wasm assets | Support importing WebAssembly assets in code | | +| Node addons | Support importing Node.js addons in code | | +| Inline static assets | Small assets are inlined into JavaScript bundles by default | | | Clean up static assets | Automatically clean up static assets in the dist directory before each build | | | Copy static assets | Optional feature, copy static assets to the dist directory | | | Generate manifest file | Optional feature, generate `manifest.json` file | | @@ -104,7 +104,7 @@ All the main features that Rsbuild supports. | Dedupe packages | Optional feature, remove duplicate npm packages | | | Component on-demand import | Optional feature, selectively import code and styles from component libraries | | | Image compression | Optional feature, compress used image resources | | -| Preload | Optional feature, preemptively fetch and cache the target resource for current navigation | | -| Prefetch | Optional feature, preemptively fetch and cache the target resource for a followup navigation | | -| Preconnect | Optional feature, preemptively connect to the target resource's origin | | +| Preload | Optional feature, fetches and caches a resource ahead of the current navigation | | +| Prefetch | Optional feature, fetches and caches a resource for an upcoming navigation | | +| Preconnect | Optional feature, opens a connection to the resource's origin before it's needed | | | DNS prefetch | Optional feature, preemptively perform DNS resolution for the target resource's origin | | From 4a03083d85caca7de2c30dcbb65d09ce2242edcc Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 16 Nov 2025 16:17:17 +0800 Subject: [PATCH 2/2] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- website/docs/en/guide/advanced/module-federation.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/en/guide/advanced/module-federation.mdx b/website/docs/en/guide/advanced/module-federation.mdx index e0ab239daf..183f085d6d 100644 --- a/website/docs/en/guide/advanced/module-federation.mdx +++ b/website/docs/en/guide/advanced/module-federation.mdx @@ -32,7 +32,7 @@ The key characteristics of each version are: ### Module Federation v2.0 -[Module Federation 2.0](https://module-federation.io/blog/announcement.html) provides additional out-of-the-box features based on Module Federation, such as dynamic TS type hints, Chrome devtools, Runtime plugins, and preloading, making it better suited for large-scale micro-frontend architectures. +[Module Federation 2.0](https://module-federation.io/blog/announcement.html) provides additional out-of-the-box features based on Module Federation, such as dynamic TS type hints, Chrome DevTools, Runtime plugins, and preloading, making it better suited for large-scale micro-frontend architectures. You need to install the additional [@module-federation/rsbuild-plugin](https://npmjs.com/package/@module-federation/rsbuild-plugin) plugin to use Module Federation v2.0.