@modern-js/main-doc 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (525) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/index.md +0 -5
  3. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/lint.md +1 -1
  4. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/serve.md +2 -4
  5. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/framework/lambda.md +12 -12
  6. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/api.md +13 -13
  7. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/app.md +0 -2
  8. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/common.md +1 -3
  9. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/app.md +16 -9
  10. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/index_.md +0 -1
  11. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/routes.md +5 -3
  12. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/server.md +6 -4
  13. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/stories.md +2 -2
  14. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/test.md +1 -1
  15. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/app/define-config.md +0 -1
  16. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/hook.md +3 -3
  17. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/bootstrap.md +3 -6
  18. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/create-app.md +1 -3
  19. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-loader.md +2 -2
  20. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-module-apps.md +58 -51
  21. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-runtime-context.md +3 -4
  22. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/index.md +0 -5
  23. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/Provider.md +1 -1
  24. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/connect.md +8 -5
  25. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-store.md +1 -3
  26. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/handle-effect.md +3 -3
  27. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/model_.md +0 -1
  28. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-model.md +0 -3
  29. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-store.md +0 -2
  30. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/router/router.md +23 -54
  31. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/no-ssr.md +1 -8
  32. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/pre-render.md +10 -6
  33. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/render.md +0 -2
  34. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/css-in-js.md +2 -2
  35. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/head.md +3 -5
  36. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/loadable.md +14 -15
  37. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/hook.md +4 -5
  38. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/middleware.md +7 -6
  39. package/en/docusaurus-plugin-content-docs/current/components/command-tip.md +3 -2
  40. package/en/docusaurus-plugin-content-docs/current/components/debug-app.md +17 -0
  41. package/en/docusaurus-plugin-content-docs/current/components/enable-bff.md +10 -14
  42. package/en/docusaurus-plugin-content-docs/current/components/enable-micro-frontend.md +4 -4
  43. package/en/docusaurus-plugin-content-docs/current/components/global-proxy-config.md +6 -9
  44. package/en/docusaurus-plugin-content-docs/current/components/global-proxy.md +0 -1
  45. package/en/docusaurus-plugin-content-docs/current/components/micro-master-manifest-config.md +2 -2
  46. package/en/docusaurus-plugin-content-docs/current/components/micro-runtime-config.md +1 -1
  47. package/en/docusaurus-plugin-content-docs/current/components/prerequisites.md +19 -0
  48. package/en/docusaurus-plugin-content-docs/current/components/reduck-migration.md +0 -1
  49. package/en/docusaurus-plugin-content-docs/current/components/reduck-tip.md +1 -1
  50. package/en/docusaurus-plugin-content-docs/current/components/router-legacy-tip.md +0 -1
  51. package/en/docusaurus-plugin-content-docs/current/configure/app/auto-load-plugin.md +8 -9
  52. package/en/docusaurus-plugin-content-docs/current/configure/app/bff/prefix.md +6 -6
  53. package/en/docusaurus-plugin-content-docs/current/configure/app/bff/proxy.md +8 -9
  54. package/en/docusaurus-plugin-content-docs/current/configure/app/builder-plugins.md +6 -6
  55. package/en/docusaurus-plugin-content-docs/current/configure/app/deploy/microFrontend.md +11 -13
  56. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/asset-prefix.md +2 -2
  57. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/hmr.md +2 -2
  58. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/https.md +2 -2
  59. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/port.md +2 -2
  60. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/progress-bar.md +2 -2
  61. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/proxy.md +0 -1
  62. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/start-url.md +2 -2
  63. package/en/docusaurus-plugin-content-docs/current/configure/app/experiments/lazy-compilation.md +2 -2
  64. package/en/docusaurus-plugin-content-docs/current/configure/app/html/app-icon.md +2 -2
  65. package/en/docusaurus-plugin-content-docs/current/configure/app/html/crossorigin.md +2 -2
  66. package/en/docusaurus-plugin-content-docs/current/configure/app/html/disable-html-folder.md +2 -2
  67. package/en/docusaurus-plugin-content-docs/current/configure/app/html/favicon-by-entries.md +2 -2
  68. package/en/docusaurus-plugin-content-docs/current/configure/app/html/favicon.md +2 -2
  69. package/en/docusaurus-plugin-content-docs/current/configure/app/html/inject-by-entries.md +2 -2
  70. package/en/docusaurus-plugin-content-docs/current/configure/app/html/inject.md +2 -2
  71. package/en/docusaurus-plugin-content-docs/current/configure/app/html/meta-by-entries.md +2 -2
  72. package/en/docusaurus-plugin-content-docs/current/configure/app/html/meta.md +2 -2
  73. package/en/docusaurus-plugin-content-docs/current/configure/app/html/mount-id.md +2 -2
  74. package/en/docusaurus-plugin-content-docs/current/configure/app/html/tags-by-entries.md +12 -0
  75. package/en/docusaurus-plugin-content-docs/current/configure/app/html/tags.md +12 -0
  76. package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-by-entries.md +2 -2
  77. package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-parameters-by-entries.md +2 -2
  78. package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-parameters.md +2 -2
  79. package/en/docusaurus-plugin-content-docs/current/configure/app/html/template.md +2 -2
  80. package/en/docusaurus-plugin-content-docs/current/configure/app/html/title-by-entries.md +2 -2
  81. package/en/docusaurus-plugin-content-docs/current/configure/app/html/title.md +2 -2
  82. package/en/docusaurus-plugin-content-docs/current/configure/app/output/asset-prefix.md +2 -2
  83. package/en/docusaurus-plugin-content-docs/current/configure/app/output/assets-retry.md +2 -2
  84. package/en/docusaurus-plugin-content-docs/current/configure/app/output/charset.md +2 -2
  85. package/en/docusaurus-plugin-content-docs/current/configure/app/output/clean-dist-path.md +2 -2
  86. package/en/docusaurus-plugin-content-docs/current/configure/app/output/convert-to-rem.md +2 -2
  87. package/en/docusaurus-plugin-content-docs/current/configure/app/output/copy.md +2 -2
  88. package/en/docusaurus-plugin-content-docs/current/configure/app/output/css-module-local-ident-name.md +2 -2
  89. package/en/docusaurus-plugin-content-docs/current/configure/app/output/data-uri-limit.md +2 -2
  90. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-css-extract.md +2 -2
  91. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-css-module-extension.md +2 -2
  92. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-filename-hash.md +2 -2
  93. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-inline-runtime-chunk.md +2 -2
  94. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-minimize.md +2 -2
  95. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-node-polyfill.md +8 -6
  96. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-source-map.md +2 -2
  97. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-ts-checker.md +2 -2
  98. package/en/docusaurus-plugin-content-docs/current/configure/app/output/dist-path.md +2 -2
  99. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-asset-fallback.md +2 -2
  100. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-asset-manifest.md +2 -2
  101. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-css-module-tsdeclaration.md +2 -2
  102. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-inline-scripts.md +2 -2
  103. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-inline-styles.md +2 -2
  104. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-latest-decorators.md +2 -2
  105. package/en/docusaurus-plugin-content-docs/current/configure/app/output/externals.md +2 -2
  106. package/en/docusaurus-plugin-content-docs/current/configure/app/output/filename.md +2 -2
  107. package/en/docusaurus-plugin-content-docs/current/configure/app/output/legal-comments.md +2 -2
  108. package/en/docusaurus-plugin-content-docs/current/configure/app/output/override-browserslist.md +2 -2
  109. package/en/docusaurus-plugin-content-docs/current/configure/app/output/polyfill.md +2 -2
  110. package/en/docusaurus-plugin-content-docs/current/configure/app/output/ssg.md +3 -2
  111. package/en/docusaurus-plugin-content-docs/current/configure/app/output/svg-default-export.md +2 -2
  112. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/build-cache.md +2 -2
  113. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/bundle-analyze.md +2 -2
  114. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/chunk-split.md +2 -2
  115. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/print-file-size.md +2 -2
  116. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/profile.md +2 -2
  117. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/remove-console.md +2 -2
  118. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/remove-moment-locale.md +2 -2
  119. package/en/docusaurus-plugin-content-docs/current/configure/app/plugins.md +6 -6
  120. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/intro.md +11 -10
  121. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/master-app.md +1 -2
  122. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/router.md +7 -7
  123. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/state.md +15 -15
  124. package/en/docusaurus-plugin-content-docs/current/configure/app/security/sri.md +2 -2
  125. package/en/docusaurus-plugin-content-docs/current/configure/app/server/base-url.md +3 -4
  126. package/en/docusaurus-plugin-content-docs/current/configure/app/server/enable-framework-ext.md +5 -4
  127. package/en/docusaurus-plugin-content-docs/current/configure/app/server/port.md +24 -4
  128. package/en/docusaurus-plugin-content-docs/current/configure/app/server/public-routes.md +6 -6
  129. package/en/docusaurus-plugin-content-docs/current/configure/app/server/routes.md +7 -7
  130. package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr-by-entries.md +5 -5
  131. package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr.md +4 -4
  132. package/en/docusaurus-plugin-content-docs/current/configure/app/source/alias.md +2 -2
  133. package/en/docusaurus-plugin-content-docs/current/configure/app/source/compile-js-data-uri.md +2 -2
  134. package/en/docusaurus-plugin-content-docs/current/configure/app/source/config-dir.md +2 -2
  135. package/en/docusaurus-plugin-content-docs/current/configure/app/source/define.md +2 -2
  136. package/en/docusaurus-plugin-content-docs/current/configure/app/source/design-system.md +656 -634
  137. package/en/docusaurus-plugin-content-docs/current/configure/app/source/disable-default-entries.md +1 -1
  138. package/en/docusaurus-plugin-content-docs/current/configure/app/source/disable-entry-dirs.md +8 -8
  139. package/en/docusaurus-plugin-content-docs/current/configure/app/source/enable-async-entry.md +1 -1
  140. package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries-dir.md +7 -7
  141. package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries.md +4 -6
  142. package/en/docusaurus-plugin-content-docs/current/configure/app/source/exclude.md +2 -2
  143. package/en/docusaurus-plugin-content-docs/current/configure/app/source/global-vars.md +2 -2
  144. package/en/docusaurus-plugin-content-docs/current/configure/app/source/include.md +2 -2
  145. package/en/docusaurus-plugin-content-docs/current/configure/app/source/module-scopes.md +2 -2
  146. package/en/docusaurus-plugin-content-docs/current/configure/app/source/pre-entry.md +2 -2
  147. package/en/docusaurus-plugin-content-docs/current/configure/app/source/resolve-extension-prefix.md +2 -2
  148. package/en/docusaurus-plugin-content-docs/current/configure/app/source/resolve-main-fields.md +2 -2
  149. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/autoprefixer.md +2 -2
  150. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/babel.md +2 -2
  151. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/css-extract.md +2 -2
  152. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/css-loader.md +2 -2
  153. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/dev-server.md +2 -2
  154. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/html-plugin.md +2 -2
  155. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/inspector.md +2 -2
  156. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/jest.md +9 -9
  157. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/less.md +2 -2
  158. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/minify-css.md +2 -2
  159. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/postcss.md +2 -2
  160. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/pug.md +2 -2
  161. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/sass.md +2 -2
  162. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/style-loader.md +2 -2
  163. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/styled-components.md +2 -2
  164. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/swc.md +12 -1
  165. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/terser.md +2 -2
  166. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/ts-checker.md +2 -2
  167. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/ts-loader.md +2 -2
  168. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/webpack-chain.md +2 -2
  169. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/webpack.md +2 -2
  170. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/frameworks.md +6 -6
  171. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/function.md +44 -38
  172. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/index.md +9 -9
  173. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/type.md +0 -1
  174. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/code-split.md +3 -4
  175. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/compatibility.md +6 -7
  176. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/eslint.md +0 -1
  177. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/index.md +0 -5
  178. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/low-level.md +17 -19
  179. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/ssg.md +8 -10
  180. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/ssr.md +5 -11
  181. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/testing.md +3 -3
  182. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/web-server.md +3 -4
  183. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/alias.md +7 -11
  184. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/css-in-js.md +6 -6
  185. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/css-modules.md +2 -2
  186. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/less-sass.md +1 -2
  187. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/postcss.md +43 -47
  188. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/tailwindcss.md +3 -3
  189. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/data-fetch.md +106 -192
  190. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/env-vars.md +8 -8
  191. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/html.md +55 -47
  192. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/mock.md +4 -4
  193. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/proxy.md +4 -5
  194. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/routes.md +90 -9
  195. package/en/docusaurus-plugin-content-docs/current/guides/concept/entries.md +1 -2
  196. package/en/docusaurus-plugin-content-docs/current/guides/get-started/quick-start.md +2 -2
  197. package/en/docusaurus-plugin-content-docs/current/guides/get-started/upgrade.md +1 -1
  198. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/extend.md +13 -13
  199. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/hook-list.md +2 -2
  200. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/hook.md +57 -54
  201. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/implement.md +11 -11
  202. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/lifecycle.md +0 -1
  203. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/plugin-api.md +4 -4
  204. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/app.md +33 -33
  205. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/ejs.md +3 -3
  206. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/fs.md +3 -3
  207. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/git.md +3 -2
  208. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/handlebars.md +3 -4
  209. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/json.md +9 -12
  210. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/npm.md +2 -3
  211. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/introduce.md +4 -3
  212. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/run-in-js.md +4 -5
  213. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/structure.md +13 -11
  214. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/config/common.md +18 -27
  215. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/abstract.md +1 -4
  216. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/introduce.md +1 -1
  217. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/updateJSONFile.md +4 -5
  218. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/hook/onForged.md +0 -1
  219. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/addInputAfter.md +1 -4
  220. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/addInputBefore.md +1 -3
  221. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/setInput.md +1 -1
  222. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/type.md +1 -1
  223. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/introduce.md +8 -9
  224. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/develop.md +11 -12
  225. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/use.md +8 -8
  226. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/project.md +1 -2
  227. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c01-introduction.md +7 -8
  228. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c02-development.md +18 -21
  229. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c03-main-app.md +41 -44
  230. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c04-communicate.md +7 -5
  231. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c05-mixed-stack.md +1 -1
  232. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/auto-actions.md +0 -1
  233. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/computed-state.md +0 -2
  234. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/define-model.md +3 -6
  235. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/faq.md +2 -5
  236. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/manage-effects.md +2 -5
  237. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/model-communicate.md +1 -4
  238. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/performance.md +1 -5
  239. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/quick-start.md +0 -6
  240. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/redux-integration.md +3 -2
  241. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/test-model.md +1 -1
  242. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/typescript-best-practice.md +13 -14
  243. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/use-model.md +14 -12
  244. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/use-out-of-modernjs.md +4 -6
  245. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c01-start.md +19 -19
  246. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c02-component.md +11 -11
  247. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c03-css.md +52 -55
  248. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c04-routes.md +23 -23
  249. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c05-loader.md +12 -11
  250. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c06-model.md +28 -28
  251. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c07-container.md +25 -26
  252. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c08-entries.md +36 -38
  253. package/en/docusaurus-plugin-content-docs/current.json +3 -47
  254. package/package.json +3 -3
  255. package/scripts/config.ts +4 -2
  256. package/scripts/summary.en.json +1 -1
  257. package/scripts/summary.zh.json +1 -1
  258. package/scripts/sync.ts +1 -1
  259. package/zh/apis/app/commands/index.md +0 -5
  260. package/zh/apis/app/commands/lint.md +1 -1
  261. package/zh/apis/app/commands/serve.md +2 -4
  262. package/zh/apis/app/hooks/api/framework/lambda.md +12 -12
  263. package/zh/apis/app/hooks/api/functions/api.md +13 -13
  264. package/zh/apis/app/hooks/api/functions/app.md +0 -2
  265. package/zh/apis/app/hooks/api/functions/common.md +1 -1
  266. package/zh/apis/app/hooks/index.md +0 -5
  267. package/zh/apis/app/hooks/shared.md +0 -1
  268. package/zh/apis/app/hooks/src/app.md +16 -9
  269. package/zh/apis/app/hooks/src/index_.md +0 -2
  270. package/zh/apis/app/hooks/src/routes.md +6 -7
  271. package/zh/apis/app/hooks/src/server.md +6 -4
  272. package/zh/apis/app/hooks/src/stories.md +1 -1
  273. package/zh/apis/app/hooks/src/test.md +1 -1
  274. package/zh/apis/app/runtime/app/define-config.md +1 -2
  275. package/zh/apis/app/runtime/bff/hook.md +3 -3
  276. package/zh/apis/app/runtime/core/bootstrap.md +2 -3
  277. package/zh/apis/app/runtime/core/use-loader.md +2 -2
  278. package/zh/apis/app/runtime/core/use-module-apps.md +53 -50
  279. package/zh/apis/app/runtime/core/use-runtime-context.md +3 -4
  280. package/zh/apis/app/runtime/index.md +0 -5
  281. package/zh/apis/app/runtime/model/Provider.md +1 -0
  282. package/zh/apis/app/runtime/model/auto-actions.md +1 -1
  283. package/zh/apis/app/runtime/model/connect.md +9 -5
  284. package/zh/apis/app/runtime/model/create-app.md +3 -3
  285. package/zh/apis/app/runtime/model/create-store.md +2 -4
  286. package/zh/apis/app/runtime/model/handle-effect.md +3 -4
  287. package/zh/apis/app/runtime/model/model_.md +0 -3
  288. package/zh/apis/app/runtime/model/use-local-model.md +0 -1
  289. package/zh/apis/app/runtime/model/use-store.md +0 -2
  290. package/zh/apis/app/runtime/router/router.md +23 -53
  291. package/zh/apis/app/runtime/ssr/no-ssr.md +1 -5
  292. package/zh/apis/app/runtime/ssr/pre-render.md +10 -6
  293. package/zh/apis/app/runtime/testing/cleanup.md +2 -2
  294. package/zh/apis/app/runtime/testing/render.md +0 -2
  295. package/zh/apis/app/runtime/utility/css-in-js.md +2 -2
  296. package/zh/apis/app/runtime/utility/head.md +3 -5
  297. package/zh/apis/app/runtime/utility/loadable.md +14 -15
  298. package/zh/apis/app/runtime/web-server/hook.md +5 -4
  299. package/zh/apis/app/runtime/web-server/middleware.md +8 -6
  300. package/zh/apis/monorepo/commands/bump.md +1 -1
  301. package/zh/apis/monorepo/commands/change.md +3 -2
  302. package/zh/apis/monorepo/commands/gen-release-note.md +1 -2
  303. package/zh/apis/monorepo/commands/index.md +1 -6
  304. package/zh/apis/monorepo/commands/lint.md +1 -1
  305. package/zh/apis/monorepo/commands/release.md +0 -1
  306. package/zh/apis/monorepo/hooks/index.md +1 -6
  307. package/zh/components/command-tip.md +3 -2
  308. package/zh/components/enable-bff.md +10 -14
  309. package/zh/components/enable-micro-frontend.md +4 -4
  310. package/zh/components/global-proxy-config.md +6 -9
  311. package/zh/components/global-proxy.md +0 -1
  312. package/zh/components/init-app.md +0 -1
  313. package/zh/components/micro-master-manifest-config.md +2 -2
  314. package/zh/components/micro-runtime-config.md +1 -1
  315. package/zh/components/reduck-migration.md +0 -1
  316. package/zh/components/router-legacy-tip.md +0 -1
  317. package/zh/configure/app/auto-load-plugin.md +9 -10
  318. package/zh/configure/app/bff/prefix.md +6 -10
  319. package/zh/configure/app/bff/proxy.md +9 -8
  320. package/zh/configure/app/builder-plugins.md +6 -6
  321. package/zh/configure/app/deploy/microFrontend.md +11 -11
  322. package/zh/configure/app/dev/asset-prefix.md +2 -2
  323. package/zh/configure/app/dev/hmr.md +2 -2
  324. package/zh/configure/app/dev/https.md +2 -2
  325. package/zh/configure/app/dev/port.md +2 -2
  326. package/zh/configure/app/dev/progress-bar.md +2 -2
  327. package/zh/configure/app/dev/proxy.md +0 -1
  328. package/zh/configure/app/dev/start-url.md +2 -2
  329. package/zh/configure/app/experiments/lazy-compilation.md +2 -2
  330. package/zh/configure/app/html/app-icon.md +2 -2
  331. package/zh/configure/app/html/crossorigin.md +2 -2
  332. package/zh/configure/app/html/disable-html-folder.md +2 -2
  333. package/zh/configure/app/html/favicon-by-entries.md +2 -2
  334. package/zh/configure/app/html/favicon.md +2 -2
  335. package/zh/configure/app/html/inject-by-entries.md +2 -2
  336. package/zh/configure/app/html/inject.md +2 -2
  337. package/zh/configure/app/html/meta-by-entries.md +2 -2
  338. package/zh/configure/app/html/meta.md +2 -2
  339. package/zh/configure/app/html/mount-id.md +2 -2
  340. package/zh/configure/app/html/tags-by-entries.md +12 -0
  341. package/zh/configure/app/html/tags.md +12 -0
  342. package/zh/configure/app/html/template-by-entries.md +2 -2
  343. package/zh/configure/app/html/template-parameters-by-entries.md +2 -2
  344. package/zh/configure/app/html/template-parameters.md +2 -2
  345. package/zh/configure/app/html/template.md +2 -2
  346. package/zh/configure/app/html/title-by-entries.md +2 -2
  347. package/zh/configure/app/html/title.md +2 -2
  348. package/zh/configure/app/output/asset-prefix.md +2 -2
  349. package/zh/configure/app/output/assets-retry.md +2 -2
  350. package/zh/configure/app/output/charset.md +2 -2
  351. package/zh/configure/app/output/clean-dist-path.md +2 -2
  352. package/zh/configure/app/output/convert-to-rem.md +2 -2
  353. package/zh/configure/app/output/copy.md +2 -2
  354. package/zh/configure/app/output/css-module-local-ident-name.md +2 -2
  355. package/zh/configure/app/output/data-uri-limit.md +2 -2
  356. package/zh/configure/app/output/disable-css-extract.md +2 -2
  357. package/zh/configure/app/output/disable-css-module-extension.md +2 -2
  358. package/zh/configure/app/output/disable-filename-hash.md +2 -2
  359. package/zh/configure/app/output/disable-inline-runtime-chunk.md +2 -2
  360. package/zh/configure/app/output/disable-minimize.md +2 -2
  361. package/zh/configure/app/output/disable-node-polyfill.md +8 -8
  362. package/zh/configure/app/output/disable-source-map.md +2 -2
  363. package/zh/configure/app/output/disable-ts-checker.md +2 -2
  364. package/zh/configure/app/output/dist-path.md +2 -2
  365. package/zh/configure/app/output/enable-asset-fallback.md +2 -2
  366. package/zh/configure/app/output/enable-asset-manifest.md +2 -2
  367. package/zh/configure/app/output/enable-css-module-tsdeclaration.md +2 -2
  368. package/zh/configure/app/output/enable-inline-scripts.md +2 -2
  369. package/zh/configure/app/output/enable-inline-styles.md +2 -2
  370. package/zh/configure/app/output/enable-latest-decorators.md +2 -2
  371. package/zh/configure/app/output/externals.md +2 -2
  372. package/zh/configure/app/output/filename.md +2 -2
  373. package/zh/configure/app/output/legal-comments.md +2 -2
  374. package/zh/configure/app/output/override-browserslist.md +2 -2
  375. package/zh/configure/app/output/polyfill.md +2 -2
  376. package/zh/configure/app/output/ssg.md +3 -2
  377. package/zh/configure/app/output/svg-default-export.md +2 -2
  378. package/zh/configure/app/performance/build-cache.md +2 -2
  379. package/zh/configure/app/performance/bundle-analyze.md +2 -2
  380. package/zh/configure/app/performance/chunk-split.md +2 -2
  381. package/zh/configure/app/performance/print-file-size.md +2 -2
  382. package/zh/configure/app/performance/profile.md +2 -2
  383. package/zh/configure/app/performance/remove-console.md +2 -2
  384. package/zh/configure/app/performance/remove-moment-locale.md +2 -2
  385. package/zh/configure/app/plugins.md +6 -6
  386. package/zh/configure/app/runtime/intro.md +39 -11
  387. package/zh/configure/app/runtime/master-app.md +1 -2
  388. package/zh/configure/app/runtime/router.md +6 -7
  389. package/zh/configure/app/runtime/state.md +15 -16
  390. package/zh/configure/app/security/sri.md +2 -2
  391. package/zh/configure/app/server/base-url.md +3 -6
  392. package/zh/configure/app/server/enable-framework-ext.md +5 -4
  393. package/zh/configure/app/server/port.md +24 -6
  394. package/zh/configure/app/server/public-routes.md +6 -8
  395. package/zh/configure/app/server/routes.md +6 -6
  396. package/zh/configure/app/server/ssr-by-entries.md +5 -8
  397. package/zh/configure/app/server/ssr.md +4 -5
  398. package/zh/configure/app/source/alias.md +2 -2
  399. package/zh/configure/app/source/compile-js-data-uri.md +2 -2
  400. package/zh/configure/app/source/config-dir.md +2 -2
  401. package/zh/configure/app/source/define.md +2 -2
  402. package/zh/configure/app/source/design-system.md +656 -630
  403. package/zh/configure/app/source/disable-default-entries.md +3 -3
  404. package/zh/configure/app/source/disable-entry-dirs.md +8 -7
  405. package/zh/configure/app/source/enable-async-entry.md +3 -3
  406. package/zh/configure/app/source/entries-dir.md +7 -7
  407. package/zh/configure/app/source/entries.md +5 -6
  408. package/zh/configure/app/source/exclude.md +2 -2
  409. package/zh/configure/app/source/global-vars.md +2 -2
  410. package/zh/configure/app/source/include.md +2 -2
  411. package/zh/configure/app/source/module-scopes.md +2 -2
  412. package/zh/configure/app/source/pre-entry.md +2 -2
  413. package/zh/configure/app/source/resolve-extension-prefix.md +2 -2
  414. package/zh/configure/app/source/resolve-main-fields.md +2 -2
  415. package/zh/configure/app/testing/transformer.md +2 -3
  416. package/zh/configure/app/tools/autoprefixer.md +2 -2
  417. package/zh/configure/app/tools/babel.md +2 -2
  418. package/zh/configure/app/tools/css-extract.md +2 -2
  419. package/zh/configure/app/tools/css-loader.md +2 -2
  420. package/zh/configure/app/tools/dev-server.md +2 -2
  421. package/zh/configure/app/tools/html-plugin.md +2 -2
  422. package/zh/configure/app/tools/inspector.md +2 -2
  423. package/zh/configure/app/tools/jest.md +9 -9
  424. package/zh/configure/app/tools/less.md +2 -2
  425. package/zh/configure/app/tools/minify-css.md +2 -2
  426. package/zh/configure/app/tools/postcss.md +2 -2
  427. package/zh/configure/app/tools/pug.md +2 -2
  428. package/zh/configure/app/tools/sass.md +2 -2
  429. package/zh/configure/app/tools/style-loader.md +2 -2
  430. package/zh/configure/app/tools/styled-components.md +2 -2
  431. package/zh/configure/app/tools/swc.md +12 -1
  432. package/zh/configure/app/tools/terser.md +2 -2
  433. package/zh/configure/app/tools/ts-checker.md +2 -2
  434. package/zh/configure/app/tools/ts-loader.md +2 -2
  435. package/zh/configure/app/tools/webpack-chain.md +2 -2
  436. package/zh/configure/app/tools/webpack.md +2 -2
  437. package/zh/guides/advanced-features/bff/frameworks.md +6 -6
  438. package/zh/guides/advanced-features/bff/function.md +49 -44
  439. package/zh/guides/advanced-features/bff/index.md +9 -9
  440. package/zh/guides/advanced-features/bff/type.md +0 -1
  441. package/zh/guides/advanced-features/code-split.md +3 -3
  442. package/zh/guides/advanced-features/compatibility.md +6 -7
  443. package/zh/guides/advanced-features/eslint.md +0 -1
  444. package/zh/guides/advanced-features/index.md +0 -5
  445. package/zh/guides/advanced-features/low-level.md +17 -19
  446. package/zh/guides/advanced-features/ssg.md +8 -9
  447. package/zh/guides/advanced-features/ssr.md +5 -11
  448. package/zh/guides/advanced-features/testing.md +3 -2
  449. package/zh/guides/advanced-features/web-server.md +3 -4
  450. package/zh/guides/basic-features/alias.md +7 -11
  451. package/zh/guides/basic-features/css/css-in-js.md +5 -5
  452. package/zh/guides/basic-features/css/css-modules.md +2 -2
  453. package/zh/guides/basic-features/css/postcss.md +42 -46
  454. package/zh/guides/basic-features/css/tailwindcss.md +5 -5
  455. package/zh/guides/basic-features/data-fetch.md +109 -192
  456. package/zh/guides/basic-features/env-vars.md +7 -6
  457. package/zh/guides/basic-features/html.md +54 -46
  458. package/zh/guides/basic-features/index.md +0 -5
  459. package/zh/guides/basic-features/mock.md +4 -4
  460. package/zh/guides/basic-features/proxy.md +4 -5
  461. package/zh/guides/basic-features/routes.md +105 -18
  462. package/zh/guides/concept/entries.md +5 -7
  463. package/zh/guides/get-started/quick-start.md +3 -4
  464. package/zh/guides/topic-detail/changesets/add.md +1 -3
  465. package/zh/guides/topic-detail/changesets/changelog.md +30 -31
  466. package/zh/guides/topic-detail/changesets/commit.md +44 -45
  467. package/zh/guides/topic-detail/changesets/config.md +2 -1
  468. package/zh/guides/topic-detail/changesets/github.md +6 -10
  469. package/zh/guides/topic-detail/changesets/introduce.md +0 -1
  470. package/zh/guides/topic-detail/changesets/release-note.md +9 -12
  471. package/zh/guides/topic-detail/changesets/release-pre.md +1 -1
  472. package/zh/guides/topic-detail/framework-plugin/extend.md +13 -13
  473. package/zh/guides/topic-detail/framework-plugin/hook-list.md +2 -2
  474. package/zh/guides/topic-detail/framework-plugin/hook.md +57 -54
  475. package/zh/guides/topic-detail/framework-plugin/implement.md +11 -11
  476. package/zh/guides/topic-detail/framework-plugin/plugin-api.md +4 -4
  477. package/zh/guides/topic-detail/generator/codesmith/api/app.md +36 -36
  478. package/zh/guides/topic-detail/generator/codesmith/api/ejs.md +2 -2
  479. package/zh/guides/topic-detail/generator/codesmith/api/fs.md +2 -2
  480. package/zh/guides/topic-detail/generator/codesmith/api/git.md +3 -2
  481. package/zh/guides/topic-detail/generator/codesmith/api/handlebars.md +2 -2
  482. package/zh/guides/topic-detail/generator/codesmith/api/json.md +9 -11
  483. package/zh/guides/topic-detail/generator/codesmith/api/npm.md +4 -2
  484. package/zh/guides/topic-detail/generator/codesmith/introduce.md +20 -7
  485. package/zh/guides/topic-detail/generator/codesmith/run-in-js.md +4 -5
  486. package/zh/guides/topic-detail/generator/codesmith/structure.md +13 -10
  487. package/zh/guides/topic-detail/generator/config/common.md +18 -27
  488. package/zh/guides/topic-detail/generator/plugin/abstract.md +1 -1
  489. package/zh/guides/topic-detail/generator/plugin/api/file/introduce.md +1 -0
  490. package/zh/guides/topic-detail/generator/plugin/api/file/updateJSONFile.md +4 -4
  491. package/zh/guides/topic-detail/generator/plugin/api/info/locale.md +1 -1
  492. package/zh/guides/topic-detail/generator/plugin/api/input/addInputAfter.md +2 -2
  493. package/zh/guides/topic-detail/generator/plugin/api/input/addInputBefore.md +3 -4
  494. package/zh/guides/topic-detail/generator/plugin/api/input/setInput.md +1 -1
  495. package/zh/guides/topic-detail/generator/plugin/api/input/type.md +1 -1
  496. package/zh/guides/topic-detail/generator/plugin/api/introduce.md +8 -9
  497. package/zh/guides/topic-detail/generator/plugin/develop.md +13 -13
  498. package/zh/guides/topic-detail/generator/plugin/use.md +8 -8
  499. package/zh/guides/topic-detail/generator/project.md +1 -1
  500. package/zh/guides/topic-detail/micro-frontend/c01-introduction.md +7 -8
  501. package/zh/guides/topic-detail/micro-frontend/c02-development.md +20 -23
  502. package/zh/guides/topic-detail/micro-frontend/c03-main-app.md +41 -44
  503. package/zh/guides/topic-detail/micro-frontend/c04-communicate.md +7 -5
  504. package/zh/guides/topic-detail/micro-frontend/c05-mixed-stack.md +1 -1
  505. package/zh/guides/topic-detail/model/auto-actions.md +0 -1
  506. package/zh/guides/topic-detail/model/computed-state.md +0 -2
  507. package/zh/guides/topic-detail/model/define-model.md +3 -6
  508. package/zh/guides/topic-detail/model/faq.md +2 -5
  509. package/zh/guides/topic-detail/model/manage-effects.md +2 -5
  510. package/zh/guides/topic-detail/model/model-communicate.md +1 -4
  511. package/zh/guides/topic-detail/model/performance.md +1 -5
  512. package/zh/guides/topic-detail/model/quick-start.md +0 -6
  513. package/zh/guides/topic-detail/model/redux-integration.md +3 -2
  514. package/zh/guides/topic-detail/model/test-model.md +1 -1
  515. package/zh/guides/topic-detail/model/typescript-best-practice.md +13 -14
  516. package/zh/guides/topic-detail/model/use-model.md +14 -12
  517. package/zh/guides/topic-detail/model/use-out-of-modernjs.md +4 -6
  518. package/zh/guides/topic-detail/monorepo/intro.md +0 -1
  519. package/zh/guides/topic-detail/monorepo/sub-project-interface.md +14 -7
  520. package/zh/tutorials/first-app/c01-start.md +2 -2
  521. package/zh/tutorials/first-app/c03-css.md +6 -9
  522. package/zh/tutorials/first-app/c04-routes.md +1 -1
  523. package/zh/tutorials/first-app/c05-loader.md +2 -1
  524. package/zh/tutorials/first-app/c07-container.md +6 -7
  525. package/zh/tutorials/first-app/c08-entries.md +5 -7
