@vercel/next 4.3.17 → 4.3.19

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.
Files changed (2) hide show
  1. package/dist/index.js +76 -44
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -11116,7 +11116,8 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
11116
11116
  initialRevalidate: initialRevalidateSeconds === false ? false : Math.max(1, initialRevalidateSeconds),
11117
11117
  dataRoute,
11118
11118
  srcRoute,
11119
- renderingMode: "STATIC" /* STATIC */
11119
+ renderingMode: "STATIC" /* STATIC */,
11120
+ allowHeader: void 0
11120
11121
  };
11121
11122
  });
11122
11123
  lazyRoutes.forEach((lazyRoute) => {
@@ -11127,14 +11128,16 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
11127
11128
  fallback,
11128
11129
  dataRoute,
11129
11130
  dataRouteRegex,
11130
- renderingMode: "STATIC" /* STATIC */
11131
+ renderingMode: "STATIC" /* STATIC */,
11132
+ allowHeader: void 0
11131
11133
  };
11132
11134
  } else {
11133
11135
  ret.blockingFallbackRoutes[lazyRoute] = {
11134
11136
  routeRegex,
11135
11137
  dataRoute,
11136
11138
  dataRouteRegex,
11137
- renderingMode: "STATIC" /* STATIC */
11139
+ renderingMode: "STATIC" /* STATIC */,
11140
+ allowHeader: void 0
11138
11141
  };
11139
11142
  }
11140
11143
  });
@@ -11163,15 +11166,18 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
11163
11166
  let initialHeaders;
11164
11167
  let experimentalBypassFor;
11165
11168
  let prefetchDataRoute;
11169
+ let allowHeader;
11166
11170
  let renderingMode;
11167
11171
  if (manifest.version === 4) {
11168
11172
  initialStatus = manifest.routes[route].initialStatus;
11169
11173
  initialHeaders = manifest.routes[route].initialHeaders;
11170
11174
  experimentalBypassFor = manifest.routes[route].experimentalBypassFor;
11171
11175
  prefetchDataRoute = manifest.routes[route].prefetchDataRoute;
11176
+ allowHeader = manifest.routes[route].allowHeader;
11172
11177
  renderingMode = manifest.routes[route].renderingMode ?? (manifest.routes[route].experimentalPPR ? "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ : "STATIC" /* STATIC */);
11173
11178
  } else {
11174
11179
  renderingMode = "STATIC" /* STATIC */;
11180
+ allowHeader = void 0;
11175
11181
  }
11176
11182
  ret.staticRoutes[route] = {
11177
11183
  initialRevalidate: initialRevalidateSeconds === false ? false : Math.max(1, initialRevalidateSeconds),
@@ -11180,6 +11186,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
11180
11186
  srcRoute,
11181
11187
  initialStatus,
11182
11188
  initialHeaders,
11189
+ allowHeader,
11183
11190
  experimentalBypassFor,
11184
11191
  renderingMode
11185
11192
  };
@@ -11193,6 +11200,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
11193
11200
  let fallbackHeaders;
11194
11201
  let renderingMode = "STATIC" /* STATIC */;
11195
11202
  let fallbackRevalidate;
11203
+ let allowHeader;
11196
11204
  if (manifest.version === 4) {
11197
11205
  experimentalBypassFor = manifest.dynamicRoutes[lazyRoute].experimentalBypassFor;
11198
11206
  prefetchDataRoute = manifest.dynamicRoutes[lazyRoute].prefetchDataRoute;
@@ -11203,6 +11211,7 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
11203
11211
  // using the `experimentalPPR` flag.
11204
11212
  (manifest.dynamicRoutes[lazyRoute].experimentalPPR ? "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ : "STATIC" /* STATIC */);
11205
11213
  fallbackRevalidate = manifest.dynamicRoutes[lazyRoute].fallbackRevalidate;
11214
+ allowHeader = manifest.dynamicRoutes[lazyRoute].allowHeader;
11206
11215
  }
11207
11216
  if (typeof fallback === "string") {
11208
11217
  ret.fallbackRoutes[lazyRoute] = {
@@ -11216,7 +11225,8 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
11216
11225
  prefetchDataRoute,
11217
11226
  prefetchDataRouteRegex,
11218
11227
  fallbackRevalidate,
11219
- renderingMode
11228
+ renderingMode,
11229
+ allowHeader
11220
11230
  };
11221
11231
  } else if (fallback === null) {
11222
11232
  ret.blockingFallbackRoutes[lazyRoute] = {
@@ -11226,7 +11236,8 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
11226
11236
  dataRouteRegex,
11227
11237
  prefetchDataRoute,
11228
11238
  prefetchDataRouteRegex,
11229
- renderingMode
11239
+ renderingMode,
11240
+ allowHeader
11230
11241
  };
11231
11242
  } else {
11232
11243
  ret.omittedRoutes[lazyRoute] = {
@@ -11236,7 +11247,8 @@ async function getPrerenderManifest(entryPath, outputDirectory) {
11236
11247
  dataRouteRegex,
11237
11248
  prefetchDataRoute,
11238
11249
  prefetchDataRouteRegex,
11239
- renderingMode
11250
+ renderingMode,
11251
+ allowHeader
11240
11252
  };
11241
11253
  }
11242
11254
  });
@@ -11683,6 +11695,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
11683
11695
  let initialHeaders;
11684
11696
  let experimentalBypassFor;
11685
11697
  let renderingMode;
11698
+ let allowHeader;
11686
11699
  if (isFallback || isBlocking) {
11687
11700
  const pr = isFallback ? prerenderManifest.fallbackRoutes[routeKey] : prerenderManifest.blockingFallbackRoutes[routeKey];
11688
11701
  initialRevalidate = 1;
@@ -11694,6 +11707,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
11694
11707
  }
11695
11708
  srcRoute = null;
11696
11709
  dataRoute = pr.dataRoute;
11710
+ allowHeader = pr.allowHeader;
11697
11711
  experimentalBypassFor = pr.experimentalBypassFor;
11698
11712
  renderingMode = pr.renderingMode;
11699
11713
  prefetchDataRoute = pr.prefetchDataRoute;
@@ -11701,6 +11715,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
11701
11715
  initialRevalidate = false;
11702
11716
  srcRoute = routeKey;
11703
11717
  dataRoute = prerenderManifest.omittedRoutes[routeKey].dataRoute;
11718
+ allowHeader = prerenderManifest.omittedRoutes[routeKey].allowHeader;
11704
11719
  experimentalBypassFor = prerenderManifest.omittedRoutes[routeKey].experimentalBypassFor;
11705
11720
  renderingMode = prerenderManifest.omittedRoutes[routeKey].renderingMode;
11706
11721
  prefetchDataRoute = prerenderManifest.omittedRoutes[routeKey].prefetchDataRoute;
@@ -11712,6 +11727,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
11712
11727
  dataRoute,
11713
11728
  initialHeaders,
11714
11729
  initialStatus,
11730
+ allowHeader,
11715
11731
  experimentalBypassFor,
11716
11732
  renderingMode,
11717
11733
  prefetchDataRoute
@@ -11939,7 +11955,12 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
11939
11955
  }
