@vercel/next 4.15.18 → 4.15.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 +41 -36
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12922,44 +12922,49 @@ var onPrerenderRoute = (prerenderRouteArgs) => async (routeKey, {
12922
12922
  if (outputPathData && renderingMode !== "PARTIALLY_STATIC" /* PARTIALLY_STATIC */) {
12923
12923
  prerenders[normalizePathData(outputPathData)] = prerender;
12924
12924
  } else if (outputPathData && routesManifest?.rsc?.dynamicRSCPrerender && routesManifest?.ppr?.chain?.headers) {
12925
- let contentType = rscContentTypeHeader;
12926
- if (postponedState) {
12927
- contentType = `application/x-nextjs-pre-render; state-length=${postponedState.length}; origin=${JSON.stringify(
12928
- rscContentTypeHeader
12929
- )}`;
12930
- }
12931
- const rdcRSCAllowQuery = isAppClientParamParsingEnabled ? htmlAllowQuery : allowQuery;
12932
- let fallback = null;
12933
- if (rdcRSCAllowQuery && rdcRSCAllowQuery.length === 0 && postponedState) {
12934
- fallback = new import_build_utils.FileBlob({
12935
- data: postponedState,
12936
- contentType
12925
+ const shouldSkipDynamicRsc = Boolean(prefetchDataRoute) && !postponedState;
12926
+ if (shouldSkipDynamicRsc) {
12927
+ prerenders[normalizePathData(outputPathData)] = prerender;
12928
+ } else {
12929
+ let contentType = rscContentTypeHeader;
12930
+ if (postponedState) {
12931
+ contentType = `application/x-nextjs-pre-render; state-length=${postponedState.length}; origin=${JSON.stringify(
12932
+ rscContentTypeHeader
12933
+ )}`;
12934
+ }
12935
+ const rdcRSCAllowQuery = isAppClientParamParsingEnabled ? htmlAllowQuery : allowQuery;
12936
+ let fallback = null;
12937
+ if (rdcRSCAllowQuery && rdcRSCAllowQuery.length === 0 && postponedState) {
12938
+ fallback = new import_build_utils.FileBlob({
12939
+ data: postponedState,
12940
+ contentType
12941
+ });
12942
+ }
12943
+ prerenders[normalizePathData(outputPathData)] = new import_build_utils.Prerender({
12944
+ expiration: initialRevalidate,
12945
+ staleExpiration: initialExpire,
12946
+ lambda,
12947
+ allowQuery: rdcRSCAllowQuery,
12948
+ fallback,
12949
+ group: prerenderGroup,
12950
+ bypassToken: prerenderManifest.bypassToken,
12951
+ experimentalBypassFor,
12952
+ allowHeader,
12953
+ chain: {
12954
+ outputPath: normalizePathData(outputPathData),
12955
+ headers: routesManifest.ppr.chain.headers
12956
+ },
12957
+ ...isNotFound ? { initialStatus: 404 } : {},
12958
+ initialHeaders: {
12959
+ ...initialHeaders,
12960
+ "content-type": contentType,
12961
+ // Dynamic RSC requests cannot be cached, so we explicity set it
12962
+ // here to ensure that the response is not cached by the browser.
12963
+ "cache-control": "private, no-store, no-cache, max-age=0, must-revalidate",
12964
+ vary: rscVaryHeader
12965
+ }
12937
12966
  });
12938
12967
  }
12939
- prerenders[normalizePathData(outputPathData)] = new import_build_utils.Prerender({
12940
- expiration: initialRevalidate,
12941
- staleExpiration: initialExpire,
12942
- lambda,
12943
- allowQuery: rdcRSCAllowQuery,
12944
- fallback,
12945
- group: prerenderGroup,
12946
- bypassToken: prerenderManifest.bypassToken,
12947
- experimentalBypassFor,
12948
- allowHeader,
12949
- chain: {
12950
- outputPath: normalizePathData(outputPathData),
12951
- headers: routesManifest.ppr.chain.headers
12952
- },
12953
- ...isNotFound ? { initialStatus: 404 } : {},
12954
- initialHeaders: {
12955
- ...initialHeaders,
12956
- "content-type": contentType,
12957
- // Dynamic RSC requests cannot be cached, so we explicity set it
12958
- // here to ensure that the response is not cached by the browser.
12959
- "cache-control": "private, no-store, no-cache, max-age=0, must-revalidate",
12960
- vary: rscVaryHeader
12961
- }
12962
- });
12963
12968
  }
12964
12969
  }
12965
12970
  const prefetchSegmentSuffix = routesManifest?.rsc?.prefetchSegmentSuffix;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.15.18",
3
+ "version": "4.15.19",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",