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
package/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Run Next.js applications on Vite, with Cloudflare Workers as the primary deployment target.
4
4
 
5
+ **Website:** [vinext.dev](https://vinext.dev)
6
+
7
+ **Documentation:**
8
+
9
+ - [Caching](docs/caching.md)
10
+
5
11
  > **Read the announcement:** [How we rebuilt Next.js with AI in one week](https://blog.cloudflare.com/vinext/)
6
12
 
7
13
  > **Under active development.** vinext supports substantial Next.js applications today, but it is not yet a drop-in replacement for every application or production workload. Expect compatibility gaps, especially in newer App Router features, and evaluate it against your own application before adopting it.
@@ -32,7 +38,23 @@ Run `vinext check` against an existing application before migrating. If a gap is
32
38
 
33
39
  ## Quick start
34
40
 
35
- vinext includes an [Agent Skill](https://agentskills.io/home) that handles migration for you. It works with Claude Code, OpenCode, Cursor, Codex, and dozens of other AI coding tools. Install it, open your Next.js project, and tell the AI to migrate:
41
+ **Use the official setup commands below.** They are the recommended way to create or migrate a vinext project because they configure dependencies, scripts, Vite, and your deployment target for you.
42
+
43
+ Start a new project with `create-vinext-app`:
44
+
45
+ ```bash
46
+ pnpm create vinext-app@latest my-app
47
+ ```
48
+
49
+ Migrate an existing Next.js project with `vinext init`:
50
+
51
+ ```bash
52
+ npx vinext init
53
+ ```
54
+
55
+ ### Optional: migrate with an AI agent
56
+
57
+ Prefer `vinext init` for a direct, repeatable migration. If you want an AI agent to investigate compatibility issues and guide the migration, vinext also includes an optional [Agent Skill](https://agentskills.io/home). It works with Claude Code, OpenCode, Cursor, Codex, and dozens of other AI coding tools:
36
58
 
37
59
  ```sh
38
60
  npx skills add cloudflare/vinext
@@ -190,7 +212,10 @@ vinext works everywhere. It natively supports Cloudflare Workers (with `npx @vin
190
212
  vinext is a Vite plugin that reimplements the public Next.js API — routing, server rendering, `next/*` module imports, the CLI — so you can run Next.js applications on Vite instead of the Next.js compiler toolchain. It can be deployed anywhere: Cloudflare Workers is the first natively supported target, with other platforms available via Nitro. Native adapters for more platforms are [planned](https://github.com/cloudflare/vinext/issues/80).
191
213
 
192
214
  **Is this a fork of Next.js?**
193
- No. vinext is an alternative implementation of the Next.js API surface built on Vite. It does import some Next.js types and utilities, but the core is written from scratch. The goal is not to create a competing framework or add features beyond what Next.js offers; it is to provide the same well-defined API surface on Vite's toolchain.
215
+ No. vinext is an alternative implementation of the Next.js API surface built on Vite. The core is written from scratch. The goal is not to create a competing framework or add features beyond what Next.js offers; it is to provide the same well-defined API surface on Vite's toolchain.
216
+
217
+ **Does vinext require Next.js to be installed?**
218
+ No. vinext ships fallback declarations for the supported `next` and `next/*` APIs, so applications can run and type-check without the `next` package. If both packages are installed, vinext keeps using Next.js's authoritative types and adds only its own extensions. Compatibility features that consume Next.js internals, such as `styled-jsx`, may still require a matching Next.js installation when used.
194
219
 
195
220
  **How is this different from OpenNext?**
196
221
  [OpenNext](https://opennext.js.org/) adapts the _output_ of a standard `next build` to run on various platforms. Because it builds on Next.js's own output, it inherits broad API coverage and has been well-tested for much longer. vinext takes a different approach: it reimplements the Next.js APIs on Vite from scratch, which means faster builds and smaller bundles, but less coverage of the long tail of Next.js features. If you need a mature, well-tested way to run Next.js outside Vercel, OpenNext is the safer choice. If you want a lighter Vite-based toolchain and do not need every Next.js API, vinext may be a good fit.
@@ -326,24 +351,16 @@ Requires a custom domain (zone analytics are unavailable on `*.workers.dev`) and
326
351
 
327
352
  #### Custom Vite configuration
328
353
 
329
- If you need to customize the Vite config, create a `vite.config.ts`. vinext will merge its config with yours. This is required for Cloudflare Workers deployment with the App Router (RSC needs explicit plugin configuration):
354
+ If you need to customize the Vite config, create a `vite.config.ts`. vinext will merge its config with yours. For Cloudflare Workers deployment with the App Router, configure `@cloudflare/vite-plugin` so the RSC environment runs in workerd:
330
355
 
331
356
  ```ts
332
357
  import { defineConfig } from "vite";
333
358
  import vinext from "vinext";
334
- import rsc from "@vitejs/plugin-rsc";
335
359
  import { cloudflare } from "@cloudflare/vite-plugin";
336
360
 
337
361
  export default defineConfig({
338
362
  plugins: [
339
363
  vinext(),
340
- rsc({
341
- entries: {
342
- rsc: "virtual:vinext-rsc-entry",
343
- ssr: "virtual:vinext-app-ssr-entry",
344
- client: "virtual:vinext-app-browser-entry",
345
- },
346
- }),
347
364
  cloudflare({
348
365
  viteEnvironment: { name: "rsc", childEnvironments: ["ssr"] },
349
366
  }),
@@ -351,6 +368,54 @@ export default defineConfig({
351
368
  });
352
369
  ```
353
370
 
371
+ > **Do not register `@vitejs/plugin-rsc` yourself.** It is an optional peer dependency, so it must be
372
+ > _installed_ in your project, but vinext auto-registers it whenever an `app/` directory is detected.
373
+ > Adding an explicit `rsc()` call fails the build with `[vinext] Duplicate @vitejs/plugin-rsc detected`.
374
+ > Pass `rsc: false` to `vinext()` only if you want to own that registration.
375
+
376
+ #### Module Federation (client-side)
377
+
378
+ For client-side Module Federation, configure React and React DOM as singleton shared modules in both the host and remotes:
379
+
380
+ ```ts
381
+ import { federation } from "@module-federation/vite";
382
+ import { defineConfig } from "vite";
383
+ import vinext from "vinext";
384
+
385
+ export default defineConfig({
386
+ plugins: [
387
+ federation({
388
+ name: "host",
389
+ shared: {
390
+ react: { singleton: true },
391
+ "react/": { singleton: true },
392
+ "react-dom": { singleton: true },
393
+ "react-dom/": { singleton: true },
394
+ },
395
+ }),
396
+ vinext(),
397
+ ],
398
+ });
399
+ ```
400
+
401
+ In a remote client component, use `getVinextReact()` before reading React hooks. vinext registers the host's browser React instance before application modules execute, and the first registration remains stable across remote evaluation and HMR:
402
+
403
+ ```tsx
404
+ "use client";
405
+
406
+ import * as React from "react";
407
+ import { getVinextReact } from "vinext/client";
408
+
409
+ const { useState } = getVinextReact(React);
410
+
411
+ export function RemoteCounter() {
412
+ const [count, setCount] = useState(0);
413
+ return <button onClick={() => setCount((value) => value + 1)}>{count}</button>;
414
+ }
415
+ ```
416
+
417
+ This bridge is browser-only. It does not provide App Router Module Federation SSR or transparently replace React imports inside third-party packages; compatible React versions remain the responsibility of the Module Federation `shared` configuration.
418
+
354
419
  See the [examples](#live-examples) for complete working configurations.
355
420
 
356
421
  ### Other platforms (via Nitro)
@@ -456,13 +521,14 @@ These are deployed to Cloudflare Workers and updated on every push to `main`:
456
521
  | Nextra Docs | Nextra docs site (MDX, App Router) | [nextra-docs-template.vinext.workers.dev](https://nextra-docs-template.vinext.workers.dev) |
457
522
  | App Router (minimal) | Minimal App Router on Workers | [app-router-cloudflare.vinext.workers.dev](https://app-router-cloudflare.vinext.workers.dev) |
458
523
  | Pages Router (minimal) | Minimal Pages Router on Workers | [pages-router-cloudflare.vinext.workers.dev](https://pages-router-cloudflare.vinext.workers.dev) |
524
+ | Static export | [Hybrid App/Pages Router site](examples/static-export) served as assets only | [static-export.vinext.workers.dev](https://static-export.vinext.workers.dev) |
459
525
  | RealWorld API | REST API routes example | [realworld-api-rest.vinext.workers.dev](https://realworld-api-rest.vinext.workers.dev) |
460
- | Benchmarks Dashboard | Build performance tracking over time (D1-backed) | [vinext-web.vinext.workers.dev/benchmarks](https://vinext-web.vinext.workers.dev/benchmarks) |
526
+ | Benchmarks Dashboard | Build performance tracking over time (D1-backed) | [vinext.dev/benchmarks](https://vinext.dev/benchmarks) |
461
527
  | App Router + Nitro | App Router deployed via Nitro (multi-platform) | [examples/app-router-nitro](examples/app-router-nitro) |
462
528
 
463
529
  ## API coverage
464
530
 
465
- ~94% of the Next.js 16 API surface has full or partial support. The remaining gaps are intentional stubs for deprecated features and Partial Prerendering (which Next.js 16 reworked into `"use cache"` — that directive is fully supported).
531
+ ~94% of the Next.js 16 API surface has full or partial support. The remaining gaps are intentional stubs for deprecated features, plus Partial Prerendering and Cache Components. Next.js 16 reworked PPR into `"use cache"`; vinext implements that directive for file-level and function-level caching, but full `cacheComponents` behavior is still incomplete — see [Known gaps we're working on](#known-gaps-were-working-on).
466
532
 
467
533
  > ✅ = full implementation | 🟡 = partial (runtime behavior correct, some build-time optimizations missing) | ⬜ = intentional stub/no-op
468
534
 
@@ -545,6 +611,33 @@ Every `next/*` import is shimmed to a Vite-compatible implementation.
545
611
  | `images` config | 🟡 | Parsed but not used for optimization |
546
612
  | `experimental.optimizePackageImports` | ✅ | Rewrites barrel imports to direct sub-module imports in RSC/SSR environments. A default set (lucide-react, date-fns, radix-ui, antd, MUI, and others) are always optimized. Add package names here to extend the list. |
547
613
  | `vinext({ nextConfig })` | ✅ | Inline Next-style config from `vite.config.*`. Supports object-form and function-form config. When provided, this overrides root `next.config.*`. |
614
+ | `vinext({ react: { compiler: true } })` | ✅ | React Compiler auto memoization. Needs `@vitejs/plugin-react` 6.1+ and the optional `oxc-transform-react` package. |
615
+
616
+ ### React Compiler
617
+
618
+ vinext auto-registers `@vitejs/plugin-react`, so the React Compiler is enabled through the same `react` option:
619
+
620
+ ```ts
621
+ import { defineConfig } from "vite";
622
+ import vinext from "vinext";
623
+
624
+ export default defineConfig({
625
+ plugins: [vinext({ react: { compiler: true } })],
626
+ });
627
+ ```
628
+
629
+ The transform itself ships separately, so install it alongside:
630
+
631
+ ```bash
632
+ npm install -D oxc-transform-react
633
+ ```
634
+
635
+ This requires `@vitejs/plugin-react` 6.1.0 or newer. Older versions accept the option and drop it, so vinext fails with an actionable error instead of leaving the compiler silently disabled. The compiler runs on the client environment only.
636
+
637
+ One caveat: modules whose JSX is lowered earlier in the pipeline are not memoized. Those build and behave correctly, they just miss auto memoization:
638
+
639
+ - JSX in plain `.js` files, which `vinext:jsx-in-js` compiles first so the compiler can parse them at all. Rename to `.jsx` or `.tsx` to get memoization.
640
+ - Components using `<style jsx>`, which `vinext:styled-jsx` compiles through the Next.js SWC transform before the compiler runs.
548
641
 
549
642
  ### Environment variable loading (`.env*`)
550
643
 
@@ -584,16 +677,21 @@ The cache is pluggable. The default `MemoryCacheHandler` works out of the box. S
584
677
  Instead of wiring up cache handlers imperatively from a worker entry, you can declare them in the `vinext()` plugin config. The `@vinext/cloudflare` package ships Cloudflare adapters for this:
585
678
 
586
679
  - **`kvDataAdapter()`** (`@vinext/cloudflare/cache/kv-data-adapter`) — backs the `"use cache"` data cache with a Workers KV namespace.
680
+ - **`cdnAdapter()`** (`@vinext/cloudflare/cache/cdn-adapter`) — serves page-level ISR from the Cloudflare Workers Cache (`ctx.cache`) instead of from the origin.
681
+
682
+ The two fill different slots and can be used together:
587
683
 
588
684
  ```ts
589
685
  import { defineConfig } from "vite";
590
686
  import vinext from "vinext";
687
+ import { cdnAdapter } from "@vinext/cloudflare/cache/cdn-adapter";
591
688
  import { kvDataAdapter } from "@vinext/cloudflare/cache/kv-data-adapter";
592
689
 
593
690
  export default defineConfig({
594
691
  plugins: [
595
692
  vinext({
596
693
  cache: {
694
+ cdn: cdnAdapter(),
597
695
  data: kvDataAdapter(),
598
696
  },
599
697
  }),
@@ -609,9 +707,37 @@ The KV data adapter reads `env[binding]` at runtime, so add the matching KV name
609
707
  }
610
708
  ```
611
709
 
612
- `binding` defaults to `VINEXT_KV_CACHE`, so `kvDataAdapter()` with no options works as long as that's your binding name. Other options: `appPrefix` (namespace cache keys to isolate multiple apps in one KV namespace), `ttlSeconds` (default KV `expirationTtl`, default 30 days), and `tagCacheTtlMs` (in-memory tag-invalidation cache TTL, default 5s).
710
+ `binding` defaults to `VINEXT_KV_CACHE`, so `kvDataAdapter()` with no options works as long as that's your binding name. Other options: `appPrefix` (namespace cache keys to isolate multiple apps in one KV namespace), `ttlSeconds` (default KV `expirationTtl`, default 30 days), `tagCacheTtlMs` (in-memory tag-invalidation cache TTL, default 5s), and `entryCacheTtlSeconds` (optional KV edge-cache TTL for entry reads; tag markers keep KV's default).
711
+
712
+ When `cdnAdapter()` is used in a Cloudflare build, vinext emits two Worker
713
+ entrypoints and configures Workers Cache only on the response entrypoint. The
714
+ default entrypoint keeps caching disabled so middleware and request-time routing
715
+ run on every request. Do not enable Workers Cache on the default entrypoint in
716
+ your source `wrangler.jsonc`; the generated `dist/server/wrangler.json` contains
717
+ the per-entrypoint cache settings and version metadata binding used for staged
718
+ discovery and warming.
719
+
720
+ The generated version metadata binding lets staged discovery and warming verify
721
+ the uploaded Worker version. Pass `versionMetadataBinding` to `cdnAdapter()`
722
+ only when the deployment needs a custom binding name.
613
723
 
614
- Each builder returns a plain, serializable `{ adapter, options }` descriptor — **it never touches the Workers runtime**, so nothing throws at build or dev time when bindings aren't available. The actual adapter (and its `env` binding lookup) is instantiated lazily on the first request.
724
+ `vinext-cloudflare deploy --experimental-warm-cdn-cache` performs the two-stage
725
+ upload and makes one final cache-fill request per admitted identity by default.
726
+ Add `--warm-cdn-certify` only to opt into a second, header-only request that
727
+ must prove every planned entry reusable before promotion.
728
+
729
+ While the data adapter can store entries and serve HIT/STALE itself, the CDN adapter delegates serving to Cloudflare's edge: the origin renders fresh responses and tags them with `Cache-Tag`, and `revalidateTag()` / `revalidatePath()` purge the edge through `ctx.cache.purge({ tags })`. See [examples/response-store-demo](examples/response-store-demo) for the Workers Response Store adapter.
730
+
731
+ The response entrypoint adds a transport-only digest of the complete stage
732
+ identity to its Workers Cache URL. That internal key is independent of zone
733
+ Cache Rules and prevents distinct query, representation, rewrite, or
734
+ interception identities from colliding.
735
+
736
+ Adapter declarations do not access the Workers runtime, so nothing throws at
737
+ config-evaluation or dev time when bindings are unavailable. Builders may also
738
+ provide platform-specific output hooks; `cdnAdapter()` uses one to configure
739
+ the Cloudflare entrypoints after the application build. Runtime adapters (and
740
+ their `env` binding lookups) are instantiated lazily on the first request.
615
741
 
616
742
  Registration is wired into **every router and runtime** — App Router and Pages Router, on Cloudflare Workers as well as the Node.js server (`vinext start`) and dev. It self-guards (instantiated once per isolate) and is resilient: if an adapter can't initialize on a given runtime (e.g. a KV binding doesn't exist on the Node server), vinext logs a warning and falls back to the default handler instead of failing requests.
617
743
 
@@ -622,9 +748,7 @@ vinext({
622
748
  cache: {
623
749
  data: {
624
750
  adapter: require.resolve("./my-adapter.js"),
625
- options: {
626
- /* … */
627
- },
751
+ options: {/* … */},
628
752
  },
629
753
  },
630
754
  });
@@ -656,7 +780,7 @@ We measure three things:
656
780
  - **Client bundle size** — gzipped output of each build.
657
781
  - **Dev server cold start** — 10 runs, randomized execution order. Vite's dependency optimizer cache is cleared before each run.
658
782
 
659
- Benchmarks run on GitHub CI runners (2-core Ubuntu) on every merge to `main`. See the launch numbers in the [announcement blog post](https://blog.cloudflare.com/vinext/) and the latest results at **[vinext-web.vinext.workers.dev/benchmarks](https://vinext-web.vinext.workers.dev/benchmarks)**.
783
+ Benchmarks run on GitHub CI runners (2-core Ubuntu) on every merge to `main`. See the launch numbers in the [announcement blog post](https://blog.cloudflare.com/vinext/) and the latest results at **[vinext.dev/benchmarks](https://vinext.dev/benchmarks)**.
660
784
 
661
785
  <details>
662
786
  <summary>Why the bundle size difference?</summary>
@@ -0,0 +1,41 @@
1
+ import { AppRoute } from "../routing/app-route-graph.js";
2
+ import { Rollup } from "vite";
3
+ import { RscPluginManager } from "@vitejs/plugin-rsc";
4
+ //#region src/build/action-owner-manifest.d.ts
5
+ type ActionOwnerRoute = Pick<AppRoute, "errorPath" | "errorPaths" | "forbiddenPath" | "forbiddenPaths" | "layoutErrorPaths" | "layouts" | "loadingPath" | "loadingPaths" | "notFoundPath" | "notFoundPaths" | "pagePath" | "parallelSlots" | "pattern" | "siblingIntercepts" | "templates" | "unauthorizedPath" | "unauthorizedPaths">;
6
+ export type ActionOwnerRouteReachability = Map<string, {
7
+ clientReferenceImportIds: Set<string>;
8
+ serverReferenceIds: Set<string>;
9
+ }>;
10
+ type ActionOwnerModuleInfo = Pick<Rollup.ModuleInfo, "dynamicallyImportedIds" | "importedIds">;
11
+ type ActionOwnerReferenceMaps = {
12
+ clientReferenceMetaMap: RscPluginManager["clientReferenceMetaMap"];
13
+ serverReferenceMetaMap: RscPluginManager["serverReferences"]["metaMap"];
14
+ };
15
+ export declare function actionOwnerRouteEntryIds(route: ActionOwnerRoute): string[];
16
+ export declare function collectReachableActionReferences(options: {
17
+ canonicalizeModuleId?: (id: string) => string;
18
+ getModuleInfo: (id: string) => ActionOwnerModuleInfo | null;
19
+ roots: readonly string[];
20
+ } & ActionOwnerReferenceMaps): {
21
+ clientReferenceImportIds: Set<string>;
22
+ serverReferenceIds: Set<string>;
23
+ };
24
+ export declare function collectRscActionReachability(options: {
25
+ canonicalizeModuleId?: (id: string) => string;
26
+ getModuleInfo: (id: string) => ActionOwnerModuleInfo | null;
27
+ routes: readonly ActionOwnerRoute[];
28
+ sharedRoots?: readonly string[];
29
+ } & ActionOwnerReferenceMaps): ActionOwnerRouteReachability;
30
+ export declare function resolveClientReferenceImportIds(options: {
31
+ canonicalizeModuleId?: (id: string) => string;
32
+ resolveId: (id: string) => Promise<string | null>;
33
+ routeReachability: ActionOwnerRouteReachability;
34
+ }): Promise<void>;
35
+ export declare function addClientActionReachability(options: {
36
+ canonicalizeModuleId?: (id: string) => string;
37
+ getModuleInfo: (id: string) => ActionOwnerModuleInfo | null;
38
+ routeReachability: ActionOwnerRouteReachability;
39
+ } & ActionOwnerReferenceMaps): void;
40
+ export declare function buildActionOwnerManifest(routeReachability: ActionOwnerRouteReachability): Record<string, string[]>;
41
+ //#endregion
@@ -0,0 +1,110 @@
1
+ //#region src/build/action-owner-manifest.ts
2
+ function actionOwnerRouteEntryIds(route) {
3
+ return [
4
+ route.pagePath,
5
+ ...route.layouts,
6
+ ...route.templates,
7
+ route.loadingPath,
8
+ ...route.loadingPaths ?? [],
9
+ route.errorPath,
10
+ ...route.layoutErrorPaths ?? [],
11
+ ...route.errorPaths ?? [],
12
+ route.notFoundPath,
13
+ ...route.notFoundPaths ?? [],
14
+ route.forbiddenPath,
15
+ ...route.forbiddenPaths ?? [],
16
+ route.unauthorizedPath,
17
+ ...route.unauthorizedPaths ?? [],
18
+ ...route.parallelSlots.flatMap((slot) => [
19
+ slot.pagePath,
20
+ slot.defaultPath,
21
+ slot.layoutPath,
22
+ ...slot.configLayoutPaths ?? [],
23
+ slot.loadingPath,
24
+ ...slot.loadingPaths ?? [],
25
+ slot.errorPath,
26
+ slot.notFoundPath,
27
+ ...slot.interceptingRoutes.flatMap((intercept) => [
28
+ intercept.pagePath,
29
+ ...intercept.layoutPaths,
30
+ ...intercept.loadingPaths ?? [],
31
+ intercept.notFoundPath
32
+ ])
33
+ ]),
34
+ ...route.siblingIntercepts.flatMap((intercept) => [
35
+ intercept.pagePath,
36
+ ...intercept.layoutPaths,
37
+ ...intercept.loadingPaths ?? [],
38
+ intercept.notFoundPath
39
+ ])
40
+ ].filter((value) => typeof value === "string");
41
+ }
42
+ function collectReachableActionReferences(options) {
43
+ const canonicalizeModuleId = options.canonicalizeModuleId ?? ((id) => id);
44
+ const clientReferenceImportIds = /* @__PURE__ */ new Set();
45
+ const serverReferenceIds = /* @__PURE__ */ new Set();
46
+ const visited = /* @__PURE__ */ new Set();
47
+ const queue = options.roots.map(canonicalizeModuleId);
48
+ for (let index = 0; index < queue.length; index++) {
49
+ const id = queue[index];
50
+ if (visited.has(id)) continue;
51
+ visited.add(id);
52
+ const clientReference = options.clientReferenceMetaMap[id];
53
+ if (clientReference) clientReferenceImportIds.add(clientReference.importId);
54
+ const serverReference = options.serverReferenceMetaMap.get(id);
55
+ if (serverReference) for (const exportName of serverReference.exportNames) serverReferenceIds.add(`${serverReference.referenceKey}#${exportName}`);
56
+ const info = options.getModuleInfo(id);
57
+ for (const importedId of [...info?.importedIds ?? [], ...info?.dynamicallyImportedIds ?? []]) if (!visited.has(importedId)) queue.push(importedId);
58
+ }
59
+ return {
60
+ clientReferenceImportIds,
61
+ serverReferenceIds
62
+ };
63
+ }
64
+ function collectRscActionReachability(options) {
65
+ const routeReachability = new Map(options.routes.map((route) => [route.pattern, collectReachableActionReferences({
66
+ canonicalizeModuleId: options.canonicalizeModuleId,
67
+ clientReferenceMetaMap: options.clientReferenceMetaMap,
68
+ getModuleInfo: options.getModuleInfo,
69
+ roots: actionOwnerRouteEntryIds(route),
70
+ serverReferenceMetaMap: options.serverReferenceMetaMap
71
+ })]));
72
+ if (options.sharedRoots?.length) routeReachability.set("*", collectReachableActionReferences({
73
+ canonicalizeModuleId: options.canonicalizeModuleId,
74
+ clientReferenceMetaMap: options.clientReferenceMetaMap,
75
+ getModuleInfo: options.getModuleInfo,
76
+ roots: options.sharedRoots,
77
+ serverReferenceMetaMap: options.serverReferenceMetaMap
78
+ }));
79
+ return routeReachability;
80
+ }
81
+ async function resolveClientReferenceImportIds(options) {
82
+ const canonicalizeModuleId = options.canonicalizeModuleId ?? ((id) => id);
83
+ for (const reachability of options.routeReachability.values()) {
84
+ const resolvedImportIds = /* @__PURE__ */ new Set();
85
+ for (const importId of reachability.clientReferenceImportIds) {
86
+ const resolvedId = await options.resolveId(importId) ?? importId;
87
+ resolvedImportIds.add(canonicalizeModuleId(resolvedId));
88
+ }
89
+ reachability.clientReferenceImportIds = resolvedImportIds;
90
+ }
91
+ }
92
+ function addClientActionReachability(options) {
93
+ for (const reachability of options.routeReachability.values()) {
94
+ const clientReachability = collectReachableActionReferences({
95
+ canonicalizeModuleId: options.canonicalizeModuleId,
96
+ clientReferenceMetaMap: options.clientReferenceMetaMap,
97
+ getModuleInfo: options.getModuleInfo,
98
+ roots: [...reachability.clientReferenceImportIds],
99
+ serverReferenceMetaMap: options.serverReferenceMetaMap
100
+ });
101
+ for (const actionId of clientReachability.serverReferenceIds) reachability.serverReferenceIds.add(actionId);
102
+ }
103
+ }
104
+ function buildActionOwnerManifest(routeReachability) {
105
+ const manifest = {};
106
+ for (const [pattern, reachability] of routeReachability) for (const actionId of reachability.serverReferenceIds) (manifest[actionId] ??= []).push(pattern);
107
+ return manifest;
108
+ }
109
+ //#endregion
110
+ export { actionOwnerRouteEntryIds, addClientActionReachability, buildActionOwnerManifest, collectReachableActionReferences, collectRscActionReachability, resolveClientReferenceImportIds };
@@ -16,7 +16,7 @@
16
16
  * patterns with `.gitignore` semantics (via the `ignore` package), so the bare
17
17
  * `.vite` entry excludes the directory and everything beneath it.
18
18
  */
19
- declare const DEFAULT_VINEXT_ASSET_IGNORE_PATTERNS: readonly string[];
19
+ export declare const DEFAULT_VINEXT_ASSET_IGNORE_PATTERNS: readonly string[];
20
20
  /**
21
21
  * Ensure a `.assetsignore` in `clientDir` contains every pattern in `patterns`.
22
22
  *
@@ -27,6 +27,5 @@ declare const DEFAULT_VINEXT_ASSET_IGNORE_PATTERNS: readonly string[];
27
27
  * @returns `true` when the file was created or modified, `false` when it already
28
28
  * covered every requested pattern.
29
29
  */
30
- declare function ensureAssetsIgnore(clientDir: string, patterns?: readonly string[]): boolean;
31
- //#endregion
32
- export { DEFAULT_VINEXT_ASSET_IGNORE_PATTERNS, ensureAssetsIgnore };
30
+ export declare function ensureAssetsIgnore(clientDir: string, patterns?: readonly string[]): boolean;
31
+ //#endregion
@@ -1,5 +1,5 @@
1
+ import path from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
1
2
  import fs from "node:fs";
2
- import path from "node:path";
3
3
  //#region src/build/assets-ignore.ts
4
4
  /**
5
5
  * Build metadata that must never be served by the Cloudflare ASSETS binding.
@@ -8,6 +8,5 @@ type CleanBuildOutputResult = {
8
8
  cleaned: boolean;
9
9
  outDir: string;
10
10
  };
11
- declare function cleanBuildOutput(options: CleanBuildOutputOptions): CleanBuildOutputResult;
12
- //#endregion
13
- export { cleanBuildOutput };
11
+ export declare function cleanBuildOutput(options: CleanBuildOutputOptions): CleanBuildOutputResult;
12
+ //#endregion
@@ -1,15 +1,12 @@
1
+ import path from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
2
+ import { isPathInsideOrEqual } from "../utils/path.js";
1
3
  import fs from "node:fs";
2
- import path from "node:path";
3
4
  //#region src/build/clean-output.ts
4
5
  function resolveOutDir(root, outDir) {
5
6
  const resolvedRoot = path.resolve(root);
6
7
  if (!outDir) return path.join(resolvedRoot, "dist");
7
8
  return path.isAbsolute(outDir) ? outDir : path.resolve(resolvedRoot, outDir);
8
9
  }
9
- function isPathInsideOrEqual(parent, child) {
10
- const relative = path.relative(parent, child);
11
- return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
12
- }
13
10
  function shouldCleanBuildOutput(options) {
14
11
  if (options.emptyOutDir === false) return false;
15
12
  if (options.emptyOutDir === true) return true;
@@ -1,5 +1,4 @@
1
1
  import { UserConfig } from "vite";
2
-
3
2
  //#region src/build/client-build-config.d.ts
4
3
  type ClientAssetFileNameInfo = {
5
4
  readonly name?: string;
@@ -13,7 +12,7 @@ type ClientAssetFileNameInfo = {
13
12
  * function so it can inspect every source-name candidate Rolldown records for
14
13
  * an asset (a single output asset can carry several `originalFileNames`).
15
14
  */
16
- declare function createClientAssetFileNames(assetsDir: string): (assetInfo: ClientAssetFileNameInfo) => string;
15
+ export declare function createClientAssetFileNames(assetsDir: string): (assetInfo: ClientAssetFileNameInfo) => string;
17
16
  /**
18
17
  * Create a manualChunks function for client builds.
19
18
  *
@@ -39,12 +38,12 @@ declare function createClientAssetFileNames(assetsDir: string): (assetInfo: Clie
39
38
  * well: shared dependencies between routes get their own chunks,
40
39
  * and route-specific code stays in route chunks.
41
40
  */
42
- declare function createClientManualChunks(shimsDir: string, preserveRouteBoundaries?: boolean): (id: string) => string | undefined;
43
- declare function createClientFileNameConfig(assetsDir: string): {
41
+ export declare function createClientManualChunks(shimsDir: string, preserveRouteBoundaries?: boolean): (id: string) => string | undefined;
42
+ export declare function createClientFileNameConfig(assetsDir: string): {
44
43
  entryFileNames: string;
45
44
  chunkFileNames: string;
46
45
  };
47
- declare function createClientCodeSplittingConfig(clientManualChunks: (id: string) => string | undefined): {
46
+ export declare function createClientCodeSplittingConfig(clientManualChunks: (id: string) => string | undefined): {
48
47
  minSize: number;
49
48
  groups: {
50
49
  name(moduleId: string): string | null;
@@ -55,8 +54,16 @@ declare function createClientCodeSplittingConfig(clientManualChunks: (id: string
55
54
  * Derived from the package list so the regex and {@link isRscFrameworkModule}
56
55
  * predicate can't drift.
57
56
  */
58
- declare const RSC_FRAMEWORK_CHUNK_TEST: RegExp;
59
- declare function isRscFrameworkModule(id: string): boolean;
57
+ export declare const RSC_FRAMEWORK_CHUNK_TEST: RegExp;
58
+ export declare function isRscFrameworkModule(id: string): boolean;
59
+ /**
60
+ * Keep virtual entry ids out of emitted RSC chunk filenames.
61
+ *
62
+ * Rolldown's entries-aware chunk names can contain the `\\0` virtual-id marker,
63
+ * which is not a portable module-specifier or filesystem name. Preserve every
64
+ * other character and remove both the printable and actual-NUL forms.
65
+ */
66
+ export declare function sanitizeRscChunkFileName(name: string): string;
60
67
  /**
61
68
  * Output config that isolates React (and the RSC flight runtime) into a
62
69
  * dedicated "framework" chunk in the RSC server build. See
@@ -64,7 +71,8 @@ declare function isRscFrameworkModule(id: string): boolean;
64
71
  * modules that are only reachable through dynamic imports must stay out of the
65
72
  * eager framework chunk (issue #2073).
66
73
  */
67
- declare function createRscFrameworkChunkOutputConfig(): {
74
+ export declare function createRscFrameworkChunkOutputConfig(): {
75
+ sanitizeFileName: typeof sanitizeRscChunkFileName;
68
76
  codeSplitting: {
69
77
  groups: {
70
78
  name: string;
@@ -81,12 +89,30 @@ declare function createRscFrameworkChunkOutputConfig(): {
81
89
  * treats node_modules as side-effect-free while preserving side effects in
82
90
  * local code.
83
91
  */
84
- declare function getClientTreeshakeConfig(): {
92
+ export declare function getClientTreeshakeConfig(): {
85
93
  moduleSideEffects: "no-external";
86
94
  };
87
95
  type VinextBuildConfig = NonNullable<UserConfig["build"]>;
88
96
  type VinextBuildBundlerOptions = NonNullable<VinextBuildConfig["rolldownOptions"]>;
89
- declare function getBuildBundlerOptions(build: UserConfig["build"] | undefined): VinextBuildBundlerOptions | undefined;
90
- declare function withBuildBundlerOptions(bundlerOptions: VinextBuildBundlerOptions): Partial<VinextBuildConfig>;
91
- //#endregion
92
- export { RSC_FRAMEWORK_CHUNK_TEST, createClientAssetFileNames, createClientCodeSplittingConfig, createClientFileNameConfig, createClientManualChunks, createRscFrameworkChunkOutputConfig, getBuildBundlerOptions, getClientTreeshakeConfig, isRscFrameworkModule, withBuildBundlerOptions };
97
+ export declare function getBuildBundlerOptions(build: UserConfig["build"] | undefined): VinextBuildBundlerOptions | undefined;
98
+ export declare function withBuildBundlerOptions(bundlerOptions: VinextBuildBundlerOptions): Partial<VinextBuildConfig>;
99
+ type VinextBuildOutput = Exclude<NonNullable<VinextBuildBundlerOptions["output"]>, readonly unknown[]>;
100
+ type VinextCodeSplittingConfig = Exclude<NonNullable<VinextBuildOutput["codeSplitting"]>, boolean>;
101
+ type ChunkFileNames = NonNullable<VinextBuildOutput["chunkFileNames"]>;
102
+ type ChunkFileNameFunction = Exclude<ChunkFileNames, string>;
103
+ /**
104
+ * Keep vinext modules partitioned by the stage entries that actually use them.
105
+ * Without an entry-aware catch-all, Rolldown may merge a small helper shared by
106
+ * request/response entries into a response-heavy chunk; importing that helper
107
+ * then evaluates React and renderer code on a request-stage cache hit.
108
+ */
109
+ export declare function createMultiStageCodeSplittingConfig(existing: VinextBuildOutput["codeSplitting"]): VinextCodeSplittingConfig & {
110
+ groups: NonNullable<VinextCodeSplittingConfig["groups"]>;
111
+ };
112
+ /**
113
+ * Keep router stage chunks beside the server entry so their generated
114
+ * `./vinext-client-assets.js` external continues to resolve. Other chunks keep
115
+ * the host's existing output pattern (or vinext's server-assets default).
116
+ */
117
+ export declare function createMultiStageChunkFileNames(assetsDir: string, existing: VinextBuildOutput["chunkFileNames"]): ChunkFileNameFunction;
118
+ //#endregion