vinext 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (529) hide show
  1. package/README.md +5 -2
  2. package/THIRD_PARTY_LICENSES.md +47 -0
  3. package/dist/_virtual/_rolldown/runtime.js +4 -3
  4. package/dist/build/action-owner-manifest.d.ts +3 -2
  5. package/dist/build/action-owner-manifest.js +18 -2
  6. package/dist/build/app-page-static-eligibility.d.ts +17 -1
  7. package/dist/build/app-page-static-eligibility.js +80 -13
  8. package/dist/build/clean-output.d.ts +2 -1
  9. package/dist/build/client-build-config.d.ts +13 -3
  10. package/dist/build/client-build-config.js +46 -9
  11. package/dist/build/client-reference-async.d.ts +48 -0
  12. package/dist/build/client-reference-async.js +123 -0
  13. package/dist/build/client-reference-chunks.d.ts +32 -0
  14. package/dist/build/client-reference-chunks.js +111 -0
  15. package/dist/build/client-reference-groups.d.ts +9 -1
  16. package/dist/build/client-reference-groups.js +40 -2
  17. package/dist/build/css-url-assets.d.ts +2 -1
  18. package/dist/build/google-fonts/fallback-metrics.d.ts +2 -1
  19. package/dist/build/google-fonts/find-font-files-in-css.d.ts +1 -0
  20. package/dist/build/google-fonts/find-font-files-in-css.js +17 -4
  21. package/dist/build/google-fonts/font-metadata.d.ts +2 -1
  22. package/dist/build/google-fonts/validate.d.ts +2 -1
  23. package/dist/build/inline-css.d.ts +2 -1
  24. package/dist/build/module-dependency-cache.d.ts +2 -1
  25. package/dist/build/next-client-runtime-manifests.d.ts +2 -1
  26. package/dist/build/precompress.d.ts +2 -1
  27. package/dist/build/precompress.js +1 -1
  28. package/dist/build/prerender-paths.d.ts +2 -1
  29. package/dist/build/prerender-phase.d.ts +2 -1
  30. package/dist/build/prerender-server-pool.js +1 -1
  31. package/dist/build/prerender.d.ts +3 -2
  32. package/dist/build/prerender.js +6 -5
  33. package/dist/build/report.d.ts +2 -15
  34. package/dist/build/report.js +1 -51
  35. package/dist/build/run-prerender.d.ts +2 -1
  36. package/dist/build/server-actions-encryption-key.d.ts +2 -1
  37. package/dist/build/ssr-manifest.js +25 -2
  38. package/dist/build/standalone.d.ts +2 -1
  39. package/dist/cache/cache-adapters-virtual.d.ts +2 -1
  40. package/dist/cache.js +1 -2
  41. package/dist/check.d.ts +2 -1
  42. package/dist/check.js +5 -1
  43. package/dist/cli-args.d.ts +2 -1
  44. package/dist/cli.js +5 -0
  45. package/dist/client/client-redirect-matcher.js +2 -1
  46. package/dist/client/client-redirects.d.ts +4 -3
  47. package/dist/client/client-redirects.js +2 -1
  48. package/dist/client/client-rewrites.d.ts +2 -1
  49. package/dist/client/dev-error-overlay-store.d.ts +2 -1
  50. package/dist/client/dev-error-overlay.js +1 -1
  51. package/dist/client/index.js +1 -2
  52. package/dist/client/instrumentation-client-state.js +5 -5
  53. package/dist/client/navigation-runtime.d.ts +16 -2
  54. package/dist/client/navigation-runtime.js +2 -2
  55. package/dist/client/pages-router-link-navigation.d.ts +2 -1
  56. package/dist/client/vinext-next-data.d.ts +25 -1
  57. package/dist/client/window-next.d.ts +2 -1
  58. package/dist/config/config-matchers.d.ts +12 -1
  59. package/dist/config/config-matchers.js +111 -16
  60. package/dist/config/dotenv.d.ts +2 -1
  61. package/dist/config/next-config.d.ts +32 -1
  62. package/dist/config/next-config.js +93 -5
  63. package/dist/config/tsconfig-paths.d.ts +2 -1
  64. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/dbcs-codec.js +327 -0
  65. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/dbcs-data.js +123 -0
  66. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/index.js +29 -0
  67. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/internal.js +134 -0
  68. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-codec.js +50 -0
  69. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-data-generated.js +455 -0
  70. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-data.js +147 -0
  71. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/big5-added.json.js +169 -0
  72. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp936.json.js +2584 -0
  73. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp949.json.js +2220 -0
  74. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp950.json.js +227 -0
  75. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/eucjp.json.js +425 -0
  76. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/gb18030-ranges.json.js +427 -0
  77. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/gbk-added.json.js +229 -0
  78. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/shiftjis.json.js +292 -0
  79. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/utf16.js +106 -0
  80. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/utf7.js +182 -0
  81. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/bom-handling.js +42 -0
  82. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/extend-node.js +147 -0
  83. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/index.js +94 -0
  84. package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/streams.js +95 -0
  85. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/detector.js +23 -0
  86. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/index.js +2 -0
  87. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/lookup.js +25 -0
  88. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/bmp.js +11 -0
  89. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/cur.js +15 -0
  90. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/dds.js +11 -0
  91. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/gif.js +12 -0
  92. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/heif.js +55 -0
  93. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/icns.js +76 -0
  94. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ico.js +39 -0
  95. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/index.js +46 -0
  96. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/j2c.js +11 -0
  97. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jp2.js +21 -0
  98. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jpg.js +71 -0
  99. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl-stream.js +42 -0
  100. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl.js +46 -0
  101. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ktx.js +19 -0
  102. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/png.js +28 -0
  103. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/pnm.js +54 -0
  104. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/psd.js +11 -0
  105. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/svg.js +79 -0
  106. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tga.js +15 -0
  107. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tiff.js +96 -0
  108. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/utils.js +53 -0
  109. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/webp.js +45 -0
  110. package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/utils/bit-reader.js +38 -0
  111. package/dist/deps/.pnpm/safer-buffer@2.1.2/deps/safer-buffer/safer.js +45 -0
  112. package/dist/deps/.pnpm/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +2 -2
  113. package/dist/entries/app-browser-entry.d.ts +20 -5
  114. package/dist/entries/app-browser-entry.js +79 -6
  115. package/dist/entries/app-rsc-entry.d.ts +2 -1
  116. package/dist/entries/app-rsc-entry.js +59 -60
  117. package/dist/entries/app-rsc-manifest.d.ts +2 -1
  118. package/dist/entries/app-rsc-manifest.js +56 -4
  119. package/dist/entries/app-ssr-entry.js +1 -0
  120. package/dist/entries/pages-entry-helpers.js +1 -2
  121. package/dist/entries/pages-server-entry.d.ts +2 -1
  122. package/dist/entries/pages-server-entry.js +34 -9
  123. package/dist/entries/runtime-entry-module.d.ts +1 -0
  124. package/dist/entries/runtime-entry-module.js +4 -1
  125. package/dist/image/image-adapters-virtual.d.ts +2 -1
  126. package/dist/index.js +184 -103
  127. package/dist/init-cloudflare.d.ts +1 -3
  128. package/dist/init-cloudflare.js +10 -48
  129. package/dist/init-platform.d.ts +2 -0
  130. package/dist/init-platform.js +4 -0
  131. package/dist/plugins/client-compile-hints.d.ts +30 -0
  132. package/dist/plugins/client-compile-hints.js +88 -0
  133. package/dist/plugins/client-reference-dedup.d.ts +2 -1
  134. package/dist/plugins/cloudflare-dev-module-urls.d.ts +2 -1
  135. package/dist/plugins/dynamic-preload-metadata.d.ts +3 -1
  136. package/dist/plugins/dynamic-preload-metadata.js +1 -1
  137. package/dist/plugins/environment.d.ts +2 -1
  138. package/dist/plugins/extensionless-dynamic-import.js +6 -2
  139. package/dist/plugins/fonts.js +9 -12
  140. package/dist/plugins/ignore-dynamic-requests.d.ts +2 -1
  141. package/dist/plugins/import-meta-url.d.ts +2 -1
  142. package/dist/plugins/next-intl-catalog.d.ts +12 -0
  143. package/dist/plugins/next-intl-catalog.js +85 -0
  144. package/dist/plugins/og-assets.d.ts +2 -1
  145. package/dist/plugins/og-assets.js +2 -3
  146. package/dist/plugins/optimize-imports.d.ts +2 -1
  147. package/dist/plugins/pages-node-externals.d.ts +3 -1
  148. package/dist/plugins/pages-node-externals.js +1 -1
  149. package/dist/plugins/remove-console.d.ts +2 -1
  150. package/dist/plugins/require-condition-resolution.d.ts +2 -1
  151. package/dist/plugins/rsc-client-reference-loaders.d.ts +8 -0
  152. package/dist/plugins/rsc-client-reference-loaders.js +170 -68
  153. package/dist/plugins/rsc-client-shim-excludes.js +2 -0
  154. package/dist/plugins/sass.d.ts +2 -1
  155. package/dist/plugins/strip-server-exports.d.ts +2 -1
  156. package/dist/plugins/styled-jsx.d.ts +2 -1
  157. package/dist/plugins/transform-result.d.ts +2 -1
  158. package/dist/plugins/typeof-window.d.ts +2 -1
  159. package/dist/plugins/use-cache-callable.d.ts +1 -1
  160. package/dist/plugins/use-cache-callable.js +136 -94
  161. package/dist/plugins/worker-image-imports.js +1 -1
  162. package/dist/plugins/worker-use-server.d.ts +2 -1
  163. package/dist/routing/app-route-graph.d.ts +46 -0
  164. package/dist/routing/app-route-graph.js +131 -51
  165. package/dist/routing/browser-route-manifest.d.ts +2 -1
  166. package/dist/routing/optimistic-route-trie.d.ts +2 -1
  167. package/dist/routing/route-matching.d.ts +2 -1
  168. package/dist/routing/route-pattern.d.ts +2 -1
  169. package/dist/server/accept-encoding.d.ts +2 -1
  170. package/dist/server/api-handler.js +19 -4
  171. package/dist/server/app-action-forwarding.d.ts +2 -1
  172. package/dist/server/app-bfcache-identity.d.ts +2 -1
  173. package/dist/server/app-bfcache-identity.js +1 -1
  174. package/dist/server/app-browser-action-result.d.ts +2 -1
  175. package/dist/server/app-browser-entry.js +106 -66
  176. package/dist/server/app-browser-error.d.ts +2 -1
  177. package/dist/server/app-browser-history-controller.d.ts +7 -5
  178. package/dist/server/app-browser-history-controller.js +93 -15
  179. package/dist/server/app-browser-hydration.d.ts +2 -1
  180. package/dist/server/app-browser-interception-context.d.ts +2 -1
  181. package/dist/server/app-browser-navigation-controller.d.ts +2 -2
  182. package/dist/server/app-browser-navigation-controller.js +16 -12
  183. package/dist/server/app-browser-popstate.d.ts +2 -1
  184. package/dist/server/app-browser-rsc-redirect.d.ts +2 -1
  185. package/dist/server/app-browser-rsc-redirect.js +4 -4
  186. package/dist/server/app-browser-server-action-client.d.ts +4 -1
  187. package/dist/server/app-browser-server-action-client.js +4 -3
  188. package/dist/server/app-browser-state.d.ts +2 -4
  189. package/dist/server/app-browser-state.js +9 -4
  190. package/dist/server/app-browser-stream.d.ts +2 -1
  191. package/dist/server/app-browser-supplemental-refresh.js +16 -1
  192. package/dist/server/app-browser-visible-commit.d.ts +3 -2
  193. package/dist/server/app-browser-visible-commit.js +2 -12
  194. package/dist/server/app-client-reference-manifest.d.ts +31 -0
  195. package/dist/server/app-client-reference-manifest.js +46 -0
  196. package/dist/server/app-client-reference-preloader.d.ts +25 -5
  197. package/dist/server/app-client-reference-preloader.js +22 -7
  198. package/dist/server/app-elements-wire.d.ts +8 -39
  199. package/dist/server/app-elements-wire.js +4 -41
  200. package/dist/server/app-elements.d.ts +4 -2
  201. package/dist/server/app-elements.js +4 -2
  202. package/dist/server/app-fallback-renderer.d.ts +9 -2
  203. package/dist/server/app-fallback-renderer.js +4 -1
  204. package/dist/server/app-history-state.d.ts +4 -3
  205. package/dist/server/app-history-state.js +5 -2
  206. package/dist/server/app-inline-css-client.d.ts +2 -1
  207. package/dist/server/app-metadata-tracing.d.ts +2 -1
  208. package/dist/server/app-mounted-layouts.d.ts +21 -0
  209. package/dist/server/app-mounted-layouts.js +67 -0
  210. package/dist/server/app-optimistic-routing.d.ts +37 -2
  211. package/dist/server/app-optimistic-routing.js +75 -2
  212. package/dist/server/app-page-boundary-render.d.ts +20 -2
  213. package/dist/server/app-page-boundary-render.js +224 -40
  214. package/dist/server/app-page-boundary.d.ts +34 -5
  215. package/dist/server/app-page-boundary.js +41 -8
  216. package/dist/server/app-page-cache-finalizer.d.ts +14 -2
  217. package/dist/server/app-page-cache-finalizer.js +71 -30
  218. package/dist/server/app-page-cache-render.d.ts +10 -2
  219. package/dist/server/app-page-cache-render.js +14 -2
  220. package/dist/server/app-page-cache.d.ts +13 -1
  221. package/dist/server/app-page-cache.js +33 -11
  222. package/dist/server/app-page-dispatch.d.ts +39 -11
  223. package/dist/server/app-page-dispatch.js +236 -177
  224. package/dist/server/app-page-element-builder.d.ts +19 -3
  225. package/dist/server/app-page-element-builder.js +193 -71
  226. package/dist/server/app-page-execution.d.ts +43 -51
  227. package/dist/server/app-page-execution.js +205 -92
  228. package/dist/server/app-page-head.d.ts +108 -3
  229. package/dist/server/app-page-head.js +337 -154
  230. package/dist/server/app-page-http-access-fallback-metadata.d.ts +49 -2
  231. package/dist/server/app-page-http-access-fallback-metadata.js +77 -2
  232. package/dist/server/app-page-layout-gate.d.ts +35 -0
  233. package/dist/server/app-page-layout-gate.js +50 -0
  234. package/dist/server/app-page-method.d.ts +2 -1
  235. package/dist/server/app-page-params.d.ts +0 -1
  236. package/dist/server/app-page-params.js +1 -14
  237. package/dist/server/app-page-probe.d.ts +5 -22
  238. package/dist/server/app-page-probe.js +4 -37
  239. package/dist/server/app-page-render-identity.d.ts +2 -1
  240. package/dist/server/app-page-render.d.ts +9 -13
  241. package/dist/server/app-page-render.js +108 -214
  242. package/dist/server/app-page-request.d.ts +15 -4
  243. package/dist/server/app-page-request.js +2 -2
  244. package/dist/server/app-page-response.js +3 -3
  245. package/dist/server/app-page-route-wiring.d.ts +65 -8
  246. package/dist/server/app-page-route-wiring.js +259 -103
  247. package/dist/server/app-page-rsc-render-status.d.ts +29 -2
  248. package/dist/server/app-page-rsc-render-status.js +121 -13
  249. package/dist/server/app-page-search-params-observation.d.ts +7 -2
  250. package/dist/server/app-page-search-params-observation.js +8 -1
  251. package/dist/server/app-page-segment-plan.d.ts +2 -1
  252. package/dist/server/app-page-stream.d.ts +33 -1
  253. package/dist/server/app-page-stream.js +25 -6
  254. package/dist/server/app-pages-bridge.d.ts +6 -1
  255. package/dist/server/app-pages-bridge.js +7 -3
  256. package/dist/server/app-ppr-fallback-shell-render.d.ts +2 -1
  257. package/dist/server/app-ppr-fallback-shell.d.ts +2 -1
  258. package/dist/server/app-prerender-endpoints.d.ts +2 -1
  259. package/dist/server/app-prerender-static-params.d.ts +2 -1
  260. package/dist/server/app-render-dependency.d.ts +21 -4
  261. package/dist/server/app-render-dependency.js +100 -33
  262. package/dist/server/app-request-stage-dispatch.js +1 -1
  263. package/dist/server/app-request-stage-independent-entry.d.ts +2 -1
  264. package/dist/server/app-response-stage-entry.d.ts +2 -1
  265. package/dist/server/app-route-handler-cache.d.ts +2 -1
  266. package/dist/server/app-route-handler-cache.js +2 -2
  267. package/dist/server/app-route-handler-dispatch.d.ts +2 -1
  268. package/dist/server/app-route-handler-dispatch.js +15 -10
  269. package/dist/server/app-route-handler-execution.d.ts +2 -1
  270. package/dist/server/app-route-handler-execution.js +8 -3
  271. package/dist/server/app-route-handler-policy.d.ts +1 -1
  272. package/dist/server/app-route-handler-policy.js +3 -3
  273. package/dist/server/app-route-handler-response.d.ts +2 -1
  274. package/dist/server/app-route-handler-response.js +1 -1
  275. package/dist/server/app-route-handler-runtime.d.ts +2 -1
  276. package/dist/server/app-route-handler-runtime.js +17 -4
  277. package/dist/server/app-route-module-loader.d.ts +18 -1
  278. package/dist/server/app-route-module-loader.js +8 -0
  279. package/dist/server/app-route-tree-prefetch.d.ts +2 -1
  280. package/dist/server/app-rsc-cache-busting.d.ts +2 -2
  281. package/dist/server/app-rsc-cache-busting.js +4 -4
  282. package/dist/server/app-rsc-error-handler.d.ts +4 -2
  283. package/dist/server/app-rsc-error-handler.js +9 -1
  284. package/dist/server/app-rsc-errors.d.ts +10 -1
  285. package/dist/server/app-rsc-errors.js +8 -1
  286. package/dist/server/app-rsc-handler.d.ts +7 -6
  287. package/dist/server/app-rsc-handler.js +36 -34
  288. package/dist/server/app-rsc-request-normalization.d.ts +0 -4
  289. package/dist/server/app-rsc-request-normalization.js +1 -4
  290. package/dist/server/app-rsc-response-finalizer.d.ts +2 -1
  291. package/dist/server/app-rsc-response-finalizer.js +2 -2
  292. package/dist/server/app-rsc-response-stage.js +5 -3
  293. package/dist/server/app-rsc-route-matching.d.ts +38 -1
  294. package/dist/server/app-rsc-route-matching.js +24 -0
  295. package/dist/server/app-segment-config.d.ts +2 -1
  296. package/dist/server/app-segment-config.js +1 -14
  297. package/dist/server/app-server-action-execution.d.ts +5 -2
  298. package/dist/server/app-server-action-execution.js +10 -7
  299. package/dist/server/app-ssr-entry.d.ts +8 -0
  300. package/dist/server/app-ssr-entry.js +98 -50
  301. package/dist/server/app-ssr-error-meta.d.ts +2 -1
  302. package/dist/server/app-ssr-search-params-gate.d.ts +2 -1
  303. package/dist/server/app-ssr-stream.d.ts +22 -10
  304. package/dist/server/app-ssr-stream.js +300 -68
  305. package/dist/server/app-static-generation.d.ts +2 -1
  306. package/dist/server/app-streamed-client-references.d.ts +39 -0
  307. package/dist/server/app-streamed-client-references.js +156 -0
  308. package/dist/server/app-visited-response-cache.d.ts +38 -2
  309. package/dist/server/app-visited-response-cache.js +46 -5
  310. package/dist/server/app-worker-stages.d.ts +27 -4
  311. package/dist/server/app-worker-stages.js +45 -6
  312. package/dist/server/artifact-compatibility.d.ts +2 -2
  313. package/dist/server/artifact-compatibility.js +1 -10
  314. package/dist/server/bfcache-identity.d.ts +2 -1
  315. package/dist/server/cache-headers.d.ts +2 -1
  316. package/dist/server/cache-proof.d.ts +1 -115
  317. package/dist/server/cache-proof.js +1 -544
  318. package/dist/server/cacheability-request.d.ts +2 -1
  319. package/dist/server/cacheability-request.js +13 -8
  320. package/dist/server/config-headers.d.ts +2 -1
  321. package/dist/server/csp.d.ts +2 -1
  322. package/dist/server/default-global-not-found-module.d.ts +2 -1
  323. package/dist/server/default-http-access-fallback-modules.d.ts +33 -0
  324. package/dist/server/default-http-access-fallback-modules.js +31 -0
  325. package/dist/server/defer-until-stream-consumed.d.ts +34 -0
  326. package/dist/server/defer-until-stream-consumed.js +154 -21
  327. package/dist/server/dev-lockfile.d.ts +32 -2
  328. package/dist/server/dev-lockfile.js +46 -2
  329. package/dist/server/dev-module-runner.d.ts +2 -1
  330. package/dist/server/dev-server.js +14 -6
  331. package/dist/server/fetch-handler.js +1 -2
  332. package/dist/server/file-based-metadata.d.ts +2 -1
  333. package/dist/server/framework-tracer.d.ts +2 -1
  334. package/dist/server/headers.d.ts +6 -3
  335. package/dist/server/headers.js +9 -5
  336. package/dist/server/html.d.ts +1 -0
  337. package/dist/server/html.js +19 -1
  338. package/dist/server/http-conditional.d.ts +2 -1
  339. package/dist/server/http-error-responses.d.ts +2 -1
  340. package/dist/server/implicit-tags.d.ts +2 -1
  341. package/dist/server/isr-cache.d.ts +8 -2
  342. package/dist/server/isr-cache.js +26 -1
  343. package/dist/server/metadata-route-build-data.d.ts +2 -1
  344. package/dist/server/metadata-route-build-data.js +1 -1
  345. package/dist/server/metadata-route-response.d.ts +2 -1
  346. package/dist/server/metadata-route-response.js +32 -15
  347. package/dist/server/metadata-routes.d.ts +2 -1
  348. package/dist/server/middleware-runtime.d.ts +2 -1
  349. package/dist/server/multi-stage.d.ts +52 -11
  350. package/dist/server/multi-stage.js +13 -1
  351. package/dist/server/navigation-planner.js +1 -1
  352. package/dist/server/navigation-trace.d.ts +2 -1
  353. package/dist/server/next-error-digest.d.ts +2 -1
  354. package/dist/server/nitro-public-files-plugin.d.ts +2 -1
  355. package/dist/server/nitro-public-files.d.ts +2 -1
  356. package/dist/server/opentelemetry-api.d.ts +2 -1
  357. package/dist/server/operation-token.d.ts +2 -1
  358. package/dist/server/pages-api-route.d.ts +2 -1
  359. package/dist/server/pages-api-route.js +28 -19
  360. package/dist/server/pages-asset-tags.d.ts +2 -1
  361. package/dist/server/pages-body-parser-config.d.ts +2 -1
  362. package/dist/server/pages-client-assets.d.ts +4 -0
  363. package/dist/server/pages-data-route.d.ts +2 -1
  364. package/dist/server/pages-document-asset-props.d.ts +2 -1
  365. package/dist/server/pages-document-initial-props.d.ts +2 -1
  366. package/dist/server/pages-execution-tracing.d.ts +2 -1
  367. package/dist/server/pages-execution-tracing.js +1 -1
  368. package/dist/server/pages-get-initial-props.d.ts +2 -1
  369. package/dist/server/pages-media-type.d.ts +21 -1
  370. package/dist/server/pages-media-type.js +69 -5
  371. package/dist/server/pages-node-compat.js +52 -27
  372. package/dist/server/pages-page-data.d.ts +7 -1
  373. package/dist/server/pages-page-data.js +35 -12
  374. package/dist/server/pages-page-handler.d.ts +3 -2
  375. package/dist/server/pages-page-handler.js +27 -27
  376. package/dist/server/pages-page-method.d.ts +2 -1
  377. package/dist/server/pages-page-response.d.ts +2 -1
  378. package/dist/server/pages-preview.d.ts +2 -1
  379. package/dist/server/pages-readiness.d.ts +2 -1
  380. package/dist/server/pages-request-pipeline.d.ts +10 -1
  381. package/dist/server/pages-request-pipeline.js +6 -7
  382. package/dist/server/pages-request-stage-entry.d.ts +2 -1
  383. package/dist/server/pages-request-stage-entry.js +14 -12
  384. package/dist/server/pages-response-stage-entry.d.ts +2 -1
  385. package/dist/server/pages-response-stage-entry.js +9 -3
  386. package/dist/server/pages-route-data-kind.d.ts +2 -1
  387. package/dist/server/prerender-cache-life-header.d.ts +2 -1
  388. package/dist/server/prerender-route-params.d.ts +2 -1
  389. package/dist/server/prod-server.js +14 -4
  390. package/dist/server/request-log.d.ts +2 -1
  391. package/dist/server/request-pipeline.d.ts +6 -0
  392. package/dist/server/request-pipeline.js +21 -1
  393. package/dist/server/request-tracing.d.ts +2 -1
  394. package/dist/server/request-tracing.js +1 -1
  395. package/dist/server/response-start-tracing.js +7 -29
  396. package/dist/server/rsc-render-stream.d.ts +4 -0
  397. package/dist/server/rsc-render-stream.js +25 -0
  398. package/dist/server/seed-cache.d.ts +2 -1
  399. package/dist/server/seed-cache.js +1 -1
  400. package/dist/server/shared-cache-identity.d.ts +23 -0
  401. package/dist/server/shared-cache-identity.js +36 -0
  402. package/dist/server/static-file-cache.d.ts +2 -1
  403. package/dist/server/static-file-cache.js +1 -0
  404. package/dist/server/worker-revalidation-context.d.ts +2 -1
  405. package/dist/server/worker-stages.d.ts +18 -4
  406. package/dist/server/worker-stages.js +23 -4
  407. package/dist/shims/app.d.ts +2 -1
  408. package/dist/shims/cache-callable-runtime.d.ts +2 -1
  409. package/dist/shims/cache-handler.d.ts +8 -3
  410. package/dist/shims/cache-handler.js +31 -11
  411. package/dist/shims/cache-request-state.d.ts +17 -20
  412. package/dist/shims/cache-request-state.js +16 -21
  413. package/dist/shims/cache-runtime.js +27 -11
  414. package/dist/shims/cache.d.ts +8 -7
  415. package/dist/shims/cache.js +17 -19
  416. package/dist/shims/cacheability-classification.d.ts +2 -0
  417. package/dist/shims/caught-not-found-boundaries.d.ts +15 -0
  418. package/dist/shims/caught-not-found-boundaries.js +48 -0
  419. package/dist/shims/cdn-cache.d.ts +22 -5
  420. package/dist/shims/cdn-purge-routes.d.ts +2 -1
  421. package/dist/shims/client-locale.js +2 -1
  422. package/dist/shims/client-page-root.d.ts +2 -1
  423. package/dist/shims/client-page-root.js +2 -2
  424. package/dist/shims/config.d.ts +2 -1
  425. package/dist/shims/default-forbidden.d.ts +4 -0
  426. package/dist/shims/default-forbidden.js +18 -0
  427. package/dist/shims/default-not-found.d.ts +0 -5
  428. package/dist/shims/default-not-found.js +5 -41
  429. package/dist/shims/default-unauthorized.d.ts +4 -0
  430. package/dist/shims/default-unauthorized.js +18 -0
  431. package/dist/shims/dynamic.js +9 -6
  432. package/dist/shims/error-boundary.d.ts +39 -3
  433. package/dist/shims/error-boundary.js +33 -18
  434. package/dist/shims/fetch-cache-state.d.ts +5 -1
  435. package/dist/shims/fetch-cache-state.js +1 -3
  436. package/dist/shims/fetch-cache.d.ts +2 -1
  437. package/dist/shims/fetch-cache.js +34 -24
  438. package/dist/shims/font-google.js +1 -2
  439. package/dist/shims/font-utils.d.ts +3 -2
  440. package/dist/shims/font-utils.js +5 -3
  441. package/dist/shims/form.js +3 -3
  442. package/dist/shims/headers.d.ts +8 -23
  443. package/dist/shims/headers.js +17 -67
  444. package/dist/shims/http-access-error-fallback.d.ts +7 -0
  445. package/dist/shims/http-access-error-fallback.js +47 -0
  446. package/dist/shims/image.d.ts +1 -22
  447. package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +22 -2
  448. package/dist/shims/internal/app-prefetch-fetch-queue.js +71 -18
  449. package/dist/shims/internal/app-route-prefetch-policy.d.ts +14 -3
  450. package/dist/shims/internal/app-route-prefetch-policy.js +29 -4
  451. package/dist/shims/internal/cache-context-accessor.d.ts +2 -1
  452. package/dist/shims/internal/client-reference-loader.d.ts +7 -0
  453. package/dist/shims/internal/client-reference-loader.js +91 -0
  454. package/dist/shims/internal/cookie-serialize.d.ts +2 -1
  455. package/dist/shims/internal/cookies.js +1 -2
  456. package/dist/shims/internal/headers-state.d.ts +2 -0
  457. package/dist/shims/internal/headers-state.js +6 -1
  458. package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +2 -1
  459. package/dist/shims/internal/interpolate-as.d.ts +2 -1
  460. package/dist/shims/internal/navigation-untracked.js +1 -1
  461. package/dist/shims/internal/pages-data-target.d.ts +2 -1
  462. package/dist/shims/internal/pages-data-url.d.ts +2 -1
  463. package/dist/shims/internal/thenable-well-known-properties.d.ts +2 -1
  464. package/dist/shims/link.js +197 -52
  465. package/dist/shims/metadata.d.ts +52 -29
  466. package/dist/shims/metadata.js +142 -42
  467. package/dist/shims/navigation-errors.d.ts +2 -1
  468. package/dist/shims/navigation-server.js +1 -1
  469. package/dist/shims/navigation.d.ts +95 -8
  470. package/dist/shims/navigation.js +255 -47
  471. package/dist/shims/navigation.react-server.js +2 -2
  472. package/dist/shims/pages-router-runtime.d.ts +2 -1
  473. package/dist/shims/ppr-fallback-shell.d.ts +2 -1
  474. package/dist/shims/request-state-types.d.ts +2 -2
  475. package/dist/shims/router.js +14 -3
  476. package/dist/shims/slot.d.ts +12 -0
  477. package/dist/shims/slot.js +37 -9
  478. package/dist/shims/unified-request-context.d.ts +1 -1
  479. package/dist/shims/unified-request-context.js +5 -6
  480. package/dist/typegen.d.ts +2 -1
  481. package/dist/utils/cache-control-metadata.d.ts +5 -0
  482. package/dist/utils/cache-control-metadata.js +9 -1
  483. package/dist/utils/client-build-manifest.d.ts +4 -1
  484. package/dist/utils/client-build-manifest.js +9 -2
  485. package/dist/utils/client-entry-manifest.d.ts +13 -0
  486. package/dist/utils/client-entry-manifest.js +20 -1
  487. package/dist/utils/client-reference-chunks.d.ts +45 -0
  488. package/dist/utils/client-reference-chunks.js +30 -0
  489. package/dist/utils/client-runtime-metadata.d.ts +9 -1
  490. package/dist/utils/client-runtime-metadata.js +40 -9
  491. package/dist/utils/compare.d.ts +9 -0
  492. package/dist/utils/compare.js +15 -1
  493. package/dist/utils/lazy-chunks.d.ts +14 -0
  494. package/dist/utils/lazy-chunks.js +27 -1
  495. package/dist/utils/middleware-request-headers.d.ts +2 -1
  496. package/dist/utils/project.d.ts +4 -3
  497. package/dist/utils/project.js +12 -17
  498. package/dist/utils/query.d.ts +2 -1
  499. package/dist/utils/regex.d.ts +5 -0
  500. package/dist/utils/regex.js +11 -1
  501. package/dist/utils/text-stream.d.ts +10 -5
  502. package/dist/utils/text-stream.js +6 -6
  503. package/dist/utils/vite-cli-invocation.d.ts +2 -1
  504. package/package.json +6 -5
  505. package/dist/build/layout-classification-types.d.ts +0 -60
  506. package/dist/build/layout-classification-types.js +0 -1
  507. package/dist/build/layout-classification.d.ts +0 -61
  508. package/dist/build/layout-classification.js +0 -98
  509. package/dist/build/route-classification-injector.d.ts +0 -32
  510. package/dist/build/route-classification-injector.js +0 -59
  511. package/dist/build/route-classification-manifest.d.ts +0 -53
  512. package/dist/build/route-classification-manifest.js +0 -143
  513. package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +0 -808
  514. package/dist/server/app-browser-client-reuse-manifest.d.ts +0 -10
  515. package/dist/server/app-browser-client-reuse-manifest.js +0 -101
  516. package/dist/server/app-layout-param-observation.d.ts +0 -41
  517. package/dist/server/app-layout-param-observation.js +0 -168
  518. package/dist/server/client-reuse-manifest.d.ts +0 -102
  519. package/dist/server/client-reuse-manifest.js +0 -209
  520. package/dist/server/default-not-found-module.d.ts +0 -19
  521. package/dist/server/default-not-found-module.js +0 -18
  522. package/dist/server/rsc-stream-hints.d.ts +0 -21
  523. package/dist/server/rsc-stream-hints.js +0 -227
  524. package/dist/server/skip-cache-proof.d.ts +0 -60
  525. package/dist/server/skip-cache-proof.js +0 -168
  526. package/dist/server/static-layout-client-reuse-proof.d.ts +0 -13
  527. package/dist/server/static-layout-client-reuse-proof.js +0 -33
  528. package/dist/utils/sorted-array.d.ts +0 -7
  529. package/dist/utils/sorted-array.js +0 -20
