qalita 2.5.4__py3-none-any.whl → 2.6.1__py3-none-any.whl
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.
- qalita/_frontend/.next/static/_0oyfpC7N2IGDMa04TT9R/_clientMiddlewareManifest.json +6 -0
- qalita/_frontend/.next/static/chunks/236f7e5abd6f09ff.js +4 -0
- qalita/_frontend/.next/static/chunks/30ea11065999f7ac.js +1 -0
- qalita/_frontend/.next/static/chunks/4dd28bc3f722184a.js +2 -0
- qalita/_frontend/.next/static/chunks/711d597b816a80c1.js +1 -0
- qalita/_frontend/.next/static/chunks/7340adf74ff47ec0.js +1 -0
- qalita/_frontend/.next/static/chunks/a6dad97d9634a72d.js.map +1 -0
- qalita/_frontend/.next/static/chunks/{e393fec0d8ba175d.js → ecf559101be0ae12.js} +3 -3
- qalita/_frontend/.next/static/chunks/turbopack-25186fc8e1264445.js +4 -0
- qalita/_frontend/node_modules/@img/sharp-libvips-linux-x64/versions.json +30 -0
- qalita/_frontend/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
- qalita/_frontend/node_modules/@next/env/package.json +4 -4
- qalita/_frontend/node_modules/next/dist/build/analyze/index.js +242 -0
- qalita/_frontend/node_modules/next/dist/build/define-env.js +22 -13
- qalita/_frontend/node_modules/next/dist/build/entries.js +5 -5
- qalita/_frontend/node_modules/next/dist/build/generate-routes-manifest.js +91 -0
- qalita/_frontend/node_modules/next/dist/build/index.js +172 -223
- qalita/_frontend/node_modules/next/dist/build/output/log.js +4 -7
- qalita/_frontend/node_modules/next/dist/build/segment-config/app/app-segments.js +23 -99
- qalita/_frontend/node_modules/next/dist/build/segment-config/app/collect-root-param-keys.js +3 -3
- qalita/_frontend/node_modules/next/dist/build/spinner.js +3 -3
- qalita/_frontend/node_modules/next/dist/build/static-paths/app/extract-pathname-route-param-segments-from-loader-tree.js +137 -0
- qalita/_frontend/node_modules/next/dist/build/static-paths/app.js +69 -210
- qalita/_frontend/node_modules/next/dist/build/static-paths/utils.js +83 -11
- qalita/_frontend/node_modules/next/dist/build/swc/index.js +10 -6
- qalita/_frontend/node_modules/next/dist/build/templates/app-page.js +21 -14
- qalita/_frontend/node_modules/next/dist/build/templates/app-route.js +8 -10
- qalita/_frontend/node_modules/next/dist/build/templates/edge-app-route.js +7 -10
- qalita/_frontend/node_modules/next/dist/build/templates/edge-ssr-app.js +16 -20
- qalita/_frontend/node_modules/next/dist/build/templates/edge-ssr.js +20 -14
- qalita/_frontend/node_modules/next/dist/build/templates/edge-wrapper.js +24 -0
- qalita/_frontend/node_modules/next/dist/build/templates/middleware.js +7 -6
- qalita/_frontend/node_modules/next/dist/build/templates/pages-edge-api.js +3 -2
- qalita/_frontend/node_modules/next/dist/build/turbopack-analyze/index.js +116 -0
- qalita/_frontend/node_modules/next/dist/build/turbopack-build/impl.js +2 -1
- qalita/_frontend/node_modules/next/dist/build/type-check.js +7 -8
- qalita/_frontend/node_modules/next/dist/build/utils.js +45 -4
- qalita/_frontend/node_modules/next/dist/build/validate-app-paths.js +242 -0
- qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js +20 -2
- qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js +2 -5
- qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-edge-ssr-loader/index.js +4 -11
- qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-root-params-loader.js +1 -1
- qalita/_frontend/node_modules/next/dist/build/webpack/plugins/flight-manifest-plugin.js +1 -1
- qalita/_frontend/node_modules/next/dist/build/webpack/plugins/middleware-plugin.js +3 -0
- qalita/_frontend/node_modules/next/dist/build/webpack-build/impl.js +1 -0
- qalita/_frontend/node_modules/next/dist/build/webpack-config.js +35 -3
- qalita/_frontend/node_modules/next/dist/cli/next-test.js +3 -5
- qalita/_frontend/node_modules/next/dist/client/components/app-router-headers.js +5 -0
- qalita/_frontend/node_modules/next/dist/client/components/app-router-instance.js +3 -11
- qalita/_frontend/node_modules/next/dist/client/components/app-router.js +8 -28
- qalita/_frontend/node_modules/next/dist/client/components/navigation-devtools.js +5 -7
- qalita/_frontend/node_modules/next/dist/client/components/navigation.js +4 -3
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/create-initial-router-state.js +3 -22
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +6 -18
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js +844 -590
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/hmr-refresh-reducer.js +4 -76
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js +21 -18
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/refresh-reducer.js +48 -85
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/restore-reducer.js +25 -10
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/server-action-reducer.js +126 -113
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/server-patch-reducer.js +30 -39
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js +0 -1
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/router-reducer.js +2 -2
- qalita/_frontend/node_modules/next/dist/client/components/segment-cache/cache-map.js +13 -18
- qalita/_frontend/node_modules/next/dist/client/components/segment-cache/cache.js +27 -14
- qalita/_frontend/node_modules/next/dist/client/components/segment-cache/lru.js +3 -1
- qalita/_frontend/node_modules/next/dist/client/components/segment-cache/navigation.js +176 -133
- qalita/_frontend/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +12 -12
- qalita/_frontend/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +12 -12
- qalita/_frontend/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +3 -3
- qalita/_frontend/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +10 -10
- qalita/_frontend/node_modules/next/dist/compiled/react-is/package.json +1 -1
- qalita/_frontend/node_modules/next/dist/lib/build-custom-route.js +4 -4
- qalita/_frontend/node_modules/next/dist/lib/constants.js +0 -5
- qalita/_frontend/node_modules/next/dist/lib/default-transpiled-packages.json +1 -0
- qalita/_frontend/node_modules/next/dist/lib/generate-interception-routes-rewrites.js +0 -1
- qalita/_frontend/node_modules/next/dist/lib/helpers/get-npx-command.js +3 -3
- qalita/_frontend/node_modules/next/dist/lib/inline-static-env.js +1 -1
- qalita/_frontend/node_modules/next/dist/lib/known-edge-safe-packages.json +1 -0
- qalita/_frontend/node_modules/next/dist/lib/metadata/metadata.js +17 -11
- qalita/_frontend/node_modules/next/dist/lib/needs-experimental-react.js +2 -2
- qalita/_frontend/node_modules/next/dist/lib/resolve-build-paths.js +44 -76
- qalita/_frontend/node_modules/next/dist/lib/server-external-packages.jsonc +103 -0
- qalita/_frontend/node_modules/next/dist/lib/static-env.js +6 -6
- qalita/_frontend/node_modules/next/dist/lib/turbopack-warning.js +3 -5
- qalita/_frontend/node_modules/next/dist/lib/typescript/runTypeCheck.js +61 -5
- qalita/_frontend/node_modules/next/dist/lib/typescript/type-paths.js +56 -0
- qalita/_frontend/node_modules/next/dist/lib/typescript/writeConfigurationDefaults.js +6 -17
- qalita/_frontend/node_modules/next/dist/lib/verify-typescript-setup.js +10 -2
- qalita/_frontend/node_modules/next/dist/lib/worker.js +17 -9
- qalita/_frontend/node_modules/next/dist/server/app-render/action-handler.js +113 -77
- qalita/_frontend/node_modules/next/dist/server/app-render/app-render-prerender-utils.js +36 -15
- qalita/_frontend/node_modules/next/dist/server/app-render/app-render-render-utils.js +36 -15
- qalita/_frontend/node_modules/next/dist/server/app-render/app-render-scheduling.js +188 -0
- qalita/_frontend/node_modules/next/dist/server/app-render/app-render.js +804 -748
- qalita/_frontend/node_modules/next/dist/server/app-render/collect-segment-data.js +8 -2
- qalita/_frontend/node_modules/next/dist/server/app-render/create-component-styles-and-scripts.js +1 -1
- qalita/_frontend/node_modules/next/dist/server/app-render/create-error-handler.js +42 -75
- qalita/_frontend/node_modules/next/dist/server/app-render/dynamic-rendering.js +127 -14
- qalita/_frontend/node_modules/next/dist/server/app-render/encryption-utils.js +3 -108
- qalita/_frontend/node_modules/next/dist/server/app-render/encryption.js +4 -3
- qalita/_frontend/node_modules/next/dist/server/app-render/flight-render-result.js +3 -2
- qalita/_frontend/node_modules/next/dist/server/app-render/get-css-inlined-link-tags.js +9 -8
- qalita/_frontend/node_modules/next/dist/server/app-render/get-layer-assets.js +1 -1
- qalita/_frontend/node_modules/next/dist/server/app-render/manifests-singleton.js +257 -0
- qalita/_frontend/node_modules/next/dist/server/app-render/prospective-render-utils.js +25 -8
- qalita/_frontend/node_modules/next/dist/server/app-render/staged-rendering.js +161 -15
- qalita/_frontend/node_modules/next/dist/server/app-render/use-flight-response.js +67 -20
- qalita/_frontend/node_modules/next/dist/server/app-render/walk-tree-with-flight-router-state.js +2 -2
- qalita/_frontend/node_modules/next/dist/server/async-storage/work-store.js +2 -1
- qalita/_frontend/node_modules/next/dist/server/base-server.js +32 -23
- qalita/_frontend/node_modules/next/dist/server/capsize-font-metrics.json +181516 -0
- qalita/_frontend/node_modules/next/dist/server/config-schema.js +8 -1
- qalita/_frontend/node_modules/next/dist/server/config-shared.js +83 -2
- qalita/_frontend/node_modules/next/dist/server/config.js +24 -17
- qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-rspack.js +171 -0
- qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +37 -25
- qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-types.js +1 -0
- qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-webpack.js +62 -57
- qalita/_frontend/node_modules/next/dist/server/dev/log-requests.js +11 -3
- qalita/_frontend/node_modules/next/dist/server/dev/messages.js +10 -0
- qalita/_frontend/node_modules/next/dist/server/dev/serialized-errors.js +67 -0
- qalita/_frontend/node_modules/next/dist/server/dev/static-paths-worker.js +10 -0
- qalita/_frontend/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- qalita/_frontend/node_modules/next/dist/server/lib/chrome-devtools-workspace.js +2 -2
- qalita/_frontend/node_modules/next/dist/server/lib/dev-bundler-service.js +6 -10
- qalita/_frontend/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +4 -4
- qalita/_frontend/node_modules/next/dist/server/lib/lazy-result.js +1 -1
- qalita/_frontend/node_modules/next/dist/server/lib/patch-fetch.js +9 -9
- qalita/_frontend/node_modules/next/dist/server/lib/router-server.js +43 -29
- qalita/_frontend/node_modules/next/dist/server/lib/router-utils/build-prefetch-segment-data-route.js +0 -21
- qalita/_frontend/node_modules/next/dist/server/lib/router-utils/filesystem.js +2 -7
- qalita/_frontend/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +8 -4
- qalita/_frontend/node_modules/next/dist/server/lib/start-server.js +3 -3
- qalita/_frontend/node_modules/next/dist/server/lib/trace/tracer.js +4 -0
- qalita/_frontend/node_modules/next/dist/server/load-components.js +3 -9
- qalita/_frontend/node_modules/next/dist/server/next-server.js +19 -18
- qalita/_frontend/node_modules/next/dist/server/next.js +1 -1
- qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js +570 -0
- qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/utils.js +60 -3
- qalita/_frontend/node_modules/next/dist/server/node-environment.js +1 -0
- qalita/_frontend/node_modules/next/dist/server/patch-error-inspect.js +7 -4
- qalita/_frontend/node_modules/next/dist/server/request/fallback-params.js +23 -66
- qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/module.js +2 -2
- qalita/_frontend/node_modules/next/dist/server/route-modules/pages/pages-handler.js +6 -3
- qalita/_frontend/node_modules/next/dist/server/route-modules/route-module.js +79 -18
- qalita/_frontend/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +28 -4
- qalita/_frontend/node_modules/next/dist/server/typescript/rules/config.js +50 -6
- qalita/_frontend/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +68 -23
- qalita/_frontend/node_modules/next/dist/server/web/edge-route-module-wrapper.js +7 -5
- qalita/_frontend/node_modules/next/dist/server/web/sandbox/context.js +8 -9
- qalita/_frontend/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +2 -1
- qalita/_frontend/node_modules/next/dist/server/web/spec-extension/revalidate.js +7 -3
- qalita/_frontend/node_modules/next/dist/shared/lib/action-revalidation-kind.js +31 -0
- qalita/_frontend/node_modules/next/dist/shared/lib/constants.js +6 -1
- qalita/_frontend/node_modules/next/dist/shared/lib/deployment-id.js +36 -0
- qalita/_frontend/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
- qalita/_frontend/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js +5 -0
- qalita/_frontend/node_modules/next/dist/shared/lib/router/routes/app.js +122 -0
- qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +20 -49
- qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +6 -6
- qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/interception-prefix-from-param-type.js +33 -0
- qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/resolve-param-value.js +116 -0
- qalita/_frontend/node_modules/next/dist/shared/lib/segment-cache/output-export-prefetch-encoding.js +3 -24
- qalita/_frontend/node_modules/next/dist/shared/lib/segment.js +5 -0
- qalita/_frontend/node_modules/next/dist/shared/lib/turbopack/utils.js +6 -5
- qalita/_frontend/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- qalita/_frontend/node_modules/next/dist/telemetry/events/build.js +11 -0
- qalita/_frontend/node_modules/next/dist/telemetry/events/version.js +2 -2
- qalita/_frontend/node_modules/next/package.json +20 -18
- qalita/_frontend/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/typesMap.json +497 -0
- qalita/_frontend/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
- qalita/_frontend/package.json +3 -3
- qalita/_frontend/server.js +1 -1
- qalita/commands/pack.py +3 -3
- qalita/commands/source.py +1 -1
- qalita/internal/utils.py +11 -7
- qalita/web/app.py +20 -4
- {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/METADATA +1 -1
- {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/RECORD +197 -168
- qalita/_frontend/.next/static/chunks/023d923a37d494fc.js +0 -1
- qalita/_frontend/.next/static/chunks/247eb132b7f7b574.js +0 -1
- qalita/_frontend/.next/static/chunks/bba035711c7e37a2.js +0 -4
- qalita/_frontend/.next/static/chunks/c903f9580a4b6572.js +0 -2
- qalita/_frontend/.next/static/chunks/cbd55ab9639e1e66.js +0 -1
- qalita/_frontend/.next/static/chunks/turbopack-1ad58da399056f41.js +0 -3
- qalita/_frontend/node_modules/next/dist/build/deployment-id.js +0 -18
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/apply-flight-data.js +0 -53
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/apply-router-state-patch-to-tree.js +0 -105
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fill-cache-with-new-subtree-data.js +0 -110
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.js +0 -131
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/handle-segment-mismatch.js +0 -25
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/invalidate-cache-by-router-state.js +0 -32
- qalita/_frontend/node_modules/next/dist/client/components/router-reducer/refetch-inactive-parallel-segments.js +0 -104
- qalita/_frontend/node_modules/next/dist/server/app-render/action-utils.js +0 -90
- qalita/_frontend/node_modules/next/dist/server/normalizers/request/prefetch-rsc.js +0 -31
- /qalita/_frontend/.next/static/{X4_AlYMbCyee-ZVLjCYMg → _0oyfpC7N2IGDMa04TT9R}/_buildManifest.js +0 -0
- /qalita/_frontend/.next/static/{X4_AlYMbCyee-ZVLjCYMg → _0oyfpC7N2IGDMa04TT9R}/_ssgManifest.js +0 -0
- {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/WHEEL +0 -0
- {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/entry_points.txt +0 -0
- {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -8,8 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
calculateFallbackMode: null,
|
|
9
9
|
filterUniqueParams: null,
|
|
10
10
|
generateAllParamCombinations: null,
|
|
11
|
-
generateRouteStaticParams: null
|
|
12
|
-
resolveParallelRouteParams: null
|
|
11
|
+
generateRouteStaticParams: null
|
|
13
12
|
});
|
|
14
13
|
function _export(target, all) {
|
|
15
14
|
for(var name in all)Object.defineProperty(target, name, {
|
|
@@ -35,9 +34,6 @@ _export(exports, {
|
|
|
35
34
|
},
|
|
36
35
|
generateRouteStaticParams: function() {
|
|
37
36
|
return generateRouteStaticParams;
|
|
38
|
-
},
|
|
39
|
-
resolveParallelRouteParams: function() {
|
|
40
|
-
return resolveParallelRouteParams;
|
|
41
37
|
}
|
|
42
38
|
});
|
|
43
39
|
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
@@ -47,11 +43,9 @@ const _fallback = require("../../lib/fallback");
|
|
|
47
43
|
const _utils = require("./utils");
|
|
48
44
|
const _escapepathdelimiters = /*#__PURE__*/ _interop_require_default(require("../../shared/lib/router/utils/escape-path-delimiters"));
|
|
49
45
|
const _createincrementalcache = require("../../export/helpers/create-incremental-cache");
|
|
50
|
-
const _invarianterror = require("../../shared/lib/invariant-error");
|
|
51
46
|
const _getsegmentparam = require("../../shared/lib/router/utils/get-segment-param");
|
|
52
|
-
const _parseloadertree = require("../../shared/lib/router/utils/parse-loader-tree");
|
|
53
|
-
const _interceptionroutes = require("../../shared/lib/router/utils/interception-routes");
|
|
54
47
|
const _emptygeneratestaticparamserror = require("../../shared/lib/errors/empty-generate-static-params-error");
|
|
48
|
+
const _interceptionprefixfromparamtype = require("../../shared/lib/router/utils/interception-prefix-from-param-type");
|
|
55
49
|
function _interop_require_default(obj) {
|
|
56
50
|
return obj && obj.__esModule ? obj : {
|
|
57
51
|
default: obj
|
|
@@ -222,11 +216,11 @@ function calculateFallbackMode(dynamicParams, fallbackRootParams, baseFallbackMo
|
|
|
222
216
|
* @param page - The page to validate.
|
|
223
217
|
* @param regex - The route regex.
|
|
224
218
|
* @param isRoutePPREnabled - Whether the route has partial prerendering enabled.
|
|
225
|
-
* @param
|
|
219
|
+
* @param pathnameSegments - The keys of the parameters.
|
|
226
220
|
* @param rootParamKeys - The keys of the root params.
|
|
227
221
|
* @param routeParams - The list of parameters to validate.
|
|
228
222
|
* @returns The list of validated parameters.
|
|
229
|
-
*/ function validateParams(page, isRoutePPREnabled,
|
|
223
|
+
*/ function validateParams(page, isRoutePPREnabled, pathnameSegments, rootParamKeys, routeParams) {
|
|
230
224
|
const valid = [];
|
|
231
225
|
// Validate that if there are any root params, that the user has provided at
|
|
232
226
|
// least one value for them only if we're using partial prerendering.
|
|
@@ -248,7 +242,7 @@ function calculateFallbackMode(dynamicParams, fallbackRootParams, baseFallbackMo
|
|
|
248
242
|
}
|
|
249
243
|
for (const params of routeParams){
|
|
250
244
|
const item = {};
|
|
251
|
-
for (const { paramName: key, paramType } of
|
|
245
|
+
for (const { paramName: key, paramType } of pathnameSegments){
|
|
252
246
|
const { repeat, optional } = (0, _getsegmentparam.getParamProperties)(paramType);
|
|
253
247
|
let paramValue = params[key];
|
|
254
248
|
if (optional && params.hasOwnProperty(key) && (paramValue === null || paramValue === undefined || paramValue === false)) {
|
|
@@ -286,7 +280,7 @@ function calculateFallbackMode(dynamicParams, fallbackRootParams, baseFallbackMo
|
|
|
286
280
|
}
|
|
287
281
|
return valid;
|
|
288
282
|
}
|
|
289
|
-
function assignErrorIfEmpty(prerenderedRoutes,
|
|
283
|
+
function assignErrorIfEmpty(prerenderedRoutes, pathnameSegments) {
|
|
290
284
|
// If there are no routes to process, exit early.
|
|
291
285
|
if (prerenderedRoutes.length === 0) {
|
|
292
286
|
return;
|
|
@@ -307,7 +301,7 @@ function assignErrorIfEmpty(prerenderedRoutes, childrenRouteParams) {
|
|
|
307
301
|
// for ensuring that routes with the same concrete parameters follow the
|
|
308
302
|
// same path in the Trie, regardless of the original order of properties
|
|
309
303
|
// in the `params` object.
|
|
310
|
-
for (const { paramName: key } of
|
|
304
|
+
for (const { paramName: key } of pathnameSegments){
|
|
311
305
|
// Check if the current route actually has a concrete value for this parameter.
|
|
312
306
|
// If a dynamic segment is not filled (i.e., it's a fallback), it won't have
|
|
313
307
|
// this property, and we stop building the path for this route at this point.
|
|
@@ -406,129 +400,6 @@ function assignErrorIfEmpty(prerenderedRoutes, childrenRouteParams) {
|
|
|
406
400
|
}
|
|
407
401
|
}
|
|
408
402
|
}
|
|
409
|
-
function resolveParallelRouteParams(loaderTree, params, pathname, fallbackRouteParams) {
|
|
410
|
-
// Stack-based traversal with depth and parallel route key tracking
|
|
411
|
-
const stack = [
|
|
412
|
-
{
|
|
413
|
-
tree: loaderTree,
|
|
414
|
-
depth: 0,
|
|
415
|
-
parallelKey: 'children'
|
|
416
|
-
}
|
|
417
|
-
];
|
|
418
|
-
// Parse pathname into segments for depth-based resolution
|
|
419
|
-
const pathSegments = pathname.split('/').filter(Boolean);
|
|
420
|
-
while(stack.length > 0){
|
|
421
|
-
const { tree, depth, parallelKey } = stack.pop();
|
|
422
|
-
const { segment, parallelRoutes } = (0, _parseloadertree.parseLoaderTree)(tree);
|
|
423
|
-
// Only process segments that are in parallel routes (not the main 'children' route)
|
|
424
|
-
if (parallelKey !== 'children') {
|
|
425
|
-
const segmentParam = (0, _getsegmentparam.getSegmentParam)(segment);
|
|
426
|
-
if (segmentParam && !params.hasOwnProperty(segmentParam.param)) {
|
|
427
|
-
const { param: paramName, type: paramType } = segmentParam;
|
|
428
|
-
switch(paramType){
|
|
429
|
-
case 'catchall':
|
|
430
|
-
case 'optional-catchall':
|
|
431
|
-
case 'catchall-intercepted-(..)(..)':
|
|
432
|
-
case 'catchall-intercepted-(.)':
|
|
433
|
-
case 'catchall-intercepted-(..)':
|
|
434
|
-
case 'catchall-intercepted-(...)':
|
|
435
|
-
// If there are any non-parallel fallback route segments, we can't use the
|
|
436
|
-
// pathname to derive the value because it's not complete. We can make
|
|
437
|
-
// this assumption because routes are resolved left to right.
|
|
438
|
-
if (fallbackRouteParams.some((param)=>!param.isParallelRouteParam)) {
|
|
439
|
-
fallbackRouteParams.push((0, _utils.createFallbackRouteParam)(paramName, paramType, true));
|
|
440
|
-
break;
|
|
441
|
-
}
|
|
442
|
-
// For catchall routes in parallel segments, derive from pathname
|
|
443
|
-
// using depth to determine which segments to use
|
|
444
|
-
const remainingSegments = pathSegments.slice(depth);
|
|
445
|
-
// Process segments to handle any embedded dynamic params
|
|
446
|
-
// Track if we encounter any unknown param placeholders
|
|
447
|
-
let hasUnknownParam = false;
|
|
448
|
-
const processedSegments = remainingSegments.flatMap((pathSegment)=>{
|
|
449
|
-
const param = (0, _getsegmentparam.getSegmentParam)(pathSegment);
|
|
450
|
-
if (param) {
|
|
451
|
-
// If the segment is a param placeholder, check if we have its value
|
|
452
|
-
if (!params.hasOwnProperty(param.param)) {
|
|
453
|
-
// Unknown param placeholder in pathname - can't derive full value
|
|
454
|
-
hasUnknownParam = true;
|
|
455
|
-
return undefined;
|
|
456
|
-
}
|
|
457
|
-
// If the segment matches a param, return the param value
|
|
458
|
-
// We don't encode values here as that's handled during retrieval.
|
|
459
|
-
return params[param.param];
|
|
460
|
-
}
|
|
461
|
-
// Otherwise it's a static segment
|
|
462
|
-
return pathSegment;
|
|
463
|
-
}).filter((s)=>s !== undefined);
|
|
464
|
-
// If we encountered any unknown param placeholders, we can't derive
|
|
465
|
-
// the full catch-all value from the pathname, so mark as fallback.
|
|
466
|
-
if (hasUnknownParam) {
|
|
467
|
-
fallbackRouteParams.push((0, _utils.createFallbackRouteParam)(paramName, paramType, true));
|
|
468
|
-
break;
|
|
469
|
-
}
|
|
470
|
-
if (processedSegments.length > 0) {
|
|
471
|
-
params[paramName] = processedSegments;
|
|
472
|
-
} else if (paramType === 'optional-catchall') {
|
|
473
|
-
params[paramName] = [];
|
|
474
|
-
} else {
|
|
475
|
-
// We shouldn't be able to match a catchall segment without any path
|
|
476
|
-
// segments if it's not an optional catchall
|
|
477
|
-
throw Object.defineProperty(new _invarianterror.InvariantError(`Unexpected empty path segments match for a pathname "${pathname}" with param "${paramName}" of type "${paramType}"`), "__NEXT_ERROR_CODE", {
|
|
478
|
-
value: "E792",
|
|
479
|
-
enumerable: false,
|
|
480
|
-
configurable: true
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
break;
|
|
484
|
-
case 'dynamic':
|
|
485
|
-
case 'dynamic-intercepted-(..)(..)':
|
|
486
|
-
case 'dynamic-intercepted-(.)':
|
|
487
|
-
case 'dynamic-intercepted-(..)':
|
|
488
|
-
case 'dynamic-intercepted-(...)':
|
|
489
|
-
// For regular dynamic parameters, take the segment at this depth
|
|
490
|
-
if (depth < pathSegments.length) {
|
|
491
|
-
const pathSegment = pathSegments[depth];
|
|
492
|
-
const param = (0, _getsegmentparam.getSegmentParam)(pathSegment);
|
|
493
|
-
// Check if the segment at this depth is a placeholder for an unknown param
|
|
494
|
-
if (param && !params.hasOwnProperty(param.param)) {
|
|
495
|
-
// The segment is a placeholder like [category] and we don't have the value
|
|
496
|
-
fallbackRouteParams.push((0, _utils.createFallbackRouteParam)(paramName, paramType, true));
|
|
497
|
-
break;
|
|
498
|
-
}
|
|
499
|
-
// If the segment matches a param, use the param value from params object
|
|
500
|
-
// Otherwise it's a static segment, just use it directly
|
|
501
|
-
// We don't encode values here as that's handled during retrieval
|
|
502
|
-
params[paramName] = param ? params[param.param] : pathSegment;
|
|
503
|
-
} else {
|
|
504
|
-
// No segment at this depth, mark as fallback.
|
|
505
|
-
fallbackRouteParams.push((0, _utils.createFallbackRouteParam)(paramName, paramType, true));
|
|
506
|
-
}
|
|
507
|
-
break;
|
|
508
|
-
default:
|
|
509
|
-
paramType;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
// Calculate next depth - increment if this is not a route group and not empty
|
|
514
|
-
let nextDepth = depth;
|
|
515
|
-
// Route groups are like (marketing) or (dashboard), NOT interception routes like (.)photo
|
|
516
|
-
// Interception routes start with markers like (.), (..), (...), (..)(..)) and should increment depth
|
|
517
|
-
const isInterceptionRoute = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((marker)=>segment.startsWith(marker));
|
|
518
|
-
const isRouteGroup = !isInterceptionRoute && segment.startsWith('(') && segment.endsWith(')');
|
|
519
|
-
if (!isRouteGroup && segment !== '') {
|
|
520
|
-
nextDepth++;
|
|
521
|
-
}
|
|
522
|
-
// Add all parallel routes to the stack for processing.
|
|
523
|
-
for (const [key, route] of Object.entries(parallelRoutes)){
|
|
524
|
-
stack.push({
|
|
525
|
-
tree: route,
|
|
526
|
-
depth: nextDepth,
|
|
527
|
-
parallelKey: key
|
|
528
|
-
});
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
403
|
async function generateRouteStaticParams(segments, store, isRoutePPREnabled) {
|
|
533
404
|
// Early return if no segments to process
|
|
534
405
|
if (segments.length === 0) return [];
|
|
@@ -601,7 +472,23 @@ async function generateRouteStaticParams(segments, store, isRoutePPREnabled) {
|
|
|
601
472
|
}
|
|
602
473
|
return currentParams;
|
|
603
474
|
}
|
|
604
|
-
|
|
475
|
+
function createReplacements(segment, paramValue) {
|
|
476
|
+
// Determine the prefix to use for the interception marker.
|
|
477
|
+
let prefix;
|
|
478
|
+
if (segment.paramType) {
|
|
479
|
+
prefix = (0, _interceptionprefixfromparamtype.interceptionPrefixFromParamType)(segment.paramType) ?? '';
|
|
480
|
+
} else {
|
|
481
|
+
prefix = '';
|
|
482
|
+
}
|
|
483
|
+
return {
|
|
484
|
+
pathname: prefix + (0, _utils.encodeParam)(paramValue, (value)=>// Only escape path delimiters if the value is a string, the following
|
|
485
|
+
// version will URL encode the value.
|
|
486
|
+
(0, _escapepathdelimiters.default)(value, true)),
|
|
487
|
+
encodedPathname: prefix + (0, _utils.encodeParam)(paramValue, // URL encode the value.
|
|
488
|
+
encodeURIComponent)
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
async function buildAppStaticPaths({ dir, page, route, distDir, cacheComponents, authInterrupts, segments, isrFlushToDisk, cacheHandler, cacheLifeProfiles, requestHeaders, cacheHandlers, cacheMaxMemorySize, fetchCacheKeyPrefix, nextConfigOutput, ComponentMod, isRoutePPREnabled = false, buildId, rootParamKeys }) {
|
|
605
492
|
if (segments.some((generate)=>{
|
|
606
493
|
var _generate_config;
|
|
607
494
|
return ((_generate_config = generate.config) == null ? void 0 : _generate_config.dynamicParams) === true;
|
|
@@ -623,44 +510,11 @@ async function buildAppStaticPaths({ dir, page, distDir, cacheComponents, authIn
|
|
|
623
510
|
flushToDisk: isrFlushToDisk,
|
|
624
511
|
cacheMaxMemorySize
|
|
625
512
|
});
|
|
626
|
-
|
|
627
|
-
//
|
|
628
|
-
//
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
// This allows us to filter out parallel route params that duplicate non-parallel ones.
|
|
632
|
-
const nonParallelParamNames = new Set();
|
|
633
|
-
for (const segment of segments){
|
|
634
|
-
if (!segment.paramName || !segment.paramType) continue;
|
|
635
|
-
if (!segment.isParallelRouteSegment) {
|
|
636
|
-
nonParallelParamNames.add(segment.paramName);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
// Second pass: collect segments, ensuring non-parallel route params take precedence.
|
|
640
|
-
for (const segment of segments){
|
|
641
|
-
// If this segment doesn't have a param name then it's not param that we
|
|
642
|
-
// need to resolve.
|
|
643
|
-
if (!segment.paramName || !segment.paramType) continue;
|
|
644
|
-
if (segment.isParallelRouteSegment) {
|
|
645
|
-
// Skip parallel route params that are already defined as non-parallel route params.
|
|
646
|
-
// Non-parallel route params take precedence because they appear in the URL pathname.
|
|
647
|
-
if (nonParallelParamNames.has(segment.paramName)) {
|
|
648
|
-
continue;
|
|
649
|
-
}
|
|
650
|
-
// Collect parallel fallback route params for the base route.
|
|
651
|
-
// The actual parallel route param resolution is now handled by
|
|
652
|
-
// resolveParallelRouteParams using the loader tree.
|
|
653
|
-
parallelFallbackRouteParams.push((0, _utils.createFallbackRouteParam)(segment.paramName, segment.paramType, true));
|
|
654
|
-
} else {
|
|
655
|
-
// Collect all the route param keys that are not parallel route params.
|
|
656
|
-
// These are the ones that will be included in the request pathname.
|
|
657
|
-
childrenRouteParamSegments.push({
|
|
658
|
-
name: segment.name,
|
|
659
|
-
paramName: segment.paramName,
|
|
660
|
-
paramType: segment.paramType
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
|
-
}
|
|
513
|
+
// Extract segments that contribute to the pathname.
|
|
514
|
+
// For AppPageRouteModule: Traverses the loader tree to find all segments (including
|
|
515
|
+
// interception routes in parallel slots) that match the pathname
|
|
516
|
+
// For AppRouteRouteModule: Filters the segments array to get non-parallel route params
|
|
517
|
+
const pathnameRouteParamSegments = (0, _utils.extractPathnameRouteParamSegments)(ComponentMod.routeModule, segments, route);
|
|
664
518
|
const afterRunner = new _runwithafter.AfterRunner();
|
|
665
519
|
const store = (0, _workstore.createWorkStore)({
|
|
666
520
|
page,
|
|
@@ -686,7 +540,7 @@ async function buildAppStaticPaths({ dir, page, distDir, cacheComponents, authIn
|
|
|
686
540
|
var _segment_config;
|
|
687
541
|
// Check to see if there are any missing params for segments that have
|
|
688
542
|
// dynamicParams set to false.
|
|
689
|
-
if (segment.paramName && segment.
|
|
543
|
+
if (segment.paramName && segment.paramType && ((_segment_config = segment.config) == null ? void 0 : _segment_config.dynamicParams) === false) {
|
|
690
544
|
for (const params of routeParams){
|
|
691
545
|
if (segment.paramName in params) continue;
|
|
692
546
|
const relative = segment.filePath ? _nodepath.default.relative(dir, segment.filePath) : undefined;
|
|
@@ -697,15 +551,15 @@ async function buildAppStaticPaths({ dir, page, distDir, cacheComponents, authIn
|
|
|
697
551
|
});
|
|
698
552
|
}
|
|
699
553
|
}
|
|
700
|
-
if (segment.
|
|
554
|
+
if (segment.paramName && segment.paramType && typeof segment.generateStaticParams !== 'function') {
|
|
701
555
|
lastDynamicSegmentHadGenerateStaticParams = false;
|
|
702
556
|
} else if (typeof segment.generateStaticParams === 'function') {
|
|
703
557
|
lastDynamicSegmentHadGenerateStaticParams = true;
|
|
704
558
|
}
|
|
705
559
|
}
|
|
706
560
|
// Determine if all the segments have had their parameters provided.
|
|
707
|
-
const hadAllParamsGenerated =
|
|
708
|
-
for (const { paramName } of
|
|
561
|
+
const hadAllParamsGenerated = pathnameRouteParamSegments.length === 0 || routeParams.length > 0 && routeParams.every((params)=>{
|
|
562
|
+
for (const { paramName } of pathnameRouteParamSegments){
|
|
709
563
|
if (paramName in params) continue;
|
|
710
564
|
return false;
|
|
711
565
|
}
|
|
@@ -729,13 +583,16 @@ async function buildAppStaticPaths({ dir, page, distDir, cacheComponents, authIn
|
|
|
729
583
|
// Discover all unique combinations of the routeParams so we can generate
|
|
730
584
|
// routes that won't throw on empty static shell for each of them if
|
|
731
585
|
// they're available.
|
|
732
|
-
paramsToProcess = generateAllParamCombinations(
|
|
733
|
-
//
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
586
|
+
paramsToProcess = generateAllParamCombinations(pathnameRouteParamSegments, routeParams, rootParamKeys);
|
|
587
|
+
// Collect all the fallback route params for the segments.
|
|
588
|
+
const fallbackRouteParams = [];
|
|
589
|
+
for (const segment of segments){
|
|
590
|
+
if (!segment.paramName || !segment.paramType) continue;
|
|
591
|
+
fallbackRouteParams.push({
|
|
592
|
+
paramName: segment.paramName,
|
|
593
|
+
paramType: segment.paramType
|
|
594
|
+
});
|
|
595
|
+
}
|
|
739
596
|
// Add the base route, this is the route with all the placeholders as it's
|
|
740
597
|
// derived from the `page` string.
|
|
741
598
|
prerenderedRoutesByPathname.set(page, {
|
|
@@ -748,18 +605,24 @@ async function buildAppStaticPaths({ dir, page, distDir, cacheComponents, authIn
|
|
|
748
605
|
throwOnEmptyStaticShell: true
|
|
749
606
|
});
|
|
750
607
|
}
|
|
751
|
-
filterUniqueParams(
|
|
608
|
+
filterUniqueParams(pathnameRouteParamSegments, validateParams(page, isRoutePPREnabled, pathnameRouteParamSegments, rootParamKeys, paramsToProcess)).forEach((params)=>{
|
|
752
609
|
let pathname = page;
|
|
753
610
|
let encodedPathname = page;
|
|
754
611
|
const fallbackRouteParams = [];
|
|
755
|
-
for (const { paramName
|
|
756
|
-
const paramValue = params[
|
|
612
|
+
for (const { name, paramName, paramType } of pathnameRouteParamSegments){
|
|
613
|
+
const paramValue = params[paramName];
|
|
757
614
|
if (!paramValue) {
|
|
758
615
|
if (isRoutePPREnabled) {
|
|
759
616
|
// Mark remaining params as fallback params.
|
|
760
|
-
fallbackRouteParams.push(
|
|
761
|
-
|
|
762
|
-
|
|
617
|
+
fallbackRouteParams.push({
|
|
618
|
+
paramName,
|
|
619
|
+
paramType
|
|
620
|
+
});
|
|
621
|
+
for(let i = pathnameRouteParamSegments.findIndex((param)=>param.paramName === paramName) + 1; i < pathnameRouteParamSegments.length; i++){
|
|
622
|
+
fallbackRouteParams.push({
|
|
623
|
+
paramName: pathnameRouteParamSegments[i].paramName,
|
|
624
|
+
paramType: pathnameRouteParamSegments[i].paramType
|
|
625
|
+
});
|
|
763
626
|
}
|
|
764
627
|
break;
|
|
765
628
|
} else {
|
|
@@ -768,27 +631,23 @@ async function buildAppStaticPaths({ dir, page, distDir, cacheComponents, authIn
|
|
|
768
631
|
return;
|
|
769
632
|
}
|
|
770
633
|
}
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
encodedPathname = encodedPathname.replace(segment.name, (0, _utils.encodeParam)(paramValue, encodeURIComponent));
|
|
634
|
+
const replacements = createReplacements({
|
|
635
|
+
paramType
|
|
636
|
+
}, paramValue);
|
|
637
|
+
pathname = pathname.replace(name, // We're replacing the segment name with the replacement pathname
|
|
638
|
+
// which will include the interception marker prefix if it exists.
|
|
639
|
+
replacements.pathname);
|
|
640
|
+
encodedPathname = encodedPathname.replace(name, // We're replacing the segment name with the replacement encoded
|
|
641
|
+
// pathname which will include the encoded param value.
|
|
642
|
+
replacements.encodedPathname);
|
|
781
643
|
}
|
|
782
|
-
// Resolve
|
|
783
|
-
// app page.
|
|
644
|
+
// Resolve all route params from the loader tree if this is from an
|
|
645
|
+
// app page. This processes both regular route params and parallel route params.
|
|
784
646
|
if ('loaderTree' in ComponentMod.routeModule.userland && Array.isArray(ComponentMod.routeModule.userland.loaderTree)) {
|
|
785
|
-
|
|
647
|
+
(0, _utils.resolveRouteParamsFromTree)(ComponentMod.routeModule.userland.loaderTree, params, route, fallbackRouteParams);
|
|
786
648
|
}
|
|
787
649
|
const fallbackRootParams = [];
|
|
788
|
-
for (const { paramName
|
|
789
|
-
// Only add the param to the fallback root params if it's not a
|
|
790
|
-
// parallel route param. They won't contribute to the request pathname.
|
|
791
|
-
if (isParallelRouteParam) continue;
|
|
650
|
+
for (const { paramName } of fallbackRouteParams){
|
|
792
651
|
// If the param is a root param then we can add it to the fallback
|
|
793
652
|
// root params.
|
|
794
653
|
if (rootParamSet.has(paramName)) {
|
|
@@ -812,7 +671,7 @@ async function buildAppStaticPaths({ dir, page, distDir, cacheComponents, authIn
|
|
|
812
671
|
] : undefined;
|
|
813
672
|
// Now we have to set the throwOnEmptyStaticShell for each of the routes.
|
|
814
673
|
if (prerenderedRoutes && cacheComponents) {
|
|
815
|
-
assignErrorIfEmpty(prerenderedRoutes,
|
|
674
|
+
assignErrorIfEmpty(prerenderedRoutes, pathnameRouteParamSegments);
|
|
816
675
|
}
|
|
817
676
|
return {
|
|
818
677
|
fallbackMode,
|
|
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
0 && (module.exports = {
|
|
6
|
-
createFallbackRouteParam: null,
|
|
7
6
|
encodeParam: null,
|
|
8
|
-
|
|
7
|
+
extractPathnameRouteParamSegments: null,
|
|
8
|
+
extractPathnameRouteParamSegmentsFromSegments: null,
|
|
9
|
+
normalizePathname: null,
|
|
10
|
+
resolveRouteParamsFromTree: null
|
|
9
11
|
});
|
|
10
12
|
function _export(target, all) {
|
|
11
13
|
for(var name in all)Object.defineProperty(target, name, {
|
|
@@ -14,16 +16,27 @@ function _export(target, all) {
|
|
|
14
16
|
});
|
|
15
17
|
}
|
|
16
18
|
_export(exports, {
|
|
17
|
-
createFallbackRouteParam: function() {
|
|
18
|
-
return createFallbackRouteParam;
|
|
19
|
-
},
|
|
20
19
|
encodeParam: function() {
|
|
21
20
|
return encodeParam;
|
|
22
21
|
},
|
|
22
|
+
extractPathnameRouteParamSegments: function() {
|
|
23
|
+
return extractPathnameRouteParamSegments;
|
|
24
|
+
},
|
|
25
|
+
extractPathnameRouteParamSegmentsFromSegments: function() {
|
|
26
|
+
return extractPathnameRouteParamSegmentsFromSegments;
|
|
27
|
+
},
|
|
23
28
|
normalizePathname: function() {
|
|
24
29
|
return normalizePathname;
|
|
30
|
+
},
|
|
31
|
+
resolveRouteParamsFromTree: function() {
|
|
32
|
+
return resolveRouteParamsFromTree;
|
|
25
33
|
}
|
|
26
34
|
});
|
|
35
|
+
const _checks = require("../../server/route-modules/checks");
|
|
36
|
+
const _app = require("../../shared/lib/router/routes/app");
|
|
37
|
+
const _parseloadertree = require("../../shared/lib/router/utils/parse-loader-tree");
|
|
38
|
+
const _extractpathnamerouteparamsegmentsfromloadertree = require("./app/extract-pathname-route-param-segments-from-loader-tree");
|
|
39
|
+
const _resolveparamvalue = require("../../shared/lib/router/utils/resolve-param-value");
|
|
27
40
|
function encodeParam(value, encoder) {
|
|
28
41
|
let replaceValue;
|
|
29
42
|
if (Array.isArray(value)) {
|
|
@@ -36,12 +49,71 @@ function encodeParam(value, encoder) {
|
|
|
36
49
|
function normalizePathname(pathname) {
|
|
37
50
|
return pathname.replace(/\\/g, '/').replace(/(?!^)\/$/, '');
|
|
38
51
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
52
|
+
function extractPathnameRouteParamSegments(routeModule, segments, route) {
|
|
53
|
+
// For AppPageRouteModule, use the loaderTree traversal approach
|
|
54
|
+
if ((0, _checks.isAppPageRouteModule)(routeModule)) {
|
|
55
|
+
const { pathnameRouteParamSegments } = (0, _extractpathnamerouteparamsegmentsfromloadertree.extractPathnameRouteParamSegmentsFromLoaderTree)(routeModule.userland.loaderTree, route);
|
|
56
|
+
return pathnameRouteParamSegments;
|
|
57
|
+
}
|
|
58
|
+
return extractPathnameRouteParamSegmentsFromSegments(segments);
|
|
59
|
+
}
|
|
60
|
+
function extractPathnameRouteParamSegmentsFromSegments(segments) {
|
|
61
|
+
// TODO: should we consider what values are already present in the page?
|
|
62
|
+
// For AppRouteRouteModule, filter the segments array to get the route params
|
|
63
|
+
// that contribute to the pathname.
|
|
64
|
+
const result = [];
|
|
65
|
+
for (const segment of segments){
|
|
66
|
+
// Skip segments without param info.
|
|
67
|
+
if (!segment.paramName || !segment.paramType) continue;
|
|
68
|
+
// Collect all the route param keys that contribute to the pathname.
|
|
69
|
+
result.push({
|
|
70
|
+
name: segment.name,
|
|
71
|
+
paramName: segment.paramName,
|
|
72
|
+
paramType: segment.paramType
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
function resolveRouteParamsFromTree(loaderTree, params, route, fallbackRouteParams) {
|
|
78
|
+
// Stack-based traversal with depth tracking
|
|
79
|
+
const stack = [
|
|
80
|
+
{
|
|
81
|
+
tree: loaderTree,
|
|
82
|
+
depth: 0
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
while(stack.length > 0){
|
|
86
|
+
const { tree, depth } = stack.pop();
|
|
87
|
+
const { segment, parallelRoutes } = (0, _parseloadertree.parseLoaderTree)(tree);
|
|
88
|
+
const appSegment = (0, _app.parseAppRouteSegment)(segment);
|
|
89
|
+
// If this segment is a route parameter, then we should process it if it's
|
|
90
|
+
// not already known and is not already marked as a fallback route param.
|
|
91
|
+
if ((appSegment == null ? void 0 : appSegment.type) === 'dynamic' && !params.hasOwnProperty(appSegment.param.paramName) && !fallbackRouteParams.some((param)=>param.paramName === appSegment.param.paramName)) {
|
|
92
|
+
const { paramName, paramType } = appSegment.param;
|
|
93
|
+
const paramValue = (0, _resolveparamvalue.resolveParamValue)(paramName, paramType, depth, route, params);
|
|
94
|
+
if (paramValue !== undefined) {
|
|
95
|
+
params[paramName] = paramValue;
|
|
96
|
+
} else if (paramType !== 'optional-catchall') {
|
|
97
|
+
// If we couldn't resolve the param, mark it as a fallback
|
|
98
|
+
fallbackRouteParams.push({
|
|
99
|
+
paramName,
|
|
100
|
+
paramType
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Calculate next depth - increment if this is not a route group and not empty
|
|
105
|
+
let nextDepth = depth;
|
|
106
|
+
if (appSegment && appSegment.type !== 'route-group' && appSegment.type !== 'parallel-route') {
|
|
107
|
+
nextDepth++;
|
|
108
|
+
}
|
|
109
|
+
// Add all parallel routes to the stack for processing.
|
|
110
|
+
for (const parallelRoute of Object.values(parallelRoutes)){
|
|
111
|
+
stack.push({
|
|
112
|
+
tree: parallelRoute,
|
|
113
|
+
depth: nextDepth
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
45
117
|
}
|
|
46
118
|
|
|
47
119
|
//# sourceMappingURL=utils.js.map
|
|
@@ -130,7 +130,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
130
130
|
}
|
|
131
131
|
return newObj;
|
|
132
132
|
}
|
|
133
|
-
const nextVersion = "16.
|
|
133
|
+
const nextVersion = "16.1.1";
|
|
134
134
|
const ArchName = (0, _os.arch)();
|
|
135
135
|
const PlatformName = (0, _os.platform)();
|
|
136
136
|
function infoLog(...args) {
|
|
@@ -453,6 +453,7 @@ function rustifyOptionEnv(env) {
|
|
|
453
453
|
value
|
|
454
454
|
}));
|
|
455
455
|
}
|
|
456
|
+
const normalizePathOnWindows = (p)=>_path.default.sep === '\\' ? p.replace(/\\/g, '/') : p;
|
|
456
457
|
// TODO(sokra) Support wasm option.
|
|
457
458
|
function bindingToApi(binding, _wasm) {
|
|
458
459
|
const cancel = new class Cancel extends Error {
|
|
@@ -645,9 +646,9 @@ function bindingToApi(binding, _wasm) {
|
|
|
645
646
|
let nextConfigSerializable = {
|
|
646
647
|
...nextConfig
|
|
647
648
|
};
|
|
648
|
-
|
|
649
|
-
// TODO: these functions takes arguments, have to be supported in a different way
|
|
649
|
+
// These values are never read by Turbopack and are potentially non-serializable.
|
|
650
650
|
nextConfigSerializable.exportPathMap = {};
|
|
651
|
+
nextConfigSerializable.generateBuildId = nextConfigSerializable.generateBuildId && {};
|
|
651
652
|
nextConfigSerializable.webpack = nextConfigSerializable.webpack && {};
|
|
652
653
|
if (nextConfigSerializable.modularizeImports) {
|
|
653
654
|
nextConfigSerializable.modularizeImports = Object.fromEntries(Object.entries(nextConfigSerializable.modularizeImports).map(([mod, config])=>[
|
|
@@ -658,21 +659,24 @@ function bindingToApi(binding, _wasm) {
|
|
|
658
659
|
}
|
|
659
660
|
]));
|
|
660
661
|
}
|
|
662
|
+
// These are relative paths, but might be backslash-separated on Windows
|
|
663
|
+
nextConfigSerializable.distDir = normalizePathOnWindows(nextConfigSerializable.distDir);
|
|
664
|
+
nextConfigSerializable.distDirRoot = normalizePathOnWindows(nextConfigSerializable.distDirRoot);
|
|
661
665
|
// loaderFile is an absolute path, we need it to be relative for turbopack.
|
|
662
666
|
if (nextConfigSerializable.images.loaderFile) {
|
|
663
667
|
nextConfigSerializable.images = {
|
|
664
668
|
...nextConfigSerializable.images,
|
|
665
|
-
loaderFile: './' + _path.default.relative(projectPath, nextConfigSerializable.images.loaderFile)
|
|
669
|
+
loaderFile: './' + normalizePathOnWindows(_path.default.relative(projectPath, nextConfigSerializable.images.loaderFile))
|
|
666
670
|
};
|
|
667
671
|
}
|
|
668
672
|
// cacheHandler can be an absolute path, we need it to be relative for turbopack.
|
|
669
673
|
if (nextConfigSerializable.cacheHandler) {
|
|
670
|
-
nextConfigSerializable.cacheHandler = './' + (_path.default.isAbsolute(nextConfigSerializable.cacheHandler) ? _path.default.relative(projectPath, nextConfigSerializable.cacheHandler) : nextConfigSerializable.cacheHandler);
|
|
674
|
+
nextConfigSerializable.cacheHandler = './' + normalizePathOnWindows(_path.default.isAbsolute(nextConfigSerializable.cacheHandler) ? _path.default.relative(projectPath, nextConfigSerializable.cacheHandler) : nextConfigSerializable.cacheHandler);
|
|
671
675
|
}
|
|
672
676
|
if (nextConfigSerializable.cacheHandlers) {
|
|
673
677
|
nextConfigSerializable.cacheHandlers = Object.fromEntries(Object.entries(nextConfigSerializable.cacheHandlers).filter(([_, value])=>value != null).map(([key, value])=>[
|
|
674
678
|
key,
|
|
675
|
-
'./' + (_path.default.isAbsolute(value) ? _path.default.relative(projectPath, value) : value)
|
|
679
|
+
'./' + normalizePathOnWindows(_path.default.isAbsolute(value) ? _path.default.relative(projectPath, value) : value)
|
|
676
680
|
]));
|
|
677
681
|
}
|
|
678
682
|
if (nextConfigSerializable.turbopack != null) {
|