vinext 1.0.0-beta.0 → 1.0.0-beta.10

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 (879) hide show
  1. package/README.md +143 -19
  2. package/dist/build/action-owner-manifest.d.ts +41 -0
  3. package/dist/build/action-owner-manifest.js +110 -0
  4. package/dist/build/assets-ignore.d.ts +3 -4
  5. package/dist/build/assets-ignore.js +1 -1
  6. package/dist/build/clean-output.d.ts +2 -3
  7. package/dist/build/clean-output.js +2 -5
  8. package/dist/build/client-build-config.d.ts +39 -13
  9. package/dist/build/client-build-config.js +92 -16
  10. package/dist/build/css-url-assets.d.ts +4 -6
  11. package/dist/build/css-url-assets.js +8 -5
  12. package/dist/build/google-fonts/build-url.d.ts +8 -6
  13. package/dist/build/google-fonts/fallback-metrics.d.ts +3 -4
  14. package/dist/build/google-fonts/fallback-metrics.js +1 -1
  15. package/dist/build/google-fonts/find-font-files-in-css.d.ts +2 -3
  16. package/dist/build/google-fonts/font-metadata.d.ts +9 -6
  17. package/dist/build/google-fonts/font-metadata.js +1 -1
  18. package/dist/build/google-fonts/get-axes.d.ts +2 -4
  19. package/dist/build/google-fonts/sort-variants.d.ts +2 -3
  20. package/dist/build/google-fonts/validate.d.ts +2 -3
  21. package/dist/build/google-fonts/validate.js +8 -4
  22. package/dist/build/inject-pregenerated-paths.d.ts +2 -3
  23. package/dist/build/inject-pregenerated-paths.js +17 -15
  24. package/dist/build/inline-css.d.ts +3 -4
  25. package/dist/build/inline-css.js +2 -5
  26. package/dist/build/layout-classification-types.d.ts +4 -5
  27. package/dist/build/layout-classification.d.ts +14 -12
  28. package/dist/build/module-dependency-cache.d.ts +3 -0
  29. package/dist/build/module-dependency-cache.js +13 -0
  30. package/dist/build/next-client-runtime-manifests.d.ts +4 -6
  31. package/dist/build/next-client-runtime-manifests.js +3 -20
  32. package/dist/build/nitro-route-rules.d.ts +6 -8
  33. package/dist/build/pages-client-assets-module.d.ts +7 -9
  34. package/dist/build/pages-client-assets-module.js +1 -1
  35. package/dist/build/precompress.d.ts +9 -5
  36. package/dist/build/precompress.js +47 -13
  37. package/dist/build/prerender-paths.d.ts +69 -9
  38. package/dist/build/prerender-paths.js +708 -110
  39. package/dist/build/prerender-phase.d.ts +14 -0
  40. package/dist/build/prerender-phase.js +37 -0
  41. package/dist/build/prerender-server-entry.d.ts +1 -1
  42. package/dist/build/prerender-server-entry.js +8 -2
  43. package/dist/build/prerender-server-pool.d.ts +13 -8
  44. package/dist/build/prerender-server-pool.js +11 -6
  45. package/dist/build/prerender.d.ts +62 -42
  46. package/dist/build/prerender.js +171 -53
  47. package/dist/build/preview-credentials.d.ts +10 -0
  48. package/dist/build/preview-credentials.js +19 -0
  49. package/dist/build/public-dir-conflict.d.ts +13 -0
  50. package/dist/build/public-dir-conflict.js +26 -0
  51. package/dist/build/report.d.ts +42 -24
  52. package/dist/build/report.js +77 -8
  53. package/dist/build/route-classification-injector.d.ts +2 -4
  54. package/dist/build/route-classification-manifest.d.ts +11 -10
  55. package/dist/build/run-prerender.d.ts +14 -20
  56. package/dist/build/run-prerender.js +28 -26
  57. package/dist/build/server-entry.d.ts +4 -0
  58. package/dist/build/server-entry.js +28 -0
  59. package/dist/build/server-manifest.d.ts +8 -3
  60. package/dist/build/server-manifest.js +15 -3
  61. package/dist/build/ssr-manifest.d.ts +9 -6
  62. package/dist/build/ssr-manifest.js +10 -6
  63. package/dist/build/standalone.d.ts +2 -3
  64. package/dist/build/standalone.js +37 -37
  65. package/dist/build/static-export.d.ts +30 -20
  66. package/dist/cache/cache-adapters-virtual.d.ts +89 -27
  67. package/dist/cache/cache-adapters-virtual.js +54 -16
  68. package/dist/check.d.ts +9 -26
  69. package/dist/check.js +35 -40
  70. package/dist/cli-args.d.ts +4 -4
  71. package/dist/cli-args.js +10 -0
  72. package/dist/cli-dev-config.d.ts +5 -7
  73. package/dist/cli.d.ts +1 -1
  74. package/dist/cli.js +97 -65
  75. package/dist/client/app-nav-failure-handler.d.ts +6 -7
  76. package/dist/client/app-nav-failure-handler.js +1 -0
  77. package/dist/client/client-rewrite-matcher.d.ts +11 -0
  78. package/dist/client/client-rewrite-matcher.js +20 -0
  79. package/dist/client/client-rewrites.d.ts +30 -0
  80. package/dist/client/client-rewrites.js +41 -0
  81. package/dist/client/dev-error-overlay-store.d.ts +13 -14
  82. package/dist/client/dev-error-overlay.d.ts +15 -16
  83. package/dist/client/dev-error-overlay.js +7 -4
  84. package/dist/client/empty-module.d.ts +1 -1
  85. package/dist/client/index.d.ts +2 -0
  86. package/dist/client/index.js +2 -0
  87. package/dist/client/instrumentation-client-inject.d.ts +3 -4
  88. package/dist/client/instrumentation-client-inject.js +1 -1
  89. package/dist/client/instrumentation-client-state.d.ts +5 -7
  90. package/dist/client/instrumentation-client.d.ts +3 -4
  91. package/dist/client/navigation-runtime.d.ts +31 -19
  92. package/dist/client/navigation-runtime.js +8 -8
  93. package/dist/client/pages-router-link-navigation.d.ts +4 -23
  94. package/dist/client/pages-router-link-navigation.js +1 -1
  95. package/dist/client/react-instance-bootstrap.d.ts +1 -0
  96. package/dist/client/react-instance-bootstrap.js +7 -0
  97. package/dist/client/react-instance.d.ts +12 -0
  98. package/dist/client/react-instance.js +20 -0
  99. package/dist/client/validate-module-path.d.ts +2 -3
  100. package/dist/client/vinext-next-data.d.ts +20 -14
  101. package/dist/client/window-next.d.ts +9 -7
  102. package/dist/config/config-matchers.d.ts +27 -53
  103. package/dist/config/config-matchers.js +51 -134
  104. package/dist/config/dotenv.d.ts +5 -11
  105. package/dist/config/dotenv.js +33 -24
  106. package/dist/config/next-config.d.ts +145 -71
  107. package/dist/config/next-config.js +126 -28
  108. package/dist/config/prerender.d.ts +16 -17
  109. package/dist/config/prerender.js +9 -17
  110. package/dist/config/request-context.d.ts +13 -0
  111. package/dist/config/request-context.js +26 -0
  112. package/dist/config/server-external-packages.d.ts +2 -3
  113. package/dist/config/server-external-packages.js +1 -1
  114. package/dist/config/tsconfig-paths.d.ts +3 -4
  115. package/dist/config/tsconfig-paths.js +2 -2
  116. package/dist/{node_modules/.pnpm/am-i-vibing@0.5.0/node_modules → deps/.pnpm/am-i-vibing@0.5.0/deps}/am-i-vibing/dist/detector-1yx2Hoe0.js +2 -2
  117. package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +808 -0
  118. package/dist/deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js +50 -0
  119. package/dist/entries/app-browser-entry.d.ts +7 -15
  120. package/dist/entries/app-browser-entry.js +30 -8
  121. package/dist/entries/app-rsc-entry.d.ts +40 -20
  122. package/dist/entries/app-rsc-entry.js +534 -41
  123. package/dist/entries/app-rsc-manifest.d.ts +2 -4
  124. package/dist/entries/app-rsc-manifest.js +44 -5
  125. package/dist/entries/app-ssr-entry.d.ts +2 -3
  126. package/dist/entries/pages-client-entry.d.ts +3 -5
  127. package/dist/entries/pages-client-entry.js +21 -11
  128. package/dist/entries/pages-server-entry.d.ts +13 -5
  129. package/dist/entries/pages-server-entry.js +227 -54
  130. package/dist/entries/runtime-entry-module.d.ts +4 -5
  131. package/dist/entries/runtime-entry-module.js +2 -2
  132. package/dist/image/image-adapters-virtual.d.ts +8 -7
  133. package/dist/index.d.ts +7 -4
  134. package/dist/index.js +1141 -504
  135. package/dist/init-cloudflare.d.ts +19 -15
  136. package/dist/init-cloudflare.js +416 -59
  137. package/dist/init-platform.d.ts +24 -23
  138. package/dist/init-platform.js +71 -24
  139. package/dist/init.d.ts +52 -29
  140. package/dist/init.js +37 -30
  141. package/dist/plugins/action-owner-manifest.d.ts +13 -0
  142. package/dist/plugins/action-owner-manifest.js +91 -0
  143. package/dist/plugins/ast-scope.d.ts +10 -12
  144. package/dist/plugins/ast-scope.js +10 -22
  145. package/dist/plugins/ast-utils.d.ts +37 -21
  146. package/dist/plugins/ast-utils.js +70 -39
  147. package/dist/plugins/async-hooks-stub.d.ts +2 -4
  148. package/dist/plugins/client-reference-dedup.d.ts +4 -6
  149. package/dist/plugins/client-reference-dedup.js +7 -5
  150. package/dist/plugins/css-data-url.d.ts +2 -4
  151. package/dist/plugins/css-module-imports.d.ts +4 -6
  152. package/dist/plugins/css-module-imports.js +5 -13
  153. package/dist/plugins/dynamic-preload-metadata.d.ts +3 -5
  154. package/dist/plugins/dynamic-preload-metadata.js +65 -185
  155. package/dist/plugins/environment.d.ts +10 -0
  156. package/dist/plugins/environment.js +7 -0
  157. package/dist/plugins/extensionless-dynamic-import.d.ts +2 -4
  158. package/dist/plugins/extensionless-dynamic-import.js +379 -63
  159. package/dist/plugins/fonts.d.ts +10 -12
  160. package/dist/plugins/fonts.js +13 -16
  161. package/dist/plugins/ignore-dynamic-requests.d.ts +5 -9
  162. package/dist/plugins/ignore-dynamic-requests.js +116 -144
  163. package/dist/plugins/import-meta-url.d.ts +16 -12
  164. package/dist/plugins/import-meta-url.js +347 -124
  165. package/dist/plugins/instrumentation-client.d.ts +2 -4
  166. package/dist/plugins/instrumentation-client.js +4 -5
  167. package/dist/plugins/middleware-export-validation.d.ts +3 -4
  168. package/dist/plugins/middleware-export-validation.js +5 -17
  169. package/dist/plugins/middleware-server-only.d.ts +2 -4
  170. package/dist/plugins/middleware-server-only.js +3 -3
  171. package/dist/plugins/og-asset-ownership.d.ts +3 -5
  172. package/dist/plugins/og-asset-ownership.js +24 -31
  173. package/dist/plugins/og-assets.d.ts +4 -6
  174. package/dist/plugins/og-assets.js +7 -10
  175. package/dist/plugins/optimize-imports.d.ts +5 -7
  176. package/dist/plugins/optimize-imports.js +41 -58
  177. package/dist/plugins/pages-node-externals.d.ts +22 -0
  178. package/dist/plugins/pages-node-externals.js +174 -0
  179. package/dist/plugins/postcss.d.ts +3 -4
  180. package/dist/plugins/postcss.js +1 -1
  181. package/dist/plugins/remove-console.d.ts +2 -4
  182. package/dist/plugins/remove-console.js +3 -6
  183. package/dist/plugins/require-condition-resolution.d.ts +15 -0
  184. package/dist/plugins/require-condition-resolution.js +166 -0
  185. package/dist/plugins/require-context.d.ts +2 -4
  186. package/dist/plugins/require-context.js +163 -84
  187. package/dist/plugins/rsc-client-reference-loaders.d.ts +2 -4
  188. package/dist/plugins/rsc-client-shim-excludes.d.ts +4 -5
  189. package/dist/plugins/rsc-reference-validation-normalizer.d.ts +2 -4
  190. package/dist/plugins/sass.d.ts +34 -7
  191. package/dist/plugins/sass.js +75 -10
  192. package/dist/plugins/server-externals-manifest.d.ts +2 -4
  193. package/dist/plugins/server-externals-manifest.js +2 -24
  194. package/dist/plugins/strip-server-exports.d.ts +5 -7
  195. package/dist/plugins/strip-server-exports.js +14 -20
  196. package/dist/plugins/styled-jsx.d.ts +2 -4
  197. package/dist/plugins/styled-jsx.js +25 -26
  198. package/dist/plugins/transform-cache.d.ts +18 -0
  199. package/dist/plugins/transform-cache.js +36 -0
  200. package/dist/plugins/transform-result.d.ts +9 -0
  201. package/dist/plugins/transform-result.js +10 -0
  202. package/dist/plugins/transitive-externals.d.ts +23 -0
  203. package/dist/plugins/transitive-externals.js +107 -0
  204. package/dist/plugins/typeof-window.d.ts +11 -7
  205. package/dist/plugins/typeof-window.js +155 -38
  206. package/dist/plugins/use-cache-callable.d.ts +11 -0
  207. package/dist/plugins/use-cache-callable.js +202 -0
  208. package/dist/plugins/wasm-module-import.d.ts +2 -4
  209. package/dist/plugins/wasm-module-import.js +1 -1
  210. package/dist/plugins/worker-image-imports.d.ts +11 -0
  211. package/dist/plugins/worker-image-imports.js +134 -0
  212. package/dist/routing/app-route-graph.d.ts +138 -69
  213. package/dist/routing/app-route-graph.js +189 -99
  214. package/dist/routing/app-router.d.ts +7 -11
  215. package/dist/routing/app-router.js +17 -12
  216. package/dist/routing/file-matcher.d.ts +21 -37
  217. package/dist/routing/file-matcher.js +31 -44
  218. package/dist/routing/pages-router.d.ts +15 -11
  219. package/dist/routing/pages-router.js +26 -32
  220. package/dist/routing/route-matching.d.ts +16 -5
  221. package/dist/routing/route-matching.js +16 -2
  222. package/dist/routing/route-pattern.d.ts +19 -12
  223. package/dist/routing/route-pattern.js +33 -3
  224. package/dist/routing/route-trie.d.ts +8 -5
  225. package/dist/routing/route-trie.js +5 -2
  226. package/dist/routing/route-validation.d.ts +3 -4
  227. package/dist/routing/route-validation.js +19 -12
  228. package/dist/routing/utils.d.ts +13 -36
  229. package/dist/routing/utils.js +1 -30
  230. package/dist/server/accept-encoding.d.ts +9 -12
  231. package/dist/server/accept-encoding.js +1 -4
  232. package/dist/server/api-handler.d.ts +4 -4
  233. package/dist/server/api-handler.js +50 -40
  234. package/dist/server/app-action-forwarding.d.ts +17 -0
  235. package/dist/server/app-action-forwarding.js +140 -0
  236. package/dist/server/app-action-request.d.ts +2 -3
  237. package/dist/server/app-bfcache-id.d.ts +3 -4
  238. package/dist/server/app-bfcache-identity.d.ts +14 -16
  239. package/dist/server/app-bfcache-identity.js +27 -102
  240. package/dist/server/app-browser-action-result.d.ts +15 -17
  241. package/dist/server/app-browser-client-reuse-manifest.d.ts +2 -4
  242. package/dist/server/app-browser-entry.d.ts +1 -1
  243. package/dist/server/app-browser-entry.js +482 -147
  244. package/dist/server/app-browser-error.d.ts +5 -7
  245. package/dist/server/app-browser-error.js +1 -5
  246. package/dist/server/app-browser-history-controller.d.ts +29 -12
  247. package/dist/server/app-browser-history-controller.js +137 -20
  248. package/dist/server/app-browser-hydration.d.ts +5 -7
  249. package/dist/server/app-browser-interception-context.d.ts +3 -5
  250. package/dist/server/app-browser-mpa-navigation.d.ts +4 -6
  251. package/dist/server/app-browser-navigation-abort.d.ts +15 -0
  252. package/dist/server/app-browser-navigation-abort.js +29 -0
  253. package/dist/server/app-browser-navigation-controller.d.ts +36 -33
  254. package/dist/server/app-browser-navigation-controller.js +62 -16
  255. package/dist/server/app-browser-navigation-response.d.ts +10 -0
  256. package/dist/server/app-browser-navigation-response.js +8 -0
  257. package/dist/server/app-browser-popstate.d.ts +8 -5
  258. package/dist/server/app-browser-popstate.js +6 -2
  259. package/dist/server/app-browser-prefetch-response.d.ts +24 -0
  260. package/dist/server/app-browser-prefetch-response.js +54 -0
  261. package/dist/server/app-browser-rsc-redirect.d.ts +4 -5
  262. package/dist/server/app-browser-server-action-client.d.ts +5 -6
  263. package/dist/server/app-browser-server-action-client.js +7 -5
  264. package/dist/server/app-browser-server-action-navigation.d.ts +2 -4
  265. package/dist/server/app-browser-state.d.ts +26 -20
  266. package/dist/server/app-browser-state.js +15 -9
  267. package/dist/server/app-browser-stream.d.ts +4 -8
  268. package/dist/server/app-browser-stream.js +8 -6
  269. package/dist/server/app-browser-supplemental-refresh.d.ts +48 -0
  270. package/dist/server/app-browser-supplemental-refresh.js +190 -0
  271. package/dist/server/app-browser-visible-commit.d.ts +7 -8
  272. package/dist/server/app-browser-visible-commit.js +26 -11
  273. package/dist/server/app-client-reference-preloader.d.ts +2 -3
  274. package/dist/server/app-elements-wire-key.d.ts +25 -0
  275. package/dist/server/app-elements-wire-key.js +69 -0
  276. package/dist/server/app-elements-wire.d.ts +47 -60
  277. package/dist/server/app-elements-wire.js +43 -80
  278. package/dist/server/app-elements.d.ts +6 -7
  279. package/dist/server/app-elements.js +2 -2
  280. package/dist/server/app-fallback-renderer.d.ts +21 -7
  281. package/dist/server/app-fallback-renderer.js +18 -3
  282. package/dist/server/app-history-state.d.ts +37 -17
  283. package/dist/server/app-history-state.js +110 -18
  284. package/dist/server/app-hook-warning-suppression.d.ts +2 -4
  285. package/dist/server/app-hydration-cache-publication.d.ts +3 -4
  286. package/dist/server/app-inline-css-client.d.ts +3 -4
  287. package/dist/server/app-interception-context-header.d.ts +2 -3
  288. package/dist/server/app-layout-param-observation.d.ts +7 -9
  289. package/dist/server/app-layout-param-observation.js +1 -1
  290. package/dist/server/app-middleware.d.ts +20 -8
  291. package/dist/server/app-middleware.js +125 -34
  292. package/dist/server/app-mounted-slots-header.d.ts +2 -3
  293. package/dist/server/app-mounted-slots-header.js +2 -2
  294. package/dist/server/app-optimistic-routing.d.ts +35 -9
  295. package/dist/server/app-optimistic-routing.js +151 -13
  296. package/dist/server/app-page-boundary-render.d.ts +35 -8
  297. package/dist/server/app-page-boundary-render.js +195 -62
  298. package/dist/server/app-page-boundary.d.ts +9 -10
  299. package/dist/server/app-page-boundary.js +2 -1
  300. package/dist/server/app-page-cache-finalizer.d.ts +25 -9
  301. package/dist/server/app-page-cache-finalizer.js +124 -23
  302. package/dist/server/app-page-cache-render.d.ts +7 -7
  303. package/dist/server/app-page-cache-render.js +9 -4
  304. package/dist/server/app-page-cache.d.ts +12 -12
  305. package/dist/server/app-page-cache.js +55 -20
  306. package/dist/server/app-page-dispatch.d.ts +47 -19
  307. package/dist/server/app-page-dispatch.js +119 -79
  308. package/dist/server/app-page-element-builder.d.ts +77 -25
  309. package/dist/server/app-page-element-builder.js +260 -76
  310. package/dist/server/app-page-execution.d.ts +27 -18
  311. package/dist/server/app-page-execution.js +63 -54
  312. package/dist/server/app-page-head.d.ts +64 -13
  313. package/dist/server/app-page-head.js +216 -85
  314. package/dist/server/app-page-http-access-fallback-metadata.d.ts +28 -0
  315. package/dist/server/app-page-http-access-fallback-metadata.js +114 -0
  316. package/dist/server/app-page-method.d.ts +3 -4
  317. package/dist/server/app-page-params.d.ts +5 -7
  318. package/dist/server/app-page-ppr-runtime.d.ts +2 -3
  319. package/dist/server/app-page-ppr-runtime.js +3 -2
  320. package/dist/server/app-page-probe.d.ts +13 -9
  321. package/dist/server/app-page-probe.js +9 -4
  322. package/dist/server/app-page-render-identity.d.ts +5 -5
  323. package/dist/server/app-page-render-observation.d.ts +8 -10
  324. package/dist/server/app-page-render-observation.js +1 -1
  325. package/dist/server/app-page-render.d.ts +13 -10
  326. package/dist/server/app-page-render.js +96 -33
  327. package/dist/server/app-page-request.d.ts +27 -43
  328. package/dist/server/app-page-request.js +119 -65
  329. package/dist/server/app-page-response.d.ts +22 -10
  330. package/dist/server/app-page-response.js +25 -13
  331. package/dist/server/app-page-route-wiring.d.ts +58 -18
  332. package/dist/server/app-page-route-wiring.js +409 -98
  333. package/dist/server/app-page-search-params-observation.d.ts +3 -5
  334. package/dist/server/app-page-segment-plan.d.ts +55 -0
  335. package/dist/server/app-page-segment-plan.js +177 -0
  336. package/dist/server/app-page-segment-state.d.ts +23 -8
  337. package/dist/server/app-page-segment-state.js +35 -10
  338. package/dist/server/app-page-stream.d.ts +42 -21
  339. package/dist/server/app-page-stream.js +12 -4
  340. package/dist/server/app-pages-bridge.d.ts +7 -7
  341. package/dist/server/app-pages-bridge.js +33 -5
  342. package/dist/server/app-post-middleware-context.d.ts +3 -5
  343. package/dist/server/app-post-middleware-context.js +1 -1
  344. package/dist/server/app-ppr-fallback-shell-render.d.ts +3 -5
  345. package/dist/server/app-ppr-fallback-shell-render.js +3 -2
  346. package/dist/server/app-ppr-fallback-shell.d.ts +7 -8
  347. package/dist/server/app-ppr-fallback-shell.js +3 -6
  348. package/dist/server/app-prerender-endpoints.d.ts +5 -6
  349. package/dist/server/app-prerender-endpoints.js +36 -11
  350. package/dist/server/app-prerender-static-params.d.ts +3 -5
  351. package/dist/server/app-prerender-static-params.js +18 -8
  352. package/dist/server/app-render-dependency.d.ts +16 -10
  353. package/dist/server/app-render-dependency.js +59 -9
  354. package/dist/server/app-request-context.d.ts +4 -4
  355. package/dist/server/app-request-stage-context.d.ts +5 -0
  356. package/dist/server/app-request-stage-context.js +11 -0
  357. package/dist/server/app-request-stage-dispatch.d.ts +25 -0
  358. package/dist/server/app-request-stage-dispatch.js +54 -0
  359. package/dist/server/app-request-stage-independent-entry.d.ts +8 -0
  360. package/dist/server/app-request-stage-independent-entry.js +99 -0
  361. package/dist/server/app-response-header-provenance.d.ts +19 -0
  362. package/dist/server/app-response-header-provenance.js +58 -0
  363. package/dist/server/app-response-stage-entry.d.ts +9 -0
  364. package/dist/server/app-response-stage-entry.js +66 -0
  365. package/dist/server/app-route-handler-cache.d.ts +5 -5
  366. package/dist/server/app-route-handler-cache.js +11 -3
  367. package/dist/server/app-route-handler-dispatch.d.ts +2 -4
  368. package/dist/server/app-route-handler-dispatch.js +103 -70
  369. package/dist/server/app-route-handler-execution.d.ts +16 -11
  370. package/dist/server/app-route-handler-execution.js +175 -27
  371. package/dist/server/app-route-handler-middleware-context.d.ts +8 -0
  372. package/dist/server/app-route-handler-middleware-context.js +15 -0
  373. package/dist/server/app-route-handler-policy.d.ts +25 -11
  374. package/dist/server/app-route-handler-policy.js +21 -6
  375. package/dist/server/app-route-handler-response.d.ts +11 -11
  376. package/dist/server/app-route-handler-response.js +18 -6
  377. package/dist/server/app-route-handler-runtime.d.ts +10 -12
  378. package/dist/server/app-route-handler-runtime.js +222 -85
  379. package/dist/server/app-route-module-loader.d.ts +43 -10
  380. package/dist/server/app-route-module-loader.js +77 -3
  381. package/dist/server/app-route-request-built-ins.d.ts +15 -0
  382. package/dist/server/app-route-request-built-ins.js +41 -0
  383. package/dist/server/app-route-tree-prefetch.d.ts +6 -7
  384. package/dist/server/app-route-tree-prefetch.js +3 -2
  385. package/dist/server/app-router-entry.d.ts +0 -1
  386. package/dist/server/app-router-entry.js +61 -14
  387. package/dist/server/app-rsc-cache-busting.d.ts +50 -23
  388. package/dist/server/app-rsc-cache-busting.js +123 -32
  389. package/dist/server/app-rsc-combined-handler.d.ts +9 -0
  390. package/dist/server/app-rsc-combined-handler.js +11 -0
  391. package/dist/server/app-rsc-embedded-chunks.d.ts +6 -7
  392. package/dist/server/app-rsc-error-handler.d.ts +2 -3
  393. package/dist/server/app-rsc-errors.d.ts +6 -7
  394. package/dist/server/app-rsc-errors.js +22 -2
  395. package/dist/server/app-rsc-handler.d.ts +42 -13
  396. package/dist/server/app-rsc-handler.js +671 -116
  397. package/dist/server/app-rsc-redirect-flight.d.ts +64 -0
  398. package/dist/server/app-rsc-redirect-flight.js +71 -0
  399. package/dist/server/app-rsc-render-mode.d.ts +8 -8
  400. package/dist/server/app-rsc-render-mode.js +4 -1
  401. package/dist/server/app-rsc-request-normalization.d.ts +25 -13
  402. package/dist/server/app-rsc-request-normalization.js +78 -6
  403. package/dist/server/app-rsc-response-finalizer.d.ts +13 -5
  404. package/dist/server/app-rsc-response-finalizer.js +56 -29
  405. package/dist/server/app-rsc-response-stage.d.ts +6 -0
  406. package/dist/server/app-rsc-response-stage.js +242 -0
  407. package/dist/server/app-rsc-route-matching.d.ts +42 -7
  408. package/dist/server/app-rsc-route-matching.js +118 -17
  409. package/dist/server/app-rsc-state-fingerprint.d.ts +13 -0
  410. package/dist/server/app-rsc-state-fingerprint.js +13 -0
  411. package/dist/server/app-rsc-vary.d.ts +16 -0
  412. package/dist/server/app-rsc-vary.js +31 -0
  413. package/dist/server/app-segment-config.d.ts +7 -7
  414. package/dist/server/app-segment-config.js +38 -16
  415. package/dist/server/app-server-action-execution.d.ts +54 -17
  416. package/dist/server/app-server-action-execution.js +287 -128
  417. package/dist/server/app-ssr-entry.d.ts +15 -7
  418. package/dist/server/app-ssr-entry.js +39 -22
  419. package/dist/server/app-ssr-error-meta.d.ts +3 -4
  420. package/dist/server/app-ssr-error-meta.js +2 -1
  421. package/dist/server/app-ssr-router-instance.d.ts +2 -4
  422. package/dist/server/app-ssr-stream.d.ts +21 -16
  423. package/dist/server/app-ssr-stream.js +36 -16
  424. package/dist/server/app-static-generation.d.ts +4 -6
  425. package/dist/server/app-visited-response-cache.d.ts +17 -8
  426. package/dist/server/app-visited-response-cache.js +68 -4
  427. package/dist/server/app-worker-stages.d.ts +83 -0
  428. package/dist/server/app-worker-stages.js +52 -0
  429. package/dist/server/artifact-compatibility.d.ts +11 -12
  430. package/dist/server/artifact-compatibility.js +1 -1
  431. package/dist/server/before-interactive-head.d.ts +2 -4
  432. package/dist/server/before-interactive-head.js +2 -0
  433. package/dist/server/bfcache-identity.d.ts +44 -0
  434. package/dist/server/bfcache-identity.js +52 -0
  435. package/dist/server/cache-control.d.ts +46 -16
  436. package/dist/server/cache-control.js +117 -13
  437. package/dist/server/cache-headers.d.ts +3 -4
  438. package/dist/server/cache-proof.d.ts +69 -71
  439. package/dist/server/cache-proof.js +1 -1
  440. package/dist/server/cacheability-limits.d.ts +8 -0
  441. package/dist/server/cacheability-limits.js +9 -0
  442. package/dist/server/cacheability-manifest.d.ts +41 -0
  443. package/dist/server/cacheability-manifest.js +196 -0
  444. package/dist/server/cacheability-request.d.ts +49 -0
  445. package/dist/server/cacheability-request.js +538 -0
  446. package/dist/server/client-reuse-manifest.d.ts +17 -19
  447. package/dist/server/client-reuse-manifest.js +3 -3
  448. package/dist/server/client-trace-metadata.d.ts +5 -6
  449. package/dist/server/config-headers.d.ts +42 -0
  450. package/dist/server/config-headers.js +102 -0
  451. package/dist/server/cookie-utils.d.ts +2 -3
  452. package/dist/server/csp.d.ts +5 -7
  453. package/dist/server/default-global-error-module.d.ts +4 -4
  454. package/dist/server/default-global-not-found-module.d.ts +2 -4
  455. package/dist/server/default-not-found-module.d.ts +4 -4
  456. package/dist/server/defer-until-stream-consumed.d.ts +2 -3
  457. package/dist/server/dev-initial-server-error.d.ts +3 -4
  458. package/dist/server/dev-initial-server-error.js +2 -1
  459. package/dist/server/dev-lockfile.d.ts +29 -18
  460. package/dist/server/dev-lockfile.js +2 -3
  461. package/dist/server/dev-module-runner.d.ts +2 -4
  462. package/dist/server/dev-origin-check.d.ts +5 -6
  463. package/dist/server/dev-route-files.d.ts +2 -4
  464. package/dist/server/dev-route-files.js +3 -6
  465. package/dist/server/dev-server.d.ts +10 -21
  466. package/dist/server/dev-server.js +462 -546
  467. package/dist/server/dev-stack-sourcemap.d.ts +7 -9
  468. package/dist/server/dev-stack-sourcemap.js +6 -8
  469. package/dist/server/document-initial-head.d.ts +13 -4
  470. package/dist/server/document-initial-head.js +17 -2
  471. package/dist/server/edge-api-runtime.d.ts +11 -3
  472. package/dist/server/edge-api-runtime.js +29 -1
  473. package/dist/server/fetch-handler.d.ts +3 -2
  474. package/dist/server/fetch-handler.js +3 -18
  475. package/dist/server/file-based-metadata.d.ts +2 -4
  476. package/dist/server/headers.d.ts +73 -46
  477. package/dist/server/headers.js +52 -18
  478. package/dist/server/html.d.ts +6 -7
  479. package/dist/server/http-conditional.d.ts +21 -0
  480. package/dist/server/http-conditional.js +117 -0
  481. package/dist/server/http-date.d.ts +4 -0
  482. package/dist/server/http-date.js +73 -0
  483. package/dist/server/http-error-responses.d.ts +9 -9
  484. package/dist/server/http-error-responses.js +21 -4
  485. package/dist/server/http-range.d.ts +24 -0
  486. package/dist/server/http-range.js +67 -0
  487. package/dist/server/hybrid-route-priority.d.ts +4 -5
  488. package/dist/server/image-optimization.d.ts +34 -27
  489. package/dist/server/image-optimization.js +2 -3
  490. package/dist/server/implicit-tags.d.ts +3 -4
  491. package/dist/server/implicit-tags.js +2 -1
  492. package/dist/server/instrumentation-runtime.d.ts +2 -3
  493. package/dist/server/instrumentation.d.ts +17 -15
  494. package/dist/server/instrumentation.js +2 -2
  495. package/dist/server/isr-cache.d.ts +50 -67
  496. package/dist/server/isr-cache.js +45 -132
  497. package/dist/server/isr-decision.d.ts +11 -9
  498. package/dist/server/metadata-route-build-data.d.ts +4 -6
  499. package/dist/server/metadata-route-build-data.js +1 -1
  500. package/dist/server/metadata-route-cache-policy.d.ts +5 -0
  501. package/dist/server/metadata-route-cache-policy.js +6 -0
  502. package/dist/server/metadata-route-response.d.ts +28 -5
  503. package/dist/server/metadata-route-response.js +225 -11
  504. package/dist/server/metadata-routes.d.ts +52 -35
  505. package/dist/server/metadata-routes.js +5 -5
  506. package/dist/server/middleware-matcher-pattern.d.ts +20 -0
  507. package/dist/server/middleware-matcher-pattern.js +219 -0
  508. package/dist/server/middleware-matcher.d.ts +19 -12
  509. package/dist/server/middleware-matcher.js +56 -77
  510. package/dist/server/middleware-path-to-regexp.d.ts +13 -0
  511. package/dist/server/middleware-path-to-regexp.js +230 -0
  512. package/dist/server/middleware-response-headers.d.ts +3 -4
  513. package/dist/server/middleware-response-headers.js +5 -3
  514. package/dist/server/middleware-runtime.d.ts +19 -9
  515. package/dist/server/middleware-runtime.js +118 -36
  516. package/dist/server/middleware.d.ts +6 -19
  517. package/dist/server/middleware.js +5 -21
  518. package/dist/server/multi-stage.d.ts +118 -0
  519. package/dist/server/multi-stage.js +8 -0
  520. package/dist/server/navigation-planner.d.ts +30 -27
  521. package/dist/server/navigation-planner.js +65 -11
  522. package/dist/server/navigation-trace.d.ts +12 -12
  523. package/dist/server/navigation-trace.js +1 -0
  524. package/dist/server/next-error-digest.d.ts +12 -29
  525. package/dist/server/next-error-digest.js +23 -15
  526. package/dist/server/normalize-path.d.ts +5 -6
  527. package/dist/server/normalize-path.js +1 -1
  528. package/dist/server/open-redirect.d.ts +2 -3
  529. package/dist/server/operation-token.d.ts +11 -12
  530. package/dist/server/operation-token.js +1 -1
  531. package/dist/server/otel-tracer-extension.d.ts +2 -3
  532. package/dist/server/pages-api-route.d.ts +9 -5
  533. package/dist/server/pages-api-route.js +49 -8
  534. package/dist/server/pages-asset-tags.d.ts +8 -7
  535. package/dist/server/pages-asset-tags.js +6 -4
  536. package/dist/server/pages-body-parser-config.d.ts +4 -5
  537. package/dist/server/pages-body-parser-config.js +6 -5
  538. package/dist/server/pages-client-assets.d.ts +4 -5
  539. package/dist/server/pages-data-route.d.ts +29 -21
  540. package/dist/server/pages-data-route.js +31 -18
  541. package/dist/server/pages-default-404.d.ts +3 -4
  542. package/dist/server/pages-dev-hydration.d.ts +13 -0
  543. package/dist/server/pages-dev-hydration.js +92 -0
  544. package/dist/server/pages-dev-module-url.d.ts +3 -4
  545. package/dist/server/pages-dev-module-url.js +2 -2
  546. package/dist/server/pages-dev-stylesheets.d.ts +9 -0
  547. package/dist/server/pages-dev-stylesheets.js +150 -0
  548. package/dist/server/pages-document-asset-props.d.ts +25 -0
  549. package/dist/server/pages-document-asset-props.js +69 -0
  550. package/dist/server/pages-document-initial-props.d.ts +14 -11
  551. package/dist/server/pages-document-initial-props.js +4 -2
  552. package/dist/server/pages-get-initial-props.d.ts +21 -9
  553. package/dist/server/pages-get-initial-props.js +17 -10
  554. package/dist/server/pages-i18n.d.ts +8 -14
  555. package/dist/server/pages-i18n.js +67 -18
  556. package/dist/server/pages-media-type.d.ts +4 -5
  557. package/dist/server/pages-node-compat.d.ts +32 -16
  558. package/dist/server/pages-node-compat.js +112 -60
  559. package/dist/server/pages-page-data.d.ts +87 -22
  560. package/dist/server/pages-page-data.js +441 -92
  561. package/dist/server/pages-page-handler.d.ts +78 -33
  562. package/dist/server/pages-page-handler.js +244 -84
  563. package/dist/server/pages-page-method.d.ts +2 -3
  564. package/dist/server/pages-page-response.d.ts +19 -22
  565. package/dist/server/pages-page-response.js +57 -54
  566. package/dist/server/pages-preview.d.ts +25 -0
  567. package/dist/server/pages-preview.js +165 -0
  568. package/dist/server/pages-readiness.d.ts +7 -8
  569. package/dist/server/pages-readiness.js +7 -5
  570. package/dist/server/pages-request-pipeline.d.ts +43 -17
  571. package/dist/server/pages-request-pipeline.js +120 -47
  572. package/dist/server/pages-request-stage-entry.d.ts +23 -0
  573. package/dist/server/pages-request-stage-entry.js +297 -0
  574. package/dist/server/pages-response-stage-entry.d.ts +11 -0
  575. package/dist/server/pages-response-stage-entry.js +104 -0
  576. package/dist/server/pages-response-stage.d.ts +31 -0
  577. package/dist/server/pages-response-stage.js +49 -0
  578. package/dist/server/pages-revalidate.d.ts +3 -5
  579. package/dist/server/pages-revalidate.js +60 -9
  580. package/dist/server/pages-route-data-kind.d.ts +18 -0
  581. package/dist/server/pages-route-data-kind.js +11 -0
  582. package/dist/server/pages-router-entry.d.ts +1 -24
  583. package/dist/server/pages-router-entry.js +42 -99
  584. package/dist/server/pages-serializable-props.d.ts +3 -4
  585. package/dist/server/pregenerated-concrete-paths.d.ts +8 -7
  586. package/dist/server/pregenerated-concrete-paths.js +3 -1
  587. package/dist/server/prerender-cache-life-header.d.ts +10 -0
  588. package/dist/server/prerender-cache-life-header.js +18 -0
  589. package/dist/server/prerender-manifest.d.ts +20 -11
  590. package/dist/server/prerender-manifest.js +4 -1
  591. package/dist/server/prerender-route-params.d.ts +16 -10
  592. package/dist/server/prerender-route-params.js +20 -7
  593. package/dist/server/prerender-work-unit-setup.d.ts +4 -4
  594. package/dist/server/prerender-work-unit-setup.js +34 -11
  595. package/dist/server/prod-server.d.ts +27 -21
  596. package/dist/server/prod-server.js +378 -140
  597. package/dist/server/proxy-trust.d.ts +5 -7
  598. package/dist/server/request-log.d.ts +9 -14
  599. package/dist/server/request-pipeline.d.ts +40 -49
  600. package/dist/server/request-pipeline.js +61 -88
  601. package/dist/server/request-stage.d.ts +5 -0
  602. package/dist/server/request-stage.js +7 -0
  603. package/dist/server/response-stage-cacheability.d.ts +30 -0
  604. package/dist/server/response-stage-cacheability.js +36 -0
  605. package/dist/server/response-stage-policy.d.ts +23 -0
  606. package/dist/server/response-stage-policy.js +88 -0
  607. package/dist/server/response-stage.d.ts +5 -0
  608. package/dist/server/response-stage.js +7 -0
  609. package/dist/server/revalidation-host.d.ts +9 -0
  610. package/dist/server/revalidation-host.js +20 -0
  611. package/dist/server/revalidation-request.d.ts +8 -0
  612. package/dist/server/revalidation-request.js +37 -0
  613. package/dist/server/rsc-completion-metadata.d.ts +14 -0
  614. package/dist/server/rsc-completion-metadata.js +183 -0
  615. package/dist/server/rsc-stream-hints.d.ts +6 -7
  616. package/dist/server/rsc-stream-hints.js +122 -18
  617. package/dist/server/seed-cache.d.ts +8 -5
  618. package/dist/server/seed-cache.js +39 -11
  619. package/dist/server/server-action-not-found.d.ts +5 -6
  620. package/dist/server/server-globals.d.ts +2 -3
  621. package/dist/server/server-globals.js +13 -0
  622. package/dist/server/skip-cache-proof.d.ts +4 -5
  623. package/dist/server/socket-error-backstop.d.ts +5 -6
  624. package/dist/server/socket-error-backstop.js +1 -1
  625. package/dist/server/static-file-cache.d.ts +26 -13
  626. package/dist/server/static-file-cache.js +63 -38
  627. package/dist/server/static-file-signal.d.ts +16 -0
  628. package/dist/server/static-file-signal.js +82 -0
  629. package/dist/server/static-layout-client-reuse-proof.d.ts +4 -6
  630. package/dist/server/streaming-metadata.d.ts +2 -3
  631. package/dist/server/worker-prerender-discovery.d.ts +18 -0
  632. package/dist/server/worker-prerender-discovery.js +55 -0
  633. package/dist/server/worker-revalidation-context.d.ts +11 -0
  634. package/dist/server/worker-revalidation-context.js +30 -0
  635. package/dist/server/worker-stages.d.ts +43 -0
  636. package/dist/server/worker-stages.js +25 -0
  637. package/dist/server/worker-utils.d.ts +6 -5
  638. package/dist/server/worker-utils.js +17 -8
  639. package/dist/shims/amp.d.ts +3 -4
  640. package/dist/shims/app-router-scroll-state.d.ts +9 -9
  641. package/dist/shims/app-router-scroll-state.js +7 -2
  642. package/dist/shims/app-router-scroll.d.ts +4 -11
  643. package/dist/shims/app-router-scroll.js +2 -1
  644. package/dist/shims/app.d.ts +7 -12
  645. package/dist/shims/before-interactive-context.d.ts +10 -9
  646. package/dist/shims/cache-callable-runtime.d.ts +13 -0
  647. package/dist/shims/cache-callable-runtime.js +39 -0
  648. package/dist/shims/cache-for-request.d.ts +2 -3
  649. package/dist/shims/cache-handler.d.ts +33 -22
  650. package/dist/shims/cache-handler.js +74 -10
  651. package/dist/shims/cache-request-state.d.ts +62 -23
  652. package/dist/shims/cache-request-state.js +86 -1
  653. package/dist/shims/cache-runtime.d.ts +47 -17
  654. package/dist/shims/cache-runtime.js +272 -85
  655. package/dist/shims/cache.d.ts +17 -18
  656. package/dist/shims/cache.js +50 -21
  657. package/dist/shims/cacheability-classification.d.ts +94 -0
  658. package/dist/shims/cacheability-classification.js +143 -0
  659. package/dist/shims/cdn-cache-state.d.ts +13 -0
  660. package/dist/shims/cdn-cache-state.js +23 -0
  661. package/dist/shims/cdn-cache.d.ts +70 -17
  662. package/dist/shims/cdn-cache.js +34 -38
  663. package/dist/shims/client-hook-error.d.ts +3 -4
  664. package/dist/shims/client-locale.d.ts +2 -8
  665. package/dist/shims/client-only.d.ts +1 -1
  666. package/dist/shims/compat-router.d.ts +2 -4
  667. package/dist/shims/config.d.ts +3 -4
  668. package/dist/shims/constants.d.ts +73 -74
  669. package/dist/shims/constants.js +1 -1
  670. package/dist/shims/default-global-error.d.ts +1 -4
  671. package/dist/shims/default-not-found.d.ts +2 -4
  672. package/dist/shims/document.d.ts +42 -84
  673. package/dist/shims/document.js +76 -53
  674. package/dist/shims/dynamic-preload-chunks.d.ts +2 -4
  675. package/dist/shims/dynamic-preload-chunks.js +12 -12
  676. package/dist/shims/dynamic.d.ts +9 -30
  677. package/dist/shims/dynamic.js +33 -14
  678. package/dist/shims/error-boundary-navigation.d.ts +3 -5
  679. package/dist/shims/error-boundary.d.ts +21 -47
  680. package/dist/shims/error-boundary.js +16 -10
  681. package/dist/shims/error.d.ts +21 -10
  682. package/dist/shims/error.js +53 -15
  683. package/dist/shims/error.react-server.d.ts +3 -4
  684. package/dist/shims/fetch-cache.d.ts +22 -21
  685. package/dist/shims/fetch-cache.js +159 -76
  686. package/dist/shims/font-google-base.d.ts +18 -12
  687. package/dist/shims/font-google-base.js +19 -9
  688. package/dist/shims/font-local.d.ts +13 -7
  689. package/dist/shims/font-local.js +44 -13
  690. package/dist/shims/font-utils.d.ts +14 -15
  691. package/dist/shims/font-utils.js +1 -1
  692. package/dist/shims/form.d.ts +8 -6
  693. package/dist/shims/form.js +9 -6
  694. package/dist/shims/hash-scroll.d.ts +5 -6
  695. package/dist/shims/hash-scroll.js +2 -1
  696. package/dist/shims/head-state.d.ts +4 -6
  697. package/dist/shims/head.d.ts +39 -16
  698. package/dist/shims/head.js +79 -16
  699. package/dist/shims/headers.d.ts +83 -73
  700. package/dist/shims/headers.js +242 -84
  701. package/dist/shims/i18n-context.d.ts +5 -7
  702. package/dist/shims/i18n-state.d.ts +4 -6
  703. package/dist/shims/image-config.d.ts +5 -6
  704. package/dist/shims/image.d.ts +29 -40
  705. package/dist/shims/image.js +34 -24
  706. package/dist/shims/internal/als-registry.d.ts +32 -4
  707. package/dist/shims/internal/als-registry.js +50 -2
  708. package/dist/shims/internal/api-utils.d.ts +3 -4
  709. package/dist/shims/internal/app-page-props-cache-key.d.ts +3 -4
  710. package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +18 -4
  711. package/dist/shims/internal/app-prefetch-fetch-queue.js +69 -7
  712. package/dist/shims/internal/app-prefetch-rsc-request.d.ts +13 -0
  713. package/dist/shims/internal/app-prefetch-rsc-request.js +12 -0
  714. package/dist/shims/internal/app-route-detection.d.ts +2 -3
  715. package/dist/shims/internal/app-route-prefetch-policy.d.ts +31 -0
  716. package/dist/shims/internal/app-route-prefetch-policy.js +65 -0
  717. package/dist/shims/internal/app-router-context.d.ts +9 -11
  718. package/dist/shims/internal/cookie-serialize.d.ts +15 -13
  719. package/dist/shims/internal/cookie-serialize.js +10 -7
  720. package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +6 -11
  721. package/dist/shims/internal/hybrid-client-route-owner-direct.js +29 -11
  722. package/dist/shims/internal/hybrid-client-route-owner.d.ts +3 -4
  723. package/dist/shims/internal/hybrid-client-route-owner.js +8 -7
  724. package/dist/shims/internal/interpolate-as.d.ts +19 -5
  725. package/dist/shims/internal/interpolate-as.js +31 -4
  726. package/dist/shims/internal/link-status-registry.d.ts +5 -6
  727. package/dist/shims/internal/make-hanging-promise.d.ts +8 -3
  728. package/dist/shims/internal/make-hanging-promise.js +13 -2
  729. package/dist/shims/internal/navigation-untracked.d.ts +2 -3
  730. package/dist/shims/internal/pages-data-fetch-dedup.d.ts +8 -9
  731. package/dist/shims/internal/pages-data-fetch-dedup.js +5 -3
  732. package/dist/shims/internal/pages-data-target.d.ts +26 -16
  733. package/dist/shims/internal/pages-data-target.js +23 -7
  734. package/dist/shims/internal/pages-data-url.d.ts +7 -6
  735. package/dist/shims/internal/pages-data-url.js +2 -1
  736. package/dist/shims/internal/pages-router-accessor.d.ts +3 -4
  737. package/dist/shims/internal/pages-router-components.d.ts +3 -4
  738. package/dist/shims/internal/route-pattern-for-warning.d.ts +3 -4
  739. package/dist/shims/internal/router-context.d.ts +2 -4
  740. package/dist/shims/internal/utils.d.ts +10 -11
  741. package/dist/shims/internal/work-unit-async-storage.d.ts +16 -14
  742. package/dist/shims/internal/work-unit-async-storage.js +2 -0
  743. package/dist/shims/layout-segment-context.d.ts +5 -10
  744. package/dist/shims/legacy-image.d.ts +3 -38
  745. package/dist/shims/legacy-image.js +6 -16
  746. package/dist/shims/link-prefetch.d.ts +9 -10
  747. package/dist/shims/link.d.ts +43 -40
  748. package/dist/shims/link.js +163 -177
  749. package/dist/shims/metadata.d.ts +25 -50
  750. package/dist/shims/metadata.js +129 -84
  751. package/dist/shims/navigation-context-accessors.d.ts +9 -0
  752. package/dist/shims/navigation-context-accessors.js +19 -0
  753. package/dist/shims/navigation-context-state.d.ts +21 -19
  754. package/dist/shims/navigation-errors.d.ts +20 -20
  755. package/dist/shims/navigation-errors.js +9 -13
  756. package/dist/shims/navigation-state.d.ts +7 -7
  757. package/dist/shims/navigation.d.ts +148 -60
  758. package/dist/shims/navigation.js +500 -99
  759. package/dist/shims/navigation.react-server.d.ts +10 -9
  760. package/dist/shims/navigation.react-server.js +1 -1
  761. package/dist/shims/next-shims-augmentations.d.ts +1 -0
  762. package/dist/shims/next-shims-public.d.ts +1 -0
  763. package/dist/shims/offline.d.ts +2 -3
  764. package/dist/shims/og.d.ts +2 -3
  765. package/dist/shims/pages-router-runtime.d.ts +4 -5
  766. package/dist/shims/ppr-fallback-shell.d.ts +13 -14
  767. package/dist/shims/public-shim-map.json.js +103 -0
  768. package/dist/shims/readonly-url-search-params.d.ts +5 -6
  769. package/dist/shims/readonly-url-search-params.js +3 -3
  770. package/dist/shims/request-context.d.ts +15 -6
  771. package/dist/shims/request-state-types.d.ts +3 -2
  772. package/dist/shims/root-params.d.ts +15 -14
  773. package/dist/shims/root-params.js +7 -1
  774. package/dist/shims/router-state.d.ts +6 -6
  775. package/dist/shims/router.d.ts +102 -46
  776. package/dist/shims/router.js +479 -152
  777. package/dist/shims/script-nonce-context.d.ts +5 -7
  778. package/dist/shims/script.d.ts +30 -22
  779. package/dist/shims/script.js +17 -12
  780. package/dist/shims/server-only.d.ts +1 -1
  781. package/dist/shims/server.d.ts +68 -47
  782. package/dist/shims/server.js +209 -67
  783. package/dist/shims/slot.d.ts +31 -19
  784. package/dist/shims/slot.js +107 -21
  785. package/dist/shims/streamed-icons.d.ts +6 -0
  786. package/dist/shims/streamed-icons.js +33 -0
  787. package/dist/shims/thenable-params.d.ts +4 -5
  788. package/dist/shims/thenable-params.js +1 -1
  789. package/dist/shims/unified-request-context.d.ts +71 -13
  790. package/dist/shims/unified-request-context.js +139 -1
  791. package/dist/shims/unrecognized-action-error.d.ts +3 -4
  792. package/dist/shims/url-safety.d.ts +5 -6
  793. package/dist/shims/url-safety.js +2 -2
  794. package/dist/shims/url-utils.d.ts +18 -12
  795. package/dist/shims/url-utils.js +10 -1
  796. package/dist/shims/use-merged-ref.d.ts +2 -4
  797. package/dist/shims/web-vitals.d.ts +2 -3
  798. package/dist/typegen.d.ts +7 -3
  799. package/dist/typegen.js +83 -24
  800. package/dist/utils/asset-prefix.d.ts +7 -8
  801. package/dist/utils/base-path.d.ts +5 -6
  802. package/dist/utils/built-asset-url.d.ts +2 -3
  803. package/dist/utils/built-asset-url.js +4 -2
  804. package/dist/utils/cache-control-metadata.d.ts +15 -3
  805. package/dist/utils/cache-control-metadata.js +21 -1
  806. package/dist/utils/client-build-manifest.d.ts +6 -8
  807. package/dist/utils/client-build-manifest.js +3 -2
  808. package/dist/utils/client-entry-manifest.d.ts +6 -7
  809. package/dist/utils/client-entry-manifest.js +1 -1
  810. package/dist/utils/client-runtime-metadata.d.ts +2 -3
  811. package/dist/utils/client-runtime-metadata.js +3 -2
  812. package/dist/utils/commonjs-loader.d.ts +4 -5
  813. package/dist/utils/commonjs-loader.js +3 -3
  814. package/dist/utils/compare.d.ts +2 -3
  815. package/dist/utils/deployment-id.d.ts +6 -7
  816. package/dist/utils/dev-error-recovery-event.d.ts +2 -3
  817. package/dist/utils/dev-stack-sourcemap-endpoint.d.ts +2 -3
  818. package/dist/utils/domain-locale.d.ts +9 -14
  819. package/dist/utils/encode-cache-tag.d.ts +4 -5
  820. package/dist/utils/encode-cache-tag.js +1 -1
  821. package/dist/utils/error-cause.d.ts +2 -3
  822. package/dist/utils/external-url.d.ts +4 -0
  823. package/dist/utils/external-url.js +7 -0
  824. package/dist/utils/has-trailing-comma.d.ts +3 -4
  825. package/dist/utils/hash.d.ts +3 -4
  826. package/dist/utils/html-limited-bots.d.ts +3 -4
  827. package/dist/utils/html-limited-bots.js +1 -1
  828. package/dist/utils/lazy-chunks.d.ts +8 -9
  829. package/dist/utils/lazy-chunks.js +3 -3
  830. package/dist/utils/manifest-paths.d.ts +5 -6
  831. package/dist/utils/mdx-scan.d.ts +3 -4
  832. package/dist/utils/mdx-scan.js +1 -1
  833. package/dist/utils/middleware-request-headers.d.ts +21 -8
  834. package/dist/utils/middleware-request-headers.js +37 -23
  835. package/dist/utils/navigation-signal.d.ts +2 -3
  836. package/dist/utils/number.d.ts +2 -3
  837. package/dist/utils/package-name.d.ts +10 -0
  838. package/dist/utils/package-name.js +18 -0
  839. package/dist/utils/parse-cookie.d.ts +4 -5
  840. package/dist/utils/path.d.ts +11 -17
  841. package/dist/utils/path.js +21 -15
  842. package/dist/utils/plugin-options.d.ts +3 -0
  843. package/dist/utils/plugin-options.js +8 -0
  844. package/dist/utils/precompressed-variant.d.ts +8 -0
  845. package/dist/utils/precompressed-variant.js +15 -0
  846. package/dist/utils/prerender-output-paths.d.ts +10 -9
  847. package/dist/utils/prerender-output-paths.js +22 -10
  848. package/dist/utils/project.d.ts +29 -31
  849. package/dist/utils/project.js +2 -8
  850. package/dist/utils/promise.d.ts +2 -3
  851. package/dist/utils/protocol-headers.d.ts +17 -12
  852. package/dist/utils/protocol-headers.js +7 -1
  853. package/dist/utils/public-file-path.d.ts +4 -0
  854. package/dist/utils/public-file-path.js +12 -0
  855. package/dist/utils/public-routes.d.ts +2 -3
  856. package/dist/utils/public-routes.js +8 -7
  857. package/dist/utils/query.d.ts +8 -9
  858. package/dist/utils/react-compiler-support.d.ts +19 -0
  859. package/dist/utils/react-compiler-support.js +29 -0
  860. package/dist/utils/react-version.d.ts +2 -3
  861. package/dist/utils/react-version.js +1 -1
  862. package/dist/utils/record.d.ts +2 -3
  863. package/dist/utils/redirect-digest.d.ts +8 -0
  864. package/dist/utils/redirect-digest.js +25 -0
  865. package/dist/utils/regex-safety.d.ts +7 -0
  866. package/dist/utils/regex-safety.js +737 -0
  867. package/dist/utils/regex.d.ts +2 -3
  868. package/dist/utils/safe-json-file.d.ts +2 -3
  869. package/dist/utils/sorted-array.d.ts +2 -3
  870. package/dist/utils/text-stream.d.ts +3 -4
  871. package/dist/utils/vinext-root.d.ts +2 -3
  872. package/dist/utils/vinext-root.js +1 -1
  873. package/dist/utils/virtual-module.d.ts +3 -4
  874. package/dist/utils/vite-version.d.ts +7 -5
  875. package/dist/utils/vite-version.js +43 -17
  876. package/package.json +53 -8
  877. /package/dist/build/google-fonts/{fallback-metrics-data.js → fallback-metrics-data.json.js} +0 -0
  878. /package/dist/build/google-fonts/{font-data.js → font-data.json.js} +0 -0
  879. /package/dist/{node_modules/.pnpm/process-ancestry@0.1.0/node_modules → deps/.pnpm/process-ancestry@0.1.0/deps}/process-ancestry/dist/index.js +0 -0
