@farm.js/core 0.1.67 → 0.1.69

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 (297) hide show
  1. package/dist/{agent-mcp.d-DWyWkTSy.d.mts → agent-mcp.d-DOfBMEzP.d.mts} +1 -1
  2. package/dist/{agent-mcp.d-BFu9xHAi.d.ts → agent-mcp.d-DnIgriX1.d.ts} +1 -1
  3. package/dist/agent-runtime.d.mts +5 -3
  4. package/dist/agent-runtime.d.ts +5 -3
  5. package/dist/{analyzer-TTIIXXMQ.mjs → analyzer-NAL5TJUP.mjs} +2 -2
  6. package/dist/analyzer-SAJSV6SP.cjs +16 -0
  7. package/dist/api/node.d.mts +7 -5
  8. package/dist/api/node.d.ts +7 -5
  9. package/dist/api/route-manager.d.mts +7 -5
  10. package/dist/api/route-manager.d.ts +7 -5
  11. package/dist/api/runtime.d.mts +6 -4
  12. package/dist/api/runtime.d.ts +6 -4
  13. package/dist/api.cjs +2 -2
  14. package/dist/api.d.mts +8 -23
  15. package/dist/api.d.ts +8 -23
  16. package/dist/api.mjs +1 -1
  17. package/dist/{app-manifest.d-CwfhGrVR.d.ts → app-manifest.d-CaAcaukR.d.ts} +1 -1
  18. package/dist/{app-manifest.d-CRmjN5j9.d.mts → app-manifest.d-_BVbI0xp.d.mts} +1 -1
  19. package/dist/app-markdown.cjs +3 -3
  20. package/dist/app-markdown.d.mts +10 -10
  21. package/dist/app-markdown.d.ts +10 -10
  22. package/dist/app-markdown.mjs +2 -2
  23. package/dist/{app.d-BX9LVTiP.d.ts → app.d-BWeDqOaF.d.ts} +6 -6
  24. package/dist/{app.d-uBBUxwyV.d.mts → app.d-CaPwtytN.d.mts} +6 -6
  25. package/dist/{base-path.d-BOUV5ozD.d.mts → base-path.d-CTDVF0Fc.d.mts} +2 -1
  26. package/dist/{base-path.d-BOUV5ozD.d.ts → base-path.d-CTDVF0Fc.d.ts} +2 -1
  27. package/dist/{chunk-HM7AGSKU.cjs → chunk-22LGTSBA.cjs} +1 -1
  28. package/dist/{chunk-4JX3M4C6.cjs → chunk-23VJEGKC.cjs} +2 -1
  29. package/dist/{chunk-V5MQMQ2P.mjs → chunk-2P7UYHZP.mjs} +1 -1
  30. package/dist/{chunk-Q37INCXG.cjs → chunk-3EEINK7G.cjs} +11 -2
  31. package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
  32. package/dist/{chunk-QJVW76JG.mjs → chunk-3Y52TWYU.mjs} +2 -2
  33. package/dist/{chunk-OB3IFUK6.cjs → chunk-437QZIC2.cjs} +4 -4
  34. package/dist/{chunk-DCXSIEFE.cjs → chunk-4JRAMCUP.cjs} +59 -38
  35. package/dist/{chunk-Q5UX55YA.cjs → chunk-4W4ZWSV2.cjs} +887 -485
  36. package/dist/{chunk-JWSI5WO4.mjs → chunk-4ZXKYCYK.mjs} +1 -1
  37. package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
  38. package/dist/{chunk-AQDLVHNF.mjs → chunk-5FBZJJGA.mjs} +17 -0
  39. package/dist/{chunk-HP2DQGQH.mjs → chunk-5TOWKGV3.mjs} +1 -1
  40. package/dist/{chunk-556H7JCE.cjs → chunk-6GQJVY4E.cjs} +32 -27
  41. package/dist/{chunk-PL6RTBDE.cjs → chunk-ABIBASLJ.cjs} +2 -2
  42. package/dist/{chunk-H37MDCPR.mjs → chunk-ANMIR6US.mjs} +1 -1
  43. package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
  44. package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
  45. package/dist/{chunk-UHNSY2PQ.mjs → chunk-CKCKCUYO.mjs} +826 -424
  46. package/dist/{chunk-IRA2CZAY.mjs → chunk-CRVSYDHV.mjs} +2 -2
  47. package/dist/{chunk-2ZOYOYEE.mjs → chunk-D5F7RPZP.mjs} +71 -1
  48. package/dist/{chunk-N5DQMOAG.cjs → chunk-DHR2WDSL.cjs} +275 -92
  49. package/dist/{chunk-QGQP6QKO.cjs → chunk-DWLNLU55.cjs} +2 -2
  50. package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
  51. package/dist/{chunk-V5RTHYJB.cjs → chunk-F6YLXK5L.cjs} +93 -25
  52. package/dist/{chunk-HNVAZGQD.cjs → chunk-FJMC24KG.cjs} +2 -2
  53. package/dist/{chunk-KCY52OUQ.cjs → chunk-FSODPZRT.cjs} +1 -1
  54. package/dist/{chunk-PPX7UOFY.cjs → chunk-FVYBEMOD.cjs} +55 -38
  55. package/dist/{chunk-6YBYX4K4.mjs → chunk-G7NBPP7H.mjs} +1 -1
  56. package/dist/{chunk-HFHJJXSV.mjs → chunk-GFPS7MNE.mjs} +1 -1
  57. package/dist/{chunk-LPIZMU7D.cjs → chunk-GQ6QOH7T.cjs} +9 -5
  58. package/dist/{chunk-BZWTBELF.cjs → chunk-GTQOEEE7.cjs} +77 -7
  59. package/dist/{chunk-6V5YWI4W.cjs → chunk-GUMKIQJL.cjs} +2 -2
  60. package/dist/{chunk-3T5TLFCQ.mjs → chunk-HEJM46HQ.mjs} +11 -2
  61. package/dist/{chunk-F43OG25P.cjs → chunk-I7J5RLGO.cjs} +15 -1
  62. package/dist/chunk-ICFPTHXM.mjs +97 -0
  63. package/dist/{chunk-WGHY3OL5.mjs → chunk-IYLZZTP6.mjs} +233 -50
  64. package/dist/{chunk-WUTFJOV7.cjs → chunk-JFPKARWM.cjs} +16 -8
  65. package/dist/{chunk-TEG6HJVF.mjs → chunk-JL2YW5KX.mjs} +1 -0
  66. package/dist/{chunk-23PVOIPT.cjs → chunk-L5OZN6YW.cjs} +3 -3
  67. package/dist/{chunk-QITSS4TD.cjs → chunk-L6NWQ3DR.cjs} +537 -356
  68. package/dist/{chunk-3T7ALZJF.cjs → chunk-LR4KP3I7.cjs} +2 -2
  69. package/dist/{chunk-CO3YMZFD.mjs → chunk-MAGFDK4Q.mjs} +1 -1
  70. package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
  71. package/dist/{chunk-5TA63JD3.mjs → chunk-MGZVDX4R.mjs} +1 -1
  72. package/dist/{chunk-6SQZXRJ2.cjs → chunk-MMDKYJ5V.cjs} +7 -7
  73. package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
  74. package/dist/{chunk-XUES6OET.mjs → chunk-MV7NWU23.mjs} +1 -1
  75. package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
  76. package/dist/{chunk-F7JKVHU2.mjs → chunk-NVOMQLI2.mjs} +15 -1
  77. package/dist/{chunk-5IQ2ERQA.cjs → chunk-O47W53D3.cjs} +1 -1
  78. package/dist/{chunk-22IWL4YD.cjs → chunk-OCNV4CI2.cjs} +21 -2
  79. package/dist/{chunk-3TXKFRSO.mjs → chunk-OEL5EPOJ.mjs} +1 -1
  80. package/dist/{chunk-E6CD45JK.mjs → chunk-PDQ6EGPK.mjs} +26 -5
  81. package/dist/{chunk-VK54PDQ6.mjs → chunk-PEYDQMSA.mjs} +86 -18
  82. package/dist/{chunk-KSZK34HU.mjs → chunk-PJQ5W356.mjs} +16 -8
  83. package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
  84. package/dist/{chunk-JSOCDYER.cjs → chunk-Q4HH5Q6A.cjs} +15 -1
  85. package/dist/{chunk-YVTS3S3F.cjs → chunk-QOGIZKSO.cjs} +3 -3
  86. package/dist/{chunk-DB2HSHQA.cjs → chunk-QSUYB3RH.cjs} +14 -14
  87. package/dist/{chunk-724MGMIL.mjs → chunk-R2ZHU37O.mjs} +19 -0
  88. package/dist/{chunk-YQYTQJZN.mjs → chunk-RLH5AH2M.mjs} +1 -1
  89. package/dist/{chunk-WDD5CTZW.mjs → chunk-SZORL7EW.mjs} +24 -19
  90. package/dist/{chunk-6R53ZWX2.cjs → chunk-TKYOJ5G2.cjs} +3 -3
  91. package/dist/{chunk-XNZWMXCF.mjs → chunk-UHU4QALN.mjs} +330 -149
  92. package/dist/{chunk-J7JHVCWA.cjs → chunk-UKZ6AWKZ.cjs} +2 -1
  93. package/dist/{chunk-GTV2ABO7.mjs → chunk-ULMXZYOA.mjs} +162 -33
  94. package/dist/{chunk-4DRINDGN.cjs → chunk-VO65MYJD.cjs} +254 -125
  95. package/dist/chunk-W44X6IC2.cjs +97 -0
  96. package/dist/{chunk-UHE5JUKB.mjs → chunk-XCAQTCGK.mjs} +1 -1
  97. package/dist/{chunk-DGOFR7D5.cjs → chunk-Y6KHPJDB.cjs} +2 -2
  98. package/dist/{chunk-DXZ57EPE.mjs → chunk-YOHHL2UE.mjs} +14 -0
  99. package/dist/{chunk-KWFNUODD.mjs → chunk-YVPX5PI5.mjs} +1 -0
  100. package/dist/{chunk-HRPTMX5C.mjs → chunk-ZR2QB45W.mjs} +7 -3
  101. package/dist/{chunk-JVM3DKZE.mjs → chunk-ZYCEEE3V.mjs} +1 -1
  102. package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
  103. package/dist/{client-component.d-DWRKyAp5.d.ts → client-component.d-CfJxuXZl.d.ts} +2 -2
  104. package/dist/{client-component.d-CDRvRmbU.d.mts → client-component.d-CnEeVvGG.d.mts} +2 -2
  105. package/dist/{client-plugins.d-CrKZiNSN.d.ts → client-plugins.d-D7dHV1Nf.d.ts} +37 -236
  106. package/dist/{client-plugins.d-BNILjfX3.d.mts → client-plugins.d-Do5ULA0x.d.mts} +37 -236
  107. package/dist/client-plugins.d.mts +5 -3
  108. package/dist/client-plugins.d.ts +5 -3
  109. package/dist/client.cjs +6 -6
  110. package/dist/client.d.mts +10 -8
  111. package/dist/client.d.ts +10 -8
  112. package/dist/client.mjs +5 -5
  113. package/dist/config.d.mts +5 -3
  114. package/dist/config.d.ts +5 -3
  115. package/dist/deployment.cjs +4 -2
  116. package/dist/deployment.d.mts +15 -1
  117. package/dist/deployment.d.ts +15 -1
  118. package/dist/deployment.mjs +3 -1
  119. package/dist/desktop.d.mts +6 -4
  120. package/dist/desktop.d.ts +6 -4
  121. package/dist/{devtools-RZVT4JVN.cjs → devtools-7HNDS4SY.cjs} +7 -7
  122. package/dist/{devtools-UFQYT3VA.mjs → devtools-BP4EBTKQ.mjs} +6 -6
  123. package/dist/docs.cjs +11 -9
  124. package/dist/docs.d.mts +19 -5
  125. package/dist/docs.d.ts +19 -5
  126. package/dist/docs.mjs +11 -9
  127. package/dist/environment/vite.cjs +5 -5
  128. package/dist/environment/vite.d.mts +1 -1
  129. package/dist/environment/vite.d.ts +1 -1
  130. package/dist/environment/vite.mjs +4 -4
  131. package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
  132. package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
  133. package/dist/image/server.cjs +2 -2
  134. package/dist/image/server.mjs +1 -1
  135. package/dist/image/sharp.cjs +9 -9
  136. package/dist/image/sharp.mjs +1 -1
  137. package/dist/index.cjs +45 -39
  138. package/dist/{index.d-Bdm6866n.d.mts → index.d-B1MpEJAo.d.mts} +1 -1
  139. package/dist/{index.d-Dey5T14f.d.ts → index.d-CVFk37uX.d.ts} +1 -1
  140. package/dist/index.d.mts +26 -23
  141. package/dist/index.d.ts +26 -23
  142. package/dist/index.mjs +48 -42
  143. package/dist/instrumentation.cjs +3 -3
  144. package/dist/instrumentation.mjs +2 -2
  145. package/dist/integrations/orm.d.mts +5 -3
  146. package/dist/integrations/orm.d.ts +5 -3
  147. package/dist/integrations.d.mts +5 -3
  148. package/dist/integrations.d.ts +5 -3
  149. package/dist/internal/app-markdown-runtime.cjs +2 -2
  150. package/dist/internal/app-markdown-runtime.d.mts +12 -5
  151. package/dist/internal/app-markdown-runtime.d.ts +12 -5
  152. package/dist/internal/app-markdown-runtime.mjs +1 -1
  153. package/dist/internal/build-runtime.cjs +34 -32
  154. package/dist/internal/build-runtime.d.mts +7 -5
  155. package/dist/internal/build-runtime.d.ts +7 -5
  156. package/dist/internal/build-runtime.mjs +33 -31
  157. package/dist/internal/cli-runtime.cjs +10 -10
  158. package/dist/internal/cli-runtime.mjs +9 -9
  159. package/dist/internal/client-error-overlay.cjs +4 -4
  160. package/dist/internal/client-error-overlay.mjs +1 -1
  161. package/dist/internal/client-runtime.cjs +31 -36
  162. package/dist/internal/client-runtime.d.mts +9 -7
  163. package/dist/internal/client-runtime.d.ts +9 -7
  164. package/dist/internal/client-runtime.mjs +22 -27
  165. package/dist/internal/compression-runtime.d.mts +5 -3
  166. package/dist/internal/compression-runtime.d.ts +5 -3
  167. package/dist/internal/config-runtime.cjs +8 -8
  168. package/dist/internal/config-runtime.d.mts +9 -7
  169. package/dist/internal/config-runtime.d.ts +9 -7
  170. package/dist/internal/config-runtime.mjs +7 -7
  171. package/dist/internal/form-actions.cjs +7 -2
  172. package/dist/internal/form-actions.d.mts +10 -3
  173. package/dist/internal/form-actions.d.ts +10 -3
  174. package/dist/internal/form-actions.mjs +8 -3
  175. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  176. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  177. package/dist/internal/islands-boot.cjs +6 -1
  178. package/dist/internal/islands-boot.mjs +6 -1
  179. package/dist/internal/native-server-fns.cjs +4 -4
  180. package/dist/internal/native-server-fns.mjs +3 -3
  181. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  182. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  183. package/dist/internal/production-node-env.cjs +4 -2
  184. package/dist/internal/production-node-env.d.mts +22 -1
  185. package/dist/internal/production-node-env.d.ts +22 -1
  186. package/dist/internal/production-node-env.mjs +3 -1
  187. package/dist/internal/production-runtime.cjs +17 -9
  188. package/dist/internal/production-runtime.d.mts +31 -19
  189. package/dist/internal/production-runtime.d.ts +31 -19
  190. package/dist/internal/production-runtime.mjs +18 -10
  191. package/dist/internal/server-tree.cjs +2 -2
  192. package/dist/internal/server-tree.d.mts +0 -5
  193. package/dist/internal/server-tree.d.ts +0 -5
  194. package/dist/internal/server-tree.mjs +1 -1
  195. package/dist/internal/vercel-edge-middleware.cjs +87 -0
  196. package/dist/internal/vercel-edge-middleware.d.mts +39 -0
  197. package/dist/internal/vercel-edge-middleware.d.ts +39 -0
  198. package/dist/internal/vercel-edge-middleware.mjs +87 -0
  199. package/dist/layers-7P4RLKVX.cjs +20 -0
  200. package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
  201. package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
  202. package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
  203. package/dist/markdown.d.mts +5 -3
  204. package/dist/markdown.d.ts +5 -3
  205. package/dist/middleware.cjs +4 -4
  206. package/dist/middleware.d.mts +8 -5
  207. package/dist/middleware.d.ts +8 -5
  208. package/dist/middleware.mjs +6 -6
  209. package/dist/mobile.d.mts +4 -4
  210. package/dist/mobile.d.ts +4 -4
  211. package/dist/{mount.d-BP0nLYQO.d.mts → mount.d-CBqr-LfI.d.mts} +1 -1
  212. package/dist/{mount.d-CkiPky_F.d.ts → mount.d-CGzN61Kq.d.ts} +1 -1
  213. package/dist/{navigation-delegate.d-CdBP-hkZ.d.mts → navigation-delegate.d-BwCOhpj7.d.mts} +1 -1
  214. package/dist/{navigation-delegate.d-DchcGzAQ.d.ts → navigation-delegate.d-CLH2dXjy.d.ts} +1 -1
  215. package/dist/navigation.cjs +5 -5
  216. package/dist/navigation.d.mts +8 -6
  217. package/dist/navigation.d.ts +8 -6
  218. package/dist/navigation.mjs +4 -4
  219. package/dist/{nitro-55YOZWRA.mjs → nitro-NSTXT7LB.mjs} +2 -2
  220. package/dist/{nitro-EEX2J3KB.cjs → nitro-Y3LGITW3.cjs} +4 -4
  221. package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
  222. package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
  223. package/dist/{plugin-WIU4GDD4.cjs → plugin-F2O4BFTK.cjs} +2 -2
  224. package/dist/{plugin-SAS22JL7.mjs → plugin-VEBRN7A3.mjs} +1 -1
  225. package/dist/plugin.cjs +23 -23
  226. package/dist/plugin.d.mts +7 -5
  227. package/dist/plugin.d.ts +7 -5
  228. package/dist/plugin.mjs +22 -22
  229. package/dist/{production-runtime.d-Dou_Htas.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
  230. package/dist/{production-runtime.d-VwsBzIee.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
  231. package/dist/query/client.cjs +6 -6
  232. package/dist/query/client.mjs +2 -2
  233. package/dist/{render-plan.d-LKymStDJ.d.mts → render-plan.d-CzGDjcT0.d.mts} +1 -1
  234. package/dist/{render-plan.d-D8UakAIk.d.ts → render-plan.d-W6LmjD6y.d.ts} +1 -1
  235. package/dist/renderer/react/server.cjs +2 -2
  236. package/dist/renderer/react/server.mjs +1 -1
  237. package/dist/renderer-client.cjs +5 -5
  238. package/dist/renderer-client.d.mts +8 -6
  239. package/dist/renderer-client.d.ts +8 -6
  240. package/dist/renderer-client.mjs +2 -2
  241. package/dist/renderer.d.mts +5 -0
  242. package/dist/renderer.d.ts +5 -0
  243. package/dist/{request.d-B928QjWy.d.ts → request.d-CTVRZiQv.d.ts} +1 -1
  244. package/dist/{request.d-KG-4d2eG.d.mts → request.d-CgNVderU.d.mts} +1 -1
  245. package/dist/request.d.mts +6 -4
  246. package/dist/request.d.ts +6 -4
  247. package/dist/{route-rendering.d-NIHQeb4m.d.mts → route-rendering.d-D0bmZVJA.d.mts} +1 -1
  248. package/dist/{route-rendering.d-DoEe_w9t.d.ts → route-rendering.d-FDSNtCMg.d.ts} +1 -1
  249. package/dist/{router.d-DYnRHQwz.d.ts → router.d-DZ3ldniI.d.ts} +1 -1
  250. package/dist/{router.d-B8PkJSGp.d.mts → router.d-GRKm_uAV.d.mts} +1 -1
  251. package/dist/{routes.d-uUBZyWoK.d.ts → routes.d-9GFFNioh.d.ts} +1 -1
  252. package/dist/{routes.d-DgZ_jgGG.d.mts → routes.d-CrEy0lJS.d.mts} +1 -1
  253. package/dist/routes.d.mts +5 -3
  254. package/dist/routes.d.ts +5 -3
  255. package/dist/{rsc-pipeline-7K5H2RPH.cjs → rsc-pipeline-J4KKBSCH.cjs} +10 -10
  256. package/dist/{rsc-pipeline-4OJ5ZQNZ.mjs → rsc-pipeline-PJZOVYSY.mjs} +9 -9
  257. package/dist/{runtime-X52Q7JFR.cjs → runtime-OLEO5NXF.cjs} +20 -20
  258. package/dist/{runtime-U7O3HZOZ.mjs → runtime-QDBSE4H6.mjs} +12 -12
  259. package/dist/{runtime.d-BxQIzwfy.d.mts → runtime.d-DqXihlxm.d.mts} +1 -1
  260. package/dist/{runtime.d-DP7mEkEF.d.ts → runtime.d-pqFQBU2N.d.ts} +1 -1
  261. package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
  262. package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
  263. package/dist/server-plugins.d.mts +6 -4
  264. package/dist/server-plugins.d.ts +6 -4
  265. package/dist/server.cjs +52 -50
  266. package/dist/server.d-C5FFrZAo.d.ts +57 -0
  267. package/dist/server.d-DgC8xew5.d.mts +57 -0
  268. package/dist/server.d.mts +13 -11
  269. package/dist/server.d.ts +13 -11
  270. package/dist/server.mjs +31 -29
  271. package/dist/{spa-router.d-DsFDHTsv.d.ts → spa-router.d-DhOhaQ-7.d.ts} +2 -2
  272. package/dist/{spa-router.d-BgHPVMhz.d.mts → spa-router.d-Dhvy60p4.d.mts} +2 -2
  273. package/dist/testing.d.mts +5 -3
  274. package/dist/testing.d.ts +5 -3
  275. package/dist/types.d-xCIhyjOq.d.mts +233 -0
  276. package/dist/types.d-xCIhyjOq.d.ts +233 -0
  277. package/dist/{utils.d-zxAVcf_V.d.ts → utils.d-BVCMRRau.d.ts} +1 -1
  278. package/dist/{utils.d-BKyKDBR1.d.mts → utils.d-Q8EHCpkF.d.mts} +1 -1
  279. package/dist/version.cjs +2 -2
  280. package/dist/version.mjs +1 -1
  281. package/dist/vite.cjs +23 -23
  282. package/dist/vite.d.mts +10 -8
  283. package/dist/vite.d.ts +10 -8
  284. package/dist/vite.mjs +22 -22
  285. package/dist/workflows.cjs +2 -2
  286. package/dist/workflows.d.mts +121 -1
  287. package/dist/workflows.d.ts +121 -1
  288. package/dist/workflows.mjs +1 -1
  289. package/package.json +7 -2
  290. package/dist/analyzer-KVZGVY5Q.cjs +0 -16
  291. package/dist/chunk-CLFEQGET.cjs +0 -60
  292. package/dist/chunk-MK5E44WP.mjs +0 -60
  293. package/dist/layers-DMRXRL7F.cjs +0 -18
  294. package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
  295. package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
  296. package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
  297. package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
@@ -5,10 +5,12 @@ import {
5
5
  } from "./chunk-QOSDWGKT.mjs";
6
6
  import {
7
7
  createFarmImageHandler
8
- } from "./chunk-3TXKFRSO.mjs";
8
+ } from "./chunk-OEL5EPOJ.mjs";
9
9
  import {
10
10
  FARM_LAYOUT_ELEMENT_CLIENT_SOURCE,
11
+ FARM_NAVIGATION_SCRIPT_SOURCE,
11
12
  FARM_NAVIGATION_STREAM_READER_SOURCE,
13
+ FARM_REFRESH_FIELDS_SOURCE,
12
14
  FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE,
13
15
  FarmApp,
14
16
  collectFarmWebMCPTools,
@@ -16,6 +18,7 @@ import {
16
18
  createFarmClientOptimizeDepsEntries,
17
19
  createFarmSourceAlias,
18
20
  createFarmThemeCssPlugin,
21
+ exactIdPattern,
19
22
  farmFontImportsPlugin,
20
23
  generateClientCachePersistenceCode,
21
24
  generateFarmIntegrationProviderClientCode,
@@ -27,21 +30,22 @@ import {
27
30
  resolveFarmClientCacheAdapterEntry,
28
31
  resolveFarmImageProviderForRuntime,
29
32
  resolveFarmRouteRootStrategy
30
- } from "./chunk-WGHY3OL5.mjs";
33
+ } from "./chunk-IYLZZTP6.mjs";
31
34
  import {
32
35
  generateFarmClientPluginEntryCode,
36
+ hasFarmServerRuntimePlugins,
33
37
  loadTailwindVitePlugin
34
- } from "./chunk-DXZ57EPE.mjs";
38
+ } from "./chunk-YOHHL2UE.mjs";
35
39
  import {
36
40
  FARM_NODE_RESPONSE_END_PENDING
37
- } from "./chunk-KSZK34HU.mjs";
38
- import {
39
- generateFarmTypeArtifacts,
40
- resolveRouteRenderingConfig
41
- } from "./chunk-6YBYX4K4.mjs";
41
+ } from "./chunk-PJQ5W356.mjs";
42
42
  import {
43
43
  resolveFarmPlatform
44
44
  } from "./chunk-SMUW7UST.mjs";
