@modern-js/main-doc 2.4.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (315) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/LICENSE +0 -123
  3. package/README.md +26 -0
  4. package/en/apis/app/commands.mdx +297 -0
  5. package/en/apis/app/hooks/_category_.json +2 -5
  6. package/en/apis/app/hooks/api/framework/lambda.mdx +1 -1
  7. package/en/apis/app/hooks/api/functions/api.mdx +1 -1
  8. package/en/apis/app/hooks/server/index_.mdx +2 -1
  9. package/en/apis/app/hooks/src/pages.mdx +7 -7
  10. package/en/apis/app/hooks/src/routes.mdx +3 -3
  11. package/en/apis/app/runtime/_category_.json +1 -5
  12. package/en/apis/app/runtime/app/define-config.mdx +2 -2
  13. package/en/apis/app/runtime/core/bootstrap.mdx +1 -1
  14. package/en/apis/app/runtime/core/create-app.mdx +2 -2
  15. package/en/apis/app/runtime/core/use-loader.mdx +4 -4
  16. package/en/apis/app/runtime/core/use-module-apps.mdx +2 -2
  17. package/en/apis/app/runtime/model/Provider.mdx +2 -2
  18. package/en/apis/app/runtime/model/auto-actions.mdx +2 -2
  19. package/en/apis/app/runtime/model/connect.mdx +5 -5
  20. package/en/apis/app/runtime/model/create-app.mdx +9 -9
  21. package/en/apis/app/runtime/model/create-store.mdx +3 -3
  22. package/en/apis/app/runtime/model/handle-effect.mdx +2 -2
  23. package/en/apis/app/runtime/model/model_.mdx +1 -1
  24. package/en/apis/app/runtime/model/use-local-model.mdx +1 -1
  25. package/en/apis/app/runtime/model/use-model.mdx +1 -1
  26. package/en/apis/app/runtime/model/use-static-model.mdx +4 -4
  27. package/en/apis/app/runtime/model/use-store.mdx +1 -1
  28. package/en/apis/app/runtime/router/router.mdx +1 -1
  29. package/en/apis/app/runtime/ssr/pre-render.mdx +1 -1
  30. package/en/apis/app/runtime/testing/render.mdx +1 -1
  31. package/en/apis/app/runtime/testing/renderApp.mdx +1 -1
  32. package/en/apis/app/runtime/utility/css-in-js.mdx +1 -1
  33. package/en/apis/app/runtime/utility/loadable.mdx +1 -1
  34. package/en/apis/app/runtime/web-server/hook.mdx +5 -5
  35. package/en/apis/app/runtime/web-server/middleware.mdx +6 -6
  36. package/en/components/global-proxy-config.mdx +3 -3
  37. package/en/components/init-app.mdx +5 -5
  38. package/en/configure/app/bff/_category_.json +4 -0
  39. package/en/configure/app/bff/prefix.mdx +2 -3
  40. package/en/configure/app/bff/proxy.mdx +1 -1
  41. package/en/configure/app/builder-plugins.mdx +3 -3
  42. package/en/configure/app/deploy/_category_.json +4 -0
  43. package/en/configure/app/dev/_category_.json +4 -0
  44. package/en/configure/app/dev/asset-prefix.mdx +1 -1
  45. package/en/configure/app/dev/before-start-url.mdx +13 -0
  46. package/en/configure/app/dev/hmr.mdx +1 -1
  47. package/en/configure/app/dev/host.mdx +13 -0
  48. package/en/configure/app/dev/https.mdx +1 -1
  49. package/en/configure/app/dev/port.mdx +1 -1
  50. package/en/configure/app/dev/progress-bar.mdx +1 -1
  51. package/en/configure/app/dev/start-url.mdx +1 -1
  52. package/en/configure/app/experiments/_category_.json +4 -0
  53. package/en/configure/app/experiments/lazy-compilation.mdx +1 -1
  54. package/en/configure/app/html/_category_.json +4 -0
  55. package/en/configure/app/html/app-icon.mdx +1 -1
  56. package/en/configure/app/html/crossorigin.mdx +1 -1
  57. package/en/configure/app/html/disable-html-folder.mdx +1 -1
  58. package/en/configure/app/html/favicon-by-entries.mdx +1 -1
  59. package/en/configure/app/html/favicon.mdx +1 -1
  60. package/en/configure/app/html/inject-by-entries.mdx +1 -1
  61. package/en/configure/app/html/inject.mdx +1 -1
  62. package/en/configure/app/html/meta-by-entries.mdx +1 -1
  63. package/en/configure/app/html/meta.mdx +1 -1
  64. package/en/configure/app/html/mount-id.mdx +1 -1
  65. package/en/configure/app/html/tags-by-entries.mdx +1 -1
  66. package/en/configure/app/html/tags.mdx +1 -1
  67. package/en/configure/app/html/template-by-entries.mdx +1 -1
  68. package/en/configure/app/html/template-parameters-by-entries.mdx +1 -1
  69. package/en/configure/app/html/template-parameters.mdx +1 -1
  70. package/en/configure/app/html/template.mdx +1 -1
  71. package/en/configure/app/html/title-by-entries.mdx +1 -1
  72. package/en/configure/app/html/title.mdx +1 -1
  73. package/en/configure/app/output/_category_.json +4 -0
  74. package/en/configure/app/output/asset-prefix.mdx +1 -1
  75. package/en/configure/app/output/assets-retry.mdx +1 -1
  76. package/en/configure/app/output/charset.mdx +1 -1
  77. package/en/configure/app/output/clean-dist-path.mdx +1 -1
  78. package/en/configure/app/output/convert-to-rem.mdx +1 -1
  79. package/en/configure/app/output/copy.mdx +1 -1
  80. package/en/configure/app/output/css-module-local-ident-name.mdx +1 -1
  81. package/en/configure/app/output/data-uri-limit.mdx +1 -1
  82. package/en/configure/app/output/disable-css-extract.mdx +1 -1
  83. package/en/configure/app/output/disable-css-module-extension.mdx +1 -1
  84. package/en/configure/app/output/disable-filename-hash.mdx +1 -1
  85. package/en/configure/app/output/disable-inline-runtime-chunk.mdx +1 -1
  86. package/en/configure/app/output/disable-minimize.mdx +1 -1
  87. package/en/configure/app/output/disable-source-map.mdx +1 -1
  88. package/en/configure/app/output/disable-ts-checker.mdx +1 -1
  89. package/en/configure/app/output/dist-path.mdx +1 -1
  90. package/en/configure/app/output/enable-asset-fallback.mdx +1 -1
  91. package/en/configure/app/output/enable-asset-manifest.mdx +1 -1
  92. package/en/configure/app/output/enable-css-module-tsdeclaration.mdx +1 -1
  93. package/en/configure/app/output/enable-inline-scripts.mdx +1 -1
  94. package/en/configure/app/output/enable-inline-styles.mdx +1 -1
  95. package/en/configure/app/output/enable-latest-decorators.mdx +1 -1
  96. package/en/configure/app/output/externals.mdx +1 -1
  97. package/en/configure/app/output/filename.mdx +1 -1
  98. package/en/configure/app/output/legal-comments.mdx +1 -1
  99. package/en/configure/app/output/override-browserslist.mdx +1 -1
  100. package/en/configure/app/output/polyfill.mdx +1 -1
  101. package/en/configure/app/output/ssg.mdx +5 -5
  102. package/en/configure/app/output/svg-default-export.mdx +1 -1
  103. package/en/configure/app/performance/_category_.json +4 -0
  104. package/en/configure/app/performance/build-cache.mdx +1 -1
  105. package/en/configure/app/performance/bundle-analyze.mdx +1 -1
  106. package/en/configure/app/performance/chunk-split.mdx +1 -1
  107. package/en/configure/app/performance/print-file-size.mdx +1 -1
  108. package/en/configure/app/performance/profile.mdx +1 -1
  109. package/en/configure/app/performance/remove-console.mdx +1 -1
  110. package/en/configure/app/performance/remove-moment-locale.mdx +1 -1
  111. package/en/configure/app/plugins.mdx +1 -1
  112. package/en/configure/app/runtime/_category_.json +4 -0
  113. package/en/configure/app/runtime/intro.mdx +2 -2
  114. package/en/configure/app/runtime/master-app.mdx +1 -1
  115. package/en/configure/app/security/_category_.json +4 -0
  116. package/en/configure/app/security/check-syntax.mdx +1 -1
  117. package/en/configure/app/security/sri.mdx +1 -1
  118. package/en/configure/app/server/_category_.json +4 -0
  119. package/en/configure/app/server/base-url.mdx +3 -3
  120. package/en/configure/app/server/enable-framework-ext.mdx +1 -1
  121. package/en/configure/app/server/ssr-by-entries.mdx +1 -1
  122. package/en/configure/app/source/_category_.json +4 -0
  123. package/en/configure/app/source/alias.mdx +1 -1
  124. package/en/configure/app/source/compile-js-data-uri.mdx +1 -1
  125. package/en/configure/app/source/define.mdx +1 -1
  126. package/en/configure/app/source/design-system.mdx +5 -5
  127. package/en/configure/app/source/entries-dir.mdx +1 -1
  128. package/en/configure/app/source/entries.mdx +3 -3
  129. package/en/configure/app/source/exclude.mdx +1 -1
  130. package/en/configure/app/source/global-vars.mdx +1 -1
  131. package/en/configure/app/source/include.mdx +1 -1
  132. package/en/configure/app/source/module-scopes.mdx +1 -1
  133. package/en/configure/app/source/pre-entry.mdx +1 -1
  134. package/en/configure/app/source/resolve-extension-prefix.mdx +1 -1
  135. package/en/configure/app/source/resolve-main-fields.mdx +1 -1
  136. package/en/configure/app/testing/_category_.json +4 -0
  137. package/en/configure/app/testing/transformer.mdx +1 -1
  138. package/en/configure/app/tools/_category_.json +4 -0
  139. package/en/configure/app/tools/autoprefixer.mdx +1 -1
  140. package/en/configure/app/tools/babel.mdx +1 -1
  141. package/en/configure/app/tools/css-extract.mdx +1 -1
  142. package/en/configure/app/tools/css-loader.mdx +1 -1
  143. package/en/configure/app/tools/dev-server.mdx +1 -1
  144. package/en/configure/app/tools/html-plugin.mdx +1 -1
  145. package/en/configure/app/tools/inspector.mdx +1 -1
  146. package/en/configure/app/tools/jest.mdx +1 -1
  147. package/en/configure/app/tools/less.mdx +1 -1
  148. package/en/configure/app/tools/minify-css.mdx +1 -1
  149. package/en/configure/app/tools/postcss.mdx +1 -1
  150. package/en/configure/app/tools/pug.mdx +1 -1
  151. package/en/configure/app/tools/rspack.mdx +13 -0
  152. package/en/configure/app/tools/sass.mdx +1 -1
  153. package/en/configure/app/tools/style-loader.mdx +1 -1
  154. package/en/configure/app/tools/styled-components.mdx +1 -1
  155. package/en/configure/app/tools/tailwindcss.mdx +1 -1
  156. package/en/configure/app/tools/terser.mdx +1 -1
  157. package/en/configure/app/tools/ts-checker.mdx +1 -1
  158. package/en/configure/app/tools/ts-loader.mdx +1 -1
  159. package/en/configure/app/tools/webpack-chain.mdx +1 -1
  160. package/en/configure/app/tools/webpack.mdx +1 -1
  161. package/en/configure/app/usage.mdx +1 -1
  162. package/en/guides/advanced-features/_category_.json +2 -2
  163. package/en/guides/advanced-features/bff/bff-proxy.mdx +1 -1
  164. package/en/guides/advanced-features/bff/frameworks.mdx +1 -1
  165. package/en/guides/advanced-features/bff/function.mdx +3 -3
  166. package/en/guides/advanced-features/code-split.mdx +2 -2
  167. package/en/guides/advanced-features/compatibility.mdx +2 -3
  168. package/en/guides/advanced-features/eslint.mdx +4 -4
  169. package/en/guides/advanced-features/low-level.mdx +1 -1
  170. package/en/guides/advanced-features/rspack-start.mdx +69 -0
  171. package/en/guides/advanced-features/ssg.mdx +12 -13
  172. package/en/guides/advanced-features/ssr.mdx +3 -3
  173. package/en/guides/advanced-features/testing.mdx +4 -5
  174. package/en/guides/advanced-features/web-server.mdx +0 -1
  175. package/en/guides/basic-features/alias.mdx +5 -5
  176. package/en/guides/basic-features/data-fetch.mdx +25 -12
  177. package/en/guides/basic-features/env-vars.mdx +1 -1
  178. package/en/guides/basic-features/html.mdx +11 -11
  179. package/en/guides/basic-features/mock.mdx +21 -1
  180. package/en/guides/basic-features/proxy.mdx +2 -2
  181. package/en/guides/basic-features/routes.mdx +29 -15
  182. package/en/guides/{basic-features → concept}/builder.mdx +2 -2
  183. package/en/guides/concept/entries.mdx +11 -11
  184. package/en/guides/css/_category_.json +5 -0
  185. package/en/guides/{basic-features/css → css}/less-sass.mdx +1 -1
  186. package/en/guides/get-started/introduction.mdx +34 -0
  187. package/en/guides/get-started/quick-start.mdx +4 -4
  188. package/en/guides/get-started/upgrade.mdx +2 -1
  189. package/en/guides/topic-detail/_category_.json +2 -2
  190. package/en/guides/topic-detail/framework-plugin/hook.mdx +1 -1
  191. package/en/guides/topic-detail/generator/plugin/api/hook/onForged.mdx +1 -1
  192. package/en/guides/topic-detail/generator/plugin/develop.mdx +1 -1
  193. package/en/guides/topic-detail/micro-frontend/c02-development.mdx +128 -61
  194. package/en/guides/topic-detail/micro-frontend/c03-main-app.mdx +73 -42
  195. package/en/guides/topic-detail/micro-frontend/c05-mixed-stack.mdx +1 -1
  196. package/en/guides/topic-detail/model/auto-actions.mdx +1 -1
  197. package/en/guides/topic-detail/model/define-model.mdx +1 -1
  198. package/en/guides/topic-detail/model/manage-effects.mdx +1 -1
  199. package/en/guides/topic-detail/model/model-communicate.mdx +1 -1
  200. package/en/guides/topic-detail/model/quick-start.mdx +2 -2
  201. package/en/guides/topic-detail/model/test-model.mdx +1 -1
  202. package/en/guides/topic-detail/model/use-model.mdx +3 -3
  203. package/en/guides/troubleshooting/_category_.json +2 -2
  204. package/en/guides/troubleshooting/cli.mdx +1 -1
  205. package/en/index.md +1 -1
  206. package/en/tutorials/first-app/_category_.json +1 -1
  207. package/en/tutorials/first-app/c01-start.mdx +0 -1
  208. package/en/tutorials/first-app/c03-css.mdx +1 -2
  209. package/en/tutorials/first-app/c06-model.mdx +1 -1
  210. package/en/tutorials/first-app/c07-container.mdx +18 -18
  211. package/en/tutorials/first-app/c08-entries.mdx +24 -25
  212. package/en/tutorials/foundations/introduction.mdx +17 -34
  213. package/package.json +3 -3
  214. package/scripts/config.ts +3 -1
  215. package/scripts/summary.en.json +1 -1
  216. package/scripts/summary.zh.json +1 -1
  217. package/zh/apis/app/commands.mdx +299 -0
  218. package/zh/apis/app/hooks/_category_.json +2 -5
  219. package/zh/apis/app/hooks/src/pages.mdx +1 -1
  220. package/zh/apis/app/hooks/src/routes.mdx +3 -3
  221. package/zh/apis/app/runtime/_category_.json +1 -5
  222. package/zh/apis/app/runtime/core/create-app.mdx +1 -1
  223. package/zh/apis/app/runtime/core/use-module-apps.mdx +81 -40
  224. package/zh/apis/app/runtime/model/Provider.mdx +2 -2
  225. package/zh/apis/app/runtime/model/create-app.mdx +7 -7
  226. package/zh/apis/app/runtime/model/create-store.mdx +2 -2
  227. package/zh/apis/app/runtime/model/use-local-model.mdx +1 -1
  228. package/zh/apis/app/runtime/model/use-static-model.mdx +1 -1
  229. package/zh/apis/app/runtime/model/use-store.mdx +1 -1
  230. package/zh/apis/app/runtime/testing/renderApp.mdx +1 -1
  231. package/zh/components/init-app.mdx +5 -5
  232. package/zh/components/micro-runtime-config.mdx +6 -6
  233. package/zh/components/release-note.mdx +1 -1
  234. package/zh/configure/app/bff/prefix.mdx +1 -1
  235. package/zh/configure/app/bff/proxy.mdx +1 -1
  236. package/zh/configure/app/builder-plugins.mdx +3 -3
  237. package/zh/configure/app/dev/before-start-url.mdx +13 -0
  238. package/zh/configure/app/dev/host.mdx +13 -0
  239. package/zh/configure/app/output/ssg.mdx +3 -3
  240. package/zh/configure/app/plugins.mdx +1 -1
  241. package/zh/configure/app/server/ssr-by-entries.mdx +1 -1
  242. package/zh/configure/app/source/entries-dir.mdx +1 -1
  243. package/zh/configure/app/tools/rspack.mdx +13 -0
  244. package/zh/configure/app/usage.mdx +1 -1
  245. package/zh/guides/advanced-features/_category_.json +2 -6
  246. package/zh/guides/advanced-features/compatibility.mdx +0 -1
  247. package/zh/guides/advanced-features/rspack-start.mdx +69 -0
  248. package/zh/guides/advanced-features/ssg.mdx +8 -9
  249. package/zh/guides/advanced-features/ssr.mdx +3 -2
  250. package/zh/guides/advanced-features/testing.mdx +0 -1
  251. package/zh/guides/advanced-features/web-server.mdx +0 -1
  252. package/zh/guides/basic-features/_category_.json +1 -5
  253. package/zh/guides/basic-features/alias.mdx +5 -5
  254. package/zh/guides/basic-features/data-fetch.mdx +39 -30
  255. package/zh/guides/basic-features/html.mdx +10 -9
  256. package/zh/guides/basic-features/mock.mdx +20 -0
  257. package/zh/guides/basic-features/routes.mdx +38 -17
  258. package/zh/guides/{basic-features → concept}/builder.mdx +4 -4
  259. package/zh/guides/concept/entries.mdx +11 -11
  260. package/zh/guides/css/_category_.json +5 -0
  261. package/zh/guides/{basic-features/css → css}/less-sass.mdx +1 -1
  262. package/zh/guides/{basic-features/css → css}/postcss.mdx +5 -4
  263. package/zh/guides/{basic-features/css → css}/tailwindcss.mdx +0 -1
  264. package/zh/guides/get-started/introduction.mdx +31 -0
  265. package/zh/guides/get-started/quick-start.mdx +4 -5
  266. package/zh/guides/get-started/upgrade.mdx +2 -1
  267. package/zh/guides/topic-detail/_category_.json +2 -2
  268. package/zh/guides/topic-detail/generator/plugin/api/input/addInputBefore.mdx +1 -1
  269. package/zh/guides/topic-detail/micro-frontend/c02-development.mdx +25 -0
  270. package/zh/guides/topic-detail/micro-frontend/c03-main-app.mdx +16 -16
  271. package/zh/guides/topic-detail/model/model-communicate.mdx +1 -1
  272. package/zh/guides/troubleshooting/_category_.json +2 -2
  273. package/zh/index.md +1 -1
  274. package/zh/tutorials/first-app/_category_.json +1 -1
  275. package/zh/tutorials/first-app/c01-start.mdx +1 -2
  276. package/zh/tutorials/first-app/c03-css.mdx +1 -2
  277. package/zh/tutorials/first-app/c06-model.mdx +2 -2
  278. package/zh/tutorials/first-app/c07-container.mdx +18 -18
  279. package/zh/tutorials/first-app/c08-entries.mdx +25 -26
  280. package/zh/tutorials/foundations/introduction.mdx +14 -29
  281. package/en/apis/app/commands/_category_.json +0 -8
  282. package/en/apis/app/commands/build.mdx +0 -39
  283. package/en/apis/app/commands/dev.mdx +0 -61
  284. package/en/apis/app/commands/index.mdx +0 -7
  285. package/en/apis/app/commands/inspect.mdx +0 -61
  286. package/en/apis/app/commands/lint.mdx +0 -19
  287. package/en/apis/app/commands/new.mdx +0 -54
  288. package/en/apis/app/commands/serve.mdx +0 -27
  289. package/en/apis/app/commands/test.mdx +0 -35
  290. package/en/apis/app/commands/upgrade.mdx +0 -18
  291. package/en/apis/app/hooks/index.mdx +0 -7
  292. package/en/apis/app/runtime/index.mdx +0 -7
  293. package/en/guides/advanced-features/index.mdx +0 -7
  294. package/en/guides/basic-features/css/_category_.json +0 -4
  295. package/zh/apis/app/commands/_category_.json +0 -8
  296. package/zh/apis/app/commands/build.mdx +0 -39
  297. package/zh/apis/app/commands/dev.mdx +0 -61
  298. package/zh/apis/app/commands/index.mdx +0 -7
  299. package/zh/apis/app/commands/inspect.mdx +0 -61
  300. package/zh/apis/app/commands/lint.mdx +0 -19
  301. package/zh/apis/app/commands/new.mdx +0 -54
  302. package/zh/apis/app/commands/serve.mdx +0 -27
  303. package/zh/apis/app/commands/test.mdx +0 -35
  304. package/zh/apis/app/commands/upgrade.mdx +0 -18
  305. package/zh/apis/app/hooks/index.mdx +0 -7
  306. package/zh/apis/app/runtime/index.mdx +0 -7
  307. package/zh/guides/advanced-features/index.mdx +0 -7
  308. package/zh/guides/basic-features/css/_category_.json +0 -4
  309. package/zh/guides/basic-features/index.mdx +0 -7
  310. /package/en/guides/{basic-features/css → css}/css-in-js.mdx +0 -0
  311. /package/en/guides/{basic-features/css → css}/css-modules.mdx +0 -0
  312. /package/en/guides/{basic-features/css → css}/postcss.mdx +0 -0
  313. /package/en/guides/{basic-features/css → css}/tailwindcss.mdx +0 -0
  314. /package/zh/guides/{basic-features/css → css}/css-in-js.mdx +0 -0
  315. /package/zh/guides/{basic-features/css → css}/css-modules.mdx +0 -0