11940
11956
  let chain;
11941
11957
  let experimentalStreamingLambdaPath;
11942
- if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && experimentalStreamingLambdaPaths) {
11958
+ if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && routesManifest?.ppr?.chain?.headers) {
11959
+ chain = {
11960
+ outputPath: pathnameToOutputName(entryDirectory, routeKey),
11961
+ headers: routesManifest.ppr.chain.headers
11962
+ };
11963
+ } else if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && experimentalStreamingLambdaPaths) {
11943
11964
  let paths = experimentalStreamingLambdaPaths.get(
11944
11965
  pathnameToOutputName(entryDirectory, routeKey)
11945
11966
  );
@@ -11954,17 +11975,10 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
11954
11975
  );
11955
11976
  }
11956
11977
  experimentalStreamingLambdaPath = paths.output;
11957
- if (routesManifest?.ppr?.chain?.headers) {
11958
- chain = {
11959
- outputPath: pathnameToOutputName(entryDirectory, routeKey),
11960
- headers: routesManifest.ppr.chain.headers
11961
- };
11962
- } else {
11963
- chain = {
11964
- outputPath: paths.output,
11965
- headers: { "x-matched-path": paths.pathname }
11966
- };
11967
- }
11978
+ chain = {
11979
+ outputPath: paths.output,
11980
+ headers: { "x-matched-path": paths.pathname }
11981
+ };
11968
11982
  }
11969
11983
  let htmlAllowQuery = allowQuery;
