@modern-js/main-doc 2.22.0 → 2.22.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/docs/en/components/debug-app.mdx +1 -1
  3. package/docs/en/components/deploy.mdx +1 -0
  4. package/docs/en/components/entry-mode.mdx +0 -0
  5. package/docs/en/components/init-app.mdx +3 -7
  6. package/docs/en/components/release-note.mdx +1 -0
  7. package/docs/en/configure/app/output/css-modules.mdx +13 -0
  8. package/docs/en/configure/app/tools/swc.mdx +2 -16
  9. package/docs/en/guides/advanced-features/rspack-start.mdx +1 -2
  10. package/docs/en/guides/concept/builder.mdx +15 -15
  11. package/docs/en/guides/concept/entries.mdx +47 -46
  12. package/docs/en/guides/get-started/glossary.mdx +12 -12
  13. package/docs/en/guides/get-started/introduction.mdx +17 -20
  14. package/docs/en/guides/get-started/quick-start.mdx +21 -37
  15. package/docs/en/guides/get-started/upgrade.mdx +15 -13
  16. package/docs/en/guides/topic-detail/changesets/_category_.json +4 -0
  17. package/docs/en/guides/topic-detail/changesets/add.mdx +125 -0
  18. package/docs/en/guides/topic-detail/changesets/changelog.mdx +238 -0
  19. package/docs/en/guides/topic-detail/changesets/commit.mdx +269 -0
  20. package/docs/en/guides/topic-detail/changesets/config.mdx +147 -0
  21. package/docs/en/guides/topic-detail/changesets/github.mdx +175 -0
  22. package/docs/en/guides/topic-detail/changesets/introduce.mdx +56 -0
  23. package/docs/en/guides/topic-detail/changesets/release-note.mdx +273 -0
  24. package/docs/en/guides/topic-detail/changesets/release-pre.mdx +49 -0
  25. package/docs/en/guides/topic-detail/changesets/release.mdx +229 -0
  26. package/docs/en/guides/troubleshooting/builder.mdx +8 -0
  27. package/docs/zh/community/blog/v2-release-note.mdx +1 -1
  28. package/docs/zh/community/contributing-guide.mdx +1 -1
  29. package/docs/zh/components/entry-mode.mdx +0 -0
  30. package/docs/zh/components/init-app.mdx +5 -9
  31. package/docs/zh/configure/app/output/css-modules.mdx +13 -0
  32. package/docs/zh/configure/app/tools/swc.mdx +2 -16
  33. package/docs/zh/guides/advanced-features/rspack-start.mdx +1 -2
  34. package/docs/zh/guides/concept/builder.mdx +1 -1
  35. package/docs/zh/guides/concept/entries.mdx +18 -14
  36. package/docs/zh/guides/get-started/quick-start.mdx +7 -10
  37. package/docs/zh/guides/get-started/upgrade.mdx +1 -1
  38. package/docs/zh/guides/topic-detail/changesets/add.mdx +15 -13
  39. package/docs/zh/guides/topic-detail/changesets/changelog.mdx +20 -20
  40. package/docs/zh/guides/topic-detail/changesets/commit.mdx +12 -14
  41. package/docs/zh/guides/topic-detail/changesets/config.mdx +5 -5
  42. package/docs/zh/guides/topic-detail/changesets/github.mdx +38 -27
  43. package/docs/zh/guides/topic-detail/changesets/introduce.mdx +12 -12
  44. package/docs/zh/guides/topic-detail/changesets/release-note.mdx +84 -70
  45. package/docs/zh/guides/topic-detail/changesets/release-pre.mdx +9 -9
  46. package/docs/zh/guides/topic-detail/changesets/release.mdx +29 -29
  47. package/docs/zh/guides/troubleshooting/builder.mdx +8 -0
  48. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @modern-js/main-doc
2
2
 
3
+ ## 2.22.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 411d047: docs: fix reset command
8
+
9
+ docs: 修复 reset command 翻译问题
10
+
11
+ - bce7a12: docs(main): update concept doc
12
+
13
+ docs(main): 更新核心概念文档
14
+
15
+ - 2ede584: docs(main): update start doc
16
+
17
+ docs(main): 更新开始文档
18
+
19
+ - 7267a1a: docs(main): update changeset doc
20
+
21
+ docs(main): 更新包版本管理文档
22
+
23
+ - Updated dependencies [bd4b150]
24
+ - Updated dependencies [2ede584]
25
+ - @modern-js/builder-doc@2.22.1
26
+
3
27
  ## 2.22.0
4
28
 
5
29
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- Execute `pnpm run dev` in the project to start the project:
1
+ Run `pnpm run dev` in the project to start the project:
2
2
 
