Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@vercel/build-utils

Package Overview
Dependencies
Maintainers
4
Versions
442
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/build-utils - npm Package Compare versions

Comparing version
13.29.1
to
13.30.0
+12
-0
CHANGELOG.md
# @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 {};

@@ -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