@@ -1,22 +1,22 @@
1
1
  ---
2
- title: 添加业务模型(状态管理)
2
+ title: Add Model
3
3
  ---
4
4
 
5
- 上一章节中,我们把硬编码的 `mockData` 改成从 Data Loader 中加载。
5
+ In the previous chapter, we changed the hardcoding `mockData` to load from Data Loader.
6
6
 
7
- 这一章节中,我们会进一步实现项目的功能,例如实现 **Archive** 按钮的功能,把联系人归档。
7
+ In this chapter, we will further implement the functions of the project, such as the implementation of the function of the **Archive** button to put the point of contact archive.
8
8
 
9
- 因此会开始编写一些跟 UI 完全无关的业务逻辑,如果继续写在组件代码中,会产生越来越多的面条式代码。为此,我们引入了一种叫做 **业务模型(Model)** 的代码模块,将这些业务逻辑和 UI 解耦。
9
+ Therefore, we will start to write some business logic that has nothing to do with the UI at all. If we continue to write in the component code, more and more noodle code will be generated. To this end, we introduced a code module called **Model** to decoupling these business logic and UI.
10
10
 
11
- :::info
12
- 使用 Model API,需要先设置 [runtime.state](/docs/configure/app/runtime/state) 以启用状态管理插件。
11
+ :::info note
12
+ To use the Model API, you need to set runtime.state(/docs/configure/app/runtime/state) to enable the state management plugin.
13
13
  :::