@@ -0,0 +1,111 @@
1
+ import "../plugins/rsc-client-reference-loaders.js";
2
+ import { toManifestModuleId } from "../plugins/dynamic-preload-metadata.js";
3
+ //#region src/build/client-reference-chunks.ts
4
+ /** As Vite's preload helper tells a stylesheet: by its URL's path. */
5
+ function isStylesheet(file) {
6
+ return new URL(file, "http://vinext.local/").pathname.endsWith(".css");
7
+ }
8
+ /**
9
+ * Collect what each App Router client reference loads in the browser from the
10
+ * client bundle: the chunk holding the module that registers it (see
11
+ * plugins/rsc-client-reference-loaders.ts), and the JS chunks and stylesheets
12
+ * that chunk needs, as Vite's preload helper would load them for a dynamic
13
+ * import. JS chunks the App browser entry imports statically have loaded
14
+ * before any Flight row decodes, so they are left out.
15
+ *
16
+ * @param moduleKeys Client reference modules by resolved id, with the keys of
17
+ * the references each registers.
18
+ * @param modulePreload The client build's `build.modulePreload`, which picks
19
+ * the JS chunks to modulepreload, as it does for Vite's preload helper. Its
20
+ * `resolveDependencies` sees the chunk that dynamically imports each
21
+ * registering module as the host, as Vite passes it.
22
+ */
23
+ function collectClientReferenceChunks(bundle, moduleKeys, appBrowserEntry, modulePreload) {
24
+ const chunks = /* @__PURE__ */ new Map();
25
+ let host;
26
+ for (const output of Object.values(bundle)) {
27
+ if (output.type !== "chunk") continue;
28
+ chunks.set(output.fileName, output);
29
+ if (output.facadeModuleId === "\0virtual:vinext-client-reference-chunks") host = output;
30
+ }
31
+ const staticImports = (chunk) => {
32
+ const seen = /* @__PURE__ */ new Set([chunk.fileName]);
33
+ const order = [chunk];
34
+ for (let i = 0; i < order.length; i++) for (const file of order[i].imports) {
35
+ const imported = chunks.get(file);
36
+ if (!imported || seen.has(file)) continue;
37
+ seen.add(file);
38
+ order.push(imported);
39
+ }
40
+ return order;
41
+ };
42
+ const eager = new Set(appBrowserEntry ? staticImports(appBrowserEntry).map((chunk) => chunk.fileName) : []);
43
+ const result = {
44
+ references: {},
45
+ modules: []
46
+ };
47
+ for (const chunk of chunks.values()) {
48
+ const keys = chunk.moduleIds.flatMap((moduleId) => moduleKeys.get(moduleId) ?? []);
49
+ if (keys.length === 0) continue;
50
+ const imports = [];
51
+ const css = /* @__PURE__ */ new Set();
52
+ const visited = /* @__PURE__ */ new Set();
53
+ const addDeps = (loaded) => {
54
+ if (visited.has(loaded.fileName)) return;
55
+ visited.add(loaded.fileName);
56
+ if (loaded !== chunk) imports.push(loaded.fileName);
57
+ for (const file of loaded.imports) {
58
+ const imported = chunks.get(file);
59
+ if (imported) addDeps(imported);
60
+ }
61
+ for (const file of loaded.viteMetadata?.importedCss ?? []) css.add(file);
62
+ };
63
+ addDeps(chunk);
64
+ let preloads = imports.length + css.size > 0 ? [chunk.fileName, ...imports] : [];
65
+ let stylesheets = [...css];
66
+ if (modulePreload === false) preloads = [];
67
+ else if (modulePreload?.resolveDependencies && host) {
68
+ const resolved = modulePreload.resolveDependencies(chunk.fileName, preloads, {
69
+ hostId: host.fileName,
70
+ hostType: "js"
71
+ });
72
+ preloads = resolved.filter((file) => !isStylesheet(file));
73
+ stylesheets = [.../* @__PURE__ */ new Set([...resolved.filter(isStylesheet), ...css])];
74
+ }
75
+ preloads = [...new Set(preloads)].filter((file) => !eager.has(file) && (file !== chunk.fileName || stylesheets.length > 0));
76
+ const index = result.modules.push({
77
+ file: chunk.fileName,
78
+ imports: preloads,
79
+ css: stylesheets
80
+ }) - 1;
81
+ for (const key of keys) result.references[key] = index;
82
+ }
83
+ return result.modules.length > 0 ? result : void 0;
84
+ }
85
+ /**
86
+ * Vite's build manifest keys a dynamic import by the module it imports, and
87
+ * next/dynamic's SSR preloads look up the module a boundary imports (see
88
+ * shims/dynamic-preload-chunks.tsx). The client build imports a client
89
+ * reference outside every group through the module that registers it, not
90
+ * the reference's own module, so map the reference's module to the chunk of
91
+ * the module that registers it, keyed as Vite keys a manifest entry.
92
+ *
93
+ * @param getImportedIds A module's static imports, as the bundler resolved
94
+ * them.
95
+ */
96
+ function collectClientReferenceSources(bundle, getImportedIds, root) {
97
+ const sources = {};
98
+ for (const output of Object.values(bundle)) {
99
+ if (output.type !== "chunk") continue;
100
+ for (const moduleId of output.moduleIds) {
101
+ if (!moduleId.startsWith("\0virtual:vinext-client-reference-module/")) continue;
102
+ const source = getImportedIds(moduleId)?.at(-1);
103
+ if (source === void 0 || source.startsWith("\0")) continue;
104
+ const key = toManifestModuleId(root, source);
105
+ if (key) sources[key] = output.fileName;
106
+ }
107
+ }
108
+ return Object.keys(sources).length > 0 ? sources : void 0;
109
+ }
110
+ //#endregion
111
+ export { collectClientReferenceChunks, collectClientReferenceSources };
@@ -49,6 +49,13 @@ export type ClientReferencePreloadPlan = {
49
49
  routes: Map<string, number[]>;
50
50
  /** The files of a render without a route, as indices into `files`. */
51
51
  routeless: number[];
52
+ /**
53
+ * References route files reach only through static imports, outside
54
+ * `always`. A render may stream one whose module evaluates asynchronously
55
+ * instead of waiting for it; a reference any dynamic import reaches, such as
56
+ * a `next/dynamic` component, always loads first.
57
+ */
58
+ staticOnly: string[];
52
59
  };