11970
11984
  if (renderingMode === "PARTIALLY_STATIC" /* PARTIALLY_STATIC */ && isFallback) {
@@ -11983,6 +11997,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
11983
11997
  sourcePath,
11984
11998
  experimentalStreamingLambdaPath,
11985
11999
  chain,
12000
+ allowHeader,
11986
12001
  ...isNotFound ? {
11987
12002
  initialStatus: 404
11988
12003
  } : {},
@@ -12012,6 +12027,7 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12012
12027
  group: prerenderGroup,
12013
12028
  bypassToken: prerenderManifest.bypassToken,
12014
12029
  experimentalBypassFor,
12030
+ allowHeader,
12015
12031
  ...isNotFound ? {
12016
12032
  initialStatus: 404
12017
12033
  } : {},
@@ -13945,31 +13961,33 @@ ${JSON.stringify(
13945
13961
  throw new Error("Invariant: PPR lambda isn't streaming");
13946
13962
  }
13947
13963
  lambdas[outputName] = lambda;
13948
- if (!omittedPrerenderRoutes.has(pagePathname)) {
13949
- const output = getPostponeResumeOutput(entryDirectory, pageName);
13950
- lambdas[output] = lambda;
13951
- experimentalStreamingLambdaPaths.set(outputName, {
13952
- pathname: getPostponeResumePathname(pageName),
13953
- output
13954
- });
13955
- }
13956
- for (const [
13957
- routePathname,
13958
- { srcRoute, renderingMode }
13959
- ] of Object.entries(prerenderManifest.staticRoutes)) {
13960
- if (srcRoute !== pagePathname || renderingMode !== "PARTIALLY_STATIC" /* PARTIALLY_STATIC */)
13961
- continue;
13962
- if (routePathname === pagePathname)
13963
- continue;
13964
- const output = getPostponeResumePathname(routePathname);
13965
- lambdas[output] = lambda;
13966
- outputName = import_path4.default.posix.join(entryDirectory, routePathname);
13967
- experimentalStreamingLambdaPaths.set(outputName, {
13968
- pathname: getPostponeResumePathname(routePathname),
13969
- output
13970
- });
13964
+ if (typeof routesManifest?.ppr?.chain?.headers === "undefined") {
13965
+ if (!omittedPrerenderRoutes.has(pagePathname)) {
13966
+ const output = getPostponeResumeOutput(entryDirectory, pageName);
13967
+ lambdas[output] = lambda;
13968
+ experimentalStreamingLambdaPaths.set(outputName, {
13969
+ pathname: getPostponeResumePathname(pageName),
13970
+ output
13971
+ });
13972
+ }
13973
+ for (const [
13974
+ routePathname,
13975
+ { srcRoute, renderingMode }
13976
+ ] of Object.entries(prerenderManifest.staticRoutes)) {
13977
+ if (srcRoute !== pagePathname || renderingMode !== "PARTIALLY_STATIC" /* PARTIALLY_STATIC */)
13978
+ continue;
13979
+ if (routePathname === pagePathname)
13980
+ continue;
13981
+ const output = getPostponeResumePathname(routePathname);
13982
+ lambdas[output] = lambda;
13983
+ outputName = import_path4.default.posix.join(entryDirectory, routePathname);
13984
+ experimentalStreamingLambdaPaths.set(outputName, {
13985
+ pathname: getPostponeResumePathname(routePathname),
13986
+ output
13987
+ });
13988
+ }
13989
+ continue;
13971
13990
  }
13972
- continue;
13973
13991
  }
13974
13992
  if (!group.isAppRouter && !group.isAppRouteHandler) {
13975
13993
  outputName = normalizeIndexOutput(outputName, true);
@@ -14814,7 +14832,14 @@ ${JSON.stringify(
14814
14832
  }
14815
14833
  ] : [
14816
14834
  {
14817
- src: import_path4.default.posix.join("/", entryDirectory, ".*"),
14835
+ src: import_path4.default.posix.join(
14836
+ "/",
14837
+ entryDirectory,
14838
+ // if entryDirectory is populated we need to
14839
+ // add optional handling for trailing slash so
14840
+ // that the entryDirectory (basePath) itself matches
14841
+ `${entryDirectory !== "." ? "?" : ""}.*`
14842
+ ),
14818
14843
  dest: import_path4.default.posix.join(
14819
14844
  "/",
14820
14845
  entryDirectory,
@@ -14846,7 +14871,14 @@ ${JSON.stringify(
14846
14871
  }
14847
14872
  ] : [
14848
14873
  {
14849
- src: import_path4.default.posix.join("/", entryDirectory, ".*"),
14874
+ src: import_path4.default.posix.join(
14875
+ "/",
14876
+ entryDirectory,
14877
+ // if entryDirectory is populated we need to
14878
+ // add optional handling for trailing slash so
14879
+ // that the entryDirectory (basePath) itself matches
14880
+ `${entryDirectory !== "." ? "?" : ""}.*`
14881
+ ),
14850
14882
  dest: import_path4.default.posix.join(
14851
14883
  "/",
14852
14884
  entryDirectory,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.3.17",
3
+ "version": "4.3.19",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -30,7 +30,7 @@
30
30
  "@types/semver": "6.0.0",
31
31
  "@types/text-table": "0.2.1",
32
32
  "@types/webpack-sources": "3.2.0",
33
- "@vercel/build-utils": "8.4.11",
33
+ "@vercel/build-utils": "8.4.12",
34
34
  "@vercel/routing-utils": "3.1.0",
35
35
  "async-sema": "3.0.1",
36
36
  "buffer-crc32": "0.2.13",