45
+ import {
46
+ generateFarmTypeArtifacts,
47
+ resolveRouteRenderingConfig
48
+ } from "./chunk-G7NBPP7H.mjs";
45
49
  import {
46
50
  createFarmServerFnBoundaryModule,
47
51
  isFarmServerFnBoundaryId,
@@ -75,19 +79,21 @@ import {
75
79
  resolveFarmMCPRouteLabel,
76
80
  resolveFarmMarkdownRouteLabel,
77
81
  setFarmRouteLabel
78
- } from "./chunk-HRPTMX5C.mjs";
82
+ } from "./chunk-ZR2QB45W.mjs";
79
83
  import {
80
84
  FARM_DEFAULT_MCP_PATH
81
85
  } from "./chunk-K6SXMVXO.mjs";
82
86
  import {
83
87
  isFarmPreviewDeploymentEnvironment
84
- } from "./chunk-V5MQMQ2P.mjs";
88
+ } from "./chunk-2P7UYHZP.mjs";
85
89
  import {
86
90
  resolveFarmLayoutFonts
87
91
  } from "./chunk-HZOMT5DY.mjs";
88
92
  import {
93
+ FARM_BROWSER_BUILTIN_PREFIX,
89
94
  FARM_CLIENT_REFERENCE_DIRECTORY,
90
95
  FARM_CLIENT_REFERENCE_PRAGMA,
96
+ FARM_RESOLVE_FROM_PREFIX,
91
97
  collectFarmServerBundledPackageInfo,
92
98
  ensureFarmInternalClientReference,
93
99
  ensureFarmPackageClientReference,
@@ -104,6 +110,7 @@ import {
104
110
  isFarmPackageClientBoundary,
105
111
  isIsolatableClientBoundarySource,
106
112
  loadFarmBrowserBuiltin,
113
+ parseFarmResolveFrom,
107
114
  programmaticClientRouteKey,
108
115
  resolveFarmBrowserBuiltin,
109
116
  resolveFarmIsolatedClientHydrationMode,
@@ -113,7 +120,7 @@ import {
113
120
  rewriteFarmReactServerClientModuleImports,
114
121
  rewriteFarmReactServerImports,
115
122
  stripUseClientDirective
116
- } from "./chunk-GTV2ABO7.mjs";
123
+ } from "./chunk-ULMXZYOA.mjs";
117
124
  import {
118
125
  generateFarmDocsAdapterClientRuntime,
119
126
  getFarmDocsAdapterConfigModule
@@ -127,7 +134,7 @@ import {
127
134
  } from "./chunk-TPA2PV5J.mjs";
128
135
  import {
129
136
  resolveRouteRuleCorsPreflightHeaders
130
- } from "./chunk-724MGMIL.mjs";
137
+ } from "./chunk-R2ZHU37O.mjs";
131
138
  import {
132
139
  FARM_DEVTOOLS_LAUNCH_PARAM,
133
140
  FARM_DEVTOOLS_PATH,
@@ -148,7 +155,7 @@ import {
148
155
  getFarmAppDirectories,
149
156
  getFarmLayerAliases,
150
157
  getFarmSourceRoots
151
- } from "./chunk-52Y3C3HG.mjs";
158
+ } from "./chunk-E7VF3LQ5.mjs";
152
159
  import {
153
160
  REACT_RENDERER,
154
161
  getFarmRendererCapabilities,
@@ -170,7 +177,7 @@ import {
170
177
  createFarmMarkdownSourceResponse,
171
178
  isFarmMarkdownPageFile,
172
179
  normalizeFarmMarkdownRoutePath
173
- } from "./chunk-3T5TLFCQ.mjs";
180
+ } from "./chunk-HEJM46HQ.mjs";
174
181
  import {
175
182
  FARM_MARKDOWN_CONTENT_TYPE,
176
183
  createFarmMarkdownErrorBody,
@@ -271,7 +278,7 @@ import {
271
278
  } from "./chunk-2DA7CLY7.mjs";
272
279
  import {
273
280
  FARM_VERSION
274
- } from "./chunk-H37MDCPR.mjs";
281
+ } from "./chunk-ANMIR6US.mjs";
275
282
  import {
276
283
  DEFAULT_FARM_API_BASE_PATH
277
284
  } from "./chunk-W6QLRQ3V.mjs";
@@ -289,7 +296,7 @@ import {
289
296
  createFarmDeploymentMismatchResponse,
290
297
  getFarmDeploymentMismatch,
291
298
  withFarmDeploymentResponse
292
- } from "./chunk-F7JKVHU2.mjs";
299
+ } from "./chunk-NVOMQLI2.mjs";
293
300
  import {
294
301
  createDeferredDataResponse
295
302
  } from "./chunk-7BIW7VCW.mjs";