@@ -1,10 +1,12 @@
1
+ import { toSlash } from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
1
2
  //#region src/build/client-build-config.ts
2
- const ROUTE_OWNED_CLIENT_SHIMS = new Set([
3
+ const ROUTE_OWNED_CLIENT_SHIMS = /* @__PURE__ */ new Set([
3
4
  "compat-router",
4
5
  "dynamic",
5
6
  "dynamic-preload-chunks",
6
7
  "form",
7
8
  "image",
9
+ "internal/hybrid-client-route-owner",
8
10
  "layout-segment-context",
9
11
  "legacy-image",
10
12
  "link",
@@ -47,7 +49,7 @@ function createClientAssetFileNames(assetsDir) {
47
49
  * (node_modules/.pnpm/pkg@ver/node_modules/pkg).
48
50
  */
49
51
  function getPackageName(id) {
50
- const normalizedId = id.replaceAll("\\", "/");
52
+ const normalizedId = toSlash(id);
51
53
  const nmIdx = normalizedId.lastIndexOf("node_modules/");
52
54
  if (nmIdx === -1) return null;
53
55
  const rest = normalizedId.slice(nmIdx + 13);
@@ -84,21 +86,27 @@ function getPackageName(id) {
84
86
  */
85
87
  function createClientManualChunks(shimsDir, preserveRouteBoundaries = false) {
86
88
  return function clientManualChunks(id) {
87
- if (id.includes("node_modules")) {
88
- const pkg = getPackageName(id);
89
- if (!pkg) return void 0;
90
- if (pkg === "react" || pkg === "react-dom" || pkg === "scheduler") return "framework";
91
- return;
92
- }
93
- if (id.startsWith(shimsDir)) {
89
+ const slashedId = toSlash(id);
90
+ if (slashedId.startsWith(shimsDir)) {
94
91
  if (preserveRouteBoundaries) {
95
- const relativeId = id.slice(shimsDir.length).split("?", 1)[0] ?? "";
92
+ const relativeId = slashedId.slice(shimsDir.length).split("?", 1)[0] ?? "";
96
93
  const extensionIndex = relativeId.lastIndexOf(".");
97
94
  const shimName = extensionIndex === -1 ? relativeId : relativeId.slice(0, extensionIndex);
98
95
  if (ROUTE_OWNED_CLIENT_SHIMS.has(shimName)) return void 0;
99
96
  }
100
97
  return "vinext";
101
98
  }
99
+ if (id.includes("node_modules")) {
100
+ const pkg = getPackageName(id);
101
+ if (!pkg) return void 0;
102
+ if (pkg === "react-dom") {
103
+ const sub = slashedId.slice(slashedId.lastIndexOf("react-dom/") + 10);
104
+ if (sub.startsWith("server.") || sub.startsWith("static.") || sub.startsWith("cjs/react-dom-server")) return "react-dom-server";
105
+ return "framework";
106
+ }
107
+ if (pkg === "react" || pkg === "scheduler") return "framework";
108
+ return;
109
+ }
102
110
  };
103
111
  }
104
112
  function createClientFileNameConfig(assetsDir) {
@@ -158,6 +166,30 @@ function isRscFrameworkModule(id) {
158
166
  return pkg !== null && FRAMEWORK_PACKAGES.includes(pkg);
159
167
  }
160
168
  /**
169
+ * Keep virtual entry ids out of emitted RSC chunk filenames.
170
+ *
171
+ * Rolldown's entries-aware chunk names can contain the `\\0` virtual-id marker,
172
+ * which is not a portable module-specifier or filesystem name. Preserve every
173
+ * other character and remove both the printable and actual-NUL forms.
174
+ */
175
+ function sanitizeRscChunkFileName(name) {
176
+ const withoutVirtualMarkers = name.replaceAll("\\0", "");
177
+ const invalid = /* @__PURE__ */ new Set([
178
+ "<",
179
+ ">",
180
+ ":",
181
+ "\"",
182
+ "/",
183
+ "\\",
184
+ "|",
185
+ "?",
186
+ "*"
187
+ ]);
188
+ let sanitized = "";
189
+ for (const character of withoutVirtualMarkers) sanitized += character.charCodeAt(0) <= 31 || invalid.has(character) ? "_" : character;
190
+ return sanitized;
191
+ }
192
+ /**
161
193
  * Output config that isolates React (and the RSC flight runtime) into a
162
194
  * dedicated "framework" chunk in the RSC server build. See
163
195
  * {@link RSC_FRAMEWORK_CHUNK_TEST} for the motivation (issue #1549). Framework
@@ -165,11 +197,14 @@ function isRscFrameworkModule(id) {
165
197
  * eager framework chunk (issue #2073).
166
198
  */
167
199
  function createRscFrameworkChunkOutputConfig() {
168
- return { codeSplitting: { groups: [{
169
- name: "framework",
170
- test: RSC_FRAMEWORK_CHUNK_TEST,
171
- entriesAware: true
172
- }] } };
200
+ return {
201
+ sanitizeFileName: sanitizeRscChunkFileName,
202
+ codeSplitting: { groups: [{
203
+ name: "framework",
204
+ test: RSC_FRAMEWORK_CHUNK_TEST,
205
+ entriesAware: true
206
+ }] }
207
+ };
173
208
  }
174
209
  /**
175
210
  * Returns Rolldown treeshake configuration for production client builds.
@@ -188,5 +223,46 @@ function getBuildBundlerOptions(build) {
188
223
  function withBuildBundlerOptions(bundlerOptions) {
189
224
  return { rolldownOptions: bundlerOptions };
190
225
  }
226
+ /**
227
+ * Keep vinext modules partitioned by the stage entries that actually use them.
228
+ * Without an entry-aware catch-all, Rolldown may merge a small helper shared by
229
+ * request/response entries into a response-heavy chunk; importing that helper
230
+ * then evaluates React and renderer code on a request-stage cache hit.
231
+ */
232
+ function createMultiStageCodeSplittingConfig(existing) {
233
+ const base = existing && typeof existing === "object" ? existing : {};
234
+ return {
235
+ ...base,
236
+ groups: [{
237
+ name: "vinext-stage-runtime",
238
+ test: /(?:^|[/\\])(?:packages[/\\]vinext[/\\]src|(?:packages[/\\]vinext|node_modules[/\\](?:\.pnpm[/\\][^/\\]+[/\\]node_modules[/\\])?vinext)[/\\]dist)[/\\]/,
239
+ entriesAware: true
240
+ }, ...base.groups ?? []]
241
+ };
242
+ }
243
+ /**
244
+ * Keep router stage chunks beside the server entry so their generated
245
+ * `./vinext-client-assets.js` external continues to resolve. Other chunks keep
246
+ * the host's existing output pattern (or vinext's server-assets default).
247
+ */
248
+ function createMultiStageChunkFileNames(assetsDir, existing) {
249
+ return (chunk) => {
250
+ const name = sanitizeRscChunkFileName(chunk.name);
251
+ if (chunk.moduleIds?.some((id) => /\/server\/app-ssr-entry\.[cm]?[jt]sx?$/.test(toSlash(id.split("?", 1)[0] ?? ""))) || [
252
+ "app-router-entry",
253
+ "pages-router-entry",
254
+ "app-response-stage-entry",
255
+ "pages-request-stage-entry",
256
+ "pages-response-stage-entry",
257
+ "virtual_vinext-rsc-entry",
258
+ "virtual_vinext-response-stage"
259
+ ].some((entryName) => name.includes(entryName))) return `${name}-[hash].js`;
260
+ if (typeof existing === "function") return existing({
261
+ ...chunk,
262
+ name
263
+ });
264
+ return (existing ?? joinAssetFileNamePattern(assetsDir, "[name]-[hash].js")).replaceAll("[name]", name);
265
+ };
266
+ }
191
267
  //#endregion
192
- export { RSC_FRAMEWORK_CHUNK_TEST, createClientAssetFileNames, createClientCodeSplittingConfig, createClientFileNameConfig, createClientManualChunks, createRscFrameworkChunkOutputConfig, getBuildBundlerOptions, getClientTreeshakeConfig, isRscFrameworkModule, withBuildBundlerOptions };
268
+ export { RSC_FRAMEWORK_CHUNK_TEST, createClientAssetFileNames, createClientCodeSplittingConfig, createClientFileNameConfig, createClientManualChunks, createMultiStageChunkFileNames, createMultiStageCodeSplittingConfig, createRscFrameworkChunkOutputConfig, getBuildBundlerOptions, getClientTreeshakeConfig, isRscFrameworkModule, sanitizeRscChunkFileName, withBuildBundlerOptions };
@@ -1,5 +1,4 @@
1
1
  import { Rolldown } from "vite";
2
-
3
2
  //#region src/build/css-url-assets.d.ts
4
3
  type BundleAsset = Rolldown.OutputAsset;
5
4
  type CssUrlAssetBundle = Rolldown.OutputBundle;
@@ -12,9 +11,9 @@ type EmitRestoredCssUrlAsset = (asset: {
12
11
  * source. Idempotent and side-effect free (only adds a query param), so it is
13
12
  * safe to run on every build-environment stylesheet, vendored CSS included.
14
13
  */
15
- declare function markCssUrlAssetReferences(code: string, id: string): string | null;
14
+ export declare function markCssUrlAssetReferences(code: string, id: string): string | null;
16
15
  /** Rebase relative asset URLs when Sass inlines a partial into an entry file. */
17
- declare function rebaseCssUrlAssetReferences(code: string, sourceDirectory: string, targetDirectory: string): string | null;
16
+ export declare function rebaseCssUrlAssetReferences(code: string, sourceDirectory: string, targetDirectory: string): string | null;
18
17
  /**
19
18
  * Mutates emitted CSS assets in place so byte-identical `url()` dependencies
20
19
  * keep their distinct Next-compatible filenames. Sibling files are produced via
@@ -26,6 +25,5 @@ declare function rebaseCssUrlAssetReferences(code: string, sourceDirectory: stri
26
25
  * chunk (`cssCodeSplit: false` / `?inline`) already has final URLs, so chunk
27
26
  * code only has the leaked marker stripped — no sibling files are emitted.
28
27
  */
29
- declare function restoreDedupedCssAssetReferences(bundle: CssUrlAssetBundle, emitRestoredAsset: EmitRestoredCssUrlAsset): void;
30
- //#endregion
31
- export { markCssUrlAssetReferences, rebaseCssUrlAssetReferences, restoreDedupedCssAssetReferences };
28
+ export declare function restoreDedupedCssAssetReferences(bundle: CssUrlAssetBundle, emitRestoredAsset: EmitRestoredCssUrlAsset): void;
29
+ //#endregion
@@ -1,4 +1,4 @@
1
- import path from "node:path";
1
+ import path, { toSlash } from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
2
2
  //#region src/build/css-url-assets.ts
3
3
  /**
4
4
  * Next-parity for CSS `url()` asset dependencies.
@@ -35,7 +35,7 @@ const CSS_URL_RE = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^'")]*?))\s*\)/g;
35
35
  const CSS_ASSET_EXT_RE = /\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp|woff2?|eot|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|wasm)$/i;
36
36
  const CSS_REQUEST_RE = /\.(?:css|scss|sass|less|styl|stylus)(?:\?|$)/i;
37
37
  function basename(value) {
38
- const normalized = value.replaceAll("\\", "/");
38
+ const normalized = toSlash(value);
39
39
  const slash = normalized.lastIndexOf("/");
40
40
  return slash === -1 ? normalized : normalized.slice(slash + 1);
41
41
  }
@@ -70,15 +70,18 @@ function decodeURIComponentSafe(value) {
70
70
  return value;
71
71
  }
72
72
  }
73
+ function splitMarkerQuery(query) {
74
+ return query.replaceAll(`?${CSS_URL_ASSET_MARKER}=`, `&${CSS_URL_ASSET_MARKER}=`).split("&");
75
+ }
73
76
  function getMarker(query) {
74
- for (const part of query.split("&")) {
77
+ for (const part of splitMarkerQuery(query)) {
75
78
  const eq = part.indexOf("=");
76
79
  if ((eq === -1 ? part : part.slice(0, eq)) === CSS_URL_ASSET_MARKER) return eq === -1 ? "" : decodeURIComponentSafe(part.slice(eq + 1));
77
80
  }
78
81
  return null;
79
82
  }
80
83
  function dropMarker(query) {
81
- return query.split("&").filter((part) => (part.indexOf("=") === -1 ? part : part.slice(0, part.indexOf("="))) !== CSS_URL_ASSET_MARKER).join("&");
84
+ return splitMarkerQuery(query).filter((part) => (part.indexOf("=") === -1 ? part : part.slice(0, part.indexOf("="))) !== CSS_URL_ASSET_MARKER).join("&");
82
85
  }
83
86
  function isRelativeAssetUrl(rawPath) {
84
87
  return !(rawPath === "" || rawPath.startsWith("/") || rawPath.startsWith("#") || rawPath.includes("(") || /^[a-zA-Z][\w+.-]*:/.test(rawPath));
@@ -137,7 +140,7 @@ function rebaseCssUrlAssetReferences(code, sourceDirectory, targetDirectory) {
137
140
  const lower = parts.path.toLowerCase();
138
141
  if (!CSS_ASSET_EXT_RE.test(lower) || lower.endsWith(".css")) return null;
139
142
  const absolutePath = path.resolve(sourceDirectory, parts.path);
140
- let rebasedPath = path.relative(targetDirectory, absolutePath).replaceAll("\\", "/");
143
+ let rebasedPath = path.relative(targetDirectory, absolutePath);
141
144
  if (!rebasedPath.startsWith(".")) rebasedPath = `./${rebasedPath}`;
142
145
  return joinUrl({
143
146
  ...parts,
@@ -1,9 +1,11 @@
1
1
  //#region src/build/google-fonts/build-url.d.ts
2
- type FontAxes = {
3
- /** Weight values: explicit faces ("400") or a variable range ("400..800"). */wght?: string[]; /** Ital values, "0" (normal) and/or "1" (italic). */
4
- ital?: string[]; /** Other variable axes the caller wants to include, e.g. `[["opsz","14..32"]]`. */
2
+ export type FontAxes = {
3
+ /** Weight values: explicit faces ("400") or a variable range ("400..800"). */
4
+ wght?: string[];
5
+ /** Ital values, "0" (normal) and/or "1" (italic). */
6
+ ital?: string[];
7
+ /** Other variable axes the caller wants to include, e.g. `[["opsz","14..32"]]`. */
5
8
  variableAxes?: [string, string][];
6
9
  };
7
- declare function buildGoogleFontsUrl(fontFamily: string, axes: FontAxes, display: string): string;
8
- //#endregion
9
- export { FontAxes, buildGoogleFontsUrl };
10
+ export declare function buildGoogleFontsUrl(fontFamily: string, axes: FontAxes, display: string): string;
11
+ //#endregion
@@ -6,7 +6,6 @@ type AdjustFontFallback = {
6
6
  lineGapOverride: string;
7
7
  sizeAdjust: string;
8
8
  };
9
- declare function getFallbackFontOverrideMetrics(fontFamily: string): AdjustFontFallback | undefined;
10
- declare function buildFallbackFontFace(family: string, metrics: AdjustFontFallback): string;
11
- //#endregion
12
- export { buildFallbackFontFace, getFallbackFontOverrideMetrics };
9
+ export declare function getFallbackFontOverrideMetrics(fontFamily: string): AdjustFontFallback | undefined;
10
+ export declare function buildFallbackFontFace(family: string, metrics: AdjustFontFallback): string;
11
+ //#endregion
@@ -1,5 +1,5 @@
1
1
  import { escapeCSSString } from "../../shims/font-utils.js";
2
- import fallback_metrics_data_default from "./fallback-metrics-data.js";
2
+ import fallback_metrics_data_default from "./fallback-metrics-data.json.js";
3
3
  //#region src/build/google-fonts/fallback-metrics.ts
4
4
  const EXPECTED_METRIC_LENGTH = 6;
5
5
  const fallbackMetrics = fallback_metrics_data_default;
@@ -8,9 +8,8 @@
8
8
  * packages/font/src/google/find-font-files-in-css.ts
9
9
  * https://github.com/vercel/next.js/blob/canary/packages/font/src/google/find-font-files-in-css.ts
10
10
  */
11
- declare function findFontFilesInCss(css: string, subsetsToPreload?: string[]): {
11
+ export declare function findFontFilesInCss(css: string, subsetsToPreload?: string[]): {
12
12
  googleFontFileUrl: string;
13
13
  preloadFontFile: boolean;
14
14
  }[];
15
- //#endregion
16
- export { findFontFilesInCss };
15
+ //#endregion
@@ -6,11 +6,14 @@ type VariableAxisDescriptor = {
6
6
  defaultValue: number;
7
7
  };
8
8
  type FontFamilyMetadata = {
9
- /** Available weight values, plus the literal "variable" if a variable face exists. */weights: string[]; /** Available styles, e.g. ["normal"], ["italic"], or both. */
10
- styles: string[]; /** Variable axes for this family. Absent when the family has no variable face. */
11
- axes?: VariableAxisDescriptor[]; /** Preloadable subsets (e.g. "latin", "latin-ext", "vietnamese"). */
9
+ /** Available weight values, plus the literal "variable" if a variable face exists. */
10
+ weights: string[];
11
+ /** Available styles, e.g. ["normal"], ["italic"], or both. */
12
+ styles: string[];
13
+ /** Variable axes for this family. Absent when the family has no variable face. */
14
+ axes?: VariableAxisDescriptor[];
15
+ /** Preloadable subsets (e.g. "latin", "latin-ext", "vietnamese"). */
12
16
  subsets: string[];
13
17
  };
14
- declare const googleFontsMetadata: Record<string, FontFamilyMetadata>;
15
- //#endregion
16
- export { googleFontsMetadata };
18
+ export declare const googleFontsMetadata: Record<string, FontFamilyMetadata>;
19
+ //#endregion
@@ -1,4 +1,4 @@
1
- import font_data_default from "./font-data.js";
1
+ import font_data_default from "./font-data.json.js";
2
2
  //#region src/build/google-fonts/font-metadata.ts
3
3
  const googleFontsMetadata = font_data_default;
4
4
  //#endregion
@@ -1,6 +1,4 @@
1
1
  import { FontAxes } from "./build-url.js";
2
-
3
2
  //#region src/build/google-fonts/get-axes.d.ts
4
- declare function getFontAxes(fontFamily: string, weights: string[], styles: string[], selectedVariableAxes?: string[]): FontAxes;
5
- //#endregion
6
- export { getFontAxes };
3
+ export declare function getFontAxes(fontFamily: string, weights: string[], styles: string[], selectedVariableAxes?: string[]): FontAxes;
4
+ //#endregion
@@ -1,4 +1,3 @@
1
1
  //#region src/build/google-fonts/sort-variants.d.ts
2
- declare function sortFontsVariantValues(valA: string, valB: string): number;
3
- //#endregion
4
- export { sortFontsVariantValues };
2
+ export declare function sortFontsVariantValues(valA: string, valB: string): number;
3
+ //#endregion
@@ -22,6 +22,5 @@ type ValidatedGoogleFontOptions = {
22
22
  variable?: string;
23
23
  subsets: string[];
24
24
  };
25
- declare function validateGoogleFontOptions(fontFamily: string, options: GoogleFontOptions): ValidatedGoogleFontOptions;
26
- //#endregion
27
- export { validateGoogleFontOptions };
25
+ export declare function validateGoogleFontOptions(fontFamily: string, options: GoogleFontOptions): ValidatedGoogleFontOptions;
26
+ //#endregion
@@ -25,12 +25,16 @@ function validateGoogleFontOptions(fontFamily, options) {
25
25
  const fontStyles = fontFamilyData.styles;
26
26
  const weights = !weight ? [] : dedupe(Array.isArray(weight) ? weight : [weight]);
27
27
  const styles = !style ? [] : dedupe(Array.isArray(style) ? style : [style]);
28
- if (weights.length === 0) if (fontWeights.includes("variable")) weights.push("variable");
29
- else throw new Error(`Missing weight for font \`${fontFamily}\`.\nAvailable weights: ${formatAvailableValues(fontWeights)}`);
28
+ if (weights.length === 0) {
29
+ if (fontWeights.includes("variable")) weights.push("variable");
30
+ else throw new Error(`Missing weight for font \`${fontFamily}\`.\nAvailable weights: ${formatAvailableValues(fontWeights)}`);
31
+ }
30
32
  if (weights.length > 1 && weights.includes("variable")) throw new Error(`Unexpected \`variable\` in weight array for font \`${fontFamily}\`. You only need \`variable\`, it includes all available weights.`);
31
33
  for (const selectedWeight of weights) if (!fontWeights.includes(selectedWeight)) throw new Error(`Unknown weight \`${selectedWeight}\` for font \`${fontFamily}\`.\nAvailable weights: ${formatAvailableValues(fontWeights)}`);
32
- if (styles.length === 0) if (fontStyles.length === 1) styles.push(fontStyles[0]);
33
- else styles.push("normal");
34
+ if (styles.length === 0) {
35
+ if (fontStyles.length === 1) styles.push(fontStyles[0]);
36
+ else styles.push("normal");
37
+ }
34
38
  for (const selectedStyle of styles) if (!fontStyles.includes(selectedStyle)) throw new Error(`Unknown style \`${selectedStyle}\` for font \`${fontFamily}\`.\nAvailable styles: ${formatAvailableValues(fontStyles)}`);
35
39
  if (!ALLOWED_DISPLAY_VALUES.includes(display)) throw new Error(`Invalid display value \`${display}\` for font \`${fontFamily}\`.\nAvailable display values: ${formatAvailableValues(ALLOWED_DISPLAY_VALUES)}`);
36
40
  if (axes) {
@@ -2,6 +2,5 @@
2
2
  declare global {
3
3
  var __VINEXT_PREGENERATED_CONCRETE_PATHS: unknown;
4
4
  }
5
- declare function injectPregeneratedConcretePaths(root: string): void;
6
- //#endregion
7
- export { injectPregeneratedConcretePaths };
5
+ export declare function injectPregeneratedConcretePaths(root: string, applicationEntry?: string, serverOutputDir?: string, additionalRuntimeDirs?: readonly string[]): void;
6
+ //#endregion
@@ -1,21 +1,23 @@
1
- import { escapeRegExp } from "../utils/regex.js";
1
+ import path from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
2
+ import { PREGENERATED_CONCRETE_PATHS_MODULE } from "../server/pregenerated-concrete-paths.js";
3
+ import { readServerRuntimeOutputDirs } from "./server-manifest.js";
2
4
  import { readPrerenderManifest } from "../server/prerender-manifest.js";
3
5
  import fs from "node:fs";
4
- import path from "node:path";
5
6
  //#region src/build/inject-pregenerated-paths.ts
6
- const VINEXT_PREGEN_START = "/* __VINEXT_PREGENERATED_CONCRETE_PATHS_START__ */";
7
- const VINEXT_PREGEN_END = "/* __VINEXT_PREGENERATED_CONCRETE_PATHS_END__ */";
8
- const VINEXT_PREGEN_RE = new RegExp(`${escapeRegExp(VINEXT_PREGEN_START)}[\\s\\S]*?${escapeRegExp(VINEXT_PREGEN_END)}\\n?`, "g");
9
- function injectPregeneratedConcretePaths(root) {
10
- const workerEntry = path.resolve(root, "dist", "server", "index.js");
11
- if (!fs.existsSync(workerEntry)) return;
12
- let code = fs.readFileSync(workerEntry, "utf-8").replace(VINEXT_PREGEN_RE, "");
13
- const table = readPrerenderManifest(path.join(root, "dist", "server", "vinext-prerender.json"))?.pregeneratedConcretePaths ?? [];
14
- if (table.length > 0) {
15
- globalThis.__VINEXT_PREGENERATED_CONCRETE_PATHS = table;
16
- code = `${VINEXT_PREGEN_START}\nglobalThis.__VINEXT_PREGENERATED_CONCRETE_PATHS = ${JSON.stringify(table)};\n${VINEXT_PREGEN_END}\n` + code;
17
- } else delete globalThis.__VINEXT_PREGENERATED_CONCRETE_PATHS;
18
- fs.writeFileSync(workerEntry, code);
7
+ function injectPregeneratedConcretePaths(root, applicationEntry = path.resolve(root, "dist", "server", "index.js"), serverOutputDir = path.resolve(root, "dist", "server"), additionalRuntimeDirs = []) {
8
+ const table = readPrerenderManifest(path.join(serverOutputDir, "vinext-prerender.json"))?.pregeneratedConcretePaths ?? [];
9
+ const runtimeModuleCode = table.length > 0 ? `globalThis.__VINEXT_PREGENERATED_CONCRETE_PATHS = ${JSON.stringify(table)};\n` : "delete globalThis.__VINEXT_PREGENERATED_CONCRETE_PATHS;\n";
10
+ for (const outputDir of /* @__PURE__ */ new Set([
11
+ serverOutputDir,
12
+ path.dirname(applicationEntry),
13
+ ...additionalRuntimeDirs,
14
+ ...readServerRuntimeOutputDirs(serverOutputDir, root)
15
+ ])) {
16
+ fs.mkdirSync(outputDir, { recursive: true });
17
+ fs.writeFileSync(path.join(outputDir, PREGENERATED_CONCRETE_PATHS_MODULE), runtimeModuleCode);
18
+ }
19
+ if (table.length > 0) globalThis.__VINEXT_PREGENERATED_CONCRETE_PATHS = table;
20
+ else delete globalThis.__VINEXT_PREGENERATED_CONCRETE_PATHS;
19
21
  }
20
22
  //#endregion
21
23
  export { injectPregeneratedConcretePaths };
@@ -1,6 +1,5 @@
1
1
  //#region src/build/inline-css.d.ts
2
2
  type InlineCssManifest = Record<string, string>;
3
- declare function collectInlineCssManifest(clientDir: string, assetPrefix: string): InlineCssManifest;
4
- declare function injectInlineCssManifestGlobal(entryPath: string, manifest: InlineCssManifest): boolean;
5
- //#endregion
6
- export { collectInlineCssManifest, injectInlineCssManifestGlobal };
3
+ export declare function collectInlineCssManifest(clientDir: string, assetPrefix: string): InlineCssManifest;
4
+ export declare function injectInlineCssManifestGlobal(entryPath: string, manifest: InlineCssManifest): boolean;
5
+ //#endregion
@@ -1,6 +1,6 @@
1
+ import path from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
1
2
  import { resolveAssetUrlPrefix, resolveAssetsDir } from "../utils/asset-prefix.js";
2
3
  import fs from "node:fs";
3
- import path from "node:path";
4
4
  //#region src/build/inline-css.ts
5
5
  const INLINE_CSS_GLOBAL_MARKER = "globalThis.__VINEXT_INLINE_CSS__ = ";
6
6
  function collectCssFiles(directory) {
@@ -12,9 +12,6 @@ function collectCssFiles(directory) {
12
12
  }
13
13
  return files;
14
14
  }
15
- function toUrlPath(filePath) {
16
- return filePath.split(path.sep).join("/");
17
- }
18
15
  function addPathnameAlias(manifest, href, css) {
19
16
  try {
20
17
  const url = new URL(href);
@@ -27,7 +24,7 @@ function collectInlineCssManifest(clientDir, assetPrefix) {
27
24
  const urlPrefix = resolveAssetUrlPrefix(assetPrefix);
28
25
  const manifest = {};
29
26
  for (const filePath of collectCssFiles(assetsDir)) {
30
- const href = `${urlPrefix}${toUrlPath(path.relative(assetsDir, filePath))}`;
27
+ const href = `${urlPrefix}${path.relative(assetsDir, filePath)}`;
31
28
  const css = fs.readFileSync(filePath, "utf8");
32
29
  manifest[href] = css;
33
30
  addPathnameAlias(manifest, href, css);
@@ -17,7 +17,7 @@
17
17
  * its own diagnostic shape without the consumer having to fall back to
18
18
  * stringly-typed `reason` fields.
19
19
  */
20
- type ClassificationReason = {
20
+ export type ClassificationReason = {
21
21
  layer: "segment-config";
22
22
  key: "dynamic" | "revalidate";
23
23
  value: string | number;
@@ -32,7 +32,7 @@ type ClassificationReason = {
32
32
  } | {
33
33
  layer: "no-classifier";
34
34
  };
35
- type ModuleGraphStaticReason = {
35
+ export type ModuleGraphStaticReason = {
36
36
  layer: "module-graph";
37
37
  result: "static";
38
38
  firstShimMatch?: string;
@@ -45,7 +45,7 @@ type ModuleGraphStaticReason = {
45
45
  * `absent` means no classifier layer had anything to say — the caller should
46
46
  * defer to the next layer (or to the runtime probe).
47
47
  */
48
- type LayoutBuildClassification = {
48
+ export type LayoutBuildClassification = {
49
49
  kind: "absent";
50
50
  } | {
51
51
  kind: "static";
@@ -57,5 +57,4 @@ type LayoutBuildClassification = {
57
57
  kind: "needs-probe";
58
58
  reason: ClassificationReason;
59
59
  };
60
- //#endregion
61
- export { ClassificationReason, LayoutBuildClassification, ModuleGraphStaticReason };
60
+ //#endregion
@@ -1,20 +1,23 @@
1
1
  import { ClassificationReason, LayoutBuildClassification, ModuleGraphStaticReason } from "./layout-classification-types.js";
2
-
3
2
  //#region src/build/layout-classification.d.ts
4
3
  type ModuleGraphClassification = "static" | "needs-probe";
5
4
  type ModuleGraphClassificationResult = {
6
- result: ModuleGraphClassification; /** First dynamic shim module ID encountered during BFS, when any. */
5
+ result: ModuleGraphClassification;
6
+ /** First dynamic shim module ID encountered during BFS, when any. */
7
7
  firstShimMatch?: string;
8
8
  };
9
- type ModuleInfoProvider = {
9
+ export type ModuleInfoProvider = {
10
10
  getModuleInfo(id: string): {
11
11
  importedIds: string[];
12
12
  dynamicImportedIds: string[];
13
13
  } | null;
14
14
  };
15
15
  type LayoutEntry = {
16
- /** Rollup/Vite module ID for the layout file. */moduleId: string; /** Directory depth from the app root, used to build the stable layout ID. */
17
- treePosition: number; /** Segment config source code extracted at build time, or null when absent. */
16
+ /** Rollup/Vite module ID for the layout file. */
17
+ moduleId: string;
18
+ /** Directory depth from the app root, used to build the stable layout ID. */
19
+ treePosition: number;
20
+ /** Segment config source code extracted at build time, or null when absent. */
18
21
  segmentConfig?: {
19
22
  code: string;
20
23
  } | null;
@@ -32,12 +35,12 @@ type RouteForClassification = {
32
35
  * shim module ID (when any). Operators use the shim ID via the debug
33
36
  * channel to trace why a layout was flagged for probing.
34
37
  */
35
- declare function classifyLayoutByModuleGraph(layoutModuleId: string, dynamicShimPaths: ReadonlySet<string>, moduleInfo: ModuleInfoProvider): ModuleGraphClassificationResult;
36
- declare function moduleGraphReason(graphResult: ModuleGraphClassificationResult & {
38
+ export declare function classifyLayoutByModuleGraph(layoutModuleId: string, dynamicShimPaths: ReadonlySet<string>, moduleInfo: ModuleInfoProvider): ModuleGraphClassificationResult;
39
+ export declare function moduleGraphReason(graphResult: ModuleGraphClassificationResult & {
37
40
  result: "static";
38
41
  }): ModuleGraphStaticReason;
39
- declare function moduleGraphReason(graphResult: ModuleGraphClassificationResult): ClassificationReason;
40
- declare function isStaticModuleGraphResult(graphResult: ModuleGraphClassificationResult): graphResult is ModuleGraphClassificationResult & {
42
+ export declare function moduleGraphReason(graphResult: ModuleGraphClassificationResult): ClassificationReason;
43
+ export declare function isStaticModuleGraphResult(graphResult: ModuleGraphClassificationResult): graphResult is ModuleGraphClassificationResult & {
41
44
  result: "static";
42
45
  };
43
46
  /**
@@ -54,6 +57,5 @@ declare function isStaticModuleGraphResult(graphResult: ModuleGraphClassificatio
54
57
  * via the numeric-index manifest in `route-classification-manifest.ts`.
55
58
  * Used only by `tests/layout-classification.test.ts`.
56
59
  */
57
- declare function classifyAllRouteLayouts(routes: readonly RouteForClassification[], dynamicShimPaths: ReadonlySet<string>, moduleInfo: ModuleInfoProvider): Map<string, LayoutBuildClassification>;
58
- //#endregion
59
- export { ModuleInfoProvider, classifyAllRouteLayouts, classifyLayoutByModuleGraph, isStaticModuleGraphResult, moduleGraphReason };
60
+ export declare function classifyAllRouteLayouts(routes: readonly RouteForClassification[], dynamicShimPaths: ReadonlySet<string>, moduleInfo: ModuleInfoProvider): Map<string, LayoutBuildClassification>;
61
+ //#endregion
@@ -0,0 +1,3 @@
1
+ //#region src/build/module-dependency-cache.d.ts
2
+ export declare function createModuleDependencyCache<T>(collect: (moduleId: string) => Promise<T>): (moduleId: string) => Promise<T>;
3
+ //#endregion
@@ -0,0 +1,13 @@
1
+ //#region src/build/module-dependency-cache.ts
2
+ function createModuleDependencyCache(collect) {
3
+ const cache = /* @__PURE__ */ new Map();
4
+ return function getModuleDependencies(moduleId) {
5
+ const cached = cache.get(moduleId);
6
+ if (cached) return cached;
7
+ const pending = collect(moduleId);
8
+ cache.set(moduleId, pending);
9
+ return pending;
10
+ };
11
+ }
12
+ //#endregion
13
+ export { createModuleDependencyCache };
@@ -1,5 +1,4 @@
1
1
  import { ResolvedNextConfig } from "../config/next-config.js";
2
-
3
2
  //#region src/build/next-client-runtime-manifests.d.ts
4
3
  type EmitNextClientRuntimeManifestsOptions = {
5
4
  clientDir: string;
@@ -7,8 +6,7 @@ type EmitNextClientRuntimeManifestsOptions = {
7
6
  buildId: string;
8
7
  rewrites: ResolvedNextConfig["rewrites"];
9
8
  };
10
- declare function buildNextClientBuildManifestContent(rewrites: ResolvedNextConfig["rewrites"]): string;
11
- declare function buildNextClientSsgManifestContent(): string;
12
- declare function emitNextClientRuntimeManifests(options: EmitNextClientRuntimeManifestsOptions): void;
13
- //#endregion
14
- export { buildNextClientBuildManifestContent, buildNextClientSsgManifestContent, emitNextClientRuntimeManifests };
9
+ export declare function buildNextClientBuildManifestContent(rewrites: ResolvedNextConfig["rewrites"]): string;
10
+ export declare function buildNextClientSsgManifestContent(): string;
11
+ export declare function emitNextClientRuntimeManifests(options: EmitNextClientRuntimeManifestsOptions): void;
12
+ //#endregion
@@ -1,27 +1,10 @@
1
+ import path from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
2
+ import { toClientRewrites } from "../client/client-rewrites.js";
1
3
  import fs from "node:fs";
2
- import path from "node:path";
3
4
  //#region src/build/next-client-runtime-manifests.ts
4
- function normalizeRewriteForClientManifest(rewrite) {
5
- if (rewrite.destination.startsWith("/")) return {
6
- has: rewrite.has,
7
- source: rewrite.source,
8
- destination: rewrite.destination
9
- };
10
- return {
11
- has: rewrite.has,
12
- source: rewrite.source
13
- };
14
- }
15
- function normalizeRewritesForClientManifest(rewrites) {
16
- return {
17
- beforeFiles: rewrites.beforeFiles.map(normalizeRewriteForClientManifest),
18
- afterFiles: rewrites.afterFiles.map(normalizeRewriteForClientManifest),
19
- fallback: rewrites.fallback.map(normalizeRewriteForClientManifest)
20
- };
21
- }
22
5
  function buildNextClientBuildManifestContent(rewrites) {
23
6
  const manifest = {
24
- __rewrites: normalizeRewritesForClientManifest(rewrites),
7
+ __rewrites: toClientRewrites(rewrites),
25
8
  sortedPages: []
26
9
  };
27
10
  return `self.__BUILD_MANIFEST = ${JSON.stringify(manifest)};self.__BUILD_MANIFEST_CB && self.__BUILD_MANIFEST_CB()`;