reroute-js 0.42.1 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/cli/bin.d.ts +1 -1
  2. package/cli/bin.js +111 -10
  3. package/cli/bin.js.map +6 -6
  4. package/cli/index.d.ts +1 -1
  5. package/cli/index.js +4 -4
  6. package/cli/index.js.map +1 -1
  7. package/cli/src/cli.d.ts +1 -1
  8. package/cli/src/commands/analyze.d.ts +1 -1
  9. package/cli/src/commands/build.d.ts +1 -1
  10. package/cli/src/commands/dev.d.ts +1 -1
  11. package/cli/src/commands/gen.d.ts +1 -1
  12. package/cli/src/commands/index.d.ts +1 -1
  13. package/cli/src/commands/init.d.ts +1 -1
  14. package/cli/src/commands/lib/assets.d.ts +1 -1
  15. package/cli/src/commands/lib/bundler.d.ts +1 -1
  16. package/cli/src/commands/lib/command.d.ts +1 -1
  17. package/cli/src/commands/lib/env.d.ts +1 -1
  18. package/cli/src/commands/lib/index.d.ts +1 -1
  19. package/cli/src/commands/lib/log.d.ts +1 -1
  20. package/cli/src/commands/lib/markdown/availability.d.ts +1 -1
  21. package/cli/src/commands/lib/markdown/index.d.ts +1 -1
  22. package/cli/src/commands/lib/markdown/processor.d.ts +1 -1
  23. package/cli/src/commands/lib/production.d.ts +1 -1
  24. package/cli/src/commands/lib/server.d.ts +1 -1
  25. package/cli/src/commands/lib/streaming/analyzer.d.ts +1 -1
  26. package/cli/src/commands/lib/streaming/suspense.d.ts +1 -1
  27. package/cli/src/commands/lib/tailwind.d.ts +1 -1
  28. package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
  29. package/cli/src/commands/lib/version.d.ts +1 -1
  30. package/cli/src/commands/og.d.ts +1 -1
  31. package/cli/src/commands/start.d.ts +1 -1
  32. package/cli/src/index.d.ts +1 -1
  33. package/core/index.d.ts +1 -1
  34. package/core/index.js +107 -6
  35. package/core/index.js.map +6 -6
  36. package/core/src/bundler/hash.d.ts +1 -1
  37. package/core/src/bundler/index.d.ts +1 -1
  38. package/core/src/config.d.ts +81 -5
  39. package/core/src/config.d.ts.map +1 -1
  40. package/core/src/content/discovery.d.ts +1 -1
  41. package/core/src/content/index.d.ts +1 -1
  42. package/core/src/content/metadata.d.ts +1 -1
  43. package/core/src/index.d.ts +1 -1
  44. package/core/src/llms/extractor.d.ts +1 -1
  45. package/core/src/llms/formatter.d.ts +1 -1
  46. package/core/src/llms/full-generator.d.ts +1 -1
  47. package/core/src/llms/index-generator.d.ts +1 -1
  48. package/core/src/llms/index.d.ts +1 -1
  49. package/core/src/og/discovery.d.ts +1 -1
  50. package/core/src/og/index.d.ts +1 -1
  51. package/core/src/og/meta.d.ts +1 -1
  52. package/core/src/og/render.d.ts +1 -1
  53. package/core/src/og/types.d.ts +1 -1
  54. package/core/src/robots/discovery.d.ts +1 -1
  55. package/core/src/robots/generator.d.ts +1 -1
  56. package/core/src/robots/index.d.ts +1 -1
  57. package/core/src/robots/policies.d.ts +1 -1
  58. package/core/src/rss/discovery.d.ts +1 -1
  59. package/core/src/rss/generator.d.ts +1 -1
  60. package/core/src/rss/index.d.ts +1 -1
  61. package/core/src/sitemap/discovery.d.ts +1 -1
  62. package/core/src/sitemap/generator.d.ts +1 -1
  63. package/core/src/sitemap/index.d.ts +1 -1
  64. package/core/src/ssr/index.d.ts +1 -1
  65. package/core/src/ssr/lib/cache.d.ts +1 -1
  66. package/core/src/ssr/lib/collections.d.ts +1 -1
  67. package/core/src/ssr/lib/compression.d.ts +1 -1
  68. package/core/src/ssr/lib/compute/content.d.ts +1 -1
  69. package/core/src/ssr/lib/compute/index.d.ts +1 -1
  70. package/core/src/ssr/lib/compute/layouts.d.ts +1 -1
  71. package/core/src/ssr/lib/compute/routes.d.ts +1 -1
  72. package/core/src/ssr/lib/data.d.ts +1 -1
  73. package/core/src/ssr/lib/html.d.ts +1 -1
  74. package/core/src/ssr/lib/imports.d.ts +1 -1
  75. package/core/src/ssr/lib/index.d.ts +1 -1
  76. package/core/src/ssr/lib/layouts.d.ts +1 -1
  77. package/core/src/ssr/lib/metadata.d.ts +1 -1
  78. package/core/src/ssr/lib/metadata.d.ts.map +1 -1
  79. package/core/src/ssr/lib/mime.d.ts +1 -1
  80. package/core/src/ssr/lib/modules.d.ts +1 -1
  81. package/core/src/ssr/lib/path.d.ts +1 -1
  82. package/core/src/ssr/lib/preload.d.ts +1 -1
  83. package/core/src/ssr/lib/scripts/collections.d.ts +1 -1
  84. package/core/src/ssr/lib/scripts/data.d.ts +1 -1
  85. package/core/src/ssr/lib/scripts/escape.d.ts +1 -1
  86. package/core/src/ssr/lib/scripts/feeds.d.ts +1 -1
  87. package/core/src/ssr/lib/scripts/index.d.ts +1 -1
  88. package/core/src/ssr/lib/seed.d.ts +1 -1
  89. package/core/src/ssr/lib/serialize.d.ts +1 -1
  90. package/core/src/ssr/lib/setup.d.ts +4 -1
  91. package/core/src/ssr/lib/setup.d.ts.map +1 -1
  92. package/core/src/ssr/lib/styles.d.ts +1 -1
  93. package/core/src/ssr/lib/template.d.ts +1 -1
  94. package/core/src/ssr/lib/types.d.ts +3 -1
  95. package/core/src/ssr/lib/types.d.ts.map +1 -1
  96. package/core/src/ssr/render.d.ts +1 -1
  97. package/core/src/ssr/stream.d.ts +1 -1
  98. package/core/src/ssr/stream.d.ts.map +1 -1
  99. package/elysia/index.d.ts +1 -1
  100. package/elysia/index.js +163 -43
  101. package/elysia/index.js.map +8 -8
  102. package/elysia/src/index.d.ts +1 -1
  103. package/elysia/src/libs/assets.d.ts +1 -1
  104. package/elysia/src/libs/cache.d.ts +1 -1
  105. package/elysia/src/libs/caching.d.ts +1 -1
  106. package/elysia/src/libs/http.d.ts +1 -1
  107. package/elysia/src/libs/image.d.ts +1 -1
  108. package/elysia/src/libs/index.d.ts +1 -1
  109. package/elysia/src/libs/llms.d.ts +1 -1
  110. package/elysia/src/libs/response.d.ts +1 -1
  111. package/elysia/src/libs/serving.d.ts +1 -1
  112. package/elysia/src/plugin.d.ts +1 -1
  113. package/elysia/src/plugin.d.ts.map +1 -1
  114. package/elysia/src/routes/artifacts.d.ts +1 -1
  115. package/elysia/src/routes/content.d.ts +1 -1
  116. package/elysia/src/routes/image.d.ts +1 -1
  117. package/elysia/src/routes/index.d.ts +1 -1
  118. package/elysia/src/routes/internal.d.ts +1 -1
  119. package/elysia/src/routes/llms.d.ts +1 -1
  120. package/elysia/src/routes/og.d.ts +1 -1
  121. package/elysia/src/routes/redirects.d.ts +1 -1
  122. package/elysia/src/routes/robots.d.ts +1 -1
  123. package/elysia/src/routes/rss.d.ts +1 -1
  124. package/elysia/src/routes/search.d.ts +1 -1
  125. package/elysia/src/routes/sitemap.d.ts +1 -1
  126. package/elysia/src/routes/ssr.d.ts +6 -3
  127. package/elysia/src/routes/ssr.d.ts.map +1 -1
  128. package/elysia/src/routes/static.d.ts +1 -1
  129. package/elysia/src/types.d.ts +1 -1
  130. package/package.json +1 -1
  131. package/react/index.d.ts +1 -1
  132. package/react/index.js +17 -5
  133. package/react/index.js.map +3 -3
  134. package/react/src/components/ClientOnly.d.ts +1 -1
  135. package/react/src/components/ContentRoute.d.ts +1 -1
  136. package/react/src/components/Image.d.ts +1 -1
  137. package/react/src/components/LazyRoute.d.ts +1 -1
  138. package/react/src/components/Link.d.ts +1 -1
  139. package/react/src/components/Markdown.d.ts +1 -1
  140. package/react/src/components/Outlet.d.ts +1 -1
  141. package/react/src/components/index.d.ts +1 -1
  142. package/react/src/hooks/index.d.ts +1 -1
  143. package/react/src/hooks/useContent.d.ts +1 -1
  144. package/react/src/hooks/useData.d.ts +1 -1
  145. package/react/src/hooks/useFeed.d.ts +1 -1
  146. package/react/src/hooks/useLayoutData.d.ts +1 -1
  147. package/react/src/hooks/useLlms.d.ts +1 -1
  148. package/react/src/hooks/useNavigate.d.ts +1 -1
  149. package/react/src/hooks/useParams.d.ts +1 -1
  150. package/react/src/hooks/useRouter.d.ts +1 -1
  151. package/react/src/hooks/useSearch.d.ts +1 -1
  152. package/react/src/hooks/useSearchParams.d.ts +1 -1
  153. package/react/src/hooks/useToc.d.ts +1 -1
  154. package/react/src/index.d.ts +1 -1
  155. package/react/src/lib/collection.d.ts +1 -1
  156. package/react/src/lib/content.d.ts +1 -1
  157. package/react/src/lib/head.d.ts +1 -1
  158. package/react/src/lib/index.d.ts +1 -1
  159. package/react/src/lib/lazy-route.d.ts +1 -1
  160. package/react/src/lib/route-loader.d.ts +1 -1
  161. package/react/src/providers/ContentProvider.d.ts +1 -1
  162. package/react/src/providers/RerouteProvider.d.ts +1 -1
  163. package/react/src/providers/RouterProvider.d.ts +1 -1
  164. package/react/src/providers/RouterProvider.d.ts.map +1 -1
  165. package/react/src/providers/index.d.ts +1 -1
  166. package/react/src/types/any.d.ts +1 -1
  167. package/react/src/types/index.d.ts +1 -1
  168. package/react/src/types/router.d.ts +1 -1
  169. package/telemetry/react.d.ts +1 -1
  170. package/telemetry/react.js +2 -2
  171. package/telemetry/react.js.map +1 -1
  172. package/telemetry/server.d.ts +1 -1
  173. package/telemetry/server.js +2 -2
  174. package/telemetry/server.js.map +6 -6
  175. package/telemetry/src/react/api.d.ts +1 -1
  176. package/telemetry/src/react/context.d.ts +1 -1
  177. package/telemetry/src/react/index.d.ts +1 -1
  178. package/telemetry/src/react/telemetry.d.ts +1 -1
  179. package/telemetry/src/server/context.d.ts +1 -1
  180. package/telemetry/src/server/headers/extractor.d.ts +1 -1
  181. package/telemetry/src/server/headers/index.d.ts +1 -1
  182. package/telemetry/src/server/headers/presets.d.ts +1 -1
  183. package/telemetry/src/server/index.d.ts +1 -1
  184. package/telemetry/src/server/instrumentation.d.ts +1 -1
  185. package/telemetry/src/server/plugin.d.ts +1 -1
  186. package/telemetry/src/server/sourcemap.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * reroute-js v0.42.1
