@timber-js/app 0.2.0-alpha.242 → 0.2.0-alpha.243

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.
Files changed (177) hide show
  1. package/dist/_chunks/{actions-BkwgRwCl.js → actions-DoTj0Jd3.js} +55 -37
  2. package/dist/_chunks/actions-DoTj0Jd3.js.map +1 -0
  3. package/dist/_chunks/als-registry-C-iwbtvI.js.map +1 -1
  4. package/dist/_chunks/{cache-api-BGA7c5qJ.js → cache-api-D3HmgsFh.js} +4 -4
  5. package/dist/_chunks/{cache-api-BGA7c5qJ.js.map → cache-api-D3HmgsFh.js.map} +1 -1
  6. package/dist/_chunks/{chains-Cuwwjv6T.js → chains-BpvDwp08.js} +2 -2
  7. package/dist/_chunks/{chains-Cuwwjv6T.js.map → chains-BpvDwp08.js.map} +1 -1
  8. package/dist/_chunks/chains-CjlZZ5ad.js +1 -0
  9. package/dist/_chunks/{classify-Y8S9C0Na.js → classify-Bbb_lKjH.js} +2 -2
  10. package/dist/_chunks/{classify-Y8S9C0Na.js.map → classify-Bbb_lKjH.js.map} +1 -1
  11. package/dist/_chunks/{cli-check-KeE1QaIx.js → cli-check-DlQBSKIN.js} +3 -3
  12. package/dist/_chunks/{cli-check-KeE1QaIx.js.map → cli-check-DlQBSKIN.js.map} +1 -1
  13. package/dist/_chunks/{cli-schema-sync-DZEF31wd.js → cli-schema-sync-CWkGFlYu.js} +2 -2
  14. package/dist/_chunks/{cli-schema-sync-DZEF31wd.js.map → cli-schema-sync-CWkGFlYu.js.map} +1 -1
  15. package/dist/_chunks/{cli-schema-sync-_y5O6MIg.js → cli-schema-sync-Dyvdkv_I.js} +1 -1
  16. package/dist/_chunks/{client-dep-entries-DpiwvoDi.js → client-dep-entries-Dka67elj.js} +2 -2
  17. package/dist/_chunks/{client-dep-entries-DpiwvoDi.js.map → client-dep-entries-Dka67elj.js.map} +1 -1
  18. package/dist/_chunks/{convention-lint-0AEsPK2T.js → convention-lint-CGGcseNn.js} +3 -3
  19. package/dist/_chunks/{convention-lint-0AEsPK2T.js.map → convention-lint-CGGcseNn.js.map} +1 -1
  20. package/dist/_chunks/dev-server-DrjLscqT.js +1 -0
  21. package/dist/_chunks/{dev-server-DYDr8KIc.js → dev-server-LO4McfQi.js} +3 -3
  22. package/dist/_chunks/{dev-server-DYDr8KIc.js.map → dev-server-LO4McfQi.js.map} +1 -1
  23. package/dist/_chunks/error-boundary-wuNvAJ4n.js.map +1 -1
  24. package/dist/_chunks/{flight-source-node-KQsX_OhS.js → flight-source-node-BeF00Wo_.js} +2 -2
  25. package/dist/_chunks/{flight-source-node-KQsX_OhS.js.map → flight-source-node-BeF00Wo_.js.map} +1 -1
  26. package/dist/_chunks/{interception-CtNt9jPt.js → interception-D1dCGNmQ.js} +6 -6
  27. package/dist/_chunks/{interception-CtNt9jPt.js.map → interception-D1dCGNmQ.js.map} +1 -1
  28. package/dist/_chunks/{json-lossy-check-BVDALqMf.js → json-lossy-check-DpXneTBm.js} +2 -2
  29. package/dist/_chunks/{json-lossy-check-BVDALqMf.js.map → json-lossy-check-DpXneTBm.js.map} +1 -1
  30. package/dist/_chunks/{live-graph-VhzO7Ol9.js → live-graph-DXhz6A_X.js} +4 -4
  31. package/dist/_chunks/{live-graph-VhzO7Ol9.js.map → live-graph-DXhz6A_X.js.map} +1 -1
  32. package/dist/_chunks/{logger-C4m8rfMy.js → logger-D1sWX2I0.js} +17 -2
  33. package/dist/_chunks/logger-D1sWX2I0.js.map +1 -0
  34. package/dist/_chunks/{node-response-8Vz29cGS.js → node-response-Cp62CtH1.js} +2 -2
  35. package/dist/_chunks/{node-response-8Vz29cGS.js.map → node-response-Cp62CtH1.js.map} +1 -1
  36. package/dist/_chunks/{poison-scan-Dpl3ibG-.js → poison-scan-DdkJoHvP.js} +2 -2
  37. package/dist/_chunks/{poison-scan-Dpl3ibG-.js.map → poison-scan-DdkJoHvP.js.map} +1 -1
  38. package/dist/_chunks/{scanner-CCEHN9Jg.js → scanner-B6V2RqqF.js} +20 -3
  39. package/dist/_chunks/scanner-B6V2RqqF.js.map +1 -0
  40. package/dist/_chunks/{sizeof-CIF7fwSJ.js → sizeof-BKA6qOZq.js} +2 -2
  41. package/dist/_chunks/{sizeof-CIF7fwSJ.js.map → sizeof-BKA6qOZq.js.map} +1 -1
  42. package/dist/_chunks/{walkers-BbotBhNG.js → walkers-BAZoAlfI.js} +3 -3
  43. package/dist/_chunks/{walkers-BbotBhNG.js.map → walkers-BAZoAlfI.js.map} +1 -1
  44. package/dist/adapters/cloudflare-kv-cache.js +1 -1
  45. package/dist/analyze/crawl-entry.js +3 -3
  46. package/dist/analyze/graph-command.js +2 -2
  47. package/dist/cache/index.js +2 -2
  48. package/dist/cache/stores/memory.js +1 -1
  49. package/dist/cli.js +3 -3
  50. package/dist/client/document-withdrawal.d.ts +2 -0
  51. package/dist/client/document-withdrawal.d.ts.map +1 -0
  52. package/dist/client/outlet-content-cache.d.ts +13 -1
  53. package/dist/client/outlet-content-cache.d.ts.map +1 -1
  54. package/dist/client/outlet-scope-context.d.ts +5 -0
  55. package/dist/client/outlet-scope-context.d.ts.map +1 -1
  56. package/dist/client/segment-outlet.d.ts.map +1 -1
  57. package/dist/config-types.d.ts +2 -1
  58. package/dist/config-types.d.ts.map +1 -1
  59. package/dist/index.js +7 -7
  60. package/dist/native/rsc/manifest.json +1 -0
  61. package/dist/native/rsc/server/als-registry.js.map +1 -1
  62. package/dist/native/rsc/server/cookie-context.js +7 -7
  63. package/dist/native/rsc/server/cookie-context.js.map +1 -1
  64. package/dist/native/rsc/server/deny-boundary.js +2 -1
  65. package/dist/native/rsc/server/deny-boundary.js.map +1 -1
  66. package/dist/native/rsc/server/dev-overlay-report.js +13 -0
  67. package/dist/native/rsc/server/dev-overlay-report.js.map +1 -0
  68. package/dist/native/rsc/server/logger.js +6 -1
  69. package/dist/native/rsc/server/logger.js.map +1 -1
  70. package/dist/native/rsc/server/pipeline-interception.js +4 -1
  71. package/dist/native/rsc/server/pipeline-interception.js.map +1 -1
  72. package/dist/native/rsc/server/pipeline.js.map +1 -1
  73. package/dist/native/rsc/server/request-context.js +4 -4
  74. package/dist/native/rsc/server/request-context.js.map +1 -1
  75. package/dist/native/rsc/server/segment-lifetime/read-rule.js +30 -19
  76. package/dist/native/rsc/server/segment-lifetime/read-rule.js.map +1 -1
  77. package/dist/native/rsc/server/segment-lifetime/read-scope.js +48 -7
  78. package/dist/native/rsc/server/segment-lifetime/read-scope.js.map +1 -1
  79. package/dist/native/rsc/server/slot-resolver.js +5 -4
  80. package/dist/native/rsc/server/slot-resolver.js.map +1 -1
  81. package/dist/native/rsc/server/slot-subtree-contain.js +2 -1
  82. package/dist/native/rsc/server/slot-subtree-contain.js.map +1 -1
  83. package/dist/native/rsc/server/subtree-walk.js +14 -5
  84. package/dist/native/rsc/server/subtree-walk.js.map +1 -1
  85. package/dist/native/rsc/server/vite-handoff-rsc.js.map +1 -1
  86. package/dist/native/ssr/client/document-withdrawal.js +17 -0
  87. package/dist/native/ssr/client/document-withdrawal.js.map +1 -0
  88. package/dist/native/ssr/client/outlet-content-cache.js +6 -1
  89. package/dist/native/ssr/client/outlet-content-cache.js.map +1 -1
  90. package/dist/native/ssr/client/outlet-scope-context.js.map +1 -1
  91. package/dist/native/ssr/client/segment-outlet.js +11 -2
  92. package/dist/native/ssr/client/segment-outlet.js.map +1 -1
  93. package/dist/native/ssr/manifest.json +5 -0
  94. package/dist/native/ssr/server/als-registry.js.map +1 -1
  95. package/dist/native/ssr/server/cookie-context.js +7 -7
  96. package/dist/native/ssr/server/cookie-context.js.map +1 -1
  97. package/dist/native/ssr/server/deny-boundary.js +2 -1
  98. package/dist/native/ssr/server/deny-boundary.js.map +1 -1
  99. package/dist/native/ssr/server/dev-overlay-report.js +6 -0
  100. package/dist/native/ssr/server/dev-overlay-report.js.map +1 -0
  101. package/dist/native/ssr/server/logger.js +6 -1
  102. package/dist/native/ssr/server/logger.js.map +1 -1
  103. package/dist/native/ssr/server/pipeline-interception.js +4 -1
  104. package/dist/native/ssr/server/pipeline-interception.js.map +1 -1
  105. package/dist/native/ssr/server/pipeline.js.map +1 -1
  106. package/dist/native/ssr/server/request-context.js +4 -4
  107. package/dist/native/ssr/server/request-context.js.map +1 -1
  108. package/dist/native/ssr/server/segment-lifetime/outlet-gate.js +11 -0
  109. package/dist/native/ssr/server/segment-lifetime/outlet-gate.js.map +1 -0
  110. package/dist/native/ssr/server/segment-lifetime/read-rule.js +30 -19
  111. package/dist/native/ssr/server/segment-lifetime/read-rule.js.map +1 -1
  112. package/dist/native/ssr/server/segment-lifetime/read-scope.js +16 -0
  113. package/dist/native/ssr/server/segment-lifetime/read-scope.js.map +1 -0
  114. package/dist/native/ssr/server/subtree-walk.js +149 -0
  115. package/dist/native/ssr/server/subtree-walk.js.map +1 -0
  116. package/dist/native/ssr/server/utils/element-type.js +21 -9
  117. package/dist/native/ssr/server/utils/element-type.js.map +1 -1
  118. package/dist/native/ssr/server/vite-handoff-rsc.js.map +1 -1
  119. package/dist/routing/index.js +3 -3
  120. package/dist/routing/slot-placement.d.ts +23 -4
  121. package/dist/routing/slot-placement.d.ts.map +1 -1
  122. package/dist/server/als-registry.d.ts +18 -0
  123. package/dist/server/als-registry.d.ts.map +1 -1
  124. package/dist/server/deny-boundary.d.ts.map +1 -1
  125. package/dist/server/dev-overlay-report.d.ts +13 -0
  126. package/dist/server/dev-overlay-report.d.ts.map +1 -0
  127. package/dist/server/index.js +2 -2
  128. package/dist/server/internal.js +97 -8
  129. package/dist/server/internal.js.map +1 -1
  130. package/dist/server/logger.d.ts +10 -0
  131. package/dist/server/logger.d.ts.map +1 -1
  132. package/dist/server/pipeline-interception.d.ts.map +1 -1
  133. package/dist/server/pipeline.d.ts +13 -1
  134. package/dist/server/pipeline.d.ts.map +1 -1
  135. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  136. package/dist/server/segment-lifetime/read-rule.d.ts +14 -18
  137. package/dist/server/segment-lifetime/read-rule.d.ts.map +1 -1
  138. package/dist/server/segment-lifetime/read-scope.d.ts +47 -6
  139. package/dist/server/segment-lifetime/read-scope.d.ts.map +1 -1
  140. package/dist/server/segment-lifetime/slot-outlets.d.ts +1 -1
  141. package/dist/server/slot-resolver.d.ts.map +1 -1
  142. package/dist/server/slot-subtree-contain.d.ts.map +1 -1
  143. package/dist/server/subtree-walk.d.ts +17 -3
  144. package/dist/server/subtree-walk.d.ts.map +1 -1
  145. package/dist/server/vite-handoff-rsc.d.ts +2 -0
  146. package/dist/server/vite-handoff-rsc.d.ts.map +1 -1
  147. package/docs/api/34-api-config.mdx +1 -1
  148. package/package.json +1 -1
  149. package/src/client/document-withdrawal.tsx +41 -0
  150. package/src/client/outlet-content-cache.ts +18 -2
  151. package/src/client/outlet-scope-context.ts +5 -0
  152. package/src/client/segment-outlet.tsx +9 -3
  153. package/src/config-types.ts +2 -1
  154. package/src/routing/interception.ts +5 -5
  155. package/src/routing/slot-placement.ts +41 -4
  156. package/src/server/als-registry.ts +14 -0
  157. package/src/server/cookie-context.ts +7 -7
  158. package/src/server/deny-boundary.ts +4 -1
  159. package/src/server/dev-overlay-report.ts +22 -0
  160. package/src/server/logger.ts +13 -0
  161. package/src/server/pipeline-interception.ts +11 -2
  162. package/src/server/pipeline.ts +13 -1
  163. package/src/server/request-context.ts +6 -6
  164. package/src/server/route-element-builder.ts +2 -2
  165. package/src/server/rsc-entry/index.ts +7 -0
  166. package/src/server/segment-lifetime/read-rule.ts +62 -31
  167. package/src/server/segment-lifetime/read-scope.ts +128 -14
  168. package/src/server/segment-lifetime/slot-outlets.ts +1 -1
  169. package/src/server/slot-resolver.ts +22 -10
  170. package/src/server/slot-subtree-contain.ts +2 -1
  171. package/src/server/subtree-walk.ts +34 -9
  172. package/src/server/vite-handoff-rsc.ts +2 -0
  173. package/dist/_chunks/actions-BkwgRwCl.js.map +0 -1
  174. package/dist/_chunks/chains-LGjBHfSN.js +0 -1
  175. package/dist/_chunks/dev-server-CboXr8zX.js +0 -1
  176. package/dist/_chunks/logger-C4m8rfMy.js.map +0 -1
  177. package/dist/_chunks/scanner-CCEHN9Jg.js.map +0 -1
