@vercel/build-utils 13.27.2 → 13.28.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 13.28.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4e849dd: Add a per-route `hasPostponed` signal to `Prerender`.
8
+
9
+ `@vercel/build-utils` exposes a new optional `hasPostponed?: boolean` field on `Prerender` / `PrerenderOptions`. It is a tri-state: `true` when the route's `.meta` postponed state is present (React suspended during the build-time prerender), `false` when the framework prerendered a Prerender route without postponing, and `undefined` when the framework did not provide the signal.
10
+
11
+ `@vercel/next` populates it for app-router PPR routes (computed from the route's postponed state) and leaves it `undefined` for pages-router and other non-app-router prerenders. This is an additive, finer-grained signal — it does not change the existing `chain` / `experimentalStreamingLambdaPath` behavior — so downstream consumers can distinguish a route that actually postponed from one that has PPR machinery but fully prerendered (e.g. under `cacheComponents: true`).
12
+
3
13
  ## 13.27.2
4
14
 
5
15
  ### Patch Changes
package/dist/index.js CHANGED
@@ -35577,12 +35577,19 @@ var Prerender = class {
35577
35577
  experimentalStreamingLambdaPath,
35578
35578
  chain,
35579
35579
  exposeErrBody,
35580
- partialFallback
35580
+ partialFallback,
35581
+ hasPostponed
35581
35582
  }) {
35582
35583
  this.type = "Prerender";
35583
35584
  this.expiration = expiration;
35584
35585
  this.staleExpiration = staleExpiration;
35585
35586
  this.sourcePath = sourcePath;
35587
+ if (hasPostponed !== void 0 && typeof hasPostponed !== "boolean") {
35588
+ throw new Error(
35589
+ "The `hasPostponed` argument for `Prerender` must be a boolean or undefined."
35590
+ );
35591
+ }
35592
+ this.hasPostponed = hasPostponed;
35586
35593
  this.lambda = lambda;
35587
35594
  if (this.lambda) {
35588
35595
  this.lambda.operationType = this.lambda.operationType || "ISR";
@@ -18,6 +18,7 @@ interface PrerenderOptions {
18
18
  chain?: Chain;
19
19
  exposeErrBody?: boolean;
20
20
  partialFallback?: boolean;
21
+ hasPostponed?: boolean;
21
22
  }
22
23
  export declare class Prerender {
23
24
  type: 'Prerender';
@@ -47,6 +48,13 @@ export declare class Prerender {
47
48
  chain?: Chain;
48
49
  exposeErrBody?: boolean;
49
50
  partialFallback?: boolean;
50
- constructor({ expiration, staleExpiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, exposeErrBody, partialFallback, }: PrerenderOptions);
51
+ /**
52
+ * Set to `true` when the route's `.meta` postponed state is present (React
53
+ * suspended during build prerender). `false` when the framework prerendered
54
+ * a Prerender route without postponing. `undefined` when the framework did
55
+ * not provide the signal.
56
+ */
57
+ hasPostponed?: boolean;
58
+ constructor({ expiration, staleExpiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, exposeErrBody, partialFallback, hasPostponed, }: PrerenderOptions);
51
59
  }
52
60
  export {};
package/dist/prerender.js CHANGED
@@ -39,12 +39,19 @@ class Prerender {
39
39
  experimentalStreamingLambdaPath,
40
40
  chain,
41
41
  exposeErrBody,
42
- partialFallback
42
+ partialFallback,
43
+ hasPostponed
43
44
  }) {
44
45
  this.type = "Prerender";
45
46
  this.expiration = expiration;
46
47
  this.staleExpiration = staleExpiration;
47
48
  this.sourcePath = sourcePath;
49
+ if (hasPostponed !== void 0 && typeof hasPostponed !== "boolean") {
50
+ throw new Error(
51
+ "The `hasPostponed` argument for `Prerender` must be a boolean or undefined."
52
+ );
53
+ }
54
+ this.hasPostponed = hasPostponed;
48
55
  this.lambda = lambda;
49
56
  if (this.lambda) {
50
57
  this.lambda.operationType = this.lambda.operationType || "ISR";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "13.27.2",
3
+ "version": "13.28.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",