@wular/pnext 0.0.4 → 0.0.6
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/README.md +11 -11
- package/bin/pnext +1 -1
- package/config/lint/base.js +7 -7
- package/config/ts/base.json +2 -4
- package/config/ts/react.json +2 -6
- package/package.json +23 -2
- package/reference/compat.md +1 -1
- package/reference/config.md +2 -2
- package/reference/css.md +13 -9
- package/reference/dev.md +1 -1
- package/reference/metadata.md +7 -7
- package/reference/navigation.md +35 -28
- package/reference/performance.md +70 -70
- package/reference/rendering.md +17 -17
- package/reference/routing.md +17 -17
- package/reference/typegen.md +12 -8
- package/src/api/cache.ts +36 -37
- package/src/api/client-cache.ts +2 -2
- package/src/api/client-navigation.ts +113 -109
- package/src/api/dynamic.tsx +58 -55
- package/src/api/link.tsx +49 -52
- package/src/api/navigation.ts +59 -58
- package/src/api/server.ts +152 -144
- package/src/api/suspense.ts +4 -4
- package/src/cli/adapters/vercel-warm.ts +126 -121
- package/src/cli/adapters/vercel.ts +437 -443
- package/src/cli/analyze.ts +333 -144
- package/src/cli/{named-bin.ts → boot/named-bin.ts} +37 -37
- package/src/cli/{boot-trace.ts → boot/trace.ts} +10 -10
- package/src/cli/build.ts +976 -978
- package/src/cli/create.ts +71 -63
- package/src/cli/dev.ts +116 -116
- package/src/cli/index.ts +88 -85
- package/src/cli/migrate/package-json.ts +73 -71
- package/src/cli/migrate/report.ts +32 -33
- package/src/cli/migrate/{index.ts → run.ts} +48 -49
- package/src/cli/migrate/scan.ts +46 -46
- package/src/cli/migrate/spinner.ts +9 -9
- package/src/cli/migrate/tsconfig.ts +35 -35
- package/src/cli/{server-entry.ts → serve/entry.ts} +57 -57
- package/src/cli/{request-pipeline.ts → serve/pipeline.ts} +386 -394
- package/src/cli/{serve-ui.ts → serve/ui.ts} +47 -47
- package/src/cli/start.ts +65 -66
- package/src/{typegen.ts → cli/typegen.ts} +59 -59
- package/src/client/build.ts +794 -768
- package/src/client/chunk-fold.ts +245 -240
- package/src/client/{paths.ts → chunk-name.ts} +6 -6
- package/src/client/entry.ts +162 -147
- package/src/client/prebuilt.ts +231 -223
- package/src/client/profile.ts +29 -29
- package/src/client/react-compiler.ts +20 -15
- package/src/client/{compat-surface.ts → react-tier.ts} +64 -64
- package/src/client/reference-stub.ts +51 -51
- package/src/client/reference.ts +19 -19
- package/src/{api → client}/router/events.ts +17 -17
- package/src/{api → client}/router/history.ts +16 -16
- package/src/{api → client}/router/hub.ts +52 -53
- package/src/{api/router.ts → client/router/index.ts} +61 -60
- package/src/{api → client}/router/policies.ts +24 -24
- package/src/{api → client}/router/runtime.ts +1988 -1992
- package/src/{api → client}/router/types.ts +93 -98
- package/src/compat/actions/client-plugin.ts +42 -43
- package/src/compat/actions/client-stub.ts +14 -14
- package/src/compat/actions/{action-client.ts → client.ts} +194 -193
- package/src/compat/actions/config.ts +63 -64
- package/src/compat/actions/detect.ts +68 -68
- package/src/compat/actions/discovery.ts +105 -105
- package/src/compat/actions/{action-dispatch.ts → dispatch.ts} +277 -274
- package/src/compat/actions/early-submit.ts +1 -1
- package/src/compat/actions/endpoint.ts +198 -198
- package/src/compat/actions/extensions.ts +811 -0
- package/src/compat/actions/flight.ts +23 -23
- package/src/compat/actions/form-state.ts +34 -34
- package/src/compat/actions/hoist.ts +382 -236
- package/src/compat/actions/ids.ts +7 -12
- package/src/compat/actions/index.ts +8 -8
- package/src/compat/actions/instances.ts +46 -46
- package/src/compat/actions/origin.ts +47 -48
- package/src/compat/actions/protocol.ts +22 -22
- package/src/compat/actions/registry.ts +19 -19
- package/src/compat/{misc/action-return.ts → actions/return.ts} +60 -57
- package/src/compat/actions/rewrite.ts +125 -125
- package/src/compat/actions/{action-router.ts → router.ts} +10 -10
- package/src/compat/actions/serve.ts +132 -136
- package/src/compat/actions/server-tag.ts +4 -4
- package/src/compat/actions/{action-shared.ts → shared.ts} +34 -34
- package/src/compat/actions/unrecognized-error.ts +4 -4
- package/src/compat/{index.ts → aliases.ts} +112 -109
- package/src/compat/bundler/bun-externals.ts +18 -18
- package/src/compat/bundler/cjs-exports.ts +271 -223
- package/src/compat/bundler/config.ts +116 -111
- package/src/compat/bundler/externals.ts +12 -12
- package/src/compat/bundler/import-meta-url.ts +19 -19
- package/src/compat/bundler/modularize-imports.ts +36 -33
- package/src/compat/bundler/new-url-asset.ts +22 -24
- package/src/compat/bundler/optimize-package-imports.ts +111 -107
- package/src/compat/bundler/polyfill.ts +28 -28
- package/src/compat/bundler/react-compiler.ts +35 -29
- package/src/compat/bundler/react-profiler.tsx +11 -11
- package/src/compat/bundler/relay-transform.ts +48 -47
- package/src/compat/bundler/require-context.ts +119 -113
- package/src/compat/bundler/resolve-extensions.ts +19 -19
- package/src/compat/bundler/source-cache.ts +25 -25
- package/src/compat/bundler/static-imports.ts +7 -7
- package/src/compat/bundler/symlink-imports.ts +46 -46
- package/src/compat/bundler/tsconfig-paths.ts +13 -15
- package/src/compat/bundler/wasm.ts +58 -60
- package/src/compat/bundler/webpack-loaders.ts +254 -241
- package/src/compat/bundler/worker.ts +101 -104
- package/src/compat/cache/build-flags.ts +29 -29
- package/src/compat/cache/build-prerender-errors.ts +40 -44
- package/src/compat/cache/custom-handler.ts +60 -53
- package/src/compat/cache/fetch-patch.ts +240 -240
- package/src/compat/cache/handler.ts +27 -31
- package/src/compat/cache/modern-handler.ts +148 -126
- package/src/compat/cache/resume-data-cache.ts +47 -45
- package/src/compat/cache/revalidate.ts +233 -232
- package/src/compat/cache/runtime-error.ts +35 -35
- package/src/compat/cache/use-cache-transform.ts +442 -417
- package/src/compat/cache/use-cache.ts +650 -614
- package/src/compat/cache-control.ts +140 -142
- package/src/compat/client/base-path.ts +21 -20
- package/src/compat/client/css-order.ts +18 -18
- package/src/compat/client/errors/bare-boundary.ts +11 -11
- package/src/compat/client/errors/control-flow.ts +23 -23
- package/src/compat/client/errors/error-boundary.ts +61 -61
- package/src/compat/client/errors/global-error.ts +101 -91
- package/src/compat/client/errors/install.ts +71 -72
- package/src/compat/client/errors/lazy.ts +23 -23
- package/src/compat/client/errors/primitive-throw.ts +47 -45
- package/src/compat/client/errors/soft-refresh.ts +4 -4
- package/src/compat/client/link-status.ts +33 -33
- package/src/compat/client/{nav-compat-runtime.ts → nav-runtime.ts} +20 -20
- package/src/compat/client/{nav-compat.ts → nav.ts} +12 -13
- package/src/compat/client/navigation-scroll.ts +63 -63
- package/src/compat/client/optimistic-routing.ts +93 -88
- package/src/compat/client/prefetch-cache.ts +23 -24
- package/src/compat/client/route-announcer.ts +35 -35
- package/src/compat/client/segment-cache-policy.ts +20 -20
- package/src/compat/client/segment-cache.ts +309 -315
- package/src/compat/client/segment-prefetch.ts +127 -132
- package/src/compat/client/trailing-slash.ts +5 -4
- package/src/compat/css/chunking.ts +113 -116
- package/src/compat/css/inline-css.ts +21 -21
- package/src/compat/css/lightningcss.ts +37 -38
- package/src/compat/css/modules.ts +161 -175
- package/src/compat/css/nonce.ts +7 -7
- package/src/compat/css/sass-plugin.ts +18 -21
- package/src/compat/css/sass.ts +150 -152
- package/src/compat/css/styled-jsx-runtime.ts +27 -27
- package/src/compat/css/styled-jsx.ts +21 -21
- package/src/compat/edge-runtime.ts +27 -27
- package/src/compat/{adapter → export}/build-complete.ts +72 -75
- package/src/compat/export/client.ts +29 -31
- package/src/compat/export/{index.ts → emit.ts} +111 -110
- package/src/compat/export/standalone.ts +62 -54
- package/src/compat/image-optimizer/cache.ts +51 -49
- package/src/compat/image-optimizer/detect.ts +52 -52
- package/src/compat/image-optimizer/{index.ts → optimize.ts} +189 -194
- package/src/compat/image-optimizer/source.ts +77 -80
- package/src/compat/lifecycle/after-scope.ts +26 -26
- package/src/compat/lifecycle/after.ts +48 -45
- package/src/compat/lifecycle/error-funnel.ts +98 -102
- package/src/compat/lifecycle/error-serialize.ts +30 -26
- package/src/compat/lifecycle/error-ui.ts +67 -32
- package/src/compat/lifecycle/instrumentation-client.ts +36 -38
- package/src/compat/lifecycle/instrumentation.ts +85 -85
- package/src/compat/lifecycle/node-console.ts +11 -11
- package/src/compat/lifecycle/testmode.ts +160 -132
- package/src/compat/mdx/compile.ts +60 -57
- package/src/compat/mdx/plugin.ts +11 -11
- package/src/compat/mdx/{next-mdx-stub.ts → stub.ts} +5 -5
- package/src/compat/{metadata-route-artifacts.ts → metadata-artifacts.ts} +195 -191
- package/src/compat/metadata.ts +75 -81
- package/src/compat/next/cache.ts +68 -69
- package/src/compat/next/canonical-url.ts +9 -9
- package/src/compat/next/client-cache.ts +19 -19
- package/src/compat/next/client-navigation.ts +112 -116
- package/src/compat/next/client-only.ts +1 -1
- package/src/compat/next/client-script.tsx +99 -93
- package/src/compat/next/client-server.ts +10 -10
- package/src/compat/next/config-loader.ts +176 -173
- package/src/compat/next/config.ts +7 -7
- package/src/compat/next/constants.cjs +6 -6
- package/src/compat/next/constants.ts +6 -6
- package/src/compat/next/custom-server.ts +26 -24
- package/src/compat/next/dist/client/components/app-router-headers.ts +21 -21
- package/src/compat/next/dist/server/app-render/work-unit-async-storage.external.cjs +3 -4
- package/src/compat/next/dist/server/web/spec-extension/revalidate.ts +1 -1
- package/src/compat/next/dist/server/web/spec-extension/unstable-cache.ts +1 -1
- package/src/compat/next/dist/server/web/spec-extension/unstable-no-store.ts +1 -1
- package/src/compat/next/dynamic.tsx +21 -18
- package/src/compat/next/error.tsx +52 -52
- package/src/compat/next/font/cache.ts +74 -74
- package/src/compat/next/font/google.ts +2 -2
- package/src/compat/next/font/index.ts +1 -1
- package/src/compat/next/font/local.ts +3 -3
- package/src/compat/next/font/runtime-client.ts +17 -15
- package/src/compat/next/font/runtime.ts +443 -408
- package/src/compat/next/font/shared.ts +120 -108
- package/src/compat/next/form.tsx +63 -63
- package/src/compat/next/head.tsx +2 -2
- package/src/compat/next/headers.ts +103 -95
- package/src/compat/next/image/client.tsx +220 -0
- package/src/compat/next/image/config.ts +56 -58
- package/src/compat/next/image/optimizer.ts +40 -36
- package/src/compat/next/image/patterns.ts +37 -40
- package/src/compat/next/{image-props.ts → image/props.ts} +208 -202
- package/src/compat/next/image/shared.ts +65 -57
- package/src/compat/next/image/static-metadata.ts +98 -107
- package/src/compat/next/image/validate.ts +79 -88
- package/src/compat/next/image.tsx +19 -23
- package/src/compat/next/index.ts +1 -1
- package/src/compat/next/legacy-image.tsx +59 -60
- package/src/compat/next/{link-validation-transform.ts → link-transform.ts} +95 -96
- package/src/compat/next/link.tsx +158 -158
- package/src/compat/next/navigation.cjs +12 -3
- package/src/compat/next/navigation.ts +48 -50
- package/src/compat/next/offline.ts +27 -27
- package/src/compat/next/og.ts +121 -124
- package/src/compat/next/preferred-region.ts +13 -14
- package/src/compat/next/redirects.ts +58 -56
- package/src/compat/next/resource-hints.ts +73 -76
- package/src/compat/next/rewrites.ts +130 -133
- package/src/compat/next/root-params.ts +45 -45
- package/src/compat/next/{optimistic-route-state.ts → route-state.ts} +52 -52
- package/src/compat/next/router.cjs +4 -2
- package/src/compat/next/router.ts +58 -61
- package/src/compat/next/script.tsx +108 -108
- package/src/compat/next/server-only.ts +1 -1
- package/src/compat/next/server.ts +19 -19
- package/src/compat/next/svgr.ts +18 -17
- package/src/compat/next/telemetry.ts +24 -24
- package/src/compat/next/{image-usage.ts → usage.ts} +70 -39
- package/src/compat/next/user-agent.ts +53 -49
- package/src/compat/next/web-vitals.ts +22 -24
- package/src/compat/otel/api.ts +41 -41
- package/src/compat/otel/client-trace-metadata.ts +25 -27
- package/src/compat/otel/fetch-span.ts +29 -29
- package/src/compat/otel/tracer.ts +331 -331
- package/src/compat/pages/api.ts +456 -0
- package/src/compat/pages/client-plugin.ts +36 -36
- package/src/compat/pages/router-state.ts +34 -34
- package/src/compat/pages/{index.ts → router.ts} +130 -135
- package/src/compat/ppr/io.ts +12 -12
- package/src/compat/ppr/missing-root-params.ts +34 -38
- package/src/compat/ppr/root-params-scan.ts +66 -66
- package/src/compat/ppr/root-params-transform.ts +24 -26
- package/src/compat/ppr/root-params.ts +30 -30
- package/src/compat/ppr/segment-config-incompat.ts +6 -7
- package/src/compat/protocol.ts +71 -70
- package/src/compat/react/action-state.ts +47 -48
- package/src/compat/react/client-lite.ts +15 -15
- package/src/compat/react/client.ts +4 -4
- package/src/compat/react/compiler-runtime.ts +11 -11
- package/src/compat/react/dom-client.ts +44 -44
- package/src/compat/react/dom-react-server.ts +10 -16
- package/src/compat/react/dom-server.ts +10 -10
- package/src/compat/react/dom.ts +52 -52
- package/src/compat/react/hooks-extra.ts +34 -35
- package/src/compat/react/parity.ts +64 -61
- package/src/compat/react/preact.ts +81 -82
- package/src/compat/react/react-server.ts +28 -28
- package/src/compat/react/router-shim.ts +1 -1
- package/src/compat/react/server-component-use.ts +8 -8
- package/src/compat/react/server-inserted-html.ts +30 -31
- package/src/compat/react/server.ts +53 -55
- package/src/compat/react/use.ts +32 -32
- package/src/compat/react/view-transition.ts +20 -20
- package/src/compat/register/actions.ts +35 -824
- package/src/compat/register/boot.ts +41 -41
- package/src/compat/register/build-tier.ts +5 -5
- package/src/compat/register/build.ts +74 -70
- package/src/compat/register/bundler.ts +161 -156
- package/src/compat/register/cache.ts +20 -20
- package/src/compat/register/client-errors.ts +3 -3
- package/src/compat/register/config.ts +6 -6
- package/src/compat/register/css-extras.ts +30 -34
- package/src/compat/register/edge-runtime.ts +3 -3
- package/src/compat/register/errors.ts +10 -12
- package/src/compat/register/export.ts +16 -16
- package/src/compat/register/font.ts +11 -11
- package/src/compat/register/hooks.ts +2 -2
- package/src/compat/register/image.ts +40 -40
- package/src/compat/register/index.ts +59 -62
- package/src/compat/register/instrumentation-client.ts +10 -10
- package/src/compat/register/lifecycle.ts +25 -28
- package/src/compat/register/mdx.ts +10 -10
- package/src/compat/register/middleware.ts +226 -16
- package/src/compat/register/otel.ts +80 -88
- package/src/compat/register/pages-api.ts +10 -463
- package/src/compat/register/ppr.ts +16 -16
- package/src/compat/register/protocol.ts +17 -18
- package/src/compat/register/proxy.ts +49 -51
- package/src/compat/register/render.ts +79 -76
- package/src/compat/register/routing.ts +162 -159
- package/src/compat/register/segment.ts +24 -1897
- package/src/compat/register/static-image.ts +3 -3
- package/src/compat/register/{misc.ts → taint.ts} +9 -9
- package/src/compat/register/typed-routes.ts +14 -14
- package/src/compat/register/{usecache.ts → use-cache.ts} +39 -39
- package/src/compat/register/validation.ts +18 -18
- package/src/compat/segment/loading-boundary.ts +43 -45
- package/src/compat/segment/page-slot.ts +69 -69
- package/src/compat/segment/serve.ts +1884 -0
- package/src/compat/segment/tree.ts +113 -112
- package/src/compat/segment/vary-key.ts +38 -38
- package/src/compat/segment/vary-params.ts +138 -142
- package/src/compat/static-params.ts +14 -12
- package/src/compat/tsconfig-defaults.ts +87 -91
- package/src/compat/typecheck/{index.ts → check.ts} +234 -212
- package/src/compat/typecheck/worker.ts +15 -12
- package/src/compat/typed-routes/{index.ts → generate.ts} +36 -36
- package/src/compat/typed-routes/manifest.ts +174 -170
- package/src/compat/typed-routes/typegen.ts +127 -110
- package/src/compat/validation/errors.ts +16 -19
- package/src/compat/validation/prerender-diagnostics.ts +521 -504
- package/src/compat/validation/{index.ts → validate.ts} +647 -648
- package/src/compat-bootstrap.ts +16 -16
- package/src/config.ts +69 -69
- package/src/css/build.ts +230 -227
- package/src/css/postcss.ts +79 -80
- package/src/css/worker.ts +14 -15
- package/src/dev/client-actions.ts +10 -10
- package/src/dev/client-chunk-store.ts +27 -27
- package/src/dev/{client-key-cache.ts → restart/client-key.ts} +76 -76
- package/src/dev/{restart-cache.ts → restart/enabled.ts} +1 -1
- package/src/dev/{global-css-cache.ts → restart/global-css.ts} +91 -83
- package/src/dev/{node-module-bundle-cache.ts → restart/node-modules.ts} +24 -24
- package/src/dev/{route-bundle-key-cache.ts → restart/route-bundle-key.ts} +53 -53
- package/src/dev/{route-facts-cache.ts → restart/route-facts.ts} +82 -82
- package/src/dev/server.ts +804 -820
- package/src/env.ts +46 -43
- package/src/extensions.ts +491 -478
- package/src/index.ts +8 -8
- package/src/internal.ts +20 -23
- package/src/{islands → render}/boundary-error.ts +3 -3
- package/src/render/hooks.ts +71 -71
- package/src/render/island-context.ts +14 -14
- package/src/render/metadata.ts +310 -310
- package/src/{ppr-postpone.ts → render/postpone.ts} +5 -5
- package/src/{ppr.ts → render/ppr.ts} +244 -245
- package/src/render/renderer.ts +2076 -2082
- package/src/render/resource-hints.ts +16 -17
- package/src/render/slots.tsx +224 -235
- package/src/{islands → render}/static-children.ts +9 -12
- package/src/{islands → render}/static-slots.ts +37 -37
- package/src/{cache/context.ts → request/cache.ts} +20 -20
- package/src/request/context.ts +107 -107
- package/src/{dynamic/source.ts → resolve/dynamic.ts} +139 -139
- package/src/resolve/engine.ts +90 -77
- package/src/resolve/imports.ts +475 -463
- package/src/resolve/scan-facts.ts +318 -296
- package/src/resolve/source-text.ts +37 -37
- package/src/{dynamic → resolve}/tree-shake.ts +132 -128
- package/src/routing/forwarded.ts +19 -19
- package/src/routing/handler.ts +84 -91
- package/src/routing/href.ts +69 -70
- package/src/routing/{metadata.ts → metadata-files.ts} +403 -401
- package/src/{proxy.ts → routing/proxy.ts} +306 -312
- package/src/routing/{request-runtime.ts → request-environment.ts} +10 -10
- package/src/routing/routes.ts +827 -815
- package/src/routing/slots.ts +164 -160
- package/src/runtime/loader.ts +952 -0
- package/src/{dev → runtime}/module-cache.ts +309 -287
- package/src/{dev → runtime}/module-generations.ts +9 -9
- package/src/{dev → runtime}/module-transform.ts +81 -72
- package/src/{dev/imports.ts → runtime/modules.ts} +934 -847
- package/src/runtime/{server.ts → vendor-build.ts} +848 -1696
- package/src/runtime/vendor.ts +425 -404
- package/src/styles.d.ts +9 -0
- package/src/types.ts +320 -335
- package/src/utils/ansi.ts +5 -5
- package/src/utils/{source.ts → code.ts} +15 -12
- package/src/utils/content-type.ts +3 -3
- package/src/utils/decode.ts +2 -2
- package/src/utils/dev-profile.ts +13 -13
- package/src/utils/error-log.ts +6 -6
- package/src/utils/esbuild.ts +18 -18
- package/src/utils/fs-cache.ts +13 -13
- package/src/utils/fs.ts +57 -49
- package/src/utils/html.ts +20 -24
- package/src/utils/native-require.ts +8 -8
- package/src/utils/serialize.ts +139 -146
- package/src/utils/verbose.ts +18 -18
- package/src/cli/analyze-print.ts +0 -181
- package/src/compat/middleware/manifest.ts +0 -210
- package/src/compat/next/image-client.tsx +0 -215
- package/src/compat/next/link-usage.ts +0 -29
- package/src/css/index.ts +0 -2
- package/src/render/index.ts +0 -1
- package/src/style-modules.d.ts +0 -9
package/src/types.ts
CHANGED
|
@@ -1,44 +1,43 @@
|
|
|
1
|
-
import type { ComponentChildren } from 'preact'
|
|
1
|
+
import type { ComponentChildren } from 'preact'
|
|
2
2
|
|
|
3
|
-
export type RouteMode = 'static' | 'dynamic'
|
|
3
|
+
export type RouteMode = 'static' | 'dynamic'
|
|
4
4
|
|
|
5
|
-
export type PrefetchMode = false | 'intent' | 'visible' | 'load'
|
|
5
|
+
export type PrefetchMode = false | 'intent' | 'visible' | 'load'
|
|
6
6
|
|
|
7
7
|
export interface PNextRoutes {
|
|
8
|
-
readonly __pnext_internal_route_brand?: never
|
|
8
|
+
readonly __pnext_internal_route_brand?: never
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export type RoutePath = Extract<Exclude<keyof PNextRoutes, '__pnext_internal_route_brand'>, string
|
|
12
|
-
export type RouteParamValue = string | string[]
|
|
11
|
+
export type RoutePath = Extract<Exclude<keyof PNextRoutes, '__pnext_internal_route_brand'>, string>
|
|
12
|
+
export type RouteParamValue = string | string[]
|
|
13
13
|
|
|
14
14
|
export type RouteParams<Route extends RoutePath> = PNextRoutes[Route] extends {
|
|
15
|
-
params: infer Params extends Record<string, RouteParamValue
|
|
15
|
+
params: infer Params extends Record<string, RouteParamValue>
|
|
16
16
|
}
|
|
17
17
|
? Params
|
|
18
|
-
: Record<string, never
|
|
18
|
+
: Record<string, never>
|
|
19
19
|
|
|
20
20
|
export type StaticParams<Route extends RoutePath> =
|
|
21
|
-
| RouteParams<Route>[]
|
|
22
|
-
| Promise<RouteParams<Route>[]>;
|
|
21
|
+
RouteParams<Route>[] | Promise<RouteParams<Route>[]>
|
|
23
22
|
|
|
24
23
|
export interface PNextConfig {
|
|
25
|
-
outDir?: string
|
|
26
|
-
basePath?: string
|
|
27
|
-
assetPrefix?: string
|
|
28
|
-
trailingSlash?: boolean
|
|
24
|
+
outDir?: string
|
|
25
|
+
basePath?: string
|
|
26
|
+
assetPrefix?: string
|
|
27
|
+
trailingSlash?: boolean
|
|
29
28
|
// Next's skipTrailingSlashRedirect: serve both slashed and unslashed URLs
|
|
30
29
|
// without a canonical 308/redirect, and never normalize trailing slashes on
|
|
31
30
|
// Link hrefs / client navigation (the raw path is preserved end to end).
|
|
32
|
-
skipTrailingSlashRedirect?: boolean
|
|
33
|
-
htmlLimitedBots?: RegExp
|
|
31
|
+
skipTrailingSlashRedirect?: boolean
|
|
32
|
+
htmlLimitedBots?: RegExp
|
|
34
33
|
// Emit browser sourcemaps from the production client build. Off by default,
|
|
35
34
|
// matching Next: shipping maps publishes your source to every visitor, and
|
|
36
35
|
// generating them costs real build time. Dev never emits them (the
|
|
37
36
|
// un-minified output is already readable).
|
|
38
|
-
productionBrowserSourceMaps?: boolean
|
|
39
|
-
workspaceRoot?: string
|
|
40
|
-
compat?: PNextCompatConfig
|
|
41
|
-
adapter?: PNextAdapterConfig
|
|
37
|
+
productionBrowserSourceMaps?: boolean
|
|
38
|
+
workspaceRoot?: string
|
|
39
|
+
compat?: PNextCompatConfig
|
|
40
|
+
adapter?: PNextAdapterConfig
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
/**
|
|
@@ -48,299 +47,297 @@ export interface PNextConfig {
|
|
|
48
47
|
* Entries are directory names (`storybook-static`) or file suffixes (`.map`).
|
|
49
48
|
*/
|
|
50
49
|
export interface PNextAdapterConfig {
|
|
51
|
-
exclude?: string[]
|
|
52
|
-
keep?: string[]
|
|
50
|
+
exclude?: string[]
|
|
51
|
+
keep?: string[]
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
export interface PNextCompatConfig {
|
|
56
|
-
next?: boolean
|
|
57
|
-
react?: boolean
|
|
58
|
-
reactCompiler?: boolean
|
|
55
|
+
next?: boolean
|
|
56
|
+
react?: boolean
|
|
57
|
+
reactCompiler?: boolean
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
export interface MetadataLink {
|
|
62
|
-
rel: string
|
|
63
|
-
url: string
|
|
64
|
-
dataPrecedence?: string
|
|
65
|
-
type?: string
|
|
66
|
-
media?: string
|
|
67
|
-
sizes?: string
|
|
68
|
-
as?: string
|
|
69
|
-
title?: string
|
|
70
|
-
hrefLang?: string
|
|
71
|
-
crossOrigin?: 'anonymous' | 'use-credentials' | ''
|
|
72
|
-
fetchPriority?: 'high' | 'low' | 'auto'
|
|
61
|
+
rel: string
|
|
62
|
+
url: string
|
|
63
|
+
dataPrecedence?: string
|
|
64
|
+
type?: string
|
|
65
|
+
media?: string
|
|
66
|
+
sizes?: string
|
|
67
|
+
as?: string
|
|
68
|
+
title?: string
|
|
69
|
+
hrefLang?: string
|
|
70
|
+
crossOrigin?: 'anonymous' | 'use-credentials' | ''
|
|
71
|
+
fetchPriority?: 'high' | 'low' | 'auto'
|
|
73
72
|
/** CSP nonce (Next §A8) — set for a manually-nonced next/script preload hint. */
|
|
74
|
-
nonce?: string
|
|
73
|
+
nonce?: string
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
/** A generic document resource hint. Compat owns any resource-specific attributes. */
|
|
78
77
|
export interface ResourceHint extends Omit<MetadataLink, 'url'> {
|
|
79
|
-
url?: string
|
|
80
|
-
attributes?: Readonly<Record<string, string
|
|
78
|
+
url?: string
|
|
79
|
+
attributes?: Readonly<Record<string, string>>
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
export type MetadataTitle =
|
|
84
|
-
| string
|
|
85
|
-
| number
|
|
86
|
-
| { absolute?: string; default?: string; template?: string | null };
|
|
83
|
+
string | number | { absolute?: string; default?: string; template?: string | null }
|
|
87
84
|
|
|
88
|
-
export type MetadataIcon = string | URL | (Partial<MetadataLink> & { url: string | URL })
|
|
85
|
+
export type MetadataIcon = string | URL | (Partial<MetadataLink> & { url: string | URL })
|
|
89
86
|
|
|
90
87
|
export interface MetadataIconGroups {
|
|
91
|
-
icon?: MetadataIcon | MetadataIcon[]
|
|
92
|
-
shortcut?: MetadataIcon | MetadataIcon[]
|
|
93
|
-
apple?: MetadataIcon | MetadataIcon[]
|
|
94
|
-
other?: MetadataIcon | MetadataIcon[]
|
|
88
|
+
icon?: MetadataIcon | MetadataIcon[]
|
|
89
|
+
shortcut?: MetadataIcon | MetadataIcon[]
|
|
90
|
+
apple?: MetadataIcon | MetadataIcon[]
|
|
91
|
+
other?: MetadataIcon | MetadataIcon[]
|
|
95
92
|
}
|
|
96
93
|
|
|
97
94
|
export interface MetadataAuthor {
|
|
98
|
-
name?: string
|
|
99
|
-
url?: string | URL
|
|
95
|
+
name?: string
|
|
96
|
+
url?: string | URL
|
|
100
97
|
}
|
|
101
98
|
|
|
102
99
|
export interface MetadataRobots {
|
|
103
|
-
index?: boolean
|
|
104
|
-
follow?: boolean
|
|
105
|
-
noarchive?: boolean
|
|
106
|
-
nosnippet?: boolean
|
|
107
|
-
noimageindex?: boolean
|
|
108
|
-
nocache?: boolean
|
|
109
|
-
googleBot?: MetadataRobots & Record<string, string | number | boolean | undefined
|
|
100
|
+
index?: boolean
|
|
101
|
+
follow?: boolean
|
|
102
|
+
noarchive?: boolean
|
|
103
|
+
nosnippet?: boolean
|
|
104
|
+
noimageindex?: boolean
|
|
105
|
+
nocache?: boolean
|
|
106
|
+
googleBot?: MetadataRobots & Record<string, string | number | boolean | undefined>
|
|
110
107
|
}
|
|
111
108
|
|
|
112
109
|
export type MetadataImage =
|
|
113
110
|
| string
|
|
114
111
|
| URL
|
|
115
112
|
| {
|
|
116
|
-
url: string | URL
|
|
117
|
-
secureUrl?: string | URL
|
|
118
|
-
width?: string | number
|
|
119
|
-
height?: string | number
|
|
120
|
-
alt?: string
|
|
121
|
-
type?: string
|
|
122
|
-
}
|
|
113
|
+
url: string | URL
|
|
114
|
+
secureUrl?: string | URL
|
|
115
|
+
width?: string | number
|
|
116
|
+
height?: string | number
|
|
117
|
+
alt?: string
|
|
118
|
+
type?: string
|
|
119
|
+
}
|
|
123
120
|
|
|
124
121
|
export interface MetadataOpenGraph {
|
|
125
|
-
title?: MetadataTitle
|
|
126
|
-
description?: string
|
|
127
|
-
url?: string | URL
|
|
128
|
-
siteName?: string
|
|
129
|
-
locale?: string
|
|
130
|
-
type?: string
|
|
131
|
-
images?: MetadataImage | MetadataImage[]
|
|
132
|
-
videos?: MetadataImage | MetadataImage[]
|
|
133
|
-
audio?: MetadataImage | MetadataImage[]
|
|
134
|
-
publishedTime?: string
|
|
135
|
-
authors?: string | string[]
|
|
136
|
-
emails?: string | string[]
|
|
137
|
-
phoneNumbers?: string | string[]
|
|
138
|
-
faxNumbers?: string | string[]
|
|
122
|
+
title?: MetadataTitle
|
|
123
|
+
description?: string
|
|
124
|
+
url?: string | URL
|
|
125
|
+
siteName?: string
|
|
126
|
+
locale?: string
|
|
127
|
+
type?: string
|
|
128
|
+
images?: MetadataImage | MetadataImage[]
|
|
129
|
+
videos?: MetadataImage | MetadataImage[]
|
|
130
|
+
audio?: MetadataImage | MetadataImage[]
|
|
131
|
+
publishedTime?: string
|
|
132
|
+
authors?: string | string[]
|
|
133
|
+
emails?: string | string[]
|
|
134
|
+
phoneNumbers?: string | string[]
|
|
135
|
+
faxNumbers?: string | string[]
|
|
139
136
|
}
|
|
140
137
|
|
|
141
138
|
export interface MetadataTwitter {
|
|
142
|
-
card?: string
|
|
143
|
-
site?: string
|
|
144
|
-
siteId?: string
|
|
145
|
-
creator?: string
|
|
146
|
-
creatorId?: string
|
|
147
|
-
title?: MetadataTitle
|
|
148
|
-
description?: string
|
|
149
|
-
images?: MetadataImage | MetadataImage[]
|
|
139
|
+
card?: string
|
|
140
|
+
site?: string
|
|
141
|
+
siteId?: string
|
|
142
|
+
creator?: string
|
|
143
|
+
creatorId?: string
|
|
144
|
+
title?: MetadataTitle
|
|
145
|
+
description?: string
|
|
146
|
+
images?: MetadataImage | MetadataImage[]
|
|
150
147
|
players?: {
|
|
151
|
-
playerUrl?: string | URL
|
|
152
|
-
streamUrl?: string | URL
|
|
153
|
-
width?: string | number
|
|
154
|
-
height?: string | number
|
|
155
|
-
}
|
|
148
|
+
playerUrl?: string | URL
|
|
149
|
+
streamUrl?: string | URL
|
|
150
|
+
width?: string | number
|
|
151
|
+
height?: string | number
|
|
152
|
+
}
|
|
156
153
|
app?: {
|
|
157
|
-
name?: string
|
|
158
|
-
id?: Record<string, string | undefined
|
|
159
|
-
url?: Record<string, string | URL | undefined
|
|
160
|
-
}
|
|
154
|
+
name?: string
|
|
155
|
+
id?: Record<string, string | undefined>
|
|
156
|
+
url?: Record<string, string | URL | undefined>
|
|
157
|
+
}
|
|
161
158
|
}
|
|
162
159
|
|
|
163
160
|
export interface MetadataAlternates {
|
|
164
|
-
canonical?: string | URL | { url: string | URL }
|
|
165
|
-
languages?: Record<string, string | URL
|
|
166
|
-
media?: Record<string, string | URL
|
|
161
|
+
canonical?: string | URL | { url: string | URL }
|
|
162
|
+
languages?: Record<string, string | URL>
|
|
163
|
+
media?: Record<string, string | URL>
|
|
167
164
|
types?: Record<
|
|
168
165
|
string,
|
|
169
166
|
| string
|
|
170
167
|
| URL
|
|
171
168
|
| { url: string | URL; title?: string }
|
|
172
169
|
| (string | URL | { url: string | URL; title?: string })[]
|
|
173
|
-
|
|
170
|
+
>
|
|
174
171
|
}
|
|
175
172
|
|
|
176
173
|
export interface Metadata {
|
|
177
|
-
metadataBase?: string | URL
|
|
178
|
-
title?: MetadataTitle
|
|
179
|
-
description?: string
|
|
180
|
-
lang?: string
|
|
181
|
-
keywords?: string | number | (string | number)[]
|
|
182
|
-
authors?: string | MetadataAuthor | (string | MetadataAuthor)[]
|
|
183
|
-
generator?: string
|
|
184
|
-
applicationName?: string
|
|
185
|
-
referrer?: string
|
|
186
|
-
robots?: string | MetadataRobots
|
|
187
|
-
openGraph?: MetadataOpenGraph
|
|
188
|
-
twitter?: MetadataTwitter
|
|
189
|
-
alternates?: MetadataAlternates
|
|
174
|
+
metadataBase?: string | URL
|
|
175
|
+
title?: MetadataTitle
|
|
176
|
+
description?: string
|
|
177
|
+
lang?: string
|
|
178
|
+
keywords?: string | number | (string | number)[]
|
|
179
|
+
authors?: string | MetadataAuthor | (string | MetadataAuthor)[]
|
|
180
|
+
generator?: string
|
|
181
|
+
applicationName?: string
|
|
182
|
+
referrer?: string
|
|
183
|
+
robots?: string | MetadataRobots
|
|
184
|
+
openGraph?: MetadataOpenGraph
|
|
185
|
+
twitter?: MetadataTwitter
|
|
186
|
+
alternates?: MetadataAlternates
|
|
190
187
|
pagination?: {
|
|
191
|
-
previous?: string | URL
|
|
192
|
-
next?: string | URL
|
|
193
|
-
}
|
|
194
|
-
icons?: MetadataIcon | MetadataIcon[] | MetadataIconGroups
|
|
195
|
-
manifest?: string | URL
|
|
196
|
-
creator?: string
|
|
197
|
-
publisher?: string
|
|
188
|
+
previous?: string | URL
|
|
189
|
+
next?: string | URL
|
|
190
|
+
}
|
|
191
|
+
icons?: MetadataIcon | MetadataIcon[] | MetadataIconGroups
|
|
192
|
+
manifest?: string | URL
|
|
193
|
+
creator?: string
|
|
194
|
+
publisher?: string
|
|
198
195
|
formatDetection?: {
|
|
199
|
-
email?: boolean
|
|
200
|
-
address?: boolean
|
|
201
|
-
telephone?: boolean
|
|
202
|
-
url?: boolean
|
|
203
|
-
}
|
|
196
|
+
email?: boolean
|
|
197
|
+
address?: boolean
|
|
198
|
+
telephone?: boolean
|
|
199
|
+
url?: boolean
|
|
200
|
+
}
|
|
204
201
|
verification?: {
|
|
205
|
-
google?: string | string[]
|
|
206
|
-
yahoo?: string | string[]
|
|
207
|
-
yandex?: string | string[]
|
|
208
|
-
other?: Record<string, string | string[]
|
|
209
|
-
}
|
|
202
|
+
google?: string | string[]
|
|
203
|
+
yahoo?: string | string[]
|
|
204
|
+
yandex?: string | string[]
|
|
205
|
+
other?: Record<string, string | string[]>
|
|
206
|
+
}
|
|
210
207
|
itunes?: {
|
|
211
|
-
appId?: string
|
|
212
|
-
appArgument?: string
|
|
213
|
-
}
|
|
208
|
+
appId?: string
|
|
209
|
+
appArgument?: string
|
|
210
|
+
}
|
|
214
211
|
appleWebApp?:
|
|
215
212
|
| boolean
|
|
216
213
|
| {
|
|
217
|
-
capable?: boolean
|
|
218
|
-
title?: string
|
|
219
|
-
statusBarStyle?: string
|
|
214
|
+
capable?: boolean
|
|
215
|
+
title?: string
|
|
216
|
+
statusBarStyle?: string
|
|
220
217
|
startupImage?:
|
|
221
218
|
| string
|
|
222
219
|
| URL
|
|
223
220
|
| { url: string | URL; media?: string }
|
|
224
|
-
| (string | URL | { url: string | URL; media?: string })[]
|
|
225
|
-
}
|
|
221
|
+
| (string | URL | { url: string | URL; media?: string })[]
|
|
222
|
+
}
|
|
226
223
|
facebook?: {
|
|
227
|
-
appId?: string
|
|
228
|
-
admins?: string | string[]
|
|
229
|
-
}
|
|
224
|
+
appId?: string
|
|
225
|
+
admins?: string | string[]
|
|
226
|
+
}
|
|
230
227
|
pinterest?: {
|
|
231
|
-
richPin?: boolean
|
|
232
|
-
}
|
|
233
|
-
appLinks?: Record<string, Record<string, string | boolean | undefined
|
|
234
|
-
other?: Record<string, string | string[]
|
|
235
|
-
links?: MetadataLink[]
|
|
228
|
+
richPin?: boolean
|
|
229
|
+
}
|
|
230
|
+
appLinks?: Record<string, Record<string, string | boolean | undefined>>
|
|
231
|
+
other?: Record<string, string | string[]>
|
|
232
|
+
links?: MetadataLink[]
|
|
236
233
|
}
|
|
237
234
|
|
|
238
|
-
export type ThemeColor = string | { color: string; media?: string }
|
|
235
|
+
export type ThemeColor = string | { color: string; media?: string }
|
|
239
236
|
|
|
240
237
|
export interface Viewport {
|
|
241
|
-
width?: string | number
|
|
242
|
-
initialScale?: number
|
|
243
|
-
minimumScale?: number
|
|
244
|
-
maximumScale?: number
|
|
245
|
-
userScalable?: boolean
|
|
246
|
-
viewportFit?: 'auto' | 'contain' | 'cover'
|
|
247
|
-
interactiveWidget?: 'resizes-visual' | 'resizes-content' | 'overlays-content'
|
|
248
|
-
themeColor?: ThemeColor | ThemeColor[]
|
|
249
|
-
colorScheme?: string
|
|
238
|
+
width?: string | number
|
|
239
|
+
initialScale?: number
|
|
240
|
+
minimumScale?: number
|
|
241
|
+
maximumScale?: number
|
|
242
|
+
userScalable?: boolean
|
|
243
|
+
viewportFit?: 'auto' | 'contain' | 'cover'
|
|
244
|
+
interactiveWidget?: 'resizes-visual' | 'resizes-content' | 'overlays-content'
|
|
245
|
+
themeColor?: ThemeColor | ThemeColor[]
|
|
246
|
+
colorScheme?: string
|
|
250
247
|
}
|
|
251
248
|
|
|
252
249
|
export interface NextRequestCookie {
|
|
253
|
-
name: string
|
|
254
|
-
value: string
|
|
250
|
+
name: string
|
|
251
|
+
value: string
|
|
255
252
|
}
|
|
256
253
|
|
|
257
254
|
export interface NextRequestCookies {
|
|
258
|
-
get(name: string): NextRequestCookie | undefined
|
|
259
|
-
getAll(name?: string): NextRequestCookie[]
|
|
260
|
-
has(name: string): boolean
|
|
261
|
-
set(name: string, value: string): this
|
|
262
|
-
delete(name: string): boolean
|
|
263
|
-
clear(): void
|
|
255
|
+
get(name: string): NextRequestCookie | undefined
|
|
256
|
+
getAll(name?: string): NextRequestCookie[]
|
|
257
|
+
has(name: string): boolean
|
|
258
|
+
set(name: string, value: string): this
|
|
259
|
+
delete(name: string): boolean
|
|
260
|
+
clear(): void
|
|
264
261
|
}
|
|
265
262
|
|
|
266
263
|
export interface NextResponseCookies {
|
|
267
264
|
set(options: {
|
|
268
|
-
name: string
|
|
269
|
-
value: string
|
|
270
|
-
path?: string
|
|
271
|
-
maxAge?: number
|
|
272
|
-
httpOnly?: boolean
|
|
273
|
-
secure?: boolean
|
|
274
|
-
sameSite?: 'strict' | 'lax' | 'none'
|
|
275
|
-
}): this
|
|
265
|
+
name: string
|
|
266
|
+
value: string
|
|
267
|
+
path?: string
|
|
268
|
+
maxAge?: number
|
|
269
|
+
httpOnly?: boolean
|
|
270
|
+
secure?: boolean
|
|
271
|
+
sameSite?: 'strict' | 'lax' | 'none'
|
|
272
|
+
}): this
|
|
276
273
|
set(
|
|
277
274
|
name: string,
|
|
278
275
|
value: string,
|
|
279
276
|
options?: {
|
|
280
|
-
path?: string
|
|
281
|
-
maxAge?: number
|
|
282
|
-
httpOnly?: boolean
|
|
283
|
-
secure?: boolean
|
|
284
|
-
sameSite?: 'strict' | 'lax' | 'none'
|
|
277
|
+
path?: string
|
|
278
|
+
maxAge?: number
|
|
279
|
+
httpOnly?: boolean
|
|
280
|
+
secure?: boolean
|
|
281
|
+
sameSite?: 'strict' | 'lax' | 'none'
|
|
285
282
|
},
|
|
286
|
-
): this
|
|
287
|
-
delete(name: string): this
|
|
283
|
+
): this
|
|
284
|
+
delete(name: string): this
|
|
288
285
|
}
|
|
289
286
|
|
|
290
287
|
export interface NextURL extends URL {
|
|
291
|
-
clone(): NextURL
|
|
288
|
+
clone(): NextURL
|
|
292
289
|
/** The configured basePath prefix ('' when unset), mirroring Next's NextURL. */
|
|
293
|
-
basePath: string
|
|
290
|
+
basePath: string
|
|
294
291
|
/** The active locale ('' without i18n), mirroring Next's NextURL. */
|
|
295
|
-
locale: string
|
|
292
|
+
locale: string
|
|
296
293
|
}
|
|
297
294
|
|
|
298
295
|
export interface NextRequest extends Request {
|
|
299
|
-
cookies: NextRequestCookies
|
|
300
|
-
nextUrl: NextURL
|
|
296
|
+
cookies: NextRequestCookies
|
|
297
|
+
nextUrl: NextURL
|
|
301
298
|
}
|
|
302
299
|
|
|
303
300
|
export interface NextFetchEvent {
|
|
304
|
-
waitUntil(promise: Promise<unknown>): void
|
|
301
|
+
waitUntil(promise: Promise<unknown>): void
|
|
305
302
|
}
|
|
306
303
|
|
|
307
304
|
type ParamsInput<P> = P extends RoutePath
|
|
308
305
|
? RouteParams<P>
|
|
309
306
|
: P extends Record<string, RouteParamValue>
|
|
310
307
|
? P
|
|
311
|
-
: Record<string, RouteParamValue
|
|
308
|
+
: Record<string, RouteParamValue>
|
|
312
309
|
|
|
313
|
-
export type PageSearchParams = Record<string, string | string[] | undefined
|
|
310
|
+
export type PageSearchParams = Record<string, string | string[] | undefined>
|
|
314
311
|
|
|
315
312
|
export interface PageProps<P = Record<string, RouteParamValue>> {
|
|
316
|
-
params: Promise<ParamsInput<P
|
|
317
|
-
searchParams: Promise<PageSearchParams
|
|
318
|
-
request?: NextRequest
|
|
313
|
+
params: Promise<ParamsInput<P>>
|
|
314
|
+
searchParams: Promise<PageSearchParams>
|
|
315
|
+
request?: NextRequest
|
|
319
316
|
}
|
|
320
317
|
|
|
321
318
|
export interface RouteContext<P = Record<string, RouteParamValue>> {
|
|
322
|
-
params: Promise<ParamsInput<P
|
|
319
|
+
params: Promise<ParamsInput<P>>
|
|
323
320
|
}
|
|
324
321
|
|
|
325
|
-
export type ServerComponentResult = ComponentChildren | void
|
|
322
|
+
export type ServerComponentResult = ComponentChildren | void
|
|
326
323
|
|
|
327
324
|
export type ServerComponent<Props = Record<string, never>> = (
|
|
328
325
|
props: Props,
|
|
329
|
-
) => ServerComponentResult | Promise<ServerComponentResult
|
|
326
|
+
) => ServerComponentResult | Promise<ServerComponentResult>
|
|
330
327
|
|
|
331
328
|
export interface LayoutProps {
|
|
332
|
-
children: ComponentChildren
|
|
333
|
-
params: Promise<Record<string, RouteParamValue
|
|
334
|
-
searchParams: Promise<PageSearchParams
|
|
335
|
-
request?: NextRequest
|
|
329
|
+
children: ComponentChildren
|
|
330
|
+
params: Promise<Record<string, RouteParamValue>>
|
|
331
|
+
searchParams: Promise<PageSearchParams>
|
|
332
|
+
request?: NextRequest
|
|
336
333
|
}
|
|
337
334
|
|
|
338
335
|
export type RouteHandler = {
|
|
339
|
-
bivarianceHack(request: NextRequest, context: RouteContext): Response | Promise<Response
|
|
340
|
-
}['bivarianceHack']
|
|
336
|
+
bivarianceHack(request: NextRequest, context: RouteContext): Response | Promise<Response>
|
|
337
|
+
}['bivarianceHack']
|
|
341
338
|
|
|
342
339
|
/** Kind of intercepting-route marker on a route directory (Next.js convention). */
|
|
343
|
-
export type InterceptionMarker = '(.)' | '(..)' | '(..)(..)' | '(...)'
|
|
340
|
+
export type InterceptionMarker = '(.)' | '(..)' | '(..)(..)' | '(...)'
|
|
344
341
|
|
|
345
342
|
/**
|
|
346
343
|
* Parallel-route render state carried across soft navigations. The client
|
|
@@ -349,38 +346,38 @@ export type InterceptionMarker = '(.)' | '(..)' | '(..)(..)' | '(...)';
|
|
|
349
346
|
*/
|
|
350
347
|
export interface NavState {
|
|
351
348
|
/** Pathname the children tree rendered from. */
|
|
352
|
-
children?: string
|
|
349
|
+
children?: string
|
|
353
350
|
/**
|
|
354
351
|
* Search string (`?a=b`, may be empty or absent) the children tree rendered with. On a host render, where
|
|
355
352
|
* interception keeps the current page visible, the children page re-renders with THIS query, not the target
|
|
356
353
|
* URL's - Next's per-segment refetch-URL semantics preserve each slot's searchParams.
|
|
357
354
|
*/
|
|
358
|
-
childrenSearch?: string
|
|
355
|
+
childrenSearch?: string
|
|
359
356
|
/**
|
|
360
357
|
* App-relative slot directory -> source URL (`pathname` or
|
|
361
358
|
* `pathname?query`) its content rendered from. The query, when present, is
|
|
362
359
|
* the searchParams the slot's page re-renders with when re-rendered from
|
|
363
360
|
* this recorded source.
|
|
364
361
|
*/
|
|
365
|
-
slots?: Record<string, string
|
|
362
|
+
slots?: Record<string, string>
|
|
366
363
|
/**
|
|
367
364
|
* The children slot rendered a `default.*` because no page matched this path (Next's `__DEFAULT__`
|
|
368
365
|
* segment). `useSelectedLayoutSegment()` with no parallel-route key reports NOTHING for such a slot - the
|
|
369
366
|
* path's segments belong to whichever parallel slot did match, not to children.
|
|
370
367
|
*/
|
|
371
|
-
childrenDefault?: boolean
|
|
368
|
+
childrenDefault?: boolean
|
|
372
369
|
/**
|
|
373
370
|
* The served document is a fully static (prerendered) route. Inlined so a
|
|
374
371
|
* hard load can seed its prefetch entry with the static reuse window rather
|
|
375
372
|
* than the dynamic default. Mirrors the `/_tree` payload's `isStatic`.
|
|
376
373
|
*/
|
|
377
|
-
isStatic?: boolean
|
|
374
|
+
isStatic?: boolean
|
|
378
375
|
/**
|
|
379
376
|
* The route's `x-nextjs-stale-time` window (seconds) from its `use cache`
|
|
380
377
|
* `cacheLife()`, inlined for the same hard-load seeding path. Mirrors the
|
|
381
378
|
* `/_tree` payload's `staleTime`.
|
|
382
379
|
*/
|
|
383
|
-
staleTime?: number
|
|
380
|
+
staleTime?: number
|
|
384
381
|
/**
|
|
385
382
|
* The served document was resumed from a BAKED SHELL (a fallback shell or a
|
|
386
383
|
* sub-shell), so the markup above its dynamic holes is a prerender even though
|
|
@@ -388,7 +385,7 @@ export interface NavState {
|
|
|
388
385
|
* pre-hydration stage as a reusable static stage on the strength of this;
|
|
389
386
|
* `isStatic` stays false, so the whole-document reuse window is untouched.
|
|
390
387
|
*/
|
|
391
|
-
staticStage?: boolean
|
|
388
|
+
staticStage?: boolean
|
|
392
389
|
/**
|
|
393
390
|
* The served document is an interception HOST render: the URL is the intercepted target but the children
|
|
394
391
|
* tree kept rendering the host page. Such a document is bound to its host - the client must NOT reuse it
|
|
@@ -396,7 +393,7 @@ export interface NavState {
|
|
|
396
393
|
* Stamped by the server, which alone knows the pre-rewrite host path; the client cannot infer it by
|
|
397
394
|
* comparing `children` to the browser pathname under a rewrite.
|
|
398
395
|
*/
|
|
399
|
-
hostRender?: boolean
|
|
396
|
+
hostRender?: boolean
|
|
400
397
|
}
|
|
401
398
|
|
|
402
399
|
/**
|
|
@@ -406,43 +403,43 @@ export interface NavState {
|
|
|
406
403
|
*/
|
|
407
404
|
export interface RouteInterception {
|
|
408
405
|
/** The raw marker that prefixed the intercepted segment. */
|
|
409
|
-
marker: InterceptionMarker
|
|
406
|
+
marker: InterceptionMarker
|
|
410
407
|
/** Route path of the level the interceptor renders within (e.g. `/feed`). */
|
|
411
|
-
base: string
|
|
408
|
+
base: string
|
|
412
409
|
/** Regex source (anchored by the matcher) for paths at or below `base`. */
|
|
413
|
-
basePattern: string
|
|
410
|
+
basePattern: string
|
|
414
411
|
/**
|
|
415
412
|
* Absolute path of the `@slot` directory the interceptor renders into. When
|
|
416
413
|
* set, the interceptor renders as slot content of the current page; when
|
|
417
414
|
* absent, the interceptor page replaces the children tree.
|
|
418
415
|
*/
|
|
419
|
-
slotDir?: string
|
|
416
|
+
slotDir?: string
|
|
420
417
|
}
|
|
421
418
|
|
|
422
419
|
export interface RouteManifestEntry {
|
|
423
|
-
id: string
|
|
424
|
-
kind: 'page' | 'handler'
|
|
425
|
-
route: string
|
|
426
|
-
pattern: string
|
|
427
|
-
file: string
|
|
428
|
-
params: string[]
|
|
429
|
-
catchAll?: string
|
|
420
|
+
id: string
|
|
421
|
+
kind: 'page' | 'handler'
|
|
422
|
+
route: string
|
|
423
|
+
pattern: string
|
|
424
|
+
file: string
|
|
425
|
+
params: string[]
|
|
426
|
+
catchAll?: string
|
|
430
427
|
/**
|
|
431
428
|
* The trailing catch-all is optional (`[[...slug]]`): it matches both the
|
|
432
429
|
* parent path and nested paths. When set, `catchAll` holds the param name and
|
|
433
430
|
* the pattern's final group is `(?:/(.*))?`.
|
|
434
431
|
*/
|
|
435
|
-
catchAllOptional?: boolean
|
|
436
|
-
mode: RouteMode
|
|
437
|
-
hasStaticParams: boolean
|
|
438
|
-
usesRequest: boolean
|
|
432
|
+
catchAllOptional?: boolean
|
|
433
|
+
mode: RouteMode
|
|
434
|
+
hasStaticParams: boolean
|
|
435
|
+
usesRequest: boolean
|
|
439
436
|
/**
|
|
440
437
|
* Route handler that calls a revalidation API (revalidatePath/revalidateTag/
|
|
441
438
|
* expirePath/expireTag). Such a handler performs a side effect that cannot be
|
|
442
439
|
* prerendered, so it stays dynamic even when a `revalidate` export or
|
|
443
440
|
* generateStaticParams would otherwise opt it into static ISR output.
|
|
444
441
|
*/
|
|
445
|
-
handlerUsesRevalidationApi?: boolean
|
|
442
|
+
handlerUsesRevalidationApi?: boolean
|
|
446
443
|
/**
|
|
447
444
|
* Route declares `export const dynamic = 'error'` AND statically references a
|
|
448
445
|
* dynamic data API (cookies()/headers()/connection()/searchParams for pages,
|
|
@@ -451,40 +448,40 @@ export interface RouteManifestEntry {
|
|
|
451
448
|
* names in that error (e.g. `cookies()`, `nextUrl.toString`). Set at scan time
|
|
452
449
|
* and enforced in the build's prerender pass.
|
|
453
450
|
*/
|
|
454
|
-
dynamicErrorApi?: string
|
|
455
|
-
client: boolean
|
|
456
|
-
clientReferences: import('./client/reference').ClientReference[]
|
|
457
|
-
cssImports: string[]
|
|
458
|
-
cssAssets?: string[]
|
|
459
|
-
sourceFiles: string[]
|
|
451
|
+
dynamicErrorApi?: string
|
|
452
|
+
client: boolean
|
|
453
|
+
clientReferences: import('./client/reference').ClientReference[]
|
|
454
|
+
cssImports: string[]
|
|
455
|
+
cssAssets?: string[]
|
|
456
|
+
sourceFiles: string[]
|
|
460
457
|
stream?: {
|
|
461
|
-
hasLoadingBoundary?: boolean
|
|
462
|
-
ancestorClientReferences?: string[]
|
|
463
|
-
}
|
|
464
|
-
clientEntry?: string
|
|
458
|
+
hasLoadingBoundary?: boolean
|
|
459
|
+
ancestorClientReferences?: string[]
|
|
460
|
+
}
|
|
461
|
+
clientEntry?: string
|
|
465
462
|
/** Static import closure of the client entry, for modulepreload links. */
|
|
466
|
-
clientEntryImports?: string[]
|
|
463
|
+
clientEntryImports?: string[]
|
|
467
464
|
/** Dynamic import closure of the client entry, for low-priority preload links. */
|
|
468
|
-
clientDynamicImports?: string[]
|
|
469
|
-
maxDuration?: number
|
|
465
|
+
clientDynamicImports?: string[]
|
|
466
|
+
maxDuration?: number
|
|
470
467
|
/** Route opts into partial prerendering via `export const experimental_ppr = true`. */
|
|
471
|
-
ppr?: boolean
|
|
468
|
+
ppr?: boolean
|
|
472
469
|
/** Merged Next segment config across the page/handler and its layout chain. */
|
|
473
|
-
segmentConfig?: RouteSegmentConfig
|
|
470
|
+
segmentConfig?: RouteSegmentConfig
|
|
474
471
|
/** Code-based metadata route synthesized from robots/sitemap/icon/etc. */
|
|
475
|
-
metadataRoute?: MetadataRouteEntry
|
|
472
|
+
metadataRoute?: MetadataRouteEntry
|
|
476
473
|
/** Param sets prerendered at build from params(). Compat aliases generateStaticParams to params. */
|
|
477
|
-
prerenderedParams?: Record<string, RouteParamValue>[]
|
|
474
|
+
prerenderedParams?: Record<string, RouteParamValue>[]
|
|
478
475
|
/**
|
|
479
476
|
* Per-prerendered-URL vary sets tracked by the BUILD render, keyed by the concrete pathname. A request-time
|
|
480
477
|
* render answered from that prerender executes no user code, so it tracks nothing and would publish
|
|
481
478
|
* "unknown" (exact-URL keying) - these are the sets it publishes instead.
|
|
482
479
|
*/
|
|
483
|
-
prerenderVary?: Record<string, { vary: string[]; layoutVary: string[]; pageVary: string[] }
|
|
480
|
+
prerenderVary?: Record<string, { vary: string[]; layoutVary: string[]; pageVary: string[] }>
|
|
484
481
|
/** Suspense boundary ids left as dynamic holes in the prebuilt PPR shell. */
|
|
485
|
-
pprHoles?: number[]
|
|
482
|
+
pprHoles?: number[]
|
|
486
483
|
/** Metadata postponed out of the static PPR shell and resumed into the body. */
|
|
487
|
-
pprMetadata?: boolean
|
|
484
|
+
pprMetadata?: boolean
|
|
488
485
|
/**
|
|
489
486
|
* Effective `use cache` cacheLife captured from the route's shell prerender.
|
|
490
487
|
* A prebuilt page never re-runs its cache scopes at serve time, so start.ts
|
|
@@ -492,10 +489,10 @@ export interface RouteManifestEntry {
|
|
|
492
489
|
* pure static HIT/MISS (the render-time header finalizer never fires there).
|
|
493
490
|
*/
|
|
494
491
|
cacheLife?: {
|
|
495
|
-
revalidateSeconds?: number
|
|
496
|
-
expireSeconds?: number
|
|
497
|
-
staleSeconds?: number
|
|
498
|
-
}
|
|
492
|
+
revalidateSeconds?: number
|
|
493
|
+
expireSeconds?: number
|
|
494
|
+
staleSeconds?: number
|
|
495
|
+
}
|
|
499
496
|
/**
|
|
500
497
|
* The `Link` response header captured from the route's shell prerender (font
|
|
501
498
|
* preloads + react-dom preload()/preconnect() hints, capped by
|
|
@@ -503,13 +500,13 @@ export interface RouteManifestEntry {
|
|
|
503
500
|
* the components that emitted the hints, so start.ts re-emits the header
|
|
504
501
|
* from here (mirrors Next serving the prerender's stored headers).
|
|
505
502
|
*/
|
|
506
|
-
linkHeader?: string
|
|
503
|
+
linkHeader?: string
|
|
507
504
|
/**
|
|
508
505
|
* Cache tags collected across the route's shell (and sub-shell) prerenders - cacheTag(),
|
|
509
506
|
* unstable_cache({tags}), fetch({next:{tags}}). A prebuilt PPR shell must stop serving once one of these
|
|
510
507
|
* tags, or the route's path, is revalidated; loadPprShell compares them against the shell file's mtime.
|
|
511
508
|
*/
|
|
512
|
-
cacheTags?: string[]
|
|
509
|
+
cacheTags?: string[]
|
|
513
510
|
/**
|
|
514
511
|
* Prebuilt sub-shells at descending param specificity. Each entry fixes a leading prefix of params
|
|
515
512
|
* (`concreteParams`) - those render buildtime - while the remaining route params hang. Ordered MOST-specific
|
|
@@ -517,49 +514,49 @@ export interface RouteManifestEntry {
|
|
|
517
514
|
* least-specific fallback. `key` is the on-disk signature; `holes` are that shell's own dynamic hole ids.
|
|
518
515
|
*/
|
|
519
516
|
pprSubShells?: {
|
|
520
|
-
key: string
|
|
521
|
-
concreteParams: Record<string, RouteParamValue
|
|
522
|
-
holes: number[]
|
|
523
|
-
}[]
|
|
517
|
+
key: string
|
|
518
|
+
concreteParams: Record<string, RouteParamValue>
|
|
519
|
+
holes: number[]
|
|
520
|
+
}[]
|
|
524
521
|
/**
|
|
525
522
|
* `template.*` files from app root to the route's own segment, parallel to
|
|
526
523
|
* the layout chain. A template re-mounts on navigation where a layout persists.
|
|
527
524
|
*/
|
|
528
|
-
templateFiles?: string[]
|
|
525
|
+
templateFiles?: string[]
|
|
529
526
|
/** `forbidden.*` files nearest-last (root->leaf); COMPAT authInterrupts. */
|
|
530
|
-
forbiddenFiles?: string[]
|
|
527
|
+
forbiddenFiles?: string[]
|
|
531
528
|
/** `unauthorized.*` files nearest-last (root->leaf); COMPAT authInterrupts. */
|
|
532
|
-
unauthorizedFiles?: string[]
|
|
529
|
+
unauthorizedFiles?: string[]
|
|
533
530
|
/**
|
|
534
531
|
* Parallel-route `@slot` directories (absolute) along the route's layout
|
|
535
532
|
* chain, root->leaf. Presence means slot content participates in rendering
|
|
536
533
|
* and soft navigations must render dynamically.
|
|
537
534
|
*/
|
|
538
|
-
slotDirs?: string[]
|
|
535
|
+
slotDirs?: string[]
|
|
539
536
|
/**
|
|
540
537
|
* Entry synthesized from a parallel slot's page: the URL is only reachable
|
|
541
538
|
* because a slot matches it. `file` anchors the layout chain; the children
|
|
542
539
|
* tree renders `childrenDefault` (or nothing) instead of importing `file`.
|
|
543
540
|
*/
|
|
544
|
-
synthetic?: boolean
|
|
541
|
+
synthetic?: boolean
|
|
545
542
|
/** Slot directory whose page produced this synthetic route. */
|
|
546
|
-
syntheticSlotDir?: string
|
|
543
|
+
syntheticSlotDir?: string
|
|
547
544
|
/** `default.*` file rendered as children for a synthetic entry. */
|
|
548
|
-
childrenDefault?: string
|
|
545
|
+
childrenDefault?: string
|
|
549
546
|
/** Intercepting-route metadata, when this route is an interceptor. */
|
|
550
|
-
interception?: RouteInterception
|
|
547
|
+
interception?: RouteInterception
|
|
551
548
|
/**
|
|
552
549
|
* Ship the soft-navigation runtime even without client references. Derived:
|
|
553
550
|
* true exactly when `clientEntryReasons` is non-empty. Kept as its own field
|
|
554
551
|
* because it is what every consumer asks and what the manifest carries.
|
|
555
552
|
*/
|
|
556
|
-
needsRouterEntry?: boolean
|
|
553
|
+
needsRouterEntry?: boolean
|
|
557
554
|
/**
|
|
558
555
|
* WHY this route needs the client entry - one entry per fact the scan (or the build) observed. The client
|
|
559
556
|
* build gates its feature regions on these, so a `<Link>`-only page never ships the action machinery;
|
|
560
557
|
* collapsing them back into the boolean above loses exactly that.
|
|
561
558
|
*/
|
|
562
|
-
clientEntryReasons?: ClientEntryReason[]
|
|
559
|
+
clientEntryReasons?: ClientEntryReason[]
|
|
563
560
|
}
|
|
564
561
|
|
|
565
562
|
/**
|
|
@@ -575,126 +572,114 @@ export interface RouteManifestEntry {
|
|
|
575
572
|
* route file can start a soft navigation
|
|
576
573
|
*/
|
|
577
574
|
export type ClientEntryReason =
|
|
578
|
-
|
|
579
|
-
| 'parallel-routes'
|
|
580
|
-
| 'link'
|
|
581
|
-
| 'router-api'
|
|
582
|
-
| 'actions'
|
|
583
|
-
| 'form'
|
|
584
|
-
| 'control-flow';
|
|
575
|
+
'compat-parity' | 'parallel-routes' | 'link' | 'router-api' | 'actions' | 'form' | 'control-flow'
|
|
585
576
|
|
|
586
577
|
export type MetadataRouteKind =
|
|
587
|
-
| 'icon'
|
|
588
|
-
| 'apple-icon'
|
|
589
|
-
| 'opengraph-image'
|
|
590
|
-
| 'twitter-image'
|
|
591
|
-
| 'robots'
|
|
592
|
-
| 'sitemap'
|
|
593
|
-
| 'manifest';
|
|
578
|
+
'icon' | 'apple-icon' | 'opengraph-image' | 'twitter-image' | 'robots' | 'sitemap' | 'manifest'
|
|
594
579
|
|
|
595
580
|
export interface MetadataRouteEntry {
|
|
596
|
-
kind: MetadataRouteKind
|
|
597
|
-
generatedParam?: string
|
|
581
|
+
kind: MetadataRouteKind
|
|
582
|
+
generatedParam?: string
|
|
598
583
|
/**
|
|
599
584
|
* Concrete pathnames the generated-param expansion resolved to at build (generateSitemaps /
|
|
600
585
|
* generateImageMetadata ids). The route pattern itself carries a param so it is never `mode: 'static'`, but
|
|
601
586
|
* every id is known ahead of time - Next lists each expanded pathname as a prerendered route. Recorded
|
|
602
587
|
* during the handler prerender pass.
|
|
603
588
|
*/
|
|
604
|
-
generatedRoutes?: string[]
|
|
589
|
+
generatedRoutes?: string[]
|
|
605
590
|
}
|
|
606
591
|
|
|
607
592
|
export interface StaticMetadataFileEntry {
|
|
608
|
-
kind: MetadataRouteKind | 'favicon'
|
|
609
|
-
file: string
|
|
610
|
-
relative: string
|
|
611
|
-
outputPath: string
|
|
612
|
-
routeSegments: string[]
|
|
613
|
-
contentType: string
|
|
614
|
-
width?: number
|
|
615
|
-
height?: number
|
|
616
|
-
sizes?: string
|
|
617
|
-
alt?: string
|
|
593
|
+
kind: MetadataRouteKind | 'favicon'
|
|
594
|
+
file: string
|
|
595
|
+
relative: string
|
|
596
|
+
outputPath: string
|
|
597
|
+
routeSegments: string[]
|
|
598
|
+
contentType: string
|
|
599
|
+
width?: number
|
|
600
|
+
height?: number
|
|
601
|
+
sizes?: string
|
|
602
|
+
alt?: string
|
|
618
603
|
}
|
|
619
604
|
|
|
620
605
|
export interface StaticModuleMetadata {
|
|
621
|
-
metadata?: Metadata
|
|
622
|
-
viewport?: Viewport
|
|
606
|
+
metadata?: Metadata
|
|
607
|
+
viewport?: Viewport
|
|
623
608
|
}
|
|
624
609
|
|
|
625
610
|
export interface StaticRouteMetadata {
|
|
626
|
-
favicon?: StaticMetadataFileEntry
|
|
627
|
-
manifest?: StaticMetadataFileEntry
|
|
628
|
-
manifestLink?: MetadataLink
|
|
629
|
-
icons: StaticMetadataFileEntry[]
|
|
630
|
-
appleIcons: StaticMetadataFileEntry[]
|
|
631
|
-
rootIcons: StaticMetadataFileEntry[]
|
|
632
|
-
dynamicIcons?: MetadataLink[]
|
|
633
|
-
dynamicAppleIcons?: MetadataLink[]
|
|
634
|
-
openGraphImage?: MetadataImage
|
|
635
|
-
dynamicOpenGraphImages?: MetadataImage[]
|
|
636
|
-
twitterImage?: MetadataImage
|
|
637
|
-
dynamicTwitterImages?: MetadataImage[]
|
|
611
|
+
favicon?: StaticMetadataFileEntry
|
|
612
|
+
manifest?: StaticMetadataFileEntry
|
|
613
|
+
manifestLink?: MetadataLink
|
|
614
|
+
icons: StaticMetadataFileEntry[]
|
|
615
|
+
appleIcons: StaticMetadataFileEntry[]
|
|
616
|
+
rootIcons: StaticMetadataFileEntry[]
|
|
617
|
+
dynamicIcons?: MetadataLink[]
|
|
618
|
+
dynamicAppleIcons?: MetadataLink[]
|
|
619
|
+
openGraphImage?: MetadataImage
|
|
620
|
+
dynamicOpenGraphImages?: MetadataImage[]
|
|
621
|
+
twitterImage?: MetadataImage
|
|
622
|
+
dynamicTwitterImages?: MetadataImage[]
|
|
638
623
|
}
|
|
639
624
|
|
|
640
625
|
export interface BuildManifest {
|
|
641
|
-
version: 0
|
|
642
|
-
root: string
|
|
643
|
-
appDir: string
|
|
644
|
-
outDir: string
|
|
645
|
-
routes: RouteManifestEntry[]
|
|
646
|
-
staticFiles?: Record<string, StaticFileMetadata
|
|
647
|
-
staticMetadataFiles?: StaticMetadataFileEntry[]
|
|
648
|
-
staticModuleMetadata?: Record<string, StaticModuleMetadata
|
|
649
|
-
staticRouteMetadata?: Record<string, StaticRouteMetadata
|
|
626
|
+
version: 0
|
|
627
|
+
root: string
|
|
628
|
+
appDir: string
|
|
629
|
+
outDir: string
|
|
630
|
+
routes: RouteManifestEntry[]
|
|
631
|
+
staticFiles?: Record<string, StaticFileMetadata>
|
|
632
|
+
staticMetadataFiles?: StaticMetadataFileEntry[]
|
|
633
|
+
staticModuleMetadata?: Record<string, StaticModuleMetadata>
|
|
634
|
+
staticRouteMetadata?: Record<string, StaticRouteMetadata>
|
|
650
635
|
/** Compiled proxy/middleware bundle, relative to outDir. */
|
|
651
|
-
proxyModule?: string
|
|
636
|
+
proxyModule?: string
|
|
652
637
|
/** Absolute path to the app-root `global-error.*` file, if present. */
|
|
653
|
-
globalErrorFile?: string
|
|
638
|
+
globalErrorFile?: string
|
|
654
639
|
/** Server-action registry: wire id -> compiled module + export. COMPAT. */
|
|
655
|
-
actions?: ActionManifestEntry[]
|
|
640
|
+
actions?: ActionManifestEntry[]
|
|
656
641
|
}
|
|
657
642
|
|
|
658
643
|
/** One server-action target in the build manifest. */
|
|
659
644
|
export interface ActionManifestEntry {
|
|
660
645
|
/** Wire id (actionId), sent by the client stub in the next-action header. */
|
|
661
|
-
id: string
|
|
646
|
+
id: string
|
|
662
647
|
/**
|
|
663
648
|
* Project-root-relative POSIX path of the action's SOURCE module. Used at
|
|
664
649
|
* startup to recompute the id (actionId with no root), giving parity with the
|
|
665
650
|
* client stub's id regardless of the machine's absolute paths.
|
|
666
651
|
*/
|
|
667
|
-
sourceKey: string
|
|
652
|
+
sourceKey: string
|
|
668
653
|
/** Compiled server-module path, relative to outDir, for start to import. */
|
|
669
|
-
modulePath: string
|
|
654
|
+
modulePath: string
|
|
670
655
|
/** Export name within the module implementing the action. */
|
|
671
|
-
exportName: string
|
|
656
|
+
exportName: string
|
|
672
657
|
}
|
|
673
658
|
|
|
674
659
|
export interface StaticFileMetadata {
|
|
675
|
-
status: number
|
|
676
|
-
headers: [string, string][]
|
|
677
|
-
routeId?: string
|
|
660
|
+
status: number
|
|
661
|
+
headers: [string, string][]
|
|
662
|
+
routeId?: string
|
|
678
663
|
/** 'page' entries are prebuilt HTML subject to ISR; absent means handler output. */
|
|
679
|
-
kind?: 'page'
|
|
664
|
+
kind?: 'page'
|
|
680
665
|
/** ISR TTL in seconds (min of segment config and fetch/unstable_cache revalidates). */
|
|
681
|
-
revalidateSeconds?: number
|
|
666
|
+
revalidateSeconds?: number
|
|
682
667
|
/**
|
|
683
668
|
* Hard-expiry window in seconds from a `use cache` cacheLife(). Past this the
|
|
684
669
|
* stale copy is NO LONGER served: the request blocks on a fresh render (vs
|
|
685
670
|
* revalidateSeconds, which serves stale-while-revalidate).
|
|
686
671
|
*/
|
|
687
|
-
expireSeconds?: number
|
|
672
|
+
expireSeconds?: number
|
|
688
673
|
/** `x-nextjs-stale-time` window in seconds from a `use cache` cacheLife(). */
|
|
689
|
-
staleSeconds?: number
|
|
674
|
+
staleSeconds?: number
|
|
690
675
|
/** Cache tags the prerender depended on; revalidateTag(tag) marks the file stale. */
|
|
691
|
-
tags?: string[]
|
|
676
|
+
tags?: string[]
|
|
692
677
|
}
|
|
693
678
|
|
|
694
679
|
/** Next route segment config exports (`export const dynamic/revalidate/...`). */
|
|
695
680
|
export interface RouteSegmentConfig {
|
|
696
|
-
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
|
|
697
|
-
revalidate?: number | false
|
|
681
|
+
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
|
|
682
|
+
revalidate?: number | false
|
|
698
683
|
fetchCache?:
|
|
699
684
|
| 'auto'
|
|
700
685
|
| 'default-cache'
|
|
@@ -702,24 +687,24 @@ export interface RouteSegmentConfig {
|
|
|
702
687
|
| 'force-cache'
|
|
703
688
|
| 'force-no-store'
|
|
704
689
|
| 'default-no-store'
|
|
705
|
-
| 'only-no-store'
|
|
690
|
+
| 'only-no-store'
|
|
706
691
|
/** Param names governed by a `dynamicParams = false` declaration. */
|
|
707
|
-
dynamicParamsFalse?: string[]
|
|
692
|
+
dynamicParamsFalse?: string[]
|
|
708
693
|
/**
|
|
709
694
|
* The page has its own static params export while a `dynamicParams = false`
|
|
710
695
|
* declaration governs the route: every param tuple must match a prerendered
|
|
711
696
|
* path (Next's fallback: false), not just the governed params.
|
|
712
697
|
*/
|
|
713
|
-
strictDynamicParams?: boolean
|
|
698
|
+
strictDynamicParams?: boolean
|
|
714
699
|
/** `export const runtime` value, when declared ('edge' | 'nodejs'). */
|
|
715
|
-
runtime?: string
|
|
700
|
+
runtime?: string
|
|
716
701
|
/** Next app-shell prefetch policy declared by the route. */
|
|
717
|
-
prefetch?: 'allow-runtime' | 'partial' | 'unstable_eager'
|
|
702
|
+
prefetch?: 'allow-runtime' | 'partial' | 'unstable_eager'
|
|
718
703
|
/**
|
|
719
704
|
* `export const unstable_instant` on the page or a layout in its chain (a boolean or a sample-config object
|
|
720
705
|
* means true; an explicit `false` on a leaf overrides an ancestor's opt-in). A full (`prefetch={true}`)
|
|
721
706
|
* prefetch of an instant route is served as a RUNTIME-PREFETCH prerender: request data is sampled into the
|
|
722
707
|
* response while connection()-gated content is omitted.
|
|
723
708
|
*/
|
|
724
|
-
unstableInstant?: boolean
|
|
709
|
+
unstableInstant?: boolean
|
|
725
710
|
}
|