@modern-js/main-doc 2.7.0 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +27 -0
- package/README.md +15 -18
- package/docs/en/apis/app/commands.mdx +299 -0
- package/docs/en/apis/app/hooks/api/framework/lambda.mdx +57 -0
- package/docs/en/apis/app/hooks/api/functions/api.mdx +81 -0
- package/docs/en/apis/app/hooks/src/routes.mdx +90 -0
- package/docs/en/apis/app/hooks/src/server.mdx +34 -0
- package/docs/en/apis/app/runtime/model/connect.mdx +145 -0
- package/docs/en/apis/app/runtime/model/model_.mdx +199 -0
- package/docs/en/apis/app/runtime/model/use-model.mdx +89 -0
- package/docs/en/apis/app/runtime/router/router.mdx +262 -0
- package/docs/en/apis/app/runtime/web-server/hook.mdx +133 -0
- package/docs/en/apis/app/runtime/web-server/middleware.mdx +134 -0
- package/docs/en/components/enable-bff.mdx +31 -0
- package/docs/en/components/init-app.mdx +43 -0
- package/docs/en/components/init-rspack-app.mdx +7 -0
- package/docs/en/components/prerequisites.mdx +18 -0
- package/docs/en/configure/app/bff/enable-handle-web.mdx +24 -0
- package/docs/en/configure/app/dev/asset-prefix.mdx +13 -0
- package/docs/en/configure/app/dev/before-start-url.mdx +13 -0
- package/docs/en/configure/app/dev/hmr.mdx +13 -0
- package/docs/en/configure/app/dev/host.mdx +13 -0
- package/docs/en/configure/app/dev/https.mdx +13 -0
- package/docs/en/configure/app/dev/port.mdx +13 -0
- package/docs/en/configure/app/dev/progress-bar.mdx +13 -0
- package/docs/en/configure/app/dev/start-url.mdx +13 -0
- package/docs/en/configure/app/experiments/lazy-compilation.mdx +13 -0
- package/docs/en/configure/app/html/app-icon.mdx +13 -0
- package/docs/en/configure/app/html/crossorigin.mdx +13 -0
- package/docs/en/configure/app/html/disable-html-folder.mdx +13 -0
- package/docs/en/configure/app/html/favicon-by-entries.mdx +13 -0
- package/docs/en/configure/app/html/favicon.mdx +13 -0
- package/docs/en/configure/app/html/inject-by-entries.mdx +13 -0
- package/docs/en/configure/app/html/inject.mdx +13 -0
- package/docs/en/configure/app/html/meta-by-entries.mdx +13 -0
- package/docs/en/configure/app/html/meta.mdx +13 -0
- package/docs/en/configure/app/html/mount-id.mdx +13 -0
- package/docs/en/configure/app/html/tags-by-entries.mdx +13 -0
- package/docs/en/configure/app/html/tags.mdx +13 -0
- package/docs/en/configure/app/html/template-by-entries.mdx +13 -0
- package/docs/en/configure/app/html/template-parameters-by-entries.mdx +13 -0
- package/docs/en/configure/app/html/template-parameters.mdx +13 -0
- package/docs/en/configure/app/html/template.mdx +13 -0
- package/docs/en/configure/app/html/title-by-entries.mdx +13 -0
- package/docs/en/configure/app/html/title.mdx +13 -0
- package/docs/en/configure/app/output/asset-prefix.mdx +13 -0
- package/docs/en/configure/app/output/assets-retry.mdx +13 -0
- package/docs/en/configure/app/output/charset.mdx +13 -0
- package/docs/en/configure/app/output/clean-dist-path.mdx +13 -0
- package/docs/en/configure/app/output/convert-to-rem.mdx +13 -0
- package/docs/en/configure/app/output/copy.mdx +13 -0
- package/docs/en/configure/app/output/css-module-local-ident-name.mdx +13 -0
- package/docs/en/configure/app/output/data-uri-limit.mdx +13 -0
- package/docs/en/configure/app/output/disable-css-extract.mdx +13 -0
- package/docs/en/configure/app/output/disable-css-module-extension.mdx +13 -0
- package/docs/en/configure/app/output/disable-filename-hash.mdx +13 -0
- package/docs/en/configure/app/output/disable-inline-runtime-chunk.mdx +13 -0
- package/docs/en/configure/app/output/disable-minimize.mdx +13 -0
- package/docs/en/configure/app/output/disable-source-map.mdx +13 -0
- package/docs/en/configure/app/output/disable-ts-checker.mdx +13 -0
- package/docs/en/configure/app/output/dist-path.mdx +13 -0
- package/docs/en/configure/app/output/enable-asset-fallback.mdx +13 -0
- package/docs/en/configure/app/output/enable-asset-manifest.mdx +13 -0
- package/docs/en/configure/app/output/enable-css-module-tsdeclaration.mdx +13 -0
- package/docs/en/configure/app/output/enable-inline-scripts.mdx +13 -0
- package/docs/en/configure/app/output/enable-inline-styles.mdx +13 -0
- package/docs/en/configure/app/output/enable-latest-decorators.mdx +13 -0
- package/docs/en/configure/app/output/externals.mdx +13 -0
- package/docs/en/configure/app/output/filename.mdx +13 -0
- package/docs/en/configure/app/output/legal-comments.mdx +13 -0
- package/docs/en/configure/app/output/override-browserslist.mdx +13 -0
- package/docs/en/configure/app/output/polyfill.mdx +13 -0
- package/docs/en/configure/app/output/ssg.mdx +196 -0
- package/docs/en/configure/app/output/svg-default-export.mdx +13 -0
- package/docs/en/configure/app/performance/build-cache.mdx +13 -0
- package/docs/en/configure/app/performance/bundle-analyze.mdx +13 -0
- package/docs/en/configure/app/performance/chunk-split.mdx +13 -0
- package/docs/en/configure/app/performance/print-file-size.mdx +13 -0
- package/docs/en/configure/app/performance/profile.mdx +13 -0
- package/docs/en/configure/app/performance/remove-console.mdx +13 -0
- package/docs/en/configure/app/performance/remove-moment-locale.mdx +13 -0
- package/docs/en/configure/app/security/check-syntax.mdx +13 -0
- package/docs/en/configure/app/security/sri.mdx +13 -0
- package/docs/en/configure/app/server/enable-framework-ext.mdx +49 -0
- package/docs/en/configure/app/server/public-routes.mdx +26 -0
- package/docs/en/configure/app/server/ssr.mdx +38 -0
- package/docs/en/configure/app/source/alias.mdx +13 -0
- package/docs/en/configure/app/source/compile-js-data-uri.mdx +13 -0
- package/docs/en/configure/app/source/define.mdx +13 -0
- package/docs/en/configure/app/source/design-system.mdx +1175 -0
- package/docs/en/configure/app/source/disable-entry-dirs.mdx +39 -0
- package/docs/en/configure/app/source/entries.mdx +123 -0
- package/docs/en/configure/app/source/exclude.mdx +13 -0
- package/docs/en/configure/app/source/global-vars.mdx +13 -0
- package/docs/en/configure/app/source/include.mdx +13 -0
- package/docs/en/configure/app/source/module-scopes.mdx +13 -0
- package/docs/en/configure/app/source/pre-entry.mdx +13 -0
- package/docs/en/configure/app/source/resolve-extension-prefix.mdx +13 -0
- package/docs/en/configure/app/source/resolve-main-fields.mdx +13 -0
- package/docs/en/configure/app/tools/autoprefixer.mdx +13 -0
- package/docs/en/configure/app/tools/babel.mdx +13 -0
- package/docs/en/configure/app/tools/css-extract.mdx +13 -0
- package/docs/en/configure/app/tools/css-loader.mdx +13 -0
- package/docs/en/configure/app/tools/dev-server.mdx +13 -0
- package/docs/en/configure/app/tools/html-plugin.mdx +13 -0
- package/docs/en/configure/app/tools/inspector.mdx +13 -0
- package/docs/en/configure/app/tools/less.mdx +13 -0
- package/docs/en/configure/app/tools/minify-css.mdx +13 -0
- package/docs/en/configure/app/tools/postcss.mdx +13 -0
- package/docs/en/configure/app/tools/pug.mdx +13 -0
- package/docs/en/configure/app/tools/rspack.mdx +13 -0
- package/docs/en/configure/app/tools/sass.mdx +13 -0
- package/docs/en/configure/app/tools/style-loader.mdx +13 -0
- package/docs/en/configure/app/tools/styled-components.mdx +13 -0
- package/docs/en/configure/app/tools/terser.mdx +13 -0
- package/docs/en/configure/app/tools/ts-checker.mdx +13 -0
- package/docs/en/configure/app/tools/ts-loader.mdx +13 -0
- package/docs/en/configure/app/tools/webpack-chain.mdx +13 -0
- package/docs/en/configure/app/tools/webpack.mdx +13 -0
- package/docs/en/guides/advanced-features/bff/_category_.json +8 -0
- package/docs/en/guides/advanced-features/code-split.mdx +80 -0
- package/docs/en/guides/advanced-features/compatibility.mdx +78 -0
- package/docs/en/guides/advanced-features/eslint.mdx +148 -0
- package/docs/en/guides/advanced-features/low-level.mdx +45 -0
- package/docs/en/guides/advanced-features/rspack-start.mdx +61 -0
- package/docs/en/guides/advanced-features/ssg.mdx +116 -0
- package/docs/en/guides/advanced-features/ssr.mdx +518 -0
- package/docs/en/guides/advanced-features/testing.mdx +46 -0
- package/docs/en/guides/advanced-features/web-server.mdx +124 -0
- package/docs/en/guides/basic-features/data-fetch.mdx +404 -0
- package/docs/en/guides/basic-features/env-vars.mdx +174 -0
- package/docs/en/guides/basic-features/html.mdx +247 -0
- package/docs/en/guides/basic-features/proxy.mdx +61 -0
- package/docs/en/guides/concept/builder.mdx +47 -0
- package/docs/en/guides/get-started/introduction.mdx +50 -0
- package/docs/en/guides/get-started/quick-start.mdx +162 -0
- package/docs/en/guides/topic-detail/framework-plugin/extend.mdx +164 -0
- package/docs/en/guides/topic-detail/framework-plugin/hook-list.mdx +827 -0
- package/docs/en/guides/topic-detail/framework-plugin/hook.mdx +188 -0
- package/docs/en/guides/topic-detail/framework-plugin/implement.mdx +246 -0
- package/docs/en/guides/topic-detail/framework-plugin/introduction.mdx +50 -0
- package/docs/en/guides/topic-detail/framework-plugin/plugin-api.mdx +117 -0
- package/docs/en/guides/topic-detail/framework-plugin/relationship.mdx +119 -0
- package/docs/en/guides/topic-detail/generator/codesmith/api/npm.mdx +48 -0
- package/docs/en/guides/topic-detail/generator/codesmith/develop.mdx +53 -0
- package/docs/en/guides/topic-detail/generator/config/app.mdx +82 -0
- package/docs/en/guides/topic-detail/generator/plugin/api/input/addInputAfter.mdx +55 -0
- package/docs/en/guides/topic-detail/generator/plugin/api/input/addInputBefore.mdx +55 -0
- package/docs/en/guides/topic-detail/generator/plugin/api/npm/install.mdx +18 -0
- package/docs/en/guides/topic-detail/generator/plugin/develop.mdx +125 -0
- package/docs/en/guides/topic-detail/generator/project.mdx +118 -0
- package/docs/en/guides/topic-detail/micro-frontend/c01-introduction.mdx +29 -0
- package/docs/en/guides/topic-detail/micro-frontend/c02-development.mdx +254 -0
- package/docs/en/guides/topic-detail/micro-frontend/c03-main-app.mdx +282 -0
- package/docs/en/guides/topic-detail/micro-frontend/c04-communicate.mdx +57 -0
- package/docs/en/guides/topic-detail/micro-frontend/c05-mixed-stack.mdx +26 -0
- package/docs/en/guides/topic-detail/model/auto-actions.mdx +89 -0
- package/docs/en/guides/topic-detail/model/computed-state.mdx +153 -0
- package/docs/en/guides/topic-detail/model/define-model.mdx +66 -0
- package/docs/en/guides/topic-detail/model/faq.mdx +40 -0
- package/docs/en/guides/topic-detail/model/manage-effects.mdx +251 -0
- package/docs/en/guides/topic-detail/model/model-communicate.mdx +222 -0
- package/docs/en/guides/topic-detail/model/performance.mdx +170 -0
- package/docs/en/guides/topic-detail/model/quick-start.mdx +114 -0
- package/docs/en/guides/topic-detail/model/redux-integration.mdx +24 -0
- package/docs/en/guides/topic-detail/model/test-model.mdx +45 -0
- package/docs/en/guides/topic-detail/model/typescript-best-practice.mdx +72 -0
- package/docs/en/guides/topic-detail/model/use-model.mdx +247 -0
- package/docs/en/guides/topic-detail/model/use-out-of-modernjs.mdx +50 -0
- package/docs/en/guides/troubleshooting/cli.mdx +63 -0
- package/docs/en/tutorials/first-app/c03-css.mdx +323 -0
- package/docs/zh/apis/app/commands.mdx +301 -0
- package/docs/zh/apis/app/runtime/model/connect.mdx +143 -0
- package/docs/zh/apis/app/runtime/model/model_.mdx +199 -0
- package/docs/zh/apis/app/runtime/model/use-model.mdx +89 -0
- package/docs/zh/apis/app/runtime/web-server/hook.mdx +132 -0
- package/docs/zh/apis/app/runtime/web-server/middleware.mdx +131 -0
- package/docs/zh/apis/monorepo/commands/gen-release-note.mdx +32 -0
- package/docs/zh/apis/monorepo/commands/new.mdx +39 -0
- package/docs/zh/components/default-mwa-generate.mdx +5 -0
- package/docs/zh/components/enable-bff.mdx +31 -0
- package/docs/zh/components/init-app.mdx +44 -0
- package/docs/zh/components/init-rspack-app.mdx +7 -0
- package/docs/zh/components/prerequisites.mdx +18 -0
- package/docs/zh/components/release-note.mdx +1 -0
- package/docs/zh/configure/app/bff/enable-handle-web.mdx +24 -0
- package/docs/zh/configure/app/dev/asset-prefix.mdx +13 -0
- package/docs/zh/configure/app/dev/before-start-url.mdx +13 -0
- package/docs/zh/configure/app/dev/hmr.mdx +13 -0
- package/docs/zh/configure/app/dev/host.mdx +13 -0
- package/docs/zh/configure/app/dev/https.mdx +13 -0
- package/docs/zh/configure/app/dev/port.mdx +13 -0
- package/docs/zh/configure/app/dev/progress-bar.mdx +13 -0
- package/docs/zh/configure/app/dev/start-url.mdx +13 -0
- package/docs/zh/configure/app/experiments/lazy-compilation.mdx +13 -0
- package/docs/zh/configure/app/html/app-icon.mdx +13 -0
- package/docs/zh/configure/app/html/crossorigin.mdx +13 -0
- package/docs/zh/configure/app/html/disable-html-folder.mdx +13 -0
- package/docs/zh/configure/app/html/favicon-by-entries.mdx +13 -0
- package/docs/zh/configure/app/html/favicon.mdx +13 -0
- package/docs/zh/configure/app/html/inject-by-entries.mdx +13 -0
- package/docs/zh/configure/app/html/inject.mdx +13 -0
- package/docs/zh/configure/app/html/meta-by-entries.mdx +13 -0
- package/docs/zh/configure/app/html/meta.mdx +13 -0
- package/docs/zh/configure/app/html/mount-id.mdx +13 -0
- package/docs/zh/configure/app/html/tags-by-entries.mdx +13 -0
- package/docs/zh/configure/app/html/tags.mdx +13 -0
- package/docs/zh/configure/app/html/template-by-entries.mdx +13 -0
- package/docs/zh/configure/app/html/template-parameters-by-entries.mdx +13 -0
- package/docs/zh/configure/app/html/template-parameters.mdx +13 -0
- package/docs/zh/configure/app/html/template.mdx +13 -0
- package/docs/zh/configure/app/html/title-by-entries.mdx +13 -0
- package/docs/zh/configure/app/html/title.mdx +13 -0
- package/docs/zh/configure/app/output/asset-prefix.mdx +13 -0
- package/docs/zh/configure/app/output/assets-retry.mdx +13 -0
- package/docs/zh/configure/app/output/charset.mdx +13 -0
- package/docs/zh/configure/app/output/clean-dist-path.mdx +13 -0
- package/docs/zh/configure/app/output/convert-to-rem.mdx +13 -0
- package/docs/zh/configure/app/output/copy.mdx +13 -0
- package/docs/zh/configure/app/output/css-module-local-ident-name.mdx +13 -0
- package/docs/zh/configure/app/output/data-uri-limit.mdx +13 -0
- package/docs/zh/configure/app/output/disable-css-extract.mdx +13 -0
- package/docs/zh/configure/app/output/disable-css-module-extension.mdx +13 -0
- package/docs/zh/configure/app/output/disable-filename-hash.mdx +13 -0
- package/docs/zh/configure/app/output/disable-inline-runtime-chunk.mdx +13 -0
- package/docs/zh/configure/app/output/disable-minimize.mdx +13 -0
- package/docs/zh/configure/app/output/disable-source-map.mdx +13 -0
- package/docs/zh/configure/app/output/disable-ts-checker.mdx +13 -0
- package/docs/zh/configure/app/output/dist-path.mdx +13 -0
- package/docs/zh/configure/app/output/enable-asset-fallback.mdx +13 -0
- package/docs/zh/configure/app/output/enable-asset-manifest.mdx +13 -0
- package/docs/zh/configure/app/output/enable-css-module-tsdeclaration.mdx +13 -0
- package/docs/zh/configure/app/output/enable-inline-scripts.mdx +13 -0
- package/docs/zh/configure/app/output/enable-inline-styles.mdx +13 -0
- package/docs/zh/configure/app/output/enable-latest-decorators.mdx +13 -0
- package/docs/zh/configure/app/output/externals.mdx +13 -0
- package/docs/zh/configure/app/output/filename.mdx +13 -0
- package/docs/zh/configure/app/output/legal-comments.mdx +13 -0
- package/docs/zh/configure/app/output/override-browserslist.mdx +13 -0
- package/docs/zh/configure/app/output/polyfill.mdx +13 -0
- package/docs/zh/configure/app/output/svg-default-export.mdx +13 -0
- package/docs/zh/configure/app/performance/build-cache.mdx +13 -0
- package/docs/zh/configure/app/performance/bundle-analyze.mdx +13 -0
- package/docs/zh/configure/app/performance/chunk-split.mdx +13 -0
- package/docs/zh/configure/app/performance/print-file-size.mdx +13 -0
- package/docs/zh/configure/app/performance/profile.mdx +13 -0
- package/docs/zh/configure/app/performance/remove-console.mdx +13 -0
- package/docs/zh/configure/app/performance/remove-moment-locale.mdx +13 -0
- package/docs/zh/configure/app/security/check-syntax.mdx +13 -0
- package/docs/zh/configure/app/security/sri.mdx +13 -0
- package/docs/zh/configure/app/server/enable-framework-ext.mdx +49 -0
- package/docs/zh/configure/app/source/alias.mdx +13 -0
- package/docs/zh/configure/app/source/compile-js-data-uri.mdx +13 -0
- package/docs/zh/configure/app/source/define.mdx +13 -0
- package/docs/zh/configure/app/source/exclude.mdx +13 -0
- package/docs/zh/configure/app/source/global-vars.mdx +13 -0
- package/docs/zh/configure/app/source/include.mdx +13 -0
- package/docs/zh/configure/app/source/module-scopes.mdx +13 -0
- package/docs/zh/configure/app/source/pre-entry.mdx +13 -0
- package/docs/zh/configure/app/source/resolve-extension-prefix.mdx +13 -0
- package/docs/zh/configure/app/source/resolve-main-fields.mdx +13 -0
- package/docs/zh/configure/app/tools/autoprefixer.mdx +13 -0
- package/docs/zh/configure/app/tools/babel.mdx +13 -0
- package/docs/zh/configure/app/tools/css-extract.mdx +13 -0
- package/docs/zh/configure/app/tools/css-loader.mdx +13 -0
- package/docs/zh/configure/app/tools/dev-server.mdx +13 -0
- package/docs/zh/configure/app/tools/html-plugin.mdx +13 -0
- package/docs/zh/configure/app/tools/inspector.mdx +13 -0
- package/docs/zh/configure/app/tools/less.mdx +13 -0
- package/docs/zh/configure/app/tools/minify-css.mdx +13 -0
- package/docs/zh/configure/app/tools/postcss.mdx +13 -0
- package/docs/zh/configure/app/tools/pug.mdx +13 -0
- package/docs/zh/configure/app/tools/rspack.mdx +13 -0
- package/docs/zh/configure/app/tools/sass.mdx +13 -0
- package/docs/zh/configure/app/tools/style-loader.mdx +13 -0
- package/docs/zh/configure/app/tools/styled-components.mdx +13 -0
- package/docs/zh/configure/app/tools/terser.mdx +13 -0
- package/docs/zh/configure/app/tools/ts-checker.mdx +13 -0
- package/docs/zh/configure/app/tools/ts-loader.mdx +13 -0
- package/docs/zh/configure/app/tools/webpack-chain.mdx +13 -0
- package/docs/zh/configure/app/tools/webpack.mdx +13 -0
- package/docs/zh/guides/advanced-features/bff/_category_.json +8 -0
- package/docs/zh/guides/advanced-features/rspack-start.mdx +62 -0
- package/docs/zh/guides/advanced-features/ssr.mdx +507 -0
- package/docs/zh/guides/advanced-features/web-server.mdx +122 -0
- package/docs/zh/guides/basic-features/mock.mdx +99 -0
- package/docs/zh/guides/concept/builder.mdx +47 -0
- package/docs/zh/guides/get-started/introduction.mdx +47 -0
- package/docs/zh/guides/topic-detail/changesets/changelog.mdx +238 -0
- package/docs/zh/guides/topic-detail/changesets/commit.mdx +271 -0
- package/docs/zh/guides/topic-detail/changesets/github.mdx +164 -0
- package/docs/zh/guides/topic-detail/changesets/release-note.mdx +259 -0
- package/docs/zh/guides/topic-detail/framework-plugin/plugin-api.mdx +117 -0
- package/docs/zh/guides/topic-detail/generator/plugin/develop.mdx +125 -0
- package/docs/zh/guides/topic-detail/model/faq.mdx +41 -0
- package/docs/zh/guides/topic-detail/model/manage-effects.mdx +260 -0
- package/docs/zh/guides/topic-detail/model/model-communicate.mdx +220 -0
- package/docs/zh/guides/topic-detail/model/performance.mdx +171 -0
- package/docs/zh/guides/topic-detail/model/quick-start.mdx +113 -0
- package/docs/zh/guides/topic-detail/model/use-model.mdx +252 -0
- package/docs/zh/guides/topic-detail/monorepo/create-sub-project.mdx +67 -0
- package/docs/zh/guides/topic-detail/monorepo/sub-project-interface.mdx +179 -0
- package/docs/zh/index.md +4 -0
- package/en/configure/app/dev/asset-prefix.mdx +1 -1
- package/en/configure/app/dev/before-start-url.mdx +1 -1
- package/en/configure/app/dev/hmr.mdx +1 -1
- package/en/configure/app/dev/host.mdx +1 -1
- package/en/configure/app/dev/https.mdx +1 -1
- package/en/configure/app/dev/port.mdx +1 -1
- package/en/configure/app/dev/progress-bar.mdx +1 -1
- package/en/configure/app/dev/start-url.mdx +1 -1
- package/en/configure/app/experiments/lazy-compilation.mdx +1 -1
- package/en/configure/app/html/app-icon.mdx +1 -1
- package/en/configure/app/html/crossorigin.mdx +1 -1
- package/en/configure/app/html/disable-html-folder.mdx +1 -1
- package/en/configure/app/html/favicon-by-entries.mdx +1 -1
- package/en/configure/app/html/favicon.mdx +1 -1
- package/en/configure/app/html/inject-by-entries.mdx +1 -1
- package/en/configure/app/html/inject.mdx +1 -1
- package/en/configure/app/html/meta-by-entries.mdx +1 -1
- package/en/configure/app/html/meta.mdx +1 -1
- package/en/configure/app/html/mount-id.mdx +1 -1
- package/en/configure/app/html/tags-by-entries.mdx +1 -1
- package/en/configure/app/html/tags.mdx +1 -1
- package/en/configure/app/html/template-by-entries.mdx +1 -1
- package/en/configure/app/html/template-parameters-by-entries.mdx +1 -1
- package/en/configure/app/html/template-parameters.mdx +1 -1
- package/en/configure/app/html/template.mdx +1 -1
- package/en/configure/app/html/title-by-entries.mdx +1 -1
- package/en/configure/app/html/title.mdx +1 -1
- package/en/configure/app/output/asset-prefix.mdx +1 -1
- package/en/configure/app/output/assets-retry.mdx +1 -1
- package/en/configure/app/output/charset.mdx +1 -1
- package/en/configure/app/output/clean-dist-path.mdx +1 -1
- package/en/configure/app/output/convert-to-rem.mdx +1 -1
- package/en/configure/app/output/copy.mdx +1 -1
- package/en/configure/app/output/css-module-local-ident-name.mdx +1 -1
- package/en/configure/app/output/data-uri-limit.mdx +1 -1
- package/en/configure/app/output/disable-css-extract.mdx +1 -1
- package/en/configure/app/output/disable-css-module-extension.mdx +1 -1
- package/en/configure/app/output/disable-filename-hash.mdx +1 -1
- package/en/configure/app/output/disable-inline-runtime-chunk.mdx +1 -1
- package/en/configure/app/output/disable-minimize.mdx +1 -1
- package/en/configure/app/output/disable-source-map.mdx +1 -1
- package/en/configure/app/output/disable-ts-checker.mdx +1 -1
- package/en/configure/app/output/dist-path.mdx +1 -1
- package/en/configure/app/output/enable-asset-fallback.mdx +1 -1
- package/en/configure/app/output/enable-asset-manifest.mdx +1 -1
- package/en/configure/app/output/enable-css-module-tsdeclaration.mdx +1 -1
- package/en/configure/app/output/enable-inline-scripts.mdx +1 -1
- package/en/configure/app/output/enable-inline-styles.mdx +1 -1
- package/en/configure/app/output/enable-latest-decorators.mdx +1 -1
- package/en/configure/app/output/externals.mdx +1 -1
- package/en/configure/app/output/filename.mdx +1 -1
- package/en/configure/app/output/legal-comments.mdx +1 -1
- package/en/configure/app/output/override-browserslist.mdx +1 -1
- package/en/configure/app/output/polyfill.mdx +1 -1
- package/en/configure/app/output/svg-default-export.mdx +1 -1
- package/en/configure/app/performance/build-cache.mdx +1 -1
- package/en/configure/app/performance/bundle-analyze.mdx +1 -1
- package/en/configure/app/performance/chunk-split.mdx +1 -1
- package/en/configure/app/performance/print-file-size.mdx +1 -1
- package/en/configure/app/performance/profile.mdx +1 -1
- package/en/configure/app/performance/remove-console.mdx +1 -1
- package/en/configure/app/performance/remove-moment-locale.mdx +1 -1
- package/en/configure/app/security/check-syntax.mdx +1 -1
- package/en/configure/app/security/sri.mdx +1 -1
- package/en/configure/app/source/alias.mdx +1 -1
- package/en/configure/app/source/compile-js-data-uri.mdx +1 -1
- package/en/configure/app/source/define.mdx +1 -1
- package/en/configure/app/source/exclude.mdx +1 -1
- package/en/configure/app/source/global-vars.mdx +1 -1
- package/en/configure/app/source/include.mdx +1 -1
- package/en/configure/app/source/module-scopes.mdx +1 -1
- package/en/configure/app/source/pre-entry.mdx +1 -1
- package/en/configure/app/source/resolve-extension-prefix.mdx +1 -1
- package/en/configure/app/source/resolve-main-fields.mdx +1 -1
- package/en/configure/app/tools/autoprefixer.mdx +1 -1
- package/en/configure/app/tools/babel.mdx +1 -1
- package/en/configure/app/tools/css-extract.mdx +1 -1
- package/en/configure/app/tools/css-loader.mdx +1 -1
- package/en/configure/app/tools/dev-server.mdx +1 -1
- package/en/configure/app/tools/html-plugin.mdx +1 -1
- package/en/configure/app/tools/inspector.mdx +1 -1
- package/en/configure/app/tools/less.mdx +1 -1
- package/en/configure/app/tools/minify-css.mdx +1 -1
- package/en/configure/app/tools/postcss.mdx +1 -1
- package/en/configure/app/tools/pug.mdx +1 -1
- package/en/configure/app/tools/rspack.mdx +1 -1
- package/en/configure/app/tools/sass.mdx +1 -1
- package/en/configure/app/tools/style-loader.mdx +1 -1
- package/en/configure/app/tools/styled-components.mdx +1 -1
- package/en/configure/app/tools/terser.mdx +1 -1
- package/en/configure/app/tools/ts-checker.mdx +1 -1
- package/en/configure/app/tools/ts-loader.mdx +1 -1
- package/en/configure/app/tools/webpack-chain.mdx +1 -1
- package/en/configure/app/tools/webpack.mdx +1 -1
- package/modern.config.ts +157 -0
- package/package.json +16 -7
- package/src/components/ContentCard/index.module.scss +61 -0
- package/src/components/ContentCard/index.tsx +25 -0
- package/src/components/FeatureLayout/index.module.css +8 -0
- package/src/components/FeatureLayout/index.tsx +8 -0
- package/src/components/Footer/index.tsx +131 -0
- package/src/components/Footer/styles.module.scss +49 -0
- package/src/components/ListCard/index.module.css +58 -0
- package/src/components/ListCard/index.tsx +26 -0
- package/src/components/SecondaryTitle/index.module.css +14 -0
- package/src/components/SecondaryTitle/index.tsx +15 -0
- package/src/global.d.ts +28 -0
- package/src/i18n/enUS.ts +50 -0
- package/src/i18n/index.ts +18 -0
- package/src/i18n/zhCN.ts +50 -0
- package/src/index.ts +9 -0
- package/src/pages/index.module.scss +238 -0
- package/src/pages/index.tsx +162 -0
- package/static/img/favicon.ico +0 -0
- package/static/img/features/ai.svg +1 -0
- package/static/img/features/api.svg +1 -0
- package/static/img/features/app.svg +1 -0
- package/static/img/features/blocks.svg +1 -0
- package/static/img/features/browser.svg +12 -0
- package/static/img/features/cloud.svg +1 -0
- package/static/img/features/coding-backend.svg +1 -0
- package/static/img/features/compiler.svg +1 -0
- package/static/img/features/css-file.svg +1 -0
- package/static/img/features/customize.svg +1 -0
- package/static/img/features/developer.svg +1 -0
- package/static/img/features/dynamic.svg +1 -0
- package/static/img/features/editor.svg +1 -0
- package/static/img/features/framework-config.svg +1 -0
- package/static/img/features/framework.svg +1 -0
- package/static/img/features/frameworks.svg +1 -0
- package/static/img/features/html.svg +1 -0
- package/static/img/features/icon2.svg +1 -0
- package/static/img/features/javascript.svg +1 -0
- package/static/img/features/monorepo.svg +1 -0
- package/static/img/features/product.svg +1 -0
- package/static/img/features/server-network.svg +1 -0
- package/static/img/features/serverless.svg +1 -0
- package/static/img/features/test.svg +1 -0
- package/static/img/features/trinity.svg +1 -0
- package/static/img/features/unity.svg +1 -0
- package/static/img/features/url.svg +1 -0
- package/static/img/features/visual.svg +1 -0
- package/static/img/features/web-server.svg +1 -0
- package/zh/configure/app/dev/asset-prefix.mdx +1 -1
- package/zh/configure/app/dev/before-start-url.mdx +1 -1
- package/zh/configure/app/dev/hmr.mdx +1 -1
- package/zh/configure/app/dev/host.mdx +1 -1
- package/zh/configure/app/dev/https.mdx +1 -1
- package/zh/configure/app/dev/port.mdx +1 -1
- package/zh/configure/app/dev/progress-bar.mdx +1 -1
- package/zh/configure/app/dev/start-url.mdx +1 -1
- package/zh/configure/app/experiments/lazy-compilation.mdx +1 -1
- package/zh/configure/app/html/app-icon.mdx +1 -1
- package/zh/configure/app/html/crossorigin.mdx +1 -1
- package/zh/configure/app/html/disable-html-folder.mdx +1 -1
- package/zh/configure/app/html/favicon-by-entries.mdx +1 -1
- package/zh/configure/app/html/favicon.mdx +1 -1
- package/zh/configure/app/html/inject-by-entries.mdx +1 -1
- package/zh/configure/app/html/inject.mdx +1 -1
- package/zh/configure/app/html/meta-by-entries.mdx +1 -1
- package/zh/configure/app/html/meta.mdx +1 -1
- package/zh/configure/app/html/mount-id.mdx +1 -1
- package/zh/configure/app/html/tags-by-entries.mdx +1 -1
- package/zh/configure/app/html/tags.mdx +1 -1
- package/zh/configure/app/html/template-by-entries.mdx +1 -1
- package/zh/configure/app/html/template-parameters-by-entries.mdx +1 -1
- package/zh/configure/app/html/template-parameters.mdx +1 -1
- package/zh/configure/app/html/template.mdx +1 -1
- package/zh/configure/app/html/title-by-entries.mdx +1 -1
- package/zh/configure/app/html/title.mdx +1 -1
- package/zh/configure/app/output/asset-prefix.mdx +1 -1
- package/zh/configure/app/output/assets-retry.mdx +1 -1
- package/zh/configure/app/output/charset.mdx +1 -1
- package/zh/configure/app/output/clean-dist-path.mdx +1 -1
- package/zh/configure/app/output/convert-to-rem.mdx +1 -1
- package/zh/configure/app/output/copy.mdx +1 -1
- package/zh/configure/app/output/css-module-local-ident-name.mdx +1 -1
- package/zh/configure/app/output/data-uri-limit.mdx +1 -1
- package/zh/configure/app/output/disable-css-extract.mdx +1 -1
- package/zh/configure/app/output/disable-css-module-extension.mdx +1 -1
- package/zh/configure/app/output/disable-filename-hash.mdx +1 -1
- package/zh/configure/app/output/disable-inline-runtime-chunk.mdx +1 -1
- package/zh/configure/app/output/disable-minimize.mdx +1 -1
- package/zh/configure/app/output/disable-source-map.mdx +1 -1
- package/zh/configure/app/output/disable-ts-checker.mdx +1 -1
- package/zh/configure/app/output/dist-path.mdx +1 -1
- package/zh/configure/app/output/enable-asset-fallback.mdx +1 -1
- package/zh/configure/app/output/enable-asset-manifest.mdx +1 -1
- package/zh/configure/app/output/enable-css-module-tsdeclaration.mdx +1 -1
- package/zh/configure/app/output/enable-inline-scripts.mdx +1 -1
- package/zh/configure/app/output/enable-inline-styles.mdx +1 -1
- package/zh/configure/app/output/enable-latest-decorators.mdx +1 -1
- package/zh/configure/app/output/externals.mdx +1 -1
- package/zh/configure/app/output/filename.mdx +1 -1
- package/zh/configure/app/output/legal-comments.mdx +1 -1
- package/zh/configure/app/output/override-browserslist.mdx +1 -1
- package/zh/configure/app/output/polyfill.mdx +1 -1
- package/zh/configure/app/output/svg-default-export.mdx +1 -1
- package/zh/configure/app/performance/build-cache.mdx +1 -1
- package/zh/configure/app/performance/bundle-analyze.mdx +1 -1
- package/zh/configure/app/performance/chunk-split.mdx +1 -1
- package/zh/configure/app/performance/print-file-size.mdx +1 -1
- package/zh/configure/app/performance/profile.mdx +1 -1
- package/zh/configure/app/performance/remove-console.mdx +1 -1
- package/zh/configure/app/performance/remove-moment-locale.mdx +1 -1
- package/zh/configure/app/security/check-syntax.mdx +1 -1
- package/zh/configure/app/security/sri.mdx +1 -1
- package/zh/configure/app/source/alias.mdx +1 -1
- package/zh/configure/app/source/compile-js-data-uri.mdx +1 -1
- package/zh/configure/app/source/define.mdx +1 -1
- package/zh/configure/app/source/exclude.mdx +1 -1
- package/zh/configure/app/source/global-vars.mdx +1 -1
- package/zh/configure/app/source/include.mdx +1 -1
- package/zh/configure/app/source/module-scopes.mdx +1 -1
- package/zh/configure/app/source/pre-entry.mdx +1 -1
- package/zh/configure/app/source/resolve-extension-prefix.mdx +1 -1
- package/zh/configure/app/source/resolve-main-fields.mdx +1 -1
- package/zh/configure/app/tools/autoprefixer.mdx +1 -1
- package/zh/configure/app/tools/babel.mdx +1 -1
- package/zh/configure/app/tools/css-extract.mdx +1 -1
- package/zh/configure/app/tools/css-loader.mdx +1 -1
- package/zh/configure/app/tools/dev-server.mdx +1 -1
- package/zh/configure/app/tools/html-plugin.mdx +1 -1
- package/zh/configure/app/tools/inspector.mdx +1 -1
- package/zh/configure/app/tools/less.mdx +1 -1
- package/zh/configure/app/tools/minify-css.mdx +1 -1
- package/zh/configure/app/tools/postcss.mdx +1 -1
- package/zh/configure/app/tools/pug.mdx +1 -1
- package/zh/configure/app/tools/rspack.mdx +1 -1
- package/zh/configure/app/tools/sass.mdx +1 -1
- package/zh/configure/app/tools/style-loader.mdx +1 -1
- package/zh/configure/app/tools/styled-components.mdx +1 -1
- package/zh/configure/app/tools/terser.mdx +1 -1
- package/zh/configure/app/tools/ts-checker.mdx +1 -1
- package/zh/configure/app/tools/ts-loader.mdx +1 -1
- package/zh/configure/app/tools/webpack-chain.mdx +1 -1
- package/zh/configure/app/tools/webpack.mdx +1 -1
- package/.eslintrc.js +0 -12
- package/.turbo/turbo-build.log +0 -4
- package/en/apis/app/commands.mdx +0 -297
- package/en/apis/app/hooks/api/framework/lambda.mdx +0 -57
- package/en/apis/app/hooks/api/functions/api.mdx +0 -81
- package/en/apis/app/hooks/src/routes.mdx +0 -90
- package/en/apis/app/hooks/src/server.mdx +0 -34
- package/en/apis/app/runtime/model/connect.mdx +0 -145
- package/en/apis/app/runtime/model/model_.mdx +0 -199
- package/en/apis/app/runtime/model/use-model.mdx +0 -89
- package/en/apis/app/runtime/router/router.mdx +0 -262
- package/en/apis/app/runtime/web-server/hook.mdx +0 -133
- package/en/apis/app/runtime/web-server/middleware.mdx +0 -110
- package/en/components/enable-bff.mdx +0 -31
- package/en/components/init-app.mdx +0 -43
- package/en/components/prerequisites.mdx +0 -20
- package/en/configure/app/output/ssg.mdx +0 -196
- package/en/configure/app/server/enable-framework-ext.mdx +0 -49
- package/en/configure/app/server/public-routes.mdx +0 -26
- package/en/configure/app/server/ssr.mdx +0 -38
- package/en/configure/app/source/design-system.mdx +0 -1175
- package/en/configure/app/source/disable-entry-dirs.mdx +0 -39
- package/en/configure/app/source/entries.mdx +0 -123
- package/en/guides/advanced-features/bff/_category_.json +0 -8
- package/en/guides/advanced-features/code-split.mdx +0 -80
- package/en/guides/advanced-features/compatibility.mdx +0 -78
- package/en/guides/advanced-features/eslint.mdx +0 -150
- package/en/guides/advanced-features/low-level.mdx +0 -45
- package/en/guides/advanced-features/rspack-start.mdx +0 -69
- package/en/guides/advanced-features/ssg.mdx +0 -116
- package/en/guides/advanced-features/ssr.mdx +0 -513
- package/en/guides/advanced-features/testing.mdx +0 -46
- package/en/guides/advanced-features/web-server.mdx +0 -57
- package/en/guides/basic-features/data-fetch.mdx +0 -404
- package/en/guides/basic-features/env-vars.mdx +0 -174
- package/en/guides/basic-features/html.mdx +0 -247
- package/en/guides/basic-features/proxy.mdx +0 -61
- package/en/guides/concept/builder.mdx +0 -47
- package/en/guides/get-started/introduction.mdx +0 -34
- package/en/guides/get-started/quick-start.mdx +0 -162
- package/en/guides/topic-detail/framework-plugin/hook-list.mdx +0 -828
- package/en/guides/topic-detail/framework-plugin/plugin-api.mdx +0 -117
- package/en/guides/topic-detail/generator/codesmith/api/npm.mdx +0 -48
- package/en/guides/topic-detail/generator/codesmith/develop.mdx +0 -53
- package/en/guides/topic-detail/generator/config/app.mdx +0 -82
- package/en/guides/topic-detail/generator/plugin/api/input/addInputAfter.mdx +0 -55
- package/en/guides/topic-detail/generator/plugin/api/input/addInputBefore.mdx +0 -55
- package/en/guides/topic-detail/generator/plugin/api/npm/install.mdx +0 -18
- package/en/guides/topic-detail/generator/plugin/develop.mdx +0 -125
- package/en/guides/topic-detail/generator/project.mdx +0 -118
- package/en/guides/topic-detail/micro-frontend/c02-development.mdx +0 -256
- package/en/guides/topic-detail/micro-frontend/c03-main-app.mdx +0 -276
- package/en/guides/topic-detail/model/faq.mdx +0 -41
- package/en/guides/topic-detail/model/manage-effects.mdx +0 -260
- package/en/guides/topic-detail/model/model-communicate.mdx +0 -220
- package/en/guides/topic-detail/model/performance.mdx +0 -171
- package/en/guides/topic-detail/model/quick-start.mdx +0 -113
- package/en/guides/topic-detail/model/use-model.mdx +0 -252
- package/en/guides/troubleshooting/cli.mdx +0 -63
- package/en/tutorials/first-app/c03-css.mdx +0 -323
- package/scripts/config.ts +0 -96
- package/scripts/summary.en.json +0 -1
- package/scripts/summary.zh.json +0 -1
- package/scripts/sync.ts +0 -57
- package/tsconfig.json +0 -7
- package/zh/apis/app/commands.mdx +0 -299
- package/zh/apis/app/runtime/model/connect.mdx +0 -143
- package/zh/apis/app/runtime/model/model_.mdx +0 -199
- package/zh/apis/app/runtime/model/use-model.mdx +0 -89
- package/zh/apis/app/runtime/web-server/hook.mdx +0 -134
- package/zh/apis/app/runtime/web-server/middleware.mdx +0 -111
- package/zh/apis/monorepo/commands/gen-release-note.mdx +0 -32
- package/zh/apis/monorepo/commands/new.mdx +0 -39
- package/zh/components/default-mwa-generate.mdx +0 -5
- package/zh/components/enable-bff.mdx +0 -31
- package/zh/components/init-app.mdx +0 -44
- package/zh/components/prerequisites.mdx +0 -20
- package/zh/components/release-note.mdx +0 -1
- package/zh/configure/app/server/enable-framework-ext.mdx +0 -49
- package/zh/guides/advanced-features/bff/_category_.json +0 -8
- package/zh/guides/advanced-features/rspack-start.mdx +0 -69
- package/zh/guides/advanced-features/ssr.mdx +0 -501
- package/zh/guides/advanced-features/web-server.mdx +0 -57
- package/zh/guides/basic-features/mock.mdx +0 -99
- package/zh/guides/concept/builder.mdx +0 -47
- package/zh/guides/get-started/introduction.mdx +0 -31
- package/zh/guides/topic-detail/changesets/changelog.mdx +0 -238
- package/zh/guides/topic-detail/changesets/commit.mdx +0 -271
- package/zh/guides/topic-detail/changesets/github.mdx +0 -164
- package/zh/guides/topic-detail/changesets/release-note.mdx +0 -259
- package/zh/guides/topic-detail/framework-plugin/extend.mdx +0 -163
- package/zh/guides/topic-detail/framework-plugin/hook.mdx +0 -173
- package/zh/guides/topic-detail/framework-plugin/implement.mdx +0 -248
- package/zh/guides/topic-detail/framework-plugin/introduction.mdx +0 -51
- package/zh/guides/topic-detail/framework-plugin/plugin-api.mdx +0 -117
- package/zh/guides/topic-detail/framework-plugin/relationship.mdx +0 -119
- package/zh/guides/topic-detail/generator/plugin/develop.mdx +0 -125
- package/zh/guides/topic-detail/micro-frontend/c01-introduction.mdx +0 -29
- package/zh/guides/topic-detail/micro-frontend/c04-communicate.mdx +0 -57
- package/zh/guides/topic-detail/micro-frontend/c05-mixed-stack.mdx +0 -26
- package/zh/guides/topic-detail/model/auto-actions.mdx +0 -92
- package/zh/guides/topic-detail/model/computed-state.mdx +0 -151
- package/zh/guides/topic-detail/model/define-model.mdx +0 -66
- package/zh/guides/topic-detail/model/faq.mdx +0 -41
- package/zh/guides/topic-detail/model/manage-effects.mdx +0 -260
- package/zh/guides/topic-detail/model/model-communicate.mdx +0 -220
- package/zh/guides/topic-detail/model/performance.mdx +0 -171
- package/zh/guides/topic-detail/model/quick-start.mdx +0 -113
- package/zh/guides/topic-detail/model/redux-integration.mdx +0 -24
- package/zh/guides/topic-detail/model/test-model.mdx +0 -45
- package/zh/guides/topic-detail/model/typescript-best-practice.mdx +0 -71
- package/zh/guides/topic-detail/model/use-model.mdx +0 -252
- package/zh/guides/topic-detail/model/use-out-of-modernjs.mdx +0 -50
- package/zh/guides/topic-detail/monorepo/create-sub-project.mdx +0 -67
- package/zh/guides/topic-detail/monorepo/sub-project-interface.mdx +0 -179
- package/zh/index.md +0 -4
- /package/{en → docs/en}/apis/app/hooks/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/hooks/api/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/hooks/api/framework/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/hooks/api/functions/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/hooks/api/functions/app.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/api/functions/common.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/api/test.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/config/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/hooks/config/html.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/config/icon.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/config/mock.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/config/public.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/config/storybook.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/config/upload.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/modern-config.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/server/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/hooks/server/index_.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/server/test.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/shared.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/src/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/hooks/src/app.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/src/index_.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/src/pages.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/src/stories.mdx +0 -0
- /package/{en → docs/en}/apis/app/hooks/src/test.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/runtime/app/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/runtime/app/define-config.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/bff/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/runtime/bff/hook.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/bff/use-context.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/core/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/runtime/core/bootstrap.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/core/create-app.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/core/use-loader.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/core/use-module-apps.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/core/use-runtime-context.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/model/Provider.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/model/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/runtime/model/auto-actions.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/model/create-app.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/model/create-store.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/model/handle-effect.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/model/use-local-model.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/model/use-static-model.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/model/use-store.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/router/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/runtime/ssr/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/runtime/ssr/no-ssr.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/ssr/pre-render.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/testing/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/runtime/testing/act.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/testing/cleanup.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/testing/render.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/testing/renderApp.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/utility/_category_.json +0 -0
- /package/{en → docs/en}/apis/app/runtime/utility/css-in-js.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/utility/head.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/utility/loadable.mdx +0 -0
- /package/{en → docs/en}/apis/app/runtime/web-server/_category_.json +0 -0
- /package/{en → docs/en}/components/debug-app.mdx +0 -0
- /package/{en → docs/en}/components/enable-micro-frontend.mdx +0 -0
- /package/{en → docs/en}/components/global-proxy-config.mdx +0 -0
- /package/{en → docs/en}/components/global-proxy.mdx +0 -0
- /package/{en → docs/en}/components/micro-master-manifest-config.mdx +0 -0
- /package/{en → docs/en}/components/micro-runtime-config.mdx +0 -0
- /package/{en → docs/en}/components/reduck-migration.mdx +0 -0
- /package/{en → docs/en}/components/reduck-tip.mdx +0 -0
- /package/{en → docs/en}/components/router-legacy-tip.mdx +0 -0
- /package/{en → docs/en}/configure/app/auto-load-plugin.mdx +0 -0
- /package/{en → docs/en}/configure/app/bff/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/bff/prefix.mdx +0 -0
- /package/{en → docs/en}/configure/app/bff/proxy.mdx +0 -0
- /package/{en → docs/en}/configure/app/builder-plugins.mdx +0 -0
- /package/{en → docs/en}/configure/app/deploy/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/deploy/microFrontend.mdx +0 -0
- /package/{en → docs/en}/configure/app/dev/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/dev/proxy.mdx +0 -0
- /package/{en → docs/en}/configure/app/experiments/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/html/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/output/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/output/disable-node-polyfill.mdx +0 -0
- /package/{en → docs/en}/configure/app/performance/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/plugins.mdx +0 -0
- /package/{en → docs/en}/configure/app/runtime/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/runtime/intro.mdx +0 -0
- /package/{en → docs/en}/configure/app/runtime/master-app.mdx +0 -0
- /package/{en → docs/en}/configure/app/runtime/router.mdx +0 -0
- /package/{en → docs/en}/configure/app/runtime/state.mdx +0 -0
- /package/{en → docs/en}/configure/app/security/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/server/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/server/base-url.mdx +0 -0
- /package/{en → docs/en}/configure/app/server/port.mdx +0 -0
- /package/{en → docs/en}/configure/app/server/routes.mdx +0 -0
- /package/{en → docs/en}/configure/app/server/ssr-by-entries.mdx +0 -0
- /package/{en → docs/en}/configure/app/source/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/source/config-dir.mdx +0 -0
- /package/{en → docs/en}/configure/app/source/disable-default-entries.mdx +0 -0
- /package/{en → docs/en}/configure/app/source/enable-async-entry.mdx +0 -0
- /package/{en → docs/en}/configure/app/source/entries-dir.mdx +0 -0
- /package/{en → docs/en}/configure/app/testing/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/testing/transformer.mdx +0 -0
- /package/{en → docs/en}/configure/app/tools/_category_.json +0 -0
- /package/{en → docs/en}/configure/app/tools/esbuild.mdx +0 -0
- /package/{en → docs/en}/configure/app/tools/jest.mdx +0 -0
- /package/{en → docs/en}/configure/app/tools/swc.mdx +0 -0
- /package/{en → docs/en}/configure/app/tools/tailwindcss.mdx +0 -0
- /package/{en → docs/en}/configure/app/usage.mdx +0 -0
- /package/{en → docs/en}/guides/advanced-features/_category_.json +0 -0
- /package/{en → docs/en}/guides/advanced-features/bff/bff-proxy.mdx +0 -0
- /package/{en → docs/en}/guides/advanced-features/bff/frameworks.mdx +0 -0
- /package/{en → docs/en}/guides/advanced-features/bff/function.mdx +0 -0
- /package/{en → docs/en}/guides/advanced-features/bff/index.mdx +0 -0
- /package/{en → docs/en}/guides/advanced-features/bff/type.mdx +0 -0
- /package/{en → docs/en}/guides/basic-features/_category_.json +0 -0
- /package/{en → docs/en}/guides/basic-features/alias.mdx +0 -0
- /package/{en → docs/en}/guides/basic-features/css.mdx +0 -0
- /package/{en → docs/en}/guides/basic-features/mock.mdx +0 -0
- /package/{en → docs/en}/guides/basic-features/routes.mdx +0 -0
- /package/{en → docs/en}/guides/concept/_category_.json +0 -0
- /package/{en → docs/en}/guides/concept/entries.mdx +0 -0
- /package/{en → docs/en}/guides/get-started/_category_.json +0 -0
- /package/{en → docs/en}/guides/get-started/upgrade.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/framework-plugin/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/framework-plugin/lifecycle.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/api/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/api/app.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/api/ejs.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/api/fs.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/api/git.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/api/handlebars.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/api/json.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/introduce.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/run-in-js.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/codesmith/structure.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/config/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/config/common.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/config/module.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/config/monorepo.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/abstract.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/addFile.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/addHelper.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/addManyFile.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/addPartial.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/introduce.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/rmDir.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/rmFile.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/updateJSONFile.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/updateModernConfig.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/file/updateTextRawFile.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/git/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/git/gitAddAndCommit.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/git/initGitRepo.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/git/isInGitRepo.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/hook/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/hook/afterForged.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/hook/onForged.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/info/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/info/isFileExit.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/info/locale.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/info/readDir.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/input/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/input/setInput.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/input/setInputValue.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/input/type.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/introduce.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/new/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/new/createElement.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/new/createSubProject.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/new/enableFunc.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/new/introduce.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/api/npm/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/generator/plugin/use.mdx +0 -0
- /package/{en → docs/en}/guides/topic-detail/micro-frontend/_category_.json +0 -0
- /package/{en → docs/en}/guides/topic-detail/model/_category_.json +0 -0
- /package/{en → docs/en}/guides/troubleshooting/_category_.json +0 -0
- /package/{en → docs/en}/index.md +0 -0
- /package/{en → docs/en}/tutorials/first-app/_category_.json +0 -0
- /package/{en → docs/en}/tutorials/first-app/c01-start.mdx +0 -0
- /package/{en → docs/en}/tutorials/first-app/c02-component.mdx +0 -0
- /package/{en → docs/en}/tutorials/first-app/c04-routes.mdx +0 -0
- /package/{en → docs/en}/tutorials/first-app/c05-loader.mdx +0 -0
- /package/{en → docs/en}/tutorials/first-app/c06-model.mdx +0 -0
- /package/{en → docs/en}/tutorials/first-app/c07-container.mdx +0 -0
- /package/{en → docs/en}/tutorials/first-app/c08-entries.mdx +0 -0
- /package/{en → docs/en}/tutorials/foundations/_category_.json +0 -0
- /package/{en → docs/en}/tutorials/foundations/introduction.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/api/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/api/framework/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/api/framework/lambda.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/api/functions/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/api/functions/api.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/api/functions/app.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/api/functions/common.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/api/test.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/config/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/config/html.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/config/icon.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/config/mock.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/config/public.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/config/storybook.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/config/upload.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/modern-config.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/server/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/server/index_.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/server/test.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/shared.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/src/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/src/app.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/src/index_.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/src/pages.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/src/routes.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/src/server.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/src/stories.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/hooks/src/test.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/app/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/app/define-config.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/bff/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/bff/hook.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/bff/use-context.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/core/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/core/bootstrap.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/core/create-app.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/core/use-loader.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/core/use-module-apps.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/core/use-runtime-context.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/model/Provider.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/model/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/model/auto-actions.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/model/create-app.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/model/create-store.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/model/handle-effect.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/model/use-local-model.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/model/use-static-model.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/model/use-store.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/router/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/router/router.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/ssr/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/ssr/no-ssr.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/ssr/pre-render.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/testing/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/testing/act.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/testing/cleanup.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/testing/render.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/testing/renderApp.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/utility/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/utility/css-in-js.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/utility/head.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/utility/loadable.mdx +0 -0
- /package/{zh → docs/zh}/apis/app/runtime/web-server/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/monorepo/commands/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/monorepo/commands/bump.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/commands/change.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/commands/clear.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/commands/deploy.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/commands/index.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/commands/lint.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/commands/pre.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/commands/release.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/commands/upgrade.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/hooks/_category_.json +0 -0
- /package/{zh → docs/zh}/apis/monorepo/hooks/apps.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/hooks/code-workspace.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/hooks/examples.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/hooks/features.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/hooks/index.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/hooks/packages.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/hooks/pnpm-workspace.mdx +0 -0
- /package/{zh → docs/zh}/apis/monorepo/hooks/pnpmfile.mdx +0 -0
- /package/{zh → docs/zh}/blog/index.md +0 -0
- /package/{zh → docs/zh}/community/index.mdx +0 -0
- /package/{zh → docs/zh}/components/custom-router-micro-frontend.mdx +0 -0
- /package/{zh → docs/zh}/components/debug-app.mdx +0 -0
- /package/{zh → docs/zh}/components/deploy.mdx +0 -0
- /package/{zh → docs/zh}/components/enable-micro-frontend.mdx +0 -0
- /package/{zh → docs/zh}/components/global-proxy-config.mdx +0 -0
- /package/{zh → docs/zh}/components/global-proxy.mdx +0 -0
- /package/{zh → docs/zh}/components/micro-master-manifest-config.mdx +0 -0
- /package/{zh → docs/zh}/components/micro-runtime-config.mdx +0 -0
- /package/{zh → docs/zh}/components/reduck-migration.mdx +0 -0
- /package/{zh → docs/zh}/components/reduck-tip.mdx +0 -0
- /package/{zh → docs/zh}/components/router-legacy-tip.mdx +0 -0
- /package/{zh → docs/zh}/components/self-route-example.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/auto-load-plugin.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/bff/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/bff/prefix.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/bff/proxy.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/builder-plugins.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/deploy/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/deploy/microFrontend.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/dev/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/dev/proxy.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/experiments/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/html/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/output/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/output/disable-node-polyfill.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/output/ssg.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/performance/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/plugins.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/runtime/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/runtime/intro.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/runtime/master-app.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/runtime/router.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/runtime/state.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/security/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/server/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/server/base-url.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/server/port.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/server/public-routes.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/server/routes.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/server/ssr-by-entries.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/server/ssr.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/source/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/source/config-dir.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/source/design-system.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/source/disable-default-entries.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/source/disable-entry-dirs.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/source/enable-async-entry.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/source/entries-dir.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/source/entries.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/testing/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/testing/transformer.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/tools/_category_.json +0 -0
- /package/{zh → docs/zh}/configure/app/tools/esbuild.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/tools/jest.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/tools/swc.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/tools/tailwindcss.mdx +0 -0
- /package/{zh → docs/zh}/configure/app/usage.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/bff/bff-proxy.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/bff/frameworks.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/bff/function.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/bff/index.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/bff/type.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/code-split.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/compatibility.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/eslint.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/low-level.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/ssg.mdx +0 -0
- /package/{zh → docs/zh}/guides/advanced-features/testing.mdx +0 -0
- /package/{zh → docs/zh}/guides/basic-features/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/basic-features/alias.mdx +0 -0
- /package/{zh → docs/zh}/guides/basic-features/css.mdx +0 -0
- /package/{zh → docs/zh}/guides/basic-features/data-fetch.mdx +0 -0
- /package/{zh → docs/zh}/guides/basic-features/env-vars.mdx +0 -0
- /package/{zh → docs/zh}/guides/basic-features/html.mdx +0 -0
- /package/{zh → docs/zh}/guides/basic-features/proxy.mdx +0 -0
- /package/{zh → docs/zh}/guides/basic-features/routes.mdx +0 -0
- /package/{zh → docs/zh}/guides/concept/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/concept/entries.mdx +0 -0
- /package/{zh → docs/zh}/guides/get-started/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/get-started/quick-start.mdx +0 -0
- /package/{zh → docs/zh}/guides/get-started/upgrade.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/changesets/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/changesets/add.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/changesets/config.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/changesets/introduce.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/changesets/release-pre.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/changesets/release.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/framework-plugin/_category_.json +0 -0
- /package/{en → docs/zh}/guides/topic-detail/framework-plugin/extend.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/framework-plugin/hook-list.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/framework-plugin/hook.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/framework-plugin/implement.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/framework-plugin/introduction.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/framework-plugin/lifecycle.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/framework-plugin/relationship.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/api/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/api/app.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/api/ejs.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/api/fs.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/api/git.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/api/handlebars.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/api/json.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/api/npm.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/develop.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/introduce.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/run-in-js.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/codesmith/structure.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/config/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/config/app.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/config/common.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/config/module.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/config/monorepo.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/abstract.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/addFile.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/addHelper.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/addManyFile.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/addPartial.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/introduce.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/rmDir.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/rmFile.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/updateJSONFile.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/updateModernConfig.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/file/updateTextRawFile.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/git/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/git/gitAddAndCommit.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/git/initGitRepo.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/git/isInGitRepo.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/hook/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/hook/afterForged.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/hook/onForged.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/info/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/info/isFileExit.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/info/locale.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/info/readDir.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/input/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/input/addInputAfter.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/input/addInputBefore.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/input/setInput.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/input/setInputValue.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/input/type.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/introduce.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/new/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/new/createElement.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/new/createSubProject.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/new/enableFunc.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/new/introduce.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/npm/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/api/npm/install.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/plugin/use.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/generator/project.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/micro-frontend/_category_.json +0 -0
- /package/{en → docs/zh}/guides/topic-detail/micro-frontend/c01-introduction.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/micro-frontend/c02-development.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/micro-frontend/c03-main-app.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/micro-frontend/c04-communicate.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/micro-frontend/c05-mixed-stack.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/model/_category_.json +0 -0
- /package/{en → docs/zh}/guides/topic-detail/model/auto-actions.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/model/computed-state.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/model/define-model.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/model/redux-integration.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/model/test-model.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/model/typescript-best-practice.mdx +0 -0
- /package/{en → docs/zh}/guides/topic-detail/model/use-out-of-modernjs.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/monorepo/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/monorepo/intro.mdx +0 -0
- /package/{zh → docs/zh}/guides/topic-detail/monorepo/publish.mdx +0 -0
- /package/{zh → docs/zh}/guides/troubleshooting/_category_.json +0 -0
- /package/{zh → docs/zh}/guides/troubleshooting/cli.mdx +0 -0
- /package/{zh → docs/zh}/guides/troubleshooting/dependencies.mdx +0 -0
- /package/{zh → docs/zh}/tutorials/first-app/_category_.json +0 -0
- /package/{zh → docs/zh}/tutorials/first-app/c01-start.mdx +0 -0
- /package/{zh → docs/zh}/tutorials/first-app/c02-component.mdx +0 -0
- /package/{zh → docs/zh}/tutorials/first-app/c03-css.mdx +0 -0
- /package/{zh → docs/zh}/tutorials/first-app/c04-routes.mdx +0 -0
- /package/{zh → docs/zh}/tutorials/first-app/c05-loader.mdx +0 -0
- /package/{zh → docs/zh}/tutorials/first-app/c06-model.mdx +0 -0
- /package/{zh → docs/zh}/tutorials/first-app/c07-container.mdx +0 -0
- /package/{zh → docs/zh}/tutorials/first-app/c08-entries.mdx +0 -0
- /package/{zh → docs/zh}/tutorials/foundations/_category_.json +0 -0
- /package/{zh → docs/zh}/tutorials/foundations/introduction.mdx +0 -0
@@ -1,501 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: 服务端渲染(SSR)
|
3
|
-
sidebar_position: 3
|
4
|
-
---
|
5
|
-
# 服务端渲染(SSR)
|
6
|
-
|
7
|
-
在 Modern.js 中,SSR 也是开箱即用的。开发者无需为 SSR 编写复杂的服务端逻辑,也无需关心 SSR 的运维,或是创建单独的服务。Modern.js 拥有完备的 SSR 降级策略,保证页面能够安全运行。
|
8
|
-
|
9
|
-
启用 SSR 非常简单,只需要设置 [`server.ssr`](/configure/app/server/ssr) 为 `true` 即可:
|
10
|
-
|
11
|
-
```json
|
12
|
-
{
|
13
|
-
"server": {
|
14
|
-
"ssr": true
|
15
|
-
}
|
16
|
-
}
|
17
|
-
```
|
18
|
-
|
19
|
-
## SSR 时的数据获取
|
20
|
-
|
21
|
-
Modern.js 中提供了 Data Loader,方便开发者在 SSR、CSR 下同构的获取数据。每个路由模块,如 `layout.tsx` 和 `page.tsx` 都可以定义自己的 Data Loader:
|
22
|
-
|
23
|
-
```ts title="src/routes/page.loader.ts"
|
24
|
-
export default () => {
|
25
|
-
return {
|
26
|
-
message: 'Hello World',
|
27
|
-
};
|
28
|
-
};
|
29
|
-
```
|
30
|
-
|
31
|
-
在组件中可以通过 Hooks API 的方式获取 `loader` 函数返回的数据:
|
32
|
-
|
33
|
-
```tsx
|
34
|
-
import { useLoaderData } from '@modern-js/runtime/router'
|
35
|
-
export default () => {
|
36
|
-
const data = useLoaderData();
|
37
|
-
return <div>{data.message}</div>;
|
38
|
-
};
|
39
|
-
```
|
40
|
-
|
41
|
-
Modern.js 打破传统的 SSR 开发模式,提供了用户无感的 SSR 开发体验。并且提供了优雅的降级处理,一旦 SSR 请求失败,会自动降级在浏览器端重新发起请求。
|
42
|
-
|
43
|
-
不过,开发者仍然需要关注数据的兜底处理,例如 `null` 值或不符合预期的数据返回。避免在 SSR 时产生 React 渲染错误或是返回凌乱的渲染结果。
|
44
|
-
|
45
|
-
:::info 补充信息
|
46
|
-
1. 当以客户端路由的方式请求页面时,Modern.js 会发送一个 HTTP 请求,服务端接收到请求后执行页面对应的 Data Loader 函数,然后将执行结果作为请求的响应返回浏览器。
|
47
|
-
|
48
|
-
2. 使用 Data Loader 时,数据获取发生在渲染前,Modern.js 也仍然支持在组件渲染时获取数据。更多相关内容可以查看[数据获取](/guides/basic-features/data-fetch)。
|
49
|
-
:::
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
## 保持渲染一致
|
54
|
-
|
55
|
-
有些业务中,通常需要根据当前的运行容器环境特征做不同的 UI 展示,例如 [UA](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) 信息。如果处理不够仔细,此时很有可能出现不符合预期的渲染结果。
|
56
|
-
|
57
|
-
这里通过一个例子,演示当 SSR 与 CSR 渲染不一致时出现的问题,在组件中添加以下代码:
|
58
|
-
|
59
|
-
```tsx
|
60
|
-
{
|
61
|
-
typeof window !== 'undefined' ? <div>browser content</div> : null;
|
62
|
-
}
|
63
|
-
```
|
64
|
-
|
65
|
-
启动应用后,访问页面,会发现浏览器控制台抛出警告信息:
|
66
|
-
|
67
|
-
```sh
|
68
|
-
Warning: Expected server HTML to contain a matching <div> in <div>.
|
69
|
-
```
|
70
|
-
|
71
|
-
这是 React 在客户端执行 hydrate 逻辑时,发现渲染结果与 SSR 渲染结果不一致造成的。虽然页面表现正常,但在复杂应用中,很有可能因此出现 DOM 层级混乱、样式混乱等问题。
|
72
|
-
|
73
|
-
:::info
|
74
|
-
关于 hydrate (注水)逻辑请参考[这里](https://reactjs.org/docs/react-dom.html#hydrate)。
|
75
|
-
|
76
|
-
:::
|
77
|
-
|
78
|
-
应用需要保持 SSR 与 CSR 渲染结果的一致性,如果存在不一致的情况,说明这部分内容无需在 SSR 中进行渲染。Modern.js 为这类在 SSR 中不需要渲染的内容提供 [`<NoSSR>` 工具组件](/apis/app/runtime/core/use-runtime-context):
|
79
|
-
|
80
|
-
```ts
|
81
|
-
import { NoSSR } from '@modern-js/runtime/ssr';
|
82
|
-
```
|
83
|
-
|
84
|
-
在不需要进行 SSR 的元素外部,用 `NoSSR` 组件包裹:
|
85
|
-
|
86
|
-
```tsx
|
87
|
-
<NoSSR>
|
88
|
-
<div>client content</div>
|
89
|
-
</NoSSR>
|
90
|
-
```
|
91
|
-
|
92
|
-
修改代码后,刷新页发现之前的 Waring 消失。打开浏览器开发者工具的 Network 窗口,查看返回的 HTML 文档是不包含 `NoSSR` 组件包裹的内容的。
|
93
|
-
|
94
|
-
:::info 补充信息
|
95
|
-
[`useRuntimeContext`](/apis/app/runtime/core/use-runtime-context) 可以获取完整的请求信息,可以利用它保证 SSR 与 CSR 的渲染结果一致。
|
96
|
-
|
97
|
-
:::
|
98
|
-
|
99
|
-
## 关注内存泄漏
|
100
|
-
|
101
|
-
:::warning 警告
|
102
|
-
在 SSR 场景下,开发者需要特别关注内存泄露问题,即使是微小的内存泄露,在大量的访问后也会对服务造成影响。
|
103
|
-
|
104
|
-
:::
|
105
|
-
|
106
|
-
SSR 时,浏览器的每次请求,都会触发服务端重新执行一次组件渲染逻辑。所以,需要避免在全局定义任何可能不断增长的数据结构,或在全局进行事件订阅,或创建不会被销毁的流。
|
107
|
-
|
108
|
-
例如以下代码,使用 [redux-observable](https://redux-observable.js.org/) 时,习惯了 CSR 的开发者通常会在组件中这样编码:
|
109
|
-
|
110
|
-
```tsx
|
111
|
-
/* 代码仅作为示例,不可运行 */
|
112
|
-
import { createEpicMiddleware, combineEpics } from 'redux-observable';
|
113
|
-
|
114
|
-
const epicMiddleware = createEpicMiddleware();
|
115
|
-
const rootEpic = combineEpics();
|
116
|
-
|
117
|
-
export default function Test() {
|
118
|
-
epicMiddleware.run(rootEpic);
|
119
|
-
return <div>Hello Modern.js</div>;
|
120
|
-
}
|
121
|
-
```
|
122
|
-
|
123
|
-
在组件外层创建 Middleware 实例 `epicMiddleware`,并在组件内部调用 `epicMiddleware.run`。
|
124
|
-
|
125
|
-
在浏览器端,这段代码不会造成任何问题,但是在 SSR 时,Middleware 实例会一直无法被销毁。每次渲染组件,调用 `epicMiddleware.run(rootEpic)` 时,都会在内部添加新的事件绑定,导致整个对象不断变大,最终对应用性能造成影响。
|
126
|
-
|
127
|
-
CSR 中这类问题不易被发觉,因此从 CSR 切换到 SSR 时,如果不确定应用是否存在这类隐患,可以对应用进行压测。
|
128
|
-
|
129
|
-
## 收敛服务端数据
|
130
|
-
|
131
|
-
为了保持 SSR 阶段请求的数据,可以在浏览器端直接使用,Modern.js 会将渲染过程中收集的数据与状态注入到 HTML 内。但是,CSR 应用常常存在接口数据量大、组件状态未收敛的情况,这时如果直接使用 SSR,渲染得到的 HTML 体积可能会存在过大的问题。此时,SSR 不仅无法为应用带来用户体验上的提升,反而可能起到相反的作用。
|
132
|
-
|
133
|
-
因此,使用 SSR 时,**开发者需要为应用做合理的瘦身**:
|
134
|
-
|
135
|
-
1. 关注首屏,SSR 中可以只请求首屏需要的数据,并在浏览器端渲染剩余的部分。
|
136
|
-
2. 将与渲染无关的数据,从接口返回数据中剔除。
|
137
|
-
|
138
|
-
## Serverless Pre-render
|
139
|
-
|
140
|
-
Modern.js 提供 Serverless Pre-rendering (SPR) 这一特性来提升 SSR 性能。
|
141
|
-
|
142
|
-
SPR 利用预渲染与缓存技术,为 SSR 页面提供静态 Web 的响应性能。它让 SSR 应用拥有静态 Web 页面的响应速度与稳定性,同时还能保持数据的动态更新。
|
143
|
-
|
144
|
-
在 Modern.js 中使用 SPR 非常简单,只需要在组件中新增 `PreRender` 组件,该组件所在的页面就会自动开启 SPR。
|
145
|
-
|
146
|
-
这里模拟一个使用 `useLoaderData` API 的组件,Data Loader 中的请求需要消耗 2s 时间。
|
147
|
-
|
148
|
-
```jsx
|
149
|
-
import { useLoaderData } from '@modern-js/runtime/router';
|
150
|
-
|
151
|
-
export const loader = async () => {
|
152
|
-
await new Promise((resolve, reject) => {
|
153
|
-
setTimeout(() => {
|
154
|
-
resolve(null);
|
155
|
-
}, 2000);
|
156
|
-
});
|
157
|
-
|
158
|
-
return {
|
159
|
-
message: 'Hello Modern.js',
|
160
|
-
};
|
161
|
-
};
|
162
|
-
|
163
|
-
export default () => {
|
164
|
-
const data = useLoaderData();
|
165
|
-
return <div>{data?.message}</div>;
|
166
|
-
};
|
167
|
-
```
|
168
|
-
|
169
|
-
执行 `dev` 命令后,打开页面,可以明显的察觉到页面需要等到 2s 后才返回。
|
170
|
-
|
171
|
-
接下来使用 `PreRender` 组件来进行优化,该组件可以直接从 `@modern-js/runtime/ssr` 中导出:
|
172
|
-
|
173
|
-
```ts
|
174
|
-
import { PreRender } from '@modern-js/runtime/ssr';
|
175
|
-
```
|
176
|
-
|
177
|
-
在路由组件内使用 `PreRender` 组件,并设置参数 `interval`,用于表示该次渲染结果的过期时间为 5s:
|
178
|
-
|
179
|
-
```tsx
|
180
|
-
<PreRender interval={5} />
|
181
|
-
```
|
182
|
-
|
183
|
-
修改后,执行 `pnpm run build && pnpm run serve` 启动应用,并打开页面。
|
184
|
-
|
185
|
-
首次打开时,和之前的渲染并没有什么不同,同样存在 2s 延迟。点击刷新,页面瞬间打开,但此时,页面数据并没有因为刷新发生变化,这是因为缓存还没有过期。
|
186
|
-
|
187
|
-
等待 5s,重新刷新页面,页面的数据仍然没有变化。再一次刷新页面数据发生变化,但是页面仍然几乎是瞬间响应的。
|
188
|
-
这是因为在之前的请求时,SPR 已经在后台异步获取了新的渲染结果,本次请求到的页面是已经缓存在服务器中的版本。
|
189
|
-
|
190
|
-
可以想象,当 `interval` 设置为 1 时,用户可以在感知到实时数据的同时,拥有静态页面的响应体验。
|
191
|
-
|
192
|
-
:::info 补充信息
|
193
|
-
`PreRender` 的详细使用可以参考[这里](/apis/app/runtime/ssr/pre-render)。
|
194
|
-
|
195
|
-
:::
|
196
|
-
|
197
|
-
## Treeshaking
|
198
|
-
|
199
|
-
开启 SSR 时,Modern.js 会用相同的入口,构建出 SSR Bundle 和 CSR Bundle 两份产物。因此,在 SSR Bundle 中存在 Web API,或是在 CSR Bundle 中存在 Node API 时,都可能导致运行出错。
|
200
|
-
|
201
|
-
在组件中引入 Web API,通常情况下是要做一些全局监听,或是获取浏览器相关的数据,例如:
|
202
|
-
|
203
|
-
```tsx
|
204
|
-
document.addEventListener('load', () => {
|
205
|
-
console.log('document load');
|
206
|
-
});
|
207
|
-
const App = () => {
|
208
|
-
return <div>Hello World</div>;
|
209
|
-
};
|
210
|
-
export default App;
|
211
|
-
```
|
212
|
-
|
213
|
-
在组件文件中引入 Node API,通常情况下是因为使用了 Data Loader,例如:
|
214
|
-
|
215
|
-
```ts
|
216
|
-
import fse from 'fs-extra';
|
217
|
-
export const loader = () => {
|
218
|
-
const file = fse.readFileSync('./myfile');
|
219
|
-
return {
|
220
|
-
...
|
221
|
-
};
|
222
|
-
};
|
223
|
-
```
|
224
|
-
|
225
|
-
### 环境变量区分
|
226
|
-
|
227
|
-
对于第一种情况,我们可以直接使用 Modern.js 内置的环境变量 `MODERN_TARGET` 进行判断,在构建时删除无用代码:
|
228
|
-
|
229
|
-
```ts
|
230
|
-
if (process.env.MODERN_TARGET === 'browser') {
|
231
|
-
document.addEventListener('load', () => {
|
232
|
-
console.log('document load');
|
233
|
-
});
|
234
|
-
}
|
235
|
-
```
|
236
|
-
|
237
|
-
:::note
|
238
|
-
更多内容可以查看[环境变量](/guides/basic-features/env-vars)。
|
239
|
-
|
240
|
-
:::
|
241
|
-
|
242
|
-
### 文件后缀区分
|
243
|
-
|
244
|
-
但例如第二种情况,Treeshaking 的方式并不能保证代码被完全分离。Modern.js 也支持通过 `.node.` 后缀的文件来区分 SSR Bundle 和 CSR Bundle 产物的打包文件。
|
245
|
-
|
246
|
-
例如在代码中引入了 `fs-extra`,这时候直接引用到组件中,会造成 CSR 加载报错。可以创建同名的 `.ts` 和 `.node.ts` 文件做一层代理:
|
247
|
-
|
248
|
-
```ts title="compat.ts"
|
249
|
-
export const readFileSync: any = () => {};
|
250
|
-
```
|
251
|
-
|
252
|
-
```ts title="compat.node.ts"
|
253
|
-
export { readFileSync } from 'fs-extra';
|
254
|
-
```
|
255
|
-
|
256
|
-
在文件中直接引入 `./compat`,此时 SSR 环境下会优先使用 `.node.ts` 后缀的文件,CSR 环境下会使用 `.ts` 后缀的文件。
|
257
|
-
|
258
|
-
```ts title="App.tsx"
|
259
|
-
import { readFileSync } from './compat'
|
260
|
-
|
261
|
-
export const loader = () => {
|
262
|
-
const file = readFileSync('./myfile');
|
263
|
-
return {
|
264
|
-
...
|
265
|
-
};
|
266
|
-
};
|
267
|
-
```
|
268
|
-
|
269
|
-
### 独立文件
|
270
|
-
|
271
|
-
上述两种方式,都会为开发者带来一些心智负担。Modern.js 基于[嵌套路由](/guides/basic-features/routes)开发设计了[更简单的方案](/guides/basic-features/data-fetch)来分离 CSR 和 SSR 的代码。
|
272
|
-
|
273
|
-
## 接口请求
|
274
|
-
|
275
|
-
在 SSR 中发起接口请求时,开发者有时自己封装了同构的请求工具。部分接口需要传递用户 Cookie,开发者可以通过 [`useRuntimeContext`](/guides/basic-features/data-fetch#route-loader) API 获取到请求头来实现。
|
276
|
-
|
277
|
-
需要注意的是,此时获取到的是 HTML 请求的请求头,不一定适用于接口请求,因此**千万不能**透传所有请求头。并且,一些后端接口,或是通用网关,会根据请求头中的信息做校验,全量透传容易出现各种难以排查的问题,推荐**按需透传**。
|
278
|
-
|
279
|
-
如果实在需要透传所有请求头,请务必过滤 `host` 字段。
|
280
|
-
|
281
|
-
## 流式渲染
|
282
|
-
|
283
|
-
Modern.js 支持了 React 18 的流式渲染,可以通过如下配置启用:
|
284
|
-
|
285
|
-
```json
|
286
|
-
{
|
287
|
-
"server": {
|
288
|
-
"ssr": {
|
289
|
-
"mode": "stream"
|
290
|
-
}
|
291
|
-
}
|
292
|
-
}
|
293
|
-
```
|
294
|
-
|
295
|
-
Modern.js 的流式渲染基于 React Router 实现,主要涉及 API 有:
|
296
|
-
|
297
|
-
- [`defer`](https://reactrouter.com/en/main/utils/defer):在 Data Loader 中使用,用于支持异步获取数据。
|
298
|
-
- [`Await`](https://reactrouter.com/en/main/components/await):用于渲染 Data Loader 返回的异步数据。
|
299
|
-
- [`useAsyncValue`](https://reactrouter.com/en/main/hooks/use-async-value):用于从最近的父级 `Await` 组件中获取数据。
|
300
|
-
|
301
|
-
|
302
|
-
### 异步获取数据
|
303
|
-
|
304
|
-
```ts title='page.loader.ts'
|
305
|
-
import { defer, type LoaderFunctionArgs } from '@modern-js/runtime/router';
|
306
|
-
|
307
|
-
interface User {
|
308
|
-
name: string;
|
309
|
-
age: number;
|
310
|
-
}
|
311
|
-
|
312
|
-
export interface Data {
|
313
|
-
data: User;
|
314
|
-
}
|
315
|
-
|
316
|
-
export default ({ params }: LoaderFunctionArgs) => {
|
317
|
-
const userId = params.id;
|
318
|
-
|
319
|
-
const user = new Promise<User>(resolve => {
|
320
|
-
setTimeout(() => {
|
321
|
-
resolve({
|
322
|
-
name: `user-${userId}`,
|
323
|
-
age: 18,
|
324
|
-
});
|
325
|
-
}, 200);
|
326
|
-
});
|
327
|
-
|
328
|
-
return defer({ data: user });
|
329
|
-
};
|
330
|
-
|
331
|
-
```
|
332
|
-
|
333
|
-
`user` 是一个 Promise 类型的对象,表示需要异步获取的数据,通过 `defer` 处理需要异步获取的 `user`。注意,`defer` 必须接收一个对象类型的参数,
|
334
|
-
因此, 传入 `defer` 的参数为 `{data: user}`。
|
335
|
-
|
336
|
-
`defer` 还可以同时接收异步数据和同步数据。例如:
|
337
|
-
|
338
|
-
```ts title='page.loader.ts'
|
339
|
-
|
340
|
-
// 省略部分代码
|
341
|
-
|
342
|
-
export default ({ params }: LoaderFunctionArgs) => {
|
343
|
-
const userId = params.id;
|
344
|
-
|
345
|
-
const user = new Promise<User>(resolve => {
|
346
|
-
setTimeout(() => {
|
347
|
-
resolve({
|
348
|
-
name: `user-${userId}`,
|
349
|
-
age: 18,
|
350
|
-
});
|
351
|
-
}, 200);
|
352
|
-
});
|
353
|
-
|
354
|
-
const otherData = new Promise<string>(resolve => {
|
355
|
-
setTimeout(() => {
|
356
|
-
resolve('some sync data');
|
357
|
-
}, 200);
|
358
|
-
});
|
359
|
-
|
360
|
-
return defer({
|
361
|
-
data: user,
|
362
|
-
other: await otherData
|
363
|
-
});
|
364
|
-
};
|
365
|
-
|
366
|
-
```
|
367
|
-
|
368
|
-
`otherData` 前加了 `await`,所以是同步获取的数据,它可以和异步获取的数据 `user` 同时传入 `defer`。
|
369
|
-
|
370
|
-
|
371
|
-
### 渲染异步数据
|
372
|
-
|
373
|
-
通过 `Await` 组件,可以获取到 Data Loader 中异步返回的数据,然后进行渲染。例如:
|
374
|
-
|
375
|
-
```ts title='page.tsx'
|
376
|
-
import { Await, useLoaderData } from '@modern-js/runtime/router';
|
377
|
-
import { Suspense } from 'react';
|
378
|
-
import type { Data } from './page.loader';
|
379
|
-
|
380
|
-
const Page = () => {
|
381
|
-
const data = useLoaderData() as Data;
|
382
|
-
|
383
|
-
return (
|
384
|
-
<div>
|
385
|
-
User info:
|
386
|
-
<Suspense fallback={<div id="loading">loading user data ...</div>}>
|
387
|
-
<Await resolve={data.data}>
|
388
|
-
{(user) => {
|
389
|
-
return (
|
390
|
-
<div id="data">
|
391
|
-
name: {user.name}, age: {user.age}
|
392
|
-
</div>
|
393
|
-
);
|
394
|
-
}}
|
395
|
-
</Await>
|
396
|
-
</Suspense>
|
397
|
-
</div>
|
398
|
-
);
|
399
|
-
};
|
400
|
-
|
401
|
-
export default Page;
|
402
|
-
```
|
403
|
-
|
404
|
-
`Await` 需要包裹在 `Suspense` 组件内部,`Await` 的 `resolve` 传入的是 Data Loader 异步获取的数据,当数据获取完成后,
|
405
|
-
通过 [Render Props](https://reactjs.org/docs/render-props.html) 模式,渲染获取到的数据。在数据的获取阶段,将展示
|
406
|
-
`Suspense` 组件 `fallback` 属性设置的内容。
|
407
|
-
|
408
|
-
:::warning 注意
|
409
|
-
从 Data Loader 文件导入类型时,需要使用 import type 语法,保证只导入类型信息,这样可以避免 Data Loader 的代码打包到前端产物的 bundle 文件中。
|
410
|
-
|
411
|
-
所以,这里的导入方式为:`import type { Data } from './page.loader'`;
|
412
|
-
:::
|
413
|
-
|
414
|
-
也可以通过 `useAsyncValue` 获取 Data Loader 返回的异步数据。例如:
|
415
|
-
|
416
|
-
```
|
417
|
-
```ts title='page.tsx'
|
418
|
-
import { useAsyncValue } from '@modern-js/runtime/router';
|
419
|
-
|
420
|
-
// 省略部分代码
|
421
|
-
|
422
|
-
const UserInfo = () => {
|
423
|
-
const user = useAsyncValue();
|
424
|
-
|
425
|
-
return (
|
426
|
-
<div>
|
427
|
-
name: {user.name}, age: {user.age}
|
428
|
-
</div>
|
429
|
-
)
|
430
|
-
}
|
431
|
-
|
432
|
-
const Page = () => {
|
433
|
-
const data = useLoaderData() as Data;
|
434
|
-
|
435
|
-
return (
|
436
|
-
<div>
|
437
|
-
User info:
|
438
|
-
<Suspense fallback={<div id="loading">loading user data ...</div>}>
|
439
|
-
<Await resolve={data.data}>
|
440
|
-
<UserInfo />
|
441
|
-
</Await>
|
442
|
-
</Suspense>
|
443
|
-
</div>
|
444
|
-
);
|
445
|
-
};
|
446
|
-
|
447
|
-
export default Page;
|
448
|
-
```
|
449
|
-
|
450
|
-
### 错误处理
|
451
|
-
|
452
|
-
`Await` 组件的 `errorElement` 属性,可以用来处理当 Data Loader 执行时,或者子组件渲染时抛出的错误。
|
453
|
-
例如,我们故意在 Data Loader 函数中抛出错误:
|
454
|
-
|
455
|
-
```ts title='page.loader.ts'
|
456
|
-
import { defer } from '@modern-js/runtime/router';
|
457
|
-
|
458
|
-
export default () => {
|
459
|
-
const data = new Promise((resolve, reject) => {
|
460
|
-
setTimeout(() => {
|
461
|
-
reject(new Error('error occurs'));
|
462
|
-
}, 200);
|
463
|
-
});
|
464
|
-
|
465
|
-
return defer({ data });
|
466
|
-
};
|
467
|
-
```
|
468
|
-
|
469
|
-
然后通过 `useAsyncError` 获取错误,并将用于渲染错误信息的组件赋值给 `Await` 组件的 `errorElement` 属性:
|
470
|
-
|
471
|
-
```ts title='page.ts'
|
472
|
-
import { Await, useAsyncError, useLoaderData } from '@modern-js/runtime/router';
|
473
|
-
import { Suspense } from 'react';
|
474
|
-
|
475
|
-
export default function Page() {
|
476
|
-
const data = useLoaderData();
|
477
|
-
|
478
|
-
return (
|
479
|
-
<div>
|
480
|
-
Error page
|
481
|
-
<Suspense fallback={<div>loading ...</div>}>
|
482
|
-
<Await resolve={data.data} errorElement={<ErrorElement />}>
|
483
|
-
{(data: any) => {
|
484
|
-
return <div>never displayed</div>;
|
485
|
-
}}
|
486
|
-
</Await>
|
487
|
-
</Suspense>
|
488
|
-
</div>
|
489
|
-
);
|
490
|
-
}
|
491
|
-
|
492
|
-
function ErrorElement() {
|
493
|
-
const error = useAsyncError() as Error;
|
494
|
-
return <p>Something went wrong! {error.message}</p>;
|
495
|
-
}
|
496
|
-
```
|
497
|
-
|
498
|
-
:::info 补充信息
|
499
|
-
1. [Deferred Data](https://reactrouter.com/en/main/guides/deferred)
|
500
|
-
2. [New Suspense SSR Architecture in React 18](https://github.com/reactwg/react-18/discussions/37)
|
501
|
-
:::
|
@@ -1,57 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: 自定义 Web Server
|
3
|
-
sidebar_position: 2
|
4
|
-
---
|
5
|
-
# 自定义 Web Server
|
6
|
-
|
7
|
-
Modern.js 作为以客户端为中心的开发框架,对服务端的定制能力较弱。而在有些开发场景下,需要定制特殊的服务端逻辑,例如用户鉴权、请求预处理、添加页面渲染骨架等。
|
8
|
-
|
9
|
-
因此 Modern.js 提供了一种功能,让项目可以在给定的范围内扩展 Modern.js 内置的 Web Server,来实现相应的需求。
|
10
|
-
|
11
|
-
## 创建自定义 Web Server
|
12
|
-
|
13
|
-
在项目根目录执行 `pnpm run new` 命令,按照如下选择,开启「自定义 Web Serve」功能:
|
14
|
-
|
15
|
-
```bash
|
16
|
-
? 请选择你想要的操作 创建工程元素
|
17
|
-
? 创建工程元素 新建「自定义 Web Server」源码目录
|
18
|
-
```
|
19
|
-
|
20
|
-
执行命令后,在 `modern.config.ts` 中注册 Server 插件:
|
21
|
-
|
22
|
-
```ts title="modern.config.ts"
|
23
|
-
import serverPlugin from '@modern-js/plugin-server';
|
24
|
-
|
25
|
-
export default defineConfig({
|
26
|
-
plugins: [..., serverPlugin()],
|
27
|
-
});
|
28
|
-
```
|
29
|
-
|
30
|
-
项目目录下会新建 `server/index.ts` 文件,自定义逻辑在这个文件中编写。
|
31
|
-
|
32
|
-
## 使用 API 扩展 Web Server
|
33
|
-
|
34
|
-
Modern.js 提供了 **Hook** 与 **Middleware** 两类 API 来扩展 Web Server。
|
35
|
-
|
36
|
-
### Hook
|
37
|
-
|
38
|
-
Hook 可以控制 Web Server 对请求处理的内置逻辑,非 BFF 请求会经过 Hook 的处理。
|
39
|
-
|
40
|
-
Hook 不可以使用运行时框架拓展。
|
41
|
-
|
42
|
-
详细 API 可以查看 [Hook](/apis/app/runtime/web-server/hook)。
|
43
|
-
|
44
|
-
### Middleware
|
45
|
-
|
46
|
-
Middleware 可以为 Web Server 添加前置中间件,只有 SSR 请求会经过 Middleware 的处理。
|
47
|
-
|
48
|
-
Middleware 可以使用运行时框架拓展。
|
49
|
-
|
50
|
-
详细 API 可以查看 [Hook](/apis/app/runtime/web-server/middleware)。
|
51
|
-
|
52
|
-
## 完全自定义的 Web Server
|
53
|
-
|
54
|
-
:::note
|
55
|
-
敬请期待
|
56
|
-
|
57
|
-
:::
|
@@ -1,99 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: 数据模拟
|
3
|
-
sidebar_position: 6
|
4
|
-
---
|
5
|
-
# 数据模拟
|
6
|
-
|
7
|
-
Modern.js 提供了快速生成 Mock 数据的功能,能够让前端独立自主开发,不被后端接口阻塞。
|
8
|
-
|
9
|
-
## Mock 文件
|
10
|
-
|
11
|
-
约定当 `config/mock` 目录下存在 `index.[jt]s` 时,会自动开启 Mock 功能,如下:
|
12
|
-
|
13
|
-
```bash
|
14
|
-
.
|
15
|
-
├── config
|
16
|
-
│ └── mock
|
17
|
-
│ └── index.ts
|
18
|
-
├── src
|
19
|
-
│ └── App.tsx
|
20
|
-
└── modern.config.ts
|
21
|
-
```
|
22
|
-
|
23
|
-
## 编写 Mock 文件
|
24
|
-
|
25
|
-
`config/mock/index.ts` 文件只需要导出一个包含所有 Mock API 的对象,对象的属性由请求配置 `method` 和 `url` 组成,对应的属性值可以为 `Object`、`Array`、`Function`:
|
26
|
-
|
27
|
-
```js
|
28
|
-
module.exports = {
|
29
|
-
/* 属性为具体的 method 和 请求 url,值为 object 或 array 作为请求的结果 */
|
30
|
-
'GET /api/getInfo': { data: [1, 2, 3, 4] },
|
31
|
-
|
32
|
-
/* method 默认为 GET */
|
33
|
-
'/api/getExample': { id: 1 },
|
34
|
-
|
35
|
-
/* 可以使用自定义函数根据请求动态返回数据,返回值参考 express middleware */
|
36
|
-
'POST /api/addInfo': (req, res, next) => {
|
37
|
-
res.setHeader('Access-Control-Allow-Origin', '*');
|
38
|
-
res.end('200');
|
39
|
-
},
|
40
|
-
};
|
41
|
-
```
|
42
|
-
|
43
|
-
代码中访问 `http://localhost:8080/api/getInfo` 时,接口会返回 JSON 格式数据:`{ "data": [1, 2, 3, 4] }`。
|
44
|
-
|
45
|
-
## 返回随机数据
|
46
|
-
|
47
|
-
可以在 `config/mock/index.js` 中自主引入 [Mock.js](https://github.com/nuysoft/Mock/wiki/Getting-Started) 等库生成随机数据,例如:
|
48
|
-
|
49
|
-
```js
|
50
|
-
const Mock = require('mockjs');
|
51
|
-
|
52
|
-
module.exports = {
|
53
|
-
'/api/getInfo': Mock.mock({
|
54
|
-
'data|1-10': [{ name: '@cname' }],
|
55
|
-
}) /* => {data: [{name: "董霞"}, {name: "魏敏"}, {name: "石磊"}} */,
|
56
|
-
};
|
57
|
-
```
|
58
|
-
|
59
|
-
:::info 更多随机数据生成库
|
60
|
-
|
61
|
-
- [Chancejs](https://github.com/chancejs/chancejs)
|
62
|
-
- [Mock](https://github.com/nuysoft/Mock/wiki/Getting-Started)
|
63
|
-
|
64
|
-
:::
|
65
|
-
|
66
|
-
## 延迟返回
|
67
|
-
|
68
|
-
- 可以使用浏览器「 弱网模拟 」的功能实现。
|
69
|
-
- 可以通过 `setTimeout` 为单个接口设置延迟,例如:
|
70
|
-
|
71
|
-
```js
|
72
|
-
module.exports = {
|
73
|
-
'api/getInfo': (req, res) => {
|
74
|
-
setTimeout(() => {
|
75
|
-
res.end('delay 2000ms');
|
76
|
-
}, 2000);
|
77
|
-
},
|
78
|
-
};
|
79
|
-
```
|
80
|
-
|
81
|
-
## 按需使用 Mock 服务
|
82
|
-
|
83
|
-
`config/mock/index.ts` 下还可以到处 `config` 对象,更精细的控制 Mock 服务。
|
84
|
-
|
85
|
-
```ts
|
86
|
-
type MockConfig = {
|
87
|
-
enable: ((req: IncomingMessage, res: ServerResponse) => boolean) | boolean;
|
88
|
-
};
|
89
|
-
|
90
|
-
export const config = {
|
91
|
-
enable: false
|
92
|
-
}
|
93
|
-
```
|
94
|
-
|
95
|
-
目前仅支持 `enable` 配置,开发者可以通过该配置控制是否执行 Mock。
|
96
|
-
|
97
|
-
:::note
|
98
|
-
修改 `config` 后无需重启服务,即刻生效。
|
99
|
-
:::
|
@@ -1,47 +0,0 @@
|
|
1
|
-
---
|
2
|
-
sidebar_position: 2
|
3
|
-
---
|
4
|
-
|
5
|
-
# 构建引擎
|
6
|
-
|
7
|
-
**Modern.js 的构建能力由 [Modern.js Builder](https://modernjs.dev/builder) 提供。**
|
8
|
-
|
9
|
-
Modern.js Builder 是 Modern.js 体系的核心组件之一,它是一个面向 Web 开发场景的构建引擎,可以脱离 Modern.js 被独立使用。Modern.js Builder 同时支持 webpack 和 rspack 等多种打包工具,默认情况下使用最成熟的 webpack 进行打包。
|
10
|
-
|
11
|
-
## 构建架构
|
12
|
-
|
13
|
-
从构建的角度看,Modern.js 分为三层架构,从上到下依次是:
|
14
|
-
|
15
|
-
- 上层研发框架:Modern.js。
|
16
|
-
- 通用构建引擎:Modern.js Builder。
|
17
|
-
- 底层打包工具:webpack 和 rspack。
|
18
|
-
|
19
|
-
<img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/builder-layers-1117.png" style={{ maxWidth: '540px' }} />
|
20
|
-
|
21
|
-
## 构建文档
|
22
|
-
|
23
|
-
由于 Modern.js Builder 是一个可独立使用的模块,我们为它提供了单独的文档,文档地址为:[modernjs.dev/builder](https://modernjs.dev/builder)。
|
24
|
-
|
25
|
-
在该文档中,你可以了解到 Modern.js Builder 的详细介绍,同时也可以找到各个构建能力的完整使用指南。当你遇到构建方面的需求或问题时,建议你优先阅读 Modern.js Builder 文档来解决。
|
26
|
-
|
27
|
-
## 构建配置
|
28
|
-
|
29
|
-
Modern.js 的配置继承自 Modern.js Builder,因此你可以在 Modern.js 中使用 Modern.js Builder 提供的所有构建配置。
|
30
|
-
|
31
|
-
以 Modern.js Builder 的 `html.title` 配置项为例,你可以直接在 `modern.config.ts` 文件中使用该配置项,它会被自动传递给 Modern.js Builder。
|
32
|
-
|
33
|
-
```ts title="modern.config.js"
|
34
|
-
export default defineConfig({
|
35
|
-
html: {
|
36
|
-
title: 'example',
|
37
|
-
},
|
38
|
-
});
|
39
|
-
```
|
40
|
-
|
41
|
-
关于构建配置的详细说明,请参考 [「Modern.js Builder - Builder 配置」](https://modernjs.dev/builder/guide/basic/builder-config.html)。
|
42
|
-
|
43
|
-
## 构建能力
|
44
|
-
|
45
|
-
Modern.js Builder 提供了丰富的构建能力,包括 JavaScript 编译、CSS 编译、静态资源处理、代码热更新、代码压缩、TS 类型检查等几十种能力。
|
46
|
-
|
47
|
-
我们推荐你阅读 [「Modern.js Builder - 功能导航」](https://modernjs.dev/builder/guide/features.html) 来了解 Modern.js Builder 提供的所有构建能力。
|