@@ -335,8 +342,9 @@ function transformFarmFormActionModule(options) {
335
342
 
336
343
  // src/vite.ts
337
344
  import { parseSync } from "vite";
345
+ import { initSync as initModuleLexer, parse as lexModule } from "es-module-lexer";
338
346
  import { AsyncLocalStorage } from "async_hooks";
339
- import { isBuiltin } from "module";
347
+ import { builtinModules, isBuiltin } from "module";
340
348
 
341
349
  // src/dev-preview-guard.ts
342
350
  import { promises as fsp } from "fs";
@@ -453,8 +461,8 @@ async function realpathOr(directory) {
453
461
  }
454
462
  }
455
463
  function isInside(directory, file) {
456
- const relative3 = path2.relative(directory, file);
457
- return relative3 !== "" && relative3 !== ".." && !relative3.startsWith(`..${path2.sep}`) && !path2.isAbsolute(relative3);
464
+ const relative4 = path2.relative(directory, file);
465
+ return relative4 !== "" && relative4 !== ".." && !relative4.startsWith(`..${path2.sep}`) && !path2.isAbsolute(relative4);
458
466
  }
459
467
 
460
468
  // src/server/dev-cors.ts
@@ -1060,7 +1068,7 @@ function loadFarmWorkflowsDevRuntime() {
1060
1068
  return import("./workflows.mjs");
1061
1069
  }