3
3
  ```bash
4
4
  $ pnpm run dev
@@ -0,0 +1 @@
1
+ After local verification, you can organize the artifacts in `dist/` into the structure required by the server for deployment.
File without changes
@@ -1,12 +1,13 @@
1
- Modern.js generator will provide an interactive Q & A interface, initialization items according to the result, according to the default selection:
1
+ `@modern-js/create` provides an interactive Q & A interface to initialize the project based on the results, with initialization performed according to the default settings:
2
2
 
3
3
  ```bash
4
4
  ? Please select the type of project you want to create: Web App
5
5
  ? Please select the programming language: TS
6
6
  ? Please select the package manager: pnpm
7
+ ? Please select the bundler: webpack
7
8
  ```
8
9
 
9
- After create the project, Modern.js automatically installs dependency and creates a git repository.
10
+ After create the project, Modern.js will automatically install dependencies and create a git repository.
10
11
 
11
12
  ```bash
12
13
  [INFO] dependencies are automatically installed
@@ -20,11 +21,6 @@ pnpm run lint # Run ESLint and automatically fix problems
20
21
  pnpm run new # Enable optional features or add a new entry
21
22
  ```
22
23
 
23
- :::note
24
- In addition to working during project initialization, the Modern.js generator can also generate modules of the project in subsequent development, which is not thrown away as soon as it is used.
25
-
26
- :::
27
-
28
24
  Now, the project structure is as follows:
29
25
 
30
26
  ```
