next-leak 0.7.0 → 0.9.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.
@@ -1,4 +1,23 @@
1
1
  import type { PrerenderManifest } from "./manifests.js";
2
+ /**
3
+ * Turns a prerendered value into one that varies per request.
4
+ *
5
+ * A value the build already prerendered is the one value guaranteed *not* to
6
+ * measure anything: every request hits the same warm cache entry and the route
7
+ * reads as flat no matter what it retains. That is a silent false negative, and
8
+ * it lands on exactly the leaks being reported now — `use cache`,
9
+ * `cacheComponents` and ISR all key on the params
10
+ * (vercel/next.js#97938, #97776, #97424, #92287).
11
+ *
12
+ * The prerendered value is still the best hint available: it shows the shape
13
+ * the app accepts. So the shape is kept and only the tail is made to move —
14
+ * `post-0` becomes `post-{n}`, `seed` becomes `seed-{n}`.
15
+ *
16
+ * If the app answers 404 for params it never prerendered, the run says so
17
+ * loudly through its non-2xx count. A noisy 404 is a far better outcome than a
18
+ * quiet `stable`.
19
+ */
20
+ export declare function varyingValueFrom(prerendered: string): string;
2
21
  /**
3
22
  * Sample values lifted from paths the build actually prerendered.
4
23
  *
package/dist/runner.d.ts CHANGED
@@ -18,6 +18,28 @@ export type RouteReport = {
18
18
  status: "failed";
19
19
  reason: string;
20
20
  }
21
+ /**
22
+ * The measured process ran out of heap partway through. This is a verdict,
23
+ * not a failure: the route did not fit in the limit the run gave it, and the
24
+ * outcome decides regardless of the shape of the truncated curve — the same
25
+ * rule the build path applies to a static-generation worker that dies.
26
+ *
27
+ * Kept apart from `measured` because there is no after-snapshot and no
28
+ * complete trend, and dressing it as a full measurement would claim data
29
+ * that does not exist.
30
+ */
31
+ | {
32
+ route: string;
33
+ status: "died-of-heap";
34
+ requestPath: string;
35
+ reason: string;
36
+ /** Post-GC readings up to the death; may be as short as the baseline. */
37
+ memorySamples: HeapSample[];
38
+ peaks: PeakSample[];
39
+ cyclesCompleted: number;
40
+ cyclesRequested: number;
41
+ requestsPerCycle: number;
42
+ }
21
43
  /**
22
44
  * The route was reachable, but the load could not have exercised the code
23
45
  * path it represents — so no verdict is emitted. Measuring an ISR route
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-leak",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Find out whether your Next.js app actually leaks memory — how much, on which route, and whose fault it is.",
5
5
  "keywords": [
6
6
  "nextjs",