vinext 1.2.1 → 1.3.1

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 (509) hide show
  1. package/README.md +12 -9
  2. package/dist/_virtual/_rolldown/runtime.js +1 -1
  3. package/dist/build/action-owner-manifest.d.ts +3 -2
  4. package/dist/build/action-owner-manifest.js +18 -2
  5. package/dist/build/app-page-static-eligibility.d.ts +17 -1
  6. package/dist/build/app-page-static-eligibility.js +80 -13
  7. package/dist/build/clean-output.d.ts +2 -1
  8. package/dist/build/client-build-config.d.ts +77 -6
  9. package/dist/build/client-build-config.js +176 -12
  10. package/dist/build/client-reference-async.d.ts +48 -0
  11. package/dist/build/client-reference-async.js +123 -0
  12. package/dist/build/client-reference-chunks.d.ts +32 -0
  13. package/dist/build/client-reference-chunks.js +111 -0
  14. package/dist/build/client-reference-groups.d.ts +171 -0
  15. package/dist/build/client-reference-groups.js +572 -0
  16. package/dist/build/css-url-assets.d.ts +2 -1
  17. package/dist/build/google-fonts/fallback-metrics.d.ts +2 -1
  18. package/dist/build/google-fonts/find-font-files-in-css.d.ts +1 -0
  19. package/dist/build/google-fonts/find-font-files-in-css.js +17 -4
  20. package/dist/build/google-fonts/font-metadata.d.ts +2 -1
  21. package/dist/build/google-fonts/validate.d.ts +2 -1
  22. package/dist/build/inline-css.d.ts +2 -1
  23. package/dist/build/layout-classification.d.ts +2 -1
  24. package/dist/build/module-dependency-cache.d.ts +33 -1
  25. package/dist/build/module-dependency-cache.js +51 -1
  26. package/dist/build/next-client-runtime-manifests.d.ts +12 -2
  27. package/dist/build/next-client-runtime-manifests.js +19 -4
  28. package/dist/build/nitro-public-files.d.ts +24 -0
  29. package/dist/build/nitro-public-files.js +60 -0
  30. package/dist/build/pages-client-assets-module.js +1 -1
  31. package/dist/build/precompress.d.ts +2 -1
  32. package/dist/build/precompress.js +1 -1
  33. package/dist/build/prerender-paths.d.ts +2 -1
  34. package/dist/build/prerender-paths.js +5 -2
  35. package/dist/build/prerender-phase.d.ts +2 -1
  36. package/dist/build/prerender-server-pool.js +1 -1
  37. package/dist/build/prerender.d.ts +3 -2
  38. package/dist/build/prerender.js +5 -4
  39. package/dist/build/report.d.ts +2 -1
  40. package/dist/build/route-classification-injector.d.ts +2 -1
  41. package/dist/build/route-classification-manifest.d.ts +2 -1
  42. package/dist/build/run-prerender.d.ts +2 -1
  43. package/dist/build/server-actions-encryption-key.d.ts +24 -0
  44. package/dist/build/server-actions-encryption-key.js +101 -0
  45. package/dist/build/ssr-manifest.d.ts +3 -0
  46. package/dist/build/ssr-manifest.js +34 -2
  47. package/dist/build/standalone.d.ts +2 -1
  48. package/dist/cache/cache-adapters-virtual.d.ts +2 -1
  49. package/dist/cache.js +1 -2
  50. package/dist/check.d.ts +2 -1
  51. package/dist/check.js +4 -0
  52. package/dist/cli-args.d.ts +2 -1
  53. package/dist/cli.js +2 -0
  54. package/dist/client/client-redirect-matcher.js +2 -1
  55. package/dist/client/client-redirects.d.ts +4 -3
  56. package/dist/client/client-redirects.js +2 -1
  57. package/dist/client/client-rewrite-params.d.ts +9 -0
  58. package/dist/client/client-rewrite-params.js +20 -0
  59. package/dist/client/client-rewrites.d.ts +2 -1
  60. package/dist/client/dev-error-overlay-store.d.ts +2 -1
  61. package/dist/client/dev-error-overlay.js +2 -1
  62. package/dist/client/index.js +1 -2
  63. package/dist/client/instrumentation-client-state.js +5 -5
  64. package/dist/client/navigation-runtime.d.ts +28 -3
  65. package/dist/client/navigation-runtime.js +42 -11
  66. package/dist/client/pages-router-link-navigation.d.ts +2 -1
  67. package/dist/client/vinext-next-data.d.ts +25 -2
  68. package/dist/client/window-next.d.ts +2 -1
  69. package/dist/config/config-matchers.d.ts +27 -41
  70. package/dist/config/config-matchers.js +293 -270
  71. package/dist/config/config-source.d.ts +34 -0
  72. package/dist/config/config-source.js +141 -0
  73. package/dist/config/dotenv.d.ts +2 -1
  74. package/dist/config/header-params.d.ts +29 -0
  75. package/dist/config/header-params.js +106 -0
  76. package/dist/config/next-config.d.ts +20 -6
  77. package/dist/config/next-config.js +149 -11
  78. package/dist/config/tsconfig-paths.d.ts +2 -1
  79. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/detector.js +23 -0
  80. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/index.js +2 -0
  81. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/lookup.js +25 -0
  82. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/bmp.js +11 -0
  83. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/cur.js +15 -0
  84. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/dds.js +11 -0
  85. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/gif.js +12 -0
  86. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/heif.js +55 -0
  87. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/icns.js +76 -0
  88. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ico.js +39 -0
  89. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/index.js +46 -0
  90. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/j2c.js +11 -0
  91. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jp2.js +21 -0
  92. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jpg.js +71 -0
  93. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl-stream.js +42 -0
  94. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl.js +46 -0
  95. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ktx.js +19 -0
  96. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/png.js +28 -0
  97. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/pnm.js +54 -0
  98. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/psd.js +11 -0
  99. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/svg.js +79 -0
  100. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tga.js +15 -0
  101. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tiff.js +96 -0
  102. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/utils.js +53 -0
  103. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/webp.js +45 -0
  104. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/utils/bit-reader.js +38 -0
  105. package/dist/deps/.pnpm/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +2 -2
  106. package/dist/entries/app-browser-entry.d.ts +34 -6
  107. package/dist/entries/app-browser-entry.js +103 -40
  108. package/dist/entries/app-rsc-entry.d.ts +4 -1
  109. package/dist/entries/app-rsc-entry.js +131 -66
  110. package/dist/entries/app-rsc-manifest.d.ts +12 -1
  111. package/dist/entries/app-rsc-manifest.js +73 -1
  112. package/dist/entries/app-ssr-entry.d.ts +4 -1
  113. package/dist/entries/app-ssr-entry.js +9 -2
  114. package/dist/entries/pages-client-entry.d.ts +1 -0
  115. package/dist/entries/pages-client-entry.js +6 -6
  116. package/dist/entries/pages-entry-helpers.js +1 -2
  117. package/dist/entries/pages-server-entry.d.ts +2 -1
  118. package/dist/entries/pages-server-entry.js +18 -15
  119. package/dist/entries/runtime-entry-module.d.ts +1 -0
  120. package/dist/entries/runtime-entry-module.js +4 -1
  121. package/dist/image/image-adapters-virtual.d.ts +2 -1
  122. package/dist/index.d.ts +11 -0
  123. package/dist/index.js +340 -116
  124. package/dist/init.js +17 -0
  125. package/dist/plugins/client-compile-hints.d.ts +30 -0
  126. package/dist/plugins/client-compile-hints.js +88 -0
  127. package/dist/plugins/client-reference-dedup.d.ts +2 -1
  128. package/dist/plugins/cloudflare-dev-module-urls.d.ts +2 -1
  129. package/dist/plugins/dynamic-preload-metadata.d.ts +3 -1
  130. package/dist/plugins/dynamic-preload-metadata.js +1 -1
  131. package/dist/plugins/environment.d.ts +2 -1
  132. package/dist/plugins/fonts.js +9 -12
  133. package/dist/plugins/ignore-dynamic-requests.d.ts +2 -1
  134. package/dist/plugins/import-meta-url.d.ts +2 -1
  135. package/dist/plugins/og-assets.d.ts +2 -1
  136. package/dist/plugins/og-assets.js +2 -3
  137. package/dist/plugins/optimize-imports.d.ts +27 -3
  138. package/dist/plugins/optimize-imports.js +106 -20
  139. package/dist/plugins/pages-node-externals.d.ts +2 -1
  140. package/dist/plugins/remove-console.d.ts +2 -1
  141. package/dist/plugins/require-condition-resolution.d.ts +2 -1
  142. package/dist/plugins/rsc-client-reference-loaders.d.ts +53 -1
  143. package/dist/plugins/rsc-client-reference-loaders.js +447 -27
  144. package/dist/plugins/rsc-client-shim-excludes.js +2 -0
  145. package/dist/plugins/sass.d.ts +2 -1
  146. package/dist/plugins/strip-server-exports.d.ts +2 -1
  147. package/dist/plugins/styled-jsx.d.ts +2 -1
  148. package/dist/plugins/transform-result.d.ts +2 -1
  149. package/dist/plugins/typeof-window.d.ts +2 -1
  150. package/dist/plugins/use-cache-callable.d.ts +5 -0
  151. package/dist/plugins/use-cache-callable.js +30 -8
  152. package/dist/plugins/worker-image-imports.d.ts +1 -0
  153. package/dist/plugins/worker-image-imports.js +2 -2
  154. package/dist/plugins/worker-use-server.d.ts +2 -1
  155. package/dist/routing/app-route-graph.d.ts +41 -1
  156. package/dist/routing/app-route-graph.js +122 -50
  157. package/dist/routing/browser-route-manifest.d.ts +44 -0
  158. package/dist/routing/browser-route-manifest.js +195 -0
  159. package/dist/routing/hashed-route-patterns.d.ts +4 -0
  160. package/dist/routing/hashed-route-patterns.js +22 -0
  161. package/dist/routing/optimistic-route-trie.d.ts +28 -0
  162. package/dist/routing/optimistic-route-trie.js +102 -0
  163. package/dist/routing/route-matching.d.ts +2 -1
  164. package/dist/routing/route-pattern.d.ts +2 -1
  165. package/dist/routing/route-validation.d.ts +6 -1
  166. package/dist/routing/route-validation.js +26 -10
  167. package/dist/server/accept-encoding.d.ts +2 -1
  168. package/dist/server/app-action-forwarding.d.ts +10 -1
  169. package/dist/server/app-action-forwarding.js +15 -1
  170. package/dist/server/app-bfcache-identity.d.ts +2 -1
  171. package/dist/server/app-browser-action-result.d.ts +2 -1
  172. package/dist/server/app-browser-client-reuse-manifest.d.ts +2 -1
  173. package/dist/server/app-browser-entry.js +175 -64
  174. package/dist/server/app-browser-error.d.ts +5 -2
  175. package/dist/server/app-browser-error.js +7 -2
  176. package/dist/server/app-browser-history-controller.d.ts +2 -1
  177. package/dist/server/app-browser-hydration.d.ts +2 -1
  178. package/dist/server/app-browser-interception-context.d.ts +4 -3
  179. package/dist/server/app-browser-mpa-navigation.d.ts +1 -0
  180. package/dist/server/app-browser-mpa-navigation.js +6 -5
  181. package/dist/server/app-browser-navigation-controller.d.ts +17 -6
  182. package/dist/server/app-browser-navigation-controller.js +103 -36
  183. package/dist/server/app-browser-popstate.d.ts +2 -1
  184. package/dist/server/app-browser-rsc-redirect.d.ts +2 -1
  185. package/dist/server/app-browser-server-action-client.d.ts +2 -1
  186. package/dist/server/app-browser-state.d.ts +2 -2
  187. package/dist/server/app-browser-state.js +1 -1
  188. package/dist/server/app-browser-stream.d.ts +2 -1
  189. package/dist/server/app-browser-visible-commit.d.ts +6 -5
  190. package/dist/server/app-client-reference-manifest.d.ts +31 -0
  191. package/dist/server/app-client-reference-manifest.js +46 -0
  192. package/dist/server/app-client-reference-preloader.d.ts +45 -2
  193. package/dist/server/app-client-reference-preloader.js +48 -10
  194. package/dist/server/app-elements-wire.d.ts +2 -1
  195. package/dist/server/app-elements.d.ts +2 -0
  196. package/dist/server/app-elements.js +3 -1
  197. package/dist/server/app-fallback-renderer.d.ts +9 -2
  198. package/dist/server/app-fallback-renderer.js +6 -2
  199. package/dist/server/app-history-state.d.ts +2 -1
  200. package/dist/server/app-inline-css-client.d.ts +2 -1
  201. package/dist/server/app-layout-param-observation.d.ts +2 -1
  202. package/dist/server/app-metadata-tracing.d.ts +2 -1
  203. package/dist/server/app-middleware.d.ts +6 -0
  204. package/dist/server/app-middleware.js +8 -10
  205. package/dist/server/app-optimistic-routing.d.ts +26 -11
  206. package/dist/server/app-optimistic-routing.js +38 -96
  207. package/dist/server/app-page-boundary-render.d.ts +20 -2
  208. package/dist/server/app-page-boundary-render.js +229 -39
  209. package/dist/server/app-page-boundary.d.ts +34 -5
  210. package/dist/server/app-page-boundary.js +40 -7
  211. package/dist/server/app-page-cache-finalizer.d.ts +2 -1
  212. package/dist/server/app-page-cache-finalizer.js +1 -1
  213. package/dist/server/app-page-cache-render.d.ts +10 -2
  214. package/dist/server/app-page-cache-render.js +15 -2
  215. package/dist/server/app-page-cache.js +2 -2
  216. package/dist/server/app-page-dispatch.d.ts +34 -1
  217. package/dist/server/app-page-dispatch.js +165 -34
  218. package/dist/server/app-page-element-builder.d.ts +17 -1
  219. package/dist/server/app-page-element-builder.js +187 -66
  220. package/dist/server/app-page-execution.d.ts +28 -1
  221. package/dist/server/app-page-execution.js +114 -5
  222. package/dist/server/app-page-head.d.ts +95 -3
  223. package/dist/server/app-page-head.js +307 -152
  224. package/dist/server/app-page-http-access-fallback-metadata.d.ts +48 -2
  225. package/dist/server/app-page-http-access-fallback-metadata.js +76 -1
  226. package/dist/server/app-page-method.d.ts +2 -1
  227. package/dist/server/app-page-probe.d.ts +2 -1
  228. package/dist/server/app-page-render-identity.d.ts +2 -1
  229. package/dist/server/app-page-render.d.ts +7 -1
  230. package/dist/server/app-page-render.js +38 -11
  231. package/dist/server/app-page-request.d.ts +14 -1
  232. package/dist/server/app-page-request.js +1 -1
  233. package/dist/server/app-page-route-wiring.d.ts +52 -2
  234. package/dist/server/app-page-route-wiring.js +197 -47
  235. package/dist/server/app-page-rsc-render-status.d.ts +3 -1
  236. package/dist/server/app-page-rsc-render-status.js +1 -0
  237. package/dist/server/app-page-search-params-observation.d.ts +8 -6
  238. package/dist/server/app-page-search-params-observation.js +16 -11
  239. package/dist/server/app-page-segment-plan.d.ts +2 -1
  240. package/dist/server/app-page-stream.d.ts +38 -1
  241. package/dist/server/app-page-stream.js +24 -4
  242. package/dist/server/app-pages-bridge.d.ts +4 -2
  243. package/dist/server/app-pages-bridge.js +11 -7
  244. package/dist/server/app-ppr-fallback-shell-render.d.ts +2 -1
  245. package/dist/server/app-ppr-fallback-shell.d.ts +2 -1
  246. package/dist/server/app-prerender-endpoints.d.ts +2 -1
  247. package/dist/server/app-prerender-static-params.d.ts +2 -1
  248. package/dist/server/app-prerender-static-params.js +3 -2
  249. package/dist/server/app-render-dependency.d.ts +11 -1
  250. package/dist/server/app-render-dependency.js +65 -6
  251. package/dist/server/app-request-stage-independent-entry.d.ts +2 -1
  252. package/dist/server/app-request-stage-independent-entry.js +2 -2
  253. package/dist/server/app-response-stage-entry.d.ts +2 -1
  254. package/dist/server/app-response-stage-entry.js +3 -3
  255. package/dist/server/app-route-handler-cache.d.ts +2 -1
  256. package/dist/server/app-route-handler-dispatch.d.ts +2 -1
  257. package/dist/server/app-route-handler-dispatch.js +4 -2
  258. package/dist/server/app-route-handler-execution.d.ts +4 -1
  259. package/dist/server/app-route-handler-execution.js +9 -2
  260. package/dist/server/app-route-handler-middleware-context.d.ts +2 -1
  261. package/dist/server/app-route-handler-middleware-context.js +3 -3
  262. package/dist/server/app-route-handler-response.d.ts +4 -2
  263. package/dist/server/app-route-handler-response.js +2 -2
  264. package/dist/server/app-route-handler-runtime.d.ts +4 -1
  265. package/dist/server/app-route-handler-runtime.js +20 -3
  266. package/dist/server/app-route-module-loader.d.ts +18 -1
  267. package/dist/server/app-route-module-loader.js +15 -6
  268. package/dist/server/app-route-tree-prefetch.d.ts +2 -1
  269. package/dist/server/app-route-tree.d.ts +20 -0
  270. package/dist/server/app-route-tree.js +18 -0
  271. package/dist/server/app-router-entry.js +2 -2
  272. package/dist/server/app-rsc-combined-handler.js +8 -1
  273. package/dist/server/app-rsc-error-handler.d.ts +2 -1
  274. package/dist/server/app-rsc-errors.d.ts +9 -1
  275. package/dist/server/app-rsc-errors.js +9 -2
  276. package/dist/server/app-rsc-handler.d.ts +6 -2
  277. package/dist/server/app-rsc-handler.js +152 -140
  278. package/dist/server/app-rsc-response-finalizer.d.ts +7 -1
  279. package/dist/server/app-rsc-response-finalizer.js +4 -1
  280. package/dist/server/app-rsc-response-stage.js +3 -1
  281. package/dist/server/app-rsc-route-matching.d.ts +39 -1
  282. package/dist/server/app-rsc-route-matching.js +25 -1
  283. package/dist/server/app-segment-config.d.ts +2 -1
  284. package/dist/server/app-segment-config.js +1 -14
  285. package/dist/server/app-server-action-execution.d.ts +25 -7
  286. package/dist/server/app-server-action-execution.js +53 -59
  287. package/dist/server/app-ssr-entry.d.ts +12 -0
  288. package/dist/server/app-ssr-entry.js +104 -48
  289. package/dist/server/app-ssr-error-meta.d.ts +2 -1
  290. package/dist/server/app-ssr-search-params-gate.d.ts +2 -1
  291. package/dist/server/app-ssr-stream.d.ts +29 -10
  292. package/dist/server/app-ssr-stream.js +311 -67
  293. package/dist/server/app-static-generation.d.ts +2 -1
  294. package/dist/server/app-streamed-client-references.d.ts +39 -0
  295. package/dist/server/app-streamed-client-references.js +156 -0
  296. package/dist/server/app-visited-response-cache.d.ts +2 -1
  297. package/dist/server/app-worker-stages.d.ts +2 -1
  298. package/dist/server/artifact-compatibility.d.ts +2 -1
  299. package/dist/server/bfcache-identity.d.ts +2 -1
  300. package/dist/server/cache-headers.d.ts +2 -1
  301. package/dist/server/cacheability-request.d.ts +2 -1
  302. package/dist/server/client-reuse-manifest.d.ts +2 -1
  303. package/dist/server/config-headers.d.ts +2 -1
  304. package/dist/server/config-headers.js +12 -3
  305. package/dist/server/csp.d.ts +2 -1
  306. package/dist/server/default-global-not-found-module.d.ts +2 -1
  307. package/dist/server/default-http-access-fallback-modules.d.ts +33 -0
  308. package/dist/server/default-http-access-fallback-modules.js +31 -0
  309. package/dist/server/defer-until-stream-consumed.d.ts +34 -0
  310. package/dist/server/defer-until-stream-consumed.js +154 -21
  311. package/dist/server/dev-lockfile.d.ts +32 -2
  312. package/dist/server/dev-lockfile.js +46 -2
  313. package/dist/server/dev-module-runner.d.ts +2 -1
  314. package/dist/server/dev-server.js +10 -3
  315. package/dist/server/fetch-handler.js +1 -2
  316. package/dist/server/file-based-metadata.d.ts +2 -1
  317. package/dist/server/framework-tracer.d.ts +2 -1
  318. package/dist/server/html.d.ts +1 -0
  319. package/dist/server/html.js +19 -1
  320. package/dist/server/http-conditional.d.ts +2 -1
  321. package/dist/server/http-error-responses.d.ts +2 -1
  322. package/dist/server/implicit-tags.d.ts +2 -1
  323. package/dist/server/isolate-shared-promise.d.ts +10 -0
  324. package/dist/server/isolate-shared-promise.js +33 -0
  325. package/dist/server/isr-cache.js +3 -2
  326. package/dist/server/metadata-route-build-data.d.ts +2 -1
  327. package/dist/server/metadata-route-build-data.js +1 -1
  328. package/dist/server/metadata-route-response.d.ts +2 -1
  329. package/dist/server/metadata-route-response.js +1 -1
  330. package/dist/server/metadata-routes.d.ts +2 -1
  331. package/dist/server/middleware-matcher-pattern.d.ts +0 -1
  332. package/dist/server/middleware-matcher-pattern.js +11 -140
  333. package/dist/server/middleware-matcher.js +5 -6
  334. package/dist/server/middleware-response-headers.d.ts +31 -0
  335. package/dist/server/middleware-response-headers.js +57 -1
  336. package/dist/server/middleware-runtime.d.ts +2 -1
  337. package/dist/server/middleware-runtime.js +26 -13
  338. package/dist/server/navigation-planner.d.ts +2 -2
  339. package/dist/server/navigation-trace.d.ts +2 -1
  340. package/dist/server/next-error-digest.d.ts +2 -1
  341. package/dist/server/nitro-public-files-plugin.d.ts +39 -0
  342. package/dist/server/nitro-public-files-plugin.js +106 -0
  343. package/dist/server/nitro-public-files.d.ts +22 -0
  344. package/dist/server/nitro-public-files.js +39 -0
  345. package/dist/server/opentelemetry-api.d.ts +2 -1
  346. package/dist/server/operation-token.d.ts +2 -1
  347. package/dist/server/pages-api-route.d.ts +2 -1
  348. package/dist/server/pages-asset-tags.d.ts +7 -1
  349. package/dist/server/pages-asset-tags.js +9 -2
  350. package/dist/server/pages-body-parser-config.d.ts +2 -1
  351. package/dist/server/pages-client-assets.d.ts +8 -1
  352. package/dist/server/pages-data-route.d.ts +2 -1
  353. package/dist/server/pages-document-asset-props.d.ts +2 -1
  354. package/dist/server/pages-document-initial-props.d.ts +2 -1
  355. package/dist/server/pages-execution-tracing.d.ts +2 -1
  356. package/dist/server/pages-execution-tracing.js +1 -1
  357. package/dist/server/pages-get-initial-props.d.ts +2 -1
  358. package/dist/server/pages-i18n.d.ts +18 -0
  359. package/dist/server/pages-i18n.js +18 -2
  360. package/dist/server/pages-node-compat.d.ts +5 -3
  361. package/dist/server/pages-node-compat.js +35 -16
  362. package/dist/server/pages-page-data.d.ts +7 -1
  363. package/dist/server/pages-page-data.js +35 -12
  364. package/dist/server/pages-page-handler.d.ts +3 -2
  365. package/dist/server/pages-page-handler.js +16 -7
  366. package/dist/server/pages-page-method.d.ts +2 -1
  367. package/dist/server/pages-page-response.d.ts +2 -1
  368. package/dist/server/pages-preview.d.ts +2 -1
  369. package/dist/server/pages-readiness.d.ts +2 -1
  370. package/dist/server/pages-request-pipeline.d.ts +8 -2
  371. package/dist/server/pages-request-pipeline.js +35 -40
  372. package/dist/server/pages-request-stage-entry.d.ts +2 -1
  373. package/dist/server/pages-request-stage-entry.js +16 -6
  374. package/dist/server/pages-response-stage-entry.d.ts +2 -1
  375. package/dist/server/pages-response-stage-entry.js +1 -1
  376. package/dist/server/pages-revalidate.js +1 -0
  377. package/dist/server/pages-route-data-kind.d.ts +2 -1
  378. package/dist/server/pages-router-entry.js +1 -1
  379. package/dist/server/prerender-cache-life-header.d.ts +2 -1
  380. package/dist/server/prerender-route-params.d.ts +2 -1
  381. package/dist/server/prod-server.d.ts +2 -2
  382. package/dist/server/prod-server.js +80 -36
  383. package/dist/server/proxy-trust.d.ts +6 -0
  384. package/dist/server/proxy-trust.js +12 -6
  385. package/dist/server/request-log.d.ts +2 -1
  386. package/dist/server/request-pipeline.d.ts +5 -0
  387. package/dist/server/request-pipeline.js +12 -1
  388. package/dist/server/request-tracing.d.ts +2 -1
  389. package/dist/server/request-tracing.js +1 -1
  390. package/dist/server/response-start-tracing.js +7 -29
  391. package/dist/server/rsc-render-stream.d.ts +4 -0
  392. package/dist/server/rsc-render-stream.js +25 -0
  393. package/dist/server/seed-cache.d.ts +2 -1
  394. package/dist/server/seed-cache.js +1 -1
  395. package/dist/server/server-reference-loader.js +10 -1
  396. package/dist/server/static-file-cache.d.ts +2 -1
  397. package/dist/server/static-file-cache.js +16 -3
  398. package/dist/server/static-layout-client-reuse-proof.d.ts +2 -1
  399. package/dist/server/worker-revalidation-context.d.ts +2 -1
  400. package/dist/server/worker-stages.d.ts +2 -1
  401. package/dist/server/worker-utils.js +1 -1
  402. package/dist/shims/app.d.ts +2 -1
  403. package/dist/shims/cache-callable-runtime.d.ts +2 -1
  404. package/dist/shims/cache-handler.d.ts +8 -3
  405. package/dist/shims/cache-handler.js +32 -11
  406. package/dist/shims/cache-request-state.d.ts +40 -3
  407. package/dist/shims/cache-request-state.js +70 -5
  408. package/dist/shims/cache-runtime.js +47 -19
  409. package/dist/shims/cache.d.ts +2 -2
  410. package/dist/shims/cache.js +17 -8
  411. package/dist/shims/caught-not-found-boundaries.d.ts +15 -0
  412. package/dist/shims/caught-not-found-boundaries.js +48 -0
  413. package/dist/shims/cdn-purge-routes.d.ts +25 -0
  414. package/dist/shims/cdn-purge-routes.js +77 -0
  415. package/dist/shims/client-locale.js +2 -1
  416. package/dist/shims/client-page-root.d.ts +2 -1
  417. package/dist/shims/config.d.ts +2 -1
  418. package/dist/shims/default-forbidden.d.ts +4 -0
  419. package/dist/shims/default-forbidden.js +18 -0
  420. package/dist/shims/default-not-found.d.ts +0 -5
  421. package/dist/shims/default-not-found.js +5 -41
  422. package/dist/shims/default-unauthorized.d.ts +4 -0
  423. package/dist/shims/default-unauthorized.js +18 -0
  424. package/dist/shims/dynamic.js +17 -4
  425. package/dist/shims/error-boundary.d.ts +39 -3
  426. package/dist/shims/error-boundary.js +31 -16
  427. package/dist/shims/font-google.js +1 -2
  428. package/dist/shims/font-utils.d.ts +3 -2
  429. package/dist/shims/font-utils.js +5 -3
  430. package/dist/shims/form.js +9 -4
  431. package/dist/shims/http-access-error-fallback.d.ts +7 -0
  432. package/dist/shims/http-access-error-fallback.js +47 -0
  433. package/dist/shims/image-props.d.ts +93 -0
  434. package/dist/shims/image-props.js +323 -0
  435. package/dist/shims/image.d.ts +4 -39
  436. package/dist/shims/image.js +4 -319
  437. package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +22 -2
  438. package/dist/shims/internal/app-prefetch-fetch-queue.js +71 -18
  439. package/dist/shims/internal/app-route-prefetch-policy.d.ts +14 -3
  440. package/dist/shims/internal/app-route-prefetch-policy.js +29 -4
  441. package/dist/shims/internal/cache-context-accessor.d.ts +2 -1
  442. package/dist/shims/internal/client-reference-loader.d.ts +7 -0
  443. package/dist/shims/internal/client-reference-loader.js +91 -0
  444. package/dist/shims/internal/cookie-serialize.d.ts +2 -1
  445. package/dist/shims/internal/cookies.js +1 -2
  446. package/dist/shims/internal/headers-state.d.ts +9 -0
  447. package/dist/shims/internal/headers-state.js +19 -2
  448. package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +6 -2
  449. package/dist/shims/internal/hybrid-client-route-owner-direct.js +31 -14
  450. package/dist/shims/internal/hybrid-client-route-owner.js +8 -8
  451. package/dist/shims/internal/interpolate-as.d.ts +2 -1
  452. package/dist/shims/internal/pages-data-target.d.ts +2 -1
  453. package/dist/shims/internal/pages-data-url.d.ts +2 -1
  454. package/dist/shims/internal/thenable-well-known-properties.d.ts +2 -1
  455. package/dist/shims/link.js +198 -53
  456. package/dist/shims/metadata.d.ts +32 -11
  457. package/dist/shims/metadata.js +88 -26
  458. package/dist/shims/navigation-errors.d.ts +2 -1
  459. package/dist/shims/navigation.d.ts +23 -3
  460. package/dist/shims/navigation.js +91 -25
  461. package/dist/shims/og.js +35 -10
  462. package/dist/shims/pages-router-runtime.d.ts +2 -1
  463. package/dist/shims/ppr-fallback-shell.d.ts +2 -1
  464. package/dist/shims/request-context.d.ts +13 -0
  465. package/dist/shims/router.js +33 -43
  466. package/dist/shims/server.d.ts +31 -4
  467. package/dist/shims/server.js +58 -10
  468. package/dist/shims/thenable-params.d.ts +6 -1
  469. package/dist/shims/thenable-params.js +11 -2
  470. package/dist/shims/unified-request-context.d.ts +5 -0
  471. package/dist/shims/unified-request-context.js +5 -3
  472. package/dist/typegen.d.ts +2 -1
  473. package/dist/utils/asset-prefix.d.ts +7 -0
  474. package/dist/utils/asset-prefix.js +10 -1
  475. package/dist/utils/client-build-manifest.d.ts +4 -1
  476. package/dist/utils/client-build-manifest.js +20 -6
  477. package/dist/utils/client-entry-manifest.d.ts +13 -0
  478. package/dist/utils/client-entry-manifest.js +20 -1
  479. package/dist/utils/client-reference-chunks.d.ts +45 -0
  480. package/dist/utils/client-reference-chunks.js +30 -0
  481. package/dist/utils/client-runtime-metadata.d.ts +10 -1
  482. package/dist/utils/client-runtime-metadata.js +53 -9
  483. package/dist/utils/compare.d.ts +9 -0
  484. package/dist/utils/compare.js +15 -1
  485. package/dist/utils/lazy-chunks.d.ts +18 -0
  486. package/dist/utils/lazy-chunks.js +27 -1
  487. package/dist/utils/manifest-paths.d.ts +14 -0
  488. package/dist/utils/manifest-paths.js +22 -1
  489. package/dist/utils/middleware-request-headers.d.ts +2 -1
  490. package/dist/utils/path-to-regexp.d.ts +21 -0
  491. package/dist/{server/middleware-path-to-regexp.js → utils/path-to-regexp.js} +14 -11
  492. package/dist/utils/plugin-react-version.d.ts +15 -0
  493. package/dist/utils/plugin-react-version.js +64 -0
  494. package/dist/utils/project.d.ts +2 -1
  495. package/dist/utils/project.js +9 -1
  496. package/dist/utils/public-routes.d.ts +2 -0
  497. package/dist/utils/public-routes.js +18 -7
  498. package/dist/utils/query.d.ts +2 -1
  499. package/dist/utils/sorted-array.d.ts +2 -1
  500. package/dist/utils/vite-cli-invocation.d.ts +2 -1
  501. package/package.json +5 -5
  502. package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +0 -808
  503. package/dist/server/default-not-found-module.d.ts +0 -19
  504. package/dist/server/default-not-found-module.js +0 -18
  505. package/dist/server/middleware-path-to-regexp.d.ts +0 -13
  506. package/dist/server/rsc-stream-hints.d.ts +0 -21
  507. package/dist/server/rsc-stream-hints.js +0 -227
  508. package/dist/utils/regex-safety.d.ts +0 -17
  509. package/dist/utils/regex-safety.js +0 -789
