@timber-js/app 0.2.0-alpha.235 → 0.2.0-alpha.237

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 (300) hide show
  1. package/dist/_chunks/{actions-CYjRMpZI.js → actions-Top9GftB.js} +3 -3
  2. package/dist/_chunks/{actions-CYjRMpZI.js.map → actions-Top9GftB.js.map} +1 -1
  3. package/dist/_chunks/{cache-api-BZJNt01a.js → cache-api-Bo8c7XVF.js} +6 -6
  4. package/dist/_chunks/{cache-api-BZJNt01a.js.map → cache-api-Bo8c7XVF.js.map} +1 -1
  5. package/dist/_chunks/{chains-D-RRc7CM.js → chains-BsGKkMTK.js} +2 -2
  6. package/dist/_chunks/{chains-D-RRc7CM.js.map → chains-BsGKkMTK.js.map} +1 -1
  7. package/dist/_chunks/chains-DHmoKxkO.js +1 -0
  8. package/dist/_chunks/{classify-_W0RWa5w.js → classify-cmE0Gins.js} +2 -2
  9. package/dist/_chunks/{classify-_W0RWa5w.js.map → classify-cmE0Gins.js.map} +1 -1
  10. package/dist/_chunks/{cli-check-Dl3yo3Zv.js → cli-check-BwiahbTC.js} +3 -3
  11. package/dist/_chunks/{cli-check-Dl3yo3Zv.js.map → cli-check-BwiahbTC.js.map} +1 -1
  12. package/dist/_chunks/{cli-schema-sync-CyrOHbAo.js → cli-schema-sync-B2ldclRO.js} +2 -2
  13. package/dist/_chunks/{cli-schema-sync-CyrOHbAo.js.map → cli-schema-sync-B2ldclRO.js.map} +1 -1
  14. package/dist/_chunks/{cli-schema-sync-CTWiBMZZ.js → cli-schema-sync-Brw7kTmm.js} +1 -1
  15. package/dist/_chunks/{client-dep-entries-C9hv-3k9.js → client-dep-entries-C1nMlLKV.js} +2 -2
  16. package/dist/_chunks/{client-dep-entries-C9hv-3k9.js.map → client-dep-entries-C1nMlLKV.js.map} +1 -1
  17. package/dist/_chunks/{cloudflare-_2fhxQE8.js → cloudflare-Dk5Hqo-O.js} +3 -3
  18. package/dist/_chunks/{cloudflare-_2fhxQE8.js.map → cloudflare-Dk5Hqo-O.js.map} +1 -1
  19. package/dist/_chunks/{convention-lint-D54k6uUM.js → convention-lint-CLpuzY5h.js} +3 -3
  20. package/dist/_chunks/{convention-lint-D54k6uUM.js.map → convention-lint-CLpuzY5h.js.map} +1 -1
  21. package/dist/_chunks/dev-server-BGGGhHXx.js +1 -0
  22. package/dist/_chunks/{dev-server-cmWVDgTf.js → dev-server-lrdpD7Ws.js} +121 -5
  23. package/dist/_chunks/dev-server-lrdpD7Ws.js.map +1 -0
  24. package/dist/_chunks/{dev-span-_NzMX-au.js → dev-span-RsVeYYc_.js} +5 -2
  25. package/dist/_chunks/dev-span-RsVeYYc_.js.map +1 -0
  26. package/dist/_chunks/{error-boundary-Cf1m-Ywk.js → error-boundary-Bh-egWUI.js} +6 -6
  27. package/dist/_chunks/{error-boundary-Cf1m-Ywk.js.map → error-boundary-Bh-egWUI.js.map} +1 -1
  28. package/dist/_chunks/{flight-source-node-BGanuoSS.js → flight-source-node-BsrlUjMO.js} +7 -3
  29. package/dist/_chunks/flight-source-node-BsrlUjMO.js.map +1 -0
  30. package/dist/_chunks/{href-BtspoNc9.js → href-8l5VD23D.js} +2 -2
  31. package/dist/_chunks/{href-BtspoNc9.js.map → href-8l5VD23D.js.map} +1 -1
  32. package/dist/_chunks/{json-lossy-check-BXM45k8p.js → json-lossy-check-D47R9Fp5.js} +2 -2
  33. package/dist/_chunks/{json-lossy-check-BXM45k8p.js.map → json-lossy-check-D47R9Fp5.js.map} +1 -1
  34. package/dist/_chunks/{live-graph-C7-yA8W9.js → live-graph-ChuFfmLi.js} +4 -4
  35. package/dist/_chunks/{live-graph-C7-yA8W9.js.map → live-graph-ChuFfmLi.js.map} +1 -1
  36. package/dist/_chunks/{logger-YtMSKfft.js → logger-DDLtp5e-.js} +16 -1
  37. package/dist/_chunks/logger-DDLtp5e-.js.map +1 -0
  38. package/dist/_chunks/navigation-root-Cvb7P1ud.js.map +1 -1
  39. package/dist/_chunks/{node-response-D3hXWb8y.js → node-response-omewa8e6.js} +21 -4
  40. package/dist/_chunks/node-response-omewa8e6.js.map +1 -0
  41. package/dist/_chunks/{poison-scan-CRSP06Es.js → poison-scan-CJ9QfJWb.js} +2 -2
  42. package/dist/_chunks/{poison-scan-CRSP06Es.js.map → poison-scan-CJ9QfJWb.js.map} +1 -1
  43. package/dist/_chunks/render-timeout-MrrqD1wd.js.map +1 -1
  44. package/dist/_chunks/{scanner-BNQ4qnLX.js → scanner-CrB_h6FA.js} +5 -5
  45. package/dist/_chunks/{scanner-BNQ4qnLX.js.map → scanner-CrB_h6FA.js.map} +1 -1
  46. package/dist/_chunks/{sizeof-Cmx6Fs-Y.js → sizeof-DVhEVN_y.js} +2 -2
  47. package/dist/_chunks/{sizeof-Cmx6Fs-Y.js.map → sizeof-DVhEVN_y.js.map} +1 -1
  48. package/dist/_chunks/{walkers-DFC9KsBL.js → walkers-BUvpsb2Q.js} +3 -3
  49. package/dist/_chunks/{walkers-DFC9KsBL.js.map → walkers-BUvpsb2Q.js.map} +1 -1
  50. package/dist/adapters/cloudflare-dev.js +1 -1
  51. package/dist/adapters/cloudflare-kv-cache.js +2 -2
  52. package/dist/adapters/cloudflare.js +1 -1
  53. package/dist/adapters/nitro.js +1 -1
  54. package/dist/analyze/crawl-entry.js +3 -3
  55. package/dist/analyze/graph-command.js +3 -3
  56. package/dist/cache/index.js +2 -2
  57. package/dist/cache/stores/memory.js +1 -1
  58. package/dist/cli.js +3 -3
  59. package/dist/client/dev-pill/index.d.ts +2 -1
  60. package/dist/client/dev-pill/index.d.ts.map +1 -1
  61. package/dist/client/dev-pill/view.d.ts.map +1 -1
  62. package/dist/client/error-boundary.js +1 -1
  63. package/dist/client/index.js +4 -4
  64. package/dist/client/internal.js +3 -3
  65. package/dist/cookies/index.js +1 -1
  66. package/dist/dev-tools/await-span.d.ts +7 -0
  67. package/dist/dev-tools/await-span.d.ts.map +1 -1
  68. package/dist/dev-tools/instrumentation.d.ts.map +1 -1
  69. package/dist/dev-tools/logger.d.ts +8 -2
  70. package/dist/dev-tools/logger.d.ts.map +1 -1
  71. package/dist/dev-tools/span-sink.d.ts +9 -1
  72. package/dist/dev-tools/span-sink.d.ts.map +1 -1
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +73 -31
  75. package/dist/index.js.map +1 -1
  76. package/dist/native/rsc/_react/chunks/{react-server-dom-webpack-server.node.development-hQ_odxIB.js → react-server-dom-webpack-server.node.development-CAttMzVD.js} +2 -2
  77. package/dist/native/rsc/_react/flight-client.js +2 -2
  78. package/dist/native/rsc/_react/flight-server.js +1 -1
  79. package/dist/native/rsc/_react/flight-static.js +1 -1
  80. package/dist/native/rsc/adapters/cloudflare-kv-cache.js +1 -1
  81. package/dist/native/rsc/adapters/cloudflare.js +2 -2
  82. package/dist/native/rsc/cache/cache-api.js +3 -3
  83. package/dist/native/rsc/cache/index.js +3 -3
  84. package/dist/native/rsc/cache/timber-cache.js +2 -2
  85. package/dist/native/rsc/cdn/index.js +1 -1
  86. package/dist/native/rsc/client/use-cookie.js +1 -1
  87. package/dist/native/rsc/dev-tools/404-page.js +1 -1
  88. package/dist/native/rsc/dev-tools/await-span.js +5 -2
  89. package/dist/native/rsc/dev-tools/await-span.js.map +1 -1
  90. package/dist/native/rsc/dev-tools/error-page.js +2 -2
  91. package/dist/native/rsc/dev-tools/instrumentation.js +38 -3
  92. package/dist/native/rsc/dev-tools/instrumentation.js.map +1 -1
  93. package/dist/native/rsc/dev-tools/logger.js +123 -80
  94. package/dist/native/rsc/dev-tools/logger.js.map +1 -1
  95. package/dist/native/rsc/dev-tools/span-sink.js +1 -0
  96. package/dist/native/rsc/dev-tools/span-sink.js.map +1 -1
  97. package/dist/native/rsc/dev-tools/terminal.js +1 -1
  98. package/dist/native/rsc/manifest.json +1 -0
  99. package/dist/native/rsc/params/index.js +1 -1
  100. package/dist/native/rsc/routing/collision-probe.js +1 -1
  101. package/dist/native/rsc/routing/interception.js +1 -1
  102. package/dist/native/rsc/search-params/define.js +2 -2
  103. package/dist/native/rsc/server/abort-scope.js +6 -2
  104. package/dist/native/rsc/server/abort-scope.js.map +1 -1
  105. package/dist/native/rsc/server/access-gate.js +1 -1
  106. package/dist/native/rsc/server/action-client.js +2 -2
  107. package/dist/native/rsc/server/action-handler.js +8 -8
  108. package/dist/native/rsc/server/actions.js +3 -3
  109. package/dist/native/rsc/server/children-interception.js +1 -1
  110. package/dist/native/rsc/server/deny-boundary.js +1 -1
  111. package/dist/native/rsc/server/deny-renderer.js +10 -10
  112. package/dist/native/rsc/server/fallback-error.js +1 -1
  113. package/dist/native/rsc/server/flight-injector-core.js +2 -2
  114. package/dist/native/rsc/server/flight-source-node.js +8 -4
  115. package/dist/native/rsc/server/flight-source-node.js.map +1 -1
  116. package/dist/native/rsc/server/index.js +4 -4
  117. package/dist/native/rsc/server/interception-gates.js +2 -2
  118. package/dist/native/rsc/server/internal.js +15 -15
  119. package/dist/native/rsc/server/logger.js +2 -2
  120. package/dist/native/rsc/server/metadata-route-links.js +1 -1
  121. package/dist/native/rsc/server/node-body-response.js +1 -1
  122. package/dist/native/rsc/server/param-coercion.js +1 -1
  123. package/dist/native/rsc/server/pipeline-helpers.js +11 -11
  124. package/dist/native/rsc/server/pipeline-helpers.js.map +1 -1
  125. package/dist/native/rsc/server/pipeline-interception.js +4 -4
  126. package/dist/native/rsc/server/pipeline-metadata-route.js +11 -11
  127. package/dist/native/rsc/server/pipeline-metadata-route.js.map +1 -1
  128. package/dist/native/rsc/server/pipeline-outcome.js +4 -4
  129. package/dist/native/rsc/server/pipeline-phases.js +11 -11
  130. package/dist/native/rsc/server/pipeline.js +10 -10
  131. package/dist/native/rsc/server/prebuilt/capture-render.js +1 -1
  132. package/dist/native/rsc/server/prebuilt/dev-store.js +1 -1
  133. package/dist/native/rsc/server/prebuilt/overlay.js +3 -3
  134. package/dist/native/rsc/server/prebuilt-builder.js +8 -8
  135. package/dist/native/rsc/server/prebuilt-runtime.js +15 -15
  136. package/dist/native/rsc/server/primitives.js +2 -2
  137. package/dist/native/rsc/server/publish-params.js +1 -1
  138. package/dist/native/rsc/server/render-timeout.js.map +1 -1
  139. package/dist/native/rsc/server/request-context.js +1 -1
  140. package/dist/native/rsc/server/route-element-builder.js +7 -7
  141. package/dist/native/rsc/server/route-element-helpers.js +1 -1
  142. package/dist/native/rsc/server/route-handler.js +1 -1
  143. package/dist/native/rsc/server/rsc-entry/action-dispatcher.js +1 -1
  144. package/dist/native/rsc/server/rsc-entry/action-middleware-runner.js +1 -1
  145. package/dist/native/rsc/server/rsc-entry/api-handler.js +1 -1
  146. package/dist/native/rsc/server/rsc-entry/deny-fallback.js +6 -6
  147. package/dist/native/rsc/server/rsc-entry/error-renderer.js +7 -7
  148. package/dist/native/rsc/server/rsc-entry/helpers.js +1 -1
  149. package/dist/native/rsc/server/rsc-entry/render-route.js +4 -4
  150. package/dist/native/rsc/server/rsc-entry/revalidate-renderer.js +7 -7
  151. package/dist/native/rsc/server/rsc-entry/rsc-payload.js +3 -3
  152. package/dist/native/rsc/server/rsc-entry/rsc-stream.js +6 -6
  153. package/dist/native/rsc/server/rsc-entry/ssr-renderer.js +10 -10
  154. package/dist/native/rsc/server/rsc-error-envelope.js +1 -1
  155. package/dist/native/rsc/server/safe-load.js +14 -2
  156. package/dist/native/rsc/server/safe-load.js.map +1 -1
  157. package/dist/native/rsc/server/sitemap-handler.js +1 -1
  158. package/dist/native/rsc/server/skippable-prefix.js +2 -2
  159. package/dist/native/rsc/server/slot-interception.js +1 -1
  160. package/dist/native/rsc/server/slot-resolver.js +11 -11
  161. package/dist/native/rsc/server/static-generator.js +2 -2
  162. package/dist/native/rsc/server/traced-access.js +1 -1
  163. package/dist/native/rsc/server/tracing.js +10 -0
  164. package/dist/native/rsc/server/tracing.js.map +1 -1
  165. package/dist/native/rsc/shared/dev-span.js +8 -2
  166. package/dist/native/rsc/shared/dev-span.js.map +1 -1
  167. package/dist/native/rsc/shared/href.js +1 -1
  168. package/dist/native/rsc/shared/span-waterfall.js +90 -0
  169. package/dist/native/rsc/shared/span-waterfall.js.map +1 -0
  170. package/dist/native/ssr/adapters/cloudflare-kv-cache.js +1 -1
  171. package/dist/native/ssr/adapters/cloudflare.js +2 -2
  172. package/dist/native/ssr/cache/cache-api.js +3 -3
  173. package/dist/native/ssr/cache/guarded-read.js +1 -1
  174. package/dist/native/ssr/cache/index.js +3 -3
  175. package/dist/native/ssr/cache/timber-cache.js +3 -3
  176. package/dist/native/ssr/cdn/index.js +1 -1
  177. package/dist/native/ssr/client/error-boundary.js +1 -1
  178. package/dist/native/ssr/client/index.js +5 -5
  179. package/dist/native/ssr/client/link.js +5 -5
  180. package/dist/native/ssr/client/navigation-commit.js +2 -2
  181. package/dist/native/ssr/client/nuqs-adapter.js +2 -2
  182. package/dist/native/ssr/client/params-context.js +1 -1
  183. package/dist/native/ssr/client/router-skew.js +1 -1
  184. package/dist/native/ssr/client/rsc-fetch.js +2 -2
  185. package/dist/native/ssr/client/use-pending-navigation.js +1 -1
  186. package/dist/native/ssr/client/use-search-params.js +2 -2
  187. package/dist/native/ssr/client/use-segment-params.js +1 -1
  188. package/dist/native/ssr/client/use-selected-layout-segment.js +1 -1
  189. package/dist/native/ssr/dev-tools/await-span.js +5 -2
  190. package/dist/native/ssr/dev-tools/await-span.js.map +1 -1
  191. package/dist/native/ssr/dev-tools/instrumentation.js +38 -3
  192. package/dist/native/ssr/dev-tools/instrumentation.js.map +1 -1
  193. package/dist/native/ssr/dev-tools/logger.js +123 -80
  194. package/dist/native/ssr/dev-tools/logger.js.map +1 -1
  195. package/dist/native/ssr/dev-tools/span-sink.js +1 -0
  196. package/dist/native/ssr/dev-tools/span-sink.js.map +1 -1
  197. package/dist/native/ssr/manifest.json +1 -0
  198. package/dist/native/ssr/params/index.js +1 -1
  199. package/dist/native/ssr/search-params/define.js +2 -2
  200. package/dist/native/ssr/server/abort-scope.js +6 -2
  201. package/dist/native/ssr/server/abort-scope.js.map +1 -1
  202. package/dist/native/ssr/server/access-gate.js +1 -1
  203. package/dist/native/ssr/server/action-client.js +2 -2
  204. package/dist/native/ssr/server/actions.js +3 -3
  205. package/dist/native/ssr/server/deny-boundary.js +2 -2
  206. package/dist/native/ssr/server/flight-injector-core.js +1 -1
  207. package/dist/native/ssr/server/flight-source-node.js +8 -4
  208. package/dist/native/ssr/server/flight-source-node.js.map +1 -1
  209. package/dist/native/ssr/server/index.js +4 -4
  210. package/dist/native/ssr/server/internal.js +12 -12
  211. package/dist/native/ssr/server/logger.js +2 -2
  212. package/dist/native/ssr/server/node-body-response.js +1 -1
  213. package/dist/native/ssr/server/node-stream-transforms.js +2 -2
  214. package/dist/native/ssr/server/param-coercion.js +3 -3
  215. package/dist/native/ssr/server/pipeline-helpers.js +8 -8
  216. package/dist/native/ssr/server/pipeline-helpers.js.map +1 -1
  217. package/dist/native/ssr/server/pipeline-interception.js +4 -4
  218. package/dist/native/ssr/server/pipeline-metadata-route.js +11 -11
  219. package/dist/native/ssr/server/pipeline-metadata-route.js.map +1 -1
  220. package/dist/native/ssr/server/pipeline-outcome.js +4 -4
  221. package/dist/native/ssr/server/pipeline-phases.js +10 -10
  222. package/dist/native/ssr/server/pipeline.js +10 -10
  223. package/dist/native/ssr/server/prebuilt/capture-render.js +2 -2
  224. package/dist/native/ssr/server/prebuilt/dev-store.js +1 -1
  225. package/dist/native/ssr/server/prebuilt/overlay.js +4 -4
  226. package/dist/native/ssr/server/prebuilt-runtime.js +14 -14
  227. package/dist/native/ssr/server/primitives.js +2 -2
  228. package/dist/native/ssr/server/render-timeout.js +3 -4
  229. package/dist/native/ssr/server/render-timeout.js.map +1 -1
  230. package/dist/native/ssr/server/request-context.js +2 -2
  231. package/dist/native/ssr/server/route-handler.js +1 -1
  232. package/dist/native/ssr/server/rsc-error-envelope.js +1 -1
  233. package/dist/native/ssr/server/safe-load.js +10 -1
  234. package/dist/native/ssr/server/safe-load.js.map +1 -1
  235. package/dist/native/ssr/server/ssr-form-state.js +2 -2
  236. package/dist/native/ssr/server/ssr-wrappers.js +1 -1
  237. package/dist/native/ssr/server/traced-access.js +1 -1
  238. package/dist/native/ssr/server/tracing.js +10 -0
  239. package/dist/native/ssr/server/tracing.js.map +1 -1
  240. package/dist/native/ssr/shared/dev-span.js +8 -2
  241. package/dist/native/ssr/shared/dev-span.js.map +1 -1
  242. package/dist/native/ssr/shared/href.js +1 -1
  243. package/dist/native/ssr/shared/span-waterfall.js +90 -0
  244. package/dist/native/ssr/shared/span-waterfall.js.map +1 -0
  245. package/dist/plugins/dev-precompile.d.ts +84 -0
  246. package/dist/plugins/dev-precompile.d.ts.map +1 -0
  247. package/dist/plugins/dev-server.d.ts.map +1 -1
  248. package/dist/plugins/entries.d.ts.map +1 -1
  249. package/dist/plugins/virtual-ids.d.ts +16 -0
  250. package/dist/plugins/virtual-ids.d.ts.map +1 -0
  251. package/dist/routes/index.js +1 -1
  252. package/dist/routing/index.js +3 -3
  253. package/dist/search-params/index.js +2 -2
  254. package/dist/server/abort-scope.d.ts +7 -0
  255. package/dist/server/abort-scope.d.ts.map +1 -1
  256. package/dist/server/flight-source-node.d.ts.map +1 -1
  257. package/dist/server/index.js +2 -2
  258. package/dist/server/internal.js +57 -17
  259. package/dist/server/internal.js.map +1 -1
  260. package/dist/server/render-timeout.d.ts.map +1 -1
  261. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  262. package/dist/server/safe-load.d.ts +22 -0
  263. package/dist/server/safe-load.d.ts.map +1 -1
  264. package/dist/server/tracing.d.ts.map +1 -1
  265. package/dist/shared/dev-span.d.ts +12 -1
  266. package/dist/shared/dev-span.d.ts.map +1 -1
  267. package/dist/shared/span-waterfall.d.ts +88 -0
  268. package/dist/shared/span-waterfall.d.ts.map +1 -0
  269. package/package.json +2 -2
  270. package/src/client/dev-pill/index.ts +5 -2
  271. package/src/client/dev-pill/store.ts +1 -1
  272. package/src/client/dev-pill/view.ts +15 -5
  273. package/src/dev-tools/await-span.ts +10 -0
  274. package/src/dev-tools/instrumentation.ts +44 -6
  275. package/src/dev-tools/logger.ts +230 -155
  276. package/src/dev-tools/span-sink.ts +34 -3
  277. package/src/index.ts +21 -11
  278. package/src/plugins/dev-precompile.ts +168 -0
  279. package/src/plugins/dev-server.ts +16 -3
  280. package/src/plugins/entries.ts +1 -11
  281. package/src/plugins/virtual-ids.ts +15 -0
  282. package/src/server/abort-scope.ts +20 -1
  283. package/src/server/flight-source-node.ts +11 -2
  284. package/src/server/pipeline-helpers.ts +2 -2
  285. package/src/server/pipeline-metadata-route.ts +2 -2
  286. package/src/server/render-timeout.ts +8 -5
  287. package/src/server/rsc-entry/index.ts +5 -0
  288. package/src/server/safe-load.ts +53 -1
  289. package/src/server/tracing.ts +29 -0
  290. package/src/shared/dev-span.ts +17 -2
  291. package/src/{client/dev-pill/waterfall.ts → shared/span-waterfall.ts} +84 -51
  292. package/dist/_chunks/chains-KblEfYzm.js +0 -1
  293. package/dist/_chunks/dev-server-DrYBIg66.js +0 -1
  294. package/dist/_chunks/dev-server-cmWVDgTf.js.map +0 -1
  295. package/dist/_chunks/dev-span-_NzMX-au.js.map +0 -1
  296. package/dist/_chunks/flight-source-node-BGanuoSS.js.map +0 -1
  297. package/dist/_chunks/logger-YtMSKfft.js.map +0 -1
  298. package/dist/_chunks/node-response-D3hXWb8y.js.map +0 -1
  299. package/dist/client/dev-pill/waterfall.d.ts +0 -64
  300. package/dist/client/dev-pill/waterfall.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { b as swallow } from "./logger-YtMSKfft.js";
