@void/platform 0.20.3 → 0.21.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 +1 @@
1
- This folder contains the built output assets for the worker "void-runtime-build-dispatch" generated at 2026-09-24T06:17:14.220Z.
1
+ This folder contains the built output assets for the worker "void-runtime-build-dispatch" generated at 2026-09-29T09:51:03.866Z.
@@ -1036,6 +1036,31 @@ function shouldBypassIsr(request) {
1036
1036
  return request.headers.has("Cookie") || request.headers.has("Authorization") || acceptsEventStream(request);
1037
1037
  }
1038
1038
  __name(shouldBypassIsr, "shouldBypassIsr");
1039
+ function isFrameworkDocumentRequest(request) {
1040
+ if (request.method !== "GET" || request.headers.has("X-VoidPages")) {
1041
+ return false;
1042
+ }
1043
+ if (new URL(request.url).pathname.startsWith("/__void/")) {
1044
+ return false;
1045
+ }
1046
+ const acceptsHtml = request.headers.get("accept")?.split(",").some((value) => value.trim().toLowerCase().split(";", 1)[0] === "text/html");
1047
+ if (!acceptsHtml) {
1048
+ return false;
1049
+ }
1050
+ const mode = request.headers.get("sec-fetch-mode")?.toLowerCase();
1051
+ if (mode && mode !== "navigate") {
1052
+ return false;
1053
+ }
1054
+ const destination = request.headers.get("sec-fetch-dest")?.toLowerCase();
1055
+ if (destination && destination !== "document") {
1056
+ return false;
1057
+ }
1058
+ if (request.headers.has("rsc") || request.headers.has("x-nextjs-data")) {
1059
+ return false;
1060
+ }
1061
+ return true;
1062
+ }
1063
+ __name(isFrameworkDocumentRequest, "isFrameworkDocumentRequest");
1039
1064
  function hasSharedCacheOptOut(response) {
1040
1065
  if (response.headers.has("Set-Cookie")) {
1041
1066
  return true;
@@ -2261,7 +2286,7 @@ var index_default = {
2261
2286
  }
2262
2287
  }
2263
2288
  }
