@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.99 → 3.8.1-ultramodern.1
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,49 +0,0 @@
|
|
|
1
|
-
To enable SSG functionality in a Modern.js project, follow these steps to modify the code:
|
|
2
|
-
|
|
3
|
-
1. Install SSG plugin dependencies
|
|
4
|
-
|
|
5
|
-
If the SSG plugin is not yet installed in your project, install it first:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm add @modern-js/plugin-ssg
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
:::tip Version Consistency
|
|
12
|
-
|
|
13
|
-
Make sure the version of `@modern-js/plugin-ssg` matches the version of `@modern-js/app-tools` in your project. All Modern.js official packages are released with a uniform version number, and version mismatches may cause compatibility issues.
|
|
14
|
-
|
|
15
|
-
Check the version of `@modern-js/app-tools` first, then install the same version of `@modern-js/plugin-ssg`:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# Check the current version of @modern-js/app-tools
|
|
19
|
-
pnpm list @modern-js/app-tools
|
|
20
|
-
|
|
21
|
-
# Install the same version of @modern-js/plugin-ssg
|
|
22
|
-
pnpm add @modern-js/plugin-ssg@<version>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
:::
|
|
26
|
-
|
|
27
|
-
2. Configure modern.config.ts
|
|
28
|
-
|
|
29
|
-
Import and add the SSG plugin in the `modern.config.ts` file, and configure `output.ssg`:
|
|
30
|
-
|
|
31
|
-
```ts title="modern.config.ts"
|
|
32
|
-
import { defineConfig, appTools } from '@modern-js/app-tools';
|
|
33
|
-
import { ssgPlugin } from '@modern-js/plugin-ssg';
|
|
34
|
-
|
|
35
|
-
export default defineConfig({
|
|
36
|
-
plugins: [appTools(), ssgPlugin()],
|
|
37
|
-
output: {
|
|
38
|
-
ssg: true,
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
:::info Scope of Application
|
|
44
|
-
|
|
45
|
-
- Use `output.ssg` for single-entry apps.
|
|
46
|
-
- Use `output.ssgByEntries` for multi-entry apps.
|
|
47
|
-
- When only `output.ssg: true` is set and `output.ssgByEntries` is not configured, all routes under all entries will be treated as SSG routes.
|
|
48
|
-
|
|
49
|
-
:::
|
|
File without changes
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
:::tip Entry scanning logic
|
|
2
|
-
- If `src/` itself meets entry criteria → Single-entry application
|
|
3
|
-
- If `src/` does not meet criteria → Scan subdirectories under `src/` → Multi-entry application
|
|
4
|
-
- In single-entry applications, the default entry name is `index`
|
|
5
|
-
|
|
6
|
-
:::
|
|
7
|
-
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
The standard BFF function writing method may not always meet your needs. For example, complex TS type requirements in business scenarios. Modern.js provides a more powerful BFF function writing method.
|
|
2
|
-
|
|
3
|
-
For more details, please refer to - [Creating Extensible BFF Functions](/guides/advanced-features/bff/operators).
|
package/docs/components/hono.mdx
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
### Getting Request Context
|
|
2
|
-
|
|
3
|
-
Sometimes in BFF functions, it's necessary to obtain the request context to handle more logic. In such cases, you can use `useHonoContext` to get it:
|
|
4
|
-
|
|
5
|
-
```ts title="api/lambda/hello.ts"
|
|
6
|
-
import { useHonoContext } from '@modern-js/server-runtime';
|
|
7
|
-
|
|
8
|
-
export const get = async () => {
|
|
9
|
-
const c = useHonoContext();
|
|
10
|
-
console.info(`access url: ${c.req.url}`);
|
|
11
|
-
return 'Hello Modern.js';
|
|
12
|
-
};
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
:::info
|
|
16
|
-
For more details, refer to [useHonoContext](/apis/app/runtime/bff/use-backend-context).
|
|
17
|
-
:::
|
|
18
|
-
|
|
19
|
-
### Getting Cookies
|
|
20
|
-
|
|
21
|
-
When getting cookies in BFF functions, you need to get the request context through `useHonoContext`, then use `c.req.header('cookie')` to get the Cookie string and parse it manually:
|
|
22
|
-
|
|
23
|
-
```ts title="api/lambda/cookies.ts"
|
|
24
|
-
import { Api, Get } from '@modern-js/plugin-bff/hono-server';
|
|
25
|
-
import { useHonoContext } from '@modern-js/server-runtime';
|
|
26
|
-
|
|
27
|
-
// Helper function to parse Cookie string
|
|
28
|
-
function parseCookies(
|
|
29
|
-
cookieHeader: string | undefined,
|
|
30
|
-
): Record<string, string> {
|
|
31
|
-
const cookies: Record<string, string> = {};
|
|
32
|
-
if (!cookieHeader) return cookies;
|
|
33
|
-
|
|
34
|
-
cookieHeader.split(';').forEach(cookie => {
|
|
35
|
-
const [name, ...rest] = cookie.trim().split('=');
|
|
36
|
-
if (name) {
|
|
37
|
-
cookies[name] = rest.join('=');
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
return cookies;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const getCookies = Api(Get('/cookies'), async () => {
|
|
45
|
-
const c = useHonoContext();
|
|
46
|
-
const cookieHeader = c.req.header('cookie');
|
|
47
|
-
const cookies = parseCookies(cookieHeader);
|
|
48
|
-
const token = cookies.token;
|
|
49
|
-
const sessionId = cookies.sessionId;
|
|
50
|
-
return {
|
|
51
|
-
hasToken: !!token,
|
|
52
|
-
token: token || null,
|
|
53
|
-
sessionId: sessionId || null,
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
:::caution Note
|
|
59
|
-
The `c.req.cookie()` method does not exist in the current version. You need to use `c.req.header('cookie')` to get the Cookie string and parse it manually.
|
|
60
|
-
:::
|
|
61
|
-
|
|
62
|
-
### Defining BFF Functions
|
|
63
|
-
|
|
64
|
-
When using Hono as the runtime framework, you can define interfaces through [Api functions](/guides/advanced-features/bff/operators.html):
|
|
65
|
-
|
|
66
|
-
```ts title="api/lambda/user.ts"
|
|
67
|
-
import { Api, Get, Query } from '@modern-js/plugin-bff/hono-server';
|
|
68
|
-
import { z } from 'zod';
|
|
69
|
-
|
|
70
|
-
const QuerySchema = z.object({
|
|
71
|
-
id: z.string(),
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
export const getUser = Api(
|
|
75
|
-
Get('/user'),
|
|
76
|
-
Query(QuerySchema),
|
|
77
|
-
async ({ query }) => {
|
|
78
|
-
return {
|
|
79
|
-
id: query.id,
|
|
80
|
-
name: 'Modern.js',
|
|
81
|
-
email: 'modernjs@bytedance.com',
|
|
82
|
-
};
|
|
83
|
-
},
|
|
84
|
-
);
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
:::info
|
|
88
|
-
For more details about Api functions and operators, refer to [Creating Extensible BFF Functions](/guides/advanced-features/bff/operators.html).
|
|
89
|
-
:::
|
|
90
|
-
|
|
91
|
-
### Using Middleware
|
|
92
|
-
|
|
93
|
-
Hono supports a rich middleware ecosystem, and you can use middleware in BFF functions:
|
|
94
|
-
|
|
95
|
-
```ts title="api/lambda/user.ts"
|
|
96
|
-
import { Api, Get, Middleware } from '@modern-js/plugin-bff/hono-server';
|
|
97
|
-
|
|
98
|
-
export const getUser = Api(
|
|
99
|
-
Get('/user'),
|
|
100
|
-
Middleware(async (c, next) => {
|
|
101
|
-
// You can access Hono's Context in middleware
|
|
102
|
-
c.res.headers.set('X-Powered-By', 'Modern.js');
|
|
103
|
-
await next();
|
|
104
|
-
}),
|
|
105
|
-
async () => {
|
|
106
|
-
return {
|
|
107
|
-
name: 'Modern.js',
|
|
108
|
-
email: 'modernjs@bytedance.com',
|
|
109
|
-
};
|
|
110
|
-
},
|
|
111
|
-
);
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
:::info
|
|
115
|
-
For more details about middleware, refer to [Creating Extensible BFF Functions](/guides/advanced-features/bff/operators.html#middleware).
|
|
116
|
-
:::
|
|
117
|
-
|
|
118
|
-
### More Hono Documentation
|
|
119
|
-
|
|
120
|
-
For more detailed information about Hono, please refer to the [Hono official documentation](https://hono.dev/).
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
UltraModern.js provides the BleedingDev create package to create SuperApp
|
|
2
|
-
workspaces. It does not require global installation and can be run on-demand
|
|
3
|
-
using `pnpm dlx`.
|
|
4
|
-
|
|
5
|
-
The supported pnpm command is the scoped package specifier:
|
|
6
|
-
`pnpm dlx @bleedingdev/modern-js-create <target>`. Do not shorten it to
|
|
7
|
-
`pnpm dlx modern-js-create`; there is no unscoped package by that name.
|
|
8
|
-
|
|
9
|
-
You can initialize the empty directory you are already in:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
mkdir myapp && cd myapp
|
|
13
|
-
pnpm dlx @bleedingdev/modern-js-create .
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
You can also create a project directly in a new directory:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
pnpm dlx @bleedingdev/modern-js-create my-super-app
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
To initialize with workspace protocol dependencies (for local monorepo testing of unreleased Modern.js packages):
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pnpm dlx @bleedingdev/modern-js-create my-super-app --workspace
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
The BleedingDev create package will directly create the application without providing an interactive Q & A interface:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
🚀 Welcome to UltraModern.js
|
|
32
|
-
|
|
33
|
-
📦 Creating project "my-super-app"...
|
|
34
|
-
|
|
35
|
-
✨ Project created successfully! 🎉
|
|
36
|
-
|
|
37
|
-
📋 Next, you can run the following commands:
|
|
38
|
-
|
|
39
|
-
📁 Enter the project directory:
|
|
40
|
-
|
|
41
|
-
cd my-super-app
|
|
42
|
-
|
|
43
|
-
🔧 Initialize Git repository:
|
|
44
|
-
|
|
45
|
-
git init
|
|
46
|
-
|
|
47
|
-
📥 Install project dependencies:
|
|
48
|
-
|
|
49
|
-
pnpm install
|
|
50
|
-
|
|
51
|
-
⚡ Start the development server:
|
|
52
|
-
|
|
53
|
-
pnpm start
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Now, the project structure is as follows:
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
.
|
|
60
|
-
├── apps
|
|
61
|
-
│ └── shell-super-app
|
|
62
|
-
├── package.json
|
|
63
|
-
├── packages
|
|
64
|
-
│ ├── shared-contracts
|
|
65
|
-
│ ├── shared-design-tokens
|
|
66
|
-
│ └── shared-effect-client
|
|
67
|
-
├── scripts
|
|
68
|
-
├── topology
|
|
69
|
-
└── verticals
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
The default workspace starts shell-only and installs the published BleedingDev
|
|
73
|
-
package aliases:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
pnpm dlx @bleedingdev/modern-js-create my-super-app
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
From a generated SuperApp workspace, add a business MicroVertical in place:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
pnpm dlx @bleedingdev/modern-js-create transportation --vertical
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
The `--vertical` command mutates the current workspace: it adds the vertical
|
|
86
|
-
package and wires topology, ownership metadata, shell Module Federation,
|
|
87
|
-
development overlays, package dependencies, generated contracts, route-owned
|
|
88
|
-
i18n, CSS isolation, and the Effect BFF/client surface.
|
|
89
|
-
|
|
90
|
-
The lower-level `--ultramodern-package-*` flags are reserved for release
|
|
91
|
-
engineering and local package-source testing. BleedingDev packages are published
|
|
92
|
-
through GitHub Actions trusted publishing; do not publish them manually from a
|
|
93
|
-
developer machine.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
In Modern.js, metric events are also handled by `LoggerMonitor`, which outputs metrics to the console in a specific format.
|
|
2
|
-
|
|
3
|
-
:::info
|
|
4
|
-
The built-in `LoggerMonitor` depends on the [rslog](https://www.npmjs.com/package/rslog) library.
|
|
5
|
-
:::
|
|
6
|
-
|
|
7
|
-
The `rslog` instance initialized in Modern.js outputs logs at `debug` level and above in development environment by default, and outputs all logs in production environment. In the built-in `LoggerMonitor`, all metric events are output as Debug logs. Therefore, if you want to view metric event information in the development environment, you need to add additional environment variables.
|
|
8
|
-
|
|
9
|
-
Developers can add the environment variable `DEBUG=true` when running the `dev` command. If running normally, after accessing, you can see the following output in the console:
|
|
10
|
-
|
|
11
|
-
```shell
|
|
12
|
-
> Local: http://localhost:8080/
|
|
13
|
-
> press h + enter to show shortcuts
|
|
14
|
-
|
|
15
|
-
debug SSR Debug - server-loader, cost: 2.000094, req.url = /
|
|
16
|
-
debug SSR Debug - ssr-prerender, cost: 6.99997, req.url = /
|
|
17
|
-
debug SSR Debug - ssr-render-html, cost: 0.999927, req.url = /
|
|
18
|
-
debug Debug - server-handle-request, cost: 19.999981, req.url = /
|
|
19
|
-
debug --> GET / 200 90ms
|
|
20
|
-
```
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
```ts
|
|
2
|
-
import { defineRuntimeConfig } from '@modern-js/runtime';
|
|
3
|
-
import i18next from 'i18next';
|
|
4
|
-
|
|
5
|
-
// Create custom instance
|
|
6
|
-
const customI18n = i18next.createInstance({
|
|
7
|
-
// Custom configuration
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export default defineRuntimeConfig({
|
|
11
|
-
i18n: {
|
|
12
|
-
i18nInstance: customI18n,
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
```
|
|
16
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
All [i18next initialization options](https://www.i18next.com/overview/configuration-options) are supported. Common options are described below:
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
`i18next` and `react-i18next` are **Peer Dependencies** and must be installed manually.
|
|
2
|
-
|
|
3
|
-
:::note Version consistency
|
|
4
|
-
`@modern-js/plugin-i18n` should use the same version as `@modern-js/app-tools` in your project.
|
|
5
|
-
:::
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm list @modern-js/app-tools
|
|
9
|
-
pnpm add @modern-js/plugin-i18n@<version> i18next react-i18next
|
|
10
|
-
```
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Create `src/modern.runtime.ts`:
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { defineRuntimeConfig } from '@modern-js/runtime';
|
|
5
|
-
import i18next from 'i18next';
|
|
6
|
-
|
|
7
|
-
// i18next exports a global singleton by default, which can cause multiple apps to affect each other.
|
|
8
|
-
// createInstance() creates an isolated instance so each app has independent language state.
|
|
9
|
-
const i18nInstance = i18next.createInstance();
|
|
10
|
-
|
|
11
|
-
export default defineRuntimeConfig({
|
|
12
|
-
i18n: {
|
|
13
|
-
i18nInstance,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
```
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
`@modern-js/plugin-i18n` is the internationalization plugin for Modern.js, built on [i18next](https://www.i18next.com/) and [react-i18next](https://react.i18next.com/).
|
|
2
|
-
|
|
3
|
-
- **The plugin itself**: Integrates with the Modern.js framework, including SSR language passing, route prefix handling, and more.
|
|
4
|
-
- **i18next**: Provides core translation capabilities, such as the `t()` function, interpolation, plurals, and namespaces.
|
|
5
|
-
- **react-i18next**: Provides React components and Hooks, such as `useTranslation`, to integrate translations with the React lifecycle.
|
|
File without changes
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
Micro-frontend (MFE) is an architecture style similar to microservices. It is a composition of multiple independently delivered frontend applications, forming a cohesive whole. MFE decomposes frontend applications into smaller, simpler applications that can be developed, tested, and deployed independently while still appearing as a cohesive single product to users.
|
|
2
|
-
|
|
3
|
-
It primarily addresses two problems:
|
|
4
|
-
|
|
5
|
-
- Difficulty in maintaining large and complex applications as they evolve over time.
|
|
6
|
-
- Inefficiency caused by cross-team or cross-department collaboration in project development.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
## manifest
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
interface Manifest {
|
|
5
|
-
getAppList?: () => Array<AppInfo>;
|
|
6
|
-
}
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
### getAppList?
|
|
10
|
-
|
|
11
|
-
Through the `getAppList` configuration, you can customize how to get remote list data
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
type GetAppList = () => Promise<Array<AppInfo>>;
|
|
15
|
-
```
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
```ts title="src/modern.runtime.ts"
|
|
2
|
-
import { defineRuntimeConfig } from '@modern-js/runtime';
|
|
3
|
-
|
|
4
|
-
export default defineRuntimeConfig({
|
|
5
|
-
masterApp: {
|
|
6
|
-
apps: [{
|
|
7
|
-
name: 'Table',
|
|
8
|
-
entry: 'http://localhost:8081',
|
|
9
|
-
// activeWhen: '/table'
|
|
10
|
-
}, {
|
|
11
|
-
name: 'Dashboard',
|
|
12
|
-
entry: 'http://localhost:8082'
|
|
13
|
-
// activeWhen: '/dashboard'
|
|
14
|
-
}]
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
```
|
|
File without changes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
Before getting started, you will need to install [Node.js](https://nodejs.org/), and ensure that your Node.js version is not lower than v20.19.5. **We recommend using the LTS version of Node.js 22.**
|
|
2
|
-
|
|
3
|
-
You can check the currently used Node.js version with the following command:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
node -v
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
If you do not have Node.js installed in your current environment, or the installed version is lower than v20.19.5, you can use [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) to install the required version.
|
|
10
|
-
|
|
11
|
-
Here is an example of how to install the Node.js 22 LTS version via nvm:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
# Install the long-term support version of Node.js 22
|
|
15
|
-
nvm install 22 --lts
|
|
16
|
-
|
|
17
|
-
# Make the newly installed Node.js 22 as the default version
|
|
18
|
-
nvm alias default 22
|
|
19
|
-
|
|
20
|
-
# Switch to the newly installed Node.js 22
|
|
21
|
-
nvm use 22
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
:::tip nvm and fnm
|
|
25
|
-
Both nvm and fnm are Node.js version management tools. Relatively speaking, nvm is more mature and stable, while fnm is implemented using Rust, which provides better performance than nvm.
|
|
26
|
-
:::
|
|
27
|
-
|
|
28
|
-
Additionally, after installing nvm or fnm, when there is a `.nvmrc` file containing `lts/jod` in the repository's root directory, the system will automatically install or switch to the correct Node.js version upon entering the repository.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Modern.js also provides a runtime Polyfill solution based on browser [UA](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/User-Agent) information. For detailed usage instructions, please refer to [Polyfill At Runtime](https://modernjs.dev/en/guides/advanced-features/compatibility.html#polyfill-at-runtime).
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
### Node.js
|
|
2
|
-
|
|
3
|
-
import NodeVersion from '@site-docs-en/components/nodeVersion.mdx';
|
|
4
|
-
|
|
5
|
-
<NodeVersion />
|
|
6
|
-
|
|
7
|
-
### pnpm
|
|
8
|
-
|
|
9
|
-
It is recommended to use [pnpm](https://pnpm.io/installation) to manage dependencies:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
mise use pnpm@11.17.0
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
:::note
|
|
16
|
-
Modern.js also supports dependency management with `yarn` and `npm`.
|
|
17
|
-
|
|
18
|
-
:::
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
According to the [Release Note](https://github.com/web-infra-dev/modern.js/releases) on the official website, developers can also manually upgrade the project to the desired version.
|
|
File without changes
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
[Rsbuild](https://v2.rsbuild.rs/) is an Rspack-based build tool for the web. The main goal of Rsbuild is to provide out-of-the-box build capabilities for Rspack users, allowing developers to start a web project with zero configuration.
|
|
2
|
-
|
|
3
|
-
Rsbuild integrates high-performance Rust-based tools from the community, including Rspack and SWC, to provide first-class build speed and development experience.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
[Rspack](https://rspack.rs/) is a high performance JavaScript bundler written in Rust. It offers strong compatibility with the webpack ecosystem, allowing for seamless replacement of webpack, and provides lightning fast build speeds.
|
|
2
|
-
|
|
3
|
-
Compared to webpack, Rspack has significantly improved build performance, thanks not only to the language advantages brought by Rust, but also to its parallel architecture and incremental compilation features. Benchmarking has shown that Rspack can provide 5-10 times better compilation performance.
|
|
File without changes
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
## modern serve
|
|
2
|
-
|
|
3
|
-
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#modern-build) command beforehand to generate the corresponding artifacts.
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
Usage: modern serve [options]
|
|
7
|
-
|
|
8
|
-
Options:
|
|
9
|
-
-c --config <config> specify the configuration file, which can be a relative or absolute path
|
|
10
|
-
-h, --help show command help
|
|
11
|
-
--api-only only run API service
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
By default, the project will run in `localhost:8080`, you can modify the server port number with `server.port`:
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
export default defineConfig({
|
|
18
|
-
server: {
|
|
19
|
-
port: 8081,
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
```
|
|
File without changes
|
package/docs/components/swc.mdx
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
[SWC](https://SWC.rs/) (Speedy Web Compiler) is a transformer and minimizer for JavaScript and TypeScript based on `Rust`. SWC can provide the same abilities with Babel, and it's more than 10x faster than Babel.
|
|
2
|
-
|
|
3
|
-
Modern.js has a out-of-box plugin for SWC, power your Web application with Polyfill and minification, we also port some common used Babel plugins to SWC.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Modern.js Server uses [Hono.js](https://hono.dev/) as the server runtime framework. For BFF, `bff.runtimeFramework` defaults to `effect`, while `hono` remains an explicit compatibility runtime. Effect and Hono BFF runtimes are strict modes (no implicit fallback). You can extend the Server based on the Hono.js ecosystem; refer to [Custom Web Server](/guides/advanced-features/web-server.html).
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
### Polyfill At Runtime
|
|
2
|
-
|
|
3
|
-
Modern.js also provides a runtime Polyfill solution based on browser [UA](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/User-Agent) information, which has the following advantages over Babel:
|
|
4
|
-
|
|
5
|
-
- It will not be inserted into the code, and only delivers Polyfill code on-demand based on the device accessing the page, reducing the overall code size.
|
|
6
|
-
- The same browser will share a Polyfill code. Therefore, with more and more projects, the UA-based Polyfill code will be delivered faster and faster, with overall speed exceeding conventional solutions.
|
|
7
|
-
|
|
8
|
-
Modern.js provides the `@modern-js/plugin-polyfill` plugin to implement this feature. You can enable it by installing the plugin:
|
|
9
|
-
|
|
10
|
-
import { PackageManagerTabs } from '@theme';
|
|
11
|
-
|
|
12
|
-
<PackageManagerTabs
|
|
13
|
-
command={{
|
|
14
|
-
npm: 'npm install @modern-js/plugin-polyfill',
|
|
15
|
-
yarn: 'yarn add @modern-js/plugin-polyfill',
|
|
16
|
-
pnpm: 'pnpm add @modern-js/plugin-polyfill',
|
|
17
|
-
}}
|
|
18
|
-
/>
|
|
19
|
-
|
|
20
|
-
Then register the Polyfill plugin in `modern.config.ts`:
|
|
21
|
-
|
|
22
|
-
```ts title="modern.config.ts"
|
|
23
|
-
import { polyfillPlugin } from '@modern-js/plugin-polyfill';
|
|
24
|
-
|
|
25
|
-
export default defineConfig({
|
|
26
|
-
plugins: [..., polyfillPlugin()],
|
|
27
|
-
});
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
After configuring `output.polyfill` as `ua` and executing `pnpm run build && pnpm run serve` to start the server, visiting the page can see that the HTML artifacts contains the following script:
|
|
31
|
-
|
|
32
|
-
```js
|
|
33
|
-
<script src="/__polyfill__" crossorigin></script>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
When accessing the page on Chrome 51, you can see the content returned by `http://localhost:8080/__polyfill__` as follows:
|
|
37
|
-
|
|
38
|
-

|
|
39
|
-
|
|
40
|
-
:::caution
|
|
41
|
-
This feature only works when using Modern.js built-in Web Server.
|
|
42
|
-
|
|
43
|
-
If you need to customize the HTML template, please refer to [HTML Template](/guides/basic-features/html.html). Manually modifying the template through `html.template` or `tools.html` may cause this feature to not work correctly.
|
|
44
|
-
:::
|
|
File without changes
|
|
File without changes
|
|
File without changes
|