Skip to content

Commit e3a8dd1

Browse files
authored
docs(main): add glossary page (#3667)
1 parent 8a3a2e5 commit e3a8dd1

File tree

20 files changed

+193
-39
lines changed

20 files changed

+193
-39
lines changed

packages/document/builder-doc/docs/en/guide/glossary.mdx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,21 @@
22

33
## Bundler
44

5-
Refers to module bundlers such as `webpack`, `Rspack`.
5+
import Bundler from '@en/shared/bundler.md';
66

7-
The main goal of bundlers is to bundle JavaScript, CSS and other files together, and the bundled files can be used in the browser, Node.js or other environments. When bundler processes the Web application, it builds a dependency graph and then combines every module into one or more bundles.
8-
9-
## Rspack
10-
11-
[Rspack](https://www.rspack.dev/) is a high performance Rust-based JavaScript bundler that offers strong interoperability with the webpack ecosystem, enabling faster development cycles and efficient collaboration between the two tools.
7+
<Bundler />
128

139
## Builder
1410

15-
Build Engine. The goal of Builder is to "reuse the best practices of build tools".
11+
import Builder from '@en/shared/builder.md';
1612

17-
Bundlers are low-level, if we build a project based on webpack, we need to fully understand the webpack config and many webpack plugins and loaders, then spend a lot of time to combine them.
13+
<Builder />
1814

19-
Builder is a out-of-box build tools. By using Builder, you can quickly gain the ability to build a web application.
15+
## Rspack
2016

21-
The layers inside the Builder are as follows:
17+
import Rspack from '@en/shared/rspack.md';
2218

23-
![](https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/builder-struct-10092.png)
19+
<Rspack />
2420

2521
## Builder Provider
2622

packages/document/builder-doc/docs/en/plugins/plugin-esbuild.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Esbuild Plugin
22

3-
[esbuild](https://esbuild.github.io/) is a front-end build tool based on Golang. It has the functions of bundling, compiling and minimizing JavaScript code. Compared with traditional tools, the performance is significantly improved. When minimizing code, compared to webpack's built-in terser minimizer, esbuild has dozens of times better performance.
3+
import Esbuild from '@en/shared/esbuild.md';
44

5-
Builder provides esbuild plugin that allow you to use esbuild instead of babel-loader, ts-loader and terser for transformation and minification process. When you enable esbuild in a large project, **it can greatly reduce the time required for code compilation and compression, while effectively avoiding OOM (heap out of memory) problems**.
5+
<Esbuild />
66

77
:::tip Recommend using SWC
88
We recommend using SWC to transform and minify code rather than esbuild, because SWC supports more syntaxes, provides better code compression, and the compiled code has better compatibility.

packages/document/builder-doc/docs/en/plugins/plugin-swc.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# SWC Plugin
22

3-
[SWC](https://SWC.rs/) (Speedy Web Compiler) is a transformer and minimizer for JavaScript and TypeScript based on `Rust`. SWC can provide the same abilities with Babel, and it's more than 10x faster than Babel.
3+
import SWC from '@en/shared/swc.md';
44

5-
Modern.js Builder has a out-of-box plugin for SWC, power your Web application with Polyfill and minification, we also port some common used Babel plugins to SWC.
5+
<SWC />
66

77
## Quick Start
88

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Refers to the build engine. The goal of Builder is to "reuse the best practices of build tools".
2+
3+
Bundlers are low-level, when we build a project based on webpack, we need to fully understand the webpack config and many webpack plugins and loaders, then spend a lot of time to combine them.
4+
5+
Builder is out-of-box. By using Builder, you can quickly gain the ability to build a web application.
6+
7+
The layers within the Modern.js Builder are as follows:
8+
9+
![](https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/builder-struct-10092.png)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Refers to module bundlers such as [webpack](https://webpack.js.org/), [Rspack](https://www.rspack.dev/).
2+
3+
The main goal of bundlers is to bundle JavaScript, CSS and other files together, and the bundled files can be used in the browser, Node.js or other environments. When bundler processes the Web application, it builds a dependency graph and then combines every module into one or more bundles.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[esbuild](https://esbuild.github.io/) is a front-end build tool based on Golang. It has the functions of bundling, compiling and minimizing JavaScript code. Compared with traditional tools, the performance is significantly improved. When minimizing code, compared to webpack's built-in terser minimizer, esbuild has dozens of times better performance.
2+
3+
Modern.js Builder provides esbuild plugin that allow you to use esbuild instead of babel-loader, ts-loader and terser for transformation and minification process. When you enable esbuild in a large project, **it can greatly reduce the time required for code compilation and compression, while effectively avoiding OOM (heap out of memory) problems**.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[SWC](https://SWC.rs/) (Speedy Web Compiler) is a transformer and minimizer for JavaScript and TypeScript based on `Rust`. SWC can provide the same abilities with Babel, and it's more than 10x faster than Babel.
2+
3+
Modern.js Builder has a out-of-box plugin for SWC, power your Web application with Polyfill and minification, we also port some common used Babel plugins to SWC.

packages/document/builder-doc/docs/zh/guide/glossary.mdx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,21 @@
22

33
## Bundler
44

5-
`webpack``Rspack` 等模块打包工具。
5+
import Bundler from '@zh/shared/bundler.md';
66

7-
打包工具的主要目标是将 JavaScript、CSS 等文件打包在一起,打包后的文件可以在浏览器、Node.js 等环境中使用。当 Bundler 处理 Web 应用时,它会构建一个依赖关系图,其中包含应用需要的各个模块,然后将所有模块打包成一个或多个 bundle。
8-
9-
## Rspack
10-
11-
[Rspack](https://www.rspack.dev/) 是一个基于 Rust 的高性能 Web 构建工具,具备与 Webpack 生态系统的互操作性,可以被 Webpack 项目低成本集成,并提供更好的构建性能。
7+
<Bundler />
128

139
## Builder
1410

15-
Builder 可以翻译为「构建引擎」,Builder 的目标是「复用构建工具的最佳实践」。
11+
import Builder from '@zh/shared/builder.md';
1612

17-
因为 webpack 等 Bundler 是比较底层的,如果我们基于 webpack 来构建一个项目,需要充分理解 webpack 的各个配置项和三方插件,并进行大量的配置组装和性能调优等工作。
13+
<Builder />
1814

19-
Builder 比 Bundler 的封装程度更高,默认集成代码转换、代码压缩等能力。通过接入 Builder,可以快速获得构建 Web 应用的能力。
15+
## Rspack
2016

21-
Builder 内部的分层如下:
17+
import Rspack from '@zh/shared/rspack.md';
2218

23-
![](https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/builder-struct-10092.png)
19+
<Rspack />
2420

2521
## Builder Provider
2622

packages/document/builder-doc/docs/zh/plugins/plugin-esbuild.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Esbuild 插件
22

3-
[esbuild](https://esbuild.github.io/) 是一款基于 Golang 开发的前端构建工具,具有打包、编译和压缩 JavaScript 代码的功能,相比传统的打包编译工具,esbuild 在性能上有显著提升。在代码压缩方面,相比 webpack 内置的 terser 压缩器,esbuild 在性能上有数十倍的提升。
3+
import Esbuild from '@zh/shared/esbuild.md';
44

5-
Builder 提供了 esbuild 插件,让你能使用 esbuild 代替 babel-loader、ts-loader 和 terser 等库进行代码编译和压缩。在大型工程中启用 esbuild 后,**可以大幅度减少代码编译和压缩所需的时间,同时有效避免 OOM (heap out of memory) 问题**
5+
<Esbuild />
66

77
:::tip 推荐使用 SWC
88
相较于 esbuild,我们更推荐使用 SWC 来编译和压缩代码,因为 SWC 支持更多的语法特性、提供更好的代码压缩能力,并且产物具备更好的兼容性。

packages/document/builder-doc/docs/zh/plugins/plugin-swc.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# SWC 插件
22

3-
[SWC](https://swc.rs/) (Speedy Web Compiler) 是基于 `Rust` 语言编写的高性能 JavaScript 和 TypeScript 转译和压缩工具。在 Polyfill 和语法降级方面可以和 Babel 提供一致的能力,并且性能比 Babel 高出一个数量级。
3+
import SWC from '@zh/shared/swc.md';
44

5-
Modern.js Builder 提供了开箱即用的 SWC 插件,可以为你的 Web 应用提供语法降级、Polyfill 以及压缩,并且移植了一些额外常见的 Babel 插件。
5+
<SWC />
66

77
## 快速开始
88

0 commit comments

Comments
 (0)