53
60
  /**
54
61
  * Plan which client references SSR loads before rendering each route. A route
@@ -160,4 +167,5 @@ export declare function planClientReferenceGroups(options: {
160
167
  costs: ReadonlyMap<string, number | null>;
161
168
  maxCostBytes: number;
162
169
  }): ClientReferenceGroup[];
163
- //#endregion
170
+ //#endregion
171
+ export {};
@@ -46,7 +46,13 @@ function interceptEntryIds(intercept) {
46
46
  intercept.pagePath,
47
47
  ...intercept.layoutPaths,
48
48
  ...intercept.loadingPaths ?? [],
49
- intercept.notFoundPath
49
+ intercept.notFoundPath,
50
+ intercept.forbiddenPath,
51
+ intercept.unauthorizedPath,
52
+ ...intercept.notFoundPaths ?? [],
53
+ ...intercept.forbiddenPaths ?? [],
54
+ ...intercept.unauthorizedPaths ?? [],
55
+ ...intercept.errorPaths ?? []
50
56
  ].filter((value) => typeof value === "string");
51
57
  }
52
58
  /**
@@ -221,11 +227,43 @@ function collectClientReferencePreloadPlan(options) {
221
227
  const stopAt = /* @__PURE__ */ new Set([...fileIndices.keys(), ...[...interceptFiles, ...alwaysRoots].map(canonicalize)]);