1062
1070
  function loadFarmDevtoolsSnapshotRuntime() {
1063
- return import("./devtools-UFQYT3VA.mjs");
1071
+ return import("./devtools-BP4EBTKQ.mjs");
1064
1072
  }
1065
1073
  function loadFarmDevtoolsUIRuntime() {
1066
1074
  return import("./devtools-ui-CYBVFLPH.mjs");
@@ -1090,6 +1098,18 @@ var farmReactServerFiles = /* @__PURE__ */ new Set();
1090
1098
  var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
1091
1099
  var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
1092
1100
  var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
1101
+ var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
1102
+ exactIdPattern([FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
1103
+ new RegExp(`^${FARM_RESOLVE_FROM_PREFIX}`),
1104
+ // What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
1105
+ // included.
1106
+ /^node:/,
1107
+ exactIdPattern(builtinModules)
1108
+ ];
1109
+ var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
1110
+ exactIdPattern([FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
1111
+ new RegExp(`^${FARM_BROWSER_BUILTIN_PREFIX}`)
1112
+ ];
1093
1113
  function createFarmPlatformClientModule(platform) {
1094
1114
  return `export function platform() { return ${JSON.stringify(platform)}; }
1095
1115
  export function appDataDir() {
@@ -1135,40 +1155,59 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1135
1155
  configResolved(config) {
1136
1156
  root = config.root;
1137
1157
  },
1138
- resolveId(id, importer, options2) {
1139
- if (id === FARM_PLATFORM_ENTRY) return options2?.ssr ? null : FARM_PLATFORM_CLIENT_ID;
1140
- if (id === SERVER_ONLY_PACKAGE) {
1141
- if (options2?.ssr || options2?.scan) {
1142
- return FARM_SERVER_ONLY_PACKAGE_ID;
1158
+ resolveId: {
1159
+ filter: { id: FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER },
1160
+ handler(id, importer, options2) {
1161
+ if (id === FARM_PLATFORM_ENTRY) return options2?.ssr ? null : FARM_PLATFORM_CLIENT_ID;
1162
+ if (id === SERVER_ONLY_PACKAGE) {
1163
+ if (options2?.ssr || options2?.scan) {
1164
+ return FARM_SERVER_ONLY_PACKAGE_ID;
1165
+ }
1166
+ this.error(
1167
+ `${importer ?? "A module"} imports "server-only", so it must not reach the browser, but client code imports it. Move what the client needs out of that module, or call it from a server component, server function or API route.`
1168
+ );
1143
1169
  }
1144
- this.error(
1145
- `${importer ?? "A module"} imports "server-only", so it must not reach the browser, but client code imports it. Move what the client needs out of that module, or call it from a server component, server function or API route.`
1146
- );
1147
- }
1148
- if (!options2?.ssr && isBuiltin(id)) {
1149
- return resolveFarmBrowserBuiltin(this, id, importer, options2);
1150
- }
1151
- if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
1152
- const importedBy = importer ? ` (imported by ${importer})` : "";
1153
- if (!options2?.ssr) {
1154
- this.error(
1155
- `${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
1156
- );
1157
- }
1158
- vercelOgInstalled || (vercelOgInstalled = isOptionalPeerInstalled(root, "@vercel/og"));
1159
- if (!vercelOgInstalled) {
1160
- this.error(
1161
- `${id} needs @vercel/og, which is not installed${importedBy}. ${VERCEL_OG_INSTALL_HINT}`
1162
- );
1170
+ if (!options2?.ssr && isBuiltin(id)) {
1171
+ return resolveFarmBrowserBuiltin(this, id, importer, options2);
1172
+ }
1173
+ const resolveFrom = importer ? parseFarmResolveFrom(id, importer.split("?", 1)[0]) : null;
1174
+ if (resolveFrom) {
1175
+ const directory = path6.dirname(resolveFrom.importer);
1176
+ return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
1177
+ ...options2,
1178
+ skipSelf: true
1179
+ }).then((resolved) => {
1180
+ if (resolved) return resolved;
1181
+ return this.error(
1182
+ `Could not resolve "${resolveFrom.specifier}" from ${directory}, the package whose server component renders it. Install it in that package, or run your package manager's install again.`
1183
+ );
1184
+ });
1185
+ }
1186
+ if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
1187
+ const importedBy = importer ? ` (imported by ${importer})` : "";
1188
+ if (!options2?.ssr) {
1189
+ this.error(
1190
+ `${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
1191
+ );
1192
+ }
1193
+ vercelOgInstalled || (vercelOgInstalled = isOptionalPeerInstalled(root, "@vercel/og"));
1194
+ if (!vercelOgInstalled) {
1195
+ this.error(
1196
+ `${id} needs @vercel/og, which is not installed${importedBy}. ${VERCEL_OG_INSTALL_HINT}`
1197
+ );
1198
+ }
1199
+ return null;
1163
1200
  }
1164
- return null;
1165
1201
  },
1166
- load(id) {
1167
- if (id === FARM_SERVER_ONLY_PACKAGE_ID) return "export {};";
1168
- if (id === FARM_PLATFORM_CLIENT_ID) {
1169
- return createFarmPlatformClientModule(options.platform ?? resolveFarmPlatform());
1202
+ load: {
1203
+ filter: { id: FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER },
1204
+ handler(id) {
1205
+ if (id === FARM_SERVER_ONLY_PACKAGE_ID) return "export {};";
1206
+ if (id === FARM_PLATFORM_CLIENT_ID) {
1207
+ return createFarmPlatformClientModule(options.platform ?? resolveFarmPlatform());
1208
+ }
1209
+ return loadFarmBrowserBuiltin(id) ?? null;
1170
1210
  }
1171
- return loadFarmBrowserBuiltin(id) ?? null;
1172
1211
  }
1173
1212
  };
1174
1213
  }
@@ -1263,11 +1302,18 @@ function createFarmDevMiddlewareErrorResponse() {
1263
1302
  headers: { "Content-Type": "application/json", "Cache-Control": "private, no-store" }
1264
1303
  });
1265
1304
  }
1266
- function sendFarmDevRuntimeHookError(res, json) {
1305
+ function setFarmDevRuntimeHookErrorHead(res, json) {
1306
+ for (const name of res.getHeaderNames()) res.removeHeader(name);
1267
1307
  res.statusCode = 500;
1268
1308
  res.setHeader("Content-Type", json ? "application/json" : "text/plain; charset=utf-8");
1309
+ }
1310
+ function sendFarmDevRuntimeHookError(res, json) {
1311
+ setFarmDevRuntimeHookErrorHead(res, json);
1269
1312
  res.end(json ? FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
1270
1313
  }
1314
+ function opensFarmDevRuntimeSession(pm) {
1315
+ return pm.hasRuntimeRequestHooks() || hasFarmServerRuntimePlugins(pm.getPlugins());
1316
+ }
1271
1317
  var FARM_CONFIG_ROUTE_PLUGIN_NAMES = /* @__PURE__ */ new Set([
1272
1318
  FARM_CONFIG_HEADERS_PLUGIN_NAME,
1273
1319
  FARM_CONFIG_REDIRECTS_PLUGIN_NAME,
@@ -1391,12 +1437,7 @@ function interceptFarmDevPageResponse(options) {
1391
1437
  console.error("Error in afterResponse hook:", error);
1392
1438
  };
1393
1439
  const writeRuntimeHookFailure = () => {
1394
- res.statusCode = 500;
1395
- res.removeHeader("Content-Length");
1396
- res.setHeader(
1397
- "Content-Type",
1398
- options.jsonError ? "application/json" : "text/plain; charset=utf-8"
1399
- );
1440
+ setFarmDevRuntimeHookErrorHead(res, Boolean(options.jsonError));
1400
1441
  originalWriteHead(500);
1401
1442
  originalWrite(options.jsonError ? FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
1402
1443
  };
@@ -1681,25 +1722,57 @@ function fileContainsProgrammaticPageRoute(file) {
1681
1722
  return false;
1682
1723
  }
1683
1724
  }
1684
- function rewriteEarlySsrRelativeImports(options) {
1685
- const cleanId = options.id.split("?", 1)[0];
1686
- if (!path6.isAbsolute(cleanId) || cleanId.replace(/\\/g, "/").includes("/node_modules/")) {
1725
+ var moduleLexerReady = false;
1726
+ function lexModuleSpecifiers(code) {
1727
+ if (!moduleLexerReady) {
1728
+ initModuleLexer();
1729
+ moduleLexerReady = true;
1730
+ }
1731
+ let imports;
1732
+ try {
1733
+ [imports] = lexModule(code);
1734
+ } catch {
1687
1735
  return null;
1688
1736
  }
1689
- const replacements = [];
1737
+ const specifiers = [];
1738
+ for (const entry of imports) {
1739
+ if (entry.n === void 0 || entry.d === -2) continue;
1740
+ const start = entry.d === -1 ? entry.s - 1 : entry.s;
1741
+ const end = entry.d === -1 ? entry.e + 1 : entry.e;
1742
+ const quote = code[start];
1743
+ if (quote !== '"' && quote !== "'" || code[end - 1] !== quote) continue;
1744
+ specifiers.push({ value: entry.n, start, end });
1745
+ }
1746
+ return specifiers;
1747
+ }
1748
+ function parseModuleSpecifiers(options) {
1690
1749
  let ast;
1691
1750
  try {
1692
1751
  ast = options.parse(options.code);
1693
1752
  } catch {
1694
1753
  return null;
1695
1754
  }
1755
+ const specifiers = [];
1696
1756
  walkModuleAst(ast, (node) => {
1697
1757
  if (node.type !== "ImportDeclaration" && node.type !== "ExportNamedDeclaration" && node.type !== "ExportAllDeclaration" && node.type !== "ImportExpression") {
1698
1758
  return;
1699
1759
  }
1700
1760
  const source = node.source;
1701
1761
  if (!isFarmModuleAstNode(source) || typeof source.value !== "string") return;
1702
- if (!source.value.startsWith(".")) return;
1762
+ specifiers.push({ value: source.value, start: source.start, end: source.end });
1763
+ });
1764
+ return specifiers;
1765
+ }
1766
+ function rewriteEarlySsrRelativeImports(options) {
1767
+ const cleanId = options.id.split("?", 1)[0];
1768
+ if (!path6.isAbsolute(cleanId) || cleanId.replace(/\\/g, "/").includes("/node_modules/")) {
1769
+ return null;
1770
+ }
1771
+ const sources = lexModuleSpecifiers(options.code) ?? parseModuleSpecifiers(options);
1772
+ if (!sources) return null;
1773
+ const replacements = [];
1774
+ for (const source of sources) {
1775
+ if (!source.value.startsWith(".")) continue;
1703
1776
  const suffixIndex = source.value.search(/[?#]/);
1704
1777
  const sourcePath = suffixIndex === -1 ? source.value : source.value.slice(0, suffixIndex);
1705
1778
  const suffix = suffixIndex === -1 ? "" : source.value.slice(suffixIndex);
@@ -1711,13 +1784,15 @@ function rewriteEarlySsrRelativeImports(options) {
1711
1784
  end: source.end,
1712
1785
  code: JSON.stringify(`${specifier}${suffix}`)
1713
1786
  });
1714
- });
1787
+ }
1715
1788
  if (replacements.length === 0) return null;
1716
- let output = options.code;
1717
- for (const replacement of replacements.sort((left, right) => right.start - left.start)) {
1718
- output = output.slice(0, replacement.start) + replacement.code + output.slice(replacement.end);
1789
+ let output = "";
1790
+ let copied = 0;
1791
+ for (const replacement of replacements.sort((left, right) => left.start - right.start)) {
1792
+ output += options.code.slice(copied, replacement.start) + replacement.code;
1793
+ copied = replacement.end;
1719
1794
  }
1720
- return output;
1795
+ return output + options.code.slice(copied);
1721
1796
  }
1722
1797
  function transformIsolatedClientBoundaryModule(options) {
1723
1798
  if (options.slots) {
@@ -1837,8 +1912,13 @@ function transformIsolatedClientBoundaryModule(options) {
1837
1912
  for (const replacement of replacements.sort((left, right) => right.start - left.start)) {
1838
1913
  output = output.slice(0, replacement.start) + replacement.code + output.slice(replacement.end);
1839
1914
  }
1840
- const runtimeImport = options.slots ? options.browser ? "const __farm_islx_island__ = (component) => component;" : `import { createIsland as __farm_islx_island__ } from "@farm.js/core/internal/islx-react";` : `import * as __farm_isolated_react__ from "react";
1841
- import { createFarmIsolatedClientBoundary as __farm_create_isolated_boundary__ } from "@farm.js/core/internal/isolated-boundary";`;
1915
+ const isComponent = `(value) => typeof value === "function" || (typeof value === "object" && value !== null && [Symbol.for("react.memo"), Symbol.for("react.forward_ref"), Symbol.for("react.lazy")].includes(value.$$typeof))`;
1916
+ const runtimeImport = options.slots ? options.browser ? "const __farm_islx_island__ = (component) => component;" : `import { createIsland as __farm_islx_create_island__ } from "@farm.js/core/internal/islx-react";
1917
+ const __farm_is_component__ = ${isComponent};
1918
+ const __farm_islx_island__ = (component, ...rest) => __farm_is_component__(component) ? __farm_islx_create_island__(component, ...rest) : component;` : `import * as __farm_isolated_react__ from "react";
1919
+ import { createFarmIsolatedClientBoundary as __farm_create_boundary__ } from "@farm.js/core/internal/isolated-boundary";
1920
+ const __farm_is_component__ = ${isComponent};
1921
+ const __farm_create_isolated_boundary__ = (react, component, ...rest) => __farm_is_component__(component) ? __farm_create_boundary__(react, component, ...rest) : component;`;
1842
1922
  return `${runtimeImport}
1843
1923
  ${output}
1844
1924
  ${wrapperStatements.join("\n")}
@@ -1869,8 +1949,8 @@ function isFarmModuleAstNode(value) {
1869
1949
  function isFarmConfigFile(file, root) {
1870
1950
  const normalized = file.replace(/\\/g, "/");
1871
1951
  const rootSlug = root.replace(/\\/g, "/").replace(/\/+$/, "");
1872
- const relative3 = normalized.startsWith(`${rootSlug}/`) ? normalized.slice(rootSlug.length + 1) : normalized;
1873
- return FARM_CONFIG_FILENAMES.has(relative3);
1952
+ const relative4 = normalized.startsWith(`${rootSlug}/`) ? normalized.slice(rootSlug.length + 1) : normalized;
1953
+ return FARM_CONFIG_FILENAMES.has(relative4);
1874
1954
  }
1875
1955
  var warnedClientBoundaryIds = /* @__PURE__ */ new Set();
1876
1956
  function warnClientBoundaryOnce(context, id, code, config) {
@@ -2418,6 +2498,34 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2418
2498
  isPathGuarded: isFarmDocsPathGuarded,
2419
2499
  basePath: farmConfig.basePath
2420
2500
  }) : null;
2501
+ const farmDocsListsPages = Boolean(
2502
+ farmDocsDevRuntime && pm?.getPlugins().some((plugin2) => plugin2.name === "farm:infra-analytics")
2503
+ );
2504
+ let farmDocsPagePaths;
2505
+ const getFarmDocsPagePaths = () => {
2506
+ if (!farmDocsDevRuntime || !farmDocsListsPages) return void 0;
2507
+ farmDocsPagePaths ?? (farmDocsPagePaths = farmDocsDevRuntime.listFarmDocsPagePaths(farmConfig.docs, {
2508
+ root: farmConfig.root,
2509
+ srcDir: farmConfig.srcDir,
2510
+ adapter: farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs)
2511
+ }).then(
2512
+ (pages) => new Set(pages),
2513
+ (error) => {
2514
+ logger.warn(
2515
+ `Farm Infra analytics reports docs pages by the docs route, not each page's path: listing them failed (${error instanceof Error ? error.message : String(error)}).`
2516
+ );
2517
+ return void 0;
2518
+ }
2519
+ ));
2520
+ return farmDocsPagePaths;
2521
+ };
2522
+ if (farmDocsListsPages) {
2523
+ for (const event of ["add", "unlink"]) {
2524
+ server.watcher.on(event, () => {
2525
+ farmDocsPagePaths = void 0;
2526
+ });
2527
+ }
2528
+ }
2421
2529
  const wrapFarmDocsResponseWithLayouts = async (request, response) => {
2422
2530
  if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !response.headers.get("content-type")?.toLowerCase().includes("text/html")) {
2423
2531
  return response;
@@ -2727,7 +2835,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2727
2835
  status: redirect.statusCode,
2728
2836
  headers: { Location: redirect.destination }
2729
2837
  });
2730
- if (pm.hasRuntimeRequestHooks()) {
2838
+ if (opensFarmDevRuntimeSession(pm)) {
2731
2839
  const redirectResponse = response;
2732
2840
  try {
2733
2841
  response = await pm.runRuntimeRequest(
@@ -2760,6 +2868,33 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2760
2868
  () => middlewareManager.execute(req, res)
2761
2869
  );
2762
2870
  };
2871
+ const sendDevErrorPage = (error) => {
2872
+ if (!res.headersSent) {
2873
+ res.setHeader("Content-Type", "text/html; charset=utf-8");
2874
+ res.setHeader("Cache-Control", "private, no-store");
2875
+ }
2876
+ next(error);
2877
+ };
2878
+ const sendMiddlewareErrorJSON = async (runtimeSession2, error) => {
2879
+ let response = createFarmDevMiddlewareErrorResponse();
2880
+ if (runtimeSession2) {
2881
+ const errorResponse = response;
2882
+ try {
2883
+ response = await pm.completeRuntimeRequest(
2884
+ runtimeSession2,
2885
+ async (_request, runtime) => {
2886
+ await runtime.reportError(error);
2887
+ return errorResponse;
2888
+ }
2889
+ );
2890
+ } catch {
2891
+ sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
2892
+ return 500;
2893
+ }
2894
+ }
2895
+ await sendWebResponse(res, response);
2896
+ return response.status;
2897
+ };
2763
2898
  const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
2764
2899
  const interceptor = runtimeSession2 && pm?.hasRuntimeHook("after") && middlewareManager?.hasMiddleware() ? interceptFarmDevPageResponse({
2765
2900
  req,
@@ -2784,8 +2919,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2784
2919
  try {
2785
2920
  handled = await runAppMiddlewareForContentRoute();
2786
2921
  } catch (error) {
2787
- interceptor?.release();
2788
- throw error;
2922
+ if (runtimeHookErrorAnswersJSON || res.headersSent) {
2923
+ interceptor?.release();
2924
+ throw error;
2925
+ }
2926
+ if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
2927
+ sendDevErrorPage(error);
2928
+ return true;
2789
2929
  }
2790
2930
  if (!handled) {
2791
2931
  interceptor?.release();
@@ -2814,7 +2954,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2814
2954
  await sendWebResponse(res, runtimeResponse);
2815
2955
  };
2816
2956
  let runtimeSession2;
2817
- if (pm?.hasRuntimeRequestHooks()) {
2957
+ if (pm && opensFarmDevRuntimeSession(pm)) {
2818
2958
  try {
2819
2959
  const routePathname = stripFarmBasePath(requestPathname, farmConfig.basePath);
2820
2960
  const route = setFarmRouteLabel(
@@ -2850,8 +2990,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2850
2990
  runtimeSession2?.request ?? createRequestFromNodeRequest(req, new URL(fullUrl))
2851
2991
  );
2852
2992
  } catch (error) {
2993
+ if (!responding && !res.headersSent) {
2994
+ logger.error(`Middleware error: ${error}`);
2995
+ await discard();
2996
+ await sendMiddlewareErrorJSON(runtimeSession2, error);
2997
+ return;
2998
+ }
2853
2999
  if (runtimeSession2) await pm.failRuntimeRequest(runtimeSession2, error);
2854
- if (!runtimeSession2 || !responding || res.headersSent) throw error;
3000
+ if (!runtimeSession2 || res.headersSent) throw error;
2855
3001
  console.error("[FARM] Built-in route error:", error);
2856
3002
  sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
2857
3003
  return;
@@ -2988,7 +3134,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2988
3134
  stripFarmBasePath(requestPathname, farmConfig.basePath),
2989
3135
  {
2990
3136
  path: farmConfig.docs?.entry || "/docs",
2991
- roots: farmConfig.docs?.roots?.map((root) => root.entry)
3137
+ roots: farmConfig.docs?.roots?.map((root) => root.entry),
3138
+ pages: await getFarmDocsPagePaths()
2992
3139
  }
2993
3140
  )
2994
3141
  }
@@ -3378,7 +3525,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3378
3525
  });
3379
3526
  let runtimeSession2;
3380
3527
  let sessionRequestUrl;
3381
- if (pm?.hasRuntimeRequestHooks()) {
3528
+ if (pm && opensFarmDevRuntimeSession(pm)) {
3382
3529
  try {
3383
3530
  runtimeSession2 = await pm.beginRuntimeRequest(
3384
3531
  await createAPIRequest(),
@@ -3410,9 +3557,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3410
3557
  return;
3411
3558
  }
3412
3559
  logger.error(`API route error: ${error}`);
3413
- res.statusCode = 500;
3414
- res.setHeader("Content-Type", "application/json");
3415
- res.end(FARM_INTERNAL_SERVER_ERROR_BODY);
3560
+ sendFarmDevRuntimeHookError(res, true);
3416
3561
  return;
3417
3562
  }
3418
3563
  pm.copyRequestContext(runtimeSession2.request, req);
@@ -3432,25 +3577,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3432
3577
  throw error;
3433
3578
  }
3434
3579
  logger.error(`Middleware error: ${error}`);
3435
- let response = createFarmDevMiddlewareErrorResponse();
3436
- if (runtimeSession2) {
3437
- const errorResponse = response;
3438
- try {
3439
- response = await pm.completeRuntimeRequest(
3440
- runtimeSession2,
3441
- async (_request, runtime) => {
3442
- await runtime.reportError(error);
3443
- return errorResponse;
3444
- }
3445
- );
3446
- } catch {
3447
- logResponse(method2, urlPath2, 500, Date.now() - startTime2, "API");
3448
- sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
3449
- return;
3450
- }
3451
- }
3452
- logResponse(method2, urlPath2, response.status, Date.now() - startTime2, "API");
3453
- await sendWebResponse(res, response);
3580
+ const status = await sendMiddlewareErrorJSON(runtimeSession2, error);
3581
+ logResponse(method2, urlPath2, status, Date.now() - startTime2, "API");
3454
3582
  return;
3455
3583
  }
3456
3584
  const createHandlerRequest = async () => {
@@ -3557,9 +3685,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3557
3685
  return;
3558
3686
  }
3559
3687
  logger.error(`API route error: ${error}`);
3560
- res.statusCode = 500;
3561
- res.setHeader("Content-Type", "application/json");
3562
- res.end(FARM_INTERNAL_SERVER_ERROR_BODY);
3688
+ sendFarmDevRuntimeHookError(res, true);
3563
3689
  return;
3564
3690
  }
3565
3691
  }
@@ -3601,9 +3727,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3601
3727
  return;
3602
3728
  }
3603
3729
  logger.error(`Docs API route error: ${error}`);
3604
- res.statusCode = 500;
3605
- res.setHeader("Content-Type", "application/json");
3606
- res.end(FARM_INTERNAL_SERVER_ERROR_BODY);
3730
+ sendFarmDevRuntimeHookError(res, true);
3607
3731
  return;
3608
3732
  }
3609
3733
  }
