@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
@@ -63,32 +63,32 @@ Several routing conventions are described as follow.
63
63
 
64
64
  Files named `index.[jt]s` are mapped to the previous directory.
65
65
 
66
- * `api/index.ts` -> `{prefix}/`
67
- * `api/user/index.ts` -> `{prefix}/user`
66
+ - `api/index.ts` -> `{prefix}/`
67
+ - `api/user/index.ts` -> `{prefix}/user`
68
68
 
69
69
  ### Multi-layer Route
70
70
 
71
71
  Supports parsing nested files, if you create a nested folder structure, the files will still automatically parse routes in the same way.
72
72
 
73
- * `api/hello.ts` -> `{prefix}/hello`
74
- * `api/user/list.ts` -> `{prefix}/user/list`
73
+ - `api/hello.ts` -> `{prefix}/hello`
74
+ - `api/user/list.ts` -> `{prefix}/user/list`
75
75
 
76
76
  ### Dynamic Route
77
77
 
78
78
  Create folders or files named with `[xxx]` to support dynamic named routing parameters.
79
79
 
80
- * `api/user/[username]/info.ts` -> `{prefix}/user/:username/info`
81
- * `api/user/username/[action].ts` -> `{prefix}/user/username/:action`
80
+ - `api/user/[username]/info.ts` -> `{prefix}/user/:username/info`
81
+ - `api/user/username/[action].ts` -> `{prefix}/user/username/:action`
82
82
 
83
83
  ### Allow List
84
84
 
85
85
  By default, all files in the'api/'directory will be parsed as BFF function files, but the following files will not be parsed:
86
86
 
87
- * file name start with `_`, for example `_utils.ts`.
88
- * files in directory which name start with `_`, for example `_utils/index.ts`、`_utils/cp.ts`.
89
- * test files, for example `foo.test.ts`.
90
- * type files, for example `hello.d.ts`.
91
- * files in `node_module`.
87
+ - file name start with `_`, for example `_utils.ts`.
88
+ - files in directory which name start with `_`, for example `_utils/index.ts`、`_utils/cp.ts`.
89
+ - test files, for example `foo.test.ts`.
90
+ - type files, for example `hello.d.ts`.
91
+ - files in `node_module`.
92
92
 
93
93
  ## RESTful API
94
94
 
@@ -126,11 +126,11 @@ export const post = async () => {
126
126
  };
127
127
  ```
128
128
 
129
- * Modern.js supports 9 definitions for HTTP Method: `GET`、`POST`、`PUT`、`DELETE`、`CONNECT`、`TRACE`、`PATCH`、`OPTION`、`HEAD`, can be exported using these methods as functions。
129
+ - Modern.js supports 9 definitions for HTTP Method: `GET`、`POST`、`PUT`、`DELETE`、`CONNECT`、`TRACE`、`PATCH`、`OPTION`、`HEAD`, can be exported using these methods as functions。
130
130
 
131
- * The name is size insensitive,if `GET`,can write `get`、`Get`、`GEt`、`GET`,can be accurately identified. But default export as `export default xxx` will be map to `Get`。
131
+ - The name is size insensitive,if `GET`,can write `get`、`Get`、`GEt`、`GET`,can be accurately identified. But default export as `export default xxx` will be map to `Get`。
132
132
 
133
- * Multiple functions of different Methods can be defined in one file, but if multiple functions of the same Method are defined, only the first will take effect.
133
+ - Multiple functions of different Methods can be defined in one file, but if multiple functions of the same Method are defined, only the first will take effect.
134
134
 
135
135
  :::info
136
136
  It should be noted that the defined functions should all be asynchronous, which is related to the type when the function is called, which will be mentioned later.
@@ -149,27 +149,25 @@ Dynamic routing will be used as imported parameters in the first part of the fun
149
149
  ```ts title="api/[level]/[id].ts"
150
150
  export default async (level: number, id: number) => {
151
151
  const userData = await queryUser(level, uid);
152
- return userData
153
- }
152
+ return userData;
153
+ };
154
154
  ```
155
155
 
156
156
  Pass dynamic parameters directly when calling:
157
157
 
158
158
  ```ts title="App.tsx"
159
- import { useState, useEffect } from 'react'
160
- import { get as getUser } from '@api/[level]/[id]'
159
+ import { useState, useEffect } from 'react';
160
+ import { get as getUser } from '@api/[level]/[id]';
161
161
 