222
228
  const always = /* @__PURE__ */ new Set([...referencesReachedFrom(options.entryIds, stopAt), ...referencesReachedFrom(alwaysRoots)]);
223
229
  for (const id of options.clientReferenceIds) if (!reached.has(id)) always.add(id);
230
+ const dynamicallyReached = /* @__PURE__ */ new Set();
231
+ const visited = /* @__PURE__ */ new Set();
232
+ const pending = [...options.entryIds.map(canonicalize), ...stopAt].map((id) => [
233
+ id,
234
+ false,
235
+ true
236
+ ]);
237
+ while (pending.length > 0) {
238
+ const [id, dynamic, root] = pending.pop();
239
+ if (!root && stopAt.has(id)) continue;
240
+ const key = dynamic ? `dynamic:${id}` : id;
241
+ if (visited.has(key)) continue;
242
+ visited.add(key);
243
+ if (options.clientReferenceIds.has(id)) {
244
+ if (dynamic) dynamicallyReached.add(id);
245
+ continue;
246
+ }
247
+ const info = getModuleInfo(id);
248
+ if (!info) continue;
249
+ for (const imported of info.importedIds) pending.push([
250
+ imported,
251
+ dynamic,
252
+ false
253
+ ]);
254
+ for (const imported of info.dynamicallyImportedIds) pending.push([
255
+ imported,
256
+ true,
257
+ false
258
+ ]);
259
+ }
260
+ const staticOnly = [...new Set(files.flat())].filter((id) => !always.has(id) && !dynamicallyReached.has(id));
224
261
  return {
225
262
  always: [...always],
226
263
  files,
227
264
  routes,
228
- routeless
265
+ routeless,
266
+ staticOnly
229
267
  };