@@ -0,0 +1,69 @@
1
+ ---
2
+ title: Rspack Start
3
+ sidebar_position: 12
4
+ ---
5
+
6
+ # Rspack Start
7
+
8
+ [Rspack](https://www.rspack.org/) is a Rust-based web bundler developed by the ByteDance Web Infra team. The core architecture of Rspack is aligned with the implementation of webpack, and provides out-of-the-box support for commonly used build features.
9
+
10
+ Rspack optimizes compilation performance by:
11
+
12
+ - Highly LTO optimized Native code.
13
+ - Take full advantage of multi-core, and the entire compilation process is fully optimized for multi-threading.
14
+ - On-demand compilation based on request (Lazy Compilation), reducing the number of modules per compilation to improve the speed of cold start.
15
+
16
+ ## Initializing an rspack project
17
+
18
+ The Modern.js generator provides an interactive question-and-answer interface to initialize a project. To create an rspack project, simply select the **rspack** build tool by running:
19
+
20
+ ```bash
21
+ $ npx @modern-js/create myapp
22
+ ? Please select the solution you want to create: Web App Solution
23
+ ? Development Language: TS
24
+ ? Package Management Tool: pnpm
25
+ ? Build Tools: rspack
26
+ ```
27
+
28
+ After the project is created, you can experience the project by running `pnpm run dev`. For more project information, please refer to [Quick Start](/guides/get-started/quick-start.html).
29
+
30
+ :::tip
31
+ When using rspack as the bundler, the following features are currently not supported:
32
+
33
+ - Server-side rendering (SSR)
34
+ - Static Site Generation (SSG)
35
+ - Micro Frontend.
36
+ - Storybook debugging.
37
+
38
+ :::
39
+
40
+ ## Migrating from webpack to rspack
41
+
42
+ You can enable rspack build by running `pnpm run new`:
43
+
44
+ ```bash
45
+ $ pnpm run new
46
+ ? Action: Enable features
47
+ ? Enable features: Enable rspack Build
48
+ ```
49
+
50
+ After executing the command, enable the rspack build in `modern.config.ts`:
51
+
52
+ ```ts title=modern.config.ts
53
+ import appTools, { defineConfig } from '@modern-js/app-tools';
54
+
55
+ export default defineConfig<'rspack'>({
56
+ runtime: {
57
+ router: true,
58
+ },
59
+ plugins: [
60
+ appTools({
61
+ bundler: 'experimental-rspack',
62
+ }),
63
+ ],
64
+ });
65
+ ```
66
+
67
+ :::tip
68
+ Migrating from webpack to rspack may have some differences in build and configuration capabilities. For more details, please refer to [Configuration Differences](https://modernjs.dev/builder/en/guide/advanced/rspack-start.html#migrating-from-webpack-to-rspack)
69
+ :::
@@ -9,8 +9,8 @@ Static Site Generation is a solution for rendering complete static web pages at
9
9
  First need to execute `pnpm run new` to enable the SSG features:
10
10
 
11
11
  ```bash
12
- ? 请选择你想要的操作 启用可选功能
13
- ? 启用可选功能 启用「SSG」功能
12
+ ? Action Enable features
13
+ ? Enable features Enable SSG
14
14
  ```
15
15
 
16
16
  After execute script,register SSG plugin in `modern.config.ts`:
@@ -18,7 +18,6 @@ After execute script,register SSG plugin in `modern.config.ts`:
18
18
  ```ts title="modern.config.ts"
19
19
  import ssgPlugin from '@modern-js/plugin-ssg';
20
20
 
21
- // https://modernjs.dev/docs/apis/app/config
22
21
  export default defineConfig({
23
22
  output: {
24
23
  ssg: true,
@@ -38,14 +37,14 @@ For example, the following is a project directory structure using conventional r
38
37
  ```bash
39
38
  .
40
39
  ├── src
41
-    └── routes
42
-    ├── layout.tsx
43
-    ├── page.tsx
44
-    └── user
45
-    ├── layout.tsx
46
-    ├── page.tsx
47
-    └── profile
48
-    └── page.tsx
40
+ └── routes
41
+ ├── layout.tsx
42
+ ├── page.tsx
43
+ └── user
44
+ ├── layout.tsx
45
+ ├── page.tsx
46
+ └── profile
47
+ └── page.tsx
49
48
  ```
50
49
 
51
50
  The above file directory will generate the following three routes:
@@ -107,11 +106,11 @@ export default defineConfig({
107
106
  });
108
107
  ```
109
108
 
110
- run `pnpm run build` and `pnpm run serve`,access `http://localhost:8080/about`. In the Preview view, you can see that the page has been rendered
109
+ run `pnpm run build` and `pnpm run serve`,access `http://localhost:8080/about`. In the Preview view, you can see that the page has been rendered.
111
110
 
112
111
  Looking at the bundle file, a new `main/about/index.html` file has been added in the `dist/` directory.
113
112
 
114
113
  :::info
115
- The above only introduces the single entry, more related content can be viewed [SSG API](/configure/app/output/ssg)
114
+ The above only introduces the single entry, more related content can be viewed [SSG API](/configure/app/output/ssg).
116
115
 
117
116
  :::
@@ -44,7 +44,7 @@ And it provides elegant degradation processing. Once the SSR request fails, it w
44
44
  However, developers still need to pay attention to the fallback of data, such as `null` values or data returns that do not as expect. Avoid React rendering errors or messy rendering results when SSR.
45
45
 
46
46
  :::info
47
- When using Data Loader, data fetching happens before rendering, Modern.js still supports fetching data when the component is rendered. See [Data Fetch](/guides/basic-features/data-fetch)
47
+ When using Data Loader, data fetching happens before rendering, Modern.js still supports fetching data when the component is rendered. See [Data Fetch](/guides/basic-features/data-fetch).
48
48
 
49
49
  :::
50
50
 
@@ -198,7 +198,7 @@ This is because in the previous request, the SPR has asynchronously obtained the
198
198
  It is conceivable that when `interval` is set to 1, users can have the responsive experience of a static page.
199
199
 
200
200
  :::info
201
- For more detail, see [`<PreRender>`](/apis/app/runtime/ssr/pre-render)
201
+ For more detail, see [`<PreRender>`](/apis/app/runtime/ssr/pre-render).
202
202
 
203
203
  :::
204
204
 
@@ -276,7 +276,7 @@ export const loader = () => {
276
276
 
277
277
  ### Independent File
278
278
 
279
- Both of the above methods will bring some burden to the developer. Modern.js based on [Nested Routing](/guides/basic-features/routes) developed and designed [Data Fetch](/guides/basic-features/data-fetch) to separate CSR and SSR code
279
+ Both of the above methods will bring some burden to the developer. Modern.js based on [Nested Routing](/guides/basic-features/routes) developed and designed [Data Fetch](/guides/basic-features/data-fetch) to separate CSR and SSR code.
280
280
 
281
281
  ## Remote Request
282
282
 
@@ -9,8 +9,8 @@ Modern.js inherits the testing capabilities of [Jest](https://jestjs.io/) by def
9
9
  First need to execute `pnpm run new` enable [unit test/integration test] features:
10
10
 
11
11
  ```
12
- ? 请选择你想要的操作: 启用可选功能
13
- ? 启用可选功能: 启用「单元测试 / 集成测试」功能
12
+ ? Action: Enable features
13
+ ? Enable features: Enable Unit Test / Integration Test
14
14
  ```
15
15
 
16
16
  After executing the above command, the `"test": "modern test"` command will be automatically generated in package.json.
@@ -20,7 +20,6 @@ register plugin in `modern.config.ts`:
20
20
  ```ts title="modern.config.ts"
21
21
  import testPlugin from '@modern-js/plugin-testing';
22
22
 
23
- // https://modernjs.dev/docs/apis/app/config
24
23
  export default defineConfig({
25
24
  plugins: [..., testPlugin()],
26
25
  });
@@ -28,7 +27,7 @@ export default defineConfig({
28
27
 
29
28
  ## Test file
30
29
 
31
- Modern.js default recognized test file paths are: `<rootDir>/src/**/*.test.[jt]s?(x)` and `<rootDir>/tests/**/*.test.[jt]s?(x)`。
30
+ Modern.js default recognized test file paths are: `<rootDir>/src/**/*.test.[jt]s?(x)` and `<rootDir>/tests/**/*.test.[jt]s?(x)`.
32
31
 
33
32
  If you need to customize the test directory, you can configure it with [tools.jest](/configure/app/tools/jest).
34
33
 
@@ -40,7 +39,7 @@ Modern.js test support [testing-library](https://testing-library.com/docs/). API
40
39
  import { render, screen } from '@modern-js/runtime/testing';
41
40
  ```
42
41
 
43
- Other Modern.js supported testing APIs can be found [here](/apis/app/runtime/testing/cleanup)
42
+ Other Modern.js supported testing APIs can be found [here](/apis/app/runtime/testing/cleanup).
44
43
 
45
44
  ## transform
46
45
 
@@ -22,7 +22,6 @@ Modern.js 作为以客户端为中心的开发框架,对服务端的定制能
22
22
  ```ts title="modern.config.ts"
23
23
  import serverPlugin from '@modern-js/plugin-server';
24
24
 
25
- // https://modernjs.dev/docs/apis/app/config
26
25
  export default defineConfig({
27
26
  plugins: [..., serverPlugin()],
28
27
  });
@@ -23,10 +23,10 @@ For example, import the modules from the `src/common/` directory in the `src/App
23
23
  ```bash
24
24
  .
25
25
  ├── common
26
-    ├── styles
27
-       └── base.css
28
-    └── utils
29
-    └── index.ts
26
+ ├── styles
27
+ └── base.css
28
+ └── utils
29
+ └── index.ts
30
30
  ├── App.tsx
31
31
  ```
32
32
 
@@ -62,4 +62,4 @@ export default defineConfig({
62
62
  });
63
63
  ```
64
64
 
65
- for more detail, see 【[API - source.alias](/configure/app/source/alias)】。
65
+ For detailed usage, please refer to [source.alias documentation](/configure/app/source/alias).
@@ -81,16 +81,16 @@ When a routing file is passed through `[]`, it is passed as a [dynamic route](/g
81
81
 
82
82
  ```tsx
83
83
  // routes/user/[id]/page.loader.tsx
84
- import { LoaderArgs } from '@modern-js/runtime/router';
84
+ import { LoaderFunctionArgs } from '@modern-js/runtime/router';
85
85
 
86
- export default async ({ params }: LoaderArgs) => {
86
+ export default async ({ params }: LoaderFunctionArgs) => {
87
87
  const { id } = params;
88
88
  const res = await fetch(`https://api/user/${id}`);
89
89
  return res.json();
90
90
  };
91
91
  ```
92
92
 
93
- 当访问 `/user/123` 时,`loader` 函数的参数为 `{ params: { id: '123' } }`。
93
+ When accessing `/user/123`, the parameters of the `loader` function are `{ params: { id: '123' } }`.
94
94
 
95
95
  #### `request`
96
96
 
@@ -100,9 +100,9 @@ A common usage scenario is to obtain query parameters via `request`:
100
100
 
101
101
  ```tsx
102
102
  // routes/user/[id]/page.loader.ts
103
- import { LoaderArgs } from '@modern-js/runtime/router';
103
+ import { LoaderFunctionArgs } from '@modern-js/runtime/router';
104
104
 
105
- export default async ({ request }: LoaderArgs) => {
105
+ export default async ({ request }: LoaderFunctionArgs) => {
106
106
  const url = new URL(request.url);
107
107
  const userId = url.searchParams.get('id');
108
108
  return queryUser(userId);
@@ -220,6 +220,26 @@ Currently, only CSR is supported, so stay tuned for Streaming SSR.
220
220
 
221
221
  :::
222
222
 
223
+ Add the following code to `user/layout.loader.ts`:
224
+
225
+ ```ts title="routes/user/layout.loader.ts"
226
+ import { defer } from "@edenx/runtime/router"
227
+
228
+ const loader = () =>
229
+ defer({
230
+ userInfo: new Promise((resolve) => {
231
+ setTimeout(() => {
232
+ resolve({
233
+ age: 1,
234
+ name: 'user layout'
235
+ })
236
+ }, 1000)
237
+ })
238
+ })
239
+
240
+ export default loader;
241
+ ```
242
+
223
243
  Add the following code to `user/layout.tsx`:
224
244
 
225
245
  ```tsx title="routes/user/layout.tsx"
@@ -230,13 +250,6 @@ import {
230
250
  Outlet
231
251
  } from '@modern-js/runtime/router';
232
252
 
233
- export const loader = () => {
234
- return defer({
235
- // fetchUserInfo 是一个异步函数,返回用户信息
236
- userInfo: fetchUserInfo(),
237
- })
238
- }
239
-
240
253
  export default function UserLayout() {
241
254
  const { userInfo } = useLoaderData() as {userInfo: Promise<UserInfo>};
242
255
  return (
@@ -167,4 +167,4 @@ const foo = TWO;
167
167
  const foo = 1 + 1;
168
168
  ```
169
169
 
170
- In most cases, `source.globalVars` is already sufficient to replace variables. But the values passed in by `source.globalVars` will be serialized by JSON by default. So it cannot be replaced like `1 + 1` in the example above,at this time, we need use [`source.define`](/configure/app/source/define)
170
+ In most cases, `source.globalVars` is already sufficient to replace variables. But the values passed in by `source.globalVars` will be serialized by JSON by default. So it cannot be replaced like `1 + 1` in the example above,at this time, we need use [`source.define`](/configure/app/source/define).
@@ -4,7 +4,7 @@ sidebar_position: 9
4
4
  ---
5
5
  # HTML Template
6
6
 
7
- Modern.js provides **JSX syntax** and **HTML(Ejs) syntax** for customizing HTML template.
7
+ Modern.js provides **JSX syntax** and **HTML(EJS) syntax** for customizing HTML template.
8
8
 
9
9
  ## JSX syntax
10
10
 
@@ -14,14 +14,14 @@ For example the following directory structure:
14
14
 
15
15
  ```bash
16
16
  .
17
- ├── src
18
- │   ├── Document.tsx
19
- │   ├── entry-a
20
-    │   ├── Document.tsx
21
-    │   └── routes
22
- │   ├── entry-b
23
-    │   └── routes
24
- │   └── modern-app-env.d.ts
17
+ └── src
18
+ ├── Document.tsx
19
+ ├── entry-a
20
+ ├── Document.tsx
21
+ └── routes
22
+ ├── entry-b
23
+ └── routes
24
+ └── modern-app-env.d.ts
25
25
  ```
26
26
 
27
27
  `entry-a` will take precedence over the `Docoument.[jt]sx` file under the current entry. If the current entry does not have a `Document.[jt]sx` file, such as `entry-b`, it will look for the `Document.[jt]sx` file in the root directory.
@@ -42,7 +42,7 @@ These components are rendered:
42
42
 
43
43
  - `Body`:Provide the ability of native Body Element, which needs to contain the `<Root>` component internally, and also supports other elements as child elements at the same time, such as adding footers.
44
44
 
45
- - `Root`:React root element `<div id='root'></div>`。the default element id is `id = 'root'`, can set `props.rootId` to change the idChild components can be added, and will also be rendered into HTML templates, which will be overwritten when React rendering is complete, generally used to implement global Loading.
45
+ - `Root`:React root element `<div id='root'></div>`. the default element id is `id = 'root'`, can set `props.rootId` to change the id.Child components can be added, and will also be rendered into HTML templates, which will be overwritten when React rendering is complete, generally used to implement global Loading.
46
46
 
47
47
  - `Head`:Provides native Head Element capabilities and automatically populates `<meta>`, as well as the `<Scripts>` component.
48
48
 
@@ -193,7 +193,7 @@ In the application root directory, create the `config/html/` directory, which su
193
193
  </html>
194
194
  ```
195
195
 
196
- HTML Fragments support the use [Lodash template](https://lodash.com/docs/4.17.15#template)
196
+ HTML Fragments support the use [Lodash template](https://lodash.com/docs/4.17.15#template).
197
197
 
198
198
  For example, insert a script in `body.html`:
199
199
 
@@ -40,7 +40,7 @@ export default {
40
40
  };
41
41
  ```
42
42
 
43
- when access `http://localhost:8080/api/getInfo`, the api will return json `{ "data": [1, 2, 3, 4] }`。
43
+ when access `http://localhost:8080/api/getInfo`, the api will return json `{ "data": [1, 2, 3, 4] }`.
44
44
 
45
45
  ## Return Random Data
46
46
 
@@ -77,3 +77,23 @@ export default {
77
77
  },
78
78
  };
79
79
  ```
80
+
81
+ ## Use Mock On Demand
82
+
83
+ Under the `config/mock/index.ts`, you can also export the `config` to control the Mock service.
84
+
85
+ ```ts
86
+ type MockConfig = {
87
+ enable: ((req: IncomingMessage, res: ServerResponse) => boolean) | boolean;
88
+ };
89
+
90
+ export const config = {
91
+ enable: false
92
+ }
93
+ ```
94
+
95
+ Currently only the `enable` configuration is supported, through which developers can control whether to execute Mock.
96
+
97
+ :::note
98
+ After modifying `config`, there is no need to restart the service, which will take effect immediately.
99
+ :::
@@ -6,7 +6,7 @@ sidebar_position: 5
6
6
 
7
7
  ## Local Proxy
8
8
 
9
- Modern.js provides a way to configure the development proxy in ['tools.devServer'] (/docs/configure/app/tools/dev-server). For example, to proxy the local interface to an online address:
9
+ Modern.js provides a way to configure the development proxy in [tools.devServer](/configure/app/tools/dev-server). For example, to proxy the local interface to an online address:
10
10
 
11
11
  ```ts title="modern.config.ts"
12
12
  import { defineConfig } from '@modern-js/app-tools';
@@ -28,7 +28,7 @@ export default defineConfig({
28
28
  when access `http://localhost:8080/go/api`, the response content is returned from [http://www.example.com/](http://www.example.com/).
29
29
 
30
30
  :::info
31
- For more detail, see [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware)
31
+ For more detail, see [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware).
32
32
 
33
33
  :::
34
34
 
@@ -77,7 +77,7 @@ In order to facilitate the introduction of the relationship between `<Layout>` a
77
77
  .
78
78
  └── routes
79
79
  ├── blog
80
-    └── page.tsx
80
+ └── page.tsx
81
81
  ├── layout.tsx
82
82
  ├── page.tsx
83
83
  └── user
@@ -124,15 +124,15 @@ With a file directory named `[]`, the generated route will be used as a dynamic
124
124
  ```
125
125
  └── routes
126
126
  ├── [id]
127
-    └── page.tsx
127
+ └── page.tsx
128
128
  ├── blog
129
-    └── page.tsx
129
+ └── page.tsx
130
130
  └── page.tsx
131
131
  ```
132
132
 
133
133
  The `routes/[id]/page.tsx` file is converted to the `/:id` route. Except for the `/blog` route that exactly matches, all other `/xxx` will match this route.
134
134
 
135
- In component, you can get the corresponding named parameters through [useParams](/apis/app/runtime/router/#useparams).
135
+ In component, you can get the corresponding named parameters through [useParams](/apis/app/runtime/router/router#useparams).
136
136
 
137
137
  ### Catch all routing
138
138
 
@@ -148,11 +148,11 @@ For example, the following directory structure:
148
148
  └── routes
149
149
  ├── $.tsx
150
150
  ├── blog
151
-    └── page.tsx
151
+ └── page.tsx
152
152
  └── page.tsx
153
153
  ```
154
154
 
155
- The `routes/$.tsx` component is rendered when accessing any path that does not match, and again, the remainder of the url can be captured in `$.tsx` using [useParams](/apis/app/runtime/router/#useparams).
155
+ The `routes/$.tsx` component is rendered when accessing any path that does not match, and again, the remainder of the url can be captured in `$.tsx` using [useParams](/apis/app/runtime/router/router#useparams).
156
156
 
157
157
  ```ts title="$.tsx"
158
158
  import { useParams } from '@modern-js/runtime/router';
@@ -215,9 +215,9 @@ When the component exists in the routing directory, all routing switches under t
215
215
  .
216
216
  └── routes
217
217
  ├── blog
218
-    ├── [id]
219
-       └── page.tsx
220
-    └── page.tsx
218
+ ├── [id]
219
+ └── page.tsx
220
+ └── page.tsx
221
221
  ├── layout.tsx
222
222
  ├── loading.tsx
223
223
  └── page.tsx
@@ -225,6 +225,22 @@ When the component exists in the routing directory, all routing switches under t
225
225
 
226
226
  When a route jumps from `/` to `/blog`, if the JS Chunk of the `<Blog>` component is not loaded, the component UI exported in `loading.tsx` will be displayed first. But when jumping from `/blog` to `/blog/20220101`, it will not be displayed.
227
227
 
228
+ ### Redirect
229
+
230
+ You can redirect routes by creating a [`data loader`](/guides/basic-features/data-fetch) file, Suppose you have the file `routes/user/page.tsx` and you want to redirect the route corresponding to this file, you can create the file `routes/user/page.loader.ts`:
231
+
232
+ ```ts title="routes/user/page.loader.ts"
233
+ import { redirect } from "@edenx/runtime/router"
234
+
235
+ export default () => {
236
+ const user = await getUser();
237
+ if(!user){
238
+ return redirect('/login');
239
+ }
240
+ return null;
241
+ }
242
+ ```
243
+
228
244
  ### ErrorBoundary
229
245
 
230
246
  In each layer directory under `routes/`, the developer can also define a `error.tsx` file, and export a `<ErrorBoundary>` component by default.
@@ -235,7 +251,7 @@ When the component exists in a routing directory, the component render error is
235
251
 
236
252
  {/* Todo API 路由 */}
237
253
 
238
- Within the `<ErrorBoundary>` component, you can use [useRouteError](/apis/app/runtime/router/#useparams) to get the specific information of the error:
254
+ Within the `<ErrorBoundary>` component, you can use [useRouteError](/apis/app/runtime/router/router#useparams) to get the specific information of the error:
239
255
 
240
256
  ```tsx
241
257
  import { useRouteError } from '@modern-js/runtime/router';
@@ -295,19 +311,17 @@ export default () => {
295
311
  When working with SSR, the browser side can get the data returned by `init` during SSR, and the developer can decide whether to retrieve the data on the browser side to overwrite the SSR data, for example:
296
312
 
297
313
  ```tsx title="src/routes/layout.tsx"
298
- import {
299
- RuntimeContext,
300
- } from '@modern-js/runtime';
314
+ import { RuntimeContext } from '@modern-js/runtime';
301
315
 
302
316
  export const init = (context: RuntimeContext) => {
303
- if (process.env.JUPITER_TARGET === 'node') {
317
+ if (process.env.MODERN_TARGET === 'node') {
304
318
  return {
305
319
  message: 'Hello World By Server',
306
320
  }
307
321
  } else {
308
322
  const { context } = runtimeContext;
309
323
  const data = context.getInitData();
310
- // 如果没有获取到期望的数据
324
+ // If do not get the expected data
311
325
  if (!data.message) {
312
326
  return {
313
327
  message: 'Hello World By Client'
@@ -1,7 +1,7 @@
1
1
  ---
2
- title: Builder
3
2
  sidebar_position: 2
4
3
  ---
4
+
5
5
  # Builder
6
6
 
7
7
  **Modern.js uses [Modern.js Builder](https://modernjs.dev/builder) to build your Web App.**
@@ -14,7 +14,7 @@ From the perspective of building, Modern.js is divided into three layers, from t
14
14
 
15
15
  - Upper-layer framework: Modern.js.
16
16
  - Universal build engine: Modern.js Builder.
17
- - Low-level bundlers: webpack and Rspack.
17
+ - Low-level bundlers: 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={{ maxWidth: '540px' }} />
20
20
 
@@ -1,7 +1,7 @@
1
1
  ---
2
- title: Entries
3
- sidebar_position: 2
2
+ sidebar_position: 1
4
3
  ---
4
+
5
5
  # Entries
6
6
 
7
7
  Entries are Modern.js default file convention, and each entry in the project is a separate page, corresponding to a server level route.
@@ -15,11 +15,11 @@ Modern.js initialization project is a single entry, the project structure is as
15
15
  ```
16
16
  .
17
17
  ├── src
18
-    ├── modern-app-env.d.ts
19
-    └── routes
20
-    ├── index.css
21
-    ├── layout.tsx
22
-    └── page.tsx
18
+ ├── modern-app-env.d.ts
19
+ └── routes
20
+ ├── index.css
21
+ ├── layout.tsx
22
+ └── page.tsx
23
23
  ├── package.json
24
24
  ├── modern.config.ts
25
25
  ├── pnpm-lock.yaml
@@ -41,10 +41,10 @@ After execution, the `src/` directory will become the following structure:
41
41
  .
42
42
  ├── modern-app-env.d.ts
43
43
  ├── myapp
44
-    └── routes
45
-    ├── index.css
46
-    ├── layout.tsx
47
-    └── page.tsx
44
+ └── routes
45
+ ├── index.css
46
+ ├── layout.tsx
47
+ └── page.tsx
48
48
  └── new-entry
49
49
  └── routes
50
50
  ├── index.css
@@ -0,0 +1,5 @@
1
+ {
2
+ "label": "CSS Solutions",
3
+ "position": 4,
4
+ "collapsed": false
5
+ }
@@ -12,6 +12,6 @@ sidebar_position: 4
12
12
  - If you need to customize the configuration of [sass-loader](https://github.com/webpack-contrib/sass-loader), please refer to the [tools.less](/configure/app/tools/sass).
13
13
 
14
14
  :::tip
15
- CSS files pre-compiled by Less and Sass will still undergo Modern.js build-in [PostCSS](https://postcss.org/) conversion, which has good browser compatibility. For related content, please refer to [[PostCSS](/guides/basic-features/css/postcss)].
15
+ CSS files pre-compiled by Less and Sass will still undergo Modern.js build-in [PostCSS](https://postcss.org/) conversion, which has good browser compatibility. For related content, please refer to [[PostCSS](/guides/css/postcss)].
16
16
 
17
17
  :::
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: Introduction
3
+ sidebar_position: 1
4
+ ---
5
+ # Introduction
6
+
7
+ ## Modern.js Introduction
8
+
9
+ **Modern.js** is a progressive modern web development framework based on React.
10
+
11
+ The framework has a variety of built-in out-of-the-box tools, excellent build performance, zero-configuration rendering paradigm switching, and integrated API calls. Starting from three solutions (Application solutions, Module solutions, Monorepo solutions), it supports front-end research and development of a complete period.
12
+
13
+ Modern.js is ByteDance's underlying front-end framework, which has directly or indirectly served thousands of applications, including middle and back-end, PC Web, H5 and other application scenarios. The framework covers a full life cycle, has a complete plugin system, and provides a high degree of customization capabilities. Support custom solutions exclusive to business lines through generator plugin, customize various functional extensions and business requirements, and help developers build applications faster.
14
+
15
+ ## Why Modern.js
16
+
17
+ Modern.js can provide developers with the ultimate **Development Experience**,make the app better **User Experience**.
18
+
19
+ 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.
20
+
21
+ Modern.js support all the configuration and tools required by React applications, and have built-in **additional functions and optimizations**. 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 fetch, state management, etc.
22
+
23
+ It mainly contains the following features:
24
+
25
+ - 🪜 **Progressive**:Create projects with the most streamlined templates, gradually turn on plugin capabilities through generators, and customize solutions.
26
+ - 🏠 **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.
27
+ - 📦 **Out Of The Box**:Default TS support, built-in build core, ESLint, debugging tools, full functionality can be tested.
28
+ - 🌏 **Ecology**:Self-developed state management, micro frontend, module packaging, Monorepo solution and other peripheral requirements.
29
+ - 🕸 **Routing Modes**:Contains controlled routing, routing based on file conventions (nested routing), configurable routing, etc.
30
+ - 🚀 **Independently Build Core**:Support a variety of packaging tools, deep optimization bundle.
31
+
32
+ ## Next
33
+
34
+ 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).
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  title: Quick Start
3
- sidebar_position: 1
3
+ sidebar_position: 2
4
4
  ---
5
+
5
6
  # Quick Start
6
7
 
7
8
  ## Environment
@@ -81,7 +82,6 @@ Features can be enabled through the configuration file, or the default behavior
81
82
  ```ts
82
83
  import { defineConfig } from '@modern-js/app-tools';
83
84
 
84
- // https://modernjs.dev/docs/apis/app/config
85
85
  export default defineConfig({
86
86
  runtime: {
87
87
  router: true,
@@ -129,9 +129,9 @@ The bundle is generated to `dist/` by default, and the directory structure is as
129
129
  .
130
130
  ├── asset-manifest.json
131
131
  ├── html
132
-    └── main
132
+ └── main
133
133
  ├── loader-routes
134
-    └── main
134
+ └── main
135
135
  ├── modern.config.json
136
136
  ├── route.json
137
137
  └── static
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  title: Upgrade
3
- sidebar_position: 2
3
+ sidebar_position: 3
4
4
  ---
5
+
5
6
  # Upgrade
6
7
 
7
8
  ## Upgrade with command