@vercel/build-utils
Advanced tools
+12
-0
| # @vercel/build-utils | ||
| ## 13.30.0 | ||
| ### Minor Changes | ||
| - 01e18e8: Add `hasFallback`, `htmlSize`, and `isDynamicRoute` to `Prerender` | ||
| These optional fields surface per-route PPR shell metadata in the Build Output so consumers can classify prerenders (e.g. full shell vs. empty shell vs. concrete prerender): | ||
| - `hasFallback` — whether a dynamic route template had a static fallback (`undefined` for concrete prerenders) | ||
| - `htmlSize` — byte size of the prerendered `.html` shell (`0` for an empty shell, `undefined` when there's no `.html`) | ||
| - `isDynamicRoute` — whether the entry came from a dynamic route template rather than a concrete prerender | ||
| ## 13.29.1 | ||
@@ -4,0 +16,0 @@ |
+23
-1
@@ -22,2 +22,5 @@ import type { File, HasField, Chain } from './types'; | ||
| hasPostponed?: boolean; | ||
| hasFallback?: boolean; | ||
| htmlSize?: number; | ||
| isDynamicRoute?: boolean; | ||
| } | ||
@@ -59,4 +62,23 @@ export declare class Prerender { | ||
| hasPostponed?: boolean; | ||
| constructor({ expiration, staleExpiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, exposeErrBody, partialFallback, hasPostponed, }: PrerenderOptions); | ||
| /** | ||
| * `true` when the route's dynamic template had a static fallback page (the | ||
| * prerender-manifest `fallback` was a string). `false` for blocking/omitted | ||
| * dynamic templates (manifest `fallback` was `null`/`false`). `undefined` for | ||
| * concrete prerenders, where the notion of a fallback doesn't apply. | ||
| */ | ||
| hasFallback?: boolean; | ||
| /** | ||
| * Byte size on disk of the route's prerendered `.html` shell. `0` for an | ||
| * empty shell (PPR template that postponed everything). `undefined` when | ||
| * there's no `.html` on disk (pages router, route handlers, edge). | ||
| */ | ||
| htmlSize?: number; | ||
| /** | ||
| * `true` when this entry came from a dynamic route template (the | ||
| * prerender-manifest `dynamicRoutes` section: fallback, blocking, or omitted) | ||
| * rather than a concrete prerender. | ||
| */ | ||
| isDynamicRoute?: boolean; | ||
| constructor({ expiration, staleExpiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, exposeErrBody, partialFallback, hasPostponed, hasFallback, htmlSize, isDynamicRoute, }: PrerenderOptions); | ||
| } | ||
| export {}; |
+20
-4
@@ -24,2 +24,9 @@ "use strict"; | ||
| module.exports = __toCommonJS(prerender_exports); | ||
| function assertOptionalBoolean(value, name) { | ||
| if (value !== void 0 && typeof value !== "boolean") { | ||
| throw new Error( | ||
| `The \`${name}\` argument for \`Prerender\` must be a boolean or undefined.` | ||
| ); | ||
| } | ||
| } | ||
| class Prerender { | ||
@@ -44,3 +51,6 @@ constructor({ | ||
| partialFallback, | ||
| hasPostponed | ||
| hasPostponed, | ||
| hasFallback, | ||
| htmlSize, | ||
| isDynamicRoute | ||
| }) { | ||
@@ -51,8 +61,14 @@ this.type = "Prerender"; | ||
| this.sourcePath = sourcePath; | ||
| if (hasPostponed !== void 0 && typeof hasPostponed !== "boolean") { | ||
| assertOptionalBoolean(hasPostponed, "hasPostponed"); | ||
| this.hasPostponed = hasPostponed; | ||
| assertOptionalBoolean(hasFallback, "hasFallback"); | ||
| this.hasFallback = hasFallback; | ||
| assertOptionalBoolean(isDynamicRoute, "isDynamicRoute"); | ||
| this.isDynamicRoute = isDynamicRoute; | ||
| if (htmlSize !== void 0 && (!Number.isInteger(htmlSize) || htmlSize < 0)) { | ||
| throw new Error( | ||
| "The `hasPostponed` argument for `Prerender` must be a boolean or undefined." | ||
| "The `htmlSize` argument for `Prerender` must be a non-negative integer or undefined." | ||
| ); | ||
| } | ||
| this.hasPostponed = hasPostponed; | ||
| this.htmlSize = htmlSize; | ||
| this.lambda = lambda; | ||
@@ -59,0 +75,0 @@ if (this.lambda) { |
+3
-3
| { | ||
| "name": "@vercel/build-utils", | ||
| "version": "13.29.1", | ||
| "version": "13.30.0", | ||
| "license": "Apache-2.0", | ||
@@ -58,4 +58,4 @@ "main": "./dist/index.js", | ||
| "yazl": "2.5.1", | ||
| "@vercel/routing-utils": "6.3.0", | ||
| "@vercel/error-utils": "2.2.0" | ||
| "@vercel/error-utils": "2.2.0", | ||
| "@vercel/routing-utils": "6.3.0" | ||
| }, | ||
@@ -62,0 +62,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2077518
0.13%52275
0.1%