230
268
  }
231
269
  function importedName(kind, name) {
@@ -26,4 +26,5 @@ export declare function rebaseCssUrlAssetReferences(code: string, sourceDirector
26
26
  * code only has the leaked marker stripped — no sibling files are emitted.
27
27
  */
28
28
  export declare function restoreDedupedCssAssetReferences(bundle: CssUrlAssetBundle, emitRestoredAsset: EmitRestoredCssUrlAsset): void;
29
- //#endregion
29
+ //#endregion
30
+ export {};
@@ -8,4 +8,5 @@ type AdjustFontFallback = {
8
8
  };
9
9
  export declare function getFallbackFontOverrideMetrics(fontFamily: string): AdjustFontFallback | undefined;
10
10
  export declare function buildFallbackFontFace(family: string, metrics: AdjustFontFallback): string;
11
- //#endregion
11
+ //#endregion
12
+ export {};
@@ -11,5 +11,6 @@
11
11
  export declare function findFontFilesInCss(css: string, subsetsToPreload?: string[]): {
12
12
  googleFontFileUrl: string;
13
13
  preloadFontFile: boolean;
14
+ ext: string;
14
15
  }[];
15
16
  //#endregion
@@ -1,4 +1,11 @@
1
1
  //#region src/build/google-fonts/find-font-files-in-css.ts
2
+ const formatToExtension = /* @__PURE__ */ new Map([
3
+ ["woff", "woff"],
4
+ ["woff2", "woff2"],
5
+ ["truetype", "ttf"],
6
+ ["opentype", "otf"],
7
+ ["embedded-opentype", "eot"]
8
+ ]);
2
9
  /**
3
10
  * Find all font files in the CSS response and determine which files should be preloaded.
4
11
  * In Google Fonts responses, the @font-face's subset is above it in a comment.
@@ -16,10 +23,16 @@ function findFontFilesInCss(css, subsetsToPreload) {
16
23
  if (newSubset) currentSubset = newSubset;
17
24
  else {
18
25
  const googleFontFileUrl = /src: url\((.+?)\)/.exec(line)?.[1];
19
- if (googleFontFileUrl && !fontFiles.some((foundFile) => foundFile.googleFontFileUrl === googleFontFileUrl)) fontFiles.push({
20
- googleFontFileUrl,
21
- preloadFontFile: !!subsetsToPreload?.includes(currentSubset)
22
- });
26
+ if (googleFontFileUrl && !fontFiles.some((foundFile) => foundFile.googleFontFileUrl === googleFontFileUrl)) {
27
+ const pathname = googleFontFileUrl.split(/[?#]/, 1)[0];
28
+ const format = /format\(['"](.+?)['"]\)/.exec(line)?.[1];
29
+ const ext = /\.(woff|woff2|eot|ttf|otf)$/.exec(pathname)?.[1] ?? formatToExtension.get(format ?? "") ?? "woff2";
30
+ fontFiles.push({
31
+ googleFontFileUrl,
32
+ preloadFontFile: !!subsetsToPreload?.includes(currentSubset),
33
+ ext
34
+ });
35
+ }
23
36
  }
24
37
  }
25
38
  return fontFiles;
@@ -16,4 +16,5 @@ type FontFamilyMetadata = {
16
16
  subsets: string[];
17
17
  };
18
18
  export declare const googleFontsMetadata: Record<string, FontFamilyMetadata>;
19
- //#endregion
19
+ //#endregion
20
+ export {};
@@ -23,4 +23,5 @@ type ValidatedGoogleFontOptions = {
23
23
  subsets: string[];
24
24
  };
25
25
  export declare function validateGoogleFontOptions(fontFamily: string, options: GoogleFontOptions): ValidatedGoogleFontOptions;
26
- //#endregion
26
+ //#endregion
27
+ export {};
@@ -2,4 +2,5 @@
2
2
  type InlineCssManifest = Record<string, string>;
3
3
  export declare function collectInlineCssManifest(clientDir: string, assetPrefix: string): InlineCssManifest;
4
4
  export declare function injectInlineCssManifestGlobal(entryPath: string, manifest: InlineCssManifest): boolean;
5
- //#endregion
5
+ //#endregion
6
+ export {};
@@ -31,4 +31,5 @@ export declare class ModuleDependencyStore<T> {
31
31
  invalidate(files: readonly string[], event: FileEvent["event"]): boolean;
32
32
  clear(): void;
33
33
  }
34
- //#endregion
34
+ //#endregion
35
+ export {};
@@ -18,4 +18,5 @@ export declare function getPagesManifestPage(pagesDir: string, filePath: string,
18
18
  export declare function buildNextClientBuildManifestContent(rewrites: ResolvedNextConfig["rewrites"], pages: readonly string[]): string;
19
19
  export declare function buildNextClientSsgManifestContent(): string;
20
20
  export declare function emitNextClientRuntimeManifests(options: EmitNextClientRuntimeManifestsOptions): void;
21
- //#endregion
21
+ //#endregion
22
+ export {};
@@ -28,4 +28,5 @@ export declare function precompressAssets(clientDir: string, options?: {
28
28
  assetsDir?: string;
29
29
  onProgress?: (completed: number, total: number, file: string) => void;
30
30
  }): Promise<PrecompressResult>;
31
- //#endregion
31
+ //#endregion
32
+ export {};
@@ -2,8 +2,8 @@ import path from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
2
2
  import { ASSET_PREFIX_URL_DIR } from "../utils/asset-prefix.js";
3
3
  import { isPrecompressedVariantBeneficial } from "../utils/precompressed-variant.js";
4
4
  import fsp from "node:fs/promises";
5
- import { randomUUID } from "node:crypto";
6
5
  import os from "node:os";
6
+ import { randomUUID } from "node:crypto";
7
7
  import zlib from "node:zlib";
8
8
  import { promisify } from "node:util";
9
9
  //#region src/build/precompress.ts
@@ -94,4 +94,5 @@ type PrerenderPathDiscoveryOptions = {
94
94
  export declare function matchesMiddlewareWarmPath(pathname: string, matcher: MatcherConfig | undefined, i18n: ResolvedNextConfig["i18n"]): boolean;
95
95
  export declare function discoverPrerenderPathManifest(options: PrerenderPathDiscoveryOptions): Promise<PrerenderPathManifest | null>;
96
96
  export declare function emitPrerenderPathManifest(options: PrerenderPathDiscoveryOptions): Promise<PrerenderPathManifest | null>;
97
- //#endregion
97
+ //#endregion
98
+ export {};
@@ -11,4 +11,5 @@ type PrerenderPhaseEnv = {
11
11
  * overwriting the caller's prior phase when they finish.
12
12
  */
13
13
  export declare function enterPrerenderPhase(env?: PrerenderPhaseEnv): () => void;
14
- //#endregion
14
+ //#endregion
15
+ export {};
@@ -2,8 +2,8 @@ import path from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
2
2
  import { PHASE_PRODUCTION_BUILD } from "../shims/constants.js";
3
3
  import fs from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
- import { fork } from "node:child_process";
6
5
  import os from "node:os";
6
+ import { fork } from "node:child_process";
7
7
  //#region src/build/prerender-server-pool.ts
8
8
  /**
9
9
  * Parallel prerender server pool.
@@ -171,8 +171,9 @@ type PrerenderAppOptionsInternal = PrerenderAppOptions & {
171
171
  * Throws on partial or malformed embeds (chunks present but no done marker,
172
172
  * tampered chunk JSON, etc.) — those are real vinext-internal regressions.
173
173
  *
174
- * Safe regex usage: safeJsonStringify (used by createRscEmbedTransform) escapes
175
- * all '<' and '>' in the embedded JSON, preventing false </script> matches.
174
+ * Safe regex usage: scriptSafeJsonStringify (used by createRscEmbedTransform)
175
+ * escapes every '<' that begins "</script" (case-insensitive) in the embedded
176
+ * JSON, preventing false </script> matches.
176
177
  */
177
178
  export declare function extractRscPayloadFromPrerenderedHtml(html: string): Uint8Array | null;
178
179
  /**
@@ -12,16 +12,16 @@ import { NoOpCacheHandler, getCacheHandler, setCacheHandler } from "../shims/cac
12
12
  import { headersContextFromRequest, runWithHeadersContext } from "../shims/headers.js";
13
13
  import { _consumeRequestScopedCacheLife } from "../shims/cache-request-state.js";
14
14
  import { normalizeStaticPathsEntry } from "../routing/route-pattern.js";
15
- import { createRscRequestUrl } from "../server/app-rsc-cache-busting.js";
16
15
  import { readPrerenderSecret } from "./server-manifest.js";
17
16
  import { buildPregeneratedConcretePathTable } from "../server/prerender-manifest.js";
18
17
  import { concatUint8Arrays, decodeRscEmbeddedChunk } from "../server/app-rsc-embedded-chunks.js";
18
+ import { createRscRequestUrl } from "../server/app-rsc-cache-busting.js";
19
19
  import { navigationRuntimeRscBootstrapExpression } from "../server/app-ssr-stream.js";
20
20
  import { encodePrerenderRouteParams, serializePrerenderRouteParamsHeader } from "../server/prerender-route-params.js";
21
- import { createAppPprFallbackShells, markAppPprDynamicFallbackShellHtml } from "../server/app-ppr-fallback-shell.js";
22
- import { getAppRouteOutputPath, getOutputPath, getRscOutputPath } from "../utils/prerender-output-paths.js";
23
21
  import { startProdServer } from "../server/prod-server.js";
24
22
  import { prerenderPoolAvailable, resolvePrerenderPoolSize, startPrerenderServerPool } from "./prerender-server-pool.js";
23
+ import { getAppRouteOutputPath, getOutputPath, getRscOutputPath } from "../utils/prerender-output-paths.js";
24
+ import { createAppPprFallbackShells, markAppPprDynamicFallbackShellHtml } from "../server/app-ppr-fallback-shell.js";
25
25
  import { enterPrerenderPhase } from "./prerender-phase.js";
26
26
  import { buildAppRouteCacheValue } from "../server/app-route-handler-response.js";
27
27
  import fs from "node:fs";
@@ -92,8 +92,9 @@ const RSC_RUNTIME_DONE_SCRIPT = `${RSC_RUNTIME_BOOTSTRAP_EXPRESSION}.done=true`;
92
92
  * Throws on partial or malformed embeds (chunks present but no done marker,
93
93
  * tampered chunk JSON, etc.) — those are real vinext-internal regressions.
94
94
  *
95
- * Safe regex usage: safeJsonStringify (used by createRscEmbedTransform) escapes
96
- * all '<' and '>' in the embedded JSON, preventing false <\/script> matches.
95
+ * Safe regex usage: scriptSafeJsonStringify (used by createRscEmbedTransform)
96
+ * escapes every '<' that begins "<\/script" (case-insensitive) in the embedded
97
+ * JSON, preventing false <\/script> matches.
97
98
  */
98
99
  function extractRscPayloadFromPrerenderedHtml(html) {
99
100
  const scriptPattern = /<script(?:\s[^>]*)?>([\s\S]*?)<\/script>/gi;
@@ -1,5 +1,4 @@
1
1
  import { AppRoute } from "../routing/app-route-graph.js";
2
- import { LayoutBuildClassification } from "./layout-classification-types.js";
3
2
  import { Route } from "../routing/pages-router.js";
4
3
  import { PrerenderResult } from "./prerender.js";
5
4
  //#region src/build/report.d.ts
@@ -77,19 +76,6 @@ export declare function extractExportConstNumber(code: string, name: string): nu
77
76
  * null — no `revalidate` key found (fully static)
78
77
  */
79
78
  export declare function extractGetStaticPropsRevalidate(code: string): number | false | null;
80
- /**
81
- * Classifies a layout file by its segment config exports (`dynamic`, `revalidate`).
82
- *
83
- * Returns a tagged `LayoutBuildClassification` carrying both the decision and
84
- * the specific segment-config field that produced it. `{ kind: "absent" }`
85
- * means no segment config is present and the caller should defer to the next
86
- * layer (module graph analysis).
87
- *
88
- * Unlike page classification, positive `revalidate` values are not meaningful
89
- * for layout skip decisions — ISR is a page-level concept. Only the extremes
90
- * (`revalidate = 0` → dynamic, `revalidate = Infinity` → static) are decisive.
91
- */
92
- export declare function classifyLayoutSegmentConfig(code: string): LayoutBuildClassification;
93
79
  /**
94
80
  * Classifies a Pages Router page file by reading its source and examining
95
81
  * which data-fetching exports it contains.
@@ -163,4 +149,5 @@ export declare function printBuildReport(options: {
163
149
  pageExtensions: string[];
164
150
  prerenderResult?: PrerenderResult;
165
151
  }): Promise<void>;
166
- //#endregion
152
+ //#endregion
153
+ export {};
@@ -392,56 +392,6 @@ function propertyName(key) {
392
392
  return null;
393
393
  }
394
394
  /**
395
- * Classifies a layout file by its segment config exports (`dynamic`, `revalidate`).
396
- *
397
- * Returns a tagged `LayoutBuildClassification` carrying both the decision and
398
- * the specific segment-config field that produced it. `{ kind: "absent" }`
399
- * means no segment config is present and the caller should defer to the next
400
- * layer (module graph analysis).
401
- *
402
- * Unlike page classification, positive `revalidate` values are not meaningful
403
- * for layout skip decisions — ISR is a page-level concept. Only the extremes
404
- * (`revalidate = 0` → dynamic, `revalidate = Infinity` → static) are decisive.
405
- */
406
- function classifyLayoutSegmentConfig(code) {
407
- const program = parseRouteModule(code);
408
- const dynamicValue = program ? extractExportConstStringFromProgram(program, "dynamic") : null;
409
- if (dynamicValue === "force-dynamic") return {
410
- kind: "dynamic",
411
- reason: {
412
- layer: "segment-config",
413
- key: "dynamic",
414
- value: "force-dynamic"
415
- }
416
- };
417
- if (dynamicValue === "force-static" || dynamicValue === "error") return {
418
- kind: "static",
419
- reason: {
420
- layer: "segment-config",
421
- key: "dynamic",
422
- value: dynamicValue
423
- }
424
- };
425
- const revalidateValue = program ? extractExportConstNumberFromProgram(program, "revalidate") : null;
426
- if (revalidateValue === Infinity) return {
427
- kind: "static",
428
- reason: {
429
- layer: "segment-config",
430
- key: "revalidate",
431
- value: Infinity
432
- }
433
- };
434
- if (revalidateValue === 0) return {
435
- kind: "dynamic",
436
- reason: {
437
- layer: "segment-config",
438
- key: "revalidate",
439
- value: 0
440
- }
441
- };
442
- return { kind: "absent" };
443
- }
444
- /**
445
395
  * Classifies a Pages Router page file by reading its source and examining
446
396
  * which data-fetching exports it contains.
447
397
  *
@@ -675,4 +625,4 @@ async function printBuildReport(options) {
675
625
  }
676
626
  }
677
627
  //#endregion
678
- export { buildReportRows, classifyAppRoute, classifyAppRouteHandler, classifyLayoutSegmentConfig, classifyPagesRoute, extractExportConstNumber, extractExportConstString, extractGetStaticPropsRevalidate, extractMiddlewareMatcherConfig, extractMiddlewareMatcherConfigValue, formatBuildReport, getAppRouteRenderEntryPath, hasExportedName, hasNamedExport, hasRuntimeExportedName, printBuildReport };
628
+ export { buildReportRows, classifyAppRoute, classifyAppRouteHandler, classifyPagesRoute, extractExportConstNumber, extractExportConstString, extractGetStaticPropsRevalidate, extractMiddlewareMatcherConfig, extractMiddlewareMatcherConfigValue, formatBuildReport, getAppRouteRenderEntryPath, hasExportedName, hasNamedExport, hasRuntimeExportedName, printBuildReport };
@@ -59,4 +59,5 @@ export declare function assertNoFatalPrerenderRoutes(routes: readonly PrerenderR
59
59
  * Statically generate routes and return the prerender result.
60
60
  */
61
61
  export declare function runPrerender(options: RunPrerenderOptions): Promise<PrerenderResult | null>;
62
- //#endregion
62
+ //#endregion
63
+ export {};
@@ -20,4 +20,5 @@ export declare function loadOrGenerateServerActionsEncryptionKey(options: LoadEn
20
20
  * when `server.fs.strict` is false, which turns off Vite's file restrictions.
21
21
  */
22
22
  export declare function getServerActionsKeyCacheFsDeny(configuredDeny: string[] | undefined): string[];
23
- //#endregion
23
+ //#endregion
24
+ export {};
@@ -62,13 +62,36 @@ function augmentSsrManifestFromBundle(ssrManifest, bundle, root, base = "/") {
62
62
  if (!nextManifest[normalizedKey]) nextManifest[normalizedKey] = /* @__PURE__ */ new Set();
63
63
  for (const file of files) nextManifest[normalizedKey].add(collapseDuplicateBase(file, base));
64
64
  }
65
+ const staticImportClosures = /* @__PURE__ */ new Map();
66
+ const getStaticImportClosure = (fileName) => {
67
+ let closure = staticImportClosures.get(fileName);
68
+ if (closure) return closure;
69
+ const files = /* @__PURE__ */ new Set();
70
+ const visit = (importer) => {
71
+ const chunk = bundle[importer];
72
+ if (chunk?.type !== "chunk") return;
73
+ for (const importedFile of chunk.imports ?? []) {
74
+ if (importedFile === fileName || files.has(importedFile)) continue;
75
+ files.add(importedFile);
76
+ visit(importedFile);
77
+ }
78
+ };
79
+ visit(fileName);
80
+ closure = [...files];
81
+ staticImportClosures.set(fileName, closure);
82
+ return closure;
83
+ };
65
84
  for (const item of Object.values(bundle)) {
66
85
  if (item.type !== "chunk") continue;
67
86
  const chunk = item;
68
- if (chunk.fileName.endsWith(".js") && (isSharedClientChunkName(chunk.name) || chunk.isEntry && isPagesClientEntryFacade(chunk.facadeModuleId))) sharedChunkFiles.add(manifestFileWithBase(chunk.fileName, base));
87
+ if (chunk.fileName.endsWith(".js") && isSharedClientChunkName(chunk.name)) sharedChunkFiles.add(manifestFileWithBase(chunk.fileName, base));
88
+ if (chunk.isEntry && isPagesClientEntryFacade(chunk.facadeModuleId)) {
89
+ sharedChunkFiles.add(manifestFileWithBase(chunk.fileName, base));
90
+ for (const importedFile of getStaticImportClosure(chunk.fileName)) sharedChunkFiles.add(manifestFileWithBase(importedFile, base));
91
+ }
69
92
  const files = /* @__PURE__ */ new Set();
70
93
  files.add(manifestFileWithBase(chunk.fileName, base));
71
- for (const importedFile of chunk.imports ?? []) files.add(manifestFileWithBase(importedFile, base));
94
+ for (const importedFile of getStaticImportClosure(chunk.fileName)) files.add(manifestFileWithBase(importedFile, base));
72
95
  for (const cssFile of chunk.viteMetadata?.importedCss ?? []) files.add(manifestFileWithBase(cssFile, base));
73
96
  for (const assetFile of chunk.viteMetadata?.importedAssets ?? []) files.add(manifestFileWithBase(assetFile, base));
74
97
  for (const moduleId of Object.keys(chunk.modules ?? {})) {
@@ -27,4 +27,5 @@ type StandaloneBuildResult = {
27
27
  * included.
28
28
  */
29
29
  export declare function emitStandaloneOutput(options: StandaloneBuildOptions): StandaloneBuildResult;
30
- //#endregion
30
+ //#endregion
31
+ export {};
@@ -132,4 +132,5 @@ export declare function loadVinextCacheConfigFromViteConfig(vite: ViteConfigLoad
132
132
  export declare function generateCacheAdaptersModule(cache?: VinextCacheConfig): string;
133
133
  /** Generate request-stage registration without importing a configured data adapter. */
134
134
  export declare function generateCdnCacheAdapterModule(cache?: VinextCacheConfig): string;
135
- //#endregion
135
+ //#endregion
136
+ export {};
package/dist/cache.js CHANGED
@@ -1,2 +1 @@
1
- import { cacheForRequest } from "./shims/cache-for-request.js";
2
- export { cacheForRequest };
1
+ export { cacheForRequest } from "./shims/cache-for-request.js";
package/dist/check.d.ts CHANGED
@@ -85,4 +85,5 @@ export declare function runCheck(root: string): CheckResult;
85
85
  export declare function formatReport(result: CheckResult, opts?: {
86
86
  calledFromInit?: boolean;
87
87
  }): string;
88
- //#endregion
88
+ //#endregion
89
+ export {};
package/dist/check.js CHANGED
@@ -323,6 +323,10 @@ const CONFIG_SUPPORT = {
323
323
  status: "partial",
324
324
  detail: "experimental support; behavior is incomplete"
325
325
  },
326
+ "experimental.cacheComponents": {
327
+ status: "partial",
328
+ detail: "legacy alias of cacheComponents; experimental support, behavior is incomplete"
329
+ },
326
330
  "experimental.ppr": {
327
331
  status: "unsupported",
328
332
  detail: "removed in Next.js 16 and ignored; use cacheComponents"
@@ -434,7 +438,7 @@ const LIBRARY_SUPPORT = {
434
438
  },
435
439
  "next-intl": {
436
440
  status: "supported",
437
- detail: "createNextIntlPlugin is only optional with the request config at (src/)i18n/request.*; its experimental messages, precompile and extract options don't work (they need webpack/Turbopack loaders)"
441
+ detail: "createNextIntlPlugin is only optional with the request config at (src/)i18n/request.*; its experimental extract option doesn't work (it needs a webpack/Turbopack loader)"
438
442
  },
439
443
  "@clerk/nextjs": {
440
444
  status: "supported",
@@ -21,4 +21,5 @@ type ParsedArgs = {
21
21
  * arguments directly to Vite.
22
22
  */
23
23
  export declare function parseArgs(args: string[]): ParsedArgs;
24
- //#endregion
24
+ //#endregion
25
+ export {};
package/dist/cli.js CHANGED
@@ -125,6 +125,7 @@ async function proxyVite(command) {
125
125
  async function start() {
126
126
  const parsed = parseArgs(rawArgs);
127
127
  if (parsed.help) return printHelp("start");
128
+ if (!process.env.NODE_ENV) Reflect.set(process.env, "NODE_ENV", "production");
128
129
  loadDotenv({
129
130
  root: process.cwd(),
130
131
  mode: "production"
@@ -194,6 +195,7 @@ async function check() {
194
195
  async function typegen() {
195
196
  const parsed = parseArgs(rawArgs);
196
197
  if (parsed.help) return printHelp("typegen");
198
+ if (!process.env.NODE_ENV) Reflect.set(process.env, "NODE_ENV", "production");
197
199
  const root = path.resolve(parsed.positionals?.[0] ?? process.cwd());
198
200
  loadDotenv({
199
201
  root,
@@ -282,6 +284,9 @@ function printHelp(cmd) {
282
284
  (Response Store or Workers Cache, default: prompt with No)
283
285
  --legacy-wrangler-cloudflare-init
284
286
  Use the legacy Wrangler setup instead of cf
287
+ --ignore-wrangler-config
288
+ Set up cf even if a root Wrangler config exists
289
+ (use when it belongs to an unrelated Worker)
285
290
  --cdn-cache <type> Cloudflare CDN cache: none, response-store, workers-cache,
286
291
  static-assets, or data-cache
287
292
  (default: none; response-store is the default cache choice)
@@ -11,7 +11,8 @@ function getMatcherRule(redirect) {
11
11
  has: redirect.has,
12
12
  missing: redirect.missing,
13
13
  locale: redirect.locale,
14
- basePath: redirect.basePath
14
+ basePath: redirect.basePath,
15
+ defaultLocaleVariant: redirect.defaultLocaleVariant
15
16
  }];
16
17
  matcherRules.set(redirect, rule);
17
18
  }