@void/isr 1.4.0 → 1.5.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/dist/core.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/core.d.ts
2
1
  /**
3
2
  * Bump when a cached response accepted by an older writer can no longer be
4
3
  * proven safe to share. Readers reject entries from earlier policies instead
@@ -89,5 +88,4 @@ export declare function serializeHeaders(response: Response): Record<string, str
89
88
  /** Validate page data before storing it as the JSON ISR variant. */
90
89
  export declare function normalizePageDataForJsonCache(raw: string): string | null;
91
90
  /** Extract validated Void Pages data embedded in an HTML response. */
92
- export declare function extractPageDataFromHtml(html: string): string | null;
93
- //#endregion
91
+ export declare function extractPageDataFromHtml(html: string): string | null;
package/dist/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { matchLiteralPattern, matchSegmentPattern } from "@void/edge";
2
- //#region src/core.ts
2
+ // src/core.ts
3
3
  /**
4
4
  * Bump when a cached response accepted by an older writer can no longer be
5
5
  * proven safe to share. Readers reject entries from earlier policies instead
@@ -224,5 +224,4 @@ function extractPageDataFromHtml(html) {
224
224
  const match = html.match(PAGE_DATA_SCRIPT_RE);
225
225
  return match ? normalizePageDataForJsonCache(match[2]) : null;
226
226
  }
227
- //#endregion
228
227
  export { SHARED_CACHE_POLICY_HEADER, SHARED_CACHE_POLICY_VERSION, buildVariantOriginalUrl, decodeIsrCacheEntry, exactQueryAllowlist, extractPageDataFromHtml, hasCurrentSharedCachePolicy, hasSharedCacheOptOut, hasUnlistedQueryParams, isFrameworkDocumentRequest, isSharedCacheableResponse, isStale, isrCacheResponse, markSharedCachePolicy, normalizePageDataForJsonCache, packIsrValue, resolvePageTtl, resolvePathTtl, resolveRevalidateTtl, serializeHeaders, shouldBypassIsr, unpackIsrValue };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { IsrCacheMetadata } from "./core.mjs";
2
- //#region src/index.d.ts
3
2
  /**
4
3
  * Build the normalized path segment for an ISR-cached page.
5
4
  * Root path `/` maps to `__index__` to avoid trailing-slash ambiguity.
@@ -79,5 +78,4 @@ export declare function splitIsrCacheKey(fullKey: string): {
79
78
  export declare function isrEdgeCacheUrl(hostname: string, pathname: string, deploymentId: string, variant: "html" | "json", originalUrl?: string | null): string;
80
79
  /** Like `isrEdgeCacheUrl`, but takes a variant token from `splitIsrCacheKey`. */
81
80
  export declare function isrEdgeCacheUrlForToken(hostname: string, pathname: string, deploymentId: string, variant: "html" | "json", variantToken?: string | null): string;
82
- //#endregion
83
81
  export type { IsrCacheMetadata };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/index.ts
1
+ // src/index.ts
2
2
  /**
3
3
  * ISR cache keys and edge-cache URLs. Writers, readers, and purgers must build
4
4
  * byte-identical keys, so all of them use these helpers.
@@ -154,5 +154,4 @@ function buildIsrEdgeCacheUrl(hostname, pathname, deploymentId, variant, variant
154
154
  if (variantToken) url.searchParams.set("__void_orig", variantToken);
155
155
  return url.toString();
156
156
  }
157
- //#endregion
158
157
  export { canonicalIsrPathname, denormalizeIsrPath, hashOriginalUrl, isrCacheKey, isrCachePrefix, isrCacheVariantPrefix, isrEdgeCacheUrl, isrEdgeCacheUrlForToken, isrLegacyCacheKey, isrLegacyCachePrefix, isrLegacyCacheVariantPrefix, normalizeIsrPath, splitIsrCacheKey };
@@ -2,7 +2,6 @@
2
2
  import { IsrCacheEntry, IsrCacheMetadata, QueryAllowlist, SHARED_CACHE_POLICY_HEADER, SHARED_CACHE_POLICY_VERSION, extractPageDataFromHtml, hasCurrentSharedCachePolicy, hasSharedCacheOptOut, isSharedCacheableResponse, isStale, isrCacheResponse, markSharedCachePolicy, normalizePageDataForJsonCache, packIsrValue, resolvePathTtl, resolveRevalidateTtl, serializeHeaders, shouldBypassIsr, unpackIsrValue } from "./core.mjs";
3
3
  import { canonicalIsrPathname, denormalizeIsrPath, normalizeIsrPath } from "./index.mjs";
4
4
  import { matchSegmentPattern as matchLiteralPattern } from "@void/edge";
5
- //#region src/runtime.d.ts
6
5
  /**
7
6
  * Single-tenant ISR cache for a direct Cloudflare Worker (Void apps and
8
7
  * framework deploy wrappers). Every `ISR_CACHE` (KV) and `caches.default`
@@ -92,5 +91,4 @@ export declare function handleFrameworkIsr(request: Request, env: IsrCacheEnv, c
92
91
  * cache in the background.
93
92
  */
