@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.100 → 3.5.0-ultramodern.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/modern-bundle-docs.js +7 -0
- package/dist/cjs/bundleDocs.js +114 -0
- package/dist/esm/bundleDocs.mjs +62 -0
- package/dist/esm-node/bundleDocs.mjs +63 -0
- package/dist/types/bundleDocs.d.ts +20 -0
- package/docs/apis/app/{commands.mdx → commands.md} +35 -9
- package/docs/apis/app/hooks/api/{lambda.mdx → lambda.md} +2 -6
- package/docs/apis/app/hooks/config/{favicon.mdx → favicon.md} +1 -6
- package/docs/apis/app/hooks/config/{html.mdx → html.md} +1 -5
- package/docs/apis/app/hooks/config/{icon.mdx → icon.md} +1 -6
- package/docs/apis/app/hooks/config/{mock.mdx → mock.md} +1 -5
- package/docs/apis/app/hooks/config/{public.mdx → public.md} +0 -4
- package/docs/apis/app/hooks/config/{upload.mdx → upload.md} +3 -7
- package/docs/apis/app/hooks/{modern-config.mdx → modern-config.md} +1 -5
- package/docs/apis/app/hooks/server/{server.mdx → server.md} +1 -6
- package/docs/apis/app/hooks/{shared.mdx → shared.md} +0 -4
- package/docs/apis/app/hooks/src/{app.mdx → app.md} +2 -2
- package/docs/apis/app/hooks/src/{entry.mdx → entry.md} +1 -6
- package/docs/apis/app/hooks/src/{entry.server.mdx → entry.server.md} +0 -5
- package/docs/apis/app/hooks/src/{modern.runtime.mdx → modern.runtime.md} +1 -5
- package/docs/apis/app/hooks/src/{routes.mdx → routes.md} +3 -7
- package/docs/apis/app/hooks/src/{server.mdx → server.md} +1 -5
- package/docs/apis/app/runtime/bff/{use-backend-context.mdx → use-backend-context.md} +0 -3
- package/docs/apis/app/runtime/core/{create-root.mdx → create-root.md} +0 -3
- package/docs/apis/app/runtime/core/{render.mdx → render.md} +1 -4
- package/docs/apis/app/runtime/core/{runtime-context.mdx → runtime-context.md} +0 -4
- package/docs/apis/app/runtime/router/{router.mdx → router.md} +1 -6
- package/docs/apis/app/runtime/ssr/{no-ssr.mdx → no-ssr.md} +0 -3
- package/docs/apis/app/runtime/ssr/{renderStreaming.mdx → renderStreaming.md} +0 -4
- package/docs/apis/app/runtime/ssr/{renderString.mdx → renderString.md} +0 -4
- package/docs/apis/app/runtime/ssr/{requestHandler.mdx → requestHandler.md} +0 -4
- package/docs/apis/app/runtime/utility/{css-in-js.mdx → css-in-js.md} +0 -4
- package/docs/apis/app/runtime/utility/{head.mdx → head.md} +0 -3
- package/docs/apis/app/runtime/utility/{loadable.mdx → loadable.md} +0 -3
- package/docs/community/blog/2022-0708-updates.md +91 -0
- package/docs/community/blog/2022-0910-updates.md +76 -0
- package/docs/community/blog/overview.md +63 -0
- package/docs/community/blog/v2-release-note.md +238 -0
- package/docs/community/blog/v3-release-note.md +622 -0
- package/docs/community/contributing-guide.md +252 -0
- package/docs/community/releases.md +23 -0
- package/docs/community/showcase.md +24 -0
- package/docs/community/team.md +14 -0
- package/docs/configure/app/bff/{cross-project.mdx → cross-project.md} +4 -8
- package/docs/configure/app/bff/{effect.mdx → effect.md} +3 -7
- package/docs/configure/app/bff/{prefix.mdx → prefix.md} +3 -7
- package/docs/configure/app/bff/{runtime-framework.mdx → runtime-framework.md} +3 -7
- package/docs/configure/app/{builder-plugins.mdx → builder-plugins.md} +4 -8
- package/docs/configure/app/dev/{asset-prefix.mdx → asset-prefix.md} +4 -9
- package/docs/configure/app/dev/{before-start-url.mdx → before-start-url.md} +0 -4
- package/docs/configure/app/dev/{client.mdx → client.md} +3 -7
- package/docs/configure/app/dev/hmr.md +10 -0
- package/docs/configure/app/dev/{host.mdx → host.md} +0 -4
- package/docs/configure/app/dev/{https.mdx → https.md} +0 -4
- package/docs/configure/app/dev/{lazy-compilation.mdx → lazy-compilation.md} +2 -8
- package/docs/configure/app/dev/live-reload.md +10 -0
- package/docs/configure/app/dev/{mock-dir.mdx → mock-dir.md} +0 -4
- package/docs/configure/app/dev/progress-bar.md +19 -0
- package/docs/configure/app/dev/{server.mdx → server.md} +0 -4
- package/docs/configure/app/dev/{setup-middlewares.mdx → setup-middlewares.md} +3 -7
- package/docs/configure/app/dev/{start-url.mdx → start-url.md} +0 -5
- package/docs/configure/app/dev/{watch-files.mdx → watch-files.md} +3 -7
- package/docs/configure/app/dev/{write-to-disk.mdx → write-to-disk.md} +3 -7
- package/docs/configure/app/experiments/{source-build.mdx → source-build.md} +1 -3
- package/docs/configure/app/html/{app-icon.mdx → app-icon.md} +3 -7
- package/docs/configure/app/html/{crossorigin.mdx → crossorigin.md} +3 -7
- package/docs/configure/app/html/{favicon.mdx → favicon.md} +3 -7
- package/docs/configure/app/html/inject.md +10 -0
- package/docs/configure/app/html/{meta.mdx → meta.md} +3 -7
- package/docs/configure/app/html/{mount-id.mdx → mount-id.md} +3 -7
- package/docs/configure/app/html/output-structure.md +10 -0
- package/docs/configure/app/html/script-loading.md +10 -0
- package/docs/configure/app/html/{tags.mdx → tags.md} +3 -7
- package/docs/configure/app/html/{template-parameters.mdx → template-parameters.md} +3 -7
- package/docs/configure/app/html/template.md +10 -0
- package/docs/configure/app/html/title.md +18 -0
- package/docs/configure/app/output/asset-prefix.md +11 -0
- package/docs/configure/app/output/{assets-retry.mdx → assets-retry.md} +1 -5
- package/docs/configure/app/output/{charset.mdx → charset.md} +3 -7
- package/docs/configure/app/output/{clean-dist-path.mdx → clean-dist-path.md} +0 -4
- package/docs/configure/app/output/{convert-to-rem.mdx → convert-to-rem.md} +12 -16
- package/docs/configure/app/output/{copy.mdx → copy.md} +3 -7
- package/docs/configure/app/output/{css-modules.mdx → css-modules.md} +3 -7
- package/docs/configure/app/output/{data-uri-limit.mdx → data-uri-limit.md} +3 -7
- package/docs/configure/app/output/{disable-css-module-extension.mdx → disable-css-module-extension.md} +3 -7
- package/docs/configure/app/output/{disable-inline-runtime-chunk.mdx → disable-inline-runtime-chunk.md} +0 -4
- package/docs/configure/app/output/{disable-svgr.mdx → disable-svgr.md} +0 -4
- package/docs/configure/app/output/{disable-ts-checker.mdx → disable-ts-checker.md} +0 -4
- package/docs/configure/app/output/{dist-path.mdx → dist-path.md} +3 -11
- package/docs/configure/app/output/{enable-asset-manifest.mdx → enable-asset-manifest.md} +0 -4
- package/docs/configure/app/output/{enable-css-module-tsdeclaration.mdx → enable-css-module-tsdeclaration.md} +0 -4
- package/docs/configure/app/output/{enable-inline-route-manifests.mdx → enable-inline-route-manifests.md} +0 -4
- package/docs/configure/app/output/{externals.mdx → externals.md} +3 -7
- package/docs/configure/app/output/filename-hash.md +10 -0
- package/docs/configure/app/output/{filename.mdx → filename.md} +3 -7
- package/docs/configure/app/output/inject-styles.md +10 -0
- package/docs/configure/app/output/{inline-scripts.mdx → inline-scripts.md} +4 -8
- package/docs/configure/app/output/{inline-styles.mdx → inline-styles.md} +4 -8
- package/docs/configure/app/output/{legal-comments.mdx → legal-comments.md} +3 -7
- package/docs/configure/app/output/{minify.mdx → minify.md} +3 -7
- package/docs/configure/app/output/{override-browserslist.mdx → override-browserslist.md} +4 -8
- package/docs/configure/app/output/polyfill.md +12 -0
- package/docs/configure/app/output/{source-map.mdx → source-map.md} +3 -7
- package/docs/configure/app/output/{split-route-chunks.mdx → split-route-chunks.md} +0 -4
- package/docs/configure/app/output/{ssg.mdx → ssg.md} +3 -7
- package/docs/configure/app/output/{ssgByEntries.mdx → ssgByEntries.md} +1 -4
- package/docs/configure/app/output/{svg-default-export.mdx → svg-default-export.md} +0 -4
- package/docs/configure/app/output/{temp-dir.mdx → temp-dir.md} +0 -4
- package/docs/configure/app/performance/{build-cache.mdx → build-cache.md} +3 -7
- package/docs/configure/app/performance/{chunk-split.mdx → chunk-split.md} +3 -7
- package/docs/configure/app/performance/{dns-prefetch.mdx → dns-prefetch.md} +3 -7
- package/docs/configure/app/performance/preconnect.md +16 -0
- package/docs/configure/app/performance/{prefetch.mdx → prefetch.md} +3 -7
- package/docs/configure/app/performance/{preload.mdx → preload.md} +3 -7
- package/docs/configure/app/performance/{print-file-size.mdx → print-file-size.md} +3 -7
- package/docs/configure/app/performance/profile.md +10 -0
- package/docs/configure/app/performance/remove-console.md +10 -0
- package/docs/configure/app/performance/remove-moment-locale.md +10 -0
- package/docs/configure/app/performance/{rsdoctor.mdx → rsdoctor.md} +0 -4
- package/docs/configure/app/{plugins.mdx → plugins.md} +4 -4
- package/docs/configure/app/resolve/{alias-strategy.mdx → alias-strategy.md} +3 -7
- package/docs/configure/app/resolve/alias.md +9 -0
- package/docs/configure/app/resolve/{condition-names.mdx → condition-names.md} +3 -8
- package/docs/configure/app/resolve/{dedupe.mdx → dedupe.md} +3 -7
- package/docs/configure/app/resolve/{extensions.mdx → extensions.md} +3 -8
- package/docs/configure/app/runtime/{0-intro.mdx → 0-intro.md} +1 -4
- package/docs/configure/app/runtime/{plugins.mdx → plugins.md} +1 -1
- package/docs/configure/app/runtime/{router.mdx → router.md} +3 -7
- package/docs/configure/app/security/{check-syntax.mdx → check-syntax.md} +0 -4
- package/docs/configure/app/security/{nonce.mdx → nonce.md} +3 -7
- package/docs/configure/app/security/{sri.mdx → sri.md} +0 -4
- package/docs/configure/app/server/{base-url.mdx → base-url.md} +0 -4
- package/docs/configure/app/server/{port.mdx → port.md} +3 -7
- package/docs/configure/app/server/{public-routes.mdx → public-routes.md} +0 -4
- package/docs/configure/app/server/{routes.mdx → routes.md} +1 -5
- package/docs/configure/app/server/{rsc.mdx → rsc.md} +2 -6
- package/docs/configure/app/server/{ssr-by-entries.mdx → ssr-by-entries.md} +1 -5
- package/docs/configure/app/server/ssr.md +80 -0
- package/docs/configure/app/server/{tsconfig-path.mdx → tsconfig-path.md} +0 -4
- package/docs/configure/app/source/{alias-strategy.mdx → alias-strategy.md} +4 -8
- package/docs/configure/app/source/{alias.mdx → alias.md} +4 -8
- package/docs/configure/app/source/{config-dir.mdx → config-dir.md} +1 -5
- package/docs/configure/app/source/{decorators.mdx → decorators.md} +0 -4
- package/docs/configure/app/source/{define.mdx → define.md} +3 -7
- package/docs/configure/app/source/{disable-default-entries.mdx → disable-default-entries.md} +2 -6
- package/docs/{components/module-federation.mdx → configure/app/source/enable-async-entry.md} +47 -0
- package/docs/configure/app/source/{enable-async-pre-entry.mdx → enable-async-pre-entry.md} +0 -4
- package/docs/configure/app/source/{entries-dir.mdx → entries-dir.md} +0 -4
- package/docs/configure/app/source/{entries.mdx → entries.md} +1 -5
- package/docs/configure/app/source/{exclude.mdx → exclude.md} +4 -8
- package/docs/configure/app/source/{global-vars.mdx → global-vars.md} +0 -4
- package/docs/configure/app/source/{include.mdx → include.md} +4 -8
- package/docs/configure/app/source/{main-entry-name.mdx → main-entry-name.md} +0 -4
- package/docs/configure/app/source/{pre-entry.mdx → pre-entry.md} +3 -7
- package/docs/configure/app/source/{react-compiler.mdx → react-compiler.md} +0 -4
- package/docs/configure/app/source/{transform-import.mdx → transform-import.md} +3 -7
- package/docs/configure/app/{split-chunks.mdx → split-chunks.md} +3 -3
- package/docs/configure/app/tools/{autoprefixer.mdx → autoprefixer.md} +0 -4
- package/docs/configure/app/tools/{bundler-chain.mdx → bundler-chain.md} +0 -4
- package/docs/configure/app/tools/{css-extract.mdx → css-extract.md} +3 -7
- package/docs/configure/app/tools/{css-loader.mdx → css-loader.md} +3 -7
- package/docs/configure/app/tools/{dev-server.mdx → dev-server.md} +0 -4
- package/docs/configure/app/tools/{html-plugin.mdx → html-plugin.md} +3 -7
- package/docs/configure/app/tools/{less.mdx → less.md} +0 -4
- package/docs/configure/app/tools/{lightningcss-loader.mdx → lightningcss-loader.md} +3 -7
- package/docs/configure/app/tools/{minify-css.mdx → minify-css.md} +0 -4
- package/docs/configure/app/tools/{postcss.mdx → postcss.md} +3 -7
- package/docs/configure/app/tools/rspack.md +10 -0
- package/docs/configure/app/tools/{sass.mdx → sass.md} +0 -4
- package/docs/configure/app/tools/style-loader.md +10 -0
- package/docs/configure/app/tools/{swc.mdx → swc.md} +4 -8
- package/docs/configure/app/tools/{ts-checker.mdx → ts-checker.md} +20 -7
- package/docs/configure/app/{usage.mdx → usage.md} +1 -1
- package/docs/guides/advanced-features/bff/{cross-project.mdx → cross-project.md} +1 -2
- package/docs/guides/advanced-features/bff/{data-platform.mdx → data-platform.md} +0 -4
- package/docs/guides/advanced-features/bff/{extend-server.mdx → extend-server.md} +1 -1
- package/docs/guides/advanced-features/bff/frameworks.md +243 -0
- package/docs/guides/advanced-features/bff/{function.mdx → function.md} +60 -7
- package/docs/guides/advanced-features/bff/{operators.mdx → operators.md} +2 -77
- package/docs/{components/bff-upload.mdx → guides/advanced-features/bff/upload.md} +4 -0
- package/docs/guides/advanced-features/{bff.mdx → bff.md} +0 -4
- package/docs/guides/advanced-features/{build-performance.mdx → build-performance.md} +3 -7
- package/docs/guides/advanced-features/{compatibility.mdx → compatibility.md} +54 -15
- package/docs/guides/advanced-features/international/{advanced.mdx → advanced.md} +0 -4
- package/docs/guides/advanced-features/international/{api.mdx → api.md} +16 -20
- package/docs/guides/advanced-features/international/{best-practices.mdx → best-practices.md} +0 -4
- package/docs/guides/advanced-features/international/configuration.md +228 -0
- package/docs/guides/advanced-features/international/{locale-detection.mdx → locale-detection.md} +25 -29
- package/docs/guides/advanced-features/international/{quick-start.mdx → quick-start.md} +29 -13
- package/docs/guides/advanced-features/international/{resource-loading.mdx → resource-loading.md} +11 -15
- package/docs/guides/advanced-features/international/{routing.mdx → routing.md} +12 -16
- package/docs/guides/advanced-features/international.md +27 -0
- package/docs/guides/advanced-features/{low-level.mdx → low-level.md} +17 -21
- package/docs/guides/advanced-features/page-performance/{code-split.mdx → code-split.md} +2 -6
- package/docs/guides/advanced-features/page-performance/{inline-assets.mdx → inline-assets.md} +3 -7
- package/docs/guides/advanced-features/page-performance/{optimize-bundle.mdx → optimize-bundle.md} +4 -8
- package/docs/{components/internal-logger.mdx → guides/advanced-features/server-monitor/logger.md} +16 -0
- package/docs/guides/advanced-features/server-monitor/metrics.md +58 -0
- package/docs/guides/advanced-features/server-monitor/{monitors.mdx → monitors.md} +3 -3
- package/docs/guides/advanced-features/{source-build.mdx → source-build.md} +1 -5
- package/docs/guides/advanced-features/{web-server.mdx → web-server.md} +1 -9
- package/docs/guides/basic-features/{alias.mdx → alias.md} +3 -7
- package/docs/guides/basic-features/css/{css-in-js.mdx → css-in-js.md} +12 -9
- package/docs/guides/basic-features/css/{css-modules.mdx → css-modules.md} +3 -3
- package/docs/guides/basic-features/css/{css.mdx → css.md} +2 -6
- package/docs/guides/basic-features/data/{data-cache.mdx → data-cache.md} +1 -6
- package/docs/guides/basic-features/data/{data-fetch.mdx → data-fetch.md} +4 -8
- package/docs/guides/basic-features/data/{data-write.mdx → data-write.md} +6 -9
- package/docs/guides/basic-features/debug/{mock.mdx → mock.md} +1 -5
- package/docs/guides/basic-features/debug/{proxy.mdx → proxy.md} +1 -5
- package/docs/guides/basic-features/debug/{using-storybook.mdx → using-storybook.md} +20 -8
- package/docs/guides/basic-features/{deploy.mdx → deploy.md} +23 -13
- package/docs/guides/basic-features/{env-vars.mdx → env-vars.md} +8 -12
- package/docs/guides/basic-features/{html.mdx → html.md} +3 -7
- package/docs/guides/basic-features/{output-files.mdx → output-files.md} +6 -10
- package/docs/guides/basic-features/render/{before-render.mdx → before-render.md} +1 -1
- package/docs/guides/basic-features/render/overview.md +47 -0
- package/docs/guides/basic-features/render/{rsc.mdx → rsc.md} +12 -20
- package/docs/guides/basic-features/render/{ssg.mdx → ssg.md} +71 -10
- package/docs/guides/basic-features/render/{ssr-cache.mdx → ssr-cache.md} +5 -5
- package/docs/guides/basic-features/render/{ssr.mdx → ssr.md} +10 -12
- package/docs/guides/basic-features/render/{streaming-ssr.mdx → streaming-ssr.md} +5 -8
- package/docs/guides/basic-features/routes/{config-routes.mdx → config-routes.md} +10 -11
- package/docs/guides/basic-features/routes/{routes.mdx → routes.md} +8 -16
- package/docs/guides/basic-features/static-assets/{json-files.mdx → json-files.md} +0 -4
- package/docs/guides/basic-features/static-assets/{svg-assets.mdx → svg-assets.md} +3 -7
- package/docs/guides/basic-features/static-assets/{wasm-assets.mdx → wasm-assets.md} +1 -5
- package/docs/guides/basic-features/{static-assets.mdx → static-assets.md} +10 -14
- package/docs/guides/basic-features/testing/{playwright.mdx → playwright.md} +12 -3
- package/docs/guides/basic-features/testing/{rstest.mdx → rstest.md} +70 -11
- package/docs/guides/concept/{builder.mdx → builder.md} +3 -26
- package/docs/guides/concept/{entries.mdx → entries.md} +11 -17
- package/docs/guides/concept/{server.mdx → server.md} +3 -3
- package/docs/guides/get-started/{ai-coding-agents.mdx → ai-coding-agents.md} +4 -9
- package/docs/guides/get-started/glossary.md +63 -0
- package/docs/guides/get-started/{introduction.mdx → introduction.md} +1 -6
- package/docs/guides/get-started/quick-start.md +269 -0
- package/docs/guides/get-started/{tech-stack.mdx → tech-stack.md} +9 -15
- package/docs/guides/get-started/{ultramodern.mdx → ultramodern.md} +19 -24
- package/docs/guides/get-started/{upgrade.mdx → upgrade.md} +21 -12
- package/docs/guides/topic-detail/module-federation/{application.mdx → application.md} +3 -3
- package/docs/guides/topic-detail/module-federation/{deploy.mdx → deploy.md} +2 -2
- package/docs/guides/topic-detail/module-federation/{i18n.mdx → i18n.md} +14 -14
- package/docs/guides/topic-detail/module-federation/{introduce.mdx → introduce.md} +2 -3
- package/docs/guides/topic-detail/module-federation/{ssr.mdx → ssr.md} +12 -7
- package/docs/guides/topic-detail/module-federation/{usage.mdx → usage.md} +20 -3
- package/docs/guides/troubleshooting/{builder.mdx → builder.md} +10 -14
- package/docs/guides/troubleshooting/{cli.mdx → cli.md} +0 -4
- package/docs/guides/troubleshooting/{dependencies.mdx → dependencies.md} +7 -11
- package/docs/guides/troubleshooting/{hmr.mdx → hmr.md} +5 -9
- package/docs/guides/upgrade/{config.mdx → config.md} +8 -5
- package/docs/guides/upgrade/{entry.mdx → entry.md} +6 -6
- package/docs/guides/upgrade/{other.mdx → other.md} +8 -8
- package/docs/guides/upgrade/{overview.mdx → overview.md} +4 -4
- package/docs/guides/upgrade/{tailwindcss.mdx → tailwindcss.md} +0 -1
- package/docs/guides/upgrade/web-server.md +11 -11
- package/docs/index.md +33 -4
- package/docs/llms.txt +290 -0
- package/docs/plugin/cli-plugins/api.md +573 -0
- package/docs/plugin/cli-plugins/life-cycle.md +2 -0
- package/docs/plugin/introduction.md +152 -0
- package/docs/plugin/official/cli-plugins/plugin-bff.md +5 -0
- package/docs/plugin/official/cli-plugins/plugin-ssg.md +5 -0
- package/docs/plugin/official/cli-plugins/plugin-styled-components.md +5 -0
- package/docs/plugin/official/cli-plugins.md +4 -0
- package/docs/plugin/plugin-system.md +238 -0
- package/docs/plugin/runtime-plugins/api.md +194 -0
- package/docs/plugin/runtime-plugins/life-cycle.md +2 -0
- package/docs/plugin/server-plugins/api.md +209 -0
- package/docs/plugin/server-plugins/life-cycle.md +13 -0
- package/docs/tutorials/examples/csr-auth.md +9 -0
- package/docs/tutorials/foundations/introduction.md +16 -0
- package/package.json +32 -14
- package/docs/_nav.json +0 -36
- package/docs/apis/_meta.json +0 -13
- package/docs/apis/app/hooks/_meta.json +0 -28
- package/docs/apis/app/hooks/config/_meta.json +0 -1
- package/docs/apis/app/runtime/_meta.json +0 -32
- package/docs/components/auto-upgrade.mdx +0 -0
- package/docs/components/build-output.mdx +0 -45
- package/docs/components/bundler.mdx +0 -3
- package/docs/components/convention-routing-motivation.mdx +0 -0
- package/docs/components/debug-app.mdx +0 -15
- package/docs/components/default-browserslist.mdx +0 -7
- package/docs/components/deploy-command.mdx +0 -14
- package/docs/components/deploy.mdx +0 -1
- package/docs/components/enable-bff-caution.mdx +0 -3
- package/docs/components/enable-bff.mdx +0 -56
- package/docs/components/enable-ssg.mdx +0 -49
- package/docs/components/entry-mode.mdx +0 -0
- package/docs/components/entry-scan-logic.mdx +0 -7
- package/docs/components/extend-bff-function.mdx +0 -3
- package/docs/components/hono.mdx +0 -120
- package/docs/components/init-app.mdx +0 -93
- package/docs/components/init-rspack-app.mdx +0 -5
- package/docs/components/internal-metrics.mdx +0 -20
- package/docs/components/international/custom-instance-code.mdx +0 -16
- package/docs/components/international/init-options-desc.mdx +0 -1
- package/docs/components/international/install-command.mdx +0 -10
- package/docs/components/international/instance-code.mdx +0 -16
- package/docs/components/international/introduce.mdx +0 -5
- package/docs/components/international/platform-support.mdx +0 -0
- package/docs/components/language-config.mdx +0 -9
- package/docs/components/micro-frontend.mdx +0 -6
- package/docs/components/micro-master-manifest-config.mdx +0 -15
- package/docs/components/micro-runtime-config.mdx +0 -17
- package/docs/components/new-entry-tooltip.mdx +0 -0
- package/docs/components/nodeVersion.mdx +0 -28
- package/docs/components/other-plugins.mdx +0 -0
- package/docs/components/output-asset-prefix-extend.mdx +0 -0
- package/docs/components/output-distpath-warning.mdx +0 -0
- package/docs/components/output-polyfill-extend.mdx +0 -1
- package/docs/components/prerequisites.mdx +0 -18
- package/docs/components/release-note.mdx +0 -1
- package/docs/components/routes-practice.mdx +0 -0
- package/docs/components/rsbuild-config-tooltip.mdx +0 -5
- package/docs/components/rsbuild.mdx +0 -3
- package/docs/components/rsc-deploy-tip.mdx +0 -1
- package/docs/components/rspack.mdx +0 -3
- package/docs/components/rspackTip.mdx +0 -7
- package/docs/components/runtime-cli-config.mdx +0 -0
- package/docs/components/serve-command.mdx +0 -22
- package/docs/components/ssr-monitor.mdx +0 -3
- package/docs/components/stream-ssr-performance.mdx +0 -0
- package/docs/components/swc.mdx +0 -3
- package/docs/components/tech-stack-node-framework.mdx +0 -1
- package/docs/components/turtorials-example-list.mdx +0 -2
- package/docs/components/ua-polyfill.mdx +0 -44
- package/docs/components/upgrade-browserslist.mdx +0 -0
- package/docs/components/upgrade-config-deploy.mdx +0 -0
- package/docs/components/upgrade-faq.mdx +0 -0
- package/docs/configure/_meta.json +0 -78
- package/docs/configure/app/dev/hmr.mdx +0 -14
- package/docs/configure/app/dev/live-reload.mdx +0 -14
- package/docs/configure/app/dev/progress-bar.mdx +0 -23
- package/docs/configure/app/html/inject.mdx +0 -14
- package/docs/configure/app/html/output-structure.mdx +0 -14
- package/docs/configure/app/html/script-loading.mdx +0 -14
- package/docs/configure/app/html/template.mdx +0 -14
- package/docs/configure/app/html/title.mdx +0 -22
- package/docs/configure/app/output/asset-prefix.mdx +0 -18
- package/docs/configure/app/output/filename-hash.mdx +0 -14
- package/docs/configure/app/output/inject-styles.mdx +0 -14
- package/docs/configure/app/output/polyfill.mdx +0 -18
- package/docs/configure/app/performance/preconnect.mdx +0 -20
- package/docs/configure/app/performance/profile.mdx +0 -14
- package/docs/configure/app/performance/remove-console.mdx +0 -14
- package/docs/configure/app/performance/remove-moment-locale.mdx +0 -14
- package/docs/configure/app/resolve/alias.mdx +0 -13
- package/docs/configure/app/server/ssr.mdx +0 -85
- package/docs/configure/app/source/enable-async-entry.mdx +0 -54
- package/docs/configure/app/tools/rspack.mdx +0 -14
- package/docs/configure/app/tools/style-loader.mdx +0 -14
- package/docs/guides/_meta.json +0 -37
- package/docs/guides/advanced-features/_meta.json +0 -32
- package/docs/guides/advanced-features/bff/_meta.json +0 -10
- package/docs/guides/advanced-features/bff/frameworks.mdx +0 -131
- package/docs/guides/advanced-features/bff/upload.mdx +0 -7
- package/docs/guides/advanced-features/international/_meta.json +0 -10
- package/docs/guides/advanced-features/international/configuration.mdx +0 -222
- package/docs/guides/advanced-features/international.mdx +0 -29
- package/docs/guides/advanced-features/page-performance/_meta.json +0 -1
- package/docs/guides/advanced-features/server-monitor/_meta.json +0 -1
- package/docs/guides/advanced-features/server-monitor/logger.mdx +0 -19
- package/docs/guides/advanced-features/server-monitor/metrics.mdx +0 -41
- package/docs/guides/basic-features/_meta.json +0 -49
- package/docs/guides/basic-features/css/_meta.json +0 -1
- package/docs/guides/basic-features/data/_meta.json +0 -1
- package/docs/guides/basic-features/debug/_meta.json +0 -1
- package/docs/guides/basic-features/render/_meta.json +0 -1
- package/docs/guides/basic-features/render/overview.mdx +0 -51
- package/docs/guides/basic-features/routes/_meta.json +0 -1
- package/docs/guides/basic-features/static-assets/_meta.json +0 -1
- package/docs/guides/basic-features/testing/_meta.json +0 -1
- package/docs/guides/concept/_meta.json +0 -1
- package/docs/guides/get-started/_meta.json +0 -9
- package/docs/guides/get-started/glossary.mdx +0 -63
- package/docs/guides/get-started/quick-start.mdx +0 -92
- package/docs/guides/topic-detail/_meta.json +0 -8
- package/docs/guides/topic-detail/module-federation/_meta.json +0 -1
- package/docs/guides/troubleshooting/_meta.json +0 -1
- package/docs/guides/upgrade/_meta.json +0 -1
- package/scripts/copy-main-doc.mjs +0 -50
- /package/docs/guides/advanced-features/bff/{sdk.mdx → sdk.md} +0 -0
- /package/docs/guides/advanced-features/page-performance/{react-compiler.mdx → react-compiler.md} +0 -0
- /package/docs/guides/basic-features/css/{tailwindcss.mdx → tailwindcss.md} +0 -0
- /package/docs/guides/basic-features/debug/{rsdoctor.mdx → rsdoctor.md} +0 -0
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 3
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Config Routes
|
|
6
2
|
|
|
7
|
-
By default, Modern.js recommends using [Convention Routes](
|
|
8
|
-
|
|
3
|
+
By default, Modern.js recommends using [Convention Routes](/guides/basic-features/routes/routes.md) as the way to define routes. At the same time, Modern.js also provides a config-based routing capability that can be used together with convention routes or used separately.
|
|
9
4
|
|
|
10
5
|
## When to Use Config Routes
|
|
11
6
|
|
|
@@ -34,15 +29,16 @@ export default defineRoutes(({ route, layout, page, $ }, fileRoutes) => {
|
|
|
34
29
|
### Function Signature Description
|
|
35
30
|
|
|
36
31
|
`defineRoutes` accepts a callback function with two parameters:
|
|
32
|
+
|
|
37
33
|
1. `routeFunctions`: An object containing `route`, `layout`, `page`, `$` functions
|
|
38
34
|
2. `fileRoutes`: An array of route configurations generated by convention routes
|
|
39
35
|
|
|
40
36
|
Basic signature of route functions:
|
|
37
|
+
|
|
41
38
|
- First parameter: File path relative to `modern.routes.ts`
|
|
42
39
|
- Second parameter: Route path (optional, must be a string)
|
|
43
40
|
- Third parameter: Array of child routes (optional)
|
|
44
41
|
|
|
45
|
-
|
|
46
42
|
## Route Functions
|
|
47
43
|
|
|
48
44
|
Modern.js provides four main route configuration functions:
|
|
@@ -50,6 +46,7 @@ Modern.js provides four main route configuration functions:
|
|
|
50
46
|
:::tip Path Description
|
|
51
47
|
|
|
52
48
|
The first parameter (path) of all route functions is a **relative path**, which will be concatenated with the parent path to generate the final route path:
|
|
49
|
+
|
|
53
50
|
- **Root path**: `"/"` or `""` represents the root path of the current level
|
|
54
51
|
- **Relative path**: Child route paths will be concatenated relative to the parent path
|
|
55
52
|
- **Dynamic path**: Use `:param` syntax to represent dynamic parameters
|
|
@@ -93,6 +90,7 @@ export default defineRoutes(({ route }, fileRoutes) => {
|
|
|
93
90
|
```
|
|
94
91
|
|
|
95
92
|
**Use cases**:
|
|
93
|
+
|
|
96
94
|
- Quick route configuration without explicitly specifying page or layout
|
|
97
95
|
- Simplify the complexity of route configuration
|
|
98
96
|
|
|
@@ -113,6 +111,7 @@ export default defineRoutes(({ layout, page }, fileRoutes) => {
|
|
|
113
111
|
```
|
|
114
112
|
|
|
115
113
|
**Use cases**:
|
|
114
|
+
|
|
116
115
|
- Need to explicitly specify a component as a layout component
|
|
117
116
|
- Provide common layout structure for multiple pages
|
|
118
117
|
- Need to share navigation, sidebar and other UI components across multiple routes
|
|
@@ -133,6 +132,7 @@ export default defineRoutes(({ layout, page }, fileRoutes) => {
|
|
|
133
132
|
```
|
|
134
133
|
|
|
135
134
|
**Use cases**:
|
|
135
|
+
|
|
136
136
|
- Need to explicitly specify a component as a page component
|
|
137
137
|
- Ensure the component does not contain `<Outlet>` child component rendering
|
|
138
138
|
- Provide clearer semantic expression
|
|
@@ -154,6 +154,7 @@ export default defineRoutes(({ layout, page, $ }, fileRoutes) => {
|
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
**Use cases**:
|
|
157
|
+
|
|
157
158
|
- Custom 404 pages
|
|
158
159
|
- Handle all unmatched requests under specific paths
|
|
159
160
|
|
|
@@ -161,7 +162,6 @@ export default defineRoutes(({ layout, page, $ }, fileRoutes) => {
|
|
|
161
162
|
The `$` function has the same functionality as the `$.tsx` file in convention routes, used to catch unmatched route requests.
|
|
162
163
|
:::
|
|
163
164
|
|
|
164
|
-
|
|
165
165
|
## Configuring Routes
|
|
166
166
|
|
|
167
167
|
### Basic Example
|
|
@@ -195,6 +195,7 @@ export default defineRoutes(({ layout, page }, fileRoutes) => {
|
|
|
195
195
|
```
|
|
196
196
|
|
|
197
197
|
The above configuration will generate:
|
|
198
|
+
|
|
198
199
|
- `/login` → `auth/layout.tsx` + `login/page.tsx`
|
|
199
200
|
- `/register` → `auth/layout.tsx` + `register/page.tsx`
|
|
200
201
|
|
|
@@ -210,7 +211,6 @@ export default defineRoutes(({ page }, fileRoutes) => {
|
|
|
210
211
|
})
|
|
211
212
|
```
|
|
212
213
|
|
|
213
|
-
|
|
214
214
|
### Dynamic Routes
|
|
215
215
|
|
|
216
216
|
Config routes support dynamic route parameters:
|
|
@@ -227,7 +227,6 @@ export default defineRoutes(({ page }, fileRoutes) => {
|
|
|
227
227
|
})
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
-
|
|
231
230
|
## Automatic Route-Related File Discovery
|
|
232
231
|
|
|
233
232
|
Config routes automatically discover component-related files without manual configuration. For any component file specified in `modern.routes.ts`, Modern.js will automatically find the following related files:
|
|
@@ -257,7 +256,7 @@ Modern.js will automatically find and load:
|
|
|
257
256
|
|
|
258
257
|
:::tip
|
|
259
258
|
|
|
260
|
-
For more detailed information about data fetching, please refer to the [Data Fetching](
|
|
259
|
+
For more detailed information about data fetching, please refer to the [Data Fetching](/guides/basic-features/data/data-fetch.md) documentation. For Loading component usage, please refer to [Convention Routes - Loading](/guides/basic-features/routes/routes.md#loading-experimental).
|
|
261
260
|
|
|
262
261
|
:::
|
|
263
262
|
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 2
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Routing
|
|
6
2
|
|
|
7
|
-
Modern.js supports conventional routing on top of both [React Router](https://reactrouter.com/en/main) and [TanStack Router](https://tanstack.com/router), offering file convention-based routing capabilities and supporting the industry-popular **nested routing** pattern. When an entry is recognized as [conventional routing](/guides/concept/entries.
|
|
3
|
+
Modern.js supports conventional routing on top of both [React Router](https://reactrouter.com/en/main) and [TanStack Router](https://tanstack.com/router), offering file convention-based routing capabilities and supporting the industry-popular **nested routing** pattern. When an entry is recognized as [conventional routing](/guides/concept/entries.md#conventional-routing), Modern.js automatically generates the corresponding routing structure based on the file system.
|
|
8
4
|
|
|
9
5
|
:::note
|
|
10
6
|
|
|
@@ -13,7 +9,7 @@ The routing mentioned in this section all refers to conventional routing.
|
|
|
13
9
|
:::
|
|
14
10
|
|
|
15
11
|
:::tip
|
|
16
|
-
This page uses React Router import paths in examples (`@modern-js/runtime/router`)
|
|
12
|
+
This page uses React Router import paths in examples (`@modern-js/runtime/router`).\
|
|
17
13
|
If your project is created with `--router tanstack`, use `@modern-js/plugin-tanstack/runtime` instead.
|
|
18
14
|
:::
|
|
19
15
|
|
|
@@ -155,7 +151,7 @@ Files and directories named with `[]` are turned into dynamic routes. For instan
|
|
|
155
151
|
|
|
156
152
|
The `routes/[id]/page.tsx` file will be converted to the `/:id` route. Apart from the `/blog` route that can be exactly matched, all `/xxx` paths will match this route.
|
|
157
153
|
|
|
158
|
-
In the component, you can use [useParams](/apis/app/runtime/router/router#useparams) to get parameters named accordingly.
|
|
154
|
+
In the component, you can use [useParams](/apis/app/runtime/router/router.md#useparams) to get parameters named accordingly.
|
|
159
155
|
|
|
160
156
|
```tsx
|
|
161
157
|
import { useParams } from '@modern-js/runtime/router';
|
|
@@ -232,7 +228,7 @@ When you visit `/blog/a` and no routes match, the page will render the `routes/b
|
|
|
232
228
|
|
|
233
229
|
If you want `/blog` to match the `blog/$.tsx` file as well, you need to remove the `blog/layout.tsx` file from the same directory and ensure there are no other sub-routes under `blog`.
|
|
234
230
|
|
|
235
|
-
Similarly, you can use [useParams](/apis/app/runtime/router/router#useparams) to capture the remaining part of the URL in the `$.tsx` component.
|
|
231
|
+
Similarly, you can use [useParams](/apis/app/runtime/router/router.md#useparams) to capture the remaining part of the URL in the `$.tsx` component.
|
|
236
232
|
|
|
237
233
|
```ts title="$.tsx"
|
|
238
234
|
import { useParams } from '@modern-js/runtime/router';
|
|
@@ -343,7 +339,7 @@ When accessed, the resulting route will have the following UI structure:
|
|
|
343
339
|
|
|
344
340
|
## Route Redirections
|
|
345
341
|
|
|
346
|
-
In some applications, you may need to redirect to another route based on user identity or other data conditions. In Modern.js, you can use a [`Data Loader`](/guides/basic-features/data/data-fetch) file to fetch data or use traditional React components with `useEffect`.
|
|
342
|
+
In some applications, you may need to redirect to another route based on user identity or other data conditions. In Modern.js, you can use a [`Data Loader`](/guides/basic-features/data/data-fetch.md) file to fetch data or use traditional React components with `useEffect`.
|
|
347
343
|
|
|
348
344
|
### Redirecting in Data Loader
|
|
349
345
|
|
|
@@ -389,9 +385,8 @@ In each directory under `routes/`, developers can define an `error.tsx` file tha
|
|
|
389
385
|
|
|
390
386
|
`<ErrorBoundary>` can return the UI view when an error occurs. If the current level does not declare an `<ErrorBoundary>` component, errors will bubble up to higher-level components until they are caught or thrown. Additionally, when an error occurs within a component, it only affects the route component and its children, leaving the state and view of other components unaffected and interactive.
|
|
391
387
|
|
|
392
|
-
{/* Todo API Routes */}
|
|
393
388
|
|
|
394
|
-
In the `<ErrorBoundary>` component, you can use [useRouteError](/apis/app/runtime/router/router#userouteerror) to obtain specific error information:
|
|
389
|
+
In the `<ErrorBoundary>` component, you can use [useRouteError](/apis/app/runtime/router/router.md#userouteerror) to obtain specific error information:
|
|
395
390
|
|
|
396
391
|
```tsx
|
|
397
392
|
import { useRouteError } from '@modern-js/runtime/router';
|
|
@@ -474,7 +469,7 @@ For applications with higher performance requirements, prefetching can further e
|
|
|
474
469
|
|
|
475
470
|
:::tip
|
|
476
471
|
|
|
477
|
-
In SSR projects, same-origin route data returned by the [Data Loader](/guides/basic-features/data/data-fetch) is prefetched for matched routes with callable loaders. Set `handle.navigationWarmup.data` to `false` on a route when its loader data should not be requested before navigation.
|
|
472
|
+
In SSR projects, same-origin route data returned by the [Data Loader](/guides/basic-features/data/data-fetch.md) is prefetched for matched routes with callable loaders. Set `handle.navigationWarmup.data` to `false` on a route when its loader data should not be requested before navigation.
|
|
478
473
|
|
|
479
474
|
:::
|
|
480
475
|
|
|
@@ -507,9 +502,6 @@ export const handle = {
|
|
|
507
502
|
|
|
508
503
|
:::
|
|
509
504
|
|
|
510
|
-
import Motivation from '@site-docs-en/components/convention-routing-motivation';
|
|
511
|
-
|
|
512
|
-
<Motivation />
|
|
513
505
|
|
|
514
506
|
## FAQ
|
|
515
507
|
|
|
@@ -528,5 +520,5 @@ If you encounter API usage issues, check the corresponding upstream docs:
|
|
|
528
520
|
- TanStack Router docs for `@modern-js/plugin-tanstack/runtime`.
|
|
529
521
|
|
|
530
522
|
:::note
|
|
531
|
-
If you must directly use the React Router package's API (e.g., route behavior wrapped in a unified npm package), you can set [`source.alias`](/configure/app/source/alias) to point `react-router` to the project's dependency, avoiding the issue of two React Router versions.
|
|
523
|
+
If you must directly use the React Router package's API (e.g., route behavior wrapped in a unified npm package), you can set [`source.alias`](/configure/app/source/alias.md) to point `react-router` to the project's dependency, avoiding the issue of two React Router versions.
|
|
532
524
|
:::
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 11
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Import SVG Assets
|
|
6
2
|
|
|
7
3
|
Modern.js supports import SVG assets and transform SVG into React components or URLs.
|
|
@@ -42,7 +38,7 @@ export default () => <Logo />;
|
|
|
42
38
|
|
|
43
39
|
## Modify the Default Export
|
|
44
40
|
|
|
45
|
-
You can modify the default export of SVG files through the [output.svgDefaultExport](/configure/app/output/svg-default-export) config. For example, set the default export as a React component:
|
|
41
|
+
You can modify the default export of SVG files through the [output.svgDefaultExport](/configure/app/output/svg-default-export.md) config. For example, set the default export as a React component:
|
|
46
42
|
|
|
47
43
|
```ts
|
|
48
44
|
export default {
|
|
@@ -74,11 +70,11 @@ When import an SVG in a CSS file, the SVG is treated as a normal static asset an
|
|
|
74
70
|
|
|
75
71
|
When SVG is imported not as a React component but as a normal static asset, it is processed exactly the same as other static assets, and it is also affected by rules such as assets inlining and URL prefixing.
|
|
76
72
|
|
|
77
|
-
Please read the [Import Static Assets](/guides/basic-features/static-assets) section to understand the processing rules for static assets.
|
|
73
|
+
Please read the [Import Static Assets](/guides/basic-features/static-assets.md) section to understand the processing rules for static assets.
|
|
78
74
|
|
|
79
75
|
## Disable SVGR Processing
|
|
80
76
|
|
|
81
|
-
By default, when an SVG resource is referenced in a JS file, Modern.js will call SVGR to convert the SVG into a React component. If you are sure that all SVG resources in your project are not being used as React components, you can turn off this conversion by setting [disableSvgr](/configure/app/output/disable-svgr) to true to improve build performance.
|
|
77
|
+
By default, when an SVG resource is referenced in a JS file, Modern.js will call SVGR to convert the SVG into a React component. If you are sure that all SVG resources in your project are not being used as React components, you can turn off this conversion by setting [disableSvgr](/configure/app/output/disable-svgr.md) to true to improve build performance.
|
|
82
78
|
|
|
83
79
|
```js
|
|
84
80
|
export default {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 13
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Import Wasm Assets
|
|
6
2
|
|
|
7
3
|
Modern.js supports import WebAssembly assets in code.
|
|
@@ -43,7 +39,7 @@ console.log(wasmURL).pathname; // "/static/wasm/[hash].module.wasm"
|
|
|
43
39
|
|
|
44
40
|
When a `.wasm` asset is imported, it will be output by Modern.js to the `dist/static/wasm` directory by default.
|
|
45
41
|
|
|
46
|
-
You can change the output directory of `.wasm` files via [output.distPath](/configure/app/output/dist-path) config.
|
|
42
|
+
You can change the output directory of `.wasm` files via [output.distPath](/configure/app/output/dist-path.md) config.
|
|
47
43
|
|
|
48
44
|
```ts
|
|
49
45
|
export default {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 10
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Import Static Assets
|
|
6
2
|
|
|
7
3
|
Modern.js supports import static assets, including images, fonts, and medias.
|
|
@@ -21,7 +17,7 @@ The following are the formats supported by Modern.js by default:
|
|
|
21
17
|
If you need to import assets in other formats, please refer to [Extend Asset Types](#extend-asset-types).
|
|
22
18
|
|
|
23
19
|
:::tip SVG images
|
|
24
|
-
SVG image is a special case. Modern.js support convert SVG to React components, so SVG is processed separately. For details, see [Import SVG Assets](/guides/basic-features/static-assets/svg-assets.
|
|
20
|
+
SVG image is a special case. Modern.js support convert SVG to React components, so SVG is processed separately. For details, see [Import SVG Assets](/guides/basic-features/static-assets/svg-assets.md).
|
|
25
21
|
:::
|
|
26
22
|
|
|
27
23
|
## Import Assets in JS file
|
|
@@ -35,7 +31,7 @@ import logo from './static/logo.png';
|
|
|
35
31
|
export default () => <img src={logo} />;
|
|
36
32
|
```
|
|
37
33
|
|
|
38
|
-
Import with [alias](/guides/basic-features/alias.
|
|
34
|
+
Import with [alias](/guides/basic-features/alias.md) are also supported:
|
|
39
35
|
|
|
40
36
|
```tsx
|
|
41
37
|
import logo from '@/static/logo.png';
|
|
@@ -53,7 +49,7 @@ In CSS files, you can reference static assets in relative paths:
|
|
|
53
49
|
}
|
|
54
50
|
```
|
|
55
51
|
|
|
56
|
-
Import with [alias](/guides/basic-features/alias.
|
|
52
|
+
Import with [alias](/guides/basic-features/alias.md) are also supported:
|
|
57
53
|
|
|
58
54
|
```css
|
|
59
55
|
.logo {
|
|
@@ -76,23 +72,23 @@ console.log(largeImage); // "/static/largeImage.6c12aba3.png"
|
|
|
76
72
|
console.log(smallImage); // "data:image/png;base64,iVBORw0KGgo..."
|
|
77
73
|
```
|
|
78
74
|
|
|
79
|
-
For a more detailed introduction to asset inlining, please refer to the [Static Asset Inlining](/guides/advanced-features/page-performance/inline-assets) chapter.
|
|
75
|
+
For a more detailed introduction to asset inlining, please refer to the [Static Asset Inlining](/guides/advanced-features/page-performance/inline-assets.md) chapter.
|
|
80
76
|
|
|
81
77
|
## Output Files
|
|
82
78
|
|
|
83
79
|
When static assets are imported, they will be output to the dist directory. You can:
|
|
84
80
|
|
|
85
|
-
- Modify the output filename through [output.filename](/configure/app/output/filename).
|
|
86
|
-
- Modify the output path through [output.distPath](/configure/app/output/dist-path).
|
|
81
|
+
- Modify the output filename through [output.filename](/configure/app/output/filename.md).
|
|
82
|
+
- Modify the output path through [output.distPath](/configure/app/output/dist-path.md).
|
|
87
83
|
|
|
88
|
-
Please read [Output Files](/guides/basic-features/output-files) for details.
|
|
84
|
+
Please read [Output Files](/guides/basic-features/output-files.md) for details.
|
|
89
85
|
|
|
90
86
|
## URL Prefix
|
|
91
87
|
|
|
92
88
|
The URL returned after importing a asset will automatically include the path prefix:
|
|
93
89
|
|
|
94
|
-
- In development, using [dev.assetPrefix](/configure/app/dev/asset-prefix) to set the path prefix.
|
|
95
|
-
- In production, using [output.assetPrefix](/configure/app/output/asset-prefix) to set the path prefix.
|
|
90
|
+
- In development, using [dev.assetPrefix](/configure/app/dev/asset-prefix.md) to set the path prefix.
|
|
91
|
+
- In production, using [output.assetPrefix](/configure/app/output/asset-prefix.md) to set the path prefix.
|
|
96
92
|
|
|
97
93
|
For example, you can set `output.assetPrefix` to `https://modern.com`:
|
|
98
94
|
|
|
@@ -123,7 +119,7 @@ After adding the type declaration, if the type error still exists, you can try t
|
|
|
123
119
|
|
|
124
120
|
## Extend Asset Types
|
|
125
121
|
|
|
126
|
-
If the built-in asset types in Modern.js cannot meet your requirements, you can modify the built-in Rspack configuration and extend the asset types you need using [tools.bundlerChain](/configure/app/tools/bundler-chain).
|
|
122
|
+
If the built-in asset types in Modern.js cannot meet your requirements, you can modify the built-in Rspack configuration and extend the asset types you need using [tools.bundlerChain](/configure/app/tools/bundler-chain.md).
|
|
127
123
|
|
|
128
124
|
For example, if you want to treat `*.pdf` files as assets and directly output them to the dist directory, you can add the following configuration:
|
|
129
125
|
|
|
@@ -4,9 +4,18 @@ Playwright is a testing framework that allows you to run tests automatically in
|
|
|
4
4
|
|
|
5
5
|
To use Playwright in Modern.js, you need to install the dependencies first. You can run the following commands:
|
|
6
6
|
|
|
7
|
-
import { PackageManagerTabs } from '@theme';
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
```sh [npm]
|
|
9
|
+
npm init playwright
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```sh [yarn]
|
|
13
|
+
yarn create playwright
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```sh [pnpm]
|
|
17
|
+
pnpm create playwright
|
|
18
|
+
```
|
|
10
19
|
|
|
11
20
|
The above commands will automatically install Playwright dependencies and help you install and configure it in your project through a series of prompts, including adding a `playwright.config.ts` file.
|
|
12
21
|
|
|
@@ -108,4 +117,4 @@ Running 3 tests using 3 workers
|
|
|
108
117
|
To open last HTML report run:
|
|
109
118
|
|
|
110
119
|
npx playwright show-report
|
|
111
|
-
```
|
|
120
|
+
```
|
|
@@ -8,10 +8,26 @@ This guide explains how to integrate Rstest with Modern.js for web app testing.
|
|
|
8
8
|
|
|
9
9
|
Install the base dependencies first:
|
|
10
10
|
|
|
11
|
-
import { Prompt } from '@rspress/core/theme';
|
|
12
|
-
import { PackageManagerTabs } from '@theme';
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
```sh [npm]
|
|
13
|
+
npm add @rstest/core @modern-js/adapter-rstest -D
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```sh [yarn]
|
|
17
|
+
yarn add @rstest/core @modern-js/adapter-rstest -D
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```sh [pnpm]
|
|
21
|
+
pnpm add @rstest/core @modern-js/adapter-rstest -D
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```sh [bun]
|
|
25
|
+
bun add @rstest/core @modern-js/adapter-rstest -D
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```sh [deno]
|
|
29
|
+
deno add npm:@rstest/core npm:@modern-js/adapter-rstest -D
|
|
30
|
+
```
|
|
15
31
|
|
|
16
32
|
Then create `rstest.config.ts`:
|
|
17
33
|
|
|
@@ -51,7 +67,26 @@ We generally recommend browser mode because it uses real browser APIs and behavi
|
|
|
51
67
|
|
|
52
68
|
If you want to test in a real browser instead of a simulated DOM, install the browser mode dependencies:
|
|
53
69
|
|
|
54
|
-
|
|
70
|
+
|
|
71
|
+
```sh [npm]
|
|
72
|
+
npm add @rstest/browser @rstest/browser-react playwright -D
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```sh [yarn]
|
|
76
|
+
yarn add @rstest/browser @rstest/browser-react playwright -D
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```sh [pnpm]
|
|
80
|
+
pnpm add @rstest/browser @rstest/browser-react playwright -D
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```sh [bun]
|
|
84
|
+
bun add @rstest/browser @rstest/browser-react playwright -D
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```sh [deno]
|
|
88
|
+
deno add npm:@rstest/browser npm:@rstest/browser-react npm:playwright -D
|
|
89
|
+
```
|
|
55
90
|
|
|
56
91
|
Then enable browser mode in `rstest.config.ts`:
|
|
57
92
|
|
|
@@ -96,7 +131,26 @@ For more browser mode setup, Locator APIs, and assertions, refer to the [Rstest
|
|
|
96
131
|
|
|
97
132
|
Install the DOM testing dependencies:
|
|
98
133
|
|
|
99
|
-
|
|
134
|
+
|
|
135
|
+
```sh [npm]
|
|
136
|
+
npm add happy-dom @testing-library/react @testing-library/dom -D
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```sh [yarn]
|
|
140
|
+
yarn add happy-dom @testing-library/react @testing-library/dom -D
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```sh [pnpm]
|
|
144
|
+
pnpm add happy-dom @testing-library/react @testing-library/dom -D
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
```sh [bun]
|
|
148
|
+
bun add happy-dom @testing-library/react @testing-library/dom -D
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
```sh [deno]
|
|
152
|
+
deno add npm:happy-dom npm:@testing-library/react npm:@testing-library/dom -D
|
|
153
|
+
```
|
|
100
154
|
|
|
101
155
|
Update `rstest.config.ts` to use `happy-dom`:
|
|
102
156
|
|
|
@@ -172,10 +226,16 @@ If your project already uses Jest or Vitest, refer to the official Rstest migrat
|
|
|
172
226
|
|
|
173
227
|
We recommend installing the `migrate-to-rstest` skill first, then copying this prompt to your coding agent. It keeps the Modern.js `@modern-js/adapter-rstest` integration during migration:
|
|
174
228
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
229
|
+
|
|
230
|
+
For your Agent
|
|
231
|
+
|
|
232
|
+
Migrate to Rstest
|
|
233
|
+
|
|
234
|
+
Copy this prompt and send it to your coding agent.
|
|
235
|
+
|
|
236
|
+
Copy Prompt
|
|
237
|
+
|
|
238
|
+
Migrate this Modern.js project from Jest or Vitest to Rstest.
|
|
179
239
|
|
|
180
240
|
First install and use the migrate-to-rstest skill. If it is not installed, install it with:
|
|
181
241
|
npx skills add rstackjs/agent-skills --skill migrate-to-rstest
|
|
@@ -188,5 +248,4 @@ Modern.js-specific requirement:
|
|
|
188
248
|
- Install and use @modern-js/adapter-rstest together with @rstest/core.
|
|
189
249
|
- Create or update rstest.config.ts to import withModernConfig from @modern-js/adapter-rstest.
|
|
190
250
|
- Reuse the Modern.js app configuration with extends: withModernConfig().
|
|
191
|
-
- Do not replace this with a plain Rstest config unless the project explicitly does not need Modern.js config integration
|
|
192
|
-
/>
|
|
251
|
+
- Do not replace this with a plain Rstest config unless the project explicitly does not need Modern.js config integration.
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 2
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Build Engine
|
|
6
2
|
|
|
7
3
|
Modern.js internally encapsulates [Rsbuild](https://v2.rsbuild.rs/), using Rspack as the bundler.
|
|
@@ -18,29 +14,10 @@ From the building perspective, Modern.js can be divided into three-layers, from
|
|
|
18
14
|
- Build tool: Rsbuild.
|
|
19
15
|
- Bundler: Rspack.
|
|
20
16
|
|
|
21
|
-
import Mermaid from '@site/src/components/Mermaid';
|
|
22
|
-
|
|
23
|
-
<Mermaid>
|
|
24
|
-
{`
|
|
25
|
-
flowchart TD
|
|
26
|
-
Framework("Upper-level Framework: Modern.js")
|
|
27
|
-
BuildTool("Build Tool: Rsbuild")
|
|
28
|
-
Bundler("Bundler: Rspack")
|
|
29
|
-
|
|
30
|
-
Framework --> BuildTool
|
|
31
|
-
BuildTool --> Bundler
|
|
32
|
-
|
|
33
|
-
style Framework fill:#FDE68A,stroke:#F59E0B,stroke-width:2px
|
|
34
|
-
style BuildTool fill:#86EFAC,stroke:#10B981,stroke-width:2px
|
|
35
|
-
style Bundler fill:#93C5FD,stroke:#3B82F6,stroke-width:2px
|
|
36
|
-
|
|
37
|
-
`}
|
|
38
|
-
|
|
39
|
-
</Mermaid>
|
|
40
17
|
|
|
41
18
|
## Build Documentation
|
|
42
19
|
|
|
43
|
-
The documentation address of Rsbuild is: https://v2.rsbuild.rs/
|
|
20
|
+
The documentation address of Rsbuild is: [https://v2.rsbuild.rs/](https://v2.rsbuild.rs/)
|
|
44
21
|
|
|
45
22
|
In this documentation, you can learn about the detailed introduction of Rsbuild, and you can also find complete usage guides for various building capabilities.
|
|
46
23
|
|
|
@@ -50,8 +27,8 @@ If you want to understand the use of build configurations, it is recommended tha
|
|
|
50
27
|
|
|
51
28
|
In Modern.js, you can register Rspack plugins or Rsbuild plugins:
|
|
52
29
|
|
|
53
|
-
- Rspack plugins: Configured through [tools.bundlerChain](/configure/app/tools/bundler-chain).
|
|
54
|
-
- Rsbuild plugins: Configured through [builderPlugins](/configure/app/builder-plugins).
|
|
30
|
+
- Rspack plugins: Configured through [tools.bundlerChain](/configure/app/tools/bundler-chain.md).
|
|
31
|
+
- Rsbuild plugins: Configured through [builderPlugins](/configure/app/builder-plugins.md).
|
|
55
32
|
|
|
56
33
|
## Build Capabilities
|
|
57
34
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 1
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Page Entry
|
|
6
2
|
|
|
7
3
|
Through this chapter, you can understand the entry conventions in Modern.js and how to customize entries.
|
|
@@ -32,9 +28,6 @@ The application initialized by Modern.js is a single-entry application with the
|
|
|
32
28
|
|
|
33
29
|
In a Modern.js application, you can easily switch from single entry to multiple entries. To manually create multiple entries, follow these steps:
|
|
34
30
|
|
|
35
|
-
import NewEntryTooltip from '@site-docs-en/components/new-entry-tooltip.mdx';
|
|
36
|
-
|
|
37
|
-
<NewEntryTooltip />
|
|
38
31
|
|
|
39
32
|
1. **Move the original entry code to a directory named after the `name` field in `package.json`**
|
|
40
33
|
|
|
@@ -103,18 +96,19 @@ Modern.js automatically scans directories to identify entries that meet the crit
|
|
|
103
96
|
2. **Has an `App.tsx?` file** → Self-controlled routing entry
|
|
104
97
|
3. **Has an `entry.tsx?` file** → Custom entry
|
|
105
98
|
|
|
106
|
-
|
|
99
|
+
:::tip 入口扫描逻辑
|
|
107
100
|
|
|
108
|
-
|
|
101
|
+
- 如果 `src/` 本身满足入口条件 → 单入口应用
|
|
102
|
+
- 如果 `src/` 不满足条件 → 扫描 `src/` 下的子目录 → 多入口应用
|
|
103
|
+
- 单入口应用中,默认入口名为 `index`
|
|
104
|
+
|
|
105
|
+
:::
|
|
109
106
|
|
|
110
107
|
:::tip Custom scanning directory
|
|
111
|
-
You can modify the directory for identifying entries through [source.entriesDir](/configure/app/source/entries-dir).
|
|
108
|
+
You can modify the directory for identifying entries through [source.entriesDir](/configure/app/source/entries-dir.md).
|
|
112
109
|
|
|
113
110
|
:::
|
|
114
111
|
|
|
115
|
-
import EntryMode from '@site-docs/components/entry-mode.mdx';
|
|
116
|
-
|
|
117
|
-
<EntryMode />
|
|
118
112
|
|
|
119
113
|
Next, we will introduce the usage of each entry type in detail.
|
|
120
114
|
|
|
@@ -144,7 +138,7 @@ Component correspondence
|
|
|
144
138
|
| `routes/about/page.tsx` | `/about` | About page |
|
|
145
139
|
| `routes/blog/[id]/page.tsx` | `/blog/:id` | Dynamic route page |
|
|
146
140
|
|
|
147
|
-
For more details, please refer to [Routing Solution](/guides/basic-features/routes/routes#convention-routing).
|
|
141
|
+
For more details, please refer to [Routing Solution](/guides/basic-features/routes/routes.md#convention-routing).
|
|
148
142
|
|
|
149
143
|
### Self-controlled Routing
|
|
150
144
|
|
|
@@ -244,10 +238,10 @@ In some cases, you may need to customize the entry configuration instead of usin
|
|
|
244
238
|
|
|
245
239
|
For example, if you need to migrate a non-Modern.js application to Modern.js, and it is not structured according to Modern.js's directory structure, there might be some migration costs involved in changing it to the conventional structure. In such cases, you can use custom entries.
|
|
246
240
|
|
|
247
|
-
Modern.js provides the following configuration options that you can set in [modern.config.ts](/configure/app/usage):
|
|
241
|
+
Modern.js provides the following configuration options that you can set in [modern.config.ts](/configure/app/usage.md):
|
|
248
242
|
|
|
249
|
-
- [source.entries](/configure/app/source/entries): Used to set custom entry objects.
|
|
250
|
-
- [source.disableDefaultEntries](/configure/app/source/disable-default-entries): Used to disable Modern.js's default entry scanning behavior. When you use custom entries, parts of your project structure might coincidentally match the Modern.js conventional directory structure, but you may not want Modern.js to generate entry configurations for them. Enabling this option can help avoid this issue.
|
|
243
|
+
- [source.entries](/configure/app/source/entries.md): Used to set custom entry objects.
|
|
244
|
+
- [source.disableDefaultEntries](/configure/app/source/disable-default-entries.md): Used to disable Modern.js's default entry scanning behavior. When you use custom entries, parts of your project structure might coincidentally match the Modern.js conventional directory structure, but you may not want Modern.js to generate entry configurations for them. Enabling this option can help avoid this issue.
|
|
251
245
|
|
|
252
246
|
### Example
|
|
253
247
|
|
|
@@ -10,7 +10,7 @@ Modern.js builds its Web server based on the [Hono framework](https://hono.dev/)
|
|
|
10
10
|
|
|
11
11
|
The Web server flow in both Modern.js development and production environments is entirely isomorphic, so you don't need to worry about differences between them.
|
|
12
12
|
|
|
13
|
-
As mentioned in the [Build Tools](/guides/concept/builder) section, Modern.js' underlying build capability is provided by Rsbuild, and some server-side capabilities in the development environment are coupled with the build tools, such as HMR. Modern.js needs to reuse these capabilities of the Rsbuild Dev Server.
|
|
13
|
+
As mentioned in the [Build Tools](/guides/concept/builder.md) section, Modern.js' underlying build capability is provided by Rsbuild, and some server-side capabilities in the development environment are coupled with the build tools, such as HMR. Modern.js needs to reuse these capabilities of the Rsbuild Dev Server.
|
|
14
14
|
|
|
15
15
|
In the development environment, Modern.js directly uses the middlewares provided by Rsbuild, which includes capabilities needed during the development stage such as HMR and Proxy. Additionally, Modern.js provides capabilities such as Mock, routing, and rendering on top of this:
|
|
16
16
|
|
|
@@ -26,10 +26,10 @@ Static asset files can be directly hosted by Modern.js' server, but it is highly
|
|
|
26
26
|
|
|
27
27
|
Modern.js supports running built artifacts in any Node.js environment. Typically, the CI environment has already installed all application dependencies.
|
|
28
28
|
|
|
29
|
-
You can run the [`modern build`](/apis/app/commands#modern-build) command to build the application and the [`modern serve`](/apis/app/commands#modern-serve) command to run the Web server, starting the UltraModern.js application.
|
|
29
|
+
You can run the [`modern build`](/apis/app/commands.md#modern-build) command to build the application and the [`modern serve`](/apis/app/commands.md#modern-serve) command to run the Web server, starting the UltraModern.js application.
|
|
30
30
|
|
|
31
31
|
## Running in Production Environments
|
|
32
32
|
|
|
33
33
|
When deploying to production, the artifact size should be as small as possible. The aforementioned method for running in CI environments keeps all artifacts from the original project. Therefore, it is not recommended to run the application using the above commands in a production environment.
|
|
34
34
|
|
|
35
|
-
UltraModern.js offers a standalone deployment solution. When running the [`modern deploy`](/apis/app/commands#modern-deploy) command, the artifacts will include an entry file for running the Web server.
|
|
35
|
+
UltraModern.js offers a standalone deployment solution. When running the [`modern deploy`](/apis/app/commands.md#modern-deploy) command, the artifacts will include an entry file for running the Web server.
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: AI Tools
|
|
3
|
-
sidebar_position: 6
|
|
4
|
-
---
|
|
5
|
-
|
|
6
1
|
# Modern.js For AI
|
|
7
2
|
|
|
8
3
|
Modern.js provides a toolkit for AI agents that makes your project agent-ready out of the box, helping you use AI to develop, upgrade, and migrate Modern.js applications more accurately and efficiently.
|
|
@@ -18,7 +13,7 @@ AI agents use them to get APIs, config, and conventions that exactly match your
|
|
|
18
13
|
`AGENTS.md` gives AI coding agents project-level guidance — telling them to read the bundled docs before making changes and to follow Modern.js conventions. A `CLAUDE.md` is generated alongside it, reusing the same guidance for Claude Code via the `@AGENTS.md` import.
|
|
19
14
|
|
|
20
15
|
- **New projects**: `npx @modern-js/create` generates both files by default; pass `--no-agents-md` to skip them.
|
|
21
|
-
- **Existing projects**: run `npx @modern-js/create agents-md` at the project root to create or update them. Re-run it any time; your own additions are preserved.
|
|
16
|
+
- **Existing projects**: run `npx @modern-js/create --agents-md-only` at the project root to create or update them. Re-run it any time; your own additions are preserved.
|
|
22
17
|
|
|
23
18
|
Modern.js only maintains the content inside the `<!-- BEGIN:modernjs-agent-rules -->` markers in `AGENTS.md`; anything you write outside them is left untouched.
|
|
24
19
|
|
|
@@ -35,9 +30,9 @@ Use it when you need content beyond the bundled docs — just let your agent ret
|
|
|
35
30
|
|
|
36
31
|
Skills are on-demand AI capabilities following the [Agent Skills open standard](https://github.com/vercel-labs/skills). User-facing Skills:
|
|
37
32
|
|
|
38
|
-
| Skill
|
|
39
|
-
|
|
40
|
-
| Upgrade to v3
|
|
33
|
+
| Skill | Identifier | Description |
|
|
34
|
+
| --------------- | ------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
35
|
+
| Upgrade to v3 | `modernjs-migrate-to-v3` | Migrate a v2 app to v3: safe rewrites + manual checklist + migration report |
|
|
41
36
|
| Enable features | `modernjs-feature-enable` | Enable BFF / SSG / styled-components for v3 apps, and scaffold Tailwind CSS / custom Web Server |
|
|
42
37
|
|
|
43
38
|
> Skills are not force-installed or implicitly installed — you install them explicitly. RSC and micro-frontend setups are configuration or architecture decisions, not one-click `modernjs-feature-enable` actions.
|