Skip to content

Commit cfb74ed

Browse files
authored
refactor: add plugin menu in top menulist (#6199)
1 parent a20b0d2 commit cfb74ed

Some content is hidden

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

63 files changed

+250
-171
lines changed

packages/document/main-doc/docs/en/_meta.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,26 @@
44
"link": "/guides/get-started/introduction",
55
"activeMatch": "/guides/"
66
},
7-
{
8-
"text": "tutorials",
9-
"link": "/tutorials/foundations/introduction",
10-
"activeMatch": "/tutorials/"
11-
},
127
{
138
"text": "configure",
149
"link": "/configure/app/usage",
1510
"activeMatch": "/configure/"
1611
},
12+
{
13+
"text": "plugin-menu",
14+
"link": "/plugin/introduction",
15+
"activeMatch": "/plugin/"
16+
},
1717
{
1818
"text": "apis",
1919
"link": "/apis/app/commands",
2020
"activeMatch": "/apis/"
2121
},
22+
{
23+
"text": "tutorials",
24+
"link": "/tutorials/foundations/introduction",
25+
"activeMatch": "/tutorials/"
26+
},
2227
{
2328
"text": "community",
2429
"link": "/community/showcase",

packages/document/main-doc/docs/en/community/blog/v2-release-note.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Modern.js 可以划分为三个核心部分:**CLI 工具、服务端和运行
132132

133133
在字节跳动内部,我们借助这些插件 API,结合公司内的基建和平台,封装出内部的企业级框架。如果你需要对 Modern.js 框架进行深度定制,也可以借助这些插件 API 来完成。
134134

135-
> 如果你对 Modern.js 的插件系统感兴趣,请阅读 [「Modern.js - 自定义插件」](https://modernjs.dev/guides/topic-detail/framework-plugin/introduction.html)文档。
135+
> 如果你对 Modern.js 的插件系统感兴趣,请阅读 [「Modern.js - 自定义插件」](https://modernjs.dev/plugin/plugin-system/introduction.html)文档。
136136
137137
### 嵌套路由
138138

packages/document/main-doc/docs/en/components/other-plugins.mdx

Whitespace-only changes.

packages/document/main-doc/docs/en/configure/app/plugins.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_position: 9
99

1010
Used to configure custom Modern.js framework plugins.
1111

12-
Refer to [How to Develop Plugins](/guides/topic-detail/framework-plugin/implement) for how to write custom plugins.
12+
Refer to [How to Develop Plugins](/plugin/plugin-system/implement) for how to write custom plugins.
1313

1414
## Note
1515

@@ -33,7 +33,7 @@ Currently, Modern.js has opened up the ability to customize CLI plugins, and Ser
3333

3434
By default, custom plugins are executed in the order of the `plugins` array, and the execution time of built-in Modern.js plugins is earlier than that of custom plugins.
3535

36-
When the plugin sets options that control the order, such as `pre` and `post`, the execution order will be adjusted based on the declared fields. Refer to [Relationship between plugins](/guides/topic-detail/framework-plugin/relationship) for more information.
36+
When the plugin sets options that control the order, such as `pre` and `post`, the execution order will be adjusted based on the declared fields. Refer to [Relationship between plugins](/plugin/plugin-system/relationship) for more information.
3737

3838
## Example
3939

packages/document/main-doc/docs/en/configure/app/tools/esbuild.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ export default defineConfig({
4141
});
4242
```
4343

44-
For config details, please refer to [Esbuild Plugin Configuration](/guides/rsbuild-plugins/plugin-esbuild.html#config).
44+
For config details, please refer to [Esbuild Plugin Configuration](/plugin/rsbuild-plugins/plugin-esbuild.html#config).

packages/document/main-doc/docs/en/configure/app/tools/swc.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ export default defineConfig({
7777
});
7878
```
7979

80-
For config details, please refer to [SWC Plugin Configuration](/guides/rsbuild-plugins/plugin-swc.html#config).
80+
For config details, please refer to [SWC Plugin Configuration](/plugin/cli-plugins/plugin-swc.html#config).

packages/document/main-doc/docs/en/guides/_meta.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
"name": "topic-detail",
2525
"label": "topic"
2626
},
27-
{
28-
"type": "dir",
29-
"name": "rsbuild-plugins",
30-
"label": "Rsbuild Plugins"
31-
},
3227
{
3328
"type": "dir",
3429
"name": "troubleshooting",

packages/document/main-doc/docs/en/guides/advanced-features/build-performance.mdx

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ The strategies in [Bundle Size Optimization](/guides/advanced-features/page-perf
1616

1717
The following are some general optimization strategies, which can speed up the development build and production build, and some of them also optimize the bundle size.
1818

19+
### Using Rspack (recommended)
20+
21+
If you are not using Rspack yet, you can switch to Rspack build mode to improve the build speed by 5~10 times, see [Using Rspack](/guides/advanced-features/rspack-start.html) for more information.
22+
1923
### Upgrade Node.js version
2024

2125
In general, updating Node.js to the latest [LTS release](https://github.com/nodejs/release#release-schedule) will help improve build performance.
@@ -40,25 +44,6 @@ nvm default 18
4044
node -v
4145
```
4246

43-
### Using Rspack build
44-
45-
If you have higher build performance requirements, you can easily switch to Rspack build mode, see [Using Rspack](/guides/advanced-features/rspack-start.html) for more information.
46-
47-
### Using SWC or esbuild
48-
49-
[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.
50-
51-
[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.
52-
53-
Modern.js provides SWC plugin and esbuild plugin that allow you to use SWC or esbuild instead of babel-loader, ts-loader and terser for transformation and minification process. See:
54-
55-
- [SWC plugin document](/configure/app/tools/swc.html)
56-
- [esbuild plugin document](/configure/app/tools/esbuild.html)
57-
58-
:::tip SWC vs esbuild
59-
The SWC compiled outputs has better compatibility, supports polyfills such as core-js, and has more complete features, so it is recommended to use the SWC plugin first.
60-
:::
61-
6247
### Avoid using ts-loader
6348

6449
By default, Modern.js uses Babel to compile TS files. After enabling the [tools.tsLoader](/en/configure/app/tools/ts-loader.html) option, `ts-loader` will be used to compile TS files.

packages/document/main-doc/docs/en/guides/topic-detail/_meta.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
"label": "micro-frontend",
66
"collapsed": true
77
},
8-
{
9-
"type": "dir",
10-
"name": "framework-plugin",
11-
"label": "framework-plugin",
12-
"collapsed": true
13-
},
148
{
159
"type": "dir",
1610
"name": "model",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[
2+
"introduction",
3+
{
4+
"type": "dir",
5+
"name": "plugin-system",
6+
"label": "plugin-system",
7+
"collapsed": true
8+
},
9+
{
10+
"type": "dir",
11+
"name": "cli-plugins",
12+
"label": "cli-plugins"
13+
},
14+
{
15+
"type": "dir",
16+
"name": "rsbuild-plugins",
17+
"label": "rsbuild-plugins"
18+
}
19+
]

0 commit comments

Comments
 (0)