94
93
  export declare function handleIsr(request: Request, env: IsrCacheEnv, ctx: ExecutionContext, options: HandleIsrOptions, render: RenderFn): Promise<Response | null>;
95
- //#endregion
96
94
  export { type IsrCacheEntry, type IsrCacheMetadata, SHARED_CACHE_POLICY_HEADER, SHARED_CACHE_POLICY_VERSION, canonicalIsrPathname, denormalizeIsrPath, extractPageDataFromHtml, hasCurrentSharedCachePolicy, hasSharedCacheOptOut, isSharedCacheableResponse, isStale, isrCacheResponse, markSharedCachePolicy, matchLiteralPattern, normalizeIsrPath, normalizePageDataForJsonCache, packIsrValue, resolvePathTtl, resolveRevalidateTtl, serializeHeaders, shouldBypassIsr, unpackIsrValue };
package/dist/runtime.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { canonicalIsrPathname, denormalizeIsrPath, isrCacheKey, isrCachePrefix, isrCacheVariantPrefix, isrEdgeCacheUrl, normalizeIsrPath } from "./index.mjs";
2
2
  import { SHARED_CACHE_POLICY_HEADER, SHARED_CACHE_POLICY_VERSION, buildVariantOriginalUrl, decodeIsrCacheEntry, extractPageDataFromHtml, hasCurrentSharedCachePolicy, hasSharedCacheOptOut, hasUnlistedQueryParams, isFrameworkDocumentRequest, isSharedCacheableResponse, isStale, isrCacheResponse, markSharedCachePolicy, normalizePageDataForJsonCache, packIsrValue, resolvePageTtl, resolvePathTtl, resolveRevalidateTtl, serializeHeaders, shouldBypassIsr, unpackIsrValue } from "./core.mjs";
3
3
  import { matchSegmentPattern as matchLiteralPattern } from "@void/edge";
4
- //#region src/runtime.ts
4
+ // src/runtime.ts
5
5
  const MAX_ISR_VARIANTS_PER_PATH = 200;
6
6
  const ISR_STALE_EVICT_GRACE_MS = 864e5;
7
7
  const DIRECT_ISR_PROJECT_ID = "__void_direct__";
@@ -354,5 +354,4 @@ async function handleIsrInternal(request, env, ctx, options, render, htmlOnly) {
354
354
  }, variantUrl));
355
355
  return response;
356
356
  }
357
- //#endregion
358
357
  export { MAX_ISR_VARIANTS_PER_PATH, SHARED_CACHE_POLICY_HEADER, SHARED_CACHE_POLICY_VERSION, canonicalIsrPathname, clientRevalidateResponse, cloneWithoutVoidPages, deleteIsrCache, denormalizeIsrPath, extractPageDataFromHtml, handleFrameworkIsr, handleIsr, hasCurrentSharedCachePolicy, hasSharedCacheOptOut, hostRegistryKey, htmlEdgeKey, isEventStreamResponse, isSharedCacheableResponse, isStale, isrCacheResponse, isrKey, isrPrefix, isrVariantPrefix, jsonEdgeKey, listIsrHosts, markSharedCachePolicy, matchLiteralPattern, normalizeIsrPath, normalizePageDataForJsonCache, packIsrValue, populateJsonEdgeCache, readIsrCache, resolvePathTtl, resolveRevalidateTtl, serializeHeaders, shouldBypassIsr, unpackIsrValue, writeIsrCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void/isr",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Incremental revalidation and cache helpers for Void runtimes.",
5
5
  "homepage": "https://void.cloud",
6
6
  "bugs": {
@@ -34,12 +34,12 @@
34
34
  "access": "public"
35
35
  },
36
36
  "dependencies": {
37
- "@cloudflare/workers-types": "^5.20261019.1",
38
- "@void/edge": "1.4.0"
37
+ "@cloudflare/workers-types": "^5.20261102.1",
38
+ "@void/edge": "1.5.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "typescript": "7.0.2",
42
- "vite-plus": "1.3.0"
42
+ "vite-plus": "1.4.0"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "vp pack",