@timber-js/app 0.2.0-alpha.9 → 0.2.0-alpha.90

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 (610) hide show
  1. package/dist/_chunks/actions-DLnUaR65.js +421 -0
  2. package/dist/_chunks/actions-DLnUaR65.js.map +1 -0
  3. package/dist/_chunks/{als-registry-B7DbZ2hS.js → als-registry-HS0LGUl2.js} +1 -1
  4. package/dist/_chunks/als-registry-HS0LGUl2.js.map +1 -0
  5. package/dist/_chunks/chunk-BYIpzuS7.js +39 -0
  6. package/dist/_chunks/{debug-gwlJkDuf.js → debug-ECi_61pb.js} +2 -2
  7. package/dist/_chunks/debug-ECi_61pb.js.map +1 -0
  8. package/dist/_chunks/define-C77ScO0m.js +106 -0
  9. package/dist/_chunks/define-C77ScO0m.js.map +1 -0
  10. package/dist/_chunks/define-Itxvcd7F.js +199 -0
  11. package/dist/_chunks/define-Itxvcd7F.js.map +1 -0
  12. package/dist/_chunks/define-cookie-BowvzoP0.js +94 -0
  13. package/dist/_chunks/define-cookie-BowvzoP0.js.map +1 -0
  14. package/dist/_chunks/{format-DviM89f0.js → dev-warnings-DpGRGoDi.js} +5 -44
  15. package/dist/_chunks/dev-warnings-DpGRGoDi.js.map +1 -0
  16. package/dist/_chunks/format-CYBGxKtc.js +14 -0
  17. package/dist/_chunks/format-CYBGxKtc.js.map +1 -0
  18. package/dist/_chunks/{interception-BOoWmLUA.js → interception-DRlhJWbu.js} +219 -97
  19. package/dist/_chunks/interception-DRlhJWbu.js.map +1 -0
  20. package/dist/_chunks/merge-search-params-Cm_KIWDX.js +41 -0
  21. package/dist/_chunks/merge-search-params-Cm_KIWDX.js.map +1 -0
  22. package/dist/_chunks/{metadata-routes-Cjmvi3rQ.js → metadata-routes-DS3eKNmf.js} +1 -1
  23. package/dist/_chunks/{metadata-routes-Cjmvi3rQ.js.map → metadata-routes-DS3eKNmf.js.map} +1 -1
  24. package/dist/_chunks/request-context-CK5tZqIP.js +478 -0
  25. package/dist/_chunks/request-context-CK5tZqIP.js.map +1 -0
  26. package/dist/_chunks/schema-bridge-C3xl_vfb.js +86 -0
  27. package/dist/_chunks/schema-bridge-C3xl_vfb.js.map +1 -0
  28. package/dist/_chunks/segment-classify-BDNn6EzD.js +65 -0
  29. package/dist/_chunks/segment-classify-BDNn6EzD.js.map +1 -0
  30. package/dist/_chunks/segment-context-fHFLF1PE.js +34 -0
  31. package/dist/_chunks/segment-context-fHFLF1PE.js.map +1 -0
  32. package/dist/_chunks/{ssr-data-MjmprTmO.js → ssr-data-DzuI0bIV.js} +1 -1
  33. package/dist/_chunks/{ssr-data-MjmprTmO.js.map → ssr-data-DzuI0bIV.js.map} +1 -1
  34. package/dist/_chunks/stale-reload-BX5gL1r-.js +64 -0
  35. package/dist/_chunks/stale-reload-BX5gL1r-.js.map +1 -0
  36. package/dist/_chunks/{tracing-CemImE6h.js → tracing-CCYbKn5n.js} +60 -9
  37. package/dist/_chunks/tracing-CCYbKn5n.js.map +1 -0
  38. package/dist/_chunks/use-params-Br9YSUFV.js +295 -0
  39. package/dist/_chunks/use-params-Br9YSUFV.js.map +1 -0
  40. package/dist/_chunks/{use-query-states-D5KaffOK.js → use-query-states-BiV5GJgm.js} +7 -4
  41. package/dist/_chunks/use-query-states-BiV5GJgm.js.map +1 -0
  42. package/dist/adapters/cloudflare-dev.d.ts +109 -0
  43. package/dist/adapters/cloudflare-dev.d.ts.map +1 -0
  44. package/dist/adapters/cloudflare-dev.js +73 -0
  45. package/dist/adapters/cloudflare-dev.js.map +1 -0
  46. package/dist/adapters/cloudflare-kv-cache.d.ts +64 -0
  47. package/dist/adapters/cloudflare-kv-cache.d.ts.map +1 -0
  48. package/dist/adapters/cloudflare-kv-cache.js +95 -0
  49. package/dist/adapters/cloudflare-kv-cache.js.map +1 -0
  50. package/dist/adapters/cloudflare.d.ts +148 -12
  51. package/dist/adapters/cloudflare.d.ts.map +1 -1
  52. package/dist/adapters/cloudflare.js +135 -11
  53. package/dist/adapters/cloudflare.js.map +1 -1
  54. package/dist/adapters/compress-module.d.ts.map +1 -1
  55. package/dist/adapters/nitro.d.ts +17 -1
  56. package/dist/adapters/nitro.d.ts.map +1 -1
  57. package/dist/adapters/nitro.js +56 -13
  58. package/dist/adapters/nitro.js.map +1 -1
  59. package/dist/cache/cache-api.d.ts +24 -0
  60. package/dist/cache/cache-api.d.ts.map +1 -0
  61. package/dist/cache/handler-store.d.ts +31 -0
  62. package/dist/cache/handler-store.d.ts.map +1 -0
  63. package/dist/cache/index.d.ts +23 -7
  64. package/dist/cache/index.d.ts.map +1 -1
  65. package/dist/cache/index.js +142 -80
  66. package/dist/cache/index.js.map +1 -1
  67. package/dist/cache/singleflight.d.ts +18 -1
  68. package/dist/cache/singleflight.d.ts.map +1 -1
  69. package/dist/cache/sizeof.d.ts +22 -0
  70. package/dist/cache/sizeof.d.ts.map +1 -0
  71. package/dist/cache/timber-cache.d.ts +1 -1
  72. package/dist/cache/timber-cache.d.ts.map +1 -1
  73. package/dist/cli.d.ts +6 -1
  74. package/dist/cli.d.ts.map +1 -1
  75. package/dist/cli.js +8 -3
  76. package/dist/cli.js.map +1 -1
  77. package/dist/client/browser-dev.d.ts +27 -1
  78. package/dist/client/browser-dev.d.ts.map +1 -1
  79. package/dist/client/browser-entry/action-dispatch.d.ts +17 -0
  80. package/dist/client/browser-entry/action-dispatch.d.ts.map +1 -0
  81. package/dist/client/browser-entry/hmr.d.ts +21 -0
  82. package/dist/client/browser-entry/hmr.d.ts.map +1 -0
  83. package/dist/client/browser-entry/hydrate.d.ts +46 -0
  84. package/dist/client/browser-entry/hydrate.d.ts.map +1 -0
  85. package/dist/client/browser-entry/index.d.ts +30 -0
  86. package/dist/client/browser-entry/index.d.ts.map +1 -0
  87. package/dist/client/browser-entry/post-hydration.d.ts +26 -0
  88. package/dist/client/browser-entry/post-hydration.d.ts.map +1 -0
  89. package/dist/client/browser-entry/router-init.d.ts +23 -0
  90. package/dist/client/browser-entry/router-init.d.ts.map +1 -0
  91. package/dist/client/browser-entry/rsc-stream.d.ts +24 -0
  92. package/dist/client/browser-entry/rsc-stream.d.ts.map +1 -0
  93. package/dist/client/browser-entry/scroll.d.ts +19 -0
  94. package/dist/client/browser-entry/scroll.d.ts.map +1 -0
  95. package/dist/client/error-boundary.d.ts +12 -5
  96. package/dist/client/error-boundary.d.ts.map +1 -1
  97. package/dist/client/error-boundary.js +10 -4
  98. package/dist/client/error-boundary.js.map +1 -1
  99. package/dist/client/error-reconstituter.d.ts +54 -0
  100. package/dist/client/error-reconstituter.d.ts.map +1 -0
  101. package/dist/client/form.d.ts +6 -3
  102. package/dist/client/form.d.ts.map +1 -1
  103. package/dist/client/history.d.ts +19 -4
  104. package/dist/client/history.d.ts.map +1 -1
  105. package/dist/client/index.d.ts +9 -21
  106. package/dist/client/index.d.ts.map +1 -1
  107. package/dist/client/index.js +229 -1018
  108. package/dist/client/index.js.map +1 -1
  109. package/dist/client/internal.d.ts +18 -0
  110. package/dist/client/internal.d.ts.map +1 -0
  111. package/dist/client/internal.js +890 -0
  112. package/dist/client/internal.js.map +1 -0
  113. package/dist/client/link-pending-store.d.ts +63 -0
  114. package/dist/client/link-pending-store.d.ts.map +1 -0
  115. package/dist/client/link.d.ts +62 -55
  116. package/dist/client/link.d.ts.map +1 -1
  117. package/dist/client/nav-link-store.d.ts +36 -0
  118. package/dist/client/nav-link-store.d.ts.map +1 -0
  119. package/dist/client/navigation-api-types.d.ts +90 -0
  120. package/dist/client/navigation-api-types.d.ts.map +1 -0
  121. package/dist/client/navigation-api.d.ts +115 -0
  122. package/dist/client/navigation-api.d.ts.map +1 -0
  123. package/dist/client/navigation-context.d.ts +13 -2
  124. package/dist/client/navigation-context.d.ts.map +1 -1
  125. package/dist/client/{transition-root.d.ts → navigation-root.d.ts} +42 -8
  126. package/dist/client/navigation-root.d.ts.map +1 -0
  127. package/dist/client/nuqs-adapter.d.ts.map +1 -1
  128. package/dist/client/router-ref.d.ts +1 -1
  129. package/dist/client/router.d.ts +70 -4
  130. package/dist/client/router.d.ts.map +1 -1
  131. package/dist/client/rsc-fetch.d.ts +38 -3
  132. package/dist/client/rsc-fetch.d.ts.map +1 -1
  133. package/dist/client/segment-cache.d.ts +1 -1
  134. package/dist/client/segment-cache.d.ts.map +1 -1
  135. package/dist/client/segment-outlet.d.ts +63 -0
  136. package/dist/client/segment-outlet.d.ts.map +1 -0
  137. package/dist/client/ssr-data.d.ts +13 -4
  138. package/dist/client/ssr-data.d.ts.map +1 -1
  139. package/dist/client/stale-reload.d.ts +15 -0
  140. package/dist/client/stale-reload.d.ts.map +1 -1
  141. package/dist/client/top-loader.d.ts +5 -5
  142. package/dist/client/top-loader.d.ts.map +1 -1
  143. package/dist/client/use-link-status.d.ts +5 -5
  144. package/dist/client/use-link-status.d.ts.map +1 -1
  145. package/dist/client/use-params.d.ts +6 -4
  146. package/dist/client/use-params.d.ts.map +1 -1
  147. package/dist/client/{use-navigation-pending.d.ts → use-pending-navigation.d.ts} +4 -4
  148. package/dist/client/use-pending-navigation.d.ts.map +1 -0
  149. package/dist/client/use-query-states.d.ts +1 -1
  150. package/dist/client/use-query-states.d.ts.map +1 -1
  151. package/dist/client/use-router.d.ts +1 -1
  152. package/dist/codec.d.ts +33 -0
  153. package/dist/codec.d.ts.map +1 -0
  154. package/dist/codec.js +2 -0
  155. package/dist/config-types.d.ts +266 -0
  156. package/dist/config-types.d.ts.map +1 -0
  157. package/dist/config-validation.d.ts +51 -0
  158. package/dist/config-validation.d.ts.map +1 -0
  159. package/dist/content/index.d.ts +1 -10
  160. package/dist/content/index.d.ts.map +1 -1
  161. package/dist/content/index.js +0 -2
  162. package/dist/cookies/define-cookie.d.ts +35 -14
  163. package/dist/cookies/define-cookie.d.ts.map +1 -1
  164. package/dist/cookies/index.js +1 -83
  165. package/dist/fonts/bundle.d.ts +48 -0
  166. package/dist/fonts/bundle.d.ts.map +1 -0
  167. package/dist/fonts/css.d.ts +1 -0
  168. package/dist/fonts/css.d.ts.map +1 -1
  169. package/dist/fonts/dev-middleware.d.ts +22 -0
  170. package/dist/fonts/dev-middleware.d.ts.map +1 -0
  171. package/dist/fonts/pipeline.d.ts +138 -0
  172. package/dist/fonts/pipeline.d.ts.map +1 -0
  173. package/dist/fonts/transform.d.ts +72 -0
  174. package/dist/fonts/transform.d.ts.map +1 -0
  175. package/dist/fonts/types.d.ts +45 -1
  176. package/dist/fonts/types.d.ts.map +1 -1
  177. package/dist/fonts/virtual-modules.d.ts +59 -0
  178. package/dist/fonts/virtual-modules.d.ts.map +1 -0
  179. package/dist/index.d.ts +45 -190
  180. package/dist/index.d.ts.map +1 -1
  181. package/dist/index.js +4294 -2453
  182. package/dist/index.js.map +1 -1
  183. package/dist/plugin-context.d.ts +107 -0
  184. package/dist/plugin-context.d.ts.map +1 -0
  185. package/dist/plugins/adapter-build.d.ts +1 -1
  186. package/dist/plugins/adapter-build.d.ts.map +1 -1
  187. package/dist/plugins/build-manifest.d.ts +2 -2
  188. package/dist/plugins/build-manifest.d.ts.map +1 -1
  189. package/dist/plugins/build-report.d.ts +3 -3
  190. package/dist/plugins/build-report.d.ts.map +1 -1
  191. package/dist/plugins/client-chunks.d.ts +32 -0
  192. package/dist/plugins/client-chunks.d.ts.map +1 -0
  193. package/dist/plugins/content.d.ts +1 -1
  194. package/dist/plugins/content.d.ts.map +1 -1
  195. package/dist/plugins/dev-404-page.d.ts +56 -0
  196. package/dist/plugins/dev-404-page.d.ts.map +1 -0
  197. package/dist/plugins/dev-browser-logs.d.ts +84 -0
  198. package/dist/plugins/dev-browser-logs.d.ts.map +1 -0
  199. package/dist/plugins/dev-error-overlay.d.ts +49 -9
  200. package/dist/plugins/dev-error-overlay.d.ts.map +1 -1
  201. package/dist/plugins/dev-error-page.d.ts +58 -0
  202. package/dist/plugins/dev-error-page.d.ts.map +1 -0
  203. package/dist/plugins/dev-logs.d.ts +1 -1
  204. package/dist/plugins/dev-logs.d.ts.map +1 -1
  205. package/dist/plugins/dev-server.d.ts +1 -1
  206. package/dist/plugins/dev-server.d.ts.map +1 -1
  207. package/dist/plugins/dev-terminal-error.d.ts +28 -0
  208. package/dist/plugins/dev-terminal-error.d.ts.map +1 -0
  209. package/dist/plugins/entries.d.ts +1 -1
  210. package/dist/plugins/entries.d.ts.map +1 -1
  211. package/dist/plugins/fonts.d.ts +17 -73
  212. package/dist/plugins/fonts.d.ts.map +1 -1
  213. package/dist/plugins/mdx.d.ts +1 -1
  214. package/dist/plugins/mdx.d.ts.map +1 -1
  215. package/dist/plugins/routing.d.ts +1 -1
  216. package/dist/plugins/routing.d.ts.map +1 -1
  217. package/dist/plugins/server-bundle.d.ts.map +1 -1
  218. package/dist/plugins/shims.d.ts +6 -5
  219. package/dist/plugins/shims.d.ts.map +1 -1
  220. package/dist/plugins/static-build.d.ts +4 -4
  221. package/dist/plugins/static-build.d.ts.map +1 -1
  222. package/dist/routing/codegen.d.ts +2 -2
  223. package/dist/routing/codegen.d.ts.map +1 -1
  224. package/dist/routing/convention-lint.d.ts +41 -0
  225. package/dist/routing/convention-lint.d.ts.map +1 -0
  226. package/dist/routing/index.d.ts +2 -0
  227. package/dist/routing/index.d.ts.map +1 -1
  228. package/dist/routing/index.js +3 -2
  229. package/dist/routing/scanner.d.ts.map +1 -1
  230. package/dist/routing/segment-classify.d.ts +46 -0
  231. package/dist/routing/segment-classify.d.ts.map +1 -0
  232. package/dist/routing/status-file-lint.d.ts +2 -1
  233. package/dist/routing/status-file-lint.d.ts.map +1 -1
  234. package/dist/routing/types.d.ts +16 -4
  235. package/dist/routing/types.d.ts.map +1 -1
  236. package/dist/rsc-runtime/rsc.d.ts +1 -1
  237. package/dist/rsc-runtime/rsc.d.ts.map +1 -1
  238. package/dist/rsc-runtime/ssr.d.ts +12 -0
  239. package/dist/rsc-runtime/ssr.d.ts.map +1 -1
  240. package/dist/schema-bridge.d.ts +76 -0
  241. package/dist/schema-bridge.d.ts.map +1 -0
  242. package/dist/search-params/define.d.ts +139 -0
  243. package/dist/search-params/define.d.ts.map +1 -0
  244. package/dist/search-params/index.d.ts +4 -7
  245. package/dist/search-params/index.d.ts.map +1 -1
  246. package/dist/search-params/index.js +32 -441
  247. package/dist/search-params/index.js.map +1 -1
  248. package/dist/search-params/registry.d.ts +2 -2
  249. package/dist/search-params/registry.d.ts.map +1 -1
  250. package/dist/search-params/wrappers.d.ts +53 -0
  251. package/dist/search-params/wrappers.d.ts.map +1 -0
  252. package/dist/segment-params/define.d.ts +78 -0
  253. package/dist/segment-params/define.d.ts.map +1 -0
  254. package/dist/segment-params/index.d.ts +3 -0
  255. package/dist/segment-params/index.d.ts.map +1 -0
  256. package/dist/segment-params/index.js +2 -0
  257. package/dist/server/access-gate.d.ts +4 -0
  258. package/dist/server/access-gate.d.ts.map +1 -1
  259. package/dist/server/action-client.d.ts +41 -6
  260. package/dist/server/action-client.d.ts.map +1 -1
  261. package/dist/server/action-encryption.d.ts +76 -0
  262. package/dist/server/action-encryption.d.ts.map +1 -0
  263. package/dist/server/action-handler.d.ts +7 -0
  264. package/dist/server/action-handler.d.ts.map +1 -1
  265. package/dist/server/actions.d.ts +3 -6
  266. package/dist/server/actions.d.ts.map +1 -1
  267. package/dist/server/als-registry.d.ts +32 -4
  268. package/dist/server/als-registry.d.ts.map +1 -1
  269. package/dist/server/build-manifest.d.ts +2 -2
  270. package/dist/server/build-manifest.d.ts.map +1 -1
  271. package/dist/server/debug.d.ts +1 -1
  272. package/dist/server/default-logger.d.ts +22 -0
  273. package/dist/server/default-logger.d.ts.map +1 -0
  274. package/dist/server/deny-page-resolver.d.ts +52 -0
  275. package/dist/server/deny-page-resolver.d.ts.map +1 -0
  276. package/dist/server/deny-renderer.d.ts.map +1 -1
  277. package/dist/server/dev-holding-server.d.ts +52 -0
  278. package/dist/server/dev-holding-server.d.ts.map +1 -0
  279. package/dist/server/dev-source-map.d.ts +22 -0
  280. package/dist/server/dev-source-map.d.ts.map +1 -0
  281. package/dist/server/dev-warnings.d.ts +1 -21
  282. package/dist/server/dev-warnings.d.ts.map +1 -1
  283. package/dist/server/early-hints.d.ts +13 -5
  284. package/dist/server/early-hints.d.ts.map +1 -1
  285. package/dist/server/error-boundary-wrapper.d.ts +7 -1
  286. package/dist/server/error-boundary-wrapper.d.ts.map +1 -1
  287. package/dist/server/fallback-error.d.ts +12 -7
  288. package/dist/server/fallback-error.d.ts.map +1 -1
  289. package/dist/server/flight-injection-state.d.ts +66 -0
  290. package/dist/server/flight-injection-state.d.ts.map +1 -0
  291. package/dist/server/flight-scripts.d.ts +42 -0
  292. package/dist/server/flight-scripts.d.ts.map +1 -0
  293. package/dist/server/flush.d.ts.map +1 -1
  294. package/dist/server/form-data.d.ts +29 -0
  295. package/dist/server/form-data.d.ts.map +1 -1
  296. package/dist/server/html-injectors.d.ts +51 -11
  297. package/dist/server/html-injectors.d.ts.map +1 -1
  298. package/dist/server/index.d.ts +5 -43
  299. package/dist/server/index.d.ts.map +1 -1
  300. package/dist/server/index.js +195 -2800
  301. package/dist/server/index.js.map +1 -1
  302. package/dist/server/internal.d.ts +46 -0
  303. package/dist/server/internal.d.ts.map +1 -0
  304. package/dist/server/internal.js +2900 -0
  305. package/dist/server/internal.js.map +1 -0
  306. package/dist/server/logger.d.ts +25 -7
  307. package/dist/server/logger.d.ts.map +1 -1
  308. package/dist/server/middleware-runner.d.ts +19 -4
  309. package/dist/server/middleware-runner.d.ts.map +1 -1
  310. package/dist/server/node-stream-transforms.d.ts +113 -0
  311. package/dist/server/node-stream-transforms.d.ts.map +1 -0
  312. package/dist/server/page-deny-boundary.d.ts +31 -0
  313. package/dist/server/page-deny-boundary.d.ts.map +1 -0
  314. package/dist/server/pipeline-interception.d.ts +1 -1
  315. package/dist/server/pipeline-interception.d.ts.map +1 -1
  316. package/dist/server/pipeline-metadata.d.ts +6 -0
  317. package/dist/server/pipeline-metadata.d.ts.map +1 -1
  318. package/dist/server/pipeline.d.ts +52 -10
  319. package/dist/server/pipeline.d.ts.map +1 -1
  320. package/dist/server/primitives.d.ts +69 -18
  321. package/dist/server/primitives.d.ts.map +1 -1
  322. package/dist/server/render-timeout.d.ts +51 -0
  323. package/dist/server/render-timeout.d.ts.map +1 -0
  324. package/dist/server/request-context.d.ts +112 -43
  325. package/dist/server/request-context.d.ts.map +1 -1
  326. package/dist/server/route-element-builder.d.ts +27 -1
  327. package/dist/server/route-element-builder.d.ts.map +1 -1
  328. package/dist/server/route-handler.d.ts.map +1 -1
  329. package/dist/server/route-matcher.d.ts +16 -2
  330. package/dist/server/route-matcher.d.ts.map +1 -1
  331. package/dist/server/rsc-entry/api-handler.d.ts +2 -2
  332. package/dist/server/rsc-entry/api-handler.d.ts.map +1 -1
  333. package/dist/server/rsc-entry/error-renderer.d.ts +26 -13
  334. package/dist/server/rsc-entry/error-renderer.d.ts.map +1 -1
  335. package/dist/server/rsc-entry/helpers.d.ts +48 -5
  336. package/dist/server/rsc-entry/helpers.d.ts.map +1 -1
  337. package/dist/server/rsc-entry/index.d.ts +20 -3
  338. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  339. package/dist/server/rsc-entry/rsc-payload.d.ts +3 -3
  340. package/dist/server/rsc-entry/rsc-payload.d.ts.map +1 -1
  341. package/dist/server/rsc-entry/rsc-stream.d.ts +14 -1
  342. package/dist/server/rsc-entry/rsc-stream.d.ts.map +1 -1
  343. package/dist/server/rsc-entry/ssr-bridge.d.ts +1 -1
  344. package/dist/server/rsc-entry/ssr-bridge.d.ts.map +1 -1
  345. package/dist/server/rsc-entry/ssr-renderer.d.ts +19 -4
  346. package/dist/server/rsc-entry/ssr-renderer.d.ts.map +1 -1
  347. package/dist/server/safe-load.d.ts +46 -0
  348. package/dist/server/safe-load.d.ts.map +1 -0
  349. package/dist/server/sensitive-fields.d.ts +74 -0
  350. package/dist/server/sensitive-fields.d.ts.map +1 -0
  351. package/dist/server/sitemap-generator.d.ts +129 -0
  352. package/dist/server/sitemap-generator.d.ts.map +1 -0
  353. package/dist/server/sitemap-handler.d.ts +22 -0
  354. package/dist/server/sitemap-handler.d.ts.map +1 -0
  355. package/dist/server/slot-resolver.d.ts +1 -1
  356. package/dist/server/slot-resolver.d.ts.map +1 -1
  357. package/dist/server/ssr-entry.d.ts +23 -0
  358. package/dist/server/ssr-entry.d.ts.map +1 -1
  359. package/dist/server/ssr-render.d.ts +39 -21
  360. package/dist/server/ssr-render.d.ts.map +1 -1
  361. package/dist/server/ssr-wrappers.d.ts +50 -0
  362. package/dist/server/ssr-wrappers.d.ts.map +1 -0
  363. package/dist/server/status-code-resolver.d.ts +1 -1
  364. package/dist/server/status-code-resolver.d.ts.map +1 -1
  365. package/dist/server/stream-utils.d.ts +36 -0
  366. package/dist/server/stream-utils.d.ts.map +1 -0
  367. package/dist/server/tracing.d.ts +4 -4
  368. package/dist/server/tracing.d.ts.map +1 -1
  369. package/dist/server/tree-builder.d.ts +22 -19
  370. package/dist/server/tree-builder.d.ts.map +1 -1
  371. package/dist/server/types.d.ts +1 -4
  372. package/dist/server/types.d.ts.map +1 -1
  373. package/dist/server/version-skew.d.ts +61 -0
  374. package/dist/server/version-skew.d.ts.map +1 -0
  375. package/dist/shared/merge-search-params.d.ts +22 -0
  376. package/dist/shared/merge-search-params.d.ts.map +1 -0
  377. package/dist/shims/font-google.d.ts +1 -1
  378. package/dist/shims/font-google.d.ts.map +1 -1
  379. package/dist/shims/font-google.js +42 -0
  380. package/dist/shims/font-google.js.map +1 -0
  381. package/dist/shims/font-local.d.ts +26 -0
  382. package/dist/shims/font-local.d.ts.map +1 -0
  383. package/dist/shims/font-local.js +20 -0
  384. package/dist/shims/font-local.js.map +1 -0
  385. package/dist/shims/headers.d.ts +2 -1
  386. package/dist/shims/headers.d.ts.map +1 -1
  387. package/dist/shims/navigation-client.d.ts +1 -1
  388. package/dist/shims/navigation-client.d.ts.map +1 -1
  389. package/dist/shims/navigation.d.ts +3 -2
  390. package/dist/shims/navigation.d.ts.map +1 -1
  391. package/dist/utils/directive-parser.d.ts +5 -2
  392. package/dist/utils/directive-parser.d.ts.map +1 -1
  393. package/dist/utils/state-machine.d.ts +80 -0
  394. package/dist/utils/state-machine.d.ts.map +1 -0
  395. package/package.json +51 -16
  396. package/src/adapters/cloudflare-dev.ts +177 -0
  397. package/src/adapters/cloudflare-kv-cache.ts +142 -0
  398. package/src/adapters/cloudflare.ts +342 -28
  399. package/src/adapters/compress-module.ts +24 -4
  400. package/src/adapters/nitro.ts +52 -8
  401. package/src/adapters/wrangler.d.ts +7 -0
  402. package/src/cache/cache-api.ts +38 -0
  403. package/src/cache/handler-store.ts +68 -0
  404. package/src/cache/index.ts +81 -18
  405. package/src/cache/singleflight.ts +62 -4
  406. package/src/cache/sizeof.ts +31 -0
  407. package/src/cache/timber-cache.ts +24 -20
  408. package/src/cli.ts +16 -6
  409. package/src/client/browser-dev.ts +128 -1
  410. package/src/client/browser-entry/action-dispatch.ts +116 -0
  411. package/src/client/browser-entry/hmr.ts +81 -0
  412. package/src/client/browser-entry/hydrate.ts +145 -0
  413. package/src/client/browser-entry/index.ts +143 -0
  414. package/src/client/browser-entry/post-hydration.ts +119 -0
  415. package/src/client/browser-entry/router-init.ts +193 -0
  416. package/src/client/browser-entry/rsc-stream.ts +157 -0
  417. package/src/client/browser-entry/scroll.ts +27 -0
  418. package/src/client/error-boundary.tsx +48 -16
  419. package/src/client/error-reconstituter.tsx +65 -0
  420. package/src/client/form.tsx +14 -7
  421. package/src/client/history.ts +26 -4
  422. package/src/client/index.ts +65 -38
  423. package/src/client/internal.ts +57 -0
  424. package/src/client/link-pending-store.ts +111 -0
  425. package/src/client/link.tsx +342 -113
  426. package/src/client/nav-link-store.ts +47 -0
  427. package/src/client/navigation-api-types.ts +112 -0
  428. package/src/client/navigation-api.ts +332 -0
  429. package/src/client/navigation-context.ts +31 -6
  430. package/src/client/navigation-root.tsx +342 -0
  431. package/src/client/nuqs-adapter.tsx +16 -3
  432. package/src/client/router-ref.ts +1 -1
  433. package/src/client/router.ts +299 -72
  434. package/src/client/rsc-fetch.ts +97 -8
  435. package/src/client/segment-cache.ts +1 -1
  436. package/src/client/segment-outlet.tsx +86 -0
  437. package/src/client/ssr-data.ts +13 -5
  438. package/src/client/stale-reload.ts +72 -3
  439. package/src/client/top-loader.tsx +18 -6
  440. package/src/client/use-link-status.ts +7 -7
  441. package/src/client/use-params.ts +7 -5
  442. package/src/client/{use-navigation-pending.ts → use-pending-navigation.ts} +6 -6
  443. package/src/client/use-query-states.ts +9 -3
  444. package/src/client/use-router.ts +1 -1
  445. package/src/codec.ts +49 -0
  446. package/src/config-types.ts +264 -0
  447. package/src/config-validation.ts +303 -0
  448. package/src/content/index.ts +5 -13
  449. package/src/cookies/define-cookie.ts +78 -25
  450. package/src/cookies/index.ts +8 -0
  451. package/src/fonts/bundle.ts +142 -0
  452. package/src/fonts/css.ts +2 -1
  453. package/src/fonts/dev-middleware.ts +74 -0
  454. package/src/fonts/pipeline.ts +275 -0
  455. package/src/fonts/transform.ts +353 -0
  456. package/src/fonts/types.ts +50 -1
  457. package/src/fonts/virtual-modules.ts +159 -0
  458. package/src/index.ts +314 -355
  459. package/src/plugin-context.ts +240 -0
  460. package/src/plugins/adapter-build.ts +9 -3
  461. package/src/plugins/build-manifest.ts +13 -2
  462. package/src/plugins/build-report.ts +3 -3
  463. package/src/plugins/client-chunks.ts +65 -0
  464. package/src/plugins/content.ts +1 -1
  465. package/src/plugins/dev-404-page.ts +418 -0
  466. package/src/plugins/dev-browser-logs.ts +288 -0
  467. package/src/plugins/dev-error-overlay.ts +286 -42
  468. package/src/plugins/dev-error-page.ts +536 -0
  469. package/src/plugins/dev-logs.ts +1 -1
  470. package/src/plugins/dev-server.ts +146 -19
  471. package/src/plugins/dev-terminal-error.ts +217 -0
  472. package/src/plugins/entries.ts +111 -10
  473. package/src/plugins/fonts.ts +133 -638
  474. package/src/plugins/mdx.ts +1 -1
  475. package/src/plugins/routing.ts +213 -31
  476. package/src/plugins/server-action-exports.ts +1 -1
  477. package/src/plugins/server-bundle.ts +32 -1
  478. package/src/plugins/shims.ts +136 -35
  479. package/src/plugins/static-build.ts +17 -11
  480. package/src/routing/codegen.ts +273 -105
  481. package/src/routing/convention-lint.ts +356 -0
  482. package/src/routing/index.ts +2 -0
  483. package/src/routing/scanner.ts +93 -23
  484. package/src/routing/segment-classify.ts +89 -0
  485. package/src/routing/status-file-lint.ts +3 -2
  486. package/src/routing/types.ts +17 -4
  487. package/src/rsc-runtime/rsc.ts +2 -0
  488. package/src/rsc-runtime/ssr.ts +50 -0
  489. package/src/rsc-runtime/vendor-types.d.ts +7 -0
  490. package/src/{search-params/codecs.ts → schema-bridge.ts} +57 -20
  491. package/src/search-params/define.ts +482 -0
  492. package/src/search-params/index.ts +14 -20
  493. package/src/search-params/registry.ts +2 -2
  494. package/src/search-params/wrappers.ts +85 -0
  495. package/src/segment-params/define.ts +279 -0
  496. package/src/segment-params/index.ts +9 -0
  497. package/src/server/access-gate.tsx +70 -29
  498. package/src/server/action-client.ts +88 -15
  499. package/src/server/action-encryption.ts +144 -0
  500. package/src/server/action-handler.ts +53 -6
  501. package/src/server/actions.ts +10 -9
  502. package/src/server/als-registry.ts +34 -6
  503. package/src/server/build-manifest.ts +10 -4
  504. package/src/server/compress.ts +25 -7
  505. package/src/server/debug.ts +1 -1
  506. package/src/server/default-logger.ts +99 -0
  507. package/src/server/deny-page-resolver.ts +154 -0
  508. package/src/server/deny-renderer.ts +24 -38
  509. package/src/server/dev-holding-server.ts +185 -0
  510. package/src/server/dev-source-map.ts +31 -0
  511. package/src/server/dev-warnings.ts +4 -49
  512. package/src/server/early-hints.ts +36 -15
  513. package/src/server/error-boundary-wrapper.ts +74 -22
  514. package/src/server/fallback-error.ts +74 -102
  515. package/src/server/flight-injection-state.ts +113 -0
  516. package/src/server/flight-scripts.ts +62 -0
  517. package/src/server/flush.ts +2 -1
  518. package/src/server/form-data.ts +76 -0
  519. package/src/server/html-injectors.ts +280 -120
  520. package/src/server/index.ts +25 -177
  521. package/src/server/internal.ts +169 -0
  522. package/src/server/logger.ts +44 -36
  523. package/src/server/middleware-runner.ts +31 -4
  524. package/src/server/node-stream-transforms.ts +509 -0
  525. package/src/server/page-deny-boundary.tsx +56 -0
  526. package/src/server/pipeline-interception.ts +17 -16
  527. package/src/server/pipeline-metadata.ts +13 -0
  528. package/src/server/pipeline.ts +261 -66
  529. package/src/server/primitives.ts +111 -28
  530. package/src/server/render-timeout.ts +108 -0
  531. package/src/server/request-context.ts +293 -132
  532. package/src/server/route-element-builder.ts +283 -191
  533. package/src/server/route-handler.ts +24 -4
  534. package/src/server/route-matcher.ts +31 -20
  535. package/src/server/rsc-entry/api-handler.ts +15 -16
  536. package/src/server/rsc-entry/error-renderer.ts +305 -89
  537. package/src/server/rsc-entry/helpers.ts +134 -5
  538. package/src/server/rsc-entry/index.ts +304 -111
  539. package/src/server/rsc-entry/rsc-payload.ts +65 -18
  540. package/src/server/rsc-entry/rsc-stream.ts +81 -13
  541. package/src/server/rsc-entry/ssr-bridge.ts +14 -5
  542. package/src/server/rsc-entry/ssr-renderer.ts +171 -38
  543. package/src/server/safe-load.ts +60 -0
  544. package/src/server/sensitive-fields.ts +230 -0
  545. package/src/server/sitemap-generator.ts +338 -0
  546. package/src/server/sitemap-handler.ts +126 -0
  547. package/src/server/slot-resolver.ts +244 -229
  548. package/src/server/ssr-entry.ts +215 -32
  549. package/src/server/ssr-render.ts +289 -67
  550. package/src/server/ssr-wrappers.tsx +139 -0
  551. package/src/server/status-code-resolver.ts +1 -1
  552. package/src/server/stream-utils.ts +213 -0
  553. package/src/server/tracing.ts +20 -9
  554. package/src/server/tree-builder.ts +92 -58
  555. package/src/server/types.ts +3 -6
  556. package/src/server/version-skew.ts +104 -0
  557. package/src/shared/merge-search-params.ts +55 -0
  558. package/src/shims/font-google.ts +1 -1
  559. package/src/shims/font-local.ts +34 -0
  560. package/src/shims/headers.ts +5 -1
  561. package/src/shims/navigation-client.ts +1 -1
  562. package/src/shims/navigation.ts +7 -2
  563. package/src/utils/directive-parser.ts +5 -2
  564. package/src/utils/state-machine.ts +111 -0
  565. package/dist/_chunks/als-registry-B7DbZ2hS.js.map +0 -1
  566. package/dist/_chunks/debug-gwlJkDuf.js.map +0 -1
  567. package/dist/_chunks/format-DviM89f0.js.map +0 -1
  568. package/dist/_chunks/interception-BOoWmLUA.js.map +0 -1
  569. package/dist/_chunks/request-context-DIkVh_jG.js +0 -330
  570. package/dist/_chunks/request-context-DIkVh_jG.js.map +0 -1
  571. package/dist/_chunks/tracing-CemImE6h.js.map +0 -1
  572. package/dist/_chunks/use-cookie-DX-l1_5E.js +0 -91
  573. package/dist/_chunks/use-cookie-DX-l1_5E.js.map +0 -1
  574. package/dist/_chunks/use-query-states-D5KaffOK.js.map +0 -1
  575. package/dist/cache/register-cached-function.d.ts +0 -17
  576. package/dist/cache/register-cached-function.d.ts.map +0 -1
  577. package/dist/client/browser-entry.d.ts +0 -21
  578. package/dist/client/browser-entry.d.ts.map +0 -1
  579. package/dist/client/link-status-provider.d.ts +0 -11
  580. package/dist/client/link-status-provider.d.ts.map +0 -1
  581. package/dist/client/transition-root.d.ts.map +0 -1
  582. package/dist/client/use-navigation-pending.d.ts.map +0 -1
  583. package/dist/cookies/index.js.map +0 -1
  584. package/dist/plugins/cache-transform.d.ts +0 -36
  585. package/dist/plugins/cache-transform.d.ts.map +0 -1
  586. package/dist/plugins/dynamic-transform.d.ts +0 -72
  587. package/dist/plugins/dynamic-transform.d.ts.map +0 -1
  588. package/dist/search-params/analyze.d.ts +0 -54
  589. package/dist/search-params/analyze.d.ts.map +0 -1
  590. package/dist/search-params/builtin-codecs.d.ts +0 -105
  591. package/dist/search-params/builtin-codecs.d.ts.map +0 -1
  592. package/dist/search-params/codecs.d.ts +0 -53
  593. package/dist/search-params/codecs.d.ts.map +0 -1
  594. package/dist/search-params/create.d.ts +0 -106
  595. package/dist/search-params/create.d.ts.map +0 -1
  596. package/dist/server/prerender.d.ts +0 -77
  597. package/dist/server/prerender.d.ts.map +0 -1
  598. package/dist/server/response-cache.d.ts +0 -54
  599. package/dist/server/response-cache.d.ts.map +0 -1
  600. package/src/cache/register-cached-function.ts +0 -103
  601. package/src/client/browser-entry.ts +0 -678
  602. package/src/client/link-status-provider.tsx +0 -30
  603. package/src/client/transition-root.tsx +0 -166
  604. package/src/plugins/cache-transform.ts +0 -199
  605. package/src/plugins/dynamic-transform.ts +0 -161
  606. package/src/search-params/analyze.ts +0 -192
  607. package/src/search-params/builtin-codecs.ts +0 -228
  608. package/src/search-params/create.ts +0 -321
  609. package/src/server/prerender.ts +0 -139
  610. package/src/server/response-cache.ts +0 -410
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Deny Page Resolver — resolves status-code file components for in-tree deny handling.
3
+ *
4
+ * When AccessGate or PageDenyBoundary catches a DenySignal, they need to
5
+ * render the matching deny page (403.tsx, 4xx.tsx, error.tsx) as a normal
6
+ * element in the React tree. This module resolves the deny page chain from
7
+ * the segment chain — a list of fallback components ordered by specificity.
8
+ *
9
+ * The chain is built during buildRouteElement and passed as a prop to
10
+ * AccessGate and PageDenyBoundary. At catch time, the first matching
11
+ * component is rendered.
12
+ *
13
+ * See design/10-error-handling.md §"Status-Code Files", TIM-666.
14
+ */
15
+
16
+ import { createElement } from 'react';
17
+
18
+ import type { ManifestSegmentNode } from './route-matcher.js';
19
+ import { loadModule } from './safe-load.js';
20
+ import { requestContextAls } from './als-registry.js';
21
+
22
+ // ─── Types ────────────────────────────────────────────────────────────────
23
+
24
+ /** A single entry in the deny page fallback chain. */
25
+ export interface DenyPageEntry {
26
+ /** Status code filter: specific (403), category (400 = any 4xx), or null (catch-all). */
27
+ status: number | null;
28
+ /** The component to render (server or client — both work). */
29
+ component: (...args: unknown[]) => unknown;
30
+ }
31
+
32
+ // ─── Resolver ─────────────────────────────────────────────────────────────
33
+
34
+ /**
35
+ * Build the deny page fallback chain from the segment chain.
36
+ *
37
+ * Walks segments from `startIndex` outward (toward root) and collects
38
+ * status-code file components in fallback order:
39
+ * 1. Specific status files (403.tsx, 404.tsx) — exact match
40
+ * 2. Category catch-alls (4xx.tsx) — matches any 4xx
41
+ * 3. error.tsx — catches everything
42
+ *
43
+ * Each segment is checked in this order. The chain is ordered so the
44
+ * FIRST match wins at catch time.
45
+ */
46
+ export async function buildDenyPageChain(
47
+ segments: ManifestSegmentNode[],
48
+ startIndex: number
49
+ ): Promise<DenyPageEntry[]> {
50
+ const chain: DenyPageEntry[] = [];
51
+
52
+ // Pass 1: Status files (specific + category) across ALL segments.
53
+ // These have higher priority than error.tsx — a root 4xx.tsx should
54
+ // match before a leaf error.tsx. Walking inner → outer ensures the
55
+ // nearest match wins within each priority tier.
56
+ for (let i = startIndex; i >= 0; i--) {
57
+ const segment = segments[i];
58
+ if (!segment.statusFiles) continue;
59
+
60
+ // Specific status files (403.tsx, 404.tsx, etc.)
61
+ for (const [key, file] of Object.entries(segment.statusFiles)) {
62
+ if (key !== '4xx' && key !== '5xx') {
63
+ const status = parseInt(key, 10);
64
+ if (!isNaN(status)) {
65
+ const mod = await loadModule(file).catch(() => null);
66
+ if (mod?.default) {
67
+ chain.push({ status, component: mod.default as (...args: unknown[]) => unknown });
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+ // Category catch-alls (4xx.tsx, 5xx.tsx)
74
+ for (const [key, file] of Object.entries(segment.statusFiles)) {
75
+ if (key === '4xx' || key === '5xx') {
76
+ const mod = await loadModule(file).catch(() => null);
77
+ if (mod?.default) {
78
+ const categoryStatus = key === '4xx' ? 400 : 500;
79
+ chain.push({
80
+ status: categoryStatus,
81
+ component: mod.default as (...args: unknown[]) => unknown,
82
+ });
83
+ }
84
+ }
85
+ }
86
+ }
87
+
88
+ // Pass 2: error.tsx files — lowest priority catch-all.
89
+ // Only added AFTER all status files so they never shadow a specific
90
+ // or category status file from an ancestor segment.
91
+ for (let i = startIndex; i >= 0; i--) {
92
+ const segment = segments[i];
93
+ if (segment.error) {
94
+ const mod = await loadModule(segment.error).catch(() => null);
95
+ if (mod?.default) {
96
+ chain.push({ status: null, component: mod.default as (...args: unknown[]) => unknown });
97
+ }
98
+ }
99
+ }
100
+
101
+ return chain;
102
+ }
103
+
104
+ // ─── Matcher ──────────────────────────────────────────────────────────────
105
+
106
+ /**
107
+ * Find the first deny page in the chain that matches the given status code.
108
+ * Returns a React element for the matching component, or null if no match.
109
+ */
110
+ export function renderMatchingDenyPage(
111
+ chain: DenyPageEntry[],
112
+ status: number,
113
+ data: unknown
114
+ ): React.ReactElement | null {
115
+ const h = createElement as (...args: unknown[]) => React.ReactElement;
116
+
117
+ for (const entry of chain) {
118
+ if (entry.status === status) {
119
+ return h(entry.component, { status, dangerouslyPassData: data });
120
+ }
121
+ if (entry.status === 400 && status >= 400 && status <= 499) {
122
+ return h(entry.component, { status, dangerouslyPassData: data });
123
+ }
124
+ if (entry.status === 500 && status >= 500 && status <= 599) {
125
+ return h(entry.component, { status, dangerouslyPassData: data });
126
+ }
127
+ if (entry.status === null) {
128
+ return h(entry.component, { status, dangerouslyPassData: data });
129
+ }
130
+ }
131
+ return null;
132
+ }
133
+
134
+ // ─── ALS Helper ───────────────────────────────────────────────────────────
135
+
136
+ /**
137
+ * Set the deny status in the request context ALS.
138
+ * Called from AccessGate / PageDenyBoundary when a DenySignal is caught.
139
+ * The pipeline reads this after render to set the HTTP status code.
140
+ */
141
+ export function setDenyStatus(status: number): void {
142
+ const store = requestContextAls.getStore();
143
+ if (store) {
144
+ store.denyStatus = status;
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Read the deny status from the request context ALS.
150
+ * Returns undefined if no deny was caught during render.
151
+ */
152
+ export function getDenyStatus(): number | undefined {
153
+ return requestContextAls.getStore()?.denyStatus;
154
+ }
@@ -16,18 +16,21 @@
16
16
  */
17
17
 
18
18
  import { createElement } from 'react';
19
- import { renderToReadableStream } from '#/rsc-runtime/rsc.js';
19
+ import { renderToReadableStream } from '../rsc-runtime/rsc.js';
20
20
 
21
21
  import { DenySignal } from './primitives.js';
22
22
  import { logRenderError } from './logger.js';
23
+ import { loadModule } from './safe-load.js';
23
24
  import { isDebug } from './debug.js';
24
25
  import { resolveMetadata, renderMetadataToElements } from './metadata.js';
25
26
  import { resolveManifestStatusFile } from './manifest-status-resolver.js';
26
27
  import type { ManifestSegmentNode } from './route-matcher.js';
27
28
  import type { RouteMatch } from './pipeline.js';
28
29
  import type { NavContext } from './ssr-entry.js';
30
+ import { flightInitScript } from './flight-scripts.js';
29
31
  import type { ClientBootstrapConfig } from './html-injectors.js';
30
32
  import type { Metadata } from './types.js';
33
+ import { teeWithErrorPropagation } from './stream-utils.js';
31
34
 
32
35
  /** RSC content type for client navigation payload requests. */
33
36
  const RSC_CONTENT_TYPE = 'text/x-component';
@@ -108,7 +111,7 @@ export async function renderDenyPage(
108
111
  }
109
112
 
110
113
  // Load the status-code page component
111
- const mod = (await resolution.file.load()) as Record<string, unknown>;
114
+ const mod = await loadModule(resolution.file);
112
115
  if (!mod.default) {
113
116
  return new Response(null, { status: deny.status, headers: responseHeaders });
114
117
  }
@@ -116,9 +119,6 @@ export async function renderDenyPage(
116
119
  const ErrorPageComponent = mod.default as (...args: unknown[]) => unknown;
117
120
  const h = createElement as (...args: unknown[]) => React.ReactElement;
118
121
 
119
- // Check shell opt-out: export const shell = false
120
- const shellEnabled = mod.shell !== false;
121
-
122
122
  // 4xx status-code pages receive { status, dangerouslyPassData }
123
123
  // per design/10-error-handling.md §"Status-Code File Props"
124
124
  let element = h(ErrorPageComponent, {
@@ -126,23 +126,14 @@ export async function renderDenyPage(
126
126
  dangerouslyPassData: deny.data,
127
127
  });
128
128
 
129
- // Wrap in layouts unless shell is explicitly disabled
130
- if (shellEnabled) {
131
- const resolvedSegments = new Set(segments.slice(0, resolution.segmentIndex + 1));
132
- const layoutsToWrap = layoutComponents.filter((lc) => resolvedSegments.has(lc.segment));
133
- for (let i = layoutsToWrap.length - 1; i >= 0; i--) {
134
- const { component } = layoutsToWrap[i];
135
- element = h(component, null, element);
136
- }
137
- } else if (isDebug()) {
138
- // Dev-mode: warn if shell=false might conflict with Suspense
139
- // The actual Suspense boundary check happens at render time in the pipeline.
140
- // This is a preemptive log for developer awareness.
141
- console.warn(
142
- `[timber] Status-code file ${resolution.file.filePath} exports shell = false. ` +
143
- 'If deny() fires inside a Suspense boundary, layouts are already committed and ' +
144
- 'cannot be unwrapped. The shell opt-out will be ignored in that case.'
145
- );
129
+ // Always wrap in layout shell.
130
+ // NOTE: Shell opt-out (export const shell = false) is a future feature
131
+ // pending a proper design doc. See design backlog.
132
+ const resolvedSegments = new Set(segments.slice(0, resolution.segmentIndex + 1));
133
+ const layoutsToWrap = layoutComponents.filter((lc) => resolvedSegments.has(lc.segment));
134
+ for (let i = layoutsToWrap.length - 1; i >= 0; i--) {
135
+ const { component } = layoutsToWrap[i];
136
+ element = h(component, null, element);
146
137
  }
147
138
 
148
139
  // Build head HTML from error page metadata (if any)
@@ -170,15 +161,15 @@ export async function renderDenyPage(
170
161
  debugChannel: createDebugChannelSink(),
171
162
  });
172
163
 
173
- const [ssrStream, inlineStream] = rscStream.tee();
164
+ const [ssrStream, inlineStream] = teeWithErrorPropagation(rscStream);
174
165
 
175
166
  const navContext: NavContext = {
176
167
  pathname: new URL(req.url).pathname,
177
- params: match.params,
168
+ params: match.segmentParams,
178
169
  searchParams: Object.fromEntries(new URL(req.url).searchParams),
179
170
  statusCode: deny.status,
180
171
  responseHeaders,
181
- headHtml,
172
+ headHtml: headHtml + flightInitScript(),
182
173
  bootstrapScriptContent: clientBootstrap.bootstrapScriptContent,
183
174
  rscStream: inlineStream,
184
175
  };
@@ -206,7 +197,7 @@ export async function renderDenyPageAsRsc(
206
197
  return new Response(null, { status: deny.status, headers: responseHeaders });
207
198
  }
208
199
 
209
- const mod = (await resolution.file.load()) as Record<string, unknown>;
200
+ const mod = await loadModule(resolution.file);
210
201
  if (!mod.default) {
211
202
  responseHeaders.set('content-type', `${RSC_CONTENT_TYPE}; charset=utf-8`);
212
203
  return new Response(null, { status: deny.status, headers: responseHeaders });
@@ -215,22 +206,17 @@ export async function renderDenyPageAsRsc(
215
206
  const ErrorPageComponent = mod.default as (...args: unknown[]) => unknown;
216
207
  const h = createElement as (...args: unknown[]) => React.ReactElement;
217
208
 
218
- // Check shell opt-out
219
- const shellEnabled = mod.shell !== false;
220
-
221
209
  let element = h(ErrorPageComponent, {
222
210
  status: deny.status,
223
211
  dangerouslyPassData: deny.data,
224
212
  });
225
213
 
226
- // Wrap in layouts unless shell is explicitly disabled
227
- if (shellEnabled) {
228
- const resolvedSegments = new Set(segments.slice(0, resolution.segmentIndex + 1));
229
- const layoutsToWrap = layoutComponents.filter((lc) => resolvedSegments.has(lc.segment));
230
- for (let i = layoutsToWrap.length - 1; i >= 0; i--) {
231
- const { component } = layoutsToWrap[i];
232
- element = h(component, null, element);
233
- }
214
+ // Always wrap in layout shell.
215
+ const resolvedSegments = new Set(segments.slice(0, resolution.segmentIndex + 1));
216
+ const layoutsToWrap = layoutComponents.filter((lc) => resolvedSegments.has(lc.segment));
217
+ for (let i = layoutsToWrap.length - 1; i >= 0; i--) {
218
+ const { component } = layoutsToWrap[i];
219
+ element = h(component, null, element);
234
220
  }
235
221
 
236
222
  const rscStream = renderToReadableStream(element, {
@@ -272,7 +258,7 @@ async function renderDenyPageJson(
272
258
  // JSON status files are loaded as modules that export the JSON content.
273
259
  // The manifest's load() imports the .json file, which Vite handles as a
274
260
  // default export of the parsed JSON object.
275
- const mod = (await resolution.file.load()) as Record<string, unknown>;
261
+ const mod = await loadModule(resolution.file);
276
262
  const jsonContent = mod.default ?? mod;
277
263
 
278
264
  responseHeaders.set('content-type', 'application/json; charset=utf-8');
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Dev holding server — serves a loading page while Vite initializes.
3
+ *
4
+ * When `timber dev` (or `vite dev`) starts, Vite takes several seconds
5
+ * to initialize all plugins, scan routes, and boot the RSC environment.
6
+ * During this window, the port is unbound and browsers get
7
+ * ERR_CONNECTION_REFUSED.
8
+ *
9
+ * This module creates a lightweight HTTP server that binds the port
10
+ * immediately and serves a branded holding page with auto-refresh.
11
+ * Once Vite is ready, the holding server is closed and Vite's server
12
+ * takes over the port.
13
+ *
14
+ * The holding server is started in rootSync's config() hook (the
15
+ * earliest Vite plugin lifecycle point where we know the port) and
16
+ * closed in timber-dev-server's configureServer() hook (the last
17
+ * plugin, right before Vite calls server.listen()).
18
+ *
19
+ * Browser requests (Accept: text/html) get the HTML holding page.
20
+ * API requests (Accept: application/json) get a 503 JSON response.
21
+ * All responses include Retry-After: 1.
22
+ *
23
+ * See design/21-dev-server.md, TIM-665.
24
+ */
25
+
26
+ import http from 'node:http';
27
+
28
+ // ─── Types ────────────────────────────────────────────────────────────────
29
+
30
+ export interface HoldingServer {
31
+ /**
32
+ * Start listening on the given port.
33
+ * Returns the actual bound port (useful when port is 0 for OS assignment).
34
+ */
35
+ listen(port: number): Promise<number>;
36
+
37
+ /** Gracefully close the server and stop accepting connections. */
38
+ close(): Promise<void>;
39
+ }
40
+
41
+ // ─── Holding Page HTML ────────────────────────────────────────────────────
42
+
43
+ /**
44
+ * Minimal self-contained HTML holding page.
45
+ *
46
+ * Matches the timber.js docs site theme:
47
+ * - Light mode: warm stone/grain background, timber/bark text
48
+ * - Dark mode: stone-900 background, stone-200 text
49
+ * - 🪵 timber.js branding
50
+ *
51
+ * Uses meta-refresh (1s) for auto-reload — works without JavaScript.
52
+ * Inline CSS only, no external dependencies.
53
+ */
54
+ const HOLDING_PAGE_HTML = [
55
+ '<!DOCTYPE html>',
56
+ '<html lang="en">',
57
+ '<head>',
58
+ ' <meta charset="utf-8">',
59
+ ' <meta name="viewport" content="width=device-width, initial-scale=1">',
60
+ ' <meta http-equiv="refresh" content="2">',
61
+ ' <title>timber — starting...</title>',
62
+ ' <style>',
63
+ ' *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }',
64
+ ' body {',
65
+ ' font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;',
66
+ ' background: #fafaf9;',
67
+ ' color: #44403c;',
68
+ ' display: flex;',
69
+ ' align-items: center;',
70
+ ' justify-content: center;',
71
+ ' min-height: 100vh;',
72
+ ' -webkit-font-smoothing: antialiased;',
73
+ ' }',
74
+ ' @media (prefers-color-scheme: dark) {',
75
+ ' body { background: #1c1917; color: #e7e5e4; }',
76
+ ' .message { color: #a8a29e; }',
77
+ ' .spinner { border-color: #57534e; border-top-color: #a1887f; }',
78
+ ' .logo { color: #e7e5e4; }',
79
+ ' }',
80
+ ' .container { text-align: center; padding: 2rem; }',
81
+ ' .logo {',
82
+ ' font-size: 1.5rem;',
83
+ ' font-weight: 700;',
84
+ ' letter-spacing: -0.02em;',
85
+ ' color: #5c3d2e;',
86
+ ' margin-bottom: 1.5rem;',
87
+ ' }',
88
+ ' .message {',
89
+ ' font-size: 0.95rem;',
90
+ ' color: #78716c;',
91
+ ' margin-bottom: 2rem;',
92
+ ' }',
93
+ ' .spinner {',
94
+ ' width: 24px;',
95
+ ' height: 24px;',
96
+ ' border: 2.5px solid #d7ccc8;',
97
+ ' border-top-color: #6d4c41;',
98
+ ' border-radius: 50%;',
99
+ ' animation: spin 0.8s linear infinite;',
100
+ ' margin: 0 auto;',
101
+ ' }',
102
+ ' @keyframes spin { to { transform: rotate(360deg); } }',
103
+ ' </style>',
104
+ '</head>',
105
+ '<body>',
106
+ ' <div class="container">',
107
+ ' <div class="logo">\u{1FAB5} timber.js</div>',
108
+ ' <p class="message">Dev server starting&hellip;</p>',
109
+ ' <div class="spinner"></div>',
110
+ ' </div>',
111
+ '</body>',
112
+ '</html>',
113
+ ].join('\n');
114
+
115
+ // ─── Factory ──────────────────────────────────────────────────────────────
116
+
117
+ /**
118
+ * Create a holding HTTP server that serves a loading page during startup.
119
+ *
120
+ * Usage (inside Vite plugin):
121
+ * ```ts
122
+ * // In config() hook — earliest point where port is known
123
+ * const holding = createHoldingServer();
124
+ * holding.listen(config.server?.port ?? 5173);
125
+ *
126
+ * // In last plugin's configureServer() — wrap listen for seamless handoff
127
+ * const originalListen = server.listen.bind(server);
128
+ * server.listen = async (...args) => {
129
+ * await holding.close();
130
+ * return originalListen(...args);
131
+ * };
132
+ * ```
133
+ */
134
+ export function createHoldingServer(): HoldingServer {
135
+ const server = http.createServer((req, res) => {
136
+ const accept = req.headers.accept ?? '';
137
+
138
+ // API requests: JSON 503
139
+ if (accept.includes('application/json') && !accept.includes('text/html')) {
140
+ res.writeHead(503, {
141
+ 'Content-Type': 'application/json; charset=utf-8',
142
+ 'Retry-After': '1',
143
+ 'Cache-Control': 'no-store',
144
+ });
145
+ res.end(
146
+ JSON.stringify({
147
+ error: 'Service Unavailable',
148
+ message: 'timber dev server is starting — please retry shortly',
149
+ })
150
+ );
151
+ return;
152
+ }
153
+
154
+ // Browser and other requests: HTML holding page
155
+ res.writeHead(503, {
156
+ 'Content-Type': 'text/html; charset=utf-8',
157
+ 'Retry-After': '1',
158
+ 'Cache-Control': 'no-store',
159
+ });
160
+ res.end(HOLDING_PAGE_HTML);
161
+ });
162
+
163
+ return {
164
+ listen(port: number): Promise<number> {
165
+ return new Promise((resolve, reject) => {
166
+ server.once('error', reject);
167
+ server.listen(port, () => {
168
+ server.removeListener('error', reject);
169
+ const addr = server.address();
170
+ const boundPort = typeof addr === 'object' && addr ? addr.port : port;
171
+ resolve(boundPort);
172
+ });
173
+ });
174
+ },
175
+
176
+ close(): Promise<void> {
177
+ return new Promise((resolve, reject) => {
178
+ server.close((err) => {
179
+ if (err) reject(err);
180
+ else resolve();
181
+ });
182
+ });
183
+ },
184
+ };
185
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Dev-only error source-mapping bridge.
3
+ *
4
+ * Stores a callback that rewrites an error's stack trace using the Vite
5
+ * dev server's module graph. Set by the RSC entry on startup (via
6
+ * setDevSourceMapHandler), consumed by error renderers before generating
7
+ * error pages.
8
+ *
9
+ * In production, the callback is never set — all calls are no-ops.
10
+ *
11
+ * See TIM-811.
12
+ */
13
+
14
+ let _sourceMapError: ((error: Error) => void) | undefined;
15
+
16
+ /**
17
+ * Set the source-map callback. Called once during dev server initialization.
18
+ */
19
+ export function setSourceMapCallback(fn: (error: Error) => void): void {
20
+ _sourceMapError = fn;
21
+ }
22
+
23
+ /**
24
+ * Source-map an error's stack trace in-place if the callback is available.
25
+ * No-op in production or before the dev server initializes.
26
+ */
27
+ export function sourceMapError(error: unknown): void {
28
+ if (_sourceMapError && error instanceof Error) {
29
+ _sourceMapError(error);
30
+ }
31
+ }
@@ -25,7 +25,6 @@ export const WarningId = {
25
25
  REDIRECT_IN_SUSPENSE: 'REDIRECT_IN_SUSPENSE',
26
26
  REDIRECT_IN_ACCESS: 'REDIRECT_IN_ACCESS',
27
27
  STATIC_REQUEST_API: 'STATIC_REQUEST_API',
28
- CACHE_REQUEST_PROPS: 'CACHE_REQUEST_PROPS',
29
28
  SLOW_SLOT_NO_SUSPENSE: 'SLOW_SLOT_NO_SUSPENSE',
30
29
  } as const;
31
30
 
@@ -111,7 +110,7 @@ export function warnSuspenseWrappingChildren(layoutFile: string): void {
111
110
  'warn',
112
111
  `Layout at ${layoutFile} wraps {children} in <Suspense>. ` +
113
112
  'This prevents child pages from setting HTTP status codes. ' +
114
- 'Use useNavigationPending() for loading states instead.'
113
+ 'Use usePendingNavigation() for loading states instead.'
115
114
  );
116
115
  }
117
116
 
@@ -179,7 +178,7 @@ export function warnRedirectInAccess(accessFile: string, line?: number): void {
179
178
  }
180
179
 
181
180
  /**
182
- * Warn when cookies() or headers() is called during a static build.
181
+ * Warn when getCookies() or getHeaders() is called during a static build.
183
182
  *
184
183
  * In output: 'static' mode, there is no per-request context — these APIs
185
184
  * read build-time values only. This is almost always a mistake.
@@ -197,33 +196,8 @@ export function warnStaticRequestApi(api: 'cookies' | 'headers', file: string):
197
196
  );
198
197
  }
199
198
 
200
- /**
201
- * Warn when a "use cache" component receives request-specific props.
202
- *
203
- * Cached components should not depend on per-request data — a userId or
204
- * sessionId in the props means the cache will either be ineffective
205
- * (key per user) or dangerous (serve one user's data to another).
206
- *
207
- * @param componentName - Name of the cached component
208
- * @param propName - Name of the suspicious prop
209
- * @param file - Relative path to the component file
210
- * @param line - Line number
211
- */
212
- export function warnCacheRequestProps(
213
- componentName: string,
214
- propName: string,
215
- file: string,
216
- line?: number
217
- ): void {
218
- const location = line ? `${file}:${line}` : file;
219
- emitOnce(
220
- WarningId.CACHE_REQUEST_PROPS,
221
- `${componentName}:${propName}:${location}`,
222
- 'warn',
223
- `Cached component ${componentName} receives prop "${propName}" which appears request-specific. ` +
224
- 'Cached components should not depend on per-request data.'
225
- );
226
- }
199
+ // NOTE: warnCacheRequestProps removed — 'use cache' directive is a future feature.
200
+ // See design/06-caching.md.
227
201
 
228
202
  /**
229
203
  * Warn when a parallel slot resolves slowly without a <Suspense> wrapper.
@@ -245,25 +219,6 @@ export function warnSlowSlotWithoutSuspense(slotName: string, durationMs: number
245
219
  );
246
220
  }
247
221
 
248
- // ─── Legacy aliases ─────────────────────────────────────────────────────────
249
-
250
- /** @deprecated Use warnStaticRequestApi instead */
251
- export const warnDynamicApiInStaticBuild = warnStaticRequestApi;
252
-
253
- /** @deprecated Use warnRedirectInAccess instead */
254
- export function warnRedirectInSlotAccess(slotName: string): void {
255
- warnRedirectInAccess(`${slotName}/access.ts`);
256
- }
257
-
258
- /** @deprecated Use warnDenyInSuspense / warnRedirectInSuspense instead */
259
- export function warnDenyAfterFlush(signal: 'deny' | 'redirect'): void {
260
- if (signal === 'deny') {
261
- warnDenyInSuspense('unknown');
262
- } else {
263
- warnRedirectInSuspense('unknown');
264
- }
265
- }
266
-
267
222
  // ─── Testing ────────────────────────────────────────────────────────────────
268
223
 
269
224
  /**