14
14
 
15
- ## 实现 Model
15
+ ## Model implementation
16
16
 
17
- 创建一个完整的 Model 首先需要定义**状态(state)**,包括状态中数据的名称和初始值。
17
+ To create a complete Model, you first need to define **state**, including the name and initial value of data in the state.
18
18
 
19
- 我们使用 Model 来管理联系人列表的数据,因此定义如下数据状态:
19
+ We use Model to manage the data of the point of contact list, so define the following data state:
20
20
 
21
21
  ```js
22
22
  const state = {
@@ -24,9 +24,9 @@ const state = {
24
24
  };
25
25
  ```
26
26
 
27
- 使用 TS 语法,可以定义更完整的类型信息,比如 items 里每个对象都应该有 `name`、`email` 字段。为了实现归档功能,还需要创建 `archived` 字段保存这个联系人是否已被归档的状态。
27
+ Using TS syntax, you can define more complete type information, such as items in each object should have a `name`, `email` field. In order to implement archive function, also need to create the `archived` field to hold the point of contact has been archived state.
28
28
 
29
- 我们还需要一个字段用来访问所有已归档的联系人,可以定义 **computed** 类型的字段,对已有的数据做转换:
29
+ We also need a field to access all archived points of contact. We can define a field of type **computed** to convert the existing data:
30
30
 