1
+ import { b as swallow } from "./logger-DDLtp5e-.js";
2
2
  // src/cache/sizeof.ts
3
3
  /**
4
4
  * Lightweight byte-size estimation for cache entries.
@@ -32,4 +32,4 @@ function estimateByteSize(value) {
32
32
  }
33
33
  export { estimateByteSize as t };
34
34
 
35
- //# sourceMappingURL=sizeof-Cmx6Fs-Y.js.map
35
+ //# sourceMappingURL=sizeof-DVhEVN_y.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sizeof-Cmx6Fs-Y.js","names":[],"sources":["../../src/cache/sizeof.ts"],"sourcesContent":["/**\n * Lightweight byte-size estimation for cache entries.\n *\n * Estimates the in-memory byte cost of a JavaScript value using\n * JSON.stringify().length * 2 (UTF-16 char width). This is a rough\n * approximation — it doesn't account for V8 object overhead, Map\n * metadata, or non-serializable values — but it's fast and good\n * enough for cache budget enforcement.\n *\n * Values that fail JSON serialization (circular references, BigInt,\n * etc.) return 0, allowing the entry to be cached without counting\n * toward the byte budget. This is a conservative choice: it's better\n * to cache and undercount than to reject the entry.\n */\n\nimport { swallow } from '../server/logger.ts';\n\n/**\n * Estimate the byte size of a value.\n *\n * Uses `JSON.stringify(value).length * 2` to approximate UTF-16\n * in-memory size. Returns 0 if the value is not serializable.\n */\nexport function estimateByteSize(value: unknown): number {\n try {\n const json = JSON.stringify(value);\n if (json === undefined) return 0;\n // Each JS string character is 2 bytes (UTF-16)\n return json.length * 2;\n } catch (e) {\n // Circular reference or non-serializable value\n swallow(e, 'sizeof estimation failed', { level: 'debug' });\n return 0;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,iBAAiB,OAAwB;CACvD,IAAI;EACF,MAAM,OAAO,KAAK,UAAU,KAAK;EACjC,IAAI,SAAS,KAAA,GAAW,OAAO;EAE/B,OAAO,KAAK,SAAS;CACvB,SAAS,GAAG;EAEV,QAAQ,GAAG,4BAA4B,EAAE,OAAO,QAAQ,CAAC;EACzD,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"sizeof-DVhEVN_y.js","names":[],"sources":["../../src/cache/sizeof.ts"],"sourcesContent":["/**\n * Lightweight byte-size estimation for cache entries.\n *\n * Estimates the in-memory byte cost of a JavaScript value using\n * JSON.stringify().length * 2 (UTF-16 char width). This is a rough\n * approximation — it doesn't account for V8 object overhead, Map\n * metadata, or non-serializable values — but it's fast and good\n * enough for cache budget enforcement.\n *\n * Values that fail JSON serialization (circular references, BigInt,\n * etc.) return 0, allowing the entry to be cached without counting\n * toward the byte budget. This is a conservative choice: it's better\n * to cache and undercount than to reject the entry.\n */\n\nimport { swallow } from '../server/logger.ts';\n\n/**\n * Estimate the byte size of a value.\n *\n * Uses `JSON.stringify(value).length * 2` to approximate UTF-16\n * in-memory size. Returns 0 if the value is not serializable.\n */\nexport function estimateByteSize(value: unknown): number {\n try {\n const json = JSON.stringify(value);\n if (json === undefined) return 0;\n // Each JS string character is 2 bytes (UTF-16)\n return json.length * 2;\n } catch (e) {\n // Circular reference or non-serializable value\n swallow(e, 'sizeof estimation failed', { level: 'debug' });\n return 0;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,iBAAiB,OAAwB;CACvD,IAAI;EACF,MAAM,OAAO,KAAK,UAAU,KAAK;EACjC,IAAI,SAAS,KAAA,GAAW,OAAO;EAE/B,OAAO,KAAK,SAAS;CACvB,SAAS,GAAG;EAEV,QAAQ,GAAG,4BAA4B,EAAE,OAAO,QAAQ,CAAC;EACzD,OAAO;CACT;AACF"}
@@ -1,6 +1,6 @@
1
1
  import { n as classifyUrlSegment } from "./segment-classify-Ho8jXWeC.js";
2
- import { u as readFileCached } from "./scanner-BNQ4qnLX.js";
3
- import { a as parseExistingSchemaKeys, r as findSchemaFile } from "./cli-schema-sync-CyrOHbAo.js";
2
+ import { u as readFileCached } from "./scanner-CrB_h6FA.js";
3
+ import { a as parseExistingSchemaKeys, r as findSchemaFile } from "./cli-schema-sync-B2ldclRO.js";
4
4
  // src/routing/schema-validation.ts
5
5
  /**
6
6
  * Schema key/value validation against the filesystem route tree.
@@ -139,4 +139,4 @@ function walk(node, chain, result, includeSlots) {
139
139
  }
140
140
  export { collectDynamicSegmentsFromTree as n, validateSchemaAgainstRoutes as r, collectLeafRoutes as t };
141
141
 
142
- //# sourceMappingURL=walkers-DFC9KsBL.js.map
142
+ //# sourceMappingURL=walkers-BUvpsb2Q.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"walkers-DFC9KsBL.js","names":[],"sources":["../../src/routing/schema-validation.ts","../../src/routing/walkers.ts"],"sourcesContent":["/**\n * Schema key/value validation against the filesystem route tree.\n *\n * Runs at codegen time (build + dev) to catch mismatches between\n * app/schema.ts keys and the actual dynamic segments on disk.\n *\n * Design doc: design/41-global-params.md\n */\n\nimport { readFileCached } from './file-cache.ts';\nimport type { RouteTree, SegmentNode } from './types.ts';\nimport { findSchemaFile, parseExistingSchemaKeys } from '../cli-schema-sync.ts';\nimport { classifyUrlSegment } from './segment-classify.ts';\n\nexport interface SchemaWarning {\n type: 'stale-key' | 'missing-key' | 'bracket-mismatch';\n key: string;\n message: string;\n filesystemKey?: string;\n}\n\n/**\n * Collect all unique bracket-keyed dynamic segment names from a route tree.\n * Returns entries like '[artistSlug]', '[...slug]', '[[...topic]]'.\n */\nexport function collectDynamicSegmentsFromTree(tree: RouteTree): Set<string> {\n const segments = new Set<string>();\n walkTree(tree.root, segments);\n return segments;\n}\n\nfunction walkTree(node: SegmentNode, segments: Set<string>): void {\n if (node.paramName && node.segmentName) {\n const classified = classifyUrlSegment(node.segmentName);\n if (classified.kind !== 'static') {\n // Use bare bracket form for schema keys — affixed segments like\n // `img-[id].png` register as `[id]`, matching runtime codec lookup.\n if (classified.kind === 'dynamic' && (classified.prefix || classified.suffix)) {\n segments.add(`[${classified.name}]`);\n } else {\n segments.add(node.segmentName);\n }\n }\n }\n for (const child of node.children) {\n walkTree(child, segments);\n }\n for (const slot of Object.values(node.slots)) {\n walkTree(slot, segments);\n }\n}\n\n/**\n * Extract the param name from a bracket key.\n * '[id]' → 'id', '[...slug]' → 'slug', '[[...topic]]' → 'topic'\n */\nfunction extractParamName(bracketKey: string): string | null {\n const seg = classifyUrlSegment(bracketKey);\n if (seg.kind === 'static') return null;\n return seg.name;\n}\n\n/**\n * Validate schema keys against the filesystem route tree.\n *\n * Returns warnings for:\n * - Stale keys: schema keys that don't match any filesystem segment\n * - Bracket form mismatches: same param name, different bracket form\n * - Missing keys: filesystem segments not registered in schema (informational)\n */\nexport function validateSchemaAgainstRoutes(tree: RouteTree, appDir: string): SchemaWarning[] {\n const schemaPath = findSchemaFile(appDir);\n if (!schemaPath) return [];\n\n const content = readFileCached(schemaPath);\n const schemaKeys = parseExistingSchemaKeys(content);\n\n if (schemaKeys.length === 0) return [];\n\n const filesystemSegments = collectDynamicSegmentsFromTree(tree);\n\n return validateKeys(schemaKeys, filesystemSegments);\n}\n\n/**\n * Core validation: compare schema keys against filesystem segments.\n * Exported separately for testing without filesystem dependencies.\n */\nexport function validateKeys(\n schemaKeys: string[],\n filesystemSegments: Set<string>\n): SchemaWarning[] {\n const warnings: SchemaWarning[] = [];\n\n // Build a map of param name → bracket form for filesystem segments\n const fsParamToKey = new Map<string, string>();\n for (const fsKey of filesystemSegments) {\n const name = extractParamName(fsKey);\n if (name) {\n fsParamToKey.set(name, fsKey);\n }\n }\n\n // Build a set of schema param names for the missing-key check\n const schemaParamNames = new Set<string>();\n\n for (const schemaKey of schemaKeys) {\n const schemaParamName = extractParamName(schemaKey);\n if (!schemaParamName) continue;\n\n schemaParamNames.add(schemaParamName);\n\n if (filesystemSegments.has(schemaKey)) {\n // Exact match — no issue\n continue;\n }\n\n // Check if the param name exists but with a different bracket form\n const fsKey = fsParamToKey.get(schemaParamName);\n if (fsKey) {\n warnings.push({\n type: 'bracket-mismatch',\n key: schemaKey,\n filesystemKey: fsKey,\n message:\n `Schema key '${schemaKey}' does not match filesystem bracket form '${fsKey}'. ` +\n `Update the schema key to '${fsKey}'.`,\n });\n } else {\n warnings.push({\n type: 'stale-key',\n key: schemaKey,\n message:\n `Schema key '${schemaKey}' does not match any dynamic segment in the filesystem. ` +\n `Remove it from app/schema.ts or create the corresponding route segment.`,\n });\n }\n }\n\n // Check for filesystem segments not in schema (informational)\n for (const fsKey of filesystemSegments) {\n const name = extractParamName(fsKey);\n if (name && !schemaParamNames.has(name)) {\n warnings.push({\n type: 'missing-key',\n key: fsKey,\n message:\n `Dynamic segment '${fsKey}' has no codec in app/schema.ts (defaults to string). ` +\n `Run: timber schema sync`,\n });\n }\n }\n\n return warnings;\n}\n","/**\n * Shared route-tree walkers (TIM-848).\n *\n * Tiny helpers that walk a `SegmentNode<TFile>` tree generically. Both the\n * build-time tree (`SegmentNode<RouteFile>`) and the runtime manifest\n * tree (`SegmentNode<ManifestFile>`) flow through these helpers because\n * the walker only reads the structural fields shared by both shapes\n * (`children`, `slots`, `page`, `route`, `urlPath`).\n *\n * Before this module, three near-identical `collectRoutes` functions\n * lived in `plugins/dev-404-page.ts`, `plugins/build-report.ts`, and\n * `routing/codegen.ts`. The codegen one is special-purpose (it\n * accumulates `ParamEntry[]` and resolves codec chains) and stays\n * local; the other two now share `collectLeafRoutes` from this file.\n */\n\nimport type { SegmentNode } from './types.ts';\n\n/** A leaf route discovered while walking the segment tree. */\nexport interface LeafRoute<TFile> {\n /** URL path of the leaf (root is \"/\"). */\n urlPath: string;\n /** Segment chain from root to this leaf, inclusive. */\n segments: SegmentNode<TFile>[];\n /** The page file at this leaf, if any. */\n page?: TFile;\n /** The route handler file at this leaf, if any. */\n route?: TFile;\n}\n\n/** Options for `collectLeafRoutes`. */\nexport interface CollectLeafRoutesOptions {\n /**\n * If true, recurse into parallel slots and emit slot leaves alongside\n * the main route tree. Defaults to `false` because slots render\n * alongside their parent at the same URL and are not separately\n * URL-addressable. The build report excludes slots; route-listing\n * UIs that want to show \"all leaves with a page handler\" can opt in.\n */\n includeSlots?: boolean;\n}\n\n/**\n * Walk a segment tree and collect every leaf with a `page` or `route`\n * handler. Generic over `TFile` so it works on both the build-time\n * scanner output and the runtime manifest tree.\n *\n * - Pages and route handlers at the same URL produce two distinct\n * entries (the build report deduplicates by URL afterward).\n * - Parallel slots are skipped unless `includeSlots: true` (slots\n * share their parent's URL and are not addressable on their own).\n * - Intercepting subtrees are skipped unconditionally. They render only\n * on soft navigation and add no URL depth, so their computed `urlPath`s\n * are not addresses — listing them would advertise routes (`/[year]`)\n * that no request can reach. This matches every other consumer of the\n * tree that produces URLs: the sitemap generator, the static generator,\n * prerendering and the prebuilt-payload builder all skip them too.\n * - Result is sorted by `urlPath` for deterministic output.\n */\nexport function collectLeafRoutes<TFile>(\n root: SegmentNode<TFile>,\n options: CollectLeafRoutesOptions = {}\n): LeafRoute<TFile>[] {\n const { includeSlots = false } = options;\n const result: LeafRoute<TFile>[] = [];\n walk(root, [], result, includeSlots);\n result.sort((a, b) => a.urlPath.localeCompare(b.urlPath));\n return result;\n}\n\nfunction walk<TFile>(\n node: SegmentNode<TFile>,\n chain: SegmentNode<TFile>[],\n result: LeafRoute<TFile>[],\n includeSlots: boolean\n): void {\n if (node.segmentType === 'intercepting') return;\n\n const currentChain = [...chain, node];\n const path = node.urlPath || '/';\n\n if (node.page) {\n result.push({ urlPath: path, segments: currentChain, page: node.page });\n }\n if (node.route) {\n result.push({ urlPath: path, segments: currentChain, route: node.route });\n }\n\n for (const child of node.children) {\n walk(child, currentChain, result, includeSlots);\n }\n\n if (includeSlots) {\n for (const slotNode of Object.values(node.slots)) {\n walk(slotNode, currentChain, result, includeSlots);\n }\n }\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"walkers-BUvpsb2Q.js","names":[],"sources":["../../src/routing/schema-validation.ts","../../src/routing/walkers.ts"],"sourcesContent":["/**\n * Schema key/value validation against the filesystem route tree.\n *\n * Runs at codegen time (build + dev) to catch mismatches between\n * app/schema.ts keys and the actual dynamic segments on disk.\n *\n * Design doc: design/41-global-params.md\n */\n\nimport { readFileCached } from './file-cache.ts';\nimport type { RouteTree, SegmentNode } from './types.ts';\nimport { findSchemaFile, parseExistingSchemaKeys } from '../cli-schema-sync.ts';\nimport { classifyUrlSegment } from './segment-classify.ts';\n\nexport interface SchemaWarning {\n type: 'stale-key' | 'missing-key' | 'bracket-mismatch';\n key: string;\n message: string;\n filesystemKey?: string;\n}\n\n/**\n * Collect all unique bracket-keyed dynamic segment names from a route tree.\n * Returns entries like '[artistSlug]', '[...slug]', '[[...topic]]'.\n */\nexport function collectDynamicSegmentsFromTree(tree: RouteTree): Set<string> {\n const segments = new Set<string>();\n walkTree(tree.root, segments);\n return segments;\n}\n\nfunction walkTree(node: SegmentNode, segments: Set<string>): void {\n if (node.paramName && node.segmentName) {\n const classified = classifyUrlSegment(node.segmentName);\n if (classified.kind !== 'static') {\n // Use bare bracket form for schema keys — affixed segments like\n // `img-[id].png` register as `[id]`, matching runtime codec lookup.\n if (classified.kind === 'dynamic' && (classified.prefix || classified.suffix)) {\n segments.add(`[${classified.name}]`);\n } else {\n segments.add(node.segmentName);\n }\n }\n }\n for (const child of node.children) {\n walkTree(child, segments);\n }\n for (const slot of Object.values(node.slots)) {\n walkTree(slot, segments);\n }\n}\n\n/**\n * Extract the param name from a bracket key.\n * '[id]' → 'id', '[...slug]' → 'slug', '[[...topic]]' → 'topic'\n */\nfunction extractParamName(bracketKey: string): string | null {\n const seg = classifyUrlSegment(bracketKey);\n if (seg.kind === 'static') return null;\n return seg.name;\n}\n\n/**\n * Validate schema keys against the filesystem route tree.\n *\n * Returns warnings for:\n * - Stale keys: schema keys that don't match any filesystem segment\n * - Bracket form mismatches: same param name, different bracket form\n * - Missing keys: filesystem segments not registered in schema (informational)\n */\nexport function validateSchemaAgainstRoutes(tree: RouteTree, appDir: string): SchemaWarning[] {\n const schemaPath = findSchemaFile(appDir);\n if (!schemaPath) return [];\n\n const content = readFileCached(schemaPath);\n const schemaKeys = parseExistingSchemaKeys(content);\n\n if (schemaKeys.length === 0) return [];\n\n const filesystemSegments = collectDynamicSegmentsFromTree(tree);\n\n return validateKeys(schemaKeys, filesystemSegments);\n}\n\n/**\n * Core validation: compare schema keys against filesystem segments.\n * Exported separately for testing without filesystem dependencies.\n */\nexport function validateKeys(\n schemaKeys: string[],\n filesystemSegments: Set<string>\n): SchemaWarning[] {\n const warnings: SchemaWarning[] = [];\n\n // Build a map of param name → bracket form for filesystem segments\n const fsParamToKey = new Map<string, string>();\n for (const fsKey of filesystemSegments) {\n const name = extractParamName(fsKey);\n if (name) {\n fsParamToKey.set(name, fsKey);\n }\n }\n\n // Build a set of schema param names for the missing-key check\n const schemaParamNames = new Set<string>();\n\n for (const schemaKey of schemaKeys) {\n const schemaParamName = extractParamName(schemaKey);\n if (!schemaParamName) continue;\n\n schemaParamNames.add(schemaParamName);\n\n if (filesystemSegments.has(schemaKey)) {\n // Exact match — no issue\n continue;\n }\n\n // Check if the param name exists but with a different bracket form\n const fsKey = fsParamToKey.get(schemaParamName);\n if (fsKey) {\n warnings.push({\n type: 'bracket-mismatch',\n key: schemaKey,\n filesystemKey: fsKey,\n message:\n `Schema key '${schemaKey}' does not match filesystem bracket form '${fsKey}'. ` +\n `Update the schema key to '${fsKey}'.`,\n });\n } else {\n warnings.push({\n type: 'stale-key',\n key: schemaKey,\n message:\n `Schema key '${schemaKey}' does not match any dynamic segment in the filesystem. ` +\n `Remove it from app/schema.ts or create the corresponding route segment.`,\n });\n }\n }\n\n // Check for filesystem segments not in schema (informational)\n for (const fsKey of filesystemSegments) {\n const name = extractParamName(fsKey);\n if (name && !schemaParamNames.has(name)) {\n warnings.push({\n type: 'missing-key',\n key: fsKey,\n message:\n `Dynamic segment '${fsKey}' has no codec in app/schema.ts (defaults to string). ` +\n `Run: timber schema sync`,\n });\n }\n }\n\n return warnings;\n}\n","/**\n * Shared route-tree walkers (TIM-848).\n *\n * Tiny helpers that walk a `SegmentNode<TFile>` tree generically. Both the\n * build-time tree (`SegmentNode<RouteFile>`) and the runtime manifest\n * tree (`SegmentNode<ManifestFile>`) flow through these helpers because\n * the walker only reads the structural fields shared by both shapes\n * (`children`, `slots`, `page`, `route`, `urlPath`).\n *\n * Before this module, three near-identical `collectRoutes` functions\n * lived in `plugins/dev-404-page.ts`, `plugins/build-report.ts`, and\n * `routing/codegen.ts`. The codegen one is special-purpose (it\n * accumulates `ParamEntry[]` and resolves codec chains) and stays\n * local; the other two now share `collectLeafRoutes` from this file.\n */\n\nimport type { SegmentNode } from './types.ts';\n\n/** A leaf route discovered while walking the segment tree. */\nexport interface LeafRoute<TFile> {\n /** URL path of the leaf (root is \"/\"). */\n urlPath: string;\n /** Segment chain from root to this leaf, inclusive. */\n segments: SegmentNode<TFile>[];\n /** The page file at this leaf, if any. */\n page?: TFile;\n /** The route handler file at this leaf, if any. */\n route?: TFile;\n}\n\n/** Options for `collectLeafRoutes`. */\nexport interface CollectLeafRoutesOptions {\n /**\n * If true, recurse into parallel slots and emit slot leaves alongside\n * the main route tree. Defaults to `false` because slots render\n * alongside their parent at the same URL and are not separately\n * URL-addressable. The build report excludes slots; route-listing\n * UIs that want to show \"all leaves with a page handler\" can opt in.\n */\n includeSlots?: boolean;\n}\n\n/**\n * Walk a segment tree and collect every leaf with a `page` or `route`\n * handler. Generic over `TFile` so it works on both the build-time\n * scanner output and the runtime manifest tree.\n *\n * - Pages and route handlers at the same URL produce two distinct\n * entries (the build report deduplicates by URL afterward).\n * - Parallel slots are skipped unless `includeSlots: true` (slots\n * share their parent's URL and are not addressable on their own).\n * - Intercepting subtrees are skipped unconditionally. They render only\n * on soft navigation and add no URL depth, so their computed `urlPath`s\n * are not addresses — listing them would advertise routes (`/[year]`)\n * that no request can reach. This matches every other consumer of the\n * tree that produces URLs: the sitemap generator, the static generator,\n * prerendering and the prebuilt-payload builder all skip them too.\n * - Result is sorted by `urlPath` for deterministic output.\n */\nexport function collectLeafRoutes<TFile>(\n root: SegmentNode<TFile>,\n options: CollectLeafRoutesOptions = {}\n): LeafRoute<TFile>[] {\n const { includeSlots = false } = options;\n const result: LeafRoute<TFile>[] = [];\n walk(root, [], result, includeSlots);\n result.sort((a, b) => a.urlPath.localeCompare(b.urlPath));\n return result;\n}\n\nfunction walk<TFile>(\n node: SegmentNode<TFile>,\n chain: SegmentNode<TFile>[],\n result: LeafRoute<TFile>[],\n includeSlots: boolean\n): void {\n if (node.segmentType === 'intercepting') return;\n\n const currentChain = [...chain, node];\n const path = node.urlPath || '/';\n\n if (node.page) {\n result.push({ urlPath: path, segments: currentChain, page: node.page });\n }\n if (node.route) {\n result.push({ urlPath: path, segments: currentChain, route: node.route });\n }\n\n for (const child of node.children) {\n walk(child, currentChain, result, includeSlots);\n }\n\n if (includeSlots) {\n for (const slotNode of Object.values(node.slots)) {\n walk(slotNode, currentChain, result, includeSlots);\n }\n }\n}\n"],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- import { d as runWithBindings } from "../_chunks/cloudflare-_2fhxQE8.js";
1
+ import { d as runWithBindings } from "../_chunks/cloudflare-Dk5Hqo-O.js";
2
2
  // src/adapters/cloudflare-dev.ts
3
3
  /**
4
4
  * Dynamically import wrangler. Extracted as a named export so tests
@@ -1,5 +1,5 @@
1
- import { t as warnLossyJsonValue } from "../_chunks/json-lossy-check-BXM45k8p.js";
2
- import { c as getCloudflareBindings } from "../_chunks/cloudflare-_2fhxQE8.js";
1
+ import { c as getCloudflareBindings } from "../_chunks/cloudflare-Dk5Hqo-O.js";
2
+ import { t as warnLossyJsonValue } from "../_chunks/json-lossy-check-D47R9Fp5.js";
3
3
  // src/adapters/cloudflare-kv-cache.ts
4
4
  var LEGACY_GRACE_MS = 2592e6;
5
5
  /**
@@ -1 +1 @@
1
- export { t as buildStaticOutput, n as cloudflare, r as generateBindingsConfig, i as generatePrebuiltSourceModule, a as generatePreviewCommand, o as generateWorkerEntry, s as generateWranglerConfig, c as getCloudflareBindings, l as readPrebuiltData, u as readUserWranglerConfig, d as runWithBindings, f as stagePagesPreview } from "../_chunks/cloudflare-_2fhxQE8.js";
1
+ export { t as buildStaticOutput, n as cloudflare, r as generateBindingsConfig, i as generatePrebuiltSourceModule, a as generatePreviewCommand, o as generateWorkerEntry, s as generateWranglerConfig, c as getCloudflareBindings, l as readPrebuiltData, u as readUserWranglerConfig, d as runWithBindings, f as stagePagesPreview } from "../_chunks/cloudflare-Dk5Hqo-O.js";
@@ -1,6 +1,6 @@
1
+ import { a as RUNTIME_INIT_MODULE, c as generateRuntimeInitModule, i as IMMUTABLE_CACHE, n as runSharedBuildSteps, o as STATIC_CACHE, r as writeHeadersFile, s as adapterBase, t as buildStaticDirectoryOutput } from "../_chunks/build-output-helper-5UsltK-S.js";
1
2
  import { t as RSC_CONTENT_TYPE } from "../_chunks/rsc-media-type-m8jz9u6_.js";
2
3
  import { a as REDIRECTS_FILE, i as HEADERS_FILE } from "../_chunks/fs-identity-BmQ_Agg-.js";
3
- import { a as RUNTIME_INIT_MODULE, c as generateRuntimeInitModule, i as IMMUTABLE_CACHE, n as runSharedBuildSteps, o as STATIC_CACHE, r as writeHeadersFile, s as adapterBase, t as buildStaticDirectoryOutput } from "../_chunks/build-output-helper-5UsltK-S.js";
4
4
  import { transformWithOxc } from "vite";
5
5
  import { basename, dirname, join, relative, sep } from "node:path";
6
6
  import { existsSync } from "node:fs";
@@ -1,8 +1,8 @@
1
+ import { i as detectDirective, r as classifyModules } from "../_chunks/classify-cmE0Gins.js";
1
2
  import { i as scanProjectSourceFiles, n as isScannableSourceFile, t as buildSourceExtensions } from "../_chunks/scan-CyizcBiX.js";
3
+ import { n as stitchImportChains } from "../_chunks/chains-BsGKkMTK.js";
4
+ import { n as importSignals, r as poisoningsFor, t as collectImportSpecifiers } from "../_chunks/poison-scan-CJ9QfJWb.js";
2
5
  import { s as isTimberPluginApi, u as resolveAppDir } from "../_chunks/plugin-context-BtaQcMuh.js";
3
- import { i as detectDirective, r as classifyModules } from "../_chunks/classify-_W0RWa5w.js";
4
- import { n as stitchImportChains } from "../_chunks/chains-D-RRc7CM.js";
5
- import { n as importSignals, r as poisoningsFor, t as collectImportSpecifiers } from "../_chunks/poison-scan-CRSP06Es.js";
6
6
  import { normalizePath } from "vite";
7
7
  import { join, resolve } from "node:path";
8
8
  import { readFile, realpath, writeFile } from "node:fs/promises";
@@ -1,6 +1,6 @@
1
1
  import { a as readDevRecords, i as probeDevServer, t as DEV_PROBE_TIMEOUT_MS } from "../_chunks/dev-discovery-YnabkCKD.js";
2
- import { r as normalizeSlashes } from "../_chunks/scan-CyizcBiX.js";
3
2
  import { a as readGraphCache, i as hashFingerprintEntries, n as computeProjectFingerprint, o as writeGraphCache, r as fingerprintEntriesForFiles, t as collectBaseFingerprintEntries } from "../_chunks/graph-cache-B1LAg4t7.js";
3
+ import { r as normalizeSlashes } from "../_chunks/scan-CyizcBiX.js";
4
4
  import { dirname, join, relative, resolve, sep } from "node:path";
5
5
  import { existsSync } from "node:fs";
6
6
  import { fileURLToPath } from "node:url";
@@ -293,7 +293,7 @@ async function printSingleFile(input, target, module, answer, json) {
293
293
  console.log(` environments: ${envs.length > 0 ? envs.join(", ") : "none"}`);
294
294
  if (module.subtreeUnknown) console.log(" note: reachable, but its subtree is unknown (never transformed)");
295
295
  if (module.chains.length > 0) {
296
- const { formatChains } = await import("../_chunks/chains-KblEfYzm.js");
296
+ const { formatChains } = await import("../_chunks/chains-DHmoKxkO.js");
297
297
  console.log(" import chains:");
298
298
  console.log(formatChains(module.chains, root));
299
299
  }
@@ -312,7 +312,7 @@ async function printDevServerText(data, configDir) {
312
312
  console.log(` environments: ${envList.length > 0 ? envList.join(", ") : "none"}`);
313
313
  if (data.subtreeUnknown) console.log(" note: reachable, but its subtree is unknown (never transformed)");
314
314
  if (data.chains.length > 0) {
315
- const { formatChains } = await import("../_chunks/chains-KblEfYzm.js");
315
+ const { formatChains } = await import("../_chunks/chains-DHmoKxkO.js");
316
316
  console.log(" import chains:");
317
317
  console.log(formatChains(data.chains, configDir));
318
318
  }
@@ -1,4 +1,4 @@
1
1
  import { b as setCacheHandler, v as getCacheHandler } from "../_chunks/dev-store-BvdqtHvK.js";
2
- import { f as MemoryCacheHandler, h as setDefaultSingleflightTimeout, m as RedisCacheHandler, p as TagAwareCacheHandler, t as cache } from "../_chunks/cache-api-BZJNt01a.js";
3
- import { t as estimateByteSize } from "../_chunks/sizeof-Cmx6Fs-Y.js";
2
+ import { f as MemoryCacheHandler, h as setDefaultSingleflightTimeout, m as RedisCacheHandler, p as TagAwareCacheHandler, t as cache } from "../_chunks/cache-api-Bo8c7XVF.js";
3
+ import { t as estimateByteSize } from "../_chunks/sizeof-DVhEVN_y.js";
4
4
  export { MemoryCacheHandler, RedisCacheHandler, TagAwareCacheHandler, cache, estimateByteSize, getCacheHandler, setCacheHandler, setDefaultSingleflightTimeout };
@@ -1,4 +1,4 @@
1
- import { t as estimateByteSize } from "../../_chunks/sizeof-Cmx6Fs-Y.js";
1
+ import { t as estimateByteSize } from "../../_chunks/sizeof-DVhEVN_y.js";
2
2
  // src/cache/stores/memory.ts
3
3
  var MemoryCacheStore = class {
4
4
  store = /* @__PURE__ */ new Map();
package/dist/cli.js CHANGED
@@ -99,7 +99,7 @@ async function runDev(options, _deps) {
99
99
  return;
100
100
  }
101
101
  const { fork } = await import("node:child_process");
102
- const { RESTART_EXIT_CODE } = await import("./_chunks/dev-server-DrYBIg66.js");
102
+ const { RESTART_EXIT_CODE } = await import("./_chunks/dev-server-BGGGhHXx.js");
103
103
  while (true) {
104
104
  const result = await new Promise((resolve) => {
105
105
  const child = fork(process.argv[1], process.argv.slice(2), {
@@ -179,7 +179,7 @@ async function runPreview(options, _deps) {
179
179
  * `--project` names the tsconfig handed to tsgo.
180
180
  */
181
181
  async function runCheck(options, _deps) {
182
- const { checkRoutes, runTypeCheck } = await import("./_chunks/cli-check-Dl3yo3Zv.js");
182
+ const { checkRoutes, runTypeCheck } = await import("./_chunks/cli-check-BwiahbTC.js");
183
183
  const { root } = await checkRoutes({ viteConfigFile: options.config }, _deps);
184
184
  await runTypeCheck({
185
185
  root,
@@ -195,7 +195,7 @@ async function runCheck(options, _deps) {
195
195
  async function runSchema(args) {
196
196
  const subcommand = args[0];
197
197
  if (subcommand !== "sync") throw new Error(`Unknown schema subcommand: ${subcommand ?? "(none)"}. Usage: timber schema sync`);
198
- const { runSchemaSync, defaultCodecForSegment } = await import("./_chunks/cli-schema-sync-CTWiBMZZ.js");
198
+ const { runSchemaSync, defaultCodecForSegment } = await import("./_chunks/cli-schema-sync-Brw7kTmm.js");
199
199
  const result = runSchemaSync(process.cwd());
200
200
  if (result.filesystemSegments.length === 0) {
201
201
  console.log("[timber] No dynamic segments found in app/.");
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Dev request pill — wiring. Feeds the store from three places:
3
3
  *
4
- * - HMR `timber:span` events: every finished server span, as it ends.
4
+ * - HMR `timber:span` events: finished server spans, batched per trace and
5
+ * event-loop turn as they end, and a trace's buffered spans on replay.
5
6
  * - The document's navigation timing entry, whose `serverTiming` carries the
6
7
  * page's trace ID (the one response header page JS can read for the
7
8
  * document itself).
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/dev-pill/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,EAAyB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAGpE,KAAK,GAAG,GAAG;IACT,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IACrD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1C,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,OAAO,EAAE,MAAM,GACd,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,IAAI,CAYpC;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AActD,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA2DxE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/dev-pill/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,EAAyB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAGpE,KAAK,GAAG,GAAG;IACT,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IACrD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1C,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,OAAO,EAAE,MAAM,GACd,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,IAAI,CAYpC;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AActD,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA6DxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/client/dev-pill/view.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAgN3D,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAwNtD"}
1
+ {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/client/dev-pill/view.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAoN3D,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CA6NtD"}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
2
  "use client";
3
- export { t as DenyAncestryContext, n as TimberErrorBoundary } from "../_chunks/error-boundary-Cf1m-Ywk.js";
3
+ export { t as DenyAncestryContext, n as TimberErrorBoundary } from "../_chunks/error-boundary-Bh-egWUI.js";
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { c as stripRscCacheKey } from "../_chunks/rsc-cache-key-D0cb0Gmc.js";
3
- import { n as resolveSegmentParams, t as mergePreservedSearchParams } from "../_chunks/merge-search-params-7o_5yX0L.js";
2
+ import { n as interpolateParams, r as resolveHref } from "../_chunks/href-8l5VD23D.js";
4
3
  import { i as validateNavigationHref, n as isInternalHref } from "../_chunks/href-validation-DNg-zV7u.js";
5
- import "../_chunks/param-value-DqlGfF57.js";
6
- import { n as interpolateParams, r as resolveHref } from "../_chunks/href-BtspoNc9.js";
7
4
  import { l as getRouterOrNull, n as usePendingNavigation, o as useNavigationContext, s as createGlobalContext } from "../_chunks/navigation-root-Cvb7P1ud.js";
8
5
  import { t as getSsrData } from "../_chunks/ssr-data-9hPtcNOr.js";
6
+ import { n as resolveSegmentParams, t as mergePreservedSearchParams } from "../_chunks/merge-search-params-7o_5yX0L.js";
7
+ import { c as stripRscCacheKey } from "../_chunks/rsc-cache-key-D0cb0Gmc.js";
9
8
  import { n as useSegmentContext } from "../_chunks/segment-context-GAyTjjtS.js";
9
+ import "../_chunks/param-value-DqlGfF57.js";
10
10
  import { n as useQueryStates } from "../_chunks/use-query-states-D3MMl-KM.js";
11
11
  import React, { createContext, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
12
12
  import { flushSync } from "react-dom";
@@ -1,9 +1,9 @@
1
- import { t as SingleflightTimeoutError } from "../_chunks/singleflight-CzoOVB9Y.js";
2
- import { c as cachedSearchParams, s as cachedSearch, t as _setCachedSearch } from "../_chunks/state-B-EBjeER.js";
1
+ import { _ as readPayloadTree, a as createSpaExits, c as createRenderOwner, d as fetchRscPayload, f as createNavigationCommitter, g as prefetchScopeOf, h as SegmentCache, i as createScrollEffects, l as isClientStale, m as PrefetchCache, n as TimberErrorBoundary, o as runAsHandle, p as isPartialNavigation, r as createNavigationRecovery, s as recordSkew, u as NonRscResponse, v as readPublishedParams } from "../_chunks/error-boundary-Bh-egWUI.js";
3
2
  import { a as NavigationProvider, c as getRouter, i as routerUrlKey, l as getRouterOrNull, o as useNavigationContext, r as parseRouterUrl, u as setGlobalRouter } from "../_chunks/navigation-root-Cvb7P1ud.js";
3
+ import { t as SingleflightTimeoutError } from "../_chunks/singleflight-CzoOVB9Y.js";
4
4
  import { n as registerSsrDataProvider, t as getSsrData } from "../_chunks/ssr-data-9hPtcNOr.js";
5
5
  import { n as useSegmentContext, t as SegmentProvider } from "../_chunks/segment-context-GAyTjjtS.js";
6
- import { _ as readPayloadTree, a as createSpaExits, c as createRenderOwner, d as fetchRscPayload, f as createNavigationCommitter, g as prefetchScopeOf, h as SegmentCache, i as createScrollEffects, l as isClientStale, m as PrefetchCache, n as TimberErrorBoundary, o as runAsHandle, p as isPartialNavigation, r as createNavigationRecovery, s as recordSkew, u as NonRscResponse, v as readPublishedParams } from "../_chunks/error-boundary-Cf1m-Ywk.js";
6
+ import { c as cachedSearchParams, s as cachedSearch, t as _setCachedSearch } from "../_chunks/state-B-EBjeER.js";
7
7
  import { t as bindUseQueryStates } from "../_chunks/use-query-states-D3MMl-KM.js";
8
8
  // src/client/history.ts
9
9
  /**
@@ -1,5 +1,5 @@
1
- import { i as assertValidCookieName, r as stringifySetCookie, t as parseCookie } from "../_chunks/dist-C1Rjlo6s.js";
2
1
  import { a as resolveCodecOrSchema } from "../_chunks/schema-bridge-DyRs3cqy.js";
2
+ import { i as assertValidCookieName, r as stringifySetCookie, t as parseCookie } from "../_chunks/dist-C1Rjlo6s.js";
3
3
  import { t as getSsrData } from "../_chunks/ssr-data-9hPtcNOr.js";
4
4
  import * as React$1 from "react";
5
5
  import { getCookieJar } from "@timber-js/app/server";
@@ -12,6 +12,13 @@
12
12
  * promises (`await call`, `await Promise.all([a, b])`).
13
13
  */
14
14
  export type DevAwaitWrapper = (thunk: () => unknown, label: string, location: string, startsNoWork?: boolean) => unknown;
15
+ /**
16
+ * Record a promise whose work another span already shows, so an await of it
17
+ * is a wait. The dev fetch patch calls this for a body read
18
+ * (`res.text()`): the read is drawn as a `timber.fetch.body` span under
19
+ * the fetch, and `await res.text()` would draw the same time again.
20
+ */
21
+ export declare function noteTracedWork(promise: Promise<unknown>): void;
15
22
  /**
16
23
  * Install the wrapper on `globalThis[DEV_AWAIT_KEY]`. Transformed modules
17
24
  * look it up per call, so a module evaluated before this ran still gets
@@ -1 +1 @@
1
- {"version":3,"file":"await-span.d.ts","sourceRoot":"","sources":["../../src/dev-tools/await-span.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,KAAK,EAAE,MAAM,OAAO,EACpB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,OAAO,KACnB,OAAO,CAAC;AA+Bb;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAkBtC"}
1
+ {"version":3,"file":"await-span.d.ts","sourceRoot":"","sources":["../../src/dev-tools/await-span.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,KAAK,EAAE,MAAM,OAAO,EACpB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,OAAO,KACnB,OAAO,CAAC;AA+Bb;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAkBtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/dev-tools/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAOrB,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC;AAazC;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAwDpD;AAgCD;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,YAAW,aAAa;IACpD;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAO;IAEjD,OAAO,CAAC,YAAY,CAAqC;IACzD,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,MAAM,CAAkB;IAEhC,YAAY,MAAM,EAAE,eAAe,EAGlC;IAED,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAE5C;IAED,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAkC9B;IAED,OAAO,CAAC,MAAM;IAUR,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAE9B;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAEhC;CACF;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CA6BhE"}
1
+ {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/dev-tools/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAYrB,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC;AAazC;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAyDpD;AAiED;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,YAAW,aAAa;IACpD;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAO;IAEjD,OAAO,CAAC,YAAY,CAAqC;IACzD,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,MAAM,CAAkB;IAEhC,YAAY,MAAM,EAAE,eAAe,EAGlC;IAED,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAE5C;IAED,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAkC9B;IAED,OAAO,CAAC,MAAM;IASR,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAE9B;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAEhC;CACF;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CA6BhE"}
@@ -5,8 +5,9 @@
5
5
  * the single source of truth — no separate event system needed.
6
6
  *
7
7
  * Supports five modes:
8
- * - tree (default) — indented tree per request
9
- * - verbose — detailed tree showing every component render
8
+ * - tree (default) — indented tree per request; explained waits hidden,
9
+ * pass-through awaits folded (the dev pill's reading rules)
10
+ * - verbose — the same tree with every span as is
10
11
  * - summary — one line per request
11
12
  * - json — chronological NDJSON dump of all spans
12
13
  * - quiet — no output
@@ -28,6 +29,11 @@ export interface DevLoggerConfig {
28
29
  export declare function resolveLogMode(config?: DevLoggerConfig): DevLogMode;
29
30
  /**
30
31
  * Format spans as a full indented tree string for stderr.
32
+ *
33
+ * Tree mode applies the dev pill's reading rules (shared/span-waterfall.ts):
34
+ * waits whose work other rows already show are left out, and an await that
35
+ * only wraps one other await or fetch folds into it. Verbose mode prints
36
+ * every span as is.
31
37
  */
32
38
  export declare function formatSpanTree(spans: ReadableSpan[], config?: DevLoggerConfig): string;
33
39
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/dev-tools/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAKlE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3E,MAAM,WAAW,eAAe;IAC9B,qCAAqC;IACrC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA2JD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,UAAU,CAMnE;AAID;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,CAgDtF;AAwGD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,MAAM,CAc1F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,MAAM,CA6BxD"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/dev-tools/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAYlE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3E,MAAM,WAAW,eAAe;IAC9B,qCAAqC;IACrC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAqJD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,UAAU,CAMnE;AAID;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,MAAM,CAgFtF;AA4ID;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,MAAM,CAc1F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,MAAM,CA6BxD"}
@@ -26,7 +26,15 @@ export interface SpanSinkChannel {
26
26
  }
27
27
  /**
28
28
  * Install the sink that broadcasts spans on the dev server's HMR channel,
29
- * and answers replay requests from it.
29
+ * and answers replay requests from it. Every message is an array of spans
30
+ * of one trace, in the order they ended.
31
+ *
32
+ * Spans are batched: one send per trace per event-loop turn, not one per
33
+ * span. The sink is called inside the request, and each `hot.send` makes
34
+ * promises there, for each of which React's dev async debug hook captures a
35
+ * stack (~6µs a span; ~6ms on a 213-span trace). So the flush is scheduled
36
+ * from an `AsyncLocalStorage.snapshot()` taken here, at install, where no
37
+ * request is in scope: the send runs outside every request (TIM-1627).
30
38
  *
31
39
  * Broadcasting alone loses most of a document load: the root span ends when
32
40
  * the pipeline returns its Response, tens of milliseconds in, and the page's
@@ -1 +1 @@
1
- {"version":3,"file":"span-sink.d.ts","sourceRoot":"","sources":["../../src/dev-tools/span-sink.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAML,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAc/B,qDAAqD;AACrD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAwBnE;AAED,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAUpD;AAKD,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACzC,EAAE,CACA,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE;QAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;KAAE,KAAK,IAAI,GACtF,IAAI,CAAC;IACR,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;CAChE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,IAAI,CA4BhE"}
1
+ {"version":3,"file":"span-sink.d.ts","sourceRoot":"","sources":["../../src/dev-tools/span-sink.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAML,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAc/B,qDAAqD;AACrD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAwBnE;AAED,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAUpD;AAKD,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACzC,EAAE,CACA,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE;QAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;KAAE,KAAK,IAAI,GACtF,IAAI,CAAC;IACR,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;CAChE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,IAAI,CAkDhE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;AAgDjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAa1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQ1D,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAElG;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,MAAM;CAAG;AAE1B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAEvE;AAyGD,wBAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAqXhE;eAEc,MAAM"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;AAgDjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAa1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQ1D,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAElG;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,MAAM;CAAG;AAE1B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAEvE;AAmHD,wBAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAqXhE;eAEc,MAAM"}
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { a as formatMissingPeers, i as checkPeerDependencies, n as timberDevServer, o as reportConfigErrors, s as validateConfig } from "./_chunks/dev-server-cmWVDgTf.js";
1
+ import { a as checkPeerDependencies, c as validateConfig, i as VIRTUAL_IDS, n as timberDevServer, o as formatMissingPeers, s as reportConfigErrors } from "./_chunks/dev-server-lrdpD7Ws.js";
2
2
  import { i as resolveRenderTimeoutMs } from "./_chunks/render-timeout-MrrqD1wd.js";
3
+ import { d as collectInterceptionRewrites, l as getPrerenderExport, n as scanRoutes } from "./_chunks/scanner-CrB_h6FA.js";
4
+ import { c as buildDirToRouteMap, n as formatConventionWarnings, o as flushCodegenWrites, r as lintConventions, s as writeRouteCodegen, t as checkAppDirExists } from "./_chunks/convention-lint-CLpuzY5h.js";
5
+ import { r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "./_chunks/walkers-BUvpsb2Q.js";
6
+ import { i as poisonPillSource, r as markerFor, t as EXPLICIT_MARKERS } from "./_chunks/poison-rules-Bmz-lCPi.js";
3
7
  import { t as writeFileAtomic } from "./_chunks/write-file-atomic-DW8m_Atv.js";
4
- import { d as collectInterceptionRewrites, l as getPrerenderExport, n as scanRoutes } from "./_chunks/scanner-BNQ4qnLX.js";
5
- import { b as swallow } from "./_chunks/logger-YtMSKfft.js";
6
- import { c as buildDirToRouteMap, n as formatConventionWarnings, o as flushCodegenWrites, r as lintConventions, s as writeRouteCodegen, t as checkAppDirExists } from "./_chunks/convention-lint-D54k6uUM.js";
7
- import { a as contextAdapter, c as loadTimberConfigFile, d as resolveBuildDir, f as resolveClientJavascript, l as mergeFileConfig, m as createNoopTimer, o as createPluginContext, r as adapterConfig, u as resolveAppDir } from "./_chunks/plugin-context-BtaQcMuh.js";
8
8
  import { i as withBasePath, n as normalizeBasePath, t as isRelativeBase } from "./_chunks/base-path-DDIx0FXe.js";
9
- import { r as validateSchemaAgainstRoutes, t as collectLeafRoutes } from "./_chunks/walkers-DFC9KsBL.js";
10
- import { i as poisonPillSource, r as markerFor, t as EXPLICIT_MARKERS } from "./_chunks/poison-rules-Bmz-lCPi.js";
11
9
  import { n as rscPayloadPath, t as RSC_PAYLOAD_DIR } from "./_chunks/rsc-payload-path-EphpDB-J.js";
12
10
  import { a as REDIRECTS_FILE, n as detectFsIdentity, o as RESERVED_OUTPUT_PATHS, r as fsKey, t as EXACT_FS_IDENTITY } from "./_chunks/fs-identity-BmQ_Agg-.js";
13
- import { a as EMPTY_BUILD_MANIFEST, n as DEV_SPAN_REPLAY_EVENT, r as DEV_SPAN_SINK_KEY, t as DEV_SPAN_EVENT } from "./_chunks/dev-span-_NzMX-au.js";
11
+ import { a as EMPTY_BUILD_MANIFEST, n as DEV_SPAN_REPLAY_EVENT, r as DEV_SPAN_SINK_KEY, t as DEV_SPAN_EVENT } from "./_chunks/dev-span-RsVeYYc_.js";
14
12
  import { t as fnv1aHash } from "./_chunks/fast-hash-DddxkU5Y.js";
15
- import { i as detectDirective } from "./_chunks/classify-_W0RWa5w.js";
13
+ import { i as detectDirective } from "./_chunks/classify-cmE0Gins.js";
14
+ import { a as contextAdapter, c as loadTimberConfigFile, d as resolveBuildDir, f as resolveClientJavascript, l as mergeFileConfig, m as createNoopTimer, o as createPluginContext, r as adapterConfig, u as resolveAppDir } from "./_chunks/plugin-context-BtaQcMuh.js";
15
+ import { b as swallow } from "./_chunks/logger-DDLtp5e-.js";
16
16
  import { t as formatSize } from "./_chunks/format-DuPOoXUP.js";
17
17
  import { createLogger, esmExternalRequirePlugin, isRunnableDevEnvironment, parseAst } from "vite";
18
18
  import { basename, dirname, extname, isAbsolute, join, normalize, relative, resolve, sep, win32 } from "node:path";
@@ -24,6 +24,7 @@ import { SourceMap, builtinModules, createRequire } from "node:module";
24
24
  import { createHash, randomUUID } from "node:crypto";
25
25
  import { copyFile, mkdir, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
26
26
  import { gzipSync } from "node:zlib";
27
+ import { AsyncLocalStorage } from "node:async_hooks";
27
28
  // src/plugins/content.ts
28
29
  var CONFIG_FILE_NAMES = [
29
30
  "content-collections.ts",
@@ -130,14 +131,6 @@ function timberContent(ctx) {
130
131
  // src/plugins/entries.ts
131
132
  var __dirname$1 = dirname(fileURLToPath(import.meta.url));
132
133
  var SRC_DIR = existsSync(resolve(__dirname$1, "..", "server", "rsc-entry", "index.ts")) ? resolve(__dirname$1, "..") : resolve(__dirname$1, "..", "src");
133
- var VIRTUAL_IDS = {
134
- rscEntry: "virtual:timber-rsc-entry",
135
- ssrEntry: "virtual:timber-ssr-entry",
136
- browserEntry: "virtual:timber-browser-entry",
137
- config: "virtual:timber-config",
138
- instrumentation: "virtual:timber-instrumentation",
139
- cacheHandler: "virtual:timber-cache-handler"
140
- };
141
134
  /**
142
135
  * Map from virtual module IDs to their resolved file paths.
143
136
  *
@@ -5615,11 +5608,31 @@ function timberBuildManifest(ctx) {
5615
5608
  };
5616
5609
  }
5617
5610
  // src/dev-tools/span-sink.ts
5611
+ /**
5612
+ * Span sink — streams finished dev spans to the browser over HMR, for the
5613
+ * dev request pill. See design/50-dev-request-pill.md §"Transport".
5614
+ *
5615
+ * Two halves that run in different module graphs of one process:
5616
+ * - `installSpanSink()` runs in the dev server plugin, which owns the HMR
5617
+ * channel.
5618
+ * - `forwardSpan()` runs in `DevSpanProcessor` (RSC graph) on every span end.
5619
+ * They meet at `globalThis[DEV_SPAN_SINK_KEY]`. With nothing installed (a
5620
+ * production build under TIMBER_DEBUG, unit tests), forwarding is a no-op —
5621
+ * this is what keeps the browser channel gated to `vite dev`.
5622
+ */
5618
5623
  /** Traces the server keeps for replay. Oldest-inserted is evicted. */
5619
5624
  var MAX_REPLAY_TRACES = 64;
5620
5625
  /**
5621
5626
  * Install the sink that broadcasts spans on the dev server's HMR channel,
5622
- * and answers replay requests from it.
5627
+ * and answers replay requests from it. Every message is an array of spans
5628
+ * of one trace, in the order they ended.
5629
+ *
5630
+ * Spans are batched: one send per trace per event-loop turn, not one per
5631
+ * span. The sink is called inside the request, and each `hot.send` makes
5632
+ * promises there, for each of which React's dev async debug hook captures a
5633
+ * stack (~6µs a span; ~6ms on a 213-span trace). So the flush is scheduled
5634
+ * from an `AsyncLocalStorage.snapshot()` taken here, at install, where no
5635
+ * request is in scope: the send runs outside every request (TIM-1627).
5623
5636
  *
5624
5637
  * Broadcasting alone loses most of a document load: the root span ends when
5625
5638
  * the pipeline returns its Response, tens of milliseconds in, and the page's
@@ -5634,6 +5647,15 @@ var MAX_REPLAY_TRACES = 64;
5634
5647
  function installSpanSink(hot) {
5635
5648
  const globals = globalThis;
5636
5649
  const recent = /* @__PURE__ */ new Map();
5650
+ const outsideRequests = AsyncLocalStorage.snapshot();
5651
+ let pending = /* @__PURE__ */ new Map();
5652
+ let scheduled;
5653
+ const flush = () => {
5654
+ const batches = pending;
5655
+ pending = /* @__PURE__ */ new Map();
5656
+ scheduled = void 0;
5657
+ for (const spans of batches.values()) hot.send(DEV_SPAN_EVENT, spans);
5658
+ };
5637
5659
  const sink = (span) => {
5638
5660
  let spans = recent.get(span.traceId);
5639
5661
  if (!spans) {
@@ -5645,18 +5667,29 @@ function installSpanSink(hot) {
5645
5667
  recent.set(span.traceId, spans);
5646
5668
  }
5647
5669
  spans.push(span);
5648
- hot.send(DEV_SPAN_EVENT, span);
5670
+ let batch = pending.get(span.traceId);
5671
+ if (!batch) {
5672
+ batch = [];
5673
+ pending.set(span.traceId, batch);
5674
+ }
5675
+ batch.push(span);
5676
+ scheduled ??= outsideRequests(() => setImmediate(flush));
5649
5677
  };
5650
5678
  const onReplay = (data, client) => {
5651
5679
  if (typeof data !== "object" || data === null || !("traceId" in data)) return;
5652
5680
  const { traceId } = data;
5653
5681
  if (typeof traceId !== "string") return;
5654
- for (const span of recent.get(traceId) ?? []) client.send(DEV_SPAN_EVENT, span);
5682
+ const spans = recent.get(traceId);
5683
+ if (spans) client.send(DEV_SPAN_EVENT, spans.slice());
5655
5684
  };
5656
5685
  globals[DEV_SPAN_SINK_KEY] = sink;
5657
5686
  hot.on(DEV_SPAN_REPLAY_EVENT, onReplay);
5658
5687
  return () => {
5659
5688
  hot.off(DEV_SPAN_REPLAY_EVENT, onReplay);
5689
+ if (scheduled) {
5690
+ clearImmediate(scheduled);
5691
+ flush();
5692
+ }
5660
5693
  if (globals[DEV_SPAN_SINK_KEY] === sink) delete globals[DEV_SPAN_SINK_KEY];
5661
5694
  };
5662
5695
  }
@@ -11015,20 +11048,29 @@ function createRscOptions(ctx, encryptionKeyExpr) {
11015
11048
  * output mode to be silently ignored. See TIM-451.
11016
11049
  */
11017
11050
  /**
11018
- * Wrap plugin-react's `vite:react-compiler` configResolved so it always
11019
- * sees `isProduction: true` during builds. The compiler plugin uses
11020
- * `!config.isProduction` to decide whether to emit jsxDEV calls, but
11021
- * Vite derives isProduction from process.env.NODE_ENV — which may be
11022
- * "development" in the shell. Rather than mutating the env, we pass a
11023
- * prototype-based view with the single property overridden.
11051
+ * Adjust plugin-react's `vite:react-compiler` plugin:
11052
+ *
11053
+ * - Its configResolved always sees `isProduction: true` during builds. The
11054
+ * compiler plugin uses `!config.isProduction` to decide whether to emit
11055
+ * jsxDEV calls, but Vite derives isProduction from process.env.NODE_ENV —
11056
+ * which may be "development" in the shell. Rather than mutating the env,
11057
+ * we pass a prototype-based view with the single property overridden.
11058
+ * - In dev it runs on the client environment only. Its `shouldCompile`
11059
+ * requires a client environment, so on rsc/ssr it only repeats the
11060
+ * JSX/TS transform `vite:oxc` does next, plus a sourcemap: ~200ms of a
11061
+ * ~2.4s cold kitchen-sink request. Output is the same except for a
11062
+ * trailing semicolon in plugin-rsc's CSS stubs (TIM-1627).
11063
+ * Builds keep it on every environment, unchanged.
11024
11064
  */
11025
- function patchReactCompilerForProdJsx(plugins) {
11065
+ function patchReactCompiler(plugins) {
11026
11066
  for (const p of plugins) if (p && typeof p === "object" && "name" in p && p.name === "vite:react-compiler") {
11027
- const orig = p.configResolved;
11028
- if (typeof orig === "function") p.configResolved = function(config) {
11067
+ const plugin = p;
11068
+ const orig = plugin.configResolved;
11069
+ if (typeof orig === "function") plugin.configResolved = function(config) {
11029
11070
  const view = config.command === "build" && !config.isProduction ? Object.create(config, { isProduction: { value: true } }) : config;
11030
11071
  return orig.call(this, view);
11031
11072
  };
11073
+ plugin.applyToEnvironment = (env) => env.config.command === "build" || env.config.consumer === "client";
11032
11074
  }
11033
11075
  return plugins;
11034
11076
  }
@@ -11110,7 +11152,7 @@ function timber(config) {
11110
11152
  console: originalConsole
11111
11153
  });
11112
11154
  ctx.timer.start("client-deps-scan");
11113
- const { clientOptimizeDepsEntries, skipUseServerScanPlugin } = await import("./_chunks/client-dep-entries-C9hv-3k9.js");
11155
+ const { clientOptimizeDepsEntries, skipUseServerScanPlugin } = await import("./_chunks/client-dep-entries-C1nMlLKV.js");
11114
11156
  const entries = await clientOptimizeDepsEntries(resolvedRoot, BROWSER_ENTRY_FILE, buildDir);
11115
11157
  ctx.timer.end("client-deps-scan");
11116
11158
  return {
@@ -11156,7 +11198,7 @@ function timber(config) {
11156
11198
  timberNativeRuntime(),
11157
11199
  timberPluginRscDeps(),
11158
11200
  timberReactProd(),
11159
- ...patchReactCompilerForProdJsx(react({ compiler: effectiveReactCompiler || false })),
11201
+ ...patchReactCompiler(react({ compiler: effectiveReactCompiler || false })),
11160
11202
  vitePluginRsc(createRscOptions(ctx, encryptionKeyExpr)),
11161
11203
  timberEncryptionRuntime(),
11162
11204
  timberShims(ctx),