@@ -3627,9 +3751,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3627
3751
  await sendWebResponse(res, response);
3628
3752
  } catch (error) {
3629
3753
  logger.error(`API route error: ${error}`);
3630
- res.statusCode = 500;
3631
- res.setHeader("Content-Type", "application/json");
3632
- res.end(FARM_INTERNAL_SERVER_ERROR_BODY);
3754
+ sendFarmDevRuntimeHookError(res, true);
3633
3755
  }
3634
3756
  return;
3635
3757
  }
@@ -4006,7 +4128,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4006
4128
  const hasBeforeRenderHook = pm?.hasHook("beforeRender") ?? false;
4007
4129
  const hasAfterResponseHook = pm?.hasHook("afterResponse") ?? false;
4008
4130
  const hasHTMLTransformHook = (pm?.hasHook("transformHTML") ?? false) || (pm?.hasHook("afterRender") ?? false);
4009
- const hasRuntimeRequestHooks = pm?.hasRuntimeRequestHooks() ?? false;
4131
+ const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
4010
4132
  const hasRuntimeAfterHook = pm?.hasRuntimeHook("after") ?? false;
4011
4133
  const requestedMatch = routeManager2.matchRoute(requestedPathname);
4012
4134
  const pageBuiltInRouteLabel = (pathname2) => {
@@ -4018,7 +4140,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4018
4140
  };