@@ -0,0 +1 @@
1
+ According to the [Release Note](https://github.com/web-infra-dev/modern.js/releases) on the official website, developers can also manually upgrade the project to the desired version.
@@ -0,0 +1,13 @@
1
+ ---
2
+ sidebar_label: cssModules
3
+ ---
4
+
5
+ # output.cssModules
6
+
7
+ :::tip
8
+ This config is provided by Modern.js Builder, more detail can see [output.cssModules](https://modernjs.dev/builder/en/api/config-output.html#outputcssmodules).
9
+ :::
10
+
11
+ import Main from '@modern-js/builder-doc/docs/en/config/output/cssModules.md';
12
+
13
+ <Main />
@@ -19,23 +19,9 @@ When using Rspack as the bundler, SWC will be used for transpiling and compressi
19
19
 
20
20
  ## Install
21
21
 
22
- First, you need to execute `pnpm run new` to enable the SWC compile:
22
+ import EnableSWC from '@modern-js/builder-doc/docs/en/shared/enable-swc.md';
23
23
 
24
- ```bash
25
- ? Please select the operation you want: Enable features
26
- ? Please select the feature name: Enable SWC Compile
27
- ```
28
-
29
- After the installation, please register the SWC plugin in the `modern.config.ts` file, then the SWC compilation and compression will be enabled.
30
-
31
- ```ts title="modern.config.ts"
32
- import appTools, { defineConfig } from '@modern-js/app-tools';
33
- import swcPlugin from '@modern-js/plugin-swc';
34
-
35
- export default defineConfig({
36
- plugins: [appTools(), swcPlugin()],
37
- });
38
- ```
24
+ <EnableSWC />
39
25
 
40
26
  ## Config
41
27
 
@@ -81,8 +81,7 @@ For example, if you are using pnpm, you can update the Rspack version with `over
81
81
  "@rspack/core": "nightly",
82
82
  "@rspack/dev-client": "nightly",
83
83
  "@rspack/dev-middleware": "nightly",
84
- "@rspack/plugin-html": "nightly",
85
- "@rspack/postcss-loader": "nightly"
84
+ "@rspack/plugin-html": "nightly"
86
85
  }
87
86
  }
88
87
  }
@@ -4,31 +4,31 @@ sidebar_position: 2
4
4
 
5
5
  # Builder
6
6
 
7
- **Modern.js uses [Modern.js Builder](https://modernjs.dev/builder) to build your Web App.**
7
+ **Modern.js uses [Modern.js Builder](https://modernjs.dev/builder/en) to build your Web App.**
8
8
 
9
- Modern.js Builder is one of the core components of Modern.js. It is A build engine for web development. and can be used independently of Modern.js. Modern.js Builder supports multiple bundlers such as webpack and Rspack, and it uses webpack by default.
9
+ Modern.js Builder is one of the core components of the Modern.js system. It is a build engine for web development scenarios that can be used independently of Modern.js. Modern.js Builder supports multiple bundlers such as webpack and Rspack, and by default uses the most mature webpack for bundling.
10
10
 
11
11
  ## Build Architecture
12
12
 
13
- From the perspective of building, Modern.js is divided into three layers, from top to bottom:
13
+ From a building perspective, Modern.js is divided into three layers, from top to bottom:
14
14
 
15
- - Upper-layer framework: Modern.js.
16
- - Universal build engine: Modern.js Builder.
17
- - Low-level bundlers: webpack and rspack.
15
+ - Upper-level development framework: Modern.js.
16
+ - Common build engine: Modern.js Builder.
17
+ - Low-level bundler: webpack and Rspack.
18
18
 
19
19
  <img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/builder-layers-1117.png" style={{ width: '100%', maxWidth: '540px' }} />
20
20
 
21
21
  ## Builder Documentation
22
22
 
23
- Since Modern.js Builder is a module that can be used independently, we provide a separate document for it, the site address is: [modernjs.dev/builder](https://modernjs.dev/builder).
23
+ Since Modern.js Builder is a module that can be used independently, we have provided separate documentation for it, which can be found at [modernjs.dev/builder](https://modernjs.dev/builder/en).
24
24
 
25
- In this document, you can learn about the detailed introduction of Modern.js Builder, and you can also find a complete usage guide for each building features. When you encounter building issues, it is recommended that you first read the Modern.js Builder documentation to solve them.
25
+ In this documentation, you can learn about the detailed introduction of Modern.js Builder, and you can also find complete usage guides for various building capabilities. If you have any building needs or problems, it is recommended that you read the Modern.js Builder documentation first to solve them.
26
26
 
27
- ## Builder Config
27
+ ## Builder Configuration
28
28
 
29
- The config of Modern.js is inherited from Modern.js Builder, so you can use all build configs provided by Modern.js Builder in Modern.js.
29
+ Modern.js's configuration inherits from Modern.js Builder, so you can use all the build configurations provided by Modern.js Builder in Modern.js.
30
30
 
31
- Take the `html.title` config of Modern.js Builder as an example, you can directly use this config in the `modern.config.ts` file, and it will be automatically passed to Modern.js Builder.
31
+ Taking the `html.title` config option of Modern.js Builder as an example, you can directly use this option in the `modern.config.ts` file, and it will be automatically passed to Modern.js Builder.
32
32
 
33
33
  ```ts title="modern.config.js"
34
34
  export default defineConfig({
@@ -38,10 +38,10 @@ export default defineConfig({
38
38
  });
39
39
  ```
40
40
 
41
- For details of building configs, please refer to [「Modern.js Builder - Builder Config」](https://modernjs.dev/builder/en/guide/basic/builder-config.html).
41
+ For detailed information about build configuration, please refer to [「Modern.js Builder - Builder Config」](https://modernjs.dev/builder/en/guide/basic/builder-config.html).
42
42
 
43
- ## Building Features
43
+ ## Builder Capabilities
44
44
 
45
- Modern.js Builder provides a wealth of building features, including dozens of features such as JavaScript compilation, CSS compilation, static resource processing, hot module replacement, code compression, and TS type checking.
45
+ Modern.js Builder provides rich build capabilities, including JavaScript compilation, CSS compilation, static resource processing, code hot update, code compression, TS type checking, and dozens of other capabilities.
46
46
 
47
- We recommend you to read [「Modern.js Builder - All Features」](https://modernjs.dev/builder/en/guide/features.html) to learn all the building features provided by Modern.js Builder.
47
+ We recommend that you read [「Modern.js Builder - All Features」](https://modernjs.dev/builder/en/guide/features.html) to learn about all the features provided by Modern.js Builder.
@@ -2,21 +2,21 @@
2
2
  sidebar_position: 1
3
3
  ---
4
4
 
5
- # Entries
5
+ # Entry
6
6
 
7
- Through this chapter, you can learn about the entry convention in Modern.js and how to customize the entry.
7
+ In this chapter, you will learn about the entry convention in Modern.js and how to customize it.
8
8
 
9
- ## What is an Entry
9
+ ## What is Entry?
10
10
 
11
- **Entry is the starting module of a page.**
11
+ **Entry refers to the starting module of a page.**
12
12
 
13
- In the Modern.js project, each entry corresponds to an independent page, and also corresponds to a server route. By default, Modern.js will automatically determine the entry of the page based on the directory convention, and also supports customizing the entry through configuration items.
13
+ In a Modern.js project, each entry corresponds to an independent page and a server-side route. By default, Modern.js automatically determines the entry of a page based on directory conventions, but also supports customizing the entry through configuration options.
14
14
 
15
- Many configuration items provided by Modern.js are divided by entry, such as page title, HTML template, page Meta information, whether to enable SSR/SSG, server-side routing rules, etc.
15
+ Many configuration options provided by Modern.js are divided by entry, such as page title, HTML template, page meta information, whether to enable SSR/SSG, server-side routing rules, etc.
16
16
 
17
17
  ## Single Entry and Multiple Entries
18
18
 
19
- The project initialized by Modern.js is single-entry (SPA), and the project structure is as follows:
19
+ The project initialized by Modern.js is a single entry (SPA) project, with the following structure:
20
20
 
21
21
  ```
22
22
  .
@@ -30,7 +30,7 @@ The project initialized by Modern.js is single-entry (SPA), and the project stru
30
30
  └── tsconfig.json
31
31
  ```
32
32
 
33
- Modern.js can easily switch from single entry to multiple entry. You can execute `pnpm run new` under the project to create entry through generator:
33
+ In a Modern.js project, you can easily switch from single entry to multiple entries by running `pnpm run new` in the project directory and creating an entry:
34
34
 
35
35
  ```bash
36
36
  ? Please select the operation you want: Create Element
@@ -38,7 +38,7 @@ Modern.js can easily switch from single entry to multiple entry. You can execute
38
38
  ? Please fill in the entry name: new-entry
39
39
  ```
40
40
 
41
- After execution, Modern.js will automatically generate a new entry directory, and you can see that the `src/` directory has the following structure:
41
+ After running the command, Modern.js will automatically generate a new entry directory. At this point, you can see that the `src/` directory has the following structure:
42
42
 
43
43
  ```bash
44
44
  .
@@ -54,51 +54,55 @@ After execution, Modern.js will automatically generate a new entry directory, an
54
54
  └── page.tsx
55
55
  ```
56
56
 
57
- The original code was moved to the directory with the same name as the `name` in the `package.json`, and a new directory was created.
57
+ The original entry code has been moved to a directory with the same name as the `name` field in `package.json`, and a `new-entry` entry directory has been created.
58
58
 
59
- After executing `pnpm run dev`, you can see that a `/new-entry` route has been added, and the migrated code route has not changed.
59
+ After running `pnpm run dev`, you can see a new route named `/new-entry` has been added, and the migrated code route has not changed.
60
60
 
61
61
  :::tip
62
- Modern.js will use the entry with the same name as the `name` field in the package.json file as the main entry, the route of the main entry is `/`, and the route of other entries is `/{entryName}`.
62
+ Modern.js will use the entry with the same name as the `name` field in `package.json` as the main entry. The route of the main entry is `/`, and the route of other entries is `/{entryName}`.
63
63
 
64
- For example, when `name` in package.json is `myapp`, `src/myapp` will be used as the main entry of the project.
64
+ For example, when the `name` field in `package.json` is `myapp`, `src/myapp` will be the main entry of the project.
65
65
 
66
66
  :::
67
67
 
68
- ## Entry Type
68
+ ## Entry Types
69
69
 
70
- Different entry types have different compile and run-time behaviors. When creating a project in Modern.js, developers can manually choose to create a project in **framework mode** or **build mode**. After the creation is complete, you can see that the project template files for different modes are different.
70
+ Different entry types have different compilation and runtime behaviors.
71
71
 
72
- By default, Modern.js will scan the files under `src/` before starting the project, identify the entry, and generate the corresponding server-side route.
72
+ import EntryMode from '@site-docs-en/components/entry-mode.mdx';
73
+
74
+ <EntryMode />
75
+
76
+ By default, Modern.js scans the files under `src/` before starting the project, identifies the entry, and generates the corresponding server-side route.
73
77
 
74
78
  :::tip
75
- You can change the entry directory to another directory through [source.entriesDir](/configure/app/source/entries-dir).
79
+ You can modify the directory for entry identification by using the [source.entriesDir](/configure/app/source/entries-dir) config.
76
80
 
77
81
  :::
78
82
 
79
- Not all first-level directories under `src/` will become project entries, and the directory where the entry is located must meet one of the following four conditions:
83
+ Not all top-level directories under `src/` become project entries. The directory where the entry is located must meet one of the following four conditions:
80
84
 
81
- 1. Have a `routes/` directory
82
- 2. Has `App.[jt]sx?` file
83
- 3. Has `index.[jt]sx?` file
84
- 4. Has a `pages/` directory (Modern.js 1.0 compatible)
85
+ 1. Has a `routes/` directory.
86
+ 2. Has an `App.[jt]sx?` file.
87
+ 3. Has an `index.[jt]sx?` file.
88
+ 4. Has a `pages/` directory (compatible with Modern.js 1.0).
85
89
 
86
- When the `src/` directory meets the entry characteristics, Modern.js will consider the current project as a single-entry application.
90
+ When the `src/` directory meets the entry requirements, Modern.js considers the current project as a single entry application.
87
91
 
88
92
  :::tip
89
- In single-entry applications, the default entry is named `main`.
93
+ In a single entry application, the default entry name is `main`.
90
94
 
91
95
  :::
92
96
 
93
- When the project is not a single-entry application, Modern.js will further check the first-level directory under `src/`.
97
+ When the project is not a single entry application, Modern.js will further look at the top-level directories under `src/`.
94
98
 
95
99
  ### Framework Mode Entry
96
100
 
97
- Framework mode refers to the need to use the capabilities of the Modern.js framework, such as Router, SSR, integrated calls, etc. Under this kind of entry agreement, the entry defined by the developer is not the real Webpack compilation entry. Modern.js will generate an encapsulated entry when it starts, and the real entry can be found in `node_modules/.modern/{entryName}/index.js`.
101
+ Framework mode refers to the need to use Modern.js framework capabilities, such as Router, SSR, integrated calls, etc. Under this type of entry convention, the entry defined by the developer is not a real webpack compilation entry. Modern.js will generate a wrapped entry during startup, and you can find the real entry in `node_modules/.modern/{entryName}/index.js`.
98
102
 
99
103
  #### Conventional Routing
100
104
 
101
- If there is a `routes/` directory in the entry, Modern.js will scan the files under `routes/` at startup, and automatically generate client-side routes (react-router) based on file conventions. For example:
105
+ If there is a `routes/` directory in the entry, Modern.js will scan the files under `routes/` during startup, and automatically generate client-side routes (react-router) based on file conventions. For example:
102
106
 
103
107
  ```bash
104
108
  .
@@ -108,11 +112,13 @@ If there is a `routes/` directory in the entry, Modern.js will scan the files un
108
112
  │ └── page.tsx
109
113
  ```
110
114
 
111
- For details, please refer to [routing](/guides/basic-features/routes#conventional-routing).
115
+ In the above directory, the component exported in `layout.tsx` will be the outermost component, and the component exported in `page.tsx` will be the component of the `/` route.
116
+
117
+ For more information, please refer to [Conventional Routing](/guides/basic-features/routes.html#conventional-routing).
112
118
 
113
119
  #### Self-controlled Routing
114
120
 
115
- If there is an `App.[jt]sx?` file in the entry, the developer can freely set the client route in this file, or not set the client route.
121
+ If there is an `App.[jt]sx?` file in the entry, developers can set the client-side route in this file through code, or not set the client-side route.
116
122
 
117
123
  ```tsx
118
124
  import { BrowserRouter, Route, Routes } from '@modern-js/runtime/router';
@@ -129,11 +135,11 @@ export default () => {
129
135
  };
130
136
  ```
131
137
 
132
- For details, please refer to [routing](/guides/basic-features/routes#self-controlled-routing).
138
+ For more information, please refer to [Self-controlled Routing](/guides/basic-features/routes.html#self-controlled-routing).
133
139
 
134
140
  #### Custom Bootstrap
135
141
 
136
- If there is an `index.[jt]sx` file in the entry, and when the file defaults to exporting functions, Modern.js will pass the default bootstrap function as an imported parameter, and replace the default bootstrap with the exported function, so that developers can customize Mounting components to DOM nodes, or adding custom behavior before mounting. E.g:
142
+ If there is an `index.[jt]sx` file in the entry, and the file exports a function by default, Modern.js will pass the default `bootstrap` function as a parameter and use the exported function to replace the default `bootstrap`. This way, developers can customize how components are mounted to DOM nodes or add custom behavior before mounting. For example:
137
143
 
138
144
  ```tsx
139
145
  export default (App: React.ComponentType, bootstrap: () => void) => {
@@ -144,12 +150,7 @@ export default (App: React.ComponentType, bootstrap: () => void) => {
144
150
  };
145
151
  ```
146
152
 
147
- :::warning
148
- Since the bootstrap function needs to be compatible with React17 and React18, you need to manually pass in ReactDOM parameters when calling the bootstrap function.
149
-
150
- :::
151
-
152
- The content of the file generated by Modern.js is as follows:
153
+ At this point, the generated file content of Modern.js is as follows:
153
154
 
154
155
  ```js
155
156
  import React from 'react';
@@ -180,9 +181,9 @@ export default AppWrapper;
180
181
 
181
182
  ### Build Mode Entry
182
183
 
183
- Build mode refers to the ability not to use any Modern.js runtime, and the developer defines the entry of the project Webpack completely by himself.
184
+ Build mode refers to not using any Modern.js runtime capabilities and completely defining the project's webpack entry by the developer.
184
185
 
185
- If `index.[jt]sx` exists in the entry and there is no default export function, then this file is the real Webpack entry file. This is similar to [Create React App](https://github.com/facebook/create-react-app), you need to mount components to DOM nodes, add hot update code, etc. For example:
186
+ If there is an `index.[jt]sx` file in the entry and it does not export a default function, then this file is the real webpack entry file. Similar to [Create React App](https://github.com/facebook/create-react-app), you need to mount the component to the DOM node by yourself, add hot update code, etc. For example:
186
187
 
187
188
  ```js title=src/index.jsx
188
189
  import React from 'react';
@@ -192,13 +193,13 @@ import App from './App';
192
193
  ReactDOM.render(<App />, document.getElementById('root'));
193
194
  ```
194
195
 
195
- Modern.js **not recommended** new project to use this method, this method loses some capabilities of the framework, such as the `runtime` configuration in the **`modern.config.js` file will no longer take effect**. But this method will be very useful when the project is migrated from other frameworks to Modern.js, such as CRA, or webpack that is manually built by yourself.
196
+ Modern.js **does not recommend** using this method for new projects, as it loses some of the framework's capabilities, such as the `runtime` configuration in the `modern.config.js` file will no longer take effect. However, this method can be very useful when migrating projects from other frameworks to Modern.js, such as CRA, or manually building webpack.
196
197
 
197
- ## Specify Entry Using Configuration
198
+ ## Specifying Entry Using Configuration
198
199
 
199
- Most existing projects are not built according to the directory convention of Modern.js. If you want to change to the directory structure agreed by Modern.js, there will be a certain migration cost.
200
+ Most existing projects are not built according to the directory structure of Modern.js. If you want to change to the directory structure of Modern.js, there will be certain migration costs.
200
201
 
201
- In this case, instead of generating the entry using file conventions, you can manually configure the entry in `modern.config.[jt]s`.
202
+ In this case, in addition to using file conventions to generate entries, you can manually configure the entry in `modern.config.[jt]s`.
202
203
 
203
204
  ```ts title="modern.config.ts"
204
205
  export default defineConfig({
@@ -213,11 +214,11 @@ export default defineConfig({
213
214
  });
214
215
  ```
215
216
 
216
- ### Disable Default Entries
217
+ ### Disable Default Entry Scanning
217
218
 
218
- When using a custom entry, part of the project structure may happen to hit the directory convention of Modern.js, but in fact this part of the directory is not the real entry.
219
+ When using custom entries, part of the project structure may coincidentally hit the directory conventions of Modern.js, but in fact, this part of the directory is not the real entry.
219
220
 
220
- Modern.js provides `disableDefaultEntries` config to disable default entry scanning rules. When you need to customize the entry, you generally need to use `disableDefaultEntries` with `entries`. In this way, some existing projects can be quickly migrated without modifying the directory structure.
221
+ Modern.js provides the `disableDefaultEntries` configuration to disable the default entry scanning rules. When you need to customize the entry, you generally need to use `disableDefaultEntries` in combination with `entries`. This way, some existing projects can be quickly migrated without modifying the directory structure.
221
222
 
222
223
  ```ts title="modern.config.ts"
223
224
  export default defineConfig({
@@ -6,9 +6,9 @@ sidebar_position: 4
6
6
 
7
7
  ## BFF
8
8
 
9
- BFF stands for "Backend For Frontend". It is an architectural pattern where a dedicated backend service is created for frontend applications.
9
+ BFF is short for "Backend For Frontend". It is an architecture pattern that involves creating a backend service for frontend applications.
10
10
 
11
- The BFF service acts as an intermediary between the frontend application and the backend APIs, providing a tailored API for the frontend to consume. This allows the frontend developers to have more control over the data and functionality that they need, without having to rely on a monolithic backend API to provide coresponding capabilities.
11
+ The BFF service acts as an intermediary between the frontend application and the server API, and can provide customized APIs for the frontend to use. This allows frontend developers to have more control over the data and functionality they need, without relying on the backend service to provide the corresponding capabilities.
12
12
 
13
13
  ## Bundler
14
14
 
@@ -24,15 +24,15 @@ import Builder from '@modern-js/builder-doc/docs/en/shared/builder.md';
24
24
 
25
25
  ## CSR
26
26
 
27
- CSR stands for "Client-Side Rendering". It means that pages are rendered directly in the browser using JavaScript. All the logic, data fetching, templating and routing is done on the client rather than the server.
27
+ CSR stands for "Client-Side Rendering". It means that the page is rendered in the browser using JavaScript, and logic such as data fetching, templates, and routing is completed on the client side rather than the server.
28
28
 
29
- In CSR, the server sends an empty HTML shell to the client along with some JavaScript bundles, which then fetches data from the server's APIs and populates the page with dynamic content.
29
+ In CSR, the server sends an empty HTML shell and some JavaScript scripts to the browser, and the browser fetching data from the server's API and renders dynamic content to the page.
30
30
 
31
31
  ## Garfish
32
32
 
33
- [Garfish](https://garfish.bytedance.net/) is a set of micro front-end solutions mainly used to solve problems such as cross-team collaboration and technical system diversification of web applications.
33
+ [Garfish](https://garfish.bytedance.net/) is a micro-frontend solution mainly used to solve problems such as cross-team collaboration and diversified technology systems in web applications.
34
34
 
35
- Starting from the architectural level, it integrates several independently delivered front-end applications. These front-end applications can be developed, tested and deployed independently, but from the user's point of view they are still a cohesive single product.
35
+ Starting from the architecture level, it combines multiple independently delivered frontend applications into a whole. These frontend applications can be developed, tested, and deployed independently, but in the user's perspective, they are still cohesive single products.
36
36
 
37
37
  ## Rspack
38
38
 
@@ -42,19 +42,19 @@ import Rspack from '@modern-js/builder-doc/docs/en/shared/rspack.md';
42
42
 
43
43
  ## SSR
44
44
 
45
- SSR stands for "Server-Side Rendering". It is a technique where the server generates the HTML of a web page and sends it to the client, instead of sending just an empty HTML shell and relying on JavaScript to populate the page.
45
+ SSR stands for "Server-Side Rendering". It means that the HTML of the web page is generated by the server and sent to the client, rather than sending only an empty HTML shell and relying on JavaScript to generate the page content.
46
46
 
47
- In traditional client-side rendering, the server sends an empty HTML shell to the client along with some JavaScript bundles, which then fetches data from the server's APIs and populates the page with dynamic content. This can result in a slower initial load time, which can be detrimental to user experience and SEO.
47
+ In traditional client-side rendering, the server sends an empty HTML shell and some JavaScript scripts to the client, and then fetching data from the server's API and fills the page with dynamic content. This leads to slow initial page loading times and is not conducive to user experience and SEO.
48
48
 
49
- With SSR, the server generates the HTML with the dynamic content already populated, and sends it to the client. This can result in a faster initial load time and better SEO, as search engines can crawl the fully rendered page.
49
+ With SSR, the server generates HTML that already contains dynamic content and sends it to the client. This makes the initial page loading faster and more SEO-friendly, as search engines can crawl the rendered page.
50
50
 
51
51
  ## SSG
52
52
 
53
- SSG stands for "Static Site Generation". It is a technique where a web page is pre-rendered into static HTML, and then served directly to the client without the need for a server to generate the HTML on the fly.
53
+ SSG stands for "Static Site Generation". It means that web pages are pre-rendered as static HTML and served directly to the client, without the need for the server to generate HTML in real-time.
54
54
 
55
- In traditional SSR, the server generates the HTML on the fly each time a user requests a page. With SSG, the HTML is generated ahead of time during the build process and can be served directly from a CDN or other static hosting service.
55
+ In traditional SSR, the server generates HTML in real-time every time a user requests a page. With SSG, HTML can be generated in advance during the build process and hosted on a CDN or other static resource service.
56
56
 
57
- SSG can provide faster load times and less server overhead to traditional SSR, as there is no need to maintain a server to generate the HTML on the fly. However, it is not suitable for websites that require dynamic content, as the HTML is generated during the build process and cannot be updated in real-time.
57
+ Compared to traditional SSR, SSG can provide faster loading speeds and less server-side overhead, as there is no need to maintain a server to generate HTML in real-time. However, SSG is not suitable for websites that require dynamic content, as the HTML is generated during the build process and does not support real-time updates.
58
58
 
59
59
  ## SWC
60
60
 
@@ -7,7 +7,7 @@ sidebar_position: 1
7
7
 
8
8
  **Modern.js is an open source web engineering system from ByteDance**, which provides multiple solutions to help developers solve problems in different development scenarios.
9
9
 
10
- Currently, Modern.js includes three solutions, each targeting at different development scenarios: web application development, npm package development, and document site development:
10
+ Currently, Modern.js includes three solutions, targeting web application development, npm package development, and document site development:
11
11
 
12
12
  import { SolutionCards } from '@site/src/components/SolutionCards';
13
13
 
@@ -31,40 +31,37 @@ import { SolutionCards } from '@site/src/components/SolutionCards';
31
31
  ]}
32
32
  />
33
33
 
34
- As a part of the Modern.js engineering system, each of these solutions can be used separately and has its own independent documentation site. Developers can choose one or more solutions as needed.
34
+ As part of the Modern.js engineering system, each of the above solutions can be used separately and has its own independent documentation site. Developers can choose one or more solutions as needed.
35
35
 
36
36
  ## About Documentation
37
37
 
38
- **This documentation site corresponds to the Modern.js framework**, which is used to developing web applications.
38
+ **The current documentation site corresponds to the Modern.js framework**, which is used to developing web applications.
39
39
 
40
- - If you are developing an npm package, please refer to the [Modern.js Module](https://modernjs.dev/module-tools/en) documentation.
41
- - If you are developing a document site, please refer to the [Modern.js Doc](https://modernjs.dev/doc-tools) documentation.
42
- - If you want to use the Modern.js's builder engine to implement a web framework, please refer to the [Modern.js Builder](https://modernjs.dev/builder/en) documentation.
40
+ - If you need to develop an npm package, please refer to the [Modern.js Module](https://modernjs.dev/module-tools) documentation.
41
+ - If you need to develop a documentation site, please refer to the [Modern.js Doc](https://modernjs.dev/doc-tools/) documentation.
42
+ - If you need to implement a web development framework based on the Modern.js build engine, please refer to the [Modern.js Builder](https://modernjs.dev/builder) documentation.
43
43
 
44
44
  :::tip
45
- As the Modern.js framework is the most widely used, in this documentation site, we will omit the "framework" and simply call it as Modern.js.
45
+ Since the Modern.js framework is the most widely used, in this documentation site, we will omit "framework" and directly refer to it as Modern.js.
46
46
  :::
47
47
 
48
48
  ## Modern.js Framework
49
49
 
50
50
  **The Modern.js framework is a progressive web framework based on React**. At ByteDance, we use Modern.js to build upper-level frameworks that have supported the development of thousands of web applications.
51
51
 
52
- Modern.js can provide developers with the ultimate **development experience**, making the application get better **user experience**.
52
+ Modern.js can provide developers with an ultimate **Development Experience** and enable applications to have better **User Experience**.
53
53
 
54
- In the process of developing React applications, developers often need to design implementations for certain functions, or use other libraries and frameworks to solve these problems.
54
+ In the process of developing React applications, developers usually need to design implementation plans for certain features or use other libraries and frameworks to solve these problems. Modern.js supports all configurations and tools needed by React applications, and has built-in **additional features and optimizations**. Developers can use React to build the UI of the application, and then gradually adopt the features of Modern.js to solve common application requirements, such as routing, data acquisition, and state management.
55
55
 
56
- Modern.js supports all the configuration and tools required by React applications, and has additional features and optimisations built in. Developers can use React to build the UI of the application, and then gradually adopt Modern.js functions to solve common application requirements, such as routing, data fetching, state management, etc.
56
+ It mainly includes the following features:
57
57
 
58
- It mainly contains the following features:
59
-
60
- - 🚀 **Rust Bundler**: Easily switch to Rspack bundler with faster build speed.
61
- - 🪜 **Progressive**: Create projects with the most streamlined templates, gradually turn on plugin capabilities through generators, and customize solutions.
62
- - 🏠 **Integration**: The development is unique to the production environment Web Server, CSR and SSR are isomorphic development, and the function as the API service call.
63
- - 📦 **Out Of The Box**: Default TS support, built-in build core, ESLint, debugging tools, full functionality can be tested.
64
- - 🌏 **Ecology**: Self-developed state management, micro frontend, module packaging, Monorepo solution and other peripheral requirements.
65
- - 🕸 **Routing Modes**: Contains controlled routing, routing based on file conventions (nested routing), configurable routing, etc.
66
- - 🚀 **Independently Build Core**: Support a variety of packaging tools, deep optimization bundle.
58
+ - 🚀 **Rust Bundler**: Provides support for dual bundlers, easily switch to the Rspack for faster build speed.
59
+ - 🪜 **Progressive**: Create projects with the most streamlined templates, gradually enable plugin features through the generator, and customize solutions.
60
+ - 🏠 **Integration**: Development and production environment web server are unique, CSR and SSR are isomorphic development, and API service calls are functions as interfaces.
61
+ - 📦 **Out Of The Box**: Default TS support, built-in build, ESLint, debugging tools, fully functional and testable.
62
+ - 🌏 **Ecology**: Self-developed state management, micro-frontend, module packaging, Monorepo solutions, and other peripheral needs.
63
+ - 🕸 **Routing Modes**: Includes self-controlled routing, file-convention-based routing (nested routing), etc.
67
64
 
68
65
  ## Next
69
66
 
70
- If you want to know how to use Modern.js, you can try [Create your first app](/tutorials/first-app/c01-start), or read [Quick Start](/guides/get-started/quick-start).
67
+ If you want to learn how to use the Modern.js framework, you can try to [create your first application](/tutorials/first-app/c01-start), or read the [Quick Start](/guides/get-started/quick-start) guide.