@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.99 → 3.8.1-ultramodern.2
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/builder/generator/getBuilderEnvironments.js +73 -11
- package/dist/cjs/bundleDocs.js +114 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/index.js +1 -1
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +94 -18
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
- package/dist/cjs/ultramodern-release-envelope/framework-output.js +109 -57
- package/dist/esm/builder/generator/getBuilderEnvironments.mjs +63 -10
- package/dist/esm/bundleDocs.mjs +62 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -1
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +93 -18
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
- package/dist/esm/ultramodern-release-envelope/framework-output.mjs +107 -58
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +63 -10
- package/dist/esm-node/bundleDocs.mjs +63 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -1
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +93 -18
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
- package/dist/esm-node/ultramodern-release-envelope/framework-output.mjs +107 -58
- package/dist/types/builder/generator/getBuilderEnvironments.d.ts +29 -0
- package/dist/types/bundleDocs.d.ts +20 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +1 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts +1 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.d.mts +13 -0
- package/dist/types/ultramodern-release-envelope/framework-output.d.ts +1 -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} +16 -22
- 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.md +22 -0
- 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} +16 -33
- 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} +38 -31
- package/docs/guides/get-started/{upgrade.mdx → upgrade.md} +26 -22
- 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 +33 -15
- 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/rsc.mdx +0 -30
- 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,43 +1,16 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
2
3
|
import promises from "node:fs/promises";
|
|
3
4
|
import node_path from "node:path";
|
|
4
|
-
import { parse } from "@babel/parser";
|
|
5
5
|
import { BACKEND_FEDERATION_MANIFEST_FILE, BACKEND_FEDERATION_REMOTE_ENTRY_FILE, ULTRAMODERN_BUILD_ARTIFACT_FILE, isUltramodernBuildArtifact } from "@modern-js/utils/universal";
|
|
6
6
|
import { canonicalSerializeMicroVerticalReleaseEnvelope, createMicroVerticalReleaseEnvelope, verifyMicroVerticalReleaseEnvelope } from "./index.mjs";
|
|
7
7
|
const MICROVERTICAL_RELEASE_ENVELOPE_PATH = 'release/microvertical-release-envelope.json';
|
|
8
|
+
const MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH = 'release/microvertical-release-identity-carriers.json';
|
|
9
|
+
const MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_KIND = 'ultramodern-release-identity-carriers';
|
|
10
|
+
const MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_SCHEMA_VERSION = 1;
|
|
8
11
|
const COMPILED_MODULE_PATTERN = /\.(?:c|m)?js$/u;
|
|
9
12
|
const EFFECT_BFF_WORKER_PATTERN = /^worker\/__modern_bff_effect\.(?:c|m)?js$/u;
|
|
10
13
|
const isRecord = (value)=>'object' == typeof value && null !== value && !Array.isArray(value);
|
|
11
|
-
const isAstNode = (value)=>isRecord(value) && 'string' == typeof value.type;
|
|
12
|
-
const visitAst = (node, visitor)=>{
|
|
13
|
-
visitor(node);
|
|
14
|
-
for (const value of Object.values(node))if (isAstNode(value)) visitAst(value, visitor);
|
|
15
|
-
else if (Array.isArray(value)) {
|
|
16
|
-
for (const item of value)if (isAstNode(item)) visitAst(item, visitor);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const compiledModuleIdentityValues = (source)=>{
|
|
20
|
-
const values = new Set();
|
|
21
|
-
const ast = parse(source, {
|
|
22
|
-
sourceType: 'unambiguous'
|
|
23
|
-
});
|
|
24
|
-
visitAst(ast.program, (node)=>{
|
|
25
|
-
if ('StringLiteral' === node.type && 'string' == typeof node.value) values.add(node.value);
|
|
26
|
-
else if ('TemplateElement' === node.type && isRecord(node.value) && 'string' == typeof node.value.cooked) values.add(node.value.cooked);
|
|
27
|
-
});
|
|
28
|
-
return values;
|
|
29
|
-
};
|
|
30
|
-
const assertEveryCompiledIdentityCarrier = async (distDirectory, logicalPaths, identity, surface)=>{
|
|
31
|
-
const compiledLogicalPaths = logicalPaths.filter((pathname)=>COMPILED_MODULE_PATTERN.test(pathname));
|
|
32
|
-
if (0 === compiledLogicalPaths.length) throw new Error(`[ultramodern-release-envelope] ${surface} has no compiled execution module carrying release identity.`);
|
|
33
|
-
for (const logicalPath of compiledLogicalPaths){
|
|
34
|
-
const source = await promises.readFile(node_path.join(distDirectory, logicalPath), {
|
|
35
|
-
encoding: 'utf8'
|
|
36
|
-
});
|
|
37
|
-
const values = compiledModuleIdentityValues(source);
|
|
38
|
-
if (!values.has(identity.buildMarker) || !values.has(identity.sourceRevision) || !values.has(identity.releaseVersion)) throw new Error(`[ultramodern-release-envelope] ${surface} execution module ${logicalPath} does not carry exact buildMarker ${identity.buildMarker}, sourceRevision ${identity.sourceRevision}, and releaseVersion ${identity.releaseVersion}.`);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
14
|
const flattenStrings = (value)=>'string' == typeof value ? [
|
|
42
15
|
value
|
|
43
16
|
] : Array.isArray(value) ? value.flatMap(flattenStrings) : [];
|
|
@@ -180,6 +153,49 @@ const releaseArtifact = (logicalPath, runtime)=>({
|
|
|
180
153
|
logicalPath,
|
|
181
154
|
runtime
|
|
182
155
|
});
|
|
156
|
+
const writeReleaseIdentityCarrierMetadata = async (artifactRoot, identity, carrierPaths)=>{
|
|
157
|
+
const surfacesByPath = new Map();
|
|
158
|
+
for (const [surface, logicalPaths] of Object.entries(carrierPaths)){
|
|
159
|
+
if (0 === logicalPaths.length) throw new Error(`[ultramodern-release-envelope] ${surface} has no declared release-identity carrier artifact.`);
|
|
160
|
+
for (const logicalPath of logicalPaths){
|
|
161
|
+
const surfaces = surfacesByPath.get(logicalPath) ?? new Set();
|
|
162
|
+
surfaces.add(surface);
|
|
163
|
+
surfacesByPath.set(logicalPath, surfaces);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const carriers = await Promise.all([
|
|
167
|
+
...surfacesByPath
|
|
168
|
+
].sort(([left], [right])=>left.localeCompare(right)).map(async ([logicalPath, surfaces])=>{
|
|
169
|
+
const bytes = await promises.readFile(node_path.join(artifactRoot, logicalPath));
|
|
170
|
+
return {
|
|
171
|
+
logicalPath,
|
|
172
|
+
byteLength: bytes.byteLength,
|
|
173
|
+
sha256: createHash('sha256').update(bytes).digest('hex'),
|
|
174
|
+
surfaces: [
|
|
175
|
+
...surfaces
|
|
176
|
+
].sort((left, right)=>left.localeCompare(right))
|
|
177
|
+
};
|
|
178
|
+
}));
|
|
179
|
+
const releaseEnvelopePath = await resolveSafeReleaseEnvelopePath({
|
|
180
|
+
artifactRoot,
|
|
181
|
+
createDirectory: true
|
|
182
|
+
});
|
|
183
|
+
if (!releaseEnvelopePath) throw new Error('[ultramodern-release-envelope] could not resolve private release metadata directory.');
|
|
184
|
+
const metadataPath = node_path.join(node_path.dirname(releaseEnvelopePath), node_path.basename(MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH));
|
|
185
|
+
try {
|
|
186
|
+
const metadataStat = await promises.lstat(metadataPath);
|
|
187
|
+
if (metadataStat.isSymbolicLink() || !metadataStat.isFile()) throw new Error('[ultramodern-release-envelope] release identity carrier metadata must be a real file inside artifactRoot.');
|
|
188
|
+
} catch (error) {
|
|
189
|
+
if (!isMissingPathError(error)) throw error;
|
|
190
|
+
}
|
|
191
|
+
await promises.writeFile(metadataPath, `${JSON.stringify({
|
|
192
|
+
schemaVersion: MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_SCHEMA_VERSION,
|
|
193
|
+
kind: MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_KIND,
|
|
194
|
+
identity,
|
|
195
|
+
carriers
|
|
196
|
+
}, null, 2)}\n`);
|
|
197
|
+
return releaseArtifact(MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH, 'release-identity-metadata');
|
|
198
|
+
};
|
|
183
199
|
const createReleaseArtifactInputs = async (distDirectory, identity, target)=>{
|
|
184
200
|
const files = await collectFiles(distDirectory);
|
|
185
201
|
if ('node' === target && files.some((logicalPath)=>EFFECT_BFF_WORKER_PATTERN.test(logicalPath))) throw new Error('[ultramodern-release-envelope] Node target conflicts with a Cloudflare Effect API/BFF worker artifact; resolve the canonical deploy target instead of emitting a Node envelope for Cloudflare output.');
|
|
@@ -203,13 +219,7 @@ const createReleaseArtifactInputs = async (distDirectory, identity, target)=>{
|
|
|
203
219
|
const clientExecutionPaths = await manifestReferencedClientModules(distDirectory, files);
|
|
204
220
|
if (0 === clientExecutionPaths.length) throw new Error('[ultramodern-release-envelope] UI/client manifest references no compiled execution module.');
|
|
205
221
|
const ssrExecutionPaths = await routeReferencedSsrModules(distDirectory, files, target);
|
|
206
|
-
|
|
207
|
-
await assertEveryCompiledIdentityCarrier(distDirectory, ssrExecutionPaths, identity, 'node' === target ? 'route-referenced Node SSR' : 'route-referenced Cloudflare SSR');
|
|
208
|
-
await assertEveryCompiledIdentityCarrier(distDirectory, ssrPaths, identity, 'node' === target ? 'compiled Node SSR closure' : 'compiled Cloudflare SSR/workerd closure');
|
|
209
|
-
await assertEveryCompiledIdentityCarrier(distDirectory, 'node' === target ? nodeApiEntryPaths : apiBackendPaths, identity, 'node' === target ? 'Node API/backend' : 'Cloudflare API/backend');
|
|
210
|
-
await assertEveryCompiledIdentityCarrier(distDirectory, [
|
|
211
|
-
BACKEND_FEDERATION_REMOTE_ENTRY_FILE
|
|
212
|
-
], identity, 'backend Module Federation container');
|
|
222
|
+
if (0 === ssrExecutionPaths.length) throw new Error(`[ultramodern-release-envelope] route manifest references no emitted ${'node' === target ? 'Node' : 'Cloudflare'} SSR execution module.`);
|
|
213
223
|
const runtimeByPath = new Map();
|
|
214
224
|
const add = (paths, runtime)=>{
|
|
215
225
|
for (const logicalPath of paths){
|
|
@@ -245,8 +255,25 @@ const createReleaseArtifactInputs = async (distDirectory, identity, target)=>{
|
|
|
245
255
|
const artifacts = [
|
|
246
256
|
...runtimeByPath
|
|
247
257
|
].map(([logicalPath, runtime])=>releaseArtifact(logicalPath, runtime)).sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath));
|
|
258
|
+
const identityCarrierMetadata = await writeReleaseIdentityCarrierMetadata(distDirectory, identity, {
|
|
259
|
+
apiBackend: apiBackendPaths,
|
|
260
|
+
backendFederation: [
|
|
261
|
+
BACKEND_FEDERATION_MANIFEST_FILE,
|
|
262
|
+
BACKEND_FEDERATION_REMOTE_ENTRY_FILE
|
|
263
|
+
],
|
|
264
|
+
ssr: [
|
|
265
|
+
...new Set([
|
|
266
|
+
...ssrExecutionPaths,
|
|
267
|
+
...ssrPaths
|
|
268
|
+
])
|
|
269
|
+
],
|
|
270
|
+
uiClient: uiClientPaths.filter((logicalPath)=>COMPILED_MODULE_PATTERN.test(logicalPath))
|
|
271
|
+
});
|
|
248
272
|
return {
|
|
249
|
-
artifacts
|
|
273
|
+
artifacts: [
|
|
274
|
+
...artifacts,
|
|
275
|
+
identityCarrierMetadata
|
|
276
|
+
].sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath)),
|
|
250
277
|
surfaces
|
|
251
278
|
};
|
|
252
279
|
};
|
|
@@ -368,13 +395,7 @@ const createNodeStagedReleaseArtifactInputs = async (outputDirectory, identity)=
|
|
|
368
395
|
])if (0 === paths.length) throw new Error(`[ultramodern-release-envelope] final Node staging has no ${surface} artifacts.`);
|
|
369
396
|
const clientExecutionPaths = await manifestReferencedClientModules(outputDirectory, files);
|
|
370
397
|
const ssrExecutionPaths = await routeReferencedSsrModules(outputDirectory, files, 'node');
|
|
371
|
-
|
|
372
|
-
await assertEveryCompiledIdentityCarrier(outputDirectory, ssrExecutionPaths, identity, 'final route-referenced Node SSR');
|
|
373
|
-
await assertEveryCompiledIdentityCarrier(outputDirectory, ssrPaths.filter((logicalPath)=>'index.js' !== logicalPath), identity, 'final compiled Node SSR closure');
|
|
374
|
-
await assertEveryCompiledIdentityCarrier(outputDirectory, apiBackendPaths.filter((logicalPath)=>logicalPath.startsWith('api/')), identity, 'final Node API/backend');
|
|
375
|
-
await assertEveryCompiledIdentityCarrier(outputDirectory, [
|
|
376
|
-
BACKEND_FEDERATION_REMOTE_ENTRY_FILE
|
|
377
|
-
], identity, 'final Node backend Module Federation container');
|
|
398
|
+
if (0 === clientExecutionPaths.length || 0 === ssrExecutionPaths.length) throw new Error('[ultramodern-release-envelope] final Node manifests must reference emitted UI/client and SSR execution modules.');
|
|
378
399
|
const runtimeByPath = new Map(files.filter((logicalPath)=>!backendFederationPaths.has(logicalPath)).map((logicalPath)=>[
|
|
379
400
|
logicalPath,
|
|
380
401
|
'nodejs-deployment'
|
|
@@ -384,10 +405,27 @@ const createNodeStagedReleaseArtifactInputs = async (outputDirectory, identity)=
|
|
|
384
405
|
for (const logicalPath of apiBackendPaths)runtimeByPath.set(logicalPath, 'nodejs');
|
|
385
406
|
runtimeByPath.set(BACKEND_FEDERATION_MANIFEST_FILE, 'module-federation-manifest');
|
|
386
407
|
runtimeByPath.set(BACKEND_FEDERATION_REMOTE_ENTRY_FILE, 'nodejs');
|
|
408
|
+
const identityCarrierMetadata = await writeReleaseIdentityCarrierMetadata(outputDirectory, identity, {
|
|
409
|
+
apiBackend: apiBackendPaths,
|
|
410
|
+
backendFederation: [
|
|
411
|
+
BACKEND_FEDERATION_MANIFEST_FILE,
|
|
412
|
+
BACKEND_FEDERATION_REMOTE_ENTRY_FILE
|
|
413
|
+
],
|
|
414
|
+
ssr: [
|
|
415
|
+
...new Set([
|
|
416
|
+
...ssrExecutionPaths,
|
|
417
|
+
...ssrPaths.filter((logicalPath)=>'index.js' !== logicalPath)
|
|
418
|
+
])
|
|
419
|
+
],
|
|
420
|
+
uiClient: uiClientPaths.filter((logicalPath)=>COMPILED_MODULE_PATTERN.test(logicalPath))
|
|
421
|
+
});
|
|
387
422
|
return {
|
|
388
423
|
artifacts: [
|
|
389
|
-
...
|
|
390
|
-
|
|
424
|
+
...[
|
|
425
|
+
...runtimeByPath
|
|
426
|
+
].map(([logicalPath, runtime])=>releaseArtifact(logicalPath, runtime)),
|
|
427
|
+
identityCarrierMetadata
|
|
428
|
+
].sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath)),
|
|
391
429
|
surfaces: {
|
|
392
430
|
uiClient: [
|
|
393
431
|
...uiClientPaths
|
|
@@ -461,13 +499,7 @@ const createCloudflareStagedReleaseArtifactInputs = async (outputDirectory, iden
|
|
|
461
499
|
])if (!files.includes(logicalPath)) throw new Error(`[ultramodern-release-envelope] final Cloudflare staging is missing ${logicalPath}.`);
|
|
462
500
|
const clientExecutionPaths = await manifestReferencedClientModules(outputDirectory, files, 'public/mf-manifest.json');
|
|
463
501
|
const ssrExecutionPaths = await routeReferencedSsrModules(outputDirectory, files, 'cloudflare', 'server/route.json');
|
|
464
|
-
|
|
465
|
-
await assertEveryCompiledIdentityCarrier(outputDirectory, ssrExecutionPaths, identity, 'final route-referenced Cloudflare SSR');
|
|
466
|
-
await assertEveryCompiledIdentityCarrier(outputDirectory, ssrPaths.filter((logicalPath)=>logicalPath.startsWith('worker/')), identity, 'final compiled Cloudflare SSR/workerd closure');
|
|
467
|
-
await assertEveryCompiledIdentityCarrier(outputDirectory, apiBackendPaths, identity, 'final Cloudflare API/backend');
|
|
468
|
-
await assertEveryCompiledIdentityCarrier(outputDirectory, [
|
|
469
|
-
backendContainerPath
|
|
470
|
-
], identity, 'final Cloudflare backend Module Federation container');
|
|
502
|
+
if (0 === clientExecutionPaths.length || 0 === ssrExecutionPaths.length) throw new Error('[ultramodern-release-envelope] final Cloudflare manifests must reference emitted UI/client and SSR execution modules.');
|
|
471
503
|
const runtimeByPath = new Map();
|
|
472
504
|
for (const logicalPath of files)runtimeByPath.set(logicalPath, 'cloudflare-deployment');
|
|
473
505
|
const add = (paths, runtime)=>{
|
|
@@ -482,10 +514,27 @@ const createCloudflareStagedReleaseArtifactInputs = async (outputDirectory, iden
|
|
|
482
514
|
add([
|
|
483
515
|
backendContainerPath
|
|
484
516
|
], 'commonjs-module');
|
|
517
|
+
const identityCarrierMetadata = await writeReleaseIdentityCarrierMetadata(outputDirectory, identity, {
|
|
518
|
+
apiBackend: apiBackendPaths,
|
|
519
|
+
backendFederation: [
|
|
520
|
+
backendManifestPath,
|
|
521
|
+
backendContainerPath
|
|
522
|
+
],
|
|
523
|
+
ssr: [
|
|
524
|
+
...new Set([
|
|
525
|
+
...ssrExecutionPaths,
|
|
526
|
+
...ssrPaths.filter((logicalPath)=>logicalPath.startsWith('worker/'))
|
|
527
|
+
])
|
|
528
|
+
],
|
|
529
|
+
uiClient: uiClientPaths.filter((logicalPath)=>COMPILED_MODULE_PATTERN.test(logicalPath))
|
|
530
|
+
});
|
|
485
531
|
return {
|
|
486
532
|
artifacts: [
|
|
487
|
-
...
|
|
488
|
-
|
|
533
|
+
...[
|
|
534
|
+
...runtimeByPath
|
|
535
|
+
].map(([logicalPath, runtime])=>releaseArtifact(logicalPath, runtime)),
|
|
536
|
+
identityCarrierMetadata
|
|
537
|
+
].sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath)),
|
|
489
538
|
surfaces: {
|
|
490
539
|
uiClient: [
|
|
491
540
|
...uiClientPaths
|
|
@@ -522,4 +571,4 @@ const verifyCloudflareReleaseEnvelopeStaging = async (outputDirectory)=>readFram
|
|
|
522
571
|
expectedTarget: 'cloudflare',
|
|
523
572
|
required: true
|
|
524
573
|
});
|
|
525
|
-
export { MICROVERTICAL_RELEASE_ENVELOPE_PATH, emitCloudflareStagedReleaseEnvelope, emitFrameworkMicroVerticalReleaseEnvelope, emitNodeStagedReleaseEnvelope, readFrameworkMicroVerticalReleaseEnvelope, stageCloudflareReleaseEnvelope, verifyBuildOutputReleaseEnvelope, verifyCloudflareReleaseEnvelopeStaging, verifyNodeReleaseEnvelopeStaging };
|
|
574
|
+
export { MICROVERTICAL_RELEASE_ENVELOPE_PATH, MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH, emitCloudflareStagedReleaseEnvelope, emitFrameworkMicroVerticalReleaseEnvelope, emitNodeStagedReleaseEnvelope, readFrameworkMicroVerticalReleaseEnvelope, stageCloudflareReleaseEnvelope, verifyBuildOutputReleaseEnvelope, verifyCloudflareReleaseEnvelopeStaging, verifyNodeReleaseEnvelopeStaging };
|
|
@@ -1,5 +1,34 @@
|
|
|
1
|
+
import type { ModifyBundlerChainFn } from '@rsbuild/core';
|
|
1
2
|
import type { AppNormalizedConfig } from '../../types';
|
|
2
3
|
import type { AppToolsContext } from '../../types/plugin';
|
|
4
|
+
export declare function getCloudflareWorkerRspackConfig(workerEntryNames: Iterable<string>): {
|
|
5
|
+
readonly experiments: {
|
|
6
|
+
readonly outputModule: true;
|
|
7
|
+
};
|
|
8
|
+
readonly externals: {
|
|
9
|
+
[k: string]: string;
|
|
10
|
+
};
|
|
11
|
+
readonly externalsType: 'module-import';
|
|
12
|
+
readonly module: {
|
|
13
|
+
readonly parser: {
|
|
14
|
+
readonly javascript: {
|
|
15
|
+
readonly dynamicImportMode: 'eager';
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly optimization: {
|
|
20
|
+
readonly runtimeChunk: {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
};
|
|
23
|
+
readonly splitChunks: {
|
|
24
|
+
readonly chunks: 'all';
|
|
25
|
+
readonly minSize: 0;
|
|
26
|
+
readonly name: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare function applyCloudflareWorkerRspackConfig(chain: Parameters<ModifyBundlerChainFn>[0], workerEntryNames: Iterable<string>): void;
|
|
31
|
+
export declare function applyCloudflareWorkerMfRuntimeBoundary(chain: Parameters<ModifyBundlerChainFn>[0]): void;
|
|
3
32
|
export declare function getBuilderEnvironments(normalizedConfig: AppNormalizedConfig, appContext: AppToolsContext, tempBuilderConfig: Omit<AppNormalizedConfig, 'plugins'>): {
|
|
4
33
|
environments: Record<string, import("@rsbuild/core").EnvironmentConfig>;
|
|
5
34
|
builderConfig: Omit<AppNormalizedConfig, "plugins">;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface BundleDocsOptions {
|
|
2
|
+
/** Docs site build output (e.g. `doc_build`). */
|
|
3
|
+
source: string;
|
|
4
|
+
/** Directory to write the bundle to. */
|
|
5
|
+
target: string;
|
|
6
|
+
/** Index file to ship alongside the pages. */
|
|
7
|
+
indexFile?: string;
|
|
8
|
+
/** Top-level directories to skip. */
|
|
9
|
+
excludedDirs?: string[];
|
|
10
|
+
}
|
|
11
|
+
/** @returns files copied, or 0 when the source is absent */
|
|
12
|
+
export declare function bundleDocs({ source, target, indexFile, excludedDirs, }: BundleDocsOptions): number;
|
|
13
|
+
/**
|
|
14
|
+
* `modern-bundle-docs --source <doc_build> --target <pkg>/docs`; both default
|
|
15
|
+
* to this repo's layout.
|
|
16
|
+
*
|
|
17
|
+
* @param pkgRoot supplied by the bin shim — the compiled module cannot know
|
|
18
|
+
* its own package root portably across output formats.
|
|
19
|
+
*/
|
|
20
|
+
export declare function runBundleDocsCli(pkgRoot: string): void;
|
|
@@ -16,5 +16,5 @@ interface WorkerBundleVerificationContract {
|
|
|
16
16
|
workerRoot: string;
|
|
17
17
|
}
|
|
18
18
|
export declare const verifyWorkerBundleReferences: (issues: CloudflareOutputVerifierIssue[], worker: ResolvedWorkerBundleReference, source: string, contract: WorkerBundleVerificationContract) => Promise<void>;
|
|
19
|
-
export declare const verifyWorkerImport: (issues: CloudflareOutputVerifierIssue[], entryPath: string) => Promise<void>;
|
|
19
|
+
export declare const verifyWorkerImport: (issues: CloudflareOutputVerifierIssue[], entryPath: string, expectedManifest?: JsonObject) => Promise<void>;
|
|
20
20
|
export {};
|
package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const modernWorkerManifest: any;
|
package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.d.mts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workerd cannot initialize Module Federation's Node-oriented SSR data-fetch
|
|
3
|
+
* runtime. Cloudflare workers do not load native MF remotes, so retain the
|
|
4
|
+
* runtime-plugin contract without installing its server data-fetch hooks.
|
|
5
|
+
*/
|
|
6
|
+
export declare const injectDataFetchFunctionPlugin: () => {
|
|
7
|
+
name: string;
|
|
8
|
+
setup(): void;
|
|
9
|
+
};
|
|
10
|
+
export declare const mfSSRDevPlugin: () => {
|
|
11
|
+
name: string;
|
|
12
|
+
setup(): void;
|
|
13
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { MicroVerticalReleaseArtifact, MicroVerticalReleaseEnvelope, MicroVerticalReleaseTarget } from './types';
|
|
2
2
|
export declare const MICROVERTICAL_RELEASE_ENVELOPE_PATH = "release/microvertical-release-envelope.json";
|
|
3
|
+
export declare const MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH = "release/microvertical-release-identity-carriers.json";
|
|
3
4
|
export declare const emitFrameworkMicroVerticalReleaseEnvelope: ({ apiOnly, distDirectory, target, }: {
|
|
4
5
|
apiOnly: boolean;
|
|
5
6
|
distDirectory: string;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 1
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Commands
|
|
6
2
|
|
|
7
3
|
UltraModern.js has some built-in commands that can help you quickly start a development server, build production environment code, and more.
|
|
@@ -69,7 +65,7 @@ modern dev --entry foo,bar
|
|
|
69
65
|
|
|
70
66
|
## modern build
|
|
71
67
|
|
|
72
|
-
The `modern build` command will build production-ready artifacts in the `dist/` directory by default. You can specify the output directory by modifying the configuration [`output.distPath`](/configure/app/output/dist-path).
|
|
68
|
+
The `modern build` command will build production-ready artifacts in the `dist/` directory by default. You can specify the output directory by modifying the configuration [`output.distPath`](/configure/app/output/dist-path.md).
|
|
73
69
|
|
|
74
70
|
```bash
|
|
75
71
|
Usage: modern build [options]
|
|
@@ -134,9 +130,28 @@ The request body always includes `appName`, `reason`, and `phase`. It includes `
|
|
|
134
130
|
modern runtime fallback-signal --app crm-shell --reason remote_load_failed --phase load --json
|
|
135
131
|
```
|
|
136
132
|
|
|
137
|
-
|
|
133
|
+
## modern serve
|
|
134
|
+
|
|
135
|
+
The `modern serve` command is used to start an UltraModern.js project in the production environment. It can also be used to preview the artifacts built for the production environment locally. Please note that you need to execute the [`build`](/apis/app/commands.md#modern-build) command beforehand to generate the corresponding artifacts.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
Usage: modern serve [options]
|
|
139
|
+
|
|
140
|
+
Options:
|
|
141
|
+
-c --config <config> specify the configuration file, which can be a relative or absolute path
|
|
142
|
+
-h, --help show command help
|
|
143
|
+
--api-only only run API service
|
|
144
|
+
```
|
|
138
145
|
|
|
139
|
-
|
|
146
|
+
By default, the project will run in `localhost:8080`, you can modify the server port number with `server.port`:
|
|
147
|
+
|
|
148
|
+
```js
|
|
149
|
+
export default defineConfig({
|
|
150
|
+
server: {
|
|
151
|
+
port: 8081,
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
```
|
|
140
155
|
|
|
141
156
|
## modern inspect
|
|
142
157
|
|
|
@@ -200,6 +215,17 @@ Inspect config succeed, open following files to view the content:
|
|
|
200
215
|
- Modern.js Config: /root/my-project/dist/modern.js.config.mjs
|
|
201
216
|
```
|
|
202
217
|
|
|
203
|
-
|
|
218
|
+
## modern deploy
|
|
219
|
+
|
|
220
|
+
The `modern deploy` command is used to generate artifacts required for the deployment platform.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
Usage: modern deploy [options]
|
|
224
|
+
|
|
225
|
+
Options:
|
|
226
|
+
-c --config <config> Specify configuration file path, either relative or absolute
|
|
227
|
+
-s --skip-build Skip the build stage
|
|
228
|
+
-h, --help Display command help
|
|
229
|
+
```
|
|
204
230
|
|
|
205
|
-
|
|
231
|
+
For more details, refer to [Deploy Application](/guides/basic-features/deploy.md).
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
title: lambda/*.ts
|
|
3
|
-
sidebar_position: 3
|
|
4
|
-
---
|
|
5
|
-
# lambda/*.ts
|
|
1
|
+
# lambda/\*.ts
|
|
6
2
|
|
|
7
3
|
After enabling BFF, the files under the `lambda/` directory will be registered as BFF routes according to conventions.
|
|
8
4
|
|
|
@@ -10,4 +6,4 @@ After enabling BFF, the files under the `lambda/` directory will be registered a
|
|
|
10
6
|
The files can be written in `js` or `ts` languages, but they must use `esm` syntax to export functions.
|
|
11
7
|
:::
|
|
12
8
|
|
|
13
|
-
For detailed information, refer to [BFF API Routes](/guides/advanced-features/bff/function.
|
|
9
|
+
For detailed information, refer to [BFF API Routes](/guides/advanced-features/bff/function.md#api-routes).
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: favicon.*
|
|
3
|
-
sidebar_position: 3
|
|
4
|
-
---
|
|
5
|
-
|
|
6
1
|
# Favicon
|
|
7
2
|
|
|
8
|
-
When there is a `favicon.*` file in the `config` directory at the root of the project, Modern.js will automatically set the file to the [html.favicon](/configure/app/html/favicon) configuration option for generating the favicon icon on the page:
|
|
3
|
+
When there is a `favicon.*` file in the `config` directory at the root of the project, Modern.js will automatically set the file to the [html.favicon](/configure/app/html/favicon.md) configuration option for generating the favicon icon on the page:
|
|
9
4
|
|
|
10
5
|
```
|
|
11
6
|
./config
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: html/
|
|
3
|
-
sidebar_position: 1
|
|
4
|
-
---
|
|
5
1
|
# html/
|
|
6
2
|
|
|
7
3
|
You can inject custom HTML fragments at different locations of the default internal HTML template through the `config/html` directory.
|
|
8
4
|
|
|
9
|
-
For specific usage, please refer to: [Custom HTML](/guides/basic-features/html).
|
|
5
|
+
For specific usage, please refer to: [Custom HTML](/guides/basic-features/html.md).
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: icon.*
|
|
3
|
-
sidebar_position: 2
|
|
4
|
-
---
|
|
5
|
-
|
|
6
1
|
# Apple Touch Icon
|
|
7
2
|
|
|
8
|
-
When there is an `icon.*` file in the `config` directory at the root of the project, Modern.js will automatically set the file to the [html.appIcon](/configure/app/html/app-icon) configuration option for generating the Apple Touch Icon icon under the iOS system.
|
|
3
|
+
When there is an `icon.*` file in the `config` directory at the root of the project, Modern.js will automatically set the file to the [html.appIcon](/configure/app/html/app-icon.md) configuration option for generating the Apple Touch Icon icon under the iOS system.
|
|
9
4
|
|
|
10
5
|
```
|
|
11
6
|
./config
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: mock/
|
|
3
|
-
sidebar_position: 5
|
|
4
|
-
---
|
|
5
1
|
# mock/
|
|
6
2
|
|
|
7
3
|
When there is a `config/mock/index.ts` or `config/mock/index.js` file in the
|
|
8
4
|
project directory, Modern.js will automatically enable the Mock service during
|
|
9
|
-
development. Use [`dev.mockDir`](/configure/app/dev/mock-dir) to customize
|
|
5
|
+
development. Use [`dev.mockDir`](/configure/app/dev/mock-dir.md) to customize
|
|
10
6
|
this directory.
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: upload/
|
|
3
|
-
sidebar_position: 4
|
|
4
|
-
---
|
|
5
1
|
# upload/
|
|
6
2
|
|
|
7
3
|
Any static assets can be placed in the `upload/` directory.
|
|
@@ -26,7 +22,7 @@ If the file ends with `.min.js`, it will not be compressed.
|
|
|
26
22
|
|
|
27
23
|
## More Usage
|
|
28
24
|
|
|
29
|
-
In React components, you can add this prefix through [Environment Variables](/guides/basic-features/env-vars.
|
|
25
|
+
In React components, you can add this prefix through [Environment Variables](/guides/basic-features/env-vars.md#asset_prefix):
|
|
30
26
|
|
|
31
27
|
```tsx
|
|
32
28
|
export default () => {
|
|
@@ -36,13 +32,13 @@ export default () => {
|
|
|
36
32
|
};
|
|
37
33
|
```
|
|
38
34
|
|
|
39
|
-
In addition, whether it is in [Custom HTML](/guides/basic-features/html) or any HTML file under [`config/public/`](/apis/app/hooks/config/public), you can directly use HTML tags to reference resources in the `config/upload/` directory:
|
|
35
|
+
In addition, whether it is in [Custom HTML](/guides/basic-features/html.md) or any HTML file under [`config/public/`](/apis/app/hooks/config/public.md), you can directly use HTML tags to reference resources in the `config/upload/` directory:
|
|
40
36
|
|
|
41
37
|
```html
|
|
42
38
|
<script src="/upload/index.js"></script>
|
|
43
39
|
```
|
|
44
40
|
|
|
45
|
-
If you set the [`dev.assetPrefix`](/configure/app/dev/asset-prefix) or [`output.assetPrefix`](/configure/app/output/asset-prefix) prefix, you can also use template syntax to add the prefix directly:
|
|
41
|
+
If you set the [`dev.assetPrefix`](/configure/app/dev/asset-prefix.md) or [`output.assetPrefix`](/configure/app/output/asset-prefix.md) prefix, you can also use template syntax to add the prefix directly:
|
|
46
42
|
|
|
47
43
|
```html
|
|
48
44
|
<script src="<%=assetPrefix %>/upload/index.js"></script>
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: modern.config.ts
|
|
3
|
-
sidebar_position: 8
|
|
4
|
-
---
|
|
5
1
|
# modern.config.ts
|
|
6
2
|
|
|
7
3
|
The Modern.js configuration file. Through this file, you can personalize the configuration of various aspects of the current project.
|
|
8
4
|
|
|
9
|
-
To learn more about how to use the configuration, please refer to [Configuration Usage](/configure/app/usage).
|
|
5
|
+
To learn more about how to use the configuration, please refer to [Configuration Usage](/configure/app/usage.md).
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: modern.server.ts
|
|
3
|
-
sidebar_position: 1
|
|
4
|
-
---
|
|
5
|
-
|
|
6
1
|
# modern.server.ts
|
|
7
2
|
|
|
8
|
-
This file extends the Modern.js Server. In this file, you can configure [Middleware](/guides/advanced-features/web-server.
|
|
3
|
+
This file extends the Modern.js Server. In this file, you can configure [Middleware](/guides/advanced-features/web-server.md#middleware), [RenderMiddleware](/guides/advanced-features/web-server.md#rendermiddleware), or [Plugin](/guides/advanced-features/web-server.md#plugin) for the Server that starts with the Modern.js project.
|
|
9
4
|
|
|
10
5
|
You can intercept and handle requests and responses, perform authentication and role checks, preprocess requests, and handle exceptions, etc. You can also insert specific business logic into the built-in processing logic (including route matching, resource addressing, header injection, page rendering, and static web hosting).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# App.tsx
|
|
2
2
|
|
|
3
|
-
The entry identifier when using [Self-controlled Routing](/guides/concept/entries.
|
|
3
|
+
The entry identifier when using [Self-controlled Routing](/guides/concept/entries.md#self-controlled-routing) in the application.
|
|
4
4
|
|
|
5
5
|
`App.tsx` is not the actual application entry; Modern.js will automatically generate the real entry file, which is roughly as follows:
|
|
6
6
|
|
|
@@ -26,5 +26,5 @@ render(<ModernRoot />, 'root');
|
|
|
26
26
|
When `createRoot` is executed, it will retrieve the registered Global App and generate the actual React component.
|
|
27
27
|
|
|
28
28
|
:::note
|
|
29
|
-
In scenarios with multiple entry points, each entry can have its own independent `App.tsx`. For more details, see [Entry Points](/guides/concept/entries).
|
|
29
|
+
In scenarios with multiple entry points, each entry can have its own independent `App.tsx`. For more details, see [Entry Points](/guides/concept/entries.md).
|
|
30
30
|
:::
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: entry.ts
|
|
3
|
-
sidebar_position: 4
|
|
4
|
-
---
|
|
5
|
-
|
|
6
1
|
# entry.tsx
|
|
7
2
|
|
|
8
|
-
Normally, the [`routes/`](/apis/app/hooks/src/routes.
|
|
3
|
+
Normally, the [`routes/`](/apis/app/hooks/src/routes.md) and [`App.tsx`](/apis/app/hooks/src/app.md) hook files can meet our needs. When we need to add custom behavior before component rendering or take full control of the Rspack packaging entry, we can create `entry.ts` file in the src or entry directory. Here are two cases for discussion。
|
|
9
4
|
|
|
10
5
|
## Add custom behavior before Render
|
|
11
6
|
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: modern.runtime.ts
|
|
3
|
-
sidebar_position: 4
|
|
4
|
-
---
|
|
5
1
|
# modern.runtime.ts
|
|
6
2
|
|
|
7
3
|
The Modern.js Runtime configuration file allows for personalized configuration of the Runtime capabilities for the current project.
|
|
8
4
|
|
|
9
|
-
For specific usage of the configuration, please refer to [Runtime Configuration](/configure/app/runtime/0-intro.
|
|
5
|
+
For specific usage of the configuration, please refer to [Runtime Configuration](/configure/app/runtime/0-intro.md).
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: routes/
|
|
3
|
-
sidebar_position: 2
|
|
4
|
-
---
|
|
5
1
|
# routes/
|
|
6
2
|
|
|
7
|
-
The identifier for the entry point when the application uses [Conventional Routing](/guides/basic-features/routes/routes#conventional-routing).
|
|
3
|
+
The identifier for the entry point when the application uses [Conventional Routing](/guides/basic-features/routes/routes.md#conventional-routing).
|
|
8
4
|
|
|
9
5
|
Conventional routing uses `routes/` as the convention for the entry point and analyzes the files in the `src/routes` directory to obtain the client-side routing configuration.
|
|
10
6
|
|
|
@@ -52,9 +48,9 @@ If the directory name of the route file is named with `[]`, the generated route
|
|
|
52
48
|
|
|
53
49
|
The `routes/[id]/page.tsx` file will be converted to the `/:id` route. Except for the `/blog` route that can be matched exactly, all other `/xxx` routes will be matched to this route.
|
|
54
50
|
|
|
55
|
-
In the component, you can use [useParams](/apis/app/runtime/router/router#useparams) to obtain the corresponding named parameter.
|
|
51
|
+
In the component, you can use [useParams](/apis/app/runtime/router/router.md#useparams) to obtain the corresponding named parameter.
|
|
56
52
|
|
|
57
|
-
When using the [loader](/guides/basic-features/data/data-fetch#the-loader-function) function to obtain data, `params` will be passed as an input parameter to the `loader` function, and the corresponding parameter can be obtained through the attribute of `params`.
|
|
53
|
+
When using the [loader](/guides/basic-features/data/data-fetch.md#the-loader-function) function to obtain data, `params` will be passed as an input parameter to the `loader` function, and the corresponding parameter can be obtained through the attribute of `params`.
|
|
58
54
|
|
|
59
55
|
## Layout Component
|
|
60
56
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
title: '*.[server|node].tsx'
|
|
3
|
-
sidebar_position: 8
|
|
4
|
-
---
|
|
5
|
-
# *.[server|node].tsx
|
|
1
|
+
# \*.\[server|node].tsx
|
|
6
2
|
|
|
7
3
|
Used in the application project to place server-side code. When `*.tsx` and `*.[server|node].tsx` coexist, SSR will prefer to use the `*.[server|node].tsx` file instead of the `*.tsx` file when rendering on the server.
|