2264
- const isSsrPath = routing.ssr === true && isIsrEligiblePath(pathname, routing.pages, routing.revalidate, routing.pathRevalidate);
2289
+ const isSsrPath = routing.ssr === true && (routing.type !== "framework" || isFrameworkDocumentRequest(request)) && isIsrEligiblePath(pathname, routing.pages, routing.revalidate, routing.pathRevalidate);
2265
2290
  if (isSsrPath && (routing.revalidate || routing.pages?.length)) {
2266
2291
  const isrTtl = resolvePageTtl(
2267
2292
  routing.pages,
@@ -2471,7 +2496,7 @@ var index_default = {
2471
2496
  return meter(workerResponse);
2472
2497
  }
2473
2498
  const ttl = resolveRevalidateTtl(workerResponse, isrTtl);
2474
- if (ttl > 0 && workerResponse.status === 200 && !isApiPath(effectiveMissPathname) && !hasSharedCacheOptOut(workerResponse) && (!missFallbackApplied || isFallbackTargetCacheable(
2499
+ if (ttl > 0 && workerResponse.status === 200 && (routing.type !== "framework" || isHtmlResponse(workerResponse)) && !isApiPath(effectiveMissPathname) && !hasSharedCacheOptOut(workerResponse) && (!missFallbackApplied || isFallbackTargetCacheable(
2475
2500
  routing.pages,
2476
2501
  effectiveMissPathname,
2477
2502
  workerResponse,
@@ -2518,7 +2543,7 @@ var index_default = {
2518
2543
  workerResponseFailureKind ? { failureKind: workerResponseFailureKind } : void 0
2519
2544
  );
2520
2545
  }
2521
- if (workerResponse.status === 200 && !missFallbackApplied && (ttl === 0 || hasSharedCacheOptOut(workerResponse))) {
2546
+ if (workerResponse.status === 200 && !missFallbackApplied && (ttl === 0 || hasSharedCacheOptOut(workerResponse) || routing.type === "framework" && !isHtmlResponse(workerResponse))) {
2522
2547
  ctx.waitUntil(purgePoisonedIsrEntry());
2523
2548
  }
2524
2549
  return meter(
@@ -2764,7 +2789,7 @@ var index_default = {
2764
2789
  routing.pathRevalidate,
2765
2790
  sharedIsrEntry.pathname
2766
2791
  )
2767
- ) === 0 || hasSharedCacheOptOut(response))) {
2792
+ ) === 0 || hasSharedCacheOptOut(response) || routing.type === "framework" && !isHtmlResponse(response))) {
2768
2793
  ctx.waitUntil(deleteSharedIsrEntry(env, sharedIsrEntry));
2769
2794
  }
2770
2795
  if (staticCacheKey && !writebackFallbackApplied && isStaticCacheResponseEligible(response)) {
@@ -2787,7 +2812,7 @@ var index_default = {
2787
2812
  if (dynamicType) {
2788
2813
  requestType = dynamicType;
2789
2814
  }
2790
- if ((routing.revalidate || routing.pages?.length) && !isEventStream && !request.headers.has("X-VoidPages") && request.method === "GET" && !request.headers.has("Range") && !shouldBypassIsr(request)) {
2815
+ if ((routing.revalidate || routing.pages?.length) && !isEventStream && !request.headers.has("X-VoidPages") && request.method === "GET" && !request.headers.has("Range") && (routing.type !== "framework" || isFrameworkDocumentRequest(request)) && !shouldBypassIsr(request)) {
2791
2816
  const configTtl = resolvePageTtl(
2792
2817
  routing.pages,
2793
2818
  routing.revalidate,
@@ -2795,7 +2820,7 @@ var index_default = {
2795
2820
  pathname
2796
2821
  );
2797
2822
  const isrTtl = configTtl > 0 ? resolveRevalidateTtl(response, configTtl) : 0;
2798
- if (isrTtl > 0 && response.status === 200 && requestType === "ssr" && !hasSharedCacheOptOut(response) && (!writebackFallbackApplied || isFallbackTargetCacheable(routing.pages, pathname, response, routing.pathRevalidate))) {
2823
+ if (isrTtl > 0 && response.status === 200 && requestType === "ssr" && (routing.type !== "framework" || isHtmlResponse(response)) && !hasSharedCacheOptOut(response) && (!writebackFallbackApplied || isFallbackTargetCacheable(routing.pages, pathname, response, routing.pathRevalidate))) {
2799
2824
  const isrDeploymentId = routing.version ?? "legacy";
2800
2825
  ctx.waitUntil(
2801
2826
  writeIsrCache(
@@ -3181,7 +3206,7 @@ async function revalidateInBackground(env, routing, request, host, pathname, def
3181
3206
  await cache.delete(jsonCacheKey);
3182
3207
  }, "evictSharedEntry");
3183
3208
  const effectiveBgPathname = fallbackResult.applied ? fallbackResult.pathname : pathname;
3184
- if (ttl > 0 && response.status === 200 && !isApiPath(effectiveBgPathname) && !hasSharedCacheOptOut(response) && (!fallbackResult.applied || isFallbackTargetCacheable(
3209
+ if (ttl > 0 && response.status === 200 && (routing.type !== "framework" || isHtmlResponse(response)) && !isApiPath(effectiveBgPathname) && !hasSharedCacheOptOut(response) && (!fallbackResult.applied || isFallbackTargetCacheable(
3185
3210
  routing.pages,
3186
3211
  effectiveBgPathname,
3187
3212
  response,
@@ -3212,7 +3237,7 @@ async function revalidateInBackground(env, routing, request, host, pathname, def
3212
3237
  );
3213
3238
  await populateJsonEdgeCache(cache, jsonCacheKey, response, ttl, "HIT");
3214
3239
  return true;
3215
- } else if (response.status === 200 && !isApiPath(effectiveBgPathname) && !fallbackResult.applied && (ttl === 0 || hasSharedCacheOptOut(response))) {
3240
+ } else if (response.status === 200 && !isApiPath(effectiveBgPathname) && !fallbackResult.applied && (ttl === 0 || hasSharedCacheOptOut(response) || routing.type === "framework" && !isHtmlResponse(response))) {
3216
3241
  try {
3217
3242
  await evictSharedEntry();
3218
3243
  } catch (error) {