4019
4141
  let runtimeSession;
4020
4142
  let pathname = requestedPathname;
4021
- if (pm && hasRuntimeRequestHooks) {
4143
+ if (pm && opensRuntimeSession) {
4022
4144
  try {
4023
4145
  const sessionOptions = {
4024
4146
  kind: "page",
@@ -4055,20 +4177,39 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4055
4177
  }
4056
4178
  }
4057
4179
  const routeMatch = pathname === requestedPathname ? requestedMatch : routeManager2.matchRoute(pathname);
4058
- if (pm && hasBeforeRouteMatchHook) {
4059
- await pm.runHookParallel("beforeRouteMatch", {
4060
- pathname,
4061
- method
4062
- });
4063
- }
4064
- if (pm && hasAfterRouteMatchHook) {
4065
- await pm.runHookParallel("afterRouteMatch", {
4066
- pathname,
4067
- matched: !!routeMatch?.route,
4068
- routePattern: routeMatch?.route?.pattern || null,
4069
- params: routeMatch?.params || {},
4070
- layoutPatterns: (routeMatch?.layouts || []).map((l) => l.pattern)
4071
- });
4180
+ const failPageHook = async (error, interceptor) => {
4181
+ interceptor?.release();
4182
+ logResponse(method, urlPath, 500, Date.now() - startTime, "PAGE");
4183
+ if (runtimeSession) {
4184
+ await pm.failRuntimeRequest(runtimeSession, error);
4185
+ } else {
4186
+ await emitPluginError("runtime", error, {
4187
+ kind: "page",
4188
+ pathname,
4189
+ durationMs: Date.now() - startTime
4190
+ });
4191
+ }
4192
+ if (!res.headersSent) sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
4193
+ };
4194
+ try {
4195
+ if (pm && hasBeforeRouteMatchHook) {
4196
+ await pm.runHookParallel("beforeRouteMatch", {
4197
+ pathname,
4198
+ method
4199
+ });
4200
+ }
4201
+ if (pm && hasAfterRouteMatchHook) {
4202
+ await pm.runHookParallel("afterRouteMatch", {
4203
+ pathname,
4204
+ matched: !!routeMatch?.route,
4205
+ routePattern: routeMatch?.route?.pattern || null,
4206
+ params: routeMatch?.params || {},
4207
+ layoutPatterns: (routeMatch?.layouts || []).map((l) => l.pattern)
4208
+ });
4209
+ }
4210
+ } catch (error) {
4211
+ await failPageHook(error);
4212
+ return;
4072
4213
  }
4073
4214
  const renderPayload = {
4074
4215
  pathname,
@@ -4135,7 +4276,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4135
4276
  }
4136
4277
  const renderer = farmApp.getServerRenderer();
4137
4278
  if (pm && hasBeforeRenderHook) {
4138
- await pm.runHookParallel("beforeRender", renderPayload);
4279
+ try {
4280
+ await pm.runHookParallel("beforeRender", renderPayload);
4281
+ } catch (error) {
4282
+ await failPageHook(error, responseInterceptor);
4283
+ return;
4284
+ }
4139
4285
  }
4140
4286
  await renderer.renderPage(req, res);
4141
4287
  if (!shouldInterceptResponse) {
@@ -4145,20 +4291,25 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4145
4291
  const duration = Date.now() - startTime;
4146
4292
  logResponse(method, urlPath, 500, duration, "PAGE");
4147
4293
  if (pm && runtimeSession) {
4148
- await pm.failRuntimeRequest(runtimeSession, error);
4149
- }
4150
- if (!(middlewareFailed && runtimeSession)) {
4294
+ if (middlewareFailed) {
4295
+ await pm.reportRuntimeRequestError(runtimeSession, error);
4296
+ } else {
4297
+ await pm.failRuntimeRequest(runtimeSession, error);
4298
+ if (!res.headersSent && !responseInterceptor?.isEnded()) {
4299
+ responseInterceptor?.release();
4300
+ console.error("[FARM] Page error:", error);
4301
+ sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
4302
+ return;
4303
+ }
4304
+ }
4305
+ } else {
4151
4306
  await emitPluginError("render-page", error, { pathname });
4152
4307
  }
4153
4308
  if (rendererDisabled && !res.headersSent) {
4154
4309
  sendFarmDevErrorJSON(res);
4155
4310
  return;
4156
4311
  }
4157
- if (!res.headersSent) {
4158
- res.setHeader("Content-Type", "text/html; charset=utf-8");
4159
- res.setHeader("Cache-Control", "private, no-store");
4160
- }
4161
- next(error);
4312
+ sendDevErrorPage(error);
4162
4313
  }
4163
4314
  })
4164
4315
  );
