@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
@@ -1,4 +1,4 @@
1
1
 
2
- > @modern-js/main-doc@2.4.0 build /github/workspace/packages/toolkit/main-doc
2
+ > @modern-js/main-doc@2.6.0 build /github/workspace/packages/toolkit/main-doc
3
3
  > npx ts-node ./scripts/sync.ts
4
4
 
package/LICENSE CHANGED
@@ -19,126 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
-
23
-
24
- The code implementation modified from external library are:
25
-
26
- - vite
27
-
28
- MIT License
29
-
30
- Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
31
-
32
- Permission is hereby granted, free of charge, to any person obtaining a copy
33
- of this software and associated documentation files (the "Software"), to deal
34
- in the Software without restriction, including without limitation the rights
35
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36
- copies of the Software, and to permit persons to whom the Software is
37
- furnished to do so, subject to the following conditions:
38
-
39
- The above copyright notice and this permission notice shall be included in all
40
- copies or substantial portions of the Software.
41
-
42
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
- SOFTWARE.
49
-
50
- - wmr
51
-
52
- MIT License
53
-
54
- Copyright (c) 2020 The Preact Authors
55
-
56
- Permission is hereby granted, free of charge, to any person obtaining a copy
57
- of this software and associated documentation files (the "Software"), to deal
58
- in the Software without restriction, including without limitation the rights
59
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
60
- copies of the Software, and to permit persons to whom the Software is
61
- furnished to do so, subject to the following conditions:
62
-
63
- The above copyright notice and this permission notice shall be included in all
64
- copies or substantial portions of the Software.
65
-
66
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
71
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
72
- SOFTWARE.
73
-
74
- - bundle-require
75
-
76
- The MIT License (MIT)
77
-
78
- Copyright © 2021 EGOIST (https://github.com/sponsors/egoist)
79
-
80
- Permission is hereby granted, free of charge, to any person obtaining a copy
81
- of this software and associated documentation files (the "Software"), to deal
82
- in the Software without restriction, including without limitation the rights
83
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
84
- copies of the Software, and to permit persons to whom the Software is
85
- furnished to do so, subject to the following conditions:
86
-
87
- The above copyright notice and this permission notice shall be included in all
88
- copies or substantial portions of the Software.
89
-
90
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
91
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
92
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
93
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
94
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
95
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
96
- SOFTWARE
97
-
98
- - react-dev-utils
99
-
100
- MIT License
101
-
102
- Copyright (c) 2013-present, Facebook, Inc.
103
-
104
- Permission is hereby granted, free of charge, to any person obtaining a copy
105
- of this software and associated documentation files (the "Software"), to deal
106
- in the Software without restriction, including without limitation the rights
107
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
108
- copies of the Software, and to permit persons to whom the Software is
109
- furnished to do so, subject to the following conditions:
110
-
111
- The above copyright notice and this permission notice shall be included in all
112
- copies or substantial portions of the Software.
113
-
114
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
115
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
116
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
117
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
118
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
119
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
120
- SOFTWARE.
121
-
122
- - jest-cli
123
-
124
- MIT License
125
-
126
- Copyright (c) Facebook, Inc. and its affiliates.
127
-
128
- Permission is hereby granted, free of charge, to any person obtaining a copy
129
- of this software and associated documentation files (the "Software"), to deal
130
- in the Software without restriction, including without limitation the rights
131
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
132
- copies of the Software, and to permit persons to whom the Software is
133
- furnished to do so, subject to the following conditions:
134
-
135
- The above copyright notice and this permission notice shall be included in all
136
- copies or substantial portions of the Software.
137
-
138
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
139
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
140
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
141
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
142
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
143
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
144
- SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ <p align="center">
2
+ <a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
3
+ </p>
4
+
5
+ <h1 align="center">Modern.js</h1>
6
+
7
+ <p align="center">
8
+ A Progressive React Framework for modern web development.
9
+ </p>
10
+
11
+ ## Getting Started
12
+
13
+ Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
14
+
15
+ ## Documentation
16
+
17
+ - [English Documentation](https://modernjs.dev/en/)
18
+ - [中文文档](https://modernjs.dev)
19
+
20
+ ## Contributing
21
+
22
+ Please read the [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md).
23
+
24
+ ## License
25
+
26
+ Modern.js is [MIT licensed](https://github.com/modern-js-dev/modern.js/blob/main/LICENSE).
@@ -0,0 +1,297 @@
1
+ ---
2
+ sidebar_position: 1
3
+ ---
4
+
5
+ # Commands
6
+
7
+ Modern.js has some built-in commands that can help you quickly start a development server, build production environment code, and more.
8
+
9
+ Through this chapter, you can learn about the built-in commands of Modern.js and how to use them.
10
+
11
+ ## modern dev
12
+
13
+ The `modern dev` command is used to start a local development server and compile the source code in the development environment.
14
+
15
+ ```bash
16
+ Usage: modern dev [options]
17
+
18
+ Options:
19
+ -e --entry <entry> compiler by entry
20
+ -c --config <config> configuration file path, which can be a relative path or an absolute path
21
+ -h, --help show command help
22
+ --analyze analyze the bundle and view size of each module
23
+ --api-only only start API service
24
+ ```
25
+
26
+ After running `modern dev`, Modern.js will watch source file changes and apply hot module replacement.
27
+
28
+ ```bash
29
+ $ modern dev
30
+
31
+ info Starting dev server...
32
+ info App running at:
33
+
34
+ > Local: http://localhost:8080/
35
+ > Network: http://192.168.0.1:8080/
36
+ ```
37
+
38
+ ### Compile Partial Pages
39
+
40
+ In multi-page (MPA) projects, the `--entry` option can be added to specify one or more pages to compile. In this way, only part of the code in the project will be compiled, and the dev startup speed will be faster.
41
+
42
+ For example, execute `modern dev --entry`, the entry selector will be displayed in the command line interface:
43
+
44
+ ```bash
45
+ $ modern dev --entry
46
+
47
+ ? Please select the entry that needs to be built
48
+ ❯ ◯ foo
49
+ ◯ bar
50
+ ◯ baz
51
+ ```
52
+
53
+ For example, if you select the `foo` entry, only the code related to the `foo` entry will be compiled, and the code of other pages will not be compiled.
54
+
55
+ ### Specify the page by parameter
56
+
57
+ You can also specify the page name through parameters after `--entry`, and the names of multiple pages can be separated by commas.
58
+
59
+ ```bash
60
+ # Compile foo page
61
+ modern dev --entry foo
62
+
63
+ # Compile foo and bar pages
64
+ modern dev --entry foo,bar
65
+ ```
66
+
67
+ ## modern start
68
+
69
+ `modern start` is an alias of `modern dev` command, the usage of the two are exactly the same.
70
+
71
+ ## modern build
72
+
73
+ The `modern build` command will build a production-ready product in the `dist/` directory by default. You can specify the output directory by modifying the configuration [`output.distPath`](/configure/app/output/dist-path).
74
+
75
+ ```bash
76
+ Usage: modern build [options]
77
+
78
+ Options:
79
+ -c --config <config> configuration file path, which can be a relative path or an absolute path
80
+ -h, --help show command help
81
+ --analyze analyze the bundle and view size of each module
82
+ ```
83
+
84
+ ### Analyze Bundle
85
+
86
+ execute `npx modern build --analyze` command,can produce an HTML file that analyzes the volume of the bundle while packaging the production code:
87
+
88
+ ```
89
+ Bundle Analyzer saved report to /example/dist/report.html
90
+ File sizes after production build:
91
+
92
+ 122.35 KB dist/static/js/885.1d4fbe5a.js
93
+ 2.3 KB dist/static/js/main.4b8e8d64.js
94
+ 761 B dist/static/js/runtime-main.edb7cf35.js
95
+ 645 B dist/static/css/main.0dd3ecc1.css
96
+ ```
97
+
98
+ Open the above HTML file in the browser, you can see the tile diagram of the packaged product, and perform package volume analysis and optimization:
99
+
100
+ <img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/aphqeh7uhohpquloj/modern-js/mwa-build-analyze-8784f762c1ab0cb20935829d5f912c4c.png" />
101
+
102
+ > this features based on [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer).
103
+
104
+ ## modern new
105
+
106
+ The `modern new` command is used to enable features in an existing project.
107
+
108
+ For example, add application entry, enable some optional features such as Tailwind CSS, micro frontend, etc.
109
+
110
+ ```bash
111
+ Usage: modern new [options]
112
+
113
+ Options:
114
+ -d, --debug using debug mode to log something (default: false)
115
+ -c, --config <config> set default generator config(json string)
116
+ --dist-tag <tag> use specified tag version for its generator
117
+ --registry set npm registry url to run npm command
118
+ -h, --help show command help
119
+ ```
120
+
121
+ ### Add Entry
122
+
123
+ In the project, execute the `new` command to add entries as follows:
124
+
125
+ ```bash
126
+ $ npx modern new
127
+ ? Action Create project element
128
+ ? Create project element New "entry"
129
+ ? Entry name entry
130
+ ```
131
+
132
+ ### Enable Features
133
+
134
+ In the project, execute the `new` command to enable features as follows:
135
+
136
+ ```bash
137
+ $ npx modern new
138
+ ? Action Enable features
139
+ ? Enable features (Use arrow keys)
140
+ ❯ Enable Tailwind CSS
141
+ Enable BFF
142
+ Enable SSG
143
+ Enable Micro Frontend
144
+ Enable Unit Test / Integration Test
145
+ Enable Visual Testing (Storybook)
146
+ ```
147
+
148
+ :::tip
149
+ The `--config` parameter needs to use a JSON string.
150
+
151
+ pnpm does not support the use of JSON strings as parameter values currently. Use `npm new` to turn on.【[Relate Issue](https://github.com/pnpm/pnpm/issues/3876)】
152
+ :::
153
+
154
+ ## modern serve
155
+
156
+ Usually use the `modern serve` command to enable project run in the production environment, and you need to execute the [`build'](/apis/app/commands#modern-build) command in advance to build the outputs.
157
+
158
+ ```bash
159
+ Usage: modern serve [options]
160
+
161
+ Options:
162
+ -c --config <config> configuration file path, which can be a relative path or an absolute path
163
+ -h, --help show command help
164
+ --api-only only run API service
165
+ ```
166
+
167
+ By default, the project will run in `localhost:8080`, you can modify the Server port number with `server.port`:
168
+
169
+ ```js
170
+ export default defineConfig({
171
+ server: {
172
+ port: 8081,
173
+ },
174
+ });
175
+ ```
176
+
177
+ ## modern upgrade
178
+
179
+ Execute the command `npx modern upgrade` in the project, by default, dependencies in the `package.json` are updated to the latest version.
180
+
181
+ ```
182
+ Usage: modern upgrade [options]
183
+
184
+ Options:
185
+ --registry <registry> specify npm registry (default: "")
186
+ -d,--debug using debug mode to log something (default: false)
187
+ --cwd <cwd> app directory (default: "")
188
+ -h, --help show command help
189
+ ```
190
+
191
+ ## modern inspect
192
+
193
+ The `modern inspect` command is used to view the [Modern.js Builder config](https://modernjs.dev/builder/en/guide/basic/builder-config.html) and webpack config of the project.
194
+
195
+ ```
196
+ Usage: modern inspect [options]
197
+
198
+ Options:
199
+ --env <env> view the configuration in the target environment (default: "development")
200
+ --output <output> Specify the path to output in the dist (default: "/")
201
+ --verbose Show the full function in the result
202
+ -c --config <config> configuration file path, which can be a relative path or an absolute path
203
+ -h, --help show command help
204
+ ```
205
+
206
+ After executing the command `npx modern inspect` in the project root directory, the following files will be generated in the `dist` directory of the project:
207
+
208
+ - `builder.config.js`: The Modern.js Builder config to use at build time.
209
+ - `webpack.config.web.js`: The webpack config used by to use at build time.
210
+
211
+ ```bash
212
+ ➜ npx modern inspect
213
+
214
+ Inspect config succeed, open following files to view the content:
215
+
216
+ - Builder Config: /root/my-project/dist/builder.config.js
217
+ - Webpack Config (web): /root/my-project/dist/webpack.config.web.js
218
+ ```
219
+
220
+ ### Configuration Env
221
+
222
+ By default, the inspect command will output the development configs, you can use the `--env production` option to output the production configs:
223
+
224
+ ```bash
225
+ modern inspect --env production
226
+ ```
227
+
228
+ ### Verbose content
229
+
230
+ By default, the inspect command will omit the function content in the config object, you can use the `--verbose` option to output the full content of the function:
231
+
232
+ ```bash
233
+ modern inspect --verbose
234
+ ```
235
+
236
+ ### SSR Configuration
237
+
238
+ If the project has enabled SSR, an additional `webpack.config.node.js` file will be generated in the `dist/`, corresponding to the webpack configuration at SSR build time.
239
+
240
+ ```bash
241
+ ➜ npx modern inspect
242
+
243
+ Inspect config succeed, open following files to view the content:
244
+
245
+ - Builder Config: /root/my-project/dist/builder.config.js
246
+ - Webpack Config (web): /root/my-project/dist/webpack.config.web.js
247
+ - Webpack Config (node): /root/my-project/dist/webpack.config.node.js
248
+ ```
249
+
250
+ ## modern lint
251
+
252
+ Run ESLint to check the syntax of the code.
253
+
254
+ ```bash
255
+ Usage: modern lint [options] [...files]
256
+
257
+ Options:
258
+ --no-fix disable auto fix source file
259
+ -h, --help display help for command
260
+ ```
261
+
262
+ Normally, only the part of the code modified by this commit needs to be checked by `lint-staged` during the `git commit` phase.
263
+
264
+ - `--no-fix` close auto fix by lint.
265
+
266
+ ## modern test
267
+
268
+ `modern test` command will automatically run the test cases.
269
+
270
+ ```bash
271
+ Usage: modern test [options]
272
+
273
+ Options:
274
+ -h, --help show command help
275
+ ```
276
+
277
+ :::tip
278
+ `modern test` command need to execute the `new` command in advance to enable the `unit test/integration test`.
279
+ :::
280
+
281
+ The effect is as follows:
282
+
283
+ ```bash
284
+ $ npx modern test
285
+ PASS src/tests/index.test.ts
286
+ The add method
287
+ ✓ should work fine. (2ms)
288
+
289
+ Test Suites: 1 passed, 1 total
290
+ Tests: 1 passed, 1 total
291
+ Snapshots: 0 total
292
+ Time: 0.994 s, estimated 1 s
293
+ ```
294
+
295
+ :::info
296
+ Files match `*.test.(js|ts)` in `api/` or `src/` folders will be recognized as test cases by default.
297
+ :::
@@ -1,8 +1,5 @@
1
1
  {
2
2
  "label": "Convention",
3
- "position": 1,
4
- "link": {
5
- "type": "doc",
6
- "id": "apis/app/hooks/index"
7
- }
3
+ "position": 2,
4
+ "collapsed": false
8
5
  }
@@ -40,7 +40,7 @@ Dynamic named routing parameters can be supported by creating folders or files w
40
40
  - `api/lambda/user/[username]/delete.ts` -> `$BASENAME/user/:username/delete`
41
41
  - `api/lambda/article/[id]/info.ts` -> `$BASENAME/article/:id/info`
42
42
 
43
- the `$BASENAME` can be configured in `modern.config.js`,the default value is `/api`。
43
+ the `$BASENAME` can be configured in `modern.config.js`,the default value is `/api`.
44
44
 
45
45
  ### Allow List
46
46
 
@@ -40,7 +40,7 @@ Dynamic named routing parameters can be supported by creating folders or files w
40
40
  - `api/user/[username]/delete.ts` -> `$BASENAME/user/:username/delete`
41
41
  - `api/article/[id]/info.ts` -> `$BASENAME/article/:id/info`
42
42
 
43
- the `$BASENAME` can be configured in `modern.config.js`,the default value is `/api`。
43
+ the `$BASENAME` can be configured in `modern.config.js`,the default value is `/api`.
44
44
 
45
45
  ### Allow List
46
46
 
@@ -2,6 +2,7 @@
2
2
  title: index.[tj]s
3
3
  sidebar_position: 1
4
4
  ---
5
+
5
6
  # index.[tj]s
6
7
 
7
8
  A file that extends the Modern.js Web Server, to add a Hook or Middleware to the Web Server that the project uses.
@@ -11,6 +12,6 @@ It can intercept requests and responses, authenticate and role, request preproce
11
12
  It can also be inserted logic into the built-in processing handler (including route matching, resource addressing, header injection, page rendering, static web hosting).
12
13
 
13
14
  :::info
14
- For detail, see [Hook](/apis/app/runtime/web-server/hook) & [Middleware](/apis/app/runtime/web-server/middleware)
15
+ For detail, see [Hook](/apis/app/runtime/web-server/hook) & [Middleware](/apis/app/runtime/web-server/middleware).
15
16
 
16
17
  :::
@@ -107,16 +107,16 @@ For example the following directory structure:
107
107
  └── index.js
108
108
  ```
109
109
 
110
- - access `/`, the `Component` is `pages/index.js`。
111
- - access `/a`, the `Component` is `pages/a/index.js`。
112
- - access `/a/b`, the `Component` is `pages/a/b/index.js`。
110
+ - access `/`, the `Component` is `pages/index.js`.
111
+ - access `/a`, the `Component` is `pages/a/index.js`.
112
+ - access `/a/b`, the `Component` is `pages/a/b/index.js`.
113
113
 
114
114
  :::tip Advantages
115
115
 
116
116
  - preserve the state of the global layout when the page changes.
117
117
  - add global css.
118
118
  - handle ComponentDidCatch error
119
- - use `defineConfig`(/docs/apis/app/runtime/app/define-config) dynamic configuration runtime.
119
+ - use [defineConfig](/apis/app/runtime/app/define-config) dynamic configuration runtime.
120
120
 
121
121
  :::
122
122
 
@@ -149,8 +149,8 @@ export default ALayout;
149
149
 
150
150
  The Component props is the specific route, for example
151
151
 
152
- - access `/a`, the `Component` is `pages/a/index.js`。
153
- - 访问 `/a/b`, the `Component` is `pages/a/b/index.js`。
152
+ - access `/a`, the `Component` is `pages/a/index.js`.
153
+ - 访问 `/a/b`, the `Component` is `pages/a/b/index.js`.
154
154
 
155
155
  In this way, you can use `pages/a/_layout.js` to display the routing common layout in the `a` directory.
156
156
 
@@ -179,4 +179,4 @@ the generated route is configured is as:
179
179
  ]
180
180
  ```
181
181
 
182
- All unmatched routes will match to `pages/404.[tj]s`。
182
+ All unmatched routes will match to `pages/404.[tj]s`.
@@ -44,15 +44,15 @@ If the directory name of the route file is named with `[]`, the generated route
44
44
  ```
45
45
  └── routes
46
46
  ├── [id]
47
-    └── page.tsx
47
+ └── page.tsx
48
48
  ├── blog
49
-    └── page.tsx
49
+ └── page.tsx
50
50
  └── page.tsx
51
51
  ```
52
52
 
53
53
  The `routes/[id]/page.tsx` file will be converted to a `/:id` route. All `/xxx` will match that route, except for the `/blog` route, which can be matched exactly.
54
54
 
55
- In the component, you can get the corresponding parameters by [useParams](/apis/app/runtime/router/#useparams).
55
+ In the component, you can get the corresponding parameters by [useParams](/apis/app/runtime/router/router#useparams).
56
56
 
57
57
  In the loader, params will be used as input to [loader](/guides/basic-features/data-fetch#loader-function), and the corresponding parameters can be retrieved through the property `params`.
58
58
 
@@ -1,9 +1,5 @@
1
1
  {
2
2
  "label": "runtime",
3
3
  "position": 3,
4
- "collapsed": false,
5
- "link": {
6
- "type": "doc",
7
- "id": "apis/app/runtime/index"
8
- }
4
+ "collapsed": false
9
5
  }
@@ -28,8 +28,8 @@ function defineConfig(Component, config): any;
28
28
 
29
29
  ### Input
30
30
 
31
- - Component: App root Component
32
- - config: runtime config
31
+ - Component: App root Component.
32
+ - config: runtime config.
33
33
 
34
34
  ## Example
35
35
 
@@ -3,7 +3,7 @@ title: bootstrap
3
3
  ---
4
4
  # bootstrap
5
5
 
6
- Used to start and mount App, usually without manual callsThis API is only required when using [Custom App](/guides/concept/entries#自定义-app).
6
+ Used to start and mount App, usually without manual calls. This API is only required when using [Custom App](/guides/concept/entries#自定义-app).
7
7
 
8
8
  ## Usage
9
9
 
@@ -3,7 +3,7 @@ title: createApp
3
3
  ---
4
4
  # createApp
5
5
 
6
- Used to create custom entries, custom runtime plugins. This API is only required when using [Custom App](/guides/concept/entries#自定义-app).
6
+ Used to create custom entries, custom runtime plugins. This API is only required when using [Custom App](/guides/concept/entries#app).
7
7
 
8
8
  ## Usage
9
9
 
@@ -28,7 +28,7 @@ function createApp(options: { plugins: Plugin[] }): React.ComponentType<any>;
28
28
 
29
29
  ### Create Custom Entry
30
30
 
31
- For details, see [`bootstrap`](./bootstrap.md)
31
+ For details, see [`bootstrap`](./bootstrap.mdx).
32
32
 
33
33
  ### Custom Plugins
34
34
 
@@ -3,7 +3,7 @@ title: useLoader
3
3
  ---
4
4
  # useLoader
5
5
 
6
- Isomorphic API,usually used to make asynchronous requestsWhen SSR, the server level uses `useLoader` to prefetch the data, and the browser side also reuses this part of the data.
6
+ Isomorphic API,usually used to make asynchronous requests. When SSR, the server level uses `useLoader` to prefetch the data, and the browser side also reuses this part of the data.
7
7
 
8
8
  ## Usage
9
9
 
@@ -35,7 +35,7 @@ function useLoader(loaderFn: LoaderFn, options: Options): ReturnData;
35
35
  ```
36
36
 
37
37
  :::info
38
- `runtimeContext` can refer to [useRuntimeContext](/apis/app/runtime/core/use-runtime-context)
38
+ `runtimeContext` can refer to [useRuntimeContext](/apis/app/runtime/core/use-runtime-context).
39
39
 
40
40
  :::
41
41
 
@@ -47,14 +47,14 @@ function useLoader(loaderFn: LoaderFn, options: Options): ReturnData;
47
47
  - `onError`: error callback.
48
48
  - `initialData`: the initial data before the first execution,.
49
49
  - `skip`: when the value is `true`, the function does not execute.
50
- - `params`: when the result of the `params` serialization changes,the function is re-executed。`params` is also passed in as the second argument of the function.
50
+ - `params`: when the result of the `params` serialization changes,the function is re-executed. `params` is also passed in as the second argument of the function.
51
51
  - `static`: when the value is `true`, `useLoader` is used for [SSG](/guides/advanced-features/ssg).
52
52
 
53
53
  ### Return Value
54
54
 
55
55
  - `data`: return data on successful execution.
56
56
  - `loading`: indicates whether the function is in execution.
57
- - `error`: error message when function execution fails
57
+ - `error`: error message when function execution fails.
58
58
  - `reload`: the function can be re-executed after the call.
59
59
  - `params`: when the value is `undefined`, the last value will be reused; otherwise, the function will be re-executed with the new value.
60
60
  - `reloading`: during the execution of the call to `reload`, the value of `reloading` is `true`.
@@ -46,7 +46,7 @@ defineConfig(App, {
46
46
  masterApp: {
47
47
  apps: [
48
48
  {
49
- // name 区分大小写,name 提供的是什么 useModuleApps 返回的就是什么
49
+ // name is case-sensitive, what name provides is what useModuleApps returns
50
50
  name: 'Home',
51
51
  entry: 'http://127.0.0.1:8081/',
52
52
  },
@@ -63,7 +63,7 @@ Get the `Home` and `Contact` sub-application components(the same as name in the
63
63
 
64
64
  ### Centralized Routing
65
65
 
66
- **Centralized Routing** is a way to centrally configure the activation routes of sub-applications. Add `activeWhen` config to enable **Centralized Routing**。
66
+ **Centralized Routing** is a way to centrally configure the activation routes of sub-applications. Add `activeWhen` config to enable **Centralized Routing**.
67
67
 
68
68
  import MicroRuntimeConfig from "@site-docs-en/components/micro-runtime-config";
69
69