@vercel/next 3.2.1 → 3.2.3

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/dist/index.js CHANGED
@@ -45177,7 +45177,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
45177
45177
  fileList = [];
45178
45178
  const curPagesDir = isAppPath && appDir ? appDir : pagesDir;
45179
45179
  const pageDir = path_1.default.dirname(path_1.default.join(curPagesDir, originalPagePath));
45180
- const normalizedBaseDir = `${baseDir}${baseDir.endsWith('/') ? '' : '/'}`;
45180
+ const normalizedBaseDir = `${baseDir}${baseDir.endsWith(path_1.default.sep) ? '' : path_1.default.sep}`;
45181
45181
  files.forEach((file) => {
45182
45182
  const absolutePath = path_1.default.join(pageDir, file);
45183
45183
  // ensure we don't attempt including files outside
@@ -45414,7 +45414,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
45414
45414
  const route = prerenderManifest.notFoundRoutes[i];
45415
45415
  const isLastRoute = i === prerenderManifest.notFoundRoutes.length - 1;
45416
45416
  if (prerenderManifest.staticRoutes[route]?.initialRevalidate === false) {
45417
- if (currentRouteSrc.length + route.length + 1 >= 4096) {
45417
+ if (currentRouteSrc.length + route.length + 1 >= 4000) {
45418
45418
  pushRoute(currentRouteSrc);
45419
45419
  currentRouteSrc = starterRouteSrc;
45420
45420
  }
@@ -45501,7 +45501,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
45501
45501
  if (appPathRoutesManifest) {
45502
45502
  // create .rsc variant for app lambdas and edge functions
45503
45503
  // to match prerenders so we can route the same when the
45504
- // __flight__ header is present
45504
+ // __rsc__ header is present
45505
45505
  const edgeFunctions = middleware.edgeFunctions;
45506
45506
  for (let route of Object.values(appPathRoutesManifest)) {
45507
45507
  route = path_1.default.posix.join('./', route === '/' ? '/index' : route);
@@ -45658,6 +45658,12 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
45658
45658
  .join('|')})?[/]?404/?`,
45659
45659
  status: 404,
45660
45660
  continue: true,
45661
+ missing: [
45662
+ {
45663
+ type: 'header',
45664
+ key: 'x-prerender-revalidate',
45665
+ },
45666
+ ],
45661
45667
  },
45662
45668
  ]
45663
45669
  : [
@@ -45665,6 +45671,12 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
45665
45671
  src: path_1.default.posix.join('/', entryDirectory, '404/?'),
45666
45672
  status: 404,
45667
45673
  continue: true,
45674
+ missing: [
45675
+ {
45676
+ type: 'header',
45677
+ key: 'x-prerender-revalidate',
45678
+ },
45679
+ ],
45668
45680
  },
45669
45681
  ]),
45670
45682
  // Make sure to 500 when visiting /500 directly for static 500
@@ -45700,7 +45712,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
45700
45712
  has: [
45701
45713
  {
45702
45714
  type: 'header',
45703
- key: '__flight__',
45715
+ key: '__rsc__',
45704
45716
  },
45705
45717
  ],
45706
45718
  dest: path_1.default.posix.join('/', entryDirectory, '/$1.rsc'),
@@ -47066,7 +47078,7 @@ const onPrerenderRouteInitial = (prerenderManifest, canUsePreviewMode, entryDire
47066
47078
  exports.onPrerenderRouteInitial = onPrerenderRouteInitial;
47067
47079
  let prerenderGroup = 1;
47068
47080
  const onPrerenderRoute = (prerenderRouteArgs) => (routeKey, { isBlocking, isFallback, isOmitted, locale, }) => {
47069
- const { appDir, pagesDir, hasPages404, static404Page, entryDirectory, prerenderManifest, isSharedLambdas, isServerMode, canUsePreviewMode, lambdas, prerenders, pageLambdaMap, routesManifest, isCorrectNotFoundRoutes, isEmptyAllowQueryForPrendered, } = prerenderRouteArgs;
47081
+ const { appDir, pagesDir, static404Page, entryDirectory, prerenderManifest, isSharedLambdas, isServerMode, canUsePreviewMode, lambdas, prerenders, pageLambdaMap, routesManifest, isCorrectNotFoundRoutes, isEmptyAllowQueryForPrendered, } = prerenderRouteArgs;
47070
47082
  if (isBlocking && isFallback) {
47071
47083
  throw new build_utils_1.NowBuildError({
47072
47084
  code: 'NEXT_ISBLOCKING_ISFALLBACK',
@@ -47190,11 +47202,10 @@ const onPrerenderRoute = (prerenderRouteArgs) => (routeKey, { isBlocking, isFall
47190
47202
  message: 'invariant: htmlFsRef != null && jsonFsRef != null',
47191
47203
  });
47192
47204
  }
47193
- // If revalidate isn't enabled we force the /404 route to be static
47194
- // to match next start behavior otherwise getStaticProps would be
47195
- // recalled for each 404 URL path since Prerender is cached based
47196
- // on the URL path
47197
- if (!canUsePreviewMode || (hasPages404 && routeKey === '/404')) {
47205
+ // if preview mode/On-Demand ISR can't be leveraged
47206
+ // we can output pure static outputs instead of prerenders
47207
+ if (!canUsePreviewMode ||
47208
+ (routeKey === '/404' && !lambdas[outputPathPage])) {
47198
47209
  htmlFsRef.contentType = _1.htmlContentType;
47199
47210
  prerenders[outputPathPage] = htmlFsRef;
47200
47211
  prerenders[outputPathData] = jsonFsRef;
@@ -328,7 +328,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
328
328
  fileList = [];
329
329
  const curPagesDir = isAppPath && appDir ? appDir : pagesDir;
330
330
  const pageDir = path_1.default.dirname(path_1.default.join(curPagesDir, originalPagePath));
331
- const normalizedBaseDir = `${baseDir}${baseDir.endsWith('/') ? '' : '/'}`;
331
+ const normalizedBaseDir = `${baseDir}${baseDir.endsWith(path_1.default.sep) ? '' : path_1.default.sep}`;
332
332
  files.forEach((file) => {
333
333
  const absolutePath = path_1.default.join(pageDir, file);
334
334
  // ensure we don't attempt including files outside
@@ -565,7 +565,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
565
565
  const route = prerenderManifest.notFoundRoutes[i];
566
566
  const isLastRoute = i === prerenderManifest.notFoundRoutes.length - 1;
567
567
  if (prerenderManifest.staticRoutes[route]?.initialRevalidate === false) {
568
- if (currentRouteSrc.length + route.length + 1 >= 4096) {
568
+ if (currentRouteSrc.length + route.length + 1 >= 4000) {
569
569
  pushRoute(currentRouteSrc);
570
570
  currentRouteSrc = starterRouteSrc;
571
571
  }
@@ -652,7 +652,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
652
652
  if (appPathRoutesManifest) {
653
653
  // create .rsc variant for app lambdas and edge functions
654
654
  // to match prerenders so we can route the same when the
655
- // __flight__ header is present
655
+ // __rsc__ header is present
656
656
  const edgeFunctions = middleware.edgeFunctions;
657
657
  for (let route of Object.values(appPathRoutesManifest)) {
658
658
  route = path_1.default.posix.join('./', route === '/' ? '/index' : route);
@@ -809,6 +809,12 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
809
809
  .join('|')})?[/]?404/?`,
810
810
  status: 404,
811
811
  continue: true,
812
+ missing: [
813
+ {
814
+ type: 'header',
815
+ key: 'x-prerender-revalidate',
816
+ },
817
+ ],
812
818
  },
813
819
  ]
814
820
  : [
@@ -816,6 +822,12 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
816
822
  src: path_1.default.posix.join('/', entryDirectory, '404/?'),
817
823
  status: 404,
818
824
  continue: true,
825
+ missing: [
826
+ {
827
+ type: 'header',
828
+ key: 'x-prerender-revalidate',
829
+ },
830
+ ],
819
831
  },
820
832
  ]),