162
162
  export default () => {
163
- const [name, setName] = useState('')
163
+ const [name, setName] = useState('');
164
164
 
165
165
  useEffect(() => {
166
- getUser(6, 001).then(
167
- userData => setName(userData.name)
168
- )
169
- }, [])
166
+ getUser(6, 001).then(userData => setName(userData.name));
167
+ }, []);
170
168
 
171
- return <div>{name}</div>
172
- }
169
+ return <div>{name}</div>;
170
+ };
173
171
  ```
174
172
 
175
173
  #### RequestOption
@@ -179,11 +177,12 @@ The parameter after Dynamic Path is the object `RequestOption` containing querys
179
177
  In normal functions without dynamic routing, the incoming `data` and `query` can be obtained from the first imported parameter, for example:
180
178
 
181
179
  ```ts title="api/hello.ts"
182
- import type { RequestOption } from '@modern-js/runtime/server'
180
+ import type { RequestOption } from '@modern-js/runtime/server';
183
181
 
184
- export async function post(
185
- { query, data }: RequestOption<Record<string, string>, Record<string, string>>
186
- ) {
182
+ export async function post({
183
+ query,
184
+ data,
185
+ }: RequestOption<Record<string, string>, Record<string, string>>) {
187
186
  // do somethings
188
187
  }
189
188
  ```
@@ -194,7 +193,10 @@ When a function file uses dynamic routing rules, dynamic routing before the `Req
194
193
  export async function post(
195
194
  sku: string,
196
195
  id: string,
197
- { data, query }: RequestOption<Record<string, string>, Record<string, string>>
196
+ {
197
+ data,
198
+ query,
199
+ }: RequestOption<Record<string, string>, Record<string, string>>,
198
200
  ) {
199
201
  // do somethings
200
202
  }
@@ -203,18 +205,22 @@ export async function post(
203
205
  Also pass in the parameters according to the function definition:
204
206
 
205
207
  ```ts title="App.tsx"
206
- import { post } from '@api/[sku]/[id]/item'
208
+ import { post } from '@api/[sku]/[id]/item';
207
209
 
208
210
  export default () => {
209
211
  const addSku = () => {
210
- post('0001'/* sku */, '1234' /* id */, {
211
- query: { /* ... */ },
212
- data: { /* ... */ },
213
- })
214
- }
212
+ post('0001' /* sku */, '1234' /* id */, {
213
+ query: {
214
+ /* ... */
215
+ },
216
+ data: {
217
+ /* ... */
218
+ },
219
+ });
220
+ };
215
221
 
216
- return <div onClick={addSku}>添加 SKU</div>
217
- }
222
+ return <div onClick={addSku}>添加 SKU</div>;
223
+ };
218
224
  ```
219
225
 
220
226
  As mentioned earlier, the defined functions should be asynchronous because they are automatically converted to HTTP interface calls when called by the front end.
@@ -6,15 +6,15 @@ In the development of the concept of **front back separation**, the front-end pa
6
6
 
7
7
  The main problems it to solve include:
8
8
 
9
- * Aggregation, mapping, clipping, and proxying of lower-level APIs according to their own business needs.
10
- * Cache data for some specific scenarios to improve performance and thus improve user experience.
11
- * Quickly development of new products based on existing interfaces.
12
- * Interface with third-party systems, such as login authentication.
9
+ - Aggregation, mapping, clipping, and proxying of lower-level APIs according to their own business needs.
10
+ - Cache data for some specific scenarios to improve performance and thus improve user experience.
11
+ - Quickly development of new products based on existing interfaces.
12
+ - Interface with third-party systems, such as login authentication.
13
13
 
14
14
  Modern.js officially supported the BFF and provided the **Integrated BFF** to further strengthen the BFF's capabilities, mainly including the following capabilities:
15
15
 
16
- * Quick development and debugging go live, running, building, and deploying BFF code in the same project.
17
- * Minimal pure function call, directly import BFF function on the front end, and can be automatically converted into HTTP request when called.
18
- * No private protocol, follow RESTful API specification, all BFF interfaces are standardized.
19
- * Full TypeScript support.
20
- * Meet user preferences and support multi-frame extension writing.
16
+ - Quick development and debugging go live, running, building, and deploying BFF code in the same project.
17
+ - Minimal pure function call, directly import BFF function on the front end, and can be automatically converted into HTTP request when called.
18
+ - No private protocol, follow RESTful API specification, all BFF interfaces are standardized.
19
+ - Full TypeScript support.
20
+ - Meet user preferences and support multi-frame extension writing.
@@ -40,4 +40,3 @@ In most cases, the function writing method can cover the customization requireme
40
40
  :::note
41
41
  The directory structure of different plugin frameworks is not the same, see [Runtime Frameworks](/docs/guides/advanced-features/bff/frameworks) for details.
42
42
  :::
43
-
@@ -18,14 +18,13 @@ When you use Modern.js [Conventional routing](/docs/guides/basic-features/routes
18
18
  use dynamic `import()`,`import` The JS modules pass to this API will be packaged into a separate JS file as a new packaging entry, for example:
19
19
 
20
20
  ```ts
21
- import("./math").then(math => {
21
+ import('./math').then(math => {
22
22
  console.log(math.add(16, 26));
23
23
  });
24
24
  ```
25
25
 
26
26
  The JS modules corresponding to the './math' path will be packaged in a separate JS file.
27
27
 
28
-
29
28
  ## React.lazy
30
29
 
31
30
  The officially way provides by React to split component code.
@@ -61,12 +60,12 @@ For detail, see [React lazy](https://reactjs.org/docs/code-splitting.html#reactl
61
60
  use `loadable` API,for example:
62
61
 
63
62
  ```ts
64
- import loadable from '@modern-js/runtime/loadable'
63
+ import loadable from '@modern-js/runtime/loadable';
65
64
 
66
65
  const OtherComponent = loadable(() => import('./OtherComponent'));
67
66
 
68
67
  function MyComponent() {
69
- return <OtherComponent />
68
+ return <OtherComponent />;
70
69
  }
71
70
  ```
72
71
 
@@ -12,7 +12,7 @@ This value is used by ['@babel/preset-env'] (https://babeljs.io/docs/en/babel-pr
12
12
  The default value in Modern.js as follow:
13
13
 
14
14
  ```js
15
- ['> 0.01%', 'not dead', 'not op_mini all']
15
+ ['> 0.01%', 'not dead', 'not op_mini all'];
16
16
  ```
17
17
 
18
18
  You can learn how to customize the browserlist [here](https://github.com/browserslist/browserslist).
@@ -23,7 +23,6 @@ See Modern.js Builder docs to learn more [Browserlist](https://modernjs.dev/buil
23
23
  Modern.js also supports configuring [output.override Browserlist](/docs/configure/app/output/override-browserslist) to override the default browserlist value.
24
24
  :::
25
25
 
26
-
27
26
  ## Polyfill
28
27
 
29
28
  ### Polyfill At Compile
@@ -40,8 +39,8 @@ For case where Polyfill is not required for third-party dependencies, you can se
40
39
 
41
40
  Modern.js also provides a runtime Polyfill solution based on browser [UA](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/User-Agent) information, which has the following advantages over Babel:
42
41
 
43
- * It will not be inserted into the code, reducing the code .
44
- * The same browser will share a Polyfill code. Therefore, with more and more projects, the UA-based Polyfill code will be delivered faster and faster.
42
+ - It will not be inserted into the code, reducing the code .
43
+ - The same browser will share a Polyfill code. Therefore, with more and more projects, the UA-based Polyfill code will be delivered faster and faster.
45
44
 
46
45
  exec `pnpm run new` to enable this features:
47
46
 
@@ -53,11 +52,11 @@ exec `pnpm run new` to enable this features:
53
52
  After executing the command, register the Polyfill plugin in `modern.config.ts`:
54
53
 
55
54
  ```ts title="modern.config.ts"
56
- import PolyfillPlugin from '@modern-js/plugin-polyfill';
55
+ import polyfillPlugin from '@modern-js/plugin-polyfill';
56
+
57
57
  // https://modernjs.dev/docs/apis/app/config
58
58
  export default defineConfig({
59
- ...,
60
- plugins: [..., PolyfillPlugin()],
59
+ plugins: [..., polyfillPlugin()],
61
60
  });
62
61
  ```
63
62
 
@@ -29,7 +29,6 @@ pnpm run lint:error
29
29
 
30
30
  对于无法自动修复的问题,可以在 IDE 里点击问题提示框里的规则链接,打开这条规则的文档,查看问题的解释和解决方案。
31
31
 
32
-
33
32
  ### 声明例外情况
34
33
 
35
34
  目前阶段,有些规则并不能做到足够智能,多数情况下会有很大收益,在少数情况下也许不适用。但如果为了这些少数情况就把整个规则关掉或改掉,得不偿失。
@@ -5,8 +5,3 @@ type: ref
5
5
  # Advanced Features
6
6
 
7
7
  This section covers advanced features of Modern.js.
8
-
9
-
10
-
11
-
12
-
@@ -11,14 +11,12 @@ Usually, the default configuration can meet most development needs. When there a
11
11
 
12
12
  Take configuring Webpack as an example, just add ['tools.webpack'] (/docs/configure/app/tools/webpack) to the modern.config.ts:
13
13
 
14
- ```typescript title="modern.config.ts"
14
+ ```ts title="modern.config.ts"
15
15
  export default defineConfig({
16
16
  tools: {
17
- webpack: config => {
18
-
19
- }
20
- }
21
- })
17
+ webpack: config => {},
18
+ },
19
+ });
22
20
  ```
23
21
 
24
22
  Configurations in the `tools` can be set to `Object` or `Function`.
@@ -31,16 +29,16 @@ When the value is `Function`, the first parameter is the default configuration v
31
29
 
32
30
  Currently provided is as follows:
33
31
 
34
- | Tools | Config |
35
- | -------- | --------- |
36
- | DevServer | [tools.devServer](/docs/configure/app/tools/dev-server) |
37
- | Babel | [tools.babel](/docs/configure/app/tools/babel)|
38
- | styled-components | [tools.styledComponents](/docs/configure/app/tools/styled-components)|
39
- | PostCSS | [tools.postcss](/docs/configure/app/tools/postcss)|
40
- | Less | [tools.less](/docs/configure/app/tools/less) |
41
- | Sass | [tools.sass](/docs/configure/app/tools/sass) |
42
- | webpack | [tools.webpack](/docs/configure/app/tools/webpack)|
43
- | Minify CSS | [tools.minifyCss](/docs/configure/app/tools/minify-css)|
44
- | terser | [tools.terser](/docs/configure/app/tools/terser)|
45
- | Tailwind CSS | [tools.tailwind](/docs/configure/app/tools/tailwindcss) |
46
- | Autoprefixer | [tools.autoprefixer](/docs/configure/app/tools/autoprefixer) |
32
+ | Tools | Config |
33
+ | ----------------- | --------------------------------------------------------------------- |
34
+ | DevServer | [tools.devServer](/docs/configure/app/tools/dev-server) |
35
+ | Babel | [tools.babel](/docs/configure/app/tools/babel) |
36
+ | styled-components | [tools.styledComponents](/docs/configure/app/tools/styled-components) |
37
+ | PostCSS | [tools.postcss](/docs/configure/app/tools/postcss) |
38
+ | Less | [tools.less](/docs/configure/app/tools/less) |
39
+ | Sass | [tools.sass](/docs/configure/app/tools/sass) |
40
+ | webpack | [tools.webpack](/docs/configure/app/tools/webpack) |
41
+ | Minify CSS | [tools.minifyCss](/docs/configure/app/tools/minify-css) |
42
+ | terser | [tools.terser](/docs/configure/app/tools/terser) |
43
+ | Tailwind CSS | [tools.tailwind](/docs/configure/app/tools/tailwindcss) |
44
+ | Autoprefixer | [tools.autoprefixer](/docs/configure/app/tools/autoprefixer) |
@@ -15,15 +15,14 @@ First need to execute `pnpm run new` to enable the SSG features:
15
15
  After execute script,register SSG plugin in `modern.config.ts`:
16
16
 
17
17
  ```ts title="modern.config.ts"
18
- import SSGPlugin from '@modern-js/plugin-ssg';
18
+ import ssgPlugin from '@modern-js/plugin-ssg';
19
+
19
20
  // https://modernjs.dev/docs/apis/app/config
20
21
  export default defineConfig({
21
- ...,
22
22
  output: {
23
- ...,
24
23
  ssg: true,
25
24
  },
26
- plugins: [..., SSGPlugin()],
25
+ plugins: [..., ssgPlugin()],
27
26
  });
28
27
  ```
29
28
 
@@ -62,13 +61,13 @@ add component to `src/routes/page.tsx`:
62
61
 
63
62
  ```jsx title="src/routes/page.tsx"
64
63
  export default () => {
65
- return <div>Index Page</div>
66
- }
64
+ return <div>Index Page</div>;
65
+ };
67
66
  ```
68
67
 
69
68
  SSG is also render in Node.js. So we can enable SSR in developmenet env, expose code problems in advance and verify SSG rendering effect:
70
69
 
71
- ```typescript title="modern.config.ts"
70
+ ```ts title="modern.config.ts"
72
71
  export default defineConfig({
73
72
  server: {
74
73
  ssr: process.env.NODE_ENV === 'development',
@@ -112,14 +111,14 @@ export default () => {
112
111
 
113
112
  If we want to enable the SSG of `/about` at the same time, we can configure the `output.ssg` to tell Modern.js to enable the SSG of the specified route.
114
113
 
115
- ```typescript title="modern.config.ts"
114
+ ```ts title="modern.config.ts"
116
115
  export default defineConfig({
117
116
  output: {
118
117
  ssg: {
119
118
  routes: ['/', '/about'],
120
119
  },
121
120
  },
122
- })
121
+ });
123
122
  ```
124
123
 
125
124
  run `pnpm run build` and `pnpm run serve`,access `http://localhost:8080/about`. In the Preview view, you can see that the page has been rendered。
@@ -129,4 +128,3 @@ Looking at the bundle file, a new `main/about/index.html` file has been added in
129
128
  :::info
130
129
  The above only introduces the single entry, more related content can be viewed [SSG API](/docs/configure/app/output/ssg)。
131
130
  :::
132
-
@@ -33,7 +33,7 @@ in the component, the data returned by the `loader` function can be get data thr
33
33
  export default () => {
34
34
  const data = useLoaderData();
35
35
  return <div>{data.message}</div>;
36
- }
36
+ };
37
37
  ```
38
38
 
39
39
  Modern.js break the traditional SSR development model and provide users with a user-friendly SSR development experience.
@@ -56,11 +56,7 @@ Here is an example to show the problem when SSR and CSR rendering are inconsiste
56
56
 
57
57
  ```tsx
58
58
  {
59
- typeof window !== 'undefined' ? (
60
- <div>
61
- browser content
62
- </div>
63
- ) : null;
59
+ typeof window !== 'undefined' ? <div>browser content</div> : null;
64
60
  }
65
61
  ```
66
62
 
@@ -88,9 +84,7 @@ Outside of elements that do not require SSR, wrap with a `NoSSR` component:
88
84
 
89
85
  ```tsx
90
86
  <NoSSR>
91
- <div>
92
- client content
93
- </div>
87
+ <div>client content</div>
94
88
  </NoSSR>
95
89
  ```
96
90
 
@@ -213,8 +207,8 @@ document.addEventListener('load', () => {
213
207
  console.log('document load');
214
208
  });
215
209
  const App = () => {
216
- return <div>Hello World</div>
217
- }
210
+ return <div>Hello World</div>;
211
+ };
218
212
  export default App;
219
213
  ```
220
214
 
@@ -17,11 +17,11 @@ After executing the above command, the `"test": "modern test"` command will be a
17
17
  register plugin in `modern.config.ts`:
18
18
 
19
19
  ```ts title="modern.config.ts"
20
- import TestPlugin from '@modern-js/plugin-testing';
20
+ import testPlugin from '@modern-js/plugin-testing';
21
+
21
22
  // https://modernjs.dev/docs/apis/app/config
22
23
  export default defineConfig({
23
- ...,
24
- plugins: [..., TestPlugin()],
24
+ plugins: [..., testPlugin()],
25
25
  });
26
26
  ```
27
27
 
@@ -19,11 +19,11 @@ Modern.js 作为以客户端为中心的开发框架,对服务端的定制能
19
19
  执行命令后,在 `modern.config.ts` 中注册 Server 插件:
20
20
 
21
21
  ```ts title="modern.config.ts"
22
- import ServerPlugin from '@modern-js/plugin-server';
22
+ import serverPlugin from '@modern-js/plugin-server';
23
+
23
24
  // https://modernjs.dev/docs/apis/app/config
24
25
  export default defineConfig({
25
- ...,
26
- plugins: [..., ServerPlugin()],
26
+ plugins: [..., serverPlugin()],
27
27
  });
28
28
  ```
29
29
 
@@ -41,7 +41,6 @@ Hook 不可以使用运行时框架拓展。
41
41
 
42
42
  详细 API 可以查看 [Hook](/docs/apis/app/runtime/web-server/hook)。
43
43
 
44
-
45
44
  ### Middleware
46
45
 
47
46
  Middleware 可以为 Web Server 添加前置中间件,只有 SSR 请求会经过 Middleware 的处理。
@@ -41,26 +41,22 @@ Modern.js also provides a way to config aliases. Adding the `@common` alias as a
41
41
  {
42
42
  "compilerOptions": {
43
43
  "paths": {
44
- "@/*": [
45
- "./src/*"
46
- ],
47
- "@/common/*": [
48
- "./src/common/*"
49
- ]
44
+ "@/*": ["./src/*"],
45
+ "@/common/*": ["./src/common/*"]
50
46
  }
51
- },
47
+ }
52
48
  }
53
49
  ```
54
50
 
55
51
  JavaScript project can config by [`source.alias`](/docs/configure/app/source/alias) in `modern.config.js`:
56
52
 
57
- ```typescript title="modern.config.ts"
53
+ ```ts title="modern.config.ts"
58
54
  export default defineConfig({
59
55
  source: {
60
56
  alias: {
61
- '@common': './src/common'
62
- }
63
- }
57
+ '@common': './src/common',
58
+ },
59
+ },
64
60
  });
65
61
  ```
66
62
 
@@ -4,27 +4,27 @@ sidebar_position: 1
4
4
 
5
5
  # CSS-in-JS
6
6
 
7
- CSS-in-JS is a technology that can write CSS styles in JS files. Modern.js integrates the CSS-in-JS library [styled-components](https://styled-components.com/) commonly used in the community, which uses the new feature of JavaScript [Tagged template](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) to write CSS styles for components. You can use the [styled-components](https://styled-components.com/) API directly from `@modern-js/runtime/styled`.
7
+ CSS-in-JS is a technology that can write CSS styles in JS files. Modern.js integrates the CSS-in-JS library [styled-components](https://styled-components.com/) commonly used in the community, which uses the new feature of JavaScript [Tagged template](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) to write CSS styles for components. You can use the [styled-components](https://styled-components.com/) API directly from `@modern-js/runtime/styled`.
8
8
 
9
9
  When you need to write a `div` component with an internal font in red, you can do the following implementation:
10
10
 
11
11
  ```js
12
- import styled from '@modern-js/runtime/styled'
12
+ import styled from '@modern-js/runtime/styled';
13
13
 
14
14
  const RedDiv = styled.div`
15
15
  color: red;
16
- `
16
+ `;
17
17
  ```
18
18
 
19
19
  When you need to dynamically set the component style according to the `props` of the component, for example, when the attribute `primary` of `props` is `true`, the color of the button is white, and otherwise it is red. The implementation code is as follows:
20
20
 
21
21
  ```js
22
- import styled from '@modern-js/runtime/styled'
22
+ import styled from '@modern-js/runtime/styled';
23
23
 
24
24
  const Button = styled.button`
25
- color: ${props => props.primary ? "white" : "red"};
25
+ color: ${props => (props.primary ? 'white' : 'red')};
26
26
  font-size: 1em;
27
- `
27
+ `;
28
28
  ```
29
29
 
30
30
  For more usage of styled-components, please refer to [[styled-components official website](https://styled-components.com/) ].
@@ -33,7 +33,7 @@ Will eventually be compiled as:
33
33
  ```js
34
34
  <button type="button" className="button_redColor__1-RBg">
35
35
  red button
36
- </button>;
36
+ </button>
37
37
  ```
38
38
 
39
39
  ## Global CSS Modules
@@ -74,7 +74,7 @@ Will eventually be compiled as:
74
74
  ```js
75
75
  <button type="button" className="button__redColor--JsFYl bg-blue">
76
76
  button
77
- </button>;
77
+ </button>
78
78
  ```
79
79
 
80
80
  The final effect is as follows:
@@ -11,7 +11,6 @@ sidebar_position: 4
11
11
  - If you need to customize the configuration of [less-loader](https://github.com/webpack-contrib/less-loader), please refer to the [tools.less](/docs/configure/app/tools/less).
12
12
  - If you need to customize the configuration of [sass-loader](https://github.com/webpack-contrib/sass-loader), please refer to the [tools.less](/docs/configure/app/tools/sass).
13
13
 
14
-
15
- ::: Tips
14
+ :::tip
16
15
  CSS files pre-compiled by Less and Sass will still undergo Modern.js build-in [PostCSS](https://postcss.org/) conversion, which has good browser compatibility. For related content, please refer to [[PostCSS](/docs/guides/basic-features/css/postcss)].
17
16
  :::