@@ -42,7 +42,7 @@ function createWorkerImageImportsPlugin(options = {}) {
42
42
  let dimensions = dimensionCache.get(imagePath);
43
43
  if (!dimensions) {
44
44
  try {
45
- const { imageSize } = await import("../deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js");
45
+ const { imageSize } = await import("../deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/index.js");
46
46
  const result = imageSize(fs.readFileSync(imagePath));
47
47
  dimensions = {
48
48
  width: result.width ?? 0,
@@ -128,4 +128,4 @@ function createWorkerImageImportsPlugin(options = {}) {
128
128
  };
129
129
  }
130
130
  //#endregion
131
- export { createWorkerImageImportsPlugin };
131
+ export { WORKER_IMAGE_METADATA_PREFIX, createWorkerImageImportsPlugin };
@@ -22,4 +22,5 @@ export declare function createWorkerUseServerPlugins(options: {
22
22
  rscPluginModule: Promise<RscPluginModule>;
23
23
  rscPluginPath: string;
24
24
  }): Promise<Plugin[]>;
25
- //#endregion
25
+ //#endregion
26
+ export {};
@@ -44,6 +44,30 @@ type InterceptingRoute = {
44
44
  notFoundBranchSegments?: string[];
45
45
  /** Tree position relative to the normalized interception branch. */
46
46
  notFoundTreePosition?: number | null;
47
+ /** Nearest forbidden convention inside the interception branch. */
48
+ forbiddenPath?: string | null;
49
+ /** Tree position relative to the normalized interception branch. */
50
+ forbiddenTreePosition?: number | null;
51
+ /** Nearest unauthorized convention inside the interception branch. */
52
+ unauthorizedPath?: string | null;
53
+ /** Tree position relative to the normalized interception branch. */
54
+ unauthorizedTreePosition?: number | null;
55
+ /** Every not-found convention inside the interception branch, outermost first. */
56
+ notFoundPaths?: string[];
57
+ /** Tree positions for notFoundPaths in the normalized interception branch. */
58
+ notFoundTreePositions?: number[];
59
+ /** Every forbidden convention inside the interception branch, outermost first. */
60
+ forbiddenPaths?: string[];
61
+ /** Tree positions for forbiddenPaths in the normalized interception branch. */
62
+ forbiddenTreePositions?: number[];
63
+ /** Every unauthorized convention inside the interception branch, outermost first. */
64
+ unauthorizedPaths?: string[];
65
+ /** Tree positions for unauthorizedPaths in the normalized interception branch. */
66
+ unauthorizedTreePositions?: number[];
67
+ /** Every error convention inside the interception branch, outermost first. */
68
+ errorPaths?: string[];
69
+ /** Tree positions for errorPaths in the normalized interception branch. */
70
+ errorTreePositions?: number[];
47
71
  /** Parameter names for dynamic segments */
48
72
  params: string[];
49
73
  /**
@@ -89,6 +113,10 @@ type ParallelSlot = {
89
113
  notFoundPath?: string | null;
90
114
  /** Tree position of that convention relative to the slot root. */
91
115
  notFoundTreePosition?: number | null;
116
+ /** Every not-found convention from the slot root to its active page, outermost first. */
117
+ notFoundPaths?: string[];
118
+ /** Slot-root-relative tree positions aligned with notFoundPaths. */
119
+ notFoundTreePositions?: number[];
92
120
  /** Intercepting routes within this slot */
93
121
  interceptingRoutes: InterceptingRoute[];
94
122
  /**
@@ -191,6 +219,18 @@ export type AppRoute = {
191
219
  unauthorizedTreePosition?: number | null;
192
220
  /** Unauthorized component paths per layout level (aligned with layouts array). */
193
221
  unauthorizedPaths: (string | null)[];
222
+ /**
223
+ * Not-found, forbidden and unauthorized component paths for every segment
224
+ * from app/ to the route's directory, including segments without a layout,
225
+ * aligned with the matching tree positions. A layout's notFound() is caught
226
+ * by the deepest of these above the layout's own segment.
227
+ */
228
+ segmentNotFoundPaths?: string[];
229
+ segmentNotFoundTreePositions?: number[];
230
+ segmentForbiddenPaths?: string[];
231
+ segmentForbiddenTreePositions?: number[];
232
+ segmentUnauthorizedPaths?: string[];
233
+ segmentUnauthorizedTreePositions?: number[];
194
234
  /**
195
235
  * Filesystem segments from app/ root to the route's directory.
196
236
  * Includes route groups and dynamic segments (as template strings like "[id]").
@@ -275,7 +315,7 @@ type RouteManifestRouteHandler = {
275
315
  routeId: string;
276
316
  pattern: string;
277
317
  };
278
- type RouteManifestLayout = {
318
+ export type RouteManifestLayout = {
279
319
  id: string;
280
320
  treePath: string;
281
321
  patternParts: readonly string[];
@@ -131,7 +131,7 @@ function createStaticSegmentGraph(routes) {
131
131
  treePath
132
132
  });
133
133
  }
134
- addRouteManifestSegmentErrorBoundaryFacts({
134
+ addRouteManifestSegmentBoundaryFacts({
135
135
  boundaries,
136
136
  route
137
137
  });
@@ -303,19 +303,42 @@ function addRouteManifestBoundaryFacts(input) {
303
303
  addRouteManifestBoundaryFact(input, "forbidden", input.route.forbiddenPaths[input.layoutIndex]);
304
304
  addRouteManifestBoundaryFact(input, "unauthorized", input.route.unauthorizedPaths[input.layoutIndex]);
305
305
  }
306
- function addRouteManifestSegmentErrorBoundaryFacts(input) {
307
- for (const [index, boundaryPath] of (input.route.errorPaths ?? []).entries()) {
308
- const treePosition = input.route.errorTreePositions?.[index];
309
- assertRouteManifestBoundaryTreePosition(input.route, boundaryPath, treePosition);
310
- const ownerLayoutId = findRouteManifestOwnerLayoutId(input.route, treePosition);
306
+ function addRouteManifestSegmentBoundaryFacts(input) {
307
+ const { route } = input;
308
+ const segmentBoundaries = [
309
+ [
310
+ "error",
311
+ route.errorPaths,
312
+ route.errorTreePositions
313
+ ],
314
+ [
315
+ "notFound",
316
+ route.segmentNotFoundPaths,
317
+ route.segmentNotFoundTreePositions
318
+ ],
319
+ [
320
+ "forbidden",
321
+ route.segmentForbiddenPaths,
322
+ route.segmentForbiddenTreePositions
323
+ ],
324
+ [
325
+ "unauthorized",
326
+ route.segmentUnauthorizedPaths,
327
+ route.segmentUnauthorizedTreePositions
328
+ ]
329
+ ];
330
+ for (const [outcome, boundaryPaths, treePositions] of segmentBoundaries) for (const [index, boundaryPath] of (boundaryPaths ?? []).entries()) {
331
+ const treePosition = treePositions?.[index];
332
+ assertRouteManifestBoundaryTreePosition(route, boundaryPath, treePosition);
333
+ const ownerLayoutId = findRouteManifestOwnerLayoutId(route, treePosition);
311
334
  if (ownerLayoutId !== null) continue;
312
- const treePath = createAppRouteGraphTreePath(input.route.routeSegments, treePosition);
335
+ const treePath = createAppRouteGraphTreePath(route.routeSegments, treePosition);
313
336
  addRouteManifestBoundaryFact({
314
337
  boundaries: input.boundaries,
315
- route: input.route,
338
+ route,
316
339
  layoutId: ownerLayoutId,
317
340
  treePath
318
- }, "error", boundaryPath);
341
+ }, outcome, boundaryPath);
319
342
  }
320
343
  }
321
344
  function addRouteManifestBoundaryFact(input, outcome, boundaryPath) {
@@ -458,14 +481,11 @@ function discoverSlotSubRoutes(routes, matcher, ghostParents = []) {
458
481
  const subPage = slotPages.get(slot.key);
459
482
  if (subPage !== void 0) {
460
483
  const configLayoutPaths = findSlotConfigLayoutPaths(slot.ownerDir, subPage, matcher);
461
- const notFoundBoundary = findSlotNotFoundBoundary(slot.ownerDir, subPage, matcher);
462
484
  return withSlotLoadingEntries({
463
485
  ...slot,
464
486
  pagePath: subPage,
465
487
  configLayoutPaths,
466
488
  configLayoutTreePositions: findSlotConfigLayoutTreePositions(slot.ownerDir, configLayoutPaths),
467
- notFoundPath: notFoundBoundary.path,
468
- notFoundTreePosition: notFoundBoundary.treePosition,
469
489
  routeSegments: rawSegments
470
490
  }, subPage, matcher);
471
491
  }
@@ -547,14 +567,11 @@ function discoverSlotSubRoutes(routes, matcher, ghostParents = []) {
547
567
  const subSlots = parentRoute.parallelSlots.map((slot) => {
548
568
  const subPage = slotPages.get(slot.key);
549
569
  const configLayoutPaths = findSlotConfigLayoutPaths(slot.ownerDir, subPage ?? null, matcher);
550
- const notFoundBoundary = findSlotNotFoundBoundary(slot.ownerDir, subPage ?? null, matcher);
551
570
  return withSlotLoadingEntries({
552
571
  ...slot,
553
572
  pagePath: subPage || null,
554
573
  configLayoutPaths,
555
574
  configLayoutTreePositions: findSlotConfigLayoutTreePositions(slot.ownerDir, configLayoutPaths),
556
- notFoundPath: notFoundBoundary.path,
557
- notFoundTreePosition: notFoundBoundary.treePosition,
558
575
  routeSegments: subPage ? rawSegments : null
559
576
  }, subPage ?? null, matcher);
560
577
  });
@@ -593,6 +610,12 @@ function discoverSlotSubRoutes(routes, matcher, ghostParents = []) {
593
610
  unauthorizedPath: parentRoute.unauthorizedPath,
594
611
  unauthorizedTreePosition: parentRoute.unauthorizedTreePosition,
595
612
  unauthorizedPaths: parentRoute.unauthorizedPaths,
613
+ segmentNotFoundPaths: parentRoute.segmentNotFoundPaths,
614
+ segmentNotFoundTreePositions: parentRoute.segmentNotFoundTreePositions,
615
+ segmentForbiddenPaths: parentRoute.segmentForbiddenPaths,
616
+ segmentForbiddenTreePositions: parentRoute.segmentForbiddenTreePositions,
617
+ segmentUnauthorizedPaths: parentRoute.segmentUnauthorizedPaths,
618
+ segmentUnauthorizedTreePositions: parentRoute.segmentUnauthorizedTreePositions,
596
619
  routeSegments: [...parentRoute.routeSegments, ...rawSegments],
597
620
  childrenRouteSegments: childrenDefault ? parentRoute.routeSegments : void 0,
598
621
  templateTreePositions: parentRoute.templateTreePositions,
@@ -680,52 +703,52 @@ function findSlotConfigLayoutTreePositions(slotDir, layoutPaths) {
680
703
  });
681
704
  }
682
705
  function findSlotLoadingEntries(slotDir, pagePath, matcher) {
706
+ return findSlotSegmentFileEntries(slotDir, pagePath, "loading", matcher);
707
+ }
708
+ /** Find a convention file in each directory from the slot root to the page, outermost first. */
709
+ function findSlotSegmentFileEntries(slotDir, pagePath, fileName, matcher) {
683
710
  const pageDir = pagePath ? path.dirname(pagePath) : slotDir;
684
711
  if (pageDir !== slotDir && !pageDir.startsWith(`${slotDir}${path.sep}`)) return [];
685
712
  const relativeDir = path.relative(slotDir, pageDir);
686
713
  const segments = relativeDir ? relativeDir.split(path.sep).filter(Boolean) : [];
687
- const loadings = [];
714
+ const entries = [];
688
715
  let currentDir = slotDir;
689
- const rootLoading = findFile(currentDir, "loading", matcher);
690
- if (rootLoading) loadings.push({
691
- path: rootLoading,
716
+ const rootEntry = findFile(currentDir, fileName, matcher);
717
+ if (rootEntry) entries.push({
718
+ path: rootEntry,
692
719
  treePosition: 0
693
720
  });
694
721
  for (let index = 0; index < segments.length; index++) {
695
722
  currentDir = path.join(currentDir, segments[index]);
696
- const loading = findFile(currentDir, "loading", matcher);
697
- if (loading) loadings.push({
698
- path: loading,
723
+ const entry = findFile(currentDir, fileName, matcher);
724
+ if (entry) entries.push({
725
+ path: entry,
699
726
  treePosition: index + 1
700
727
  });
701
728
  }
702
- return loadings;
729
+ return entries;
703
730
  }
704
731
  function withSlotLoadingEntries(slot, pagePath, matcher) {
705
732
  const loadingEntries = findSlotLoadingEntries(slot.ownerDir, pagePath, matcher);
706
733
  return {
707
734
  ...slot,
708
735
  loadingPaths: loadingEntries.map((entry) => entry.path),
709
- loadingTreePositions: loadingEntries.map((entry) => entry.treePosition)
736
+ loadingTreePositions: loadingEntries.map((entry) => entry.treePosition),
737
+ ...findSlotNotFoundFields(slot.ownerDir, pagePath, matcher)
710
738
  };
711
739
  }
712
- function findSlotNotFoundBoundary(slotDir, pagePath, matcher) {
713
- let dir = pagePath ? path.dirname(pagePath) : slotDir;
714
- while (dir === slotDir || dir.startsWith(`${slotDir}${path.sep}`)) {
715
- const boundaryPath = findFile(dir, "not-found", matcher);
716
- if (boundaryPath) {
717
- const relativeDir = path.relative(slotDir, dir);
718
- return {
719
- path: boundaryPath,
720
- treePosition: relativeDir ? relativeDir.split(path.sep).filter(Boolean).length : 0
721
- };
722
- }
723
- if (dir === slotDir) break;
724
- dir = path.dirname(dir);
725
- }
740
+ /**
741
+ * Every not-found convention on the slot's active branch, plus the nearest one,
742
+ * which supplies the slot's not-found metadata.
743
+ */
744
+ function findSlotNotFoundFields(slotDir, pagePath, matcher) {
745
+ const entries = findSlotSegmentFileEntries(slotDir, pagePath, "not-found", matcher);
746
+ const nearest = entries.at(-1);
726
747
  return {
727
- path: null,
728
- treePosition: null
748
+ notFoundPath: nearest?.path ?? null,
749
+ notFoundTreePosition: nearest?.treePosition ?? null,
750
+ notFoundPaths: entries.map((entry) => entry.path),
751
+ notFoundTreePositions: entries.map((entry) => entry.treePosition)
729
752
  };
730
753
  }
731
754
  /**
@@ -801,6 +824,10 @@ function directoryToAppRoute(dir, appDir, matcher, pagePath, routePath, includeN
801
824
  const notFoundPaths = discoverBoundaryFilePerLayout(layouts, "not-found", matcher);
802
825
  const forbiddenPaths = discoverBoundaryFilePerLayout(layouts, "forbidden", matcher);
803
826
  const unauthorizedPaths = discoverBoundaryFilePerLayout(layouts, "unauthorized", matcher);
827
+ const discoverPageSegmentBoundaryFiles = (fileName) => pagePath === null && routePath !== null ? [] : discoverSegmentBoundaryFiles(segments, appDir, fileName, matcher);
828
+ const segmentNotFounds = discoverPageSegmentBoundaryFiles("not-found");
829
+ const segmentForbiddens = discoverPageSegmentBoundaryFiles("forbidden");
830
+ const segmentUnauthorizeds = discoverPageSegmentBoundaryFiles("unauthorized");
804
831
  const parallelSlots = discoverInheritedParallelSlots(segments, appDir, routeDir, matcher, includeNestedOnlySlots);
805
832
  return {
806
833
  ids: createAppRouteSemanticIds({
@@ -833,6 +860,12 @@ function directoryToAppRoute(dir, appDir, matcher, pagePath, routePath, includeN
833
860
  forbiddenTreePosition: forbiddenEntry?.treePosition ?? null,
834
861
  unauthorizedPath,
835
862
  unauthorizedTreePosition: unauthorizedEntry?.treePosition ?? null,
863
+ segmentNotFoundPaths: segmentNotFounds.map((entry) => entry.path),
864
+ segmentNotFoundTreePositions: segmentNotFounds.map((entry) => entry.treePosition),
865
+ segmentForbiddenPaths: segmentForbiddens.map((entry) => entry.path),
866
+ segmentForbiddenTreePositions: segmentForbiddens.map((entry) => entry.treePosition),
867
+ segmentUnauthorizedPaths: segmentUnauthorizeds.map((entry) => entry.path),
868
+ segmentUnauthorizedTreePositions: segmentUnauthorizeds.map((entry) => entry.treePosition),
836
869
  unauthorizedPaths,
837
870
  routeSegments: segments,
838
871
  templateTreePositions,
@@ -1034,6 +1067,24 @@ function discoverBoundaryFileEntry(segments, appDir, fileName, matcher) {
1034
1067
  return null;
1035
1068
  }
1036
1069
  /**
1070
+ * Discover boundary files (not-found, forbidden, unauthorized) by segment tree
1071
+ * position. As with error.tsx, Next.js wraps each segment's children in its
1072
+ * boundary whether or not the segment has a layout.
1073
+ */
1074
+ function discoverSegmentBoundaryFiles(segments, appDir, fileName, matcher) {
1075
+ const boundaries = [];
1076
+ let currentDir = appDir;
1077
+ for (let index = 0; index <= segments.length; index++) {
1078
+ if (index > 0) currentDir = path.join(currentDir, segments[index - 1]);
1079
+ const boundary = findFile(currentDir, fileName, matcher);
1080
+ if (boundary) boundaries.push({
1081
+ path: boundary,
1082
+ treePosition: index
1083
+ });
1084
+ }
1085
+ return boundaries;
1086
+ }
1087
+ /**
1037
1088
  * Discover boundary files (not-found, forbidden, unauthorized) at each layout directory.
1038
1089
  * Returns an array aligned with the layouts array, where each entry is the boundary
1039
1090
  * file at that layout's directory, or null if none exists there.
@@ -1271,7 +1322,6 @@ function discoverParallelSlots(dir, appDir, matcher, includeNestedOnlySlots = fa
1271
1322
  const ownerTreePath = createAppRouteGraphTreePath(ownerSegments, ownerSegments.length);
1272
1323
  const configLayoutPaths = findSlotConfigLayoutPaths(slotDir, pagePath, matcher);
1273
1324
  const loadingEntries = findSlotLoadingEntries(slotDir, pagePath, matcher);
1274
- const notFoundBoundary = findSlotNotFoundBoundary(slotDir, pagePath, matcher);
1275
1325
  slots.push({
1276
1326
  id: createAppRouteGraphSlotId(slotName, ownerTreePath),
1277
1327
  key: `${slotName}@${path.relative(appDir, slotDir)}`,
@@ -1289,8 +1339,7 @@ function discoverParallelSlots(dir, appDir, matcher, includeNestedOnlySlots = fa
1289
1339
  loadingPaths: loadingEntries.map((loading) => loading.path),
1290
1340
  loadingTreePositions: loadingEntries.map((loading) => loading.treePosition),
1291
1341
  errorPath: findFile(slotDir, "error", matcher),
1292
- notFoundPath: notFoundBoundary.path,
1293
- notFoundTreePosition: notFoundBoundary.treePosition,
1342
+ ...findSlotNotFoundFields(slotDir, pagePath, matcher),
1294
1343
  interceptingRoutes,
1295
1344
  layoutIndex: -1,
1296
1345
  routeSegments: pagePath ? [] : null
@@ -1440,7 +1489,7 @@ function findOwnerRouteForDir(dir, appDir, routes, routesByDir) {
1440
1489
  * Recursively scan a directory tree for page.tsx files that are inside
1441
1490
  * intercepting route directories.
1442
1491
  */
1443
- function scanForInterceptingPages(currentDir, slotRootDir, routeDir, appDir, results, matcher, parentLoadingEntries = []) {
1492
+ function scanForInterceptingPages(currentDir, slotRootDir, routeDir, appDir, results, matcher, parentLoadingEntries = [], parentLayoutPaths = []) {
1444
1493
  if (!fs.existsSync(currentDir)) return;
1445
1494
  const entries = fs.readdirSync(currentDir, { withFileTypes: true });
1446
1495
  for (const entry of entries) {
@@ -1450,13 +1499,14 @@ function scanForInterceptingPages(currentDir, slotRootDir, routeDir, appDir, res
1450
1499
  const interceptDir = path.join(currentDir, entry.name);
1451
1500
  if (interceptMatch) {
1452
1501
  const restOfName = entry.name.slice(interceptMatch.prefix.length);
1453
- collectInterceptingPages(interceptDir, interceptDir, interceptMatch.convention, restOfName, routeDir, appDir, currentDir, slotRootDir, results, matcher, [], parentLoadingEntries, path.relative(slotRootDir, currentDir).split(path.sep).filter(Boolean).length);
1502
+ collectInterceptingPages(interceptDir, interceptDir, interceptMatch.convention, restOfName, routeDir, appDir, currentDir, slotRootDir, results, matcher, parentLayoutPaths, parentLoadingEntries, path.relative(slotRootDir, currentDir).split(path.sep).filter(Boolean).length);
1454
1503
  } else {
1504
+ const layout = findFile(interceptDir, "layout", matcher);
1455
1505
  const loading = findFile(interceptDir, "loading", matcher);
1456
1506
  scanForInterceptingPages(interceptDir, slotRootDir, routeDir, appDir, results, matcher, loading ? [...parentLoadingEntries, {
1457
1507
  path: loading,
1458
1508
  treePosition: path.relative(slotRootDir, interceptDir).split(path.sep).filter(Boolean).length
1459
- }] : parentLoadingEntries);
1509
+ }] : parentLoadingEntries, layout ? [...parentLayoutPaths, layout] : parentLayoutPaths);
1460
1510
  }
1461
1511
  }
1462
1512
  }
@@ -1486,7 +1536,15 @@ function collectInterceptingPages(currentDir, interceptRoot, convention, interce
1486
1536
  const targetPattern = computeInterceptTarget(convention, interceptSegment, currentDir, interceptRoot, routeDir, appDir);
1487
1537
  if (targetPattern) {
1488
1538
  const sourceMatchPattern = computeInterceptSourceMatchPattern(interceptParentDir, appDir);
1489
- const notFoundBoundary = findSlotNotFoundBoundary(slotRootDir ?? interceptRoot, page, matcher);
1539
+ const notFoundTreePositionOffset = slotRootDir ? 0 : 1;
1540
+ const notFoundFields = findSlotNotFoundFields(slotRootDir ?? interceptRoot, page, matcher);
1541
+ const findInterceptBoundaries = (fileName) => findSlotSegmentFileEntries(slotRootDir ?? interceptRoot, page, fileName, matcher).map((entry) => ({
1542
+ path: entry.path,
1543
+ treePosition: entry.treePosition + notFoundTreePositionOffset
1544
+ }));
1545
+ const forbiddenBoundaries = findInterceptBoundaries("forbidden");
1546
+ const unauthorizedBoundaries = findInterceptBoundaries("unauthorized");
1547
+ const errorBoundaries = findInterceptBoundaries("error");
1490
1548
  const slotParentSegments = slotRootDir ? path.relative(slotRootDir, interceptParentDir).split(path.sep).filter(Boolean) : [];
1491
1549
  const branchSegments = [
1492
1550
  ...slotParentSegments,
@@ -1498,7 +1556,9 @@ function collectInterceptingPages(currentDir, interceptRoot, convention, interce
1498
1556
  convention,
1499
1557
  layoutPaths: [...layoutPaths],
1500
1558
  layoutSegments: layoutPaths.map((layoutPath) => {
1501
- const relativeDir = path.relative(interceptRoot, path.dirname(layoutPath));
1559
+ const layoutDir = path.dirname(layoutPath);
1560
+ if (slotRootDir && layoutDir !== interceptRoot && !layoutDir.startsWith(`${interceptRoot}${path.sep}`)) return path.relative(slotRootDir, layoutDir).split(path.sep).filter(Boolean);
1561
+ const relativeDir = path.relative(interceptRoot, layoutDir);
1502
1562
  return [
1503
1563
  ...slotParentSegments,
1504
1564
  interceptSegment,
@@ -1508,8 +1568,20 @@ function collectInterceptingPages(currentDir, interceptRoot, convention, interce
1508
1568
  loadingPaths: loadingEntries.map((loading) => loading.path),
1509
1569
  loadingTreePositions: loadingEntries.map((loading) => loading.treePosition),
1510
1570
  notFoundBranchSegments: branchSegments,
1511
- notFoundPath: notFoundBoundary.path,
1512
- notFoundTreePosition: notFoundBoundary.treePosition === null ? null : slotRootDir ? notFoundBoundary.treePosition : notFoundBoundary.treePosition + 1,
1571
+ notFoundPath: notFoundFields.notFoundPath,
1572
+ notFoundTreePosition: notFoundFields.notFoundTreePosition == null ? null : notFoundFields.notFoundTreePosition + notFoundTreePositionOffset,
1573
+ notFoundPaths: notFoundFields.notFoundPaths,
1574
+ notFoundTreePositions: notFoundFields.notFoundTreePositions?.map((treePosition) => treePosition + notFoundTreePositionOffset),
1575
+ forbiddenPath: forbiddenBoundaries.at(-1)?.path ?? null,
1576
+ forbiddenTreePosition: forbiddenBoundaries.at(-1)?.treePosition ?? null,
1577
+ forbiddenPaths: forbiddenBoundaries.map((boundary) => boundary.path),
1578
+ forbiddenTreePositions: forbiddenBoundaries.map((boundary) => boundary.treePosition),
1579
+ unauthorizedPath: unauthorizedBoundaries.at(-1)?.path ?? null,
1580
+ unauthorizedTreePosition: unauthorizedBoundaries.at(-1)?.treePosition ?? null,
1581
+ unauthorizedPaths: unauthorizedBoundaries.map((boundary) => boundary.path),
1582
+ unauthorizedTreePositions: unauthorizedBoundaries.map((boundary) => boundary.treePosition),
1583
+ errorPaths: errorBoundaries.map((boundary) => boundary.path),
1584
+ errorTreePositions: errorBoundaries.map((boundary) => boundary.treePosition),
1513
1585
  targetPattern: targetPattern.pattern,
1514
1586
  sourceMatchPattern,
1515
1587
  pagePath: page,
@@ -0,0 +1,44 @@
1
+ import { GraphVersion, RouteManifest, RouteManifestInterception, RouteManifestLayout, RouteManifestRootBoundary, RouteManifestRoute, RouteManifestSlotBinding } from "./app-route-graph.js";
2
+ //#region src/routing/browser-route-manifest.d.ts
3
+ export type BrowserRouteManifestRoute = Pick<RouteManifestRoute, "id" | "patternParts" | "isDynamic" | "paramNames" | "rootBoundaryId" | "pageId" | "layoutIds" | "slotIds">;
4
+ type BrowserRouteManifestLayout = Pick<RouteManifestLayout, "id" | "patternParts" | "rootBoundaryId">;
5
+ type BrowserRouteManifestSlotBinding = Pick<RouteManifestSlotBinding, "id" | "routeId" | "slotId" | "ownerLayoutId" | "state" | "routeSegments" | "slotPatternParts" | "slotParamNames">;
6
+ export type BrowserRouteManifestInterception = Pick<RouteManifestInterception, "id" | "sourcePatternParts" | "targetPatternParts" | "slotId" | "ownerLayoutId" | "targetRouteId">;
7
+ type BrowserRouteManifestRootBoundary = Pick<RouteManifestRootBoundary, "id" | "treePath">;
8
+ /**
9
+ * The part of the RouteManifest the browser navigation runtime reads: the
10
+ * maps and fields the navigation planner, optimistic routing and interception
11
+ * context resolution use.
12
+ */
13
+ export type BrowserRouteManifest = {
14
+ graphVersion: GraphVersion;
15
+ segmentGraph: {
16
+ routes: ReadonlyMap<string, BrowserRouteManifestRoute>;
17
+ layouts: ReadonlyMap<string, BrowserRouteManifestLayout>;
18
+ slotBindings: ReadonlyMap<string, BrowserRouteManifestSlotBinding>;
19
+ interceptions: ReadonlyMap<string, BrowserRouteManifestInterception>;
20
+ interceptionsBySlotId: ReadonlyMap<string, readonly BrowserRouteManifestInterception[]>;
21
+ rootBoundaries: ReadonlyMap<string, BrowserRouteManifestRootBoundary>;
22
+ };
23
+ };
24
+ /**
25
+ * JSON form of `BrowserRouteManifest`. Every map is keyed by its values' `id`,
26
+ * so maps travel as arrays of values in map order. A route omits `id` when it
27
+ * is `route:` plus its pattern, and `interceptionsBySlotId` lists interception
28
+ * ids instead of repeating the interceptions.
29
+ */
30
+ export type BrowserRouteManifestWire = {
31
+ graphVersion: string;
32
+ routes: (Omit<BrowserRouteManifestRoute, "id"> & {
33
+ id?: string;
34
+ })[];
35
+ layouts: BrowserRouteManifestLayout[];
36
+ slotBindings: BrowserRouteManifestSlotBinding[];
37
+ interceptions: BrowserRouteManifestInterception[];
38
+ interceptionsBySlotId: [slotId: string, interceptionIds: string[]][];
39
+ rootBoundaries: BrowserRouteManifestRootBoundary[];
40
+ };
41
+ export declare function toBrowserRouteManifestWire(routeManifest: RouteManifest): BrowserRouteManifestWire;
42
+ export declare function decodeBrowserRouteManifest(wire: BrowserRouteManifestWire): BrowserRouteManifest;
43
+ //#endregion
44
+ export {};
@@ -0,0 +1,195 @@
1
+ import { buildOptimisticRouteTrie } from "./optimistic-route-trie.js";
2
+ //#region src/routing/browser-route-manifest.ts
3
+ function createRouteIdFromPatternParts(patternParts) {
4
+ return `route:/${patternParts.join("/")}`;
5
+ }
6
+ /**
7
+ * Route matching precedence of one pattern part, lower wins: the URL ending
8
+ * here, then a static, dynamic, catch-all and optional catch-all part.
9
+ */
10
+ function patternPartRank(part) {
11
+ if (part === void 0) return 0;
12
+ if (!part.startsWith(":")) return 1;
13
+ if (part.endsWith("+")) return 3;
14
+ if (part.endsWith("*")) return 4;
15
+ return 2;
16
+ }
17
+ /**
18
+ * Whether the router sends a URL pathname that both patterns match to the
19
+ * route handler: it wins at the first part whose kind differs. Two patterns
20
+ * that never differ would be the same route shape, which cannot hold both a
21
+ * handler and a page.
22
+ */
23
+ function routeHandlerOutranks(handler, rendered) {
24
+ for (let index = 0;; index++) {
25
+ const handlerRank = patternPartRank(handler[index]);
26
+ const renderedRank = patternPartRank(rendered[index]);
27
+ if (handlerRank !== renderedRank) return handlerRank < renderedRank;
28
+ if (handlerRank === 0 || handlerRank >= 3) return false;
29
+ }
30
+ }
31
+ /**
32
+ * Whether the optimistic trie of the rendered routes predicts a rendered
33
+ * route that the route handler outranks for some URL pathname the handler
34
+ * pattern matches. The trie match descends one path and only backtracks to a
35
+ * catch-all on its way up, so this follows that path for every URL: a param
36
+ * segment either names one of the node's static children or none of them,
37
+ * and a catch-all takes any number of such segments.
38
+ */
39
+ function triePredictsOutrankedRoute(trie, handler) {
40
+ const lastPart = handler.at(-1);
41
+ const isCatchAll = lastPart?.startsWith(":") === true && /[+*]$/.test(lastPart);
42
+ const fixedLength = isCatchAll ? handler.length - 1 : handler.length;
43
+ const minLength = lastPart?.endsWith("+") === true ? handler.length : fixedLength;
44
+ const predict = (route) => route === null ? {
45
+ outranked: false,
46
+ unmatched: true
47
+ } : {
48
+ outranked: routeHandlerOutranks(handler, route.patternParts),
49
+ unmatched: false
50
+ };
51
+ const afterOtherSegment = (node, depth) => {
52
+ const dynamic = node.dynamicChild ? predictFrom(node.dynamicChild.node, depth) : {
53
+ outranked: false,
54
+ unmatched: true
55
+ };
56
+ if (!dynamic.unmatched) return dynamic;
57
+ const fallback = predict(node.catchAllChild?.route ?? node.optionalCatchAllChild?.route ?? null);
58
+ return {
59
+ outranked: dynamic.outranked || fallback.outranked,
60
+ unmatched: fallback.unmatched
61
+ };
62
+ };
63
+ const predictFrom = (node, depth) => {
64
+ const predictions = {
65
+ outranked: false,
66
+ unmatched: false
67
+ };
68
+ const add = (more) => {
69
+ predictions.outranked ||= more.outranked;
70
+ predictions.unmatched ||= more.unmatched;
71
+ };
72
+ if (isCatchAll ? depth >= minLength : depth === fixedLength) add(predict(node.route ?? node.optionalCatchAllChild?.route ?? null));
73
+ if (depth < fixedLength && !handler[depth].startsWith(":")) {
74
+ const child = node.staticChildren.get(handler[depth]);
75
+ add(child ? predictFrom(child, depth + 1) : afterOtherSegment(node, depth + 1));
76
+ } else if (depth < fixedLength || isCatchAll) {
77
+ for (const child of node.staticChildren.values()) add(predictFrom(child, depth + 1));
78
+ add(afterOtherSegment(node, depth + 1));
79
+ }
80
+ return predictions;
81
+ };
82
+ return predictFrom(trie, 0).outranked;
83
+ }
84
+ /**
85
+ * The browser only needs a route handler where the optimistic route trie of
86
+ * the rendered routes would predict a route the handler outranks: the matcher
87
+ * must find the handler there instead of rendering that route's shell. Any
88
+ * other handler URL matches no rendered route on the client, or one the
89
+ * router prefers, and its non-Flight response already turns the navigation
90
+ * into a document load, so shipping its path would only publish the app's
91
+ * API surface (issue #3624).
92
+ */
93
+ function selectBrowserRoutes(routes) {
94
+ const allRoutes = [...routes];
95
+ const renderedTrie = buildOptimisticRouteTrie(allRoutes.filter((route) => route.routeHandlerId === null));
96
+ return allRoutes.filter((route) => route.routeHandlerId === null || triePredictsOutrankedRoute(renderedTrie, route.patternParts));
97
+ }
98
+ /**
99
+ * The graph records the browser receives: the shipped routes, the rendered
100
+ * routes' slot bindings, and the layouts and root boundaries those and the
101
+ * interceptions reach. A shipped route handler only stops an optimistic
102
+ * match, and its non-Flight response never renders a tree, so it ships as a
103
+ * bare pattern; its layouts, slots and root boundary would only name its
104
+ * directories.
105
+ */
106
+ function selectBrowserGraph(graph) {
107
+ const routes = selectBrowserRoutes(graph.routes.values()).map((route) => route.routeHandlerId === null ? route : {
108
+ ...route,
109
+ layoutIds: [],
110
+ rootBoundaryId: null,
111
+ slotIds: []
112
+ });
113
+ const renderedRouteIds = new Set(routes.filter((route) => route.routeHandlerId === null).map((route) => route.id));
114
+ const slotBindings = [...graph.slotBindings.values()].filter((binding) => renderedRouteIds.has(binding.routeId));
115
+ const layoutIds = /* @__PURE__ */ new Set([
116
+ ...routes.flatMap((route) => route.layoutIds),
117
+ ...slotBindings.flatMap((binding) => binding.ownerLayoutId ?? []),
118
+ ...[...graph.interceptions.values()].flatMap((interception) => interception.ownerLayoutId ?? [])
119
+ ]);
120
+ const layouts = [...graph.layouts.values()].filter((layout) => layoutIds.has(layout.id));
121
+ const rootBoundaryIds = new Set([...routes, ...layouts].flatMap((record) => record.rootBoundaryId ?? []));
122
+ return {
123
+ routes,
124
+ layouts,
125
+ slotBindings,
126
+ rootBoundaries: [...graph.rootBoundaries.values()].filter((rootBoundary) => rootBoundaryIds.has(rootBoundary.id))
127
+ };
128
+ }
129
+ function toBrowserRouteManifestWire(routeManifest) {
130
+ const graph = routeManifest.segmentGraph;
131
+ const browserGraph = selectBrowserGraph(graph);
132
+ return {
133
+ graphVersion: routeManifest.graphVersion,
134
+ routes: browserGraph.routes.map((route) => ({
135
+ ...route.id === createRouteIdFromPatternParts(route.patternParts) ? {} : { id: route.id },
136
+ patternParts: route.patternParts,
137
+ isDynamic: route.isDynamic,
138
+ paramNames: route.paramNames,
139
+ rootBoundaryId: route.rootBoundaryId,
140
+ pageId: route.pageId,
141
+ layoutIds: route.layoutIds,
142
+ slotIds: route.slotIds
143
+ })),
144
+ layouts: browserGraph.layouts.map((layout) => ({
145
+ id: layout.id,
146
+ patternParts: layout.patternParts,
147
+ rootBoundaryId: layout.rootBoundaryId
148
+ })),
149
+ slotBindings: browserGraph.slotBindings.map((binding) => ({
150
+ id: binding.id,
151
+ routeId: binding.routeId,
152
+ slotId: binding.slotId,
153
+ ownerLayoutId: binding.ownerLayoutId,
154
+ state: binding.state,
155
+ routeSegments: binding.routeSegments,
156
+ slotPatternParts: binding.slotPatternParts,
157
+ slotParamNames: binding.slotParamNames
158
+ })),
159
+ interceptions: Array.from(graph.interceptions.values(), (interception) => ({
160
+ id: interception.id,
161
+ sourcePatternParts: interception.sourcePatternParts,
162
+ targetPatternParts: interception.targetPatternParts,
163
+ slotId: interception.slotId,
164
+ ownerLayoutId: interception.ownerLayoutId,
165
+ targetRouteId: interception.targetRouteId
166
+ })),
167
+ interceptionsBySlotId: Array.from(graph.interceptionsBySlotId, ([slotId, interceptions]) => [slotId, interceptions.map((interception) => interception.id)]),
168
+ rootBoundaries: browserGraph.rootBoundaries.map((rootBoundary) => ({
169
+ id: rootBoundary.id,
170
+ treePath: rootBoundary.treePath
171
+ }))
172
+ };
173
+ }
174
+ function mapById(values) {
175
+ return new Map(values.map((value) => [value.id, value]));
176
+ }
177
+ function decodeBrowserRouteManifest(wire) {
178
+ const interceptions = mapById(wire.interceptions);
179
+ return {
180
+ graphVersion: wire.graphVersion,
181
+ segmentGraph: {
182
+ routes: mapById(wire.routes.map((route) => ({
183
+ ...route,
184
+ id: route.id ?? createRouteIdFromPatternParts(route.patternParts)
185
+ }))),
186
+ layouts: mapById(wire.layouts),
187
+ slotBindings: mapById(wire.slotBindings),
188
+ interceptions,
189
+ interceptionsBySlotId: new Map(wire.interceptionsBySlotId.map(([slotId, interceptionIds]) => [slotId, interceptionIds.flatMap((id) => interceptions.get(id) ?? [])])),
190
+ rootBoundaries: mapById(wire.rootBoundaries)
191
+ }
192
+ };
193
+ }
194
+ //#endregion
195
+ export { decodeBrowserRouteManifest, toBrowserRouteManifestWire };
@@ -0,0 +1,4 @@
1
+ //#region src/routing/hashed-route-patterns.d.ts
2
+ export declare function hashRoutePatternParts(patternParts: readonly string[]): string[];
3
+ export declare function hashRoutePathname(pathname: string): string;
4
+ //#endregion