821
833
  // Make sure to 500 when visiting /500 directly for static 500
@@ -851,7 +863,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, privateOutputs
851
863
  has: [
852
864
  {
853
865
  type: 'header',
854
- key: '__flight__',
866
+ key: '__rsc__',
855
867
  },
856
868
  ],
857
869
  dest: path_1.default.posix.join('/', entryDirectory, '/$1.rsc'),
package/dist/utils.js CHANGED
@@ -1027,7 +1027,7 @@ const onPrerenderRouteInitial = (prerenderManifest, canUsePreviewMode, entryDire
1027
1027
  exports.onPrerenderRouteInitial = onPrerenderRouteInitial;
1028
1028
  let prerenderGroup = 1;
1029
1029
  const onPrerenderRoute = (prerenderRouteArgs) => (routeKey, { isBlocking, isFallback, isOmitted, locale, }) => {
1030
- const { appDir, pagesDir, hasPages404, static404Page, entryDirectory, prerenderManifest, isSharedLambdas, isServerMode, canUsePreviewMode, lambdas, prerenders, pageLambdaMap, routesManifest, isCorrectNotFoundRoutes, isEmptyAllowQueryForPrendered, } = prerenderRouteArgs;
1030
+ const { appDir, pagesDir, static404Page, entryDirectory, prerenderManifest, isSharedLambdas, isServerMode, canUsePreviewMode, lambdas, prerenders, pageLambdaMap, routesManifest, isCorrectNotFoundRoutes, isEmptyAllowQueryForPrendered, } = prerenderRouteArgs;
1031
1031
  if (isBlocking && isFallback) {
1032
1032
  throw new build_utils_1.NowBuildError({
1033
1033
  code: 'NEXT_ISBLOCKING_ISFALLBACK',
@@ -1151,11 +1151,10 @@ const onPrerenderRoute = (prerenderRouteArgs) => (routeKey, { isBlocking, isFall
1151
1151
  message: 'invariant: htmlFsRef != null && jsonFsRef != null',
1152
1152
  });
1153
1153
  }
1154
- // If revalidate isn't enabled we force the /404 route to be static
1155
- // to match next start behavior otherwise getStaticProps would be
1156
- // recalled for each 404 URL path since Prerender is cached based
1157
- // on the URL path
1158
- if (!canUsePreviewMode || (hasPages404 && routeKey === '/404')) {
1154
+ // if preview mode/On-Demand ISR can't be leveraged
1155
+ // we can output pure static outputs instead of prerenders
1156
+ if (!canUsePreviewMode ||
1157
+ (routeKey === '/404' && !lambdas[outputPathPage])) {
1159
1158
  htmlFsRef.contentType = _1.htmlContentType;
1160
1159
  prerenders[outputPathPage] = htmlFsRef;
1161
1160
  prerenders[outputPathData] = jsonFsRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -44,7 +44,7 @@
44
44
  "@types/semver": "6.0.0",
45
45
  "@types/text-table": "0.2.1",
46
46
  "@types/webpack-sources": "3.2.0",
47
- "@vercel/build-utils": "5.5.3",
47
+ "@vercel/build-utils": "5.5.4",
48
48
  "@vercel/nft": "0.22.1",
49
49
  "@vercel/routing-utils": "2.0.2",
50
50
  "async-sema": "3.0.1",
@@ -69,5 +69,5 @@
69
69
  "typescript": "4.5.2",
70
70
  "webpack-sources": "3.2.3"
71
71
  },
72
- "gitHead": "8814fc15159c78432375d7bb6a99c2e42125de5d"
72
+ "gitHead": "45bd855250436b73bee892c53f0407e1f24bc689"
73
73
  }