@rangojs/router 0.0.0-experimental.debug-cache-2383ca26 → 0.0.0-experimental.debug-cache-fix

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.
@@ -1745,7 +1745,7 @@ import { resolve } from "node:path";
1745
1745
  // package.json
1746
1746
  var package_default = {
1747
1747
  name: "@rangojs/router",
1748
- version: "0.0.0-experimental.debug-cache-2383ca26",
1748
+ version: "0.0.0-experimental.debug-cache-fix",
1749
1749
  description: "Django-inspired RSC router with composable URL patterns",
1750
1750
  keywords: [
1751
1751
  "react",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rangojs/router",
3
- "version": "0.0.0-experimental.debug-cache-2383ca26",
3
+ "version": "0.0.0-experimental.debug-cache-fix",
4
4
  "description": "Django-inspired RSC router with composable URL patterns",
5
5
  "keywords": [
6
6
  "react",
@@ -349,19 +349,22 @@ export class CacheScope {
349
349
  );
350
350
  }
351
351
 
352
- // For document requests: only cache if ALL segments have components (complete render)
353
- // For partial requests: null components are expected (client already has them)
352
+ // For document requests: only cache if layout segments have components
353
+ // (complete render). Parallel and route segments may legitimately have
354
+ // null components — UI-less @meta parallels return null, and void route
355
+ // handlers produce null when the UI lives in parallel slots/layouts.
356
+ // Partial requests always allow null components (client already has them).
354
357
  if (!isPartial) {
355
- const hasAllComponents = nonLoaderSegments.every(
356
- (s) => s.component !== null,
358
+ const hasIncompleteLayouts = nonLoaderSegments.some(
359
+ (s) => s.component === null && s.type === "layout",
357
360
  );
358
- if (!hasAllComponents) {
361
+ if (hasIncompleteLayouts) {
359
362
  if (INTERNAL_RANGO_DEBUG) {
360
363
  const nullSegments = nonLoaderSegments
361
- .filter((s) => s.component === null)
364
+ .filter((s) => s.component === null && s.type === "layout")
362
365
  .map((s) => s.id);
363
366
  debugCacheLog(
364
- `[CacheScope] waitUntil: SKIPPED (null components: ${nullSegments.join(", ")}) for ${key}`,
367
+ `[CacheScope] waitUntil: SKIPPED (incomplete layouts: ${nullSegments.join(", ")}) for ${key}`,
365
368
  );
366
369
  }
367
370
  return;