@@ -41,6 +41,16 @@ export declare function logCsrfRejected(detail: string, data: {
41
41
  path: string;
42
42
  reason: CsrfRejectReason;
43
43
  }): void;
44
+ /**
45
+ * Report a `'document'` segment's read outside its key. The render survives
46
+ * it: the segment degrades to `'request'` for the client that rendered it
47
+ * (design/53-segment-lifetime.md §"Reads outside the key"). Under the dev
48
+ * server it goes to the error overlay, which also prints it; otherwise it is
49
+ * logged at warn, and this line is the only sign the key is wrong.
50
+ */
51
+ export declare function logDocumentReadOutsideKey(error: Error, data: {
52
+ segment: string;
53
+ }): void;
44
54
  /** Log a completed request. Level: info. */
45
55
  export declare function logRequestCompleted(data: {
46
56
  method: string;
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/server/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAIlD,6FAA6F;AAC7F,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxD,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACzD,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC1D;AAQD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAEpD;AA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AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAsCjF;AAID;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,uEAAuE;IACvE,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,OAAO,EACZ,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,UAAU,GAAG,IAAI,GAChC,aAAa,CAwGf;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,UAAU,GACnB,YAAY,EAAE,CAMhB;AAsBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAEvE"}
1
+ {"version":3,"file":"pipeline-interception.d.ts","sourceRoot":"","sources":["../../src/server/pipeline-interception.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAKtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,MAAM,EACtB,mBAAmB,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,EACvD,QAAQ,EAAE,mBAAmB,EAAE,GAC9B,mBAAmB,GAAG,IAAI,CAyB5B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAsCjF;AAID;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,uEAAuE;IACvE,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,OAAO,EACZ,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,UAAU,GAAG,IAAI,GAChC,aAAa,CAiHf;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,UAAU,GACnB,YAAY,EAAE,CAMhB;AAsBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAEvE"}
@@ -66,10 +66,22 @@ export interface RouteMatch {
66
66
  export type RouteMatcher = (pathname: string) => RouteMatch | null;
67
67
  /** Function that matches a canonical pathname to a metadata route. */
68
68
  export type MetadataRouteMatcher = (pathname: string) => import('./route-matcher.ts').MetadataRouteMatch | null;
69
- /** Context for intercepting route resolution (modal pattern). */
69
+ /**
70
+ * The pipeline's decision for a modal-shape interception — which rewrite won,
71
+ * stated once, for the slot resolver to consume rather than re-derive.
72
+ */
70
73
  export interface InterceptionContext {
71
74
  /** The URL the user is navigating TO (the intercepted route). */
72
75
  targetPathname: string;
76
+ /**
77
+ * The winning rewrite's `interceptingScope`: the tree path of the segment
78
+ * whose slots hold the interception. Only that owner's slots intercept. The
79
+ * re-matched chain can pass through other owners with interceptors for the
80
+ * same URL — `app/@modal/(...)photo` above `app/feed/@modal/(..)photo` —
81
+ * and those lost the deepest-scope ranking, so they render as on any other
82
+ * navigation (TIM-1443, design/07-routing.md §"Selection Between Owners").
83
+ */
84
+ interceptingScope: string;
73
85
  }
74
86
  /** Function that renders a matched route into a Response. */
75
87
  export type RouteRenderer = (req: Request, match: RouteMatch, responseHeaders: Headers, interception?: InterceptionContext) => Response | Promise<Response>;
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/server/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAe3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAS5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAK9D;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,mDAAmD;IACnD,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC;;;;OAIG;IACH,aAAa,EAAE,aAAa,CAAC;IAC7B;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACpD,oEAAoE;IACpE,eAAe,EAAE,YAAY,EAAE,CAAC;IAChC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED,6DAA6D;AAC7D,M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,EAAE,uBAAuB,GAChE,OAAO,CAAC,OAAO,wBAAwB,EAAE,uBAAuB,CAAC,CAQnE;8BA4CoB,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC"}
@@ -3,6 +3,12 @@
3
3
  * segment's read scope (`read-scope.ts`, design/53-segment-lifetime.md §"What
4
4
  * a 'document' segment may read"). No React and no render machinery: the
5
5
  * accessors in `request-context.ts` and `cookie-context.ts` import this.
6
+ *
7
+ * A read outside the key is detected and reported in every environment: the
8
+ * dev server's error overlay, or a warning in the log. The read returns its
9
+ * real value, and the component call that read is marked, so its output
10
+ * withdraws the segment from the client (`read-scope.ts`) and the segment renders
11
+ * as `'request'` for that client from then on (design/53 §"Reads outside the key").
6
12
  */
7
13
  import { type DocumentReadScope } from '../als-registry.ts';
8
14
  import type { CoercedParams } from '../../shared/param-value.ts';
@@ -10,44 +16,34 @@ import type { SearchParamsReader } from '../../shared/als-slots.ts';
10
16
  import type { ReadonlyHeaders } from '../request-context.ts';
11
17
  /** The read scope the current render runs in, if it is a `'document'` segment's. */
12
18
  export declare function currentReadScope(): DocumentReadScope | undefined;
13
- /** Which part of a key would allow a read, for the error's fix. */
14
- type KeyPart = 'segmentParams' | 'searchParams' | 'cookies' | 'headers';
15
- /**
16
- * The error for a read outside the key. Names the segment, what was read, and
17
- * the fix: add it to the key, or make the segment `'request'`.
18
- */
19
- export declare function readOutsideKey(scope: DocumentReadScope, what: string, part?: KeyPart,
20
- /** Overrides the fix when adding the read to the key is not possible. */
21
- fixOverride?: string): Error;
22
19
  /**
23
20
  * The request headers as a `'document'` segment may read them: `get` and
24
- * `has` of a header in its key. Any other name throws, and so does reading
21
+ * `has` of a header in its key. Any other name is refused, and so is reading
25
22
  * them all (iteration, `entries`, `forEach`), which could see headers the
26
23
  * key leaves out — the pathname among them.
27
24
  */
28
25
  export declare function keyedHeaders(headers: ReadonlyHeaders, scope: DocumentReadScope): ReadonlyHeaders;
29
- /** Throw if the current render may not read `what` at all (raw search params). */
30
- export declare function assertUnscopedRead(what: string): void;
26
+ /** Refuse the read if the current render may not read `what` at all (raw search params). */
27
+ export declare function checkUnscopedRead(what: string): void;
31
28
  /**
32
- * Throw if the current render reads search-param fields outside its key. A
29
+ * Refuse the read if the current render reads search-param fields outside its key. A
33
30
  * field is in the key only when the key's definition reads it through the
34
31
  * same codec and URL key — a `.pick()` of the keyed definition, or the keyed
35
32
  * definition itself. Another definition with a field of the same name may map
36
33
  * it to another URL parameter or parse it differently.
37
34
  */
38
- export declare function assertSearchParamsRead(reader: SearchParamsReader): void;
35
+ export declare function checkSearchParamsRead(reader: SearchParamsReader): void;
39
36
  /**
40
- * Throw if the current render reads a cookie outside its key. A keyed cookie
37
+ * Refuse the read if the current render reads a cookie outside its key. A keyed cookie
41
38
  * is in the key only as its definition parses it, so it may be read only
42
39
  * through that definition (`codec` is the reader's); a raw read, or another
43
40
  * definition of the same name, could see a difference the key does not.
44
41
  */
45
- export declare function assertCookieRead(name: string, codec?: unknown): void;
42
+ export declare function checkCookieRead(name: string, codec?: unknown): void;
46
43
  /**
47
- * The params a scoped render sees: reading one outside the key throws. Its
44
+ * The params a scoped render sees: reading one outside the key is refused. Its
48
45
  * own keys are only the params in the key, so spreading it, or passing it to
49
46
  * a client component, carries exactly what the segment may depend on.
50
47
  */
51
48
  export declare function scopedParams<T extends CoercedParams>(params: T): T;
52
- export {};
53
49
  //# sourceMappingURL=read-rule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read-rule.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/read-rule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,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D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAG,eAAe,CAyChG;AAED,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAGpD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CActE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAYnE;AAiBD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CA6BlE"}
@@ -5,14 +5,16 @@
5
5
  *
6
6
  * A `'document'` segment is skipped without rendering whenever its key is
7
7
  * unchanged, so anything else it read would freeze silently at its load-time
8
- * value. The rule makes that a thrown error instead, in every environment:
8
+ * value. The rule detects that in every environment, reports it (the dev
9
+ * overlay, or a warning in the log), and degrades the segment to `'request'`
10
+ * for the client (below). What it refuses:
9
11
  *
10
- * - `getSegmentParams()` returns a view that throws on a param outside the key;
11
- * - a search-params definition's `.get()` throws unless every field it reads is
12
- * in the key's definition, and the raw search params throw;
13
- * - the cookie jar throws on a cookie outside the key, and on `getAll()`;
12
+ * - `getSegmentParams()` returns a view that refuses a param outside the key;
13
+ * - a search-params definition's `.get()` is refused unless every field it
14
+ * reads is in the key's definition, and so are the raw search params;
15
+ * - the cookie jar refuses a cookie outside the key, and `getAll()`;
14
16
  * - `getHeaders()` reads only the headers in the key; any other header, and
15
- * iterating them all, throws — and with that the pathname, which no timber
17
+ * iterating them all, is refused — and with that the pathname, which no timber
16
18
  * API exposes to a component except through a header.
17
19
  *
18
20
  * **Reach.** The scope is an AsyncLocalStorage scope around the segment's
@@ -26,7 +28,39 @@
26
28
  * Not covered: values computed outside this render and handed to it — a
27
29
  * `timber.cache` entry an earlier request filled, or a module-level value. The
28
30
  * accessors' checks are `read-rule.ts`.
31
+ *
32
+ * **Degrading.** The read rule reports a refused read, lets it return its
33
+ * real value and marks the component call that made it: each scoped call runs
34
+ * in its own copy of the scope, with a fresh `call` record. The render has
35
+ * already sent the outlet's key digest (the outlet decides before the segment
36
+ * renders), so the content withdraws itself instead: when a call that read
37
+ * outside the key returns, its output gets a `DocumentWithdrawal` marker. The
38
+ * marker sits beside what the read produced, so the client commits it exactly
39
+ * when it commits that content — not in a Suspense fallback or an unrendered
40
+ * prop another component happened to finish in. When it commits, the client
41
+ * drops the segment's entry and records none for that outlet for the rest of
42
+ * the document (`client/outlet-content-cache.ts`). The client never advertises
43
+ * a digest for it again, so every later navigation renders it live —
44
+ * `'request'` for that client.
45
+ *
46
+ * A call that reads and then throws has no output to mark. Its error is
47
+ * remembered, and each catcher that renders a fallback in its place inside an
48
+ * outlet (a deny page, a slot's `default.tsx`) passes the fallback through
49
+ * `fallbackAfter`, which marks it. The marker withdraws whichever outlet the
50
+ * fallback lands in.
51
+ *
52
+ * An async iterable the call returned is advanced later, in a call record of
53
+ * its own; the first chunk it yields after a read carries the marker, or, for
54
+ * a read on its closing step, a last chunk of the marker alone.
55
+ *
56
+ * A scoped view (`getHeaders()`, `getSegmentParams()`) handed down to another
57
+ * component marks the call reading through it, as well as the one that made it.
58
+ *
59
+ * Not marked: a read in other work the call did not await, such as a promise
60
+ * handed to a client component (it lands in a call record nobody checks).
61
+ * See design/53 §"Reads outside the key".
29
62
  */
63
+ import { type ReactElement, type ReactNode } from 'react';
30
64
  import { type DocumentReadScope } from '../als-registry.ts';
31
65
  import { type ServerComponent } from '../subtree-walk.ts';
32
66
  import type { DocumentLifetime } from './segment-key.ts';
@@ -37,4 +71,11 @@ export declare function readScopeFor(segmentPath: string, lifetime: DocumentLife
37
71
  * component it returns rewritten to run there too.
38
72
  */
39
73
  export declare function inReadScope(component: ServerComponent, scope: DocumentReadScope): ServerComponent;
74
+ /**
75
+ * The fallback a catcher renders in place of a component that threw: marked
76
+ * to withdraw its outlet when the throw came from a scoped call that read
77
+ * outside its key, so the client does not keep the fallback under the key
78
+ * digest. Every catcher that renders a fallback inside an outlet calls this.
79
+ */
80
+ export declare function fallbackAfter<T extends ReactNode>(error: unknown, fallback: T): T | ReactElement;
40
81
  //# sourceMappingURL=read-scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read-scope.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/read-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAkB,KAAK,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AAC5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,kDAAkD;AAClD,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,iBAAiB,CAcnB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAG,eAAe,CAGjG"}
1
+ {"version":3,"file":"read-scope.d.ts","sourceRoot":"","sources":["../../../src/server/segment-lifetime/read-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,OAAO,EAA2B,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,kDAAkD;AAClD,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,iBAAiB,CAgBnB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAG,eAAe,CAGjG;AAuDD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,YAAY,CAGhG"}
@@ -68,7 +68,7 @@ export declare class SlotDocumentOutlets {
68
68
  layout(node: ManifestSegmentNode, lifetime: DocumentLifetime, children: ReactElement, buildLayout: (children: ReactElement) => ReactElement): Promise<ReactElement>;
69
69
  /**
70
70
  * A 'document' slot segment's component, run in its read scope
71
- * (`read-scope.ts`): a read outside its key throws.
71
+ * (`read-scope.ts`): a read outside its key is refused.
72
72
  */
73
73
  scoped(node: ManifestSegmentNode, kind: 'page' | 'layout', lifetime: DocumentLifetime, component: ServerComponent): ServerComponent;
74
74
  private decision;
@@ -1 +1 @@
1
- {"version":3,"file":"slot-resolver.d.ts","sourceRoot":"","sources":["../../src/server/slot-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAQ9D,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,mCAAmC,CAAC;AAO3C,KAAK,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,KAAK,CAAC,YAAY,CAAC;AAgClE;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EA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AM,EAAE,CAAC,CAAC;CAC/C;AAED;;;;;;;;;;;;;;GAcG;AACH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,mBAAmB,EAAE,GAC9B,MAAM,CAQR;AA6BD,UAAU,oBAAoB;IAC5B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAClB,CAAC,EAAE,eAAe,CAAC;IACnB,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,OAAO,EACP,SAAS,EACT,KAAK,EACL,CAAC,EACD,YAAY,EACZ,cAAc,EACd,GAAG,EACH,MAAM,GACP,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CAwB/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"slot-subtree-contain.d.ts","sourceRoot":"","sources":["../../src/server/slot-subtree-contain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAuEtD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,SAAS,EACnB,MAAM,CAAC,EAAE,SAAS,GACjB,SAAS,CAEX"}
1
+ {"version":3,"file":"slot-subtree-contain.d.ts","sourceRoot":"","sources":["../../src/server/slot-subtree-contain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAwEtD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,SAAS,EACnB,MAAM,CAAC,EAAE,SAAS,GACjB,SAAS,CAEX"}
@@ -39,10 +39,24 @@ export interface SubtreeRule {
39
39
  /** Handles a rejection of a promise rendered as a child; rethrows by default. */
40
40
  onRejected?: (reason: unknown) => unknown;
41
41
  /**
42
- * Runs work the walk defers past the component's return — advancing an
43
- * async iterable it returned — in the rule's context. Default: as is.
42
+ * The context for one async iterable a component returned: the work the walk
43
+ * defers past the component's return (advancing it) runs through `run`,
44
+ * each value it yields passes through `yielded` after it is rewritten, and
45
+ * `beforeClose` may name one last value to yield before it closes. Default:
46
+ * as is.
44
47
  */
45
- runIn?: <T>(fn: () => T) => T;
48
+ iterate?: () => IterationContext;
49
+ }
50
+ /** How a rule runs and post-processes the steps of one async iterable. */
51
+ export interface IterationContext {
52
+ run<T>(fn: () => T): T;
53
+ yielded(value: unknown): unknown;
54
+ /**
55
+ * A value to yield before the iterable closes, or undefined for none. A
56
+ * value that must render cannot ride on the return value: React's
57
+ * iterable-child consumption does not render it.
58
+ */
59
+ beforeClose(): unknown;
46
60
  }
47
61
  /** Rewrite every server component in `tree` by `rule`. */
48
62
  export declare function rewriteSubtree(tree: unknown, rule: SubtreeRule): unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"subtree-walk.d.ts","sourceRoot":"","sources":["../../src/server/subtree-walk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAmC,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS3F,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,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AgB,cAAc,CAC5B,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,IAAI,EAAE,WAAW,GAChB,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAQhC"}
@@ -30,6 +30,7 @@ import type { StatusPageMarker } from '../client/status-page-marker.tsx';
30
30
  import type { SlotOutlet } from '../client/slot-outlet.tsx';
31
31
  import type { SlotsProvider } from '../client/slot-provider.tsx';
32
32
  import type { DenyLastResort } from '../client/deny-last-resort.tsx';
33
+ import type { DocumentWithdrawal } from '../client/document-withdrawal.tsx';
33
34
  /**
34
35
  * plugin-rsc's Flight runtime, as `rsc-runtime/rsc.ts` adapts it, typed as
35
36
  * the runtime calls it. `createFromReadableStream` is plugin-rsc's generic
@@ -59,6 +60,7 @@ export interface RscClientComponents {
59
60
  SlotOutlet: typeof SlotOutlet;
60
61
  SlotsProvider: typeof SlotsProvider;
61
62
  DenyLastResort: typeof DenyLastResort;
63
+ DocumentWithdrawal: typeof DocumentWithdrawal;
62
64
  }
63
65
  export interface RscViteHandoff {
64
66
  /** Partial so a test provides only the functions it exercises. */
@@ -1 +1 @@
1
- {"version":3,"file":"vite-handoff-rsc.d.ts","sourceRoot":"","sources":["../../src/server/vite-handoff-rsc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,KAAK,aAAa,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,iBAAiB,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE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c,CAAC,GAAG,MAAM,IAAI,CAUjF;AAsBD,kDAAkD;AAClD,wBAAgB,gBAAgB,IAAI,mBAAmB,CAEtD;AAMD,eAAO,MAAM,YAAY,EAAE,gBAAgB,CAAC,cAAc,CACvB,CAAC;AACpC,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAC3B,CAAC;AACxC,eAAO,MAAM,WAAW,EAAE,gBAAgB,CAAC,aAAa,CACtB,CAAC;AACnC,eAAO,MAAM,YAAY,EAAE,gBAAgB,CAAC,cAAc,CACvB,CAAC;AACpC,eAAO,MAAM,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAC1B,CAAC;AACvC,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CAAC,0BAA0B,CACnC,CAAC;AAChD,eAAO,MAAM,OAAO,EAAE,OAAO,OAA+C,CAAC"}
@@ -213,7 +213,7 @@ Render timeout in milliseconds. If an SSR render or RSC stream read does not com
213
213
 
214
214
  ### `defaultLayoutLifetime`
215
215
 
216
- The lifetime of every layout that does not declare one, slot layouts included. `'request'` (the default) or `'document'`. Pages are unaffected, and a layout's own `layoutOptions.lifetime` wins. Under `'document'`, a layout that reads a request input outside its key throws, one that shows data that changes during a visit keeps its load-time value, and one that hides its children in its body no longer keeps them out of the payload. Layouts in and below an intercepting directory stay `'request'`. See [Making layouts `'document'` by default](/docs/client-navigation#making-layouts-document-by-default).
216
+ The lifetime of every layout that does not declare one, slot layouts included. `'request'` (the default) or `'document'`. Pages are unaffected, and a layout's own `layoutOptions.lifetime` wins. Under `'document'`, a layout that reads a request input outside its key is reported (the dev overlay, or a warning in production) and renders as `'request'`, one that shows data that changes during a visit keeps its load-time value, and one that hides its children in its body no longer keeps them out of the payload. Layouts in and below an intercepting directory stay `'request'`. See [Making layouts `'document'` by default](/docs/client-navigation#making-layouts-document-by-default).
217
217
 
218
218
  ### `devBrowserLogs`
219
219
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timber-js/app",
3
- "version": "0.2.0-alpha.242",
3
+ "version": "0.2.0-alpha.243",
4
4
  "description": "Vite-native React framework built for Servers and Serverless Platforms — correct HTTP semantics, real status codes, pages that work without JavaScript",
5
5
  "keywords": [
6
6
  "cloudflare-workers",
@@ -0,0 +1,41 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * DocumentWithdrawal — a `'document'` segment's content telling the client
5
+ * not to keep it.
6
+ *
7
+ * A `'document'` segment that reads a request input outside its key is not
8
+ * failed: the read is reported, it returns its real value, and the server
9
+ * appends this marker to the segment's content
10
+ * (`server/segment-lifetime/read-scope.ts`). The outlet's key digest was sent
11
+ * before the segment rendered, so the content has to withdraw itself.
12
+ *
13
+ * It carries no outlet path: it withdraws the nearest `SegmentOutlet` above it
14
+ * (`OutletScopeContext`), which is the outlet whose committed content holds it.
15
+ * For a marker the segment's own call placed, that is the segment's outlet.
16
+ * For one a catcher placed beside its fallback (a deny page, a slot's
17
+ * `default.tsx`), it is wherever that fallback landed — after a hoisted deny,
18
+ * an ancestor's outlet.
19
+ *
20
+ * On commit the marker withdraws that outlet from the router's outlet content
21
+ * cache: the entry is dropped and no later content is recorded for it, so
22
+ * the client never advertises a digest for it and every navigation renders
23
+ * it live — the segment is `'request'` for the rest of the document.
24
+ * A layout effect, and layout effects run child before parent: in the commit
25
+ * that brings the outlet's content, this runs before the outlet records it.
26
+ *
27
+ * Renders nothing. See design/53-segment-lifetime.md §"Reads outside the key".
28
+ */
29
+
30
+ import { useContext, useLayoutEffect } from 'react';
31
+ import { OutletContentCacheContext } from './outlet-content-cache.ts';
32
+ import { OutletScopeContext } from './outlet-scope-context.ts';
33
+
34
+ export function DocumentWithdrawal(): null {
35
+ const cache = useContext(OutletContentCacheContext);
36
+ const { segmentPath } = useContext(OutletScopeContext);
37
+ useLayoutEffect(() => {
38
+ if (segmentPath !== undefined) cache?.withdraw(segmentPath);
39
+ }, [cache, segmentPath]);
40
+ return null;
41
+ }
@@ -53,13 +53,20 @@ const MAX_PATHS = 64;
53
53
 
54
54
  export class OutletContentCache {
55
55
  private readonly byPath = new Map<string, Entry[]>();
56
+ /**
57
+ * Outlets whose content withdrew itself (`DocumentWithdrawal`): a
58
+ * `'document'` segment that read outside its key. Never
59
+ * recorded again in this document, so it renders live on every navigation.
60
+ */
61
+ private readonly withdrawn = new Set<string>();
56
62
 
57
63
  /**
58
64
  * Record content an outlet committed. Only a `'document'` segment's
59
- * content, which carries the key digest it rendered under, is kept.
65
+ * content, which carries the key digest it rendered under, is kept, and
66
+ * not a withdrawn one's.
60
67
  */
61
68
  record(segmentPath: string, content: ReactNode, digest: string | undefined): void {
62
- if (digest === undefined) return;
69
+ if (digest === undefined || this.withdrawn.has(segmentPath)) return;
63
70
  const entries = this.byPath.get(segmentPath) ?? [];
64
71
  entries.unshift({ content, digest });
65
72
  if (entries.length > ENTRIES_PER_PATH) entries.length = ENTRIES_PER_PATH;
@@ -72,6 +79,15 @@ export class OutletContentCache {
72
79
  }
73
80
  }
74
81
 
82
+ /**
83
+ * Stop holding `segmentPath` for the rest of the document: drop what is
84
+ * held and record nothing later (design/53 §"Reads outside the key").
85
+ */
86
+ withdraw(segmentPath: string): void {
87
+ this.withdrawn.add(segmentPath);
88
+ this.byPath.delete(segmentPath);
89
+ }
90
+
75
91
  /** The content committed under `digest` at `segmentPath`, if held. */
76
92
  lookup(segmentPath: string, digest: string): { content: ReactNode } | undefined {
77
93
  return this.byPath.get(segmentPath)?.find((e) => e.digest === digest);
@@ -29,6 +29,11 @@ export interface OutletScope {
29
29
  */
30
30
  skipped: boolean;
31
31
  decisions: ReadonlyMap<string, OutletDecision>;
32
+ /**
33
+ * The outlet this content belongs to: the nearest `SegmentOutlet` above.
34
+ * A `DocumentWithdrawal` marker withdraws it. Undefined outside any outlet.
35
+ */
36
+ segmentPath?: string;
32
37
  }
33
38
 
34
39
  export const LIVE_OUTLET_SCOPE: OutletScope = Object.freeze({
@@ -59,12 +59,18 @@ export function SegmentOutlet({ segmentPath, decision }: SegmentOutletProps): Re
59
59
  const cached = resolved.skip ? cache?.lookup(segmentPath, resolved.digest) : undefined;
60
60
  if (resolved.skip && !cached) throw staleSegmentError(segmentPath);
61
61
  const content: ReactNode = resolved.skip ? cached!.content : resolved.children;
62
+ // One live scope per outlet, so its identity changes only with a skip's
63
+ // new decisions (`ResetOnNewDecisions` in error-boundary.tsx reads that).
64
+ const liveScope = useMemo<OutletScope>(
65
+ () => ({ ...LIVE_OUTLET_SCOPE, segmentPath }),
66
+ [segmentPath]
67
+ );
62
68
  const childScope = useMemo<OutletScope>(
63
69
  () =>
64
70
  resolved.skip
65
- ? { skipped: true, decisions: new Map(Object.entries(resolved.outlets)) }
66
- : LIVE_OUTLET_SCOPE,
67
- [resolved]
71
+ ? { skipped: true, decisions: new Map(Object.entries(resolved.outlets)), segmentPath }
72
+ : liveScope,
73
+ [resolved, liveScope, segmentPath]
68
74
  );
69
75
 
70
76
  // Commit-time write: live content is recorded once React commits it.
@@ -338,7 +338,8 @@ export interface TimberUserConfig {
338
338
  * applies: the default key is every param on the layout's path, and the
339
339
  * layout may read only the request inputs in its key. Check three things
340
340
  * before turning it on: a layout that reads anything else (a header, a
341
- * cookie outside its key) throws; a layout that shows data that changes
341
+ * cookie outside its key) is reported (the dev overlay, or a warning) and
342
+ * renders as `'request'` for that visitor; a layout that shows data that changes
342
343
  * during a visit (a cart badge) keeps the value it had at load; and a layout
343
344
  * that hides its children in its body no longer keeps them out of the
344
345
  * payload, since a skip never runs it. Declare
@@ -350,11 +350,11 @@ export function validateInterceptionPlacement(root: SegmentNode): void {
350
350
  * layout-bearing segment**, because those are the segments the client needs an
351
351
  * outlet and a cache node for. `buildSegmentInfo` skips the rest.
352
352
  *
353
- * For the modal shape that set is exactly the set of possible scope owners, by
354
- * construction: a slot is only resolved inside a rendering layout
355
- * (`route-element-builder.ts`), so a layoutless segment can never own one. A
356
- * children-path interception broke that equivalence — its owner is an ordinary
357
- * directory and needs no layout.
353
+ * For the modal shape that set is exactly the set of possible scope owners:
354
+ * a slot is only resolved inside its owner's layout, and `validateSlotPlacement`
355
+ * rejects a slot whose owner has none (TIM-1443). A children-path
356
+ * interception's owner is an ordinary directory rather than a slot owner, so
357
+ * that rule does not reach it — this one does.
358
358
  *
359
359
  * Left unchecked the result is a swap that works exactly once: the first soft
360
360
  * navigation renders, then the client reports no such tree path, and the next
@@ -1,10 +1,17 @@
1
1
  /**
2
2
  * Parallel slot placement.
3
3
  *
4
- * One rule: a slot is resolved only for a segment on the **matched route
5
- * chain**, and a slot's own subtree is never on that chain. So a slot declared
6
- * anywhere inside another slot's subtree can never render, and is rejected at
7
- * build time rather than left as a directory the author will keep editing.
4
+ * Two rules, both about slots no renderer reaches:
5
+ *
6
+ * 1. A slot is resolved only for a segment on the **matched route chain**,
7
+ * and a slot's own subtree is never on that chain. So a slot declared
8
+ * anywhere inside another slot's subtree can never render.
9
+ * 2. A slot is a prop of its owner's **layout**. A segment without a
10
+ * `layout.tsx` has nothing to hand the slot to, so its slots never render
11
+ * either (TIM-1443).
12
+ *
13
+ * Both are rejected at build time rather than left as directories the author
14
+ * will keep editing.
8
15
  *
9
16
  * See design/07-routing.md §"Parallel Routes".
10
17
  */
@@ -45,6 +52,18 @@ import type { SegmentNode } from './types.ts';
45
52
  * it exactly as it does for any other chain segment. `(browse)/(...)photo/[id]/@side`
46
53
  * renders; `feed/@modal/(.)photo/@side` does not. The discriminator is the slot
47
54
  * boundary, which is what this walk tracks — not the marker.
55
+ *
56
+ * **The owner must have a layout.** `route-element-builder.ts` resolves a
57
+ * segment's slots only while building that segment's layout element — the
58
+ * slot props are the layout's props, and nothing else receives them. A slot on
59
+ * a layoutless segment is dead in exactly the way a nested slot is, with the
60
+ * same missing signal. (Next.js drops them the same way: a segment with no
61
+ * layout renders only `children`.) Interception made it worse than dead: only
62
+ * the winning owner's slots intercept, so a layoutless owner whose rewrite won
63
+ * — reachable through the address-bar scope channel — rendered the source page
64
+ * with no modal under the target URL. The client's mounted-scope channel never
65
+ * names such an owner, because `X-Timber-Segments` carries layout-bearing
66
+ * segments only; this rule makes the two channels agree by construction.
48
67
  */
49
68
  export function validateSlotPlacement(root: SegmentNode): void {
50
69
  walkForSlotPlacement(root, '', null);
@@ -67,6 +86,9 @@ function walkForSlotPlacement(
67
86
  if (enclosingSlotPath !== null) {
68
87
  throwNestedSlot(slotPath, enclosingSlotPath);
69
88
  }
89
+ if (!node.layout) {
90
+ throwLayoutlessOwner(slotPath, path, slotName);
91
+ }
70
92
  walkForSlotPlacement(slotNode, slotPath, slotPath);
71
93
  }
72
94
 
@@ -79,6 +101,21 @@ function walkForSlotPlacement(
79
101
  }
80
102
  }
81
103
 
104
+ function throwLayoutlessOwner(slotPath: string, ownerPath: string, slotName: string): never {
105
+ const owner = ownerPath ? `app/${ownerPath}` : 'app';
106
+ throw new Error(
107
+ `Build error: parallel slot whose owner has no layout.\n` +
108
+ ` Directory: app/${slotPath}\n` +
109
+ ` Owner: ${owner}\n` +
110
+ `A parallel slot is passed to its owning segment's layout as a named prop, and ` +
111
+ `${owner} has no layout.tsx to receive it — so app/${slotPath} can never render, ` +
112
+ `and no request-time signal can tell you.\n` +
113
+ `Add ${owner}/layout.tsx and place the slot prop where it should appear, e.g. ` +
114
+ `({ children, ${slotName} }) => <>{children}{${slotName}}</>.\n` +
115
+ `See design/07-routing.md §"Parallel Routes".`
116
+ );
117
+ }
118
+
82
119
  function throwNestedSlot(slotPath: string, enclosingSlotPath: string): never {
83
120
  throw new Error(
84
121
  `Build error: parallel slot nested inside another parallel slot.\n` +
@@ -364,6 +364,20 @@ export interface DocumentReadScope {
364
364
  cookies: ReadonlyMap<string, unknown>;
365
365
  /** The key's header names, lowercased. */
366
366
  headers: ReadonlySet<string>;
367
+ /**
368
+ * Whether this segment render has reported a read outside its key: one
369
+ * report per segment render. Shared by every call in the render.
370
+ */
371
+ reported: { done: boolean };
372
+ /**
373
+ * Whether this component call (and the work it awaits) read outside the
374
+ * key, so its output must withdraw the segment from the client (design/53
375
+ * §"Reads outside the key"). One per scoped component call: the scope runs
376
+ * each call in a copy of the scope with a fresh `call`
377
+ * (`segment-lifetime/read-scope.ts`). Set by the read rule
378
+ * (`segment-lifetime/read-rule.ts`).
379
+ */
380
+ call: { read: boolean };
367
381
  }
368
382
 
369
383
  /** @internal — run and read via segment-lifetime/read-scope.ts */