2
+ * reroute-js v0.43.0
3
3
  *
4
4
  * @license MIT
5
5
  * @copyright 2026 stewones <hi@stewan.io>
@@ -1,5 +1,5 @@
1
1
  /**
2
- * reroute-js v0.42.1
2
+ * reroute-js v0.43.0
3
3
  *
4
4
  * @license MIT
5
5
  * @copyright 2026 stewones <hi@stewan.io>
@@ -98,6 +98,8 @@ type MetadataResult = {
98
98
  perPageHead: string;
99
99
  pageLang?: string;
100
100
  statusOverride?: number;
101
+ /** SSR export for dynamic head generation at stream end */
102
+ ssrExport?: SSR;
101
103
  };
102
104
  /**
103
105
  * Cache entry structure
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/ssr/lib/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,GAAG,GAAG,GAAG,CAAC;AAEf;;GAEG;AACH,KAAK,eAAe,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACb,EAAE,CAAC;CACJ,CAAC;AAEF;;GAEG;AACH,KAAK,WAAW,GAAG;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,KAAK,cAAc,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;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C,CAAC;AAEF;;;GAGG;AACH,KAAK,cAAc,CAAC,QAAQ,GAAG,OAAO,IAAI;IACzC,mDAAmD;IACnD,IAAI,CAAC,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,KAAK,GAAG,CAAC,QAAQ,GAAG,OAAO,IAAI;IAC9B;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE7D;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC,CAAC;IAE3E;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,YAAY,EACX,GAAG,EACH,eAAe,EACf,UAAU,EACV,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,aAAa,EACb,uBAAuB,EACvB,aAAa,EACb,SAAS,EACT,UAAU,EACV,UAAU,EACV,cAAc,EACd,GAAG,GACH,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/ssr/lib/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,GAAG,GAAG,GAAG,CAAC;AAEf;;GAEG;AACH,KAAK,eAAe,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE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U,EACV,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,aAAa,EACb,uBAAuB,EACvB,aAAa,EACb,SAAS,EACT,UAAU,EACV,UAAU,EACV,cAAc,EACd,GAAG,GACH,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * reroute-js v0.42.1
2
+ * reroute-js v0.43.0
3
3
  *
4
4
  * @license MIT
5
5
  * @copyright 2026 stewones <hi@stewan.io>
@@ -1,5 +1,5 @@
1
1
  /**
2
- * reroute-js v0.42.1
2
+ * reroute-js v0.43.0
3
3
  *
4
4
  * @license MIT
5
5
  * @copyright 2026 stewones <hi@stewan.io>
@@ -1 +1 @@
1
- {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/ssr/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAOxD,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAiB5E,KAAK,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,YAAY,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,C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,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACzB,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,iBAAe,uBAAuB,CACrC,OAAO,EAAE,mBAAmB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CA2K7B;AAkYD,OAAO,EAAE,uBAAuB,EAAE,CAAC;AACnC,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC"}
package/elysia/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * reroute-js v0.42.1
2
+ * reroute-js v0.43.0
3
3
  *
4
4
  * @license MIT
5
5
  * @copyright 2026 stewones <hi@stewan.io>
package/elysia/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * reroute-js v0.42.1
2
+ * reroute-js v0.43.0
3
3
  *
4
4
  * @license MIT
5
5
  * @copyright 2026 stewones <hi@stewan.io>
@@ -1908,7 +1908,12 @@ ${ogMetaTags}`;
1908
1908
  if (routeResult.lang)
1909
1909
  pageLang = routeResult.lang;
1910
1910
  statusOverride = routeResult.statusOverride;
1911
- return { perPageHead, pageLang, statusOverride };
1911
+ return {
1912
+ perPageHead,
1913
+ pageLang,
1914
+ statusOverride,
1915
+ ssrExport: routeResult.ssrExport
1916
+ };
1912
1917
  }
1913
1918
  async function processLayoutForMetadata(layout, clientDir, isWatchMode, addHead, setLang, ogConfig) {
1914
1919
  if (typeof layout?.path !== "string")
@@ -1978,7 +1983,12 @@ async function extractMatchedRouteMetadata(pathname, clientDir, m, isWatchMode,
1978
1983
  if (ssrHead)
1979
1984
  head += `
1980
1985
  ${ssrHead}`;
1981
- return { head, lang: extractSSRLang(ssr), statusOverride };
1986
+ return {
1987
+ head,
1988
+ lang: extractSSRLang(ssr),
1989
+ statusOverride,
1990
+ ssrExport: ssr
1991
+ };
1982
1992
  }
1983
1993
  return { head, statusOverride };
1984
1994
  } catch {}
@@ -1989,6 +1999,7 @@ async function extractRouteMetadata(pathname, clientDir, cwd, isWatchMode, curre
1989
1999
  let head = "";
1990
2000
  let lang;
1991
2001
  let statusOverride = currentStatusOverride;
2002
+ let ssrExport;
1992
2003
  try {
1993
2004
  const m = await loadRoutesModule(cwd, isWatchMode);
1994
2005
  if (!m) {
@@ -2005,13 +2016,14 @@ async function extractRouteMetadata(pathname, clientDir, cwd, isWatchMode, curre
2005
2016
  head = result.head;
2006
2017
  lang = result.lang;
2007
2018
  statusOverride = result.statusOverride;
2019
+ ssrExport = result.ssrExport;
2008
2020
  } else {
2009
2021
  head += await extractNotFoundMetadata(pathname, clientDir, m, isWatchMode, (l) => {
2010
2022
  lang = l;
2011
2023
  }, ogConfig);
2012
2024
  }
2013
2025
  } catch {}
2014
- return { head, lang, statusOverride };
2026
+ return { head, lang, statusOverride, ssrExport };
2015
2027
  }
2016
2028
  function findBestNotFoundRoute(list, pathname) {
2017
2029
  let chosen;
@@ -5073,7 +5085,8 @@ async function renderSSRDocumentStream(options) {
5073
5085
  browserTelemetryConfig,
5074
5086
  traceContext,
5075
5087
  parentSpan: options.parentSpan,
5076
- timeout: options.timeout
5088
+ timeout: options.timeout,
5089
+ ssrExport: setup2.metadataResult.ssrExport
5077
5090
  });
5078
5091
  if (debug)
5079
5092
  console.log(`[renderStream] ${pathname} - returning stream: ${(performance.now() - t0).toFixed(2)}ms`);
@@ -5181,12 +5194,100 @@ function buildStreamingScripts(ctx) {
5181
5194
  const feedsScript = createFeedsScript();
5182
5195
  const llmsScript = createLlmsScript();
5183
5196
  let allScripts = dataScript + feedsScript + llmsScript + collectionScripts + ctx.preloadHydrationScript;
5197
+ const metaUpdateScript = generateMetaUpdateScript(ctx, ssrDataSnapshot);
5198
+ if (metaUpdateScript) {
5199
+ allScripts += metaUpdateScript;
5200
+ }
5184
5201
  allScripts += `<script type="module" src="${ctx.bundleUrl}"></script>`;
5185
5202
  if (ctx.isWatchMode) {
5186
5203
  allScripts += `<script type="module" src="/__reroute_watch.js"></script>`;
5187
5204
  }
5188
5205
  return allScripts;
5189
5206
  }
5207
+ function generateMetaUpdateScript(ctx, ssrDataSnapshot) {
5208
+ if (typeof ctx.ssrExport?.head !== "function") {
5209
+ return "";
5210
+ }
5211
+ const routeData = ssrDataSnapshot[ctx.pathname];
5212
+ if (!routeData) {
5213
+ return "";
5214
+ }
5215
+ let headResult;
5216
+ try {
5217
+ headResult = ctx.ssrExport.head({ data: routeData });
5218
+ } catch (err) {
5219
+ console.error("[reroute] Error calling ssr.head() at stream end:", err);
5220
+ return "";
5221
+ }
5222
+ if (!headResult) {
5223
+ return "";
5224
+ }
5225
+ const headHtml = Array.isArray(headResult) ? headResult.join(`
5226
+ `) : headResult;
5227
+ if (!headHtml) {
5228
+ return "";
5229
+ }
5230
+ const metaUpdates = parseHeadForMetaUpdates(headHtml);
5231
+ if (Object.keys(metaUpdates).length === 0) {
5232
+ return "";
5233
+ }
5234
+ const updatesJson = JSON.stringify(metaUpdates);
5235
+ return `<script>(function(){var u=${updatesJson};if(u.title){document.title=u.title}Object.keys(u).forEach(function(k){if(k==='title')return;var s=k.split(':');var isOg=s[0]==='og'||s[0]==='twitter';var el=isOg?document.querySelector('meta[property="'+k+'"]')||document.querySelector('meta[name="'+k+'"]'):document.querySelector('meta[name="'+k+'"]');if(el){el.setAttribute('content',u[k])}else{var m=document.createElement('meta');m.setAttribute(isOg?'property':'name',k);m.setAttribute('content',u[k]);document.head.appendChild(m)}})})()</script>`;
5236
+ }
5237
+ function parseHeadForMetaUpdates(headHtml) {
5238
+ const updates = {};
5239
+ const titleMatch = headHtml.match(/<title[^>]*>(.*?)<\/title>/is);
5240
+ if (titleMatch?.[1]) {
5241
+ updates.title = unescapeHtmlEntities(titleMatch[1].trim());
5242
+ }
5243
+ let descMatch = headHtml.match(/<meta\s+name=["']description["']\s+content=["'](.+?)["']/i);
5244
+ if (!descMatch) {
5245
+ descMatch = headHtml.match(/<meta\s+content=["'](.+?)["']\s+name=["']description["']/i);
5246
+ }
5247
+ if (descMatch?.[1]) {
5248
+ updates.description = unescapeHtmlEntities(descMatch[1].trim());
5249
+ }
5250
+ let ogTitleMatch = headHtml.match(/<meta\s+property=["']og:title["']\s+content=["'](.+?)["']/i);
5251
+ if (!ogTitleMatch) {
5252
+ ogTitleMatch = headHtml.match(/<meta\s+content=["'](.+?)["']\s+property=["']og:title["']/i);
5253
+ }
5254
+ if (ogTitleMatch?.[1]) {
5255
+ updates["og:title"] = unescapeHtmlEntities(ogTitleMatch[1].trim());
5256
+ } else if (updates.title) {
5257
+ updates["og:title"] = updates.title;
5258
+ }
5259
+ let ogDescMatch = headHtml.match(/<meta\s+property=["']og:description["']\s+content=["'](.+?)["']/i);
5260
+ if (!ogDescMatch) {
5261
+ ogDescMatch = headHtml.match(/<meta\s+content=["'](.+?)["']\s+property=["']og:description["']/i);
5262
+ }
5263
+ if (ogDescMatch?.[1]) {
5264
+ updates["og:description"] = unescapeHtmlEntities(ogDescMatch[1].trim());
5265
+ } else if (updates.description) {
5266
+ updates["og:description"] = updates.description;
5267
+ }
5268
+ let twitterTitleMatch = headHtml.match(/<meta\s+name=["']twitter:title["']\s+content=["'](.+?)["']/i);
5269
+ if (!twitterTitleMatch) {
5270
+ twitterTitleMatch = headHtml.match(/<meta\s+content=["'](.+?)["']\s+name=["']twitter:title["']/i);
5271
+ }
5272
+ if (twitterTitleMatch?.[1]) {
5273
+ updates["twitter:title"] = unescapeHtmlEntities(twitterTitleMatch[1].trim());
5274
+ } else if (updates.title) {
5275
+ updates["twitter:title"] = updates.title;
5276
+ }
5277
+ let twitterDescMatch = headHtml.match(/<meta\s+name=["']twitter:description["']\s+content=["'](.+?)["']/i);
5278
+ if (!twitterDescMatch) {
5279
+ twitterDescMatch = headHtml.match(/<meta\s+content=["'](.+?)["']\s+name=["']twitter:description["']/i);
5280
+ }
5281
+ if (twitterDescMatch?.[1]) {
5282
+ updates["twitter:description"] = unescapeHtmlEntities(twitterDescMatch[1].trim());
5283
+ } else if (updates.description) {
5284
+ updates["twitter:description"] = updates.description;
5285
+ }
5286
+ return updates;
5287
+ }
5288
+ function unescapeHtmlEntities(str) {
5289
+ return str.replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
5290
+ }
5190
5291
  var init_stream = __esm(() => {
5191
5292
  init_server2();
5192
5293
  init_config();
@@ -7681,12 +7782,21 @@ function registerSSRRoutes(app, options) {
7681
7782
  head = "",
7682
7783
  lang = "en",
7683
7784
  appId = "root",
7684
- maxAge = 3600,
7685
- directive = "public",
7785
+ serverCacheEnabled = true,
7786
+ serverMaxAge = 3600,
7787
+ browserCacheEnabled = true,
7788
+ browserMaxAge = 300,
7789
+ browserDirective = "public",
7686
7790
  compression: compression2 = true,
7687
7791
  streamingEnabled = false
7688
7792
  } = options;
7689
- const SSR_HTML_TTL_MS = maxAge === 0 ? 0 : maxAge * 1000 || 5 * 60 * 1000;
7793
+ const addCacheControl = (headers2, cacheControl) => {
7794
+ if (cacheControl) {
7795
+ headers2["Cache-Control"] = cacheControl;
7796
+ }
7797
+ return headers2;
7798
+ };
7799
+ const SSR_HTML_TTL_MS = serverCacheEnabled && serverMaxAge > 0 ? serverMaxAge * 1000 : 0;
7690
7800
  const htmlCache = new LRUCache(200);
7691
7801
  const makeKey = (pathname, acceptEncoding) => `${pathname}::${acceptEncoding || "identity"}`;
7692
7802
  let staticRoutes = [];
@@ -7785,7 +7895,7 @@ function registerSSRRoutes(app, options) {
7785
7895
  } catch {}
7786
7896
  set.headers.link = set.headers.link ? `${set.headers.link}, ${linkValue}` : linkValue;
7787
7897
  } catch {}
7788
- const cacheControlHeader = isWatchMode ? "no-cache, no-store, must-revalidate" : `${directive}, max-age=${maxAge}`;
7898
+ const cacheControlHeader = isWatchMode ? "no-cache, no-store, must-revalidate" : browserCacheEnabled ? `${browserDirective}, max-age=${browserMaxAge}` : undefined;
7789
7899
  let response;
7790
7900
  if (streamingEnabled) {
7791
7901
  if (debug)
@@ -7809,7 +7919,7 @@ function registerSSRRoutes(app, options) {
7809
7919
  head,
7810
7920
  lang,
7811
7921
  appId,
7812
- maxAge,
7922
+ maxAge: serverMaxAge,
7813
7923
  searchParams,
7814
7924
  ogConfig: options.ogConfig,
7815
7925
  ogMetaConfig: options.ogMetaConfig,
@@ -7868,9 +7978,9 @@ function registerSSRRoutes(app, options) {
7868
7978
  const ck = makeKey(pathname, acceptEncoding);
7869
7979
  const cacheHeaders = {
7870
7980
  "Content-Type": "text/html; charset=utf-8",
7871
- "Cache-Control": cacheControlHeader,
7872
7981
  ...extraHeaders
7873
7982
  };
7983
+ addCacheControl(cacheHeaders, cacheControlHeader);
7874
7984
  if (set.headers.link) {
7875
7985
  cacheHeaders.Link = set.headers.link;
7876
7986
  }
@@ -7884,10 +7994,10 @@ function registerSSRRoutes(app, options) {
7884
7994
  }
7885
7995
  const resHeaders = {
7886
7996
  "Content-Type": "text/html; charset=utf-8",
7887
- "Cache-Control": cacheControlHeader,
7888
7997
  "Reroute-Cache": "MISS",
7889
7998
  ...extraHeaders
7890
7999
  };
8000
+ addCacheControl(resHeaders, cacheControlHeader);
7891
8001
  if (set.headers.link) {
7892
8002
  resHeaders.Link = set.headers.link;
7893
8003
  }
@@ -7921,9 +8031,9 @@ function registerSSRRoutes(app, options) {
7921
8031
  }
7922
8032
  const ck = makeKey(pathname, "identity");
7923
8033
  const cacheHeaders = {
7924
- "Content-Type": "text/html; charset=utf-8",
7925
- "Cache-Control": cacheControlHeader
8034
+ "Content-Type": "text/html; charset=utf-8"
7926
8035
  };
8036
+ addCacheControl(cacheHeaders, cacheControlHeader);
7927
8037
  if (set.headers.link) {
7928
8038
  cacheHeaders.Link = set.headers.link;
7929
8039
  }
@@ -7940,13 +8050,14 @@ function registerSSRRoutes(app, options) {
7940
8050
  }));
7941
8051
  set.status = status;
7942
8052
  const tBeforeResponse = debug ? performance.now() : 0;
8053
+ const resHeaders = {
8054
+ "Content-Type": "text/html; charset=utf-8",
8055
+ "Reroute-Cache": "MISS"
8056
+ };
8057
+ addCacheControl(resHeaders, cacheControlHeader);
7943
8058
  const res = new Response(cachingStream, {
7944
8059
  status,
7945
- headers: {
7946
- "Content-Type": "text/html; charset=utf-8",
7947
- "Cache-Control": cacheControlHeader,
7948
- "Reroute-Cache": "MISS"
7949
- }
8060
+ headers: resHeaders
7950
8061
  });
7951
8062
  if (debug)
7952
8063
  console.log(`[SSR] ${pathname} - Response created (cached stream): ${(performance.now() - t0).toFixed(2)}ms (creation: ${(performance.now() - tBeforeResponse).toFixed(2)}ms)`);
@@ -7957,13 +8068,14 @@ function registerSSRRoutes(app, options) {
7957
8068
  if (debug)
7958
8069
  console.log(`[SSR] ${pathname} - creating direct stream response: ${(performance.now() - t0).toFixed(2)}ms`);
7959
8070
  set.status = status;
8071
+ const streamHeaders = {
8072
+ "Content-Type": "text/html; charset=utf-8",
8073
+ "Reroute-Cache": "MISS"
8074
+ };
8075
+ addCacheControl(streamHeaders, cacheControlHeader);
7960
8076
  response = new Response(stream2, {
7961
8077
  status,
7962
- headers: {
7963
- "Content-Type": "text/html; charset=utf-8",
7964
- "Cache-Control": cacheControlHeader,
7965
- "Reroute-Cache": "MISS"
7966
- }
8078
+ headers: streamHeaders
7967
8079
  });
7968
8080
  if (debug)
7969
8081
  console.log(`[SSR] ${pathname} - Response created (direct stream): ${(performance.now() - t0).toFixed(2)}ms`);
@@ -7988,7 +8100,7 @@ function registerSSRRoutes(app, options) {
7988
8100
  head,
7989
8101
  lang,
7990
8102
  appId,
7991
- maxAge,
8103
+ maxAge: serverMaxAge,
7992
8104
  searchParams,
7993
8105
  ogConfig: options.ogConfig,
7994
8106
  ogMetaConfig: options.ogMetaConfig,
@@ -8040,10 +8152,10 @@ function registerSSRRoutes(app, options) {
8040
8152
  }) : { body: html2, extraHeaders: {} };
8041
8153
  const resHeaders = {
8042
8154
  "Content-Type": "text/html; charset=utf-8",
8043
- "Cache-Control": cacheControlHeader,
8044
8155
  "Reroute-Cache": "MISS",
8045
8156
  ...extraHeaders
8046
8157
  };
8158
+ addCacheControl(resHeaders, cacheControlHeader);
8047
8159
  if (set.headers.link) {
8048
8160
  resHeaders.Link = set.headers.link;
8049
8161
  }
@@ -8223,10 +8335,15 @@ var reroute = () => async (app) => {
8223
8335
  ".env"
8224
8336
  ];
8225
8337
  const staticHeaders = staticConfig.headers;
8226
- const maxAge = globalConfig.app?.maxAge ?? 3600;
8227
- const directive = globalConfig.app?.directive ?? "public";
8228
- const staticMaxAge = staticConfig.maxAge ?? maxAge;
8229
- const staticDirective = staticConfig.directive ?? directive;
8338
+ const server2 = globalConfig.server;
8339
+ const serverCacheEnabled = server2?.cache ?? true;
8340
+ const serverMaxAge = server2?.maxAge ?? 3600;
8341
+ const browser = globalConfig.browser;
8342
+ const browserCacheEnabled = browser?.cache ?? true;
8343
+ const browserMaxAge = browser?.maxAge ?? 300;
8344
+ const browserDirective = browser?.directive ?? "public";
8345
+ const staticMaxAge = staticConfig.maxAge ?? serverMaxAge;
8346
+ const staticDirective = staticConfig.directive ?? browserDirective;
8230
8347
  const compression2 = globalConfig.app?.compression ?? true;
8231
8348
  const debug = globalConfig.app?.debug ?? false;
8232
8349
  const imageConfig = globalConfig.image ?? {};
@@ -8294,7 +8411,7 @@ var reroute = () => async (app) => {
8294
8411
  const clientDir = existsSync3(`${cwd}/.reroute/assets`) ? `${cwd}/.reroute` : `${cwd}/src/client`;
8295
8412
  const shouldIgnore = !ignorePatterns.length ? () => false : (file) => ignorePatterns.find((pattern) => typeof pattern === "string" ? file.includes(pattern) : pattern.test(file));
8296
8413
  const isWatchMode = Array.isArray(process.execArgv) && process.execArgv.includes("--watch") || Array.isArray(process.argv) && process.argv.includes("--watch");
8297
- const dataCacheControl = `${directive}, max-age=${maxAge}`;
8414
+ const dataCacheControl = browserCacheEnabled ? `${browserDirective}, max-age=${browserMaxAge}` : undefined;
8298
8415
  if (isWatchMode) {
8299
8416
  console.log(`[reroute] Live reload enabled`);
8300
8417
  registerLiveReloadRoutes(app, liveReloadState);
@@ -8346,8 +8463,8 @@ var reroute = () => async (app) => {
8346
8463
  if (globalConfig.redirects && globalConfig.redirects.length > 0) {
8347
8464
  registerRedirectRoutes(app, globalConfig.redirects);
8348
8465
  }
8349
- registerContentRoutes(app, cwd, collectionCache, directive, maxAge, isWatchMode);
8350
- registerSearchRoute(app, cwd, directive, maxAge, {
8466
+ registerContentRoutes(app, cwd, collectionCache, browserDirective, browserMaxAge, isWatchMode);
8467
+ registerSearchRoute(app, cwd, browserDirective, browserMaxAge, {
8351
8468
  defaultPageSize: globalConfig.search?.defaultPageSize,
8352
8469
  maxPageSize: globalConfig.search?.maxPageSize
8353
8470
  });
@@ -8357,11 +8474,11 @@ var reroute = () => async (app) => {
8357
8474
  dataCacheControl,
8358
8475
  dataCache,
8359
8476
  isWatchMode,
8360
- maxAge
8477
+ maxAge: serverMaxAge
8361
8478
  });
8362
8479
  registerArtifactsRoutes(app, cwd, fileCache, {
8363
8480
  bundleMaxAge,
8364
- directive,
8481
+ directive: browserDirective,
8365
8482
  isWatchMode
8366
8483
  });
8367
8484
  const imageCacheDir = `${cwd}/.reroute/image-cache`;
@@ -8394,7 +8511,7 @@ var reroute = () => async (app) => {
8394
8511
  try {
8395
8512
  registerRobotsRoute(app, {
8396
8513
  cwd,
8397
- maxAge: robotsConfig.maxAge ?? maxAge,
8514
+ maxAge: robotsConfig.maxAge ?? browserMaxAge,
8398
8515
  isWatchMode,
8399
8516
  robotsCache,
8400
8517
  robotsConfig,
@@ -8413,7 +8530,7 @@ var reroute = () => async (app) => {
8413
8530
  cwd,
8414
8531
  collections: collections2,
8415
8532
  baseUrl: sitemapBaseUrl,
8416
- maxAge,
8533
+ maxAge: browserMaxAge,
8417
8534
  isWatchMode,
8418
8535
  sitemapCache,
8419
8536
  sitemapConfig
@@ -8430,7 +8547,7 @@ var reroute = () => async (app) => {
8430
8547
  clientDir,
8431
8548
  collections: collections2,
8432
8549
  baseUrl: rssBaseUrl,
8433
- maxAge,
8550
+ maxAge: browserMaxAge,
8434
8551
  isWatchMode,
8435
8552
  rssCache,
8436
8553
  rssConfig
@@ -8448,8 +8565,8 @@ var reroute = () => async (app) => {
8448
8565
  cwd,
8449
8566
  isWatchMode,
8450
8567
  getBundleUrl,
8451
- maxAge,
8452
- directive,
8568
+ maxAge: serverMaxAge,
8569
+ directive: browserDirective,
8453
8570
  llmsConfig,
8454
8571
  collections: collections2,
8455
8572
  dataCache
@@ -8497,8 +8614,11 @@ var reroute = () => async (app) => {
8497
8614
  head: ssrHead,
8498
8615
  lang: ssrLang,
8499
8616
  appId: ssrAppId,
8500
- maxAge,
8501
- directive,
8617
+ serverCacheEnabled,
8618
+ serverMaxAge,
8619
+ browserCacheEnabled,
8620
+ browserMaxAge,
8621
+ browserDirective,
8502
8622
  compression: compression2,
8503
8623
  streamingEnabled,
8504
8624
  streamingTimeout: globalConfig.streaming?.timeout,
@@ -8527,4 +8647,4 @@ export {
8527
8647
  reroute
8528
8648
  };
8529
8649
 
8530
- //# debugId=34902B8E9F66D1AE64756E2164756E21
8650
+ //# debugId=C6F09D6C67BEE32064756E2164756E21