@vercel/next 4.21.4 → 4.21.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.
@@ -9581,6 +9581,11 @@ function sha256(input) {
9581
9581
  function fallbackHasFilePath(fallback) {
9582
9582
  return fallback !== void 0 && "filePath" in fallback && typeof fallback.filePath === "string";
9583
9583
  }
9584
+ function getPostponedStateContentType(postponedState, originContentType) {
9585
+ return `application/x-nextjs-pre-render; state-length=${Buffer.byteLength(
9586
+ postponedState
9587
+ )}; origin=${JSON.stringify(originContentType)}`;
9588
+ }
9584
9589
  var copy = async (src, dest) => {
9585
9590
  await import_fs_extra3.default.remove(dest);
9586
9591
  await import_fs_extra3.default.copy(src, dest);
@@ -10059,13 +10064,19 @@ async function handlePrerenderOutputs(prerenderOutputs, {
10059
10064
  `${output.fallback.postponedState}${fallbackContent}`
10060
10065
  );
10061
10066
  const originContentType = isRscOutput ? rscContentType : "text/html; charset=utf-8";
10062
- initialHeaders["content-type"] = `application/x-nextjs-pre-render; state-length=${output.fallback.postponedState.length}; origin=${JSON.stringify(originContentType)}`;
10067
+ initialHeaders["content-type"] = getPostponedStateContentType(
10068
+ output.fallback.postponedState,
10069
+ originContentType
10070
+ );
10063
10071
  } else if (output.fallback?.postponedState && !fallbackHasFilePath(output.fallback) && prerenderFallbackPath) {
10064
10072
  await writeIfNotExists(
10065
10073
  prerenderFallbackPath,
10066
10074
  output.fallback.postponedState
10067
10075
  );
10068
- initialHeaders["content-type"] = `application/x-nextjs-pre-render; state-length=${output.fallback.postponedState.length}; origin=${JSON.stringify(rscContentType)}`;
10076
+ initialHeaders["content-type"] = getPostponedStateContentType(
10077
+ output.fallback.postponedState,
10078
+ rscContentType
10079
+ );
10069
10080
  }
10070
10081
  await import_promises.default.mkdir(import_node_path.default.dirname(prerenderConfigPath), { recursive: true });
10071
10082
  await writeIfNotExists(
package/dist/index.js CHANGED
@@ -12796,7 +12796,10 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12796
12796
  const html = import_fs_extra3.default.readFileSync(htmlPath, "utf8");
12797
12797
  initialHeaders ??= {};
12798
12798
  if (postponedState) {
12799
- initialHeaders["content-type"] = `application/x-nextjs-pre-render; state-length=${postponedState.length}; origin="text/html; charset=utf-8"`;
12799
+ initialHeaders["content-type"] = getPostponedStateContentType(
12800
+ postponedState,
12801
+ "text/html; charset=utf-8"
12802
+ );
12800
12803
  postponedPrerender = postponedState + html;
12801
12804
  didPostpone = true;
12802
12805
  } else {
@@ -13128,9 +13131,10 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
13128
13131
  } else {
13129
13132
  let contentType = rscContentTypeHeader;
13130
13133
  if (postponedState) {
13131
- contentType = `application/x-nextjs-pre-render; state-length=${postponedState.length}; origin=${JSON.stringify(
13134
+ contentType = getPostponedStateContentType(
13135
+ postponedState,
13132
13136
  rscContentTypeHeader
13133
- )}`;
13137
+ );
13134
13138
  }
13135
13139
  const rdcRSCAllowQuery = isAppClientParamParsingEnabled ? htmlAllowQuery : allowQuery;
13136
13140
  let fallback = null;
@@ -13985,6 +13989,11 @@ function normalizePrefetches(prefetches) {
13985
13989
  }
13986
13990
  return updatedPrefetches;
13987
13991
  }
13992
+ function getPostponedStateContentType(postponedState, originContentType) {
13993
+ return `application/x-nextjs-pre-render; state-length=${Buffer.byteLength(
13994
+ postponedState
13995
+ )}; origin=${JSON.stringify(originContentType)}`;
13996
+ }
13988
13997
  function getHTMLPostponedState({
13989
13998
  appDir,
13990
13999
  routeFileNoExt
@@ -16807,6 +16816,7 @@ var build = async (buildOptions) => {
16807
16816
  cliType,
16808
16817
  lockfileVersion,
16809
16818
  packageJsonPackageManager,
16819
+ nodeVersion,
16810
16820
  env: process.env,
16811
16821
  turboSupportsCorepackHome,
16812
16822
  projectCreatedAt: config.projectSettings?.createdAt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.21.4",
3
+ "version": "4.21.6",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -16,7 +16,7 @@
16
16
  "@vercel/nft": "1.10.0"
17
17
  },
18
18
  "devDependencies": {
19
- "@next-community/adapter-vercel": "0.0.1-beta.26",
19
+ "@next-community/adapter-vercel": "0.0.1-beta.27",
20
20
  "@types/aws-lambda": "8.10.19",
21
21
  "@types/buffer-crc32": "0.2.0",
22
22
  "@types/bytes": "3.1.1",
@@ -54,8 +54,8 @@
54
54
  "vite": "6.4.3",
55
55
  "vitest": "4.1.10",
56
56
  "webpack-sources": "3.2.3",
57
- "@vercel/build-utils": "14.1.0",
58
- "@vercel/routing-utils": "6.5.0"
57
+ "@vercel/routing-utils": "6.5.0",
58
+ "@vercel/build-utils": "14.1.1"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "node build.mjs",