31
31
  ```js
32
32
  const computed = {
@@ -36,13 +36,13 @@ const computed = {
36
36
  };
37
37
  ```
38
38
 
39
- `computed` 类型字段的定义方式是函数,但使用时可以像普通字段一样通过 state 访问。
39
+ Fields of type `computed` are defined as function, but can be accessed through state just like normal fields.
40
40
 
41
41
  :::info
42
- Modern.js 集成了 [Immer](https://immerjs.github.io/immer/),能够像操作 JS 中常规的可变数据一样,去写这种状态转移的逻辑。
42
+ Modern.js integrates [Immer](https://immerjs.github.io/immer/) and can write such state transfer logic just like normal mutable data in JS.
43
43
  :::
44
44
 
45
- 实现 Archive 按钮时,我们需要一个 `archive` 函数,负责修改指定联系人的 `archived` 字段,我们把这种函数都叫作 **action**:
45
+ When implementing the Archive button, we need an `archive` function, which is responsible for modifying the `archived` field of the specified contact. We call this function **action**:
46
46
 
47
47
  ```js
48
48
  const actions = {
@@ -55,11 +55,11 @@ const actions = {
55
55
  };
56
56
  ```
57
57
 
58
- action 函数是一种**纯函数**,确定的输入得到确定的输出(转移后的状态),不应该有任何副作用。
58
+ An action function is a pure function, where a defined input gets a defined output (a shifted state) and should not have any side effects.
59
59
 
60
- 函数的第一个参数是 Immer 提供的 Draft State,第二个参数是 action 被调用时传入的参数(后面会介绍怎么调用)。
60
+ The first parameter of the function is the Draft State provided by Immer, and the second parameter is the parameter passed in when the action is called (more on how to call it later).
61
61
 
62
- 我们尝试完整实现它们:
62
+ We try to implement them completely:
63
63
 
64
64
  ```js
65
65
  const state = {
@@ -84,14 +84,14 @@ const actions = {
84
84
  };
85
85
  ```
86
86
 
87
- 接下来我们把上面的代码连起来,放在同一个 Model 文件里。首先执行以下命令,创建新的文件目录:
87
+ Next we connect the above code and put it in the same Model file. First execute the following command to create a new file directory:
88
88
 
89
89
  ```bash
90
90
  mkdir -p src/models/
91
91
  touch src/models/contacts.ts
92
92
  ```
93
93
 
94
- 添加 `src/models/contacts.ts` 的内容:
94
+ Add `src/models/contacts.ts`:
95
95
 
96
96
  ```tsx
97
97
  import { model } from '@modern-js/runtime/model';
@@ -127,13 +127,13 @@ export default model<State>('contacts').define({
127
127
  });
128
128
  ```
129
129
 
130
- 我们把一个包含 state,action 等要素的 plain object 称作 **Model Spec**,Modern.js 提供了 [Model API](/docs/apis/app/runtime/model/model_),可以根据 Model Spec 生成 **Model**。
130
+ We call a plain object containing elements such as state, action, etc. as **Model Spec**, Modern.js provides [Model API](/docs/apis/app/runtime/model/model_), which can generate **Model** from Model Spec.
131
131
 
132
- ## 使用 Model
132
+ ## Use Model
133
133
 
134
- 现在我们直接使用这个 Model,把项目的逻辑补充起来。
134
+ Now let's use this Model directly to complement the logic of the project.
135
135
 
136
- 首先修改 `src/components/Item/index.tsx`,添加 **Archive 按钮**的 UI 和交互,内容如下:
136
+ First modify `src/components/Item/index.tsx` and add the UI and interaction of the **Archive button**, the content is as follows:
137
137
 
138
138
  ```tsx
139
139
  import Avatar from '../Avatar';
@@ -181,7 +181,7 @@ const Item = ({
181
181
  export default Item;
182
182
  ```
183
183
 
184
- 接下来,我们修改 `src/routes/page.tsx`,为 `<Item>` 组件传递更多参数:
184
+ Next, we modify `src/routes/page.tsx` to pass more parameters to the `<Item>` component:
185
185
 
186
186
  ```tsx
187
187
  import { Helmet } from '@modern-js/runtime/head';
@@ -249,12 +249,12 @@ function Index() {
249
249
  export default Index;
250
250
  ```
251
251
 
252
- `useModel` Modern.js 提供的 hooks API。可以在组件中提供 Model 中定义的 state,或通过 actions 调用 Model 中定义的 side effect action,从而改变 Model state
252
+ `useModel` is the hooks API provided by the Modern.js. You can provide the state defined in the Model in the component, or call the side effects and actions defined in the Model through actions to change the state of the Model.
253
253
 
254
- Model 是业务逻辑,是计算过程,本身不创建也不持有状态。只有在被组件用 hooks API 使用后,才在指定的地方创建状态。
254
+ Model is business logic, a computational process that does not create or hold state itself. Only after being used by the component with the hooks API, the state is created in the specified place.
255
255
 
256
- 执行 `pnpm run dev`,点击 **Archive 按钮**,可以看到页面 UI 发生了变化。
256
+ Execute `pnpm run dev` and click the **Archive button** to see that the page UI has changed.
257
257
 
258
258
  :::note
259
- 上述例子中,`useLoaderData` 其实在每次切换路由时都会执行。因为我们在 Data Loader 里使用了 fake 数据,每次返回的数据是不同的。但我们优先使用了 Model 中的数据,因此切换路由时数据没有发生改变。
259
+ In the above example, `useLoaderData` is actually executed every time the route is switched. Because we used fake data in the Data Loader, the data returned each time is different. But we use the data in the Model first, so the data does not change when switching routes.
260
260
  :::
@@ -1,19 +1,19 @@
1
1
  ---
2
- title: 添加容器组件
2
+ title: Add Container
3
3
  ---
4
4
 
5
5
  import Tabs from '@theme/Tabs';
6
6
  import TabItem from '@theme/TabItem';
7
7
 
8
- 上一章节中,我们初步引入**业务模型**,从 UI 组件中拆分出这部分逻辑。`page.tsx` 中不再包含 UI 无关的业务逻辑实现细节,只需要使用 Model,就能实现同样的功能。
8
+ In the previous chapter, we initially introduced the **model** to split this part of the logic from the UI component. The `page.tsx` no longer contains UI-independent business logic implementation details, and only needs to use the Model to implement the same function.
9
9
 
10
- 这一章节中,我们要进一步利用 Model 中实现的业务逻辑,让 `page.tsx` `archived/page.tsx` 获取同一份数据。并实现 Archive 按钮,点击按钮能把联系人归档,只显示在 Archives 列表里,不显示在 All 列表里。
10
+ In this chapter, we will further use the business logic of implementation in Model to let `page.tsx` and `archived/page.tsx` get the same data. And implementation Archive button, click the button to display the point of contact archive only in the Archives list, not in the All list.
11
11
 
12
- ## 使用完整 Model
12
+ ## Use the full Model
13
13
 
14
- 因为两个页面需要共用同一套状态(联系人列表数据、联系人是否被归档),都需要包含加载初始数据的逻辑,因此我们需要在更上一层完成数据获取。
14
+ Because the two pages need to share the same set of state (point of contact tabular data, point of contact is archived or not), both need to contain the logic to load the initial data, so we need to complete the data acquisition at a higher level.
15
15
 
16
- Modern.js 支持在 `layout.tsx` 通过 Data Loader 获取数据,我们先数据获取这部分代码移动到 `src/routes/layout.tsx` 中:
16
+ Modern.js support obtaining data through Data Loader in `layout.tsx`, we first move the data acquisition part of the code to `src/routes/layout.tsx`:
17
17
 
18
18
  ```tsx
19
19
  import { name, internet } from 'faker';
@@ -69,7 +69,7 @@ export default function Layout() {
69
69
  }
70
70
  ```
71
71
 
72
- `src/routes/page.tsx` 中,直接使用 Model,获取数据:
72
+ In `src/routes/page.tsx`, use Model directly to get data:
73
73
 
74
74
  ```tsx
75
75
  import { Helmet } from '@modern-js/runtime/head';
@@ -105,7 +105,7 @@ function Index() {
105
105
  export default Index;
106
106
  ```
107
107
 
108
- 同样在 `archived/page.tsx` 中,删除原本的 `mockData` 逻辑,使用 Model computed `archived` 值作为数据源:
108
+ Also in `archived/page.tsx`, delete the original `mockData` logic and use the `archived` value computed in Model as the data source:
109
109
 
110
110
  ```tsx
111
111
  import { Helmet } from '@modern-js/runtime/head';
@@ -141,21 +141,21 @@ function Index() {
141
141
  export default Index;
142
142
  ```
143
143
 
144
- 执行 `pnpm run dev`,访问 `http://localhost:8080/`,点击 Archive 按钮后,可以看到按钮置灰:
144
+ Execute `pnpm run dev`, visit `http://localhost:8080/`, click the Archive button, you can see the button grey out:
145
145
 
146
146
  ![display](https://lf3-static.bytednsdoc.com/obj/eden-cn/nuvjhpqnuvr/modern-website/tutorials/c07-contacts-all.png)
147
147
 
148
- 接下来点击顶部导航,切换到 Archives 列表,可以发现刚才 **Archive** 的联系人已经出现在列表当中:
148
+ Next, click the top navigation and switch to the Archives list. You can find that the point of contact of **Archive** just now has appeared in the list:
149
149
 
150
150
  ![display](https://lf3-static.bytednsdoc.com/obj/eden-cn/nuvjhpqnuvr/modern-website/tutorials/c07-contacts-archives.png)
151
151
 
152
- ## 抽离容器组件
152
+ ## Withdraw container components
153
153
 
154
- 前面章节中,我们把项目中的业务逻辑拆分成了两个 layer,一个是**视图组件**,另一个是**业务模块**。前者负责 UI 展示、交互等,后者负责实现 UI 无关的业务逻辑,专门管理状态。
154
+ In the previous chapters, we split the business logic in the project into two layers, one is the **view component**, and the other is the **module**. The former is responsible for UI display, interaction, etc., and the latter is responsible for the implementation of UI-independent business logic, which specializes in managing state.
155
155
 
156
- `src/routes/page.tsx` `src/routes/archives/page.tsx` 这样使用了 `useModel` API 的组件,负责把 View Model 这两个 layer 连接起来,类似传统 MVC 架构中 Controller 的角色,在 Modern.js 里我们沿用习惯,把它们称作**容器组件(Container)**。
156
+ Like `src/routes/page.tsx` and `src/routes/archives/page.tsx` use the component of the `useModel` API, which is responsible for linking the two layers of View and Model, similar to the role of the Controller in the traditional MVC architecture. In the Modern.js, we follow the habit and call them **Container**.
157
157
 
158
- 容器组件推荐放在专门的 `containers/` 目录里,我们执行以下命令,创建新的文件:
158
+ The container component is recommended to be placed in a special `containers/` directory. We execute the following command to create a new file:
159
159
 
160
160
  <Tabs>
161
161
  <TabItem value="macOS" label="macOS" default>
@@ -176,13 +176,13 @@ ni src/containers/Contacts.tsx
176
176
  </TabItem>
177
177
  </Tabs>
178
178
 
179
- 我们将原本两个 `page.tsx` 中公共的部分抽离出来,`src/containers/Contacts.tsx` 的代码如下:
179
+ We extracted the common part of the original two `page.tsx`, and the code of `src/containers/Contacts.tsx` is as follows:
180
180
 
181
181
  ```tsx
182
- import { Helmet } from "@modern-js/runtime/head";
183
- import { useModel } from "@modern-js/runtime/model";
184
- import { List } from "antd";
185
- import Item from "../components/Item";
182
+ import { Helmet } from '@modern-js/runtime/head';
183
+ import { useModel } from '@modern-js/runtime/model';
184
+ import { List } from 'antd';
185
+ import Item from '../components/Item';
186
186
  import { Helmet } from '@modern-js/runtime/head';
187
187
  import { useModel } from '@modern-js/runtime/model';
188
188
  import { List } from 'antd';
@@ -222,7 +222,7 @@ function Contacts({
222
222
  export default Contacts;
223
223
  ```
224
224
 
225
- 修改 `src/routes/page.tsx` `src/routes/archives/page.tsx` 的代码:
225
+ Modify the code for `src/routes/page.tsx` and `src/routes/archives/page.tsx`:
226
226
 
227
227
  ```tsx title="src/routes/page.tsx"
228
228
  import Contacts from '../containers/Contacts';
@@ -244,9 +244,9 @@ function Index() {
244
244
  export default Index;
245
245
  ```
246
246
 
247
- 重构完成,现在的项目结构是:
247
+ The refactoring is complete, and the current project structure is:
248
248
 
249
- ```md
249
+ ```bash
250
250
  .
251
251
  ├── README.md
252
252
  ├── dist
@@ -275,9 +275,8 @@ export default Index;
275
275
  └── tsconfig.json
276
276
  ```
277
277
 
278
- `components/` 里的**视图组件**,都是目录形式,如 `Avatar/index.tsx`。而 `containers/` 里的**容器组件**,都是单文件形式,如 `contacts.tsx`。**这是我们推荐的一种最佳实践**。
279
-
280
- 在​ [添加 UI 组件(Component)](./c02-component.md) 章节提到过,视图组件用目录形式,是因为视图组件负责实现 UI 展示和交互细节,可以演变的复杂。用目录形式,可以方便增加子文件,包括专用的资源(图片等)、专用子组件、CSS 文件等。在这个目录内部可以随意重构,只考虑最小局部。
278
+ The **view components** in `components/` dir are in the form of directories, such as `Avatar/index.tsx`. And the **container components** in `containers/` dir are in the form of single files, such as `contacts.tsx`. **This is a best practice we recommend**.
281
279
 
282
- 而容器组件只负责连接,是一个胶水层,复杂的业务逻辑和实现细节都交给 View 层和 Model 层去实现。容器组件自己应该保持简单清晰,不应该包含复杂实现细节,所以不应该有内部结构。采用单文件形式不但更简洁,也能起到约束作用,提醒开发者不要把容器组件写复杂。
280
+ As mentioned in the chapter [Add UI component](./c02-component.md), the view component is in the form of a directory, because the view component is responsible for the implementation of UI display and interaction details, and can evolve in complexity. In the form of a directory, it is convenient to add sub-files, including dedicated resources (pictures, etc.), dedicated sub-components, CSS files, etc. You can reconstruct at will within this directory, considering only the smallest parts.
283
281
 
282
+ The container component is only responsible for linkage and is a glue layer. The sophisticated business logic and implementation details are handed over to the View layer and the Model layer for implementation. The container component itself should be kept simple and clear, and should not contain complex implementation details, so there should be no internal structure. The single-file form is not only more concise, but also acts as a constraint, reminding developers not to write complicated container components.
@@ -1,26 +1,26 @@
1
1
  ---
2
- title: 添加应用入口
2
+ title: Add Application Entry
3
3
  ---
4
4
 
5
- 上一个章节中,我们基本完成了联系人列表应用的开发,介绍了 Modern.js 中部分功能的用法,以及推荐的最佳实践。
5
+ In the last chapter, we basically completed the development of the point of contact list application, introduced the usage of some functions in the Modern.js, and recommended best practices.
6
6
 
7
- 这一章节中,我们将介绍如何为应用添加新的入口。
7
+ In this chapter, we will describe how to add a new entry to the application.
8
8
 
9
- ## 新建入口
9
+ ## New entry
10
10
 
11
- 一个完整的项目可能需要多个入口,Modern.js 支持自动创建新入口,前面的章节中提到过,`pnpm run new` 可以启用可选功能。
11
+ A complete project may require multiple entries, Modern.js supports the automatic creation of new entries, as mentioned in the previous section, `pnpm run new` can enable optional features.
12
12
 
13
- 我们也可以通过它来创建新的工程元素,在项目根目录下执行 `pnpm run new`:
13
+ We can also use it to create new project elements and execute `pnpm run new` in the project root directory:
14
14
 
15
15
  ```bash
16
- ? 请选择你想要的操作 创建工程元素
17
- ? 创建工程元素 新建「应用入口」
18
- ? 请填写入口名称 (entry) landing-page
16
+ ? Action Create project element
17
+ ? Create project element New "entry"
18
+ ? Entry name (entry) landing-page
19
19
  ```
20
20
 
21
- 创建完成,项目会变成这样:
21
+ When created, the project will look like this:
22
22
 
23
- ```md
23
+ ```bash
24
24
  .
25
25
  ├── README.md
26
26
  ├── modern.config.ts
@@ -52,51 +52,49 @@ title: 添加应用入口
52
52
  │   └── styles
53
53
  │   └── utils.css
54
54
  └── tsconfig.json
55
-
56
55
  ```
57
56
 
58
- 可以看到联系人列表应用的文件,都被自动重构到 `src/myapp/` 里。
57
+ You can see that the files of the contact list application are automatically refactored into `src/myapp/`.
59
58
 
60
- 同时新建了一个 `src/landing-page/`,里面同样有 `routes/*`(`pnpm run new` 命令只做了这些事,所以你也可以很容易的手动创建新入口或修改入口)
59
+ At the same time, a new `src/landing-page/` is created, which also has `routes/*` (the `pnpm run new` command only does these things, so you can also easily create new entries or modify entries manually).
61
60
 
62
- 执行 `pnpm run dev`,显示:
61
+ Execute `pnpm run dev` to display:
63
62
 
64
63
  ![design](https://lf3-static.bytednsdoc.com/obj/eden-cn/nuvjhpqnuvr/modern-website/tutorials/c08-entries-myapp.png)
65
64
 
66
- 访问 `http://localhost:8080/`,可以像之前一样看到应用程序。
65
+ Access `http://localhost:8080/` to see the application as before.
67
66
 
68
- 访问 `http://localhost:8080/landing-page`,可以看到刚创建的新入口 `landing-page` 的页面(Modern.js 自动生成的默认页面)。
67
+ Visit `http://localhost:8080/landing-page` to see the landing-page for the new entry you just created (Modern.js automatically generated default page).
69
68
 
70
- Modern.js 框架的设计原则之一是【[约定优于配置(Convention over Configuration](https://en.wikipedia.org/wiki/Convention_over_configuration)】,多数情况下可以按约定直接写代码,不需要做任何配置,这里 `src/` 中的目录结构就是一种约定:
69
+ One of the design principles of the Modern.js framework is [[Convention over Configuration](https://en.wikipedia.org/wiki/Convention_over_configuration) ]. In most cases, you can write code directly by convention without any configuration. The directory structure in `src/` is a convention:
71
70
 
72
- `src/myapp/` `src/landing-page/` 被自动识别为两个应用入口:myapp landing-page
71
+ `src/myapp/` and `src/landing-page/` are automatically identified as two application portals: myapp and landing-page.
73
72
 
74
- 其中 `src/myapp/` 的目录名跟项目名(`package.json` 里的 `name`)一致,会被认为是项目**主入口**,项目 URL 的根路径(开发环境里默认是 `http://localhost:8080/`)会自动指向主入口。
73
+ The directory name of `src/myapp/` is the same as the project name (`name` in `package.json`), which will be considered as the main entry of the project, and the root path of the project URL (the default in the development environment is `http://localhost:8080/`) will automatically point to the main entry.
75
74
 
76
- 其他入口的 URL,是在根路径后追加入口名,比如 `http://localhost:8080/landing-page`。
75
+ The URL of other entries is to append the entry name after the root path, such as `http://localhost:8080/landing-page`.
77
76
 
78
- 接下来,我们把 `src/myapp/` 重命名为 `src/contacts/`:
77
+ Next, we rename `src/myapp/` to `src/contacts/`:
79
78
 
80
79
  ```bash
81
80
  mv src/myapp src/contacts
82
81
  ```
83
82
 
84
- 再次执行 `pnpm run dev`,结果变成:
83
+ Execute `pnpm run dev` again, the result becomes:
85
84
 
86
85
  ![design](https://lf3-static.bytednsdoc.com/obj/eden-cn/nuvjhpqnuvr/modern-website/tutorials/c08-entries-contacts.png)
87
86
 
88
- 现在不再有主入口,联系人列表现在是一个普通入口,需要用 `http://localhost:8080/contacts` 访问。
89
-
87
+ There is no longer a main entry, the point of contact list is now a normal entry that needs to be accessed with `http://localhost:8080/contacts`.
90
88
 
91
- ## 按入口修改配置
89
+ ## Modify the configuration by entry
92
90
 
93
- 我们可以在 Modern.js 配置文件里,自己写代码来控制项目的配置。
91
+ In the Modern.js configuration file, we can write our own code to control the configuration of the project.
94
92
 
95
- 现在,修改 `modern.config.ts` 里面添加内容:
93
+ Now, modify the `modern.config.ts` to add something:
96
94
 
97
- ```typescript
98
- import AppToolsPlugin, { defineConfig } from '@modern-js/app-tools';
99
- import TailwindCSSPlugin from '@modern-js/plugin-tailwindcss';
95
+ ```ts
96
+ import appTools, { defineConfig } from '@modern-js/app-tools';
97
+ import tailwindcssPlugin from '@modern-js/plugin-tailwindcss';
100
98
 
101
99
  // https://modernjs.dev/docs/apis/app/config
102
100
  export default defineConfig({
@@ -110,15 +108,15 @@ export default defineConfig({
110
108
  'landing-page': false,
111
109
  },
112
110
  },
113
- plugins: [AppToolsPlugin(), TailwindCSSPlugin()],
111
+ plugins: [appTools(), tailwindcssPlugin()],
114
112
  });
115
113
  ```
116
114
 
117
- 执行 `pnpm run dev`,再用浏览器打开 `view-source:http://localhost:8080/landing-page`,可以看到 `landing-page` 网页内容是通过 js 动态加载的,且此页面的 SSR 功能被关闭。
115
+ Execute `pnpm run dev`, and then open `view-source: http://localhost:8080/landing-page` with the browser, you can see that the content of the `landing-page` web page is dynamically loaded through js, and the SSR function of this page is turned off.
118
116
 
119
- 如果注释掉 `ssrByEntries` 和它的值,landing-page SSR 功能就恢复开启了。
117
+ If `ssrByEntries` and its value are annotated, the SSR function of landing-page is restored.
120
118
 
121
- 还有一些时候,需要一些更复杂的逻辑来做设置,比如需要 JS 变量、表达式、导入模块等,例如在只在开发环境里开启 SSR
119
+ Other times, you need some more sophisticated logic to do the setup, such as JS variables, expressions, import modules, etc., for example, only in the development environment to enable SSR:
122
120
 
123
121
  ```js
124
122
  export default defineConfig({
@@ -130,8 +128,8 @@ export default defineConfig({
130
128
  };
131
129
  ```
132
130
 
133
- 到底为止,我们的联系人列表应用的雏形就基本完成了 👏👏👏。
131
+ So far, the prototype of our point of contact list application is almost complete 👏👏👏.
134
132
 
135
- ## 下一步
133
+ ## Next step
136
134
 
137
- 接下来你可以通过了解[指南](/docs/guides/get-started/quick-start)[配置](/docs/configure/app/usage) 等更多教程,进一步完善你的应用。
135
+ Then you can further refine your application by following more tutorials like [Guides](/docs/guides/get-started/quick-start), [configuration](/docs/configure/app/usage), and more.
@@ -7,53 +7,9 @@
7
7
  "message": "Basic",
8
8
  "description": "The label for category 基础 in sidebar tutorialsSidebar"
9
9
  },
10
- "sidebar.tutorialsSidebar.category.创建第一个应用": {
11
- "message": "创建第一个应用",
12
- "description": "The label for category 创建第一个应用 in sidebar tutorialsSidebar"
13
- },
14
- "sidebar.tutorialsSidebar.category.1: 手动创建应用工程": {
15
- "message": "1: 手动创建应用工程",
16
- "description": "The label for category 1: 手动创建应用工程 in sidebar tutorialsSidebar"
17
- },
18
- "sidebar.tutorialsSidebar.category.2: 自动创建应用工程": {
19
- "message": "2: 自动创建应用工程",
20
- "description": "The label for category 2: 自动创建应用工程 in sidebar tutorialsSidebar"
21
- },
22
- "sidebar.tutorialsSidebar.category.3: 确认编程环境": {
23
- "message": "3: 确认编程环境",
24
- "description": "The label for category 3: 确认编程环境 in sidebar tutorialsSidebar"
25
- },
26
- "sidebar.tutorialsSidebar.category.4: 写 JS 代码": {
27
- "message": "4: 写 JS 代码",
28
- "description": "The label for category 4: 写 JS 代码 in sidebar tutorialsSidebar"
29
- },
30
- "sidebar.tutorialsSidebar.category.5: 使用 UI 组件": {
31
- "message": "5: 使用 UI 组件",
32
- "description": "The label for category 5: 使用 UI 组件 in sidebar tutorialsSidebar"
33
- },
34
- "sidebar.tutorialsSidebar.category.6: 添加 UI 组件": {
35
- "message": "6: 添加 UI 组件",
36
- "description": "The label for category 6: 添加 UI 组件 in sidebar tutorialsSidebar"
37
- },
38
- "sidebar.tutorialsSidebar.category.7: 添加应用入口": {
39
- "message": "7: 添加应用入口",
40
- "description": "The label for category 7: 添加应用入口 in sidebar tutorialsSidebar"
41
- },
42
- "sidebar.tutorialsSidebar.category.8: 添加客户端路由": {
43
- "message": "8: 添加客户端路由",
44
- "description": "The label for category 8: 添加客户端路由 in sidebar tutorialsSidebar"
45
- },
46
- "sidebar.tutorialsSidebar.category.9: 添加 BFF": {
47
- "message": "9: 添加 BFF",
48
- "description": "The label for category 9: 添加 BFF in sidebar tutorialsSidebar"
49
- },
50
- "sidebar.tutorialsSidebar.category.10: 添加业务模型": {
51
- "message": "10: 添加业务模型",
52
- "description": "The label for category 10: 添加业务模型 in sidebar tutorialsSidebar"
53
- },
54
- "sidebar.tutorialsSidebar.category.11: 添加容器组件": {
55
- "message": "11: 添加容器组件",
56
- "description": "The label for category 11: 添加容器组件 in sidebar tutorialsSidebar"
10
+ "sidebar.tutorialsSidebar.category.联系人列表应用": {
11
+ "message": "First App",
12
+ "description": "The label for category 联系人列表应用 in sidebar tutorialsSidebar"
57
13
  },
58
14
  "sidebar.guidesSidebar.category.开始": {
59
15
  "message": "Start",
package/package.json CHANGED
@@ -11,20 +11,20 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.2",
14
+ "version": "2.1.0",
15
15
  "publishConfig": {
16
16
  "registry": "https://registry.npmjs.org/",
17
17
  "access": "public"
18
18
  },
19
19
  "peerDependencies": {
20
- "@modern-js/builder-doc": "^2.0.2"
20
+ "@modern-js/builder-doc": "^2.1.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "ts-node": "^10",
24
24
  "fs-extra": "^10",
25
25
  "@types/node": "^16",
26
26
  "@types/fs-extra": "^9",
27
- "@modern-js/builder-doc": "2.0.2"
27
+ "@modern-js/builder-doc": "2.1.0"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "npx ts-node ./scripts/sync.ts"
package/scripts/config.ts CHANGED
@@ -16,6 +16,8 @@ export type Language = 'en' | 'zh';
16
16
  const createMarkdown = (summary: Summary, lng: Language) => {
17
17
  const { name, dirname } = summary;
18
18
 
19
+ const langPrefix = lng === 'zh' ? '' : `/${lng}`;
20
+
19
21
  return `---
20
22
  title: ${dirname}.${name}
21
23
  sidebar_label: ${name}
@@ -24,10 +26,10 @@ sidebar_label: ${name}
24
26
  :::info BUILDER
25
27
  ${
26
28
  tip[lng]
27
- } [${dirname}.${name}](https://modernjs.dev/builder/zh/api/config-${dirname}.html#${dirname}-${name.toLowerCase()})。
29
+ } [${dirname}.${name}](https://modernjs.dev/builder${langPrefix}/api/config-${dirname}.html#${dirname}-${name.toLowerCase()})。
28
30
  :::
29
31
 
30
- import Main from '@modern-js/builder-doc/${lng}/config/${dirname}/${name}.md'
32
+ import Main from '@modern-js/builder-doc/docs/${lng}/config/${dirname}/${name}.md'
31
33
 
32
34
  <Main />
33
35
  `;
@@ -1 +1 @@
1
- [{"name":"assetPrefix","dirname":"dev"},{"name":"hmr","dirname":"dev"},{"name":"https","dirname":"dev"},{"name":"port","dirname":"dev"},{"name":"progressBar","dirname":"dev"},{"name":"startUrl","dirname":"dev"},{"name":"lazyCompilation","dirname":"experiments"},{"name":"appIcon","dirname":"html"},{"name":"crossorigin","dirname":"html"},{"name":"disableHtmlFolder","dirname":"html"},{"name":"favicon","dirname":"html"},{"name":"faviconByEntries","dirname":"html"},{"name":"inject","dirname":"html"},{"name":"injectByEntries","dirname":"html"},{"name":"meta","dirname":"html"},{"name":"metaByEntries","dirname":"html"},{"name":"mountId","dirname":"html"},{"name":"template","dirname":"html"},{"name":"templateByEntries","dirname":"html"},{"name":"templateParameters","dirname":"html"},{"name":"templateParametersByEntries","dirname":"html"},{"name":"title","dirname":"html"},{"name":"titleByEntries","dirname":"html"},{"name":"assetPrefix","dirname":"output"},{"name":"assetsRetry","dirname":"output"},{"name":"charset","dirname":"output"},{"name":"cleanDistPath","dirname":"output"},{"name":"convertToRem","dirname":"output"},{"name":"copy","dirname":"output"},{"name":"cssModuleLocalIdentName","dirname":"output"},{"name":"dataUriLimit","dirname":"output"},{"name":"disableCssExtract","dirname":"output"},{"name":"disableCssModuleExtension","dirname":"output"},{"name":"disableFilenameHash","dirname":"output"},{"name":"disableInlineRuntimeChunk","dirname":"output"},{"name":"disableMinimize","dirname":"output"},{"name":"disableSourceMap","dirname":"output"},{"name":"disableTsChecker","dirname":"output"},{"name":"distPath","dirname":"output"},{"name":"enableAssetFallback","dirname":"output"},{"name":"enableAssetManifest","dirname":"output"},{"name":"enableCssModuleTSDeclaration","dirname":"output"},{"name":"enableInlineScripts","dirname":"output"},{"name":"enableInlineStyles","dirname":"output"},{"name":"enableLatestDecorators","dirname":"output"},{"name":"externals","dirname":"output"},{"name":"filename","dirname":"output"},{"name":"legalComments","dirname":"output"},{"name":"overrideBrowserslist","dirname":"output"},{"name":"polyfill","dirname":"output"},{"name":"svgDefaultExport","dirname":"output"},{"name":"buildCache","dirname":"performance"},{"name":"bundleAnalyze","dirname":"performance"},{"name":"chunkSplit","dirname":"performance"},{"name":"printFileSize","dirname":"performance"},{"name":"profile","dirname":"performance"},{"name":"removeConsole","dirname":"performance"},{"name":"removeMomentLocale","dirname":"performance"},{"name":"sri","dirname":"security"},{"name":"alias","dirname":"source"},{"name":"compileJsDataURI","dirname":"source"},{"name":"define","dirname":"source"},{"name":"exclude","dirname":"source"},{"name":"globalVars","dirname":"source"},{"name":"include","dirname":"source"},{"name":"moduleScopes","dirname":"source"},{"name":"preEntry","dirname":"source"},{"name":"resolveExtensionPrefix","dirname":"source"},{"name":"resolveMainFields","dirname":"source"},{"name":"autoprefixer","dirname":"tools"},{"name":"babel","dirname":"tools"},{"name":"cssExtract","dirname":"tools"},{"name":"cssLoader","dirname":"tools"},{"name":"devServer","dirname":"tools"},{"name":"htmlPlugin","dirname":"tools"},{"name":"inspector","dirname":"tools"},{"name":"less","dirname":"tools"},{"name":"minifyCss","dirname":"tools"},{"name":"postcss","dirname":"tools"},{"name":"pug","dirname":"tools"},{"name":"sass","dirname":"tools"},{"name":"styleLoader","dirname":"tools"},{"name":"styledComponents","dirname":"tools"},{"name":"terser","dirname":"tools"},{"name":"tsChecker","dirname":"tools"},{"name":"tsLoader","dirname":"tools"},{"name":"webpack","dirname":"tools"},{"name":"webpackChain","dirname":"tools"}]
1
+ [{"name":"assetPrefix","dirname":"dev"},{"name":"hmr","dirname":"dev"},{"name":"https","dirname":"dev"},{"name":"port","dirname":"dev"},{"name":"progressBar","dirname":"dev"},{"name":"startUrl","dirname":"dev"},{"name":"lazyCompilation","dirname":"experiments"},{"name":"appIcon","dirname":"html"},{"name":"crossorigin","dirname":"html"},{"name":"disableHtmlFolder","dirname":"html"},{"name":"favicon","dirname":"html"},{"name":"faviconByEntries","dirname":"html"},{"name":"inject","dirname":"html"},{"name":"injectByEntries","dirname":"html"},{"name":"meta","dirname":"html"},{"name":"metaByEntries","dirname":"html"},{"name":"mountId","dirname":"html"},{"name":"tags","dirname":"html"},{"name":"tagsByEntries","dirname":"html"},{"name":"template","dirname":"html"},{"name":"templateByEntries","dirname":"html"},{"name":"templateParameters","dirname":"html"},{"name":"templateParametersByEntries","dirname":"html"},{"name":"title","dirname":"html"},{"name":"titleByEntries","dirname":"html"},{"name":"assetPrefix","dirname":"output"},{"name":"assetsRetry","dirname":"output"},{"name":"charset","dirname":"output"},{"name":"cleanDistPath","dirname":"output"},{"name":"convertToRem","dirname":"output"},{"name":"copy","dirname":"output"},{"name":"cssModuleLocalIdentName","dirname":"output"},{"name":"dataUriLimit","dirname":"output"},{"name":"disableCssExtract","dirname":"output"},{"name":"disableCssModuleExtension","dirname":"output"},{"name":"disableFilenameHash","dirname":"output"},{"name":"disableInlineRuntimeChunk","dirname":"output"},{"name":"disableMinimize","dirname":"output"},{"name":"disableSourceMap","dirname":"output"},{"name":"disableTsChecker","dirname":"output"},{"name":"distPath","dirname":"output"},{"name":"enableAssetFallback","dirname":"output"},{"name":"enableAssetManifest","dirname":"output"},{"name":"enableCssModuleTSDeclaration","dirname":"output"},{"name":"enableInlineScripts","dirname":"output"},{"name":"enableInlineStyles","dirname":"output"},{"name":"enableLatestDecorators","dirname":"output"},{"name":"externals","dirname":"output"},{"name":"filename","dirname":"output"},{"name":"legalComments","dirname":"output"},{"name":"overrideBrowserslist","dirname":"output"},{"name":"polyfill","dirname":"output"},{"name":"svgDefaultExport","dirname":"output"},{"name":"buildCache","dirname":"performance"},{"name":"bundleAnalyze","dirname":"performance"},{"name":"chunkSplit","dirname":"performance"},{"name":"printFileSize","dirname":"performance"},{"name":"profile","dirname":"performance"},{"name":"removeConsole","dirname":"performance"},{"name":"removeMomentLocale","dirname":"performance"},{"name":"sri","dirname":"security"},{"name":"alias","dirname":"source"},{"name":"compileJsDataURI","dirname":"source"},{"name":"define","dirname":"source"},{"name":"exclude","dirname":"source"},{"name":"globalVars","dirname":"source"},{"name":"include","dirname":"source"},{"name":"moduleScopes","dirname":"source"},{"name":"preEntry","dirname":"source"},{"name":"resolveExtensionPrefix","dirname":"source"},{"name":"resolveMainFields","dirname":"source"},{"name":"autoprefixer","dirname":"tools"},{"name":"babel","dirname":"tools"},{"name":"cssExtract","dirname":"tools"},{"name":"cssLoader","dirname":"tools"},{"name":"devServer","dirname":"tools"},{"name":"htmlPlugin","dirname":"tools"},{"name":"inspector","dirname":"tools"},{"name":"less","dirname":"tools"},{"name":"minifyCss","dirname":"tools"},{"name":"postcss","dirname":"tools"},{"name":"pug","dirname":"tools"},{"name":"sass","dirname":"tools"},{"name":"styleLoader","dirname":"tools"},{"name":"styledComponents","dirname":"tools"},{"name":"terser","dirname":"tools"},{"name":"tsChecker","dirname":"tools"},{"name":"tsLoader","dirname":"tools"},{"name":"webpack","dirname":"tools"},{"name":"webpackChain","dirname":"tools"}]
@@ -1 +1 @@
1
- [{"name":"assetPrefix","dirname":"dev"},{"name":"hmr","dirname":"dev"},{"name":"https","dirname":"dev"},{"name":"port","dirname":"dev"},{"name":"progressBar","dirname":"dev"},{"name":"startUrl","dirname":"dev"},{"name":"lazyCompilation","dirname":"experiments"},{"name":"appIcon","dirname":"html"},{"name":"crossorigin","dirname":"html"},{"name":"disableHtmlFolder","dirname":"html"},{"name":"favicon","dirname":"html"},{"name":"faviconByEntries","dirname":"html"},{"name":"inject","dirname":"html"},{"name":"injectByEntries","dirname":"html"},{"name":"meta","dirname":"html"},{"name":"metaByEntries","dirname":"html"},{"name":"mountId","dirname":"html"},{"name":"template","dirname":"html"},{"name":"templateByEntries","dirname":"html"},{"name":"templateParameters","dirname":"html"},{"name":"templateParametersByEntries","dirname":"html"},{"name":"title","dirname":"html"},{"name":"titleByEntries","dirname":"html"},{"name":"assetPrefix","dirname":"output"},{"name":"assetsRetry","dirname":"output"},{"name":"charset","dirname":"output"},{"name":"cleanDistPath","dirname":"output"},{"name":"convertToRem","dirname":"output"},{"name":"copy","dirname":"output"},{"name":"cssModuleLocalIdentName","dirname":"output"},{"name":"dataUriLimit","dirname":"output"},{"name":"disableCssExtract","dirname":"output"},{"name":"disableCssModuleExtension","dirname":"output"},{"name":"disableFilenameHash","dirname":"output"},{"name":"disableInlineRuntimeChunk","dirname":"output"},{"name":"disableMinimize","dirname":"output"},{"name":"disableSourceMap","dirname":"output"},{"name":"disableTsChecker","dirname":"output"},{"name":"distPath","dirname":"output"},{"name":"enableAssetFallback","dirname":"output"},{"name":"enableAssetManifest","dirname":"output"},{"name":"enableCssModuleTSDeclaration","dirname":"output"},{"name":"enableInlineScripts","dirname":"output"},{"name":"enableInlineStyles","dirname":"output"},{"name":"enableLatestDecorators","dirname":"output"},{"name":"externals","dirname":"output"},{"name":"filename","dirname":"output"},{"name":"legalComments","dirname":"output"},{"name":"overrideBrowserslist","dirname":"output"},{"name":"polyfill","dirname":"output"},{"name":"svgDefaultExport","dirname":"output"},{"name":"buildCache","dirname":"performance"},{"name":"bundleAnalyze","dirname":"performance"},{"name":"chunkSplit","dirname":"performance"},{"name":"printFileSize","dirname":"performance"},{"name":"profile","dirname":"performance"},{"name":"removeConsole","dirname":"performance"},{"name":"removeMomentLocale","dirname":"performance"},{"name":"sri","dirname":"security"},{"name":"alias","dirname":"source"},{"name":"compileJsDataURI","dirname":"source"},{"name":"define","dirname":"source"},{"name":"exclude","dirname":"source"},{"name":"globalVars","dirname":"source"},{"name":"include","dirname":"source"},{"name":"moduleScopes","dirname":"source"},{"name":"preEntry","dirname":"source"},{"name":"resolveExtensionPrefix","dirname":"source"},{"name":"resolveMainFields","dirname":"source"},{"name":"autoprefixer","dirname":"tools"},{"name":"babel","dirname":"tools"},{"name":"cssExtract","dirname":"tools"},{"name":"cssLoader","dirname":"tools"},{"name":"devServer","dirname":"tools"},{"name":"htmlPlugin","dirname":"tools"},{"name":"inspector","dirname":"tools"},{"name":"less","dirname":"tools"},{"name":"minifyCss","dirname":"tools"},{"name":"postcss","dirname":"tools"},{"name":"pug","dirname":"tools"},{"name":"sass","dirname":"tools"},{"name":"styleLoader","dirname":"tools"},{"name":"styledComponents","dirname":"tools"},{"name":"terser","dirname":"tools"},{"name":"tsChecker","dirname":"tools"},{"name":"tsLoader","dirname":"tools"},{"name":"webpack","dirname":"tools"},{"name":"webpackChain","dirname":"tools"}]
1
+ [{"name":"assetPrefix","dirname":"dev"},{"name":"hmr","dirname":"dev"},{"name":"https","dirname":"dev"},{"name":"port","dirname":"dev"},{"name":"progressBar","dirname":"dev"},{"name":"startUrl","dirname":"dev"},{"name":"lazyCompilation","dirname":"experiments"},{"name":"appIcon","dirname":"html"},{"name":"crossorigin","dirname":"html"},{"name":"disableHtmlFolder","dirname":"html"},{"name":"favicon","dirname":"html"},{"name":"faviconByEntries","dirname":"html"},{"name":"inject","dirname":"html"},{"name":"injectByEntries","dirname":"html"},{"name":"meta","dirname":"html"},{"name":"metaByEntries","dirname":"html"},{"name":"mountId","dirname":"html"},{"name":"tags","dirname":"html"},{"name":"tagsByEntries","dirname":"html"},{"name":"template","dirname":"html"},{"name":"templateByEntries","dirname":"html"},{"name":"templateParameters","dirname":"html"},{"name":"templateParametersByEntries","dirname":"html"},{"name":"title","dirname":"html"},{"name":"titleByEntries","dirname":"html"},{"name":"assetPrefix","dirname":"output"},{"name":"assetsRetry","dirname":"output"},{"name":"charset","dirname":"output"},{"name":"cleanDistPath","dirname":"output"},{"name":"convertToRem","dirname":"output"},{"name":"copy","dirname":"output"},{"name":"cssModuleLocalIdentName","dirname":"output"},{"name":"dataUriLimit","dirname":"output"},{"name":"disableCssExtract","dirname":"output"},{"name":"disableCssModuleExtension","dirname":"output"},{"name":"disableFilenameHash","dirname":"output"},{"name":"disableInlineRuntimeChunk","dirname":"output"},{"name":"disableMinimize","dirname":"output"},{"name":"disableSourceMap","dirname":"output"},{"name":"disableTsChecker","dirname":"output"},{"name":"distPath","dirname":"output"},{"name":"enableAssetFallback","dirname":"output"},{"name":"enableAssetManifest","dirname":"output"},{"name":"enableCssModuleTSDeclaration","dirname":"output"},{"name":"enableInlineScripts","dirname":"output"},{"name":"enableInlineStyles","dirname":"output"},{"name":"enableLatestDecorators","dirname":"output"},{"name":"externals","dirname":"output"},{"name":"filename","dirname":"output"},{"name":"legalComments","dirname":"output"},{"name":"overrideBrowserslist","dirname":"output"},{"name":"polyfill","dirname":"output"},{"name":"svgDefaultExport","dirname":"output"},{"name":"buildCache","dirname":"performance"},{"name":"bundleAnalyze","dirname":"performance"},{"name":"chunkSplit","dirname":"performance"},{"name":"printFileSize","dirname":"performance"},{"name":"profile","dirname":"performance"},{"name":"removeConsole","dirname":"performance"},{"name":"removeMomentLocale","dirname":"performance"},{"name":"sri","dirname":"security"},{"name":"alias","dirname":"source"},{"name":"compileJsDataURI","dirname":"source"},{"name":"define","dirname":"source"},{"name":"exclude","dirname":"source"},{"name":"globalVars","dirname":"source"},{"name":"include","dirname":"source"},{"name":"moduleScopes","dirname":"source"},{"name":"preEntry","dirname":"source"},{"name":"resolveExtensionPrefix","dirname":"source"},{"name":"resolveMainFields","dirname":"source"},{"name":"autoprefixer","dirname":"tools"},{"name":"babel","dirname":"tools"},{"name":"cssExtract","dirname":"tools"},{"name":"cssLoader","dirname":"tools"},{"name":"devServer","dirname":"tools"},{"name":"htmlPlugin","dirname":"tools"},{"name":"inspector","dirname":"tools"},{"name":"less","dirname":"tools"},{"name":"minifyCss","dirname":"tools"},{"name":"postcss","dirname":"tools"},{"name":"pug","dirname":"tools"},{"name":"sass","dirname":"tools"},{"name":"styleLoader","dirname":"tools"},{"name":"styledComponents","dirname":"tools"},{"name":"terser","dirname":"tools"},{"name":"tsChecker","dirname":"tools"},{"name":"tsLoader","dirname":"tools"},{"name":"webpack","dirname":"tools"},{"name":"webpackChain","dirname":"tools"}]
package/scripts/sync.ts CHANGED
@@ -19,7 +19,7 @@ const summary = (lng: string) => {
19
19
  const fl = walk(
20
20
  path.join(
21
21
  process.cwd(),
22
- `./node_modules/@modern-js/builder-doc/${lng}/config`,
22
+ `./node_modules/@modern-js/builder-doc/docs/${lng}/config`,
23
23
  ),
24
24
  );
25
25
  const json = fl.map(fpath => {
@@ -5,8 +5,3 @@ type: ref
5
5
  # 命令
6
6
 
7
7
  本节涵盖了所有命令。
8
-
9
-
10
-
11
-
12
-
@@ -15,7 +15,7 @@ Options:
15
15
 
16
16
  运行 `ESLint` 检查代码语法情况。通常情况下,我们只需要在 `git commit` 阶段通过 `lint-staged` 检查本次提交修改的部分代码。
17
17
 
18
- * `--no-fix` 参数设置后可以关闭自动修复 lint 错误代码的能力。
18
+ - `--no-fix` 参数设置后可以关闭自动修复 lint 错误代码的能力。
19
19
 
20
20
  import CommandTip from '@site-docs/components/command-tip.md'
21
21