@@ -4184,6 +4335,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4184
4335
  };
4185
4336
  },
4186
4337
  async resolveId(id, importer, resolveOptions) {
4338
+ if (id.startsWith("@farm.js/core/internal/") && importer) {
4339
+ const root = farmApp?.getConfig().root || server?.config.root || options.root;
4340
+ const relative4 = root ? path6.relative(root, importer.split("?", 1)[0]) : "";
4341
+ if (root && (relative4.startsWith("..") || path6.isAbsolute(relative4))) {
4342
+ return this.resolve(id, path6.join(root, "package.json"), {
4343
+ ...resolveOptions,
4344
+ skipSelf: true
4345
+ });
4346
+ }
4347
+ }
4187
4348
  if (typeof fontImports.resolveId === "function") {
4188
4349
  const fontId = await fontImports.resolveId.call(this, id, importer, resolveOptions);
4189
4350
  if (fontId) return fontId;
@@ -4390,7 +4551,7 @@ export const manifest = getManifest();
4390
4551
  const reactServer = !serverModule ? null : rewriteFarmReactServerImports({
4391
4552
  code,
4392
4553
  file,
4393
- reference: (specifier, exportName) => ensureFarmPackageClientReference(projectRoot, specifier, exportName),
4554
+ reference: (specifier, exportName) => ensureFarmPackageClientReference(projectRoot, specifier, exportName, file),
4394
4555
  onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
4395
4556
  });
4396
4557
  if (reactServer !== null) {
@@ -4766,6 +4927,7 @@ if (import.meta.hot) {
4766
4927
  const planRouteManager = farmApp?.getRouteManager();
4767
4928
  const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
4768
4929
  const tracksAsyncOwnerIslands = isReactRenderer(currentFarmConfig?.renderer) && planRouteManager !== void 0;
4930
+ let clientPlanCurrent = false;
4769
4931
  if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
4770
4932
  const routeManager = planRouteManager;
4771
4933
  if (routeManager) {
@@ -4800,6 +4962,7 @@ if (import.meta.hot) {
4800
4962
  server2.ws.send({ type: "full-reload", path: "*" });
4801
4963
  return [];
4802
4964
  }
4965
+ clientPlanCurrent = true;
4803
4966
  } catch (error) {
4804
4967
  logger.warn(
4805
4968
  `[Farm.js] Could not refresh the client hydration plan after ${file}: ${error instanceof Error ? error.message : String(error)}`
@@ -4825,7 +4988,7 @@ if (import.meta.hot) {
4825
4988
  }
4826
4989
  return [];
4827
4990
  }
4828
- farmApp?.getRouteManager().invalidateClientManifest();
4991
+ if (!clientPlanCurrent) farmApp?.getRouteManager().invalidateClientManifest();
4829
4992
  const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
4830
4993
  if (manifestModule) {
4831
4994
  server2.moduleGraph.invalidateModule(manifestModule);
@@ -6508,14 +6671,11 @@ function readActiveLayoutPatterns() {
6508
6671
  .filter(Boolean);
6509
6672
  }
6510
6673
 
6674
+ ${FARM_NAVIGATION_SCRIPT_SOURCE}
6675
+
6511
6676
  function activateFragmentScripts(root) {
6512
6677
  for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
6513
- const freshScript = document.createElement('script');
6514
- for (const attribute of Array.from(script.attributes)) {
6515
- freshScript.setAttribute(attribute.name, attribute.value);
6516
- }
6517
- freshScript.textContent = script.textContent || '';
6518
- script.replaceWith(freshScript);
6678
+ script.replaceWith(createFarmNavigationScript(script));
6519
6679
  }
6520
6680
  }
6521
6681
 
@@ -6556,7 +6716,13 @@ function getLayoutShell(root, patterns, index, find) {
6556
6716
  : shell.querySelector('#__farm_page__');
6557
6717
  inner?.replaceChildren();
6558
6718
  removeSuspenseContent(shell);
6559
- shell.querySelectorAll('script').forEach((script) => script.remove());
6719
+ // Each island's props stay, without its id, so new props count as a change.
6720
+ shell.querySelectorAll('script').forEach((script) => {
6721
+ if (script.type !== 'f/props') return script.remove();
6722
+ Array.from(script.attributes).forEach((attribute) => {
6723
+ if (attribute.name !== 'type') script.removeAttribute(attribute.name);
6724
+ });
6725
+ });
6560
6726
  shell.querySelectorAll('f-island').forEach((island) => {
6561
6727
  island.replaceChildren();
6562
6728
  Array.from(island.attributes).forEach((attribute) => island.removeAttribute(attribute.name));
@@ -6564,7 +6730,7 @@ function getLayoutShell(root, patterns, index, find) {
6564
6730
  return shell.innerHTML;
6565
6731
  }
6566
6732
 
6567
- function replaceNavigationBoundary(
6733
+ ${islandValues ? FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
6568
6734
  container,
6569
6735
  fragment,
6570
6736
  currentPatterns,
@@ -6572,6 +6738,8 @@ function replaceNavigationBoundary(
6572
6738
  refresh = false,
6573
6739
  find = findLayoutBoundary,
6574
6740
  ) {
6741
+ // A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
6742
+ if (refresh) revealFarmStreamedContent(fragment);
6575
6743
  let sharedCount = 0;
6576
6744
  while (
6577
6745
  sharedCount < currentPatterns.length &&
@@ -6601,11 +6769,13 @@ function replaceNavigationBoundary(
6601
6769
  activateFragmentScripts(container);
6602
6770
  return container;
6603
6771
  }
6604
-
6772
+ ${islandValues ? `
6773
+ // A refresh renders the same layouts again: their fields keep what was typed, and the focus.
6774
+ const fields = refresh ? captureFarmServerFields(currentTarget) : null;` : ""}
6605
6775
  ${isolatedHydrationEnabled ? `${islandValues ? `// A refresh keeps the islands still on the page, with their state and new props.
6606
6776
  if (refresh) farmIsolatedHydrationRuntime.carryOver(currentTarget, nextTarget);
6607
6777
  ` : ""}disposeFarmIsolatedClientBoundaries(currentTarget);` : ""}
6608
- currentTarget.replaceWith(nextTarget);
6778
+ currentTarget.replaceWith(nextTarget);${islandValues ? "\n if (fields) restoreFarmServerFields(fields, nextTarget);" : ""}
6609
6779
  activateFragmentScripts(nextTarget);
6610
6780
  if (fragmentTreeRoot && fragmentTreeRoot !== nextTarget) fragmentTreeRoot.remove();
6611
6781
 
@@ -6615,7 +6785,17 @@ function replaceNavigationBoundary(
6615
6785
  const support = document.createElement('div');
6616
6786
  support.hidden = true;
6617
6787
  support.dataset.farmFragmentSupport = 'true';
6618
- support.append(fragment);
6788
+ while (fragment.firstChild) {
6789
+ const node = fragment.firstChild;
6790
+ // React's staged Suspense content stays in the root, where a later flush of a streamed
6791
+ // navigation reveals it; React removes it then.
6792
+ if (node.nodeType === 1 && node.matches('div[hidden][id^="S:"]')) {
6793
+ container.appendChild(node);
6794
+ activateFragmentScripts(node);
6795
+ } else {
6796
+ support.appendChild(node);
6797
+ }
6798
+ }
6619
6799
  document.body.appendChild(support);
6620
6800
  activateFragmentScripts(support);
6621
6801
  setTimeout(() => support.remove(), 0);
@@ -6700,7 +6880,8 @@ async function fetchFarmNavigationDocument(path, context) {
6700
6880
  redirect: 'manual',
6701
6881
  headers: createFarmDeploymentRequestHeaders(deploymentId, {
6702
6882
  Accept: 'text/html',
6703
- ...(context.prefetch ? {} : { 'F-Stream': 'flush' }),
6883
+ // A refresh arrives whole, like a transition: the islands it keeps are all in it.
6884
+ ...(context.prefetch || context.refresh ? {} : { 'F-Stream': 'flush' }),
6704
6885
  ...getFarmIslandValueHeaders(),
6705
6886
  // A prefetch names its layouts even when it keeps none: that marks it as a navigation,
6706
6887
  // which the server answers without loading.tsx.
@@ -7320,7 +7501,7 @@ async function defineConfig(config = {}) {
7320
7501
  const tailwindVitePlugin = await loadTailwindVitePlugin();
7321
7502
  const appRoot = path6.resolve(config.root || process.cwd());
7322
7503
  if (config.extends?.length) {
7323
- const { config: layeredConfig } = await import("./layers-T55SA47E.mjs").then(
7504
+ const { config: layeredConfig } = await import("./layers-XQ7VFMWO.mjs").then(
7324
7505
  ({ resolveFarmLayers }) => resolveFarmLayers(config, {
7325
7506
  root: appRoot,
7326
7507
  mode: process.env.NODE_ENV === "production" ? "production" : "development"