@farm.js/core 0.1.78 → 0.1.80

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 (363) hide show
  1. package/dist/{agent-mcp-handler-EDJNU224.mjs → agent-mcp-handler-GDY5CPPW.mjs} +5 -5
  2. package/dist/{agent-mcp-handler-LNBYLRTZ.cjs → agent-mcp-handler-IUL6OPC3.cjs} +6 -6
  3. package/dist/{agent-mcp.d-BErtnhV2.d.ts → agent-mcp.d-BPa5n0ld.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-CYHfcjur.d.mts → agent-mcp.d-DOP95Jxm.d.mts} +1 -1
  5. package/dist/agent-runtime.cjs +2 -2
  6. package/dist/agent-runtime.d.mts +4 -4
  7. package/dist/agent-runtime.d.ts +4 -4
  8. package/dist/agent-runtime.mjs +1 -1
  9. package/dist/{analyzer-M2BG6QYU.mjs → analyzer-F7CWE5VA.mjs} +2 -2
  10. package/dist/analyzer-I7RBBQ65.cjs +16 -0
  11. package/dist/api/node.cjs +6 -6
  12. package/dist/api/node.d.mts +6 -6
  13. package/dist/api/node.d.ts +6 -6
  14. package/dist/api/node.mjs +5 -5
  15. package/dist/api/route-manager.cjs +8 -8
  16. package/dist/api/route-manager.d.mts +6 -6
  17. package/dist/api/route-manager.d.ts +6 -6
  18. package/dist/api/route-manager.mjs +7 -7
  19. package/dist/api/runtime.cjs +5 -5
  20. package/dist/api/runtime.d.mts +5 -5
  21. package/dist/api/runtime.d.ts +5 -5
  22. package/dist/api/runtime.mjs +4 -4
  23. package/dist/api.cjs +10 -10
  24. package/dist/api.d.mts +7 -7
  25. package/dist/api.d.ts +7 -7
  26. package/dist/api.mjs +9 -9
  27. package/dist/{app-manifest.d-6NCkLQ1y.d.mts → app-manifest.d-9UD6BznX.d.mts} +1 -1
  28. package/dist/{app-manifest.d-DuqLBcmi.d.ts → app-manifest.d-CO6Iu0Hx.d.ts} +1 -1
  29. package/dist/app-markdown.cjs +5 -5
  30. package/dist/app-markdown.d.mts +5 -5
  31. package/dist/app-markdown.d.ts +5 -5
  32. package/dist/app-markdown.mjs +4 -4
  33. package/dist/{app.d-Dk2HkvPh.d.mts → app.d-DXeRWZK7.d.mts} +4 -4
  34. package/dist/{app.d-Bz6vYBFF.d.ts → app.d-DwX1ePhs.d.ts} +4 -4
  35. package/dist/cache.cjs +3 -3
  36. package/dist/cache.mjs +2 -2
  37. package/dist/{chunk-QYOAGT3E.cjs → chunk-2BEGVSDF.cjs} +6 -5
  38. package/dist/{chunk-4SLHSODZ.cjs → chunk-2FK47RRZ.cjs} +13 -13
  39. package/dist/{chunk-2YJ4DHTD.cjs → chunk-2NOHVIJ3.cjs} +2 -2
  40. package/dist/{chunk-GDM3ZD2O.cjs → chunk-2OFP3IVA.cjs} +5 -1
  41. package/dist/{chunk-B3IRRANH.mjs → chunk-2RRTOKRZ.mjs} +1 -1
  42. package/dist/{chunk-PNWRH6TR.mjs → chunk-3JQBQG7K.mjs} +4 -4
  43. package/dist/{chunk-H76C5AOU.mjs → chunk-3K2E55BJ.mjs} +2 -2
  44. package/dist/{chunk-VJ6L7TII.cjs → chunk-3SPECQXI.cjs} +31 -20
  45. package/dist/{chunk-R77D7TCZ.mjs → chunk-44G4XHEL.mjs} +13 -6
  46. package/dist/{chunk-6XDDE7M6.cjs → chunk-4H4ZXUNB.cjs} +3 -3
  47. package/dist/{chunk-LIC6CMLB.mjs → chunk-4MIDUSIX.mjs} +13 -13
  48. package/dist/{chunk-F4ID7BGO.cjs → chunk-4OFWG4IK.cjs} +7 -7
  49. package/dist/{chunk-VRI43FDN.mjs → chunk-4WXNTAOM.mjs} +1 -1
  50. package/dist/{chunk-5KISFWD2.cjs → chunk-5OAN7BG5.cjs} +12 -12
  51. package/dist/{chunk-DPBQRDWW.cjs → chunk-5VDJEKGK.cjs} +3 -3
  52. package/dist/{chunk-CYNQPKA4.cjs → chunk-5ZHC6QGD.cjs} +2 -2
  53. package/dist/{chunk-ALEUMLJN.mjs → chunk-67JTJCAS.mjs} +3 -2
  54. package/dist/{chunk-CBP7AKZH.mjs → chunk-6GJZJAED.mjs} +1 -1
  55. package/dist/{chunk-K3ZELA6U.cjs → chunk-7DD5TNPS.cjs} +8 -8
  56. package/dist/{chunk-GC5ROI3A.cjs → chunk-7U4XF76R.cjs} +1 -1
  57. package/dist/{chunk-62DZHPDK.cjs → chunk-7YLDUB4R.cjs} +10 -10
  58. package/dist/{chunk-ZEWIWAS2.mjs → chunk-A5D3UMLJ.mjs} +1 -1
  59. package/dist/{chunk-NNGBTJCX.cjs → chunk-ANZLZNNX.cjs} +83 -25
  60. package/dist/{chunk-CSAIIMY3.mjs → chunk-ATISIC6G.mjs} +1 -1
  61. package/dist/{chunk-ZCYGYIC2.cjs → chunk-AXA2BSX3.cjs} +2 -2
  62. package/dist/{chunk-BNCKXPCU.cjs → chunk-BIAGSYIZ.cjs} +30 -30
  63. package/dist/{chunk-X2SEYK7I.mjs → chunk-BPWTSPK6.mjs} +3 -3
  64. package/dist/{chunk-LMXGCFAM.cjs → chunk-CCMP4JD2.cjs} +1 -1
  65. package/dist/{chunk-JHZ6HULQ.cjs → chunk-CGIVCGH5.cjs} +2 -2
  66. package/dist/{chunk-ERT6HQAI.mjs → chunk-CNDBLUKI.mjs} +2 -2
  67. package/dist/{chunk-OGVOKAQU.mjs → chunk-COTFX4GT.mjs} +1 -1
  68. package/dist/{chunk-RK4MGL6Q.mjs → chunk-CYRO3WP4.mjs} +4 -3
  69. package/dist/{chunk-2G6JPLSL.cjs → chunk-DVHFIETW.cjs} +25 -18
  70. package/dist/{chunk-F35C3TJZ.mjs → chunk-E4E4Y5FD.mjs} +1 -1
  71. package/dist/{chunk-VCW6BR6U.mjs → chunk-EG5YBYHO.mjs} +2 -2
  72. package/dist/{chunk-2DA7CLY7.mjs → chunk-EILUVBKS.mjs} +14 -0
  73. package/dist/{chunk-XT2CHTDN.mjs → chunk-EY7ED5UW.mjs} +3 -3
  74. package/dist/{chunk-ZO6TOLHL.mjs → chunk-FS55CNTC.mjs} +1 -1
  75. package/dist/{chunk-DD2ANOEF.cjs → chunk-G4SZC2WH.cjs} +589 -472
  76. package/dist/{chunk-H5OVJHXY.cjs → chunk-GAWSWJJ2.cjs} +27 -27
  77. package/dist/{chunk-CKNZJFK5.cjs → chunk-GBESKA76.cjs} +3 -3
  78. package/dist/{chunk-EBFTAVGD.mjs → chunk-GBW5DU7V.mjs} +327 -210
  79. package/dist/{chunk-OVUU2RCQ.mjs → chunk-HD5FLXP2.mjs} +1 -1
  80. package/dist/{chunk-Q2EKSSEG.cjs → chunk-HEDGTXXB.cjs} +14 -14
  81. package/dist/{chunk-5QZT2EQN.cjs → chunk-HNUBRUFQ.cjs} +2 -2
  82. package/dist/{chunk-JA6RML7C.mjs → chunk-HR4N2K4V.mjs} +2 -2
  83. package/dist/{chunk-6D3CJFNU.cjs → chunk-HR5GU4UU.cjs} +7 -7
  84. package/dist/{chunk-SX535SU5.cjs → chunk-IJPRCQHW.cjs} +10 -10
  85. package/dist/{chunk-VRJAMU34.mjs → chunk-JGEN2FIT.mjs} +1 -1
  86. package/dist/{chunk-QES76U42.mjs → chunk-K3XKEZR6.mjs} +3 -3
  87. package/dist/{chunk-LPXJEZJK.mjs → chunk-KCJBIWBM.mjs} +2 -2
  88. package/dist/{chunk-7JTVN6IJ.mjs → chunk-KEU55O2D.mjs} +1 -1
  89. package/dist/{chunk-5REIO5DT.mjs → chunk-KKVRWNDH.mjs} +3 -3
  90. package/dist/{chunk-NSNQLBHR.cjs → chunk-KMGHXIDA.cjs} +2 -2
  91. package/dist/{chunk-Z2FFLTF5.mjs → chunk-LTXKRIST.mjs} +2 -2
  92. package/dist/{chunk-F7PKUP6P.cjs → chunk-LVGB5PYK.cjs} +27 -27
  93. package/dist/{chunk-7RQ5KAK6.mjs → chunk-MDEFTF63.mjs} +69 -14
  94. package/dist/{chunk-IWGGRXD2.cjs → chunk-MHKPXX3J.cjs} +2 -2
  95. package/dist/{chunk-5DREJN4G.cjs → chunk-MQOHYV6L.cjs} +15 -15
  96. package/dist/{chunk-BGUTIQII.mjs → chunk-MUZHULW2.mjs} +1 -1
  97. package/dist/{chunk-WGNGM6MJ.mjs → chunk-MZ5QGWRW.mjs} +2 -2
  98. package/dist/{chunk-DZZHTMWM.cjs → chunk-N3H7UPBM.cjs} +3 -2
  99. package/dist/{chunk-WJ4NUY2H.mjs → chunk-NJ4OASLP.mjs} +4 -4
  100. package/dist/{chunk-EVVV2XZ2.cjs → chunk-NW3DL2PM.cjs} +53 -7
  101. package/dist/{chunk-WRWJ7IWT.cjs → chunk-OLKYHTLN.cjs} +5 -5
  102. package/dist/{chunk-EVIWKPJV.cjs → chunk-PLJMEUAN.cjs} +15 -1
  103. package/dist/{chunk-EMTN5ABC.mjs → chunk-POVHO46S.mjs} +1 -1
  104. package/dist/{chunk-X3Y6JWJG.cjs → chunk-PWMJBCAN.cjs} +3 -3
  105. package/dist/{chunk-PG7J7XYT.cjs → chunk-Q4TRGTO7.cjs} +6 -6
  106. package/dist/{chunk-KUXEII7V.mjs → chunk-Q4YEAWUK.mjs} +1 -1
  107. package/dist/{chunk-IGE5BAWK.mjs → chunk-QBJ6N5MT.mjs} +53 -7
  108. package/dist/{chunk-PKXGFQZS.mjs → chunk-QD34VE4N.mjs} +1 -1
  109. package/dist/{chunk-S6RUJRWI.mjs → chunk-QHAISITM.mjs} +1 -1
  110. package/dist/{chunk-VJI2LWTL.cjs → chunk-RFNQTQ44.cjs} +2 -2
  111. package/dist/{chunk-TZ2YPXLB.cjs → chunk-RLCOWWE5.cjs} +7 -7
  112. package/dist/{chunk-IG2JE6WJ.mjs → chunk-RLEAVG6G.mjs} +1 -1
  113. package/dist/{chunk-VO5XDZHK.mjs → chunk-RPA45OQS.mjs} +2 -2
  114. package/dist/{chunk-A37D6LOS.mjs → chunk-RQBGHHOQ.mjs} +1 -1
  115. package/dist/{chunk-BZJYPIFZ.cjs → chunk-SDICLSQU.cjs} +8 -8
  116. package/dist/{chunk-FE6KYDHC.cjs → chunk-SHDCKRP4.cjs} +3 -3
  117. package/dist/{chunk-DUSTJ6A5.mjs → chunk-SLEHAGGV.mjs} +2 -2
  118. package/dist/{chunk-26CNCIFI.cjs → chunk-T3SMMLSB.cjs} +2 -2
  119. package/dist/{chunk-K6DXKHFE.mjs → chunk-TE7AX6HB.mjs} +1 -1
  120. package/dist/{chunk-LJKTJNOF.cjs → chunk-TS3ZHJN5.cjs} +3 -3
  121. package/dist/{chunk-KHS3T3E5.mjs → chunk-TYHWZOA2.mjs} +1 -1
  122. package/dist/{chunk-Z3QXQN4U.mjs → chunk-U6GMCDRS.mjs} +1 -1
  123. package/dist/{chunk-URQW27KO.mjs → chunk-UBLKPREL.mjs} +1 -1
  124. package/dist/{chunk-DD22NQFX.cjs → chunk-UGLTOLTJ.cjs} +2 -2
  125. package/dist/{chunk-PE2LEWXA.mjs → chunk-UJPE75GF.mjs} +1 -1
  126. package/dist/{chunk-6ZFGWB75.cjs → chunk-UWOCYINY.cjs} +4 -4
  127. package/dist/{chunk-E7V2GYBP.mjs → chunk-V73Y4UBL.mjs} +67 -9
  128. package/dist/{chunk-G7B6NU4X.cjs → chunk-VFMHE5D3.cjs} +3 -3
  129. package/dist/{chunk-IXO6O2EL.cjs → chunk-VGVRGGP4.cjs} +2 -2
  130. package/dist/{chunk-YRXPDKMM.cjs → chunk-W53Z4WDI.cjs} +8 -8
  131. package/dist/{chunk-47R7CX4A.mjs → chunk-WBPVLCNE.mjs} +1 -1
  132. package/dist/{chunk-4VLXQ55O.cjs → chunk-WIZRYFB2.cjs} +3 -3
  133. package/dist/{chunk-NB2ZEBIS.cjs → chunk-WJ2O2MPP.cjs} +287 -288
  134. package/dist/{chunk-HVMQAVZK.cjs → chunk-X4TSMQWF.cjs} +333 -303
  135. package/dist/{chunk-DASQJ5UD.mjs → chunk-XF7MJSUS.mjs} +1 -1
  136. package/dist/{chunk-S7QEQCVV.mjs → chunk-XGL42MQ7.mjs} +1 -1
  137. package/dist/{chunk-YN7G22MP.cjs → chunk-XKUKWMGX.cjs} +3 -3
  138. package/dist/{chunk-FOULIN4S.cjs → chunk-XY5OZQF6.cjs} +2 -2
  139. package/dist/{chunk-RIMEFQYO.mjs → chunk-XZBBKZGW.mjs} +73 -74
  140. package/dist/{chunk-ZJGFAW5U.mjs → chunk-YHHOTKUT.mjs} +5 -1
  141. package/dist/{chunk-A7EJATEW.mjs → chunk-YN3YMSKD.mjs} +3 -3
  142. package/dist/{chunk-PDACTAVX.mjs → chunk-YOVSWY2E.mjs} +1 -1
  143. package/dist/{chunk-R5X7FDOG.mjs → chunk-YU2MNIIY.mjs} +1 -1
  144. package/dist/{chunk-42EUEYW6.cjs → chunk-YUQUGVSV.cjs} +8 -8
  145. package/dist/{chunk-KZ5BOWJS.cjs → chunk-Z4SMFUZ7.cjs} +28 -28
  146. package/dist/{chunk-MBD34AS5.cjs → chunk-Z5BANEQD.cjs} +6 -6
  147. package/dist/{chunk-AHGOHPRN.mjs → chunk-ZDYYZX73.mjs} +60 -30
  148. package/dist/{chunk-4PWGLPL6.mjs → chunk-ZIEO3DQ3.mjs} +26 -15
  149. package/dist/{chunk-XGS76V7L.cjs → chunk-ZPEZXQTM.cjs} +22 -22
  150. package/dist/{chunk-ODYKCC6W.cjs → chunk-ZVSQN7NC.cjs} +135 -80
  151. package/dist/{cli-runtime.d-BG9q2_vC.d.ts → cli-runtime.d-8BhZy_wr.d.ts} +7 -6
  152. package/dist/{cli-runtime.d-CGMGs1Zz.d.mts → cli-runtime.d-DPNTN-JV.d.mts} +7 -6
  153. package/dist/client/lifecycle.d.mts +1 -1
  154. package/dist/client/lifecycle.d.ts +1 -1
  155. package/dist/{client-component.d-CdsG1E7p.d.mts → client-component.d-CMCdyAr8.d.mts} +1 -1
  156. package/dist/{client-component.d-B84GPb_u.d.ts → client-component.d-CkDcob6D.d.ts} +1 -1
  157. package/dist/{client-plugins.d-FptsHgls.d.ts → client-plugins.d-BYIovYqX.d.ts} +4 -4
  158. package/dist/{client-plugins.d-DX-iCJWE.d.mts → client-plugins.d-WcMwOZGZ.d.mts} +4 -4
  159. package/dist/client-plugins.d.mts +4 -4
  160. package/dist/client-plugins.d.ts +4 -4
  161. package/dist/client.cjs +3 -3
  162. package/dist/client.d.mts +9 -9
  163. package/dist/client.d.ts +9 -9
  164. package/dist/client.mjs +2 -2
  165. package/dist/config.d.mts +4 -4
  166. package/dist/config.d.ts +4 -4
  167. package/dist/cron.cjs +3 -3
  168. package/dist/cron.mjs +2 -2
  169. package/dist/desktop.d.mts +5 -5
  170. package/dist/desktop.d.ts +5 -5
  171. package/dist/{devtools-7P3OUNLV.mjs → devtools-F3FDFV26.mjs} +10 -10
  172. package/dist/{devtools-TMATFNUY.cjs → devtools-JJOYTIMS.cjs} +12 -12
  173. package/dist/docs.cjs +14 -14
  174. package/dist/docs.d.mts +6 -6
  175. package/dist/docs.d.ts +6 -6
  176. package/dist/docs.mjs +13 -13
  177. package/dist/environment/vite.cjs +5 -5
  178. package/dist/environment/vite.d.mts +9 -0
  179. package/dist/environment/vite.d.ts +9 -0
  180. package/dist/environment/vite.mjs +4 -4
  181. package/dist/{handler.d-Cy3XbY_W.d.ts → handler.d-BwdOyc9x.d.ts} +1 -1
  182. package/dist/{handler.d-DSwLTpa5.d.mts → handler.d-s3IM6pbJ.d.mts} +1 -1
  183. package/dist/{headers.d-DiL9YTH3.d.mts → headers.d-BR-OXrqQ.d.mts} +1 -1
  184. package/dist/{headers.d-Qbjo38a0.d.ts → headers.d-CAW4wPey.d.ts} +1 -1
  185. package/dist/index.cjs +65 -59
  186. package/dist/{index.d-CqQKX3s6.d.mts → index.d-BEVK61zS.d.mts} +1 -1
  187. package/dist/{index.d-OccJoC6I.d.ts → index.d-ah2c89Wu.d.ts} +1 -1
  188. package/dist/index.d.mts +25 -25
  189. package/dist/index.d.ts +25 -25
  190. package/dist/index.mjs +67 -61
  191. package/dist/integrations/orm.cjs +3 -3
  192. package/dist/integrations/orm.d.mts +4 -4
  193. package/dist/integrations/orm.d.ts +4 -4
  194. package/dist/integrations/orm.mjs +2 -2
  195. package/dist/integrations.cjs +2 -2
  196. package/dist/integrations.d.mts +4 -4
  197. package/dist/integrations.d.ts +4 -4
  198. package/dist/integrations.mjs +1 -1
  199. package/dist/internal/app-markdown-runtime.cjs +4 -4
  200. package/dist/internal/app-markdown-runtime.d.mts +5 -5
  201. package/dist/internal/app-markdown-runtime.d.ts +5 -5
  202. package/dist/internal/app-markdown-runtime.mjs +3 -3
  203. package/dist/internal/build-runtime.cjs +47 -47
  204. package/dist/internal/build-runtime.d.mts +7 -7
  205. package/dist/internal/build-runtime.d.ts +7 -7
  206. package/dist/internal/build-runtime.mjs +46 -46
  207. package/dist/internal/cli-runtime.cjs +29 -26
  208. package/dist/internal/cli-runtime.d.mts +11 -11
  209. package/dist/internal/cli-runtime.d.ts +11 -11
  210. package/dist/internal/cli-runtime.mjs +28 -25
  211. package/dist/internal/client-error-overlay.cjs +4 -4
  212. package/dist/internal/client-error-overlay.mjs +1 -1
  213. package/dist/internal/client-runtime.cjs +48 -11
  214. package/dist/internal/client-runtime.d.mts +17 -21
  215. package/dist/internal/client-runtime.d.ts +17 -21
  216. package/dist/internal/client-runtime.mjs +37 -0
  217. package/dist/internal/compression-runtime.d.mts +4 -4
  218. package/dist/internal/compression-runtime.d.ts +4 -4
  219. package/dist/internal/config-runtime.cjs +12 -12
  220. package/dist/internal/config-runtime.d.mts +6 -6
  221. package/dist/internal/config-runtime.d.ts +6 -6
  222. package/dist/internal/config-runtime.mjs +11 -11
  223. package/dist/internal/infra-analytics-runtime.cjs +10 -10
  224. package/dist/internal/infra-analytics-runtime.mjs +8 -8
  225. package/dist/internal/islands-boot.cjs +33 -5
  226. package/dist/internal/islands-boot.d.mts +19 -1
  227. package/dist/internal/islands-boot.d.ts +19 -1
  228. package/dist/internal/islands-boot.mjs +32 -4
  229. package/dist/internal/native-server-fns.cjs +4 -4
  230. package/dist/internal/native-server-fns.mjs +3 -3
  231. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  232. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  233. package/dist/internal/production-runtime.cjs +26 -26
  234. package/dist/internal/production-runtime.d.mts +14 -13
  235. package/dist/internal/production-runtime.d.ts +14 -13
  236. package/dist/internal/production-runtime.mjs +27 -27
  237. package/dist/internal/spa-router.cjs +44 -0
  238. package/dist/internal/spa-router.d.mts +41 -0
  239. package/dist/internal/spa-router.d.ts +41 -0
  240. package/dist/internal/spa-router.mjs +44 -0
  241. package/dist/internal/start-manifest.d.mts +4 -4
  242. package/dist/internal/start-manifest.d.ts +4 -4
  243. package/dist/internal/vercel-edge-middleware.cjs +3 -3
  244. package/dist/internal/vercel-edge-middleware.mjs +2 -2
  245. package/dist/{lifecycle.d-VzcXyEyn.d.ts → lifecycle.d-OtGWAvJT.d.mts} +1 -1
  246. package/dist/{lifecycle.d-VzcXyEyn.d.mts → lifecycle.d-OtGWAvJT.d.ts} +1 -1
  247. package/dist/markdown.cjs +3 -3
  248. package/dist/markdown.d.mts +4 -4
  249. package/dist/markdown.d.ts +4 -4
  250. package/dist/markdown.mjs +2 -2
  251. package/dist/middleware.cjs +8 -8
  252. package/dist/middleware.d.mts +4 -4
  253. package/dist/middleware.d.ts +4 -4
  254. package/dist/middleware.mjs +7 -7
  255. package/dist/{mount.d-CPzqOm-a.d.ts → mount.d-DcoPFqv5.d.ts} +1 -1
  256. package/dist/{mount.d-AcJaUtHF.d.mts → mount.d-Ylo-CmzK.d.mts} +1 -1
  257. package/dist/{native-server-fn-handler-WYYY4YBN.mjs → native-server-fn-handler-OXFTI6V5.mjs} +4 -4
  258. package/dist/{native-server-fn-handler-XRTZR7SZ.cjs → native-server-fn-handler-TNVFEQW3.cjs} +5 -5
  259. package/dist/{native-tree-MNUFN5G6.cjs → native-tree-5TENEQ7Y.cjs} +4 -4
  260. package/dist/{native-tree-JDI3LJSH.mjs → native-tree-LNO7K6JR.mjs} +3 -3
  261. package/dist/{navigation-delegate.d-_Df9DnPY.d.ts → navigation-delegate.d-2MK4YSlL.d.ts} +1 -1
  262. package/dist/{navigation-delegate.d-C4i5Y39E.d.mts → navigation-delegate.d-BA5h0fbE.d.mts} +1 -1
  263. package/dist/navigation.cjs +4 -4
  264. package/dist/navigation.d.mts +7 -7
  265. package/dist/navigation.d.ts +7 -7
  266. package/dist/navigation.mjs +3 -3
  267. package/dist/{nitro-NUCTYEKJ.cjs → nitro-6UOJXJZ6.cjs} +7 -7
  268. package/dist/{nitro-VCJ6QQSI.mjs → nitro-C3MYDX7V.mjs} +3 -3
  269. package/dist/observability.cjs +8 -2
  270. package/dist/{observability.d-DdJRiaIX.d.mts → observability.d-mXSbp4jc.d.mts} +17 -1
  271. package/dist/{observability.d-DdJRiaIX.d.ts → observability.d-mXSbp4jc.d.ts} +17 -1
  272. package/dist/observability.d.mts +1 -1
  273. package/dist/observability.d.ts +1 -1
  274. package/dist/observability.mjs +7 -1
  275. package/dist/{plugin-TV6W7YNK.mjs → plugin-33I3V42N.mjs} +1 -1
  276. package/dist/{plugin-AGEFSU7K.cjs → plugin-LN3JBZRR.cjs} +2 -2
  277. package/dist/plugin.cjs +37 -37
  278. package/dist/plugin.d.mts +8 -8
  279. package/dist/plugin.d.ts +8 -8
  280. package/dist/plugin.mjs +36 -36
  281. package/dist/query/client.cjs +6 -6
  282. package/dist/query/client.mjs +1 -1
  283. package/dist/{render-plan.d-CslZE7o7.d.ts → render-plan.d-2o-AG-ot.d.ts} +1 -1
  284. package/dist/{render-plan.d-4V_NmaA6.d.mts → render-plan.d-ChYBMhLu.d.mts} +1 -1
  285. package/dist/renderer-client.cjs +4 -4
  286. package/dist/renderer-client.d.mts +7 -7
  287. package/dist/renderer-client.d.ts +7 -7
  288. package/dist/renderer-client.mjs +1 -1
  289. package/dist/renderer.d.mts +16 -1
  290. package/dist/renderer.d.ts +16 -1
  291. package/dist/{request.d-CbV3y7j3.d.ts → request.d-CE0FIkiM.d.ts} +1 -1
  292. package/dist/{request.d-CmLTxEgS.d.mts → request.d-RCnCBuWq.d.mts} +1 -1
  293. package/dist/request.d.mts +5 -5
  294. package/dist/request.d.ts +5 -5
  295. package/dist/{route-rendering.d-CETnXNez.d.ts → route-rendering.d-BTPOM2nU.d.ts} +1 -1
  296. package/dist/{route-rendering.d-CmoqfOmj.d.mts → route-rendering.d-BZJnfKsp.d.mts} +1 -1
  297. package/dist/{router.d-Dga3N5YO.d.ts → router.d-BU_WE6Ol.d.ts} +1 -1
  298. package/dist/{router.d-ktz7pwYm.d.mts → router.d-D8Vvwl4i.d.mts} +1 -1
  299. package/dist/routes.cjs +4 -4
  300. package/dist/routes.d.mts +4 -4
  301. package/dist/routes.d.ts +4 -4
  302. package/dist/routes.mjs +3 -3
  303. package/dist/{rsc-pipeline-JLYD26AR.cjs → rsc-pipeline-A3R4U26C.cjs} +15 -15
  304. package/dist/{rsc-pipeline-N7CWJW7T.mjs → rsc-pipeline-JZWVSHOR.mjs} +14 -14
  305. package/dist/{runtime-QXX2A4TS.mjs → runtime-SQFRHRGJ.mjs} +18 -18
  306. package/dist/{runtime-F5NSS4DD.cjs → runtime-WZ3CHHGJ.cjs} +26 -26
  307. package/dist/{runtime.d-DuaXEM0p.d.mts → runtime.d-BnmuOXVD.d.mts} +1 -1
  308. package/dist/{runtime.d-BWLZUOfA.d.ts → runtime.d-DJ6IIKcF.d.ts} +1 -1
  309. package/dist/{schema-dev-notice-2GN5V7Y2.mjs → schema-dev-notice-EUPAUJVN.mjs} +2 -2
  310. package/dist/{schema-dev-notice-6VCOZGG2.cjs → schema-dev-notice-ZSCL47CT.cjs} +5 -5
  311. package/dist/search-client-A7YJT7JZ.cjs +15 -0
  312. package/dist/{search-client-W4PEFAQB.mjs → search-client-GIXIEU75.mjs} +1 -1
  313. package/dist/{server-components-status.d-C5JpC7_Y.d.ts → server-components-status.d-BeqSXcjM.d.ts} +1 -1
  314. package/dist/{server-components-status.d-CqxtJmqP.d.mts → server-components-status.d-BzOg9M8g.d.mts} +1 -1
  315. package/dist/server-fn.cjs +4 -4
  316. package/dist/server-fn.mjs +3 -3
  317. package/dist/server-plugins.d.mts +6 -6
  318. package/dist/server-plugins.d.ts +6 -6
  319. package/dist/server-query.cjs +5 -5
  320. package/dist/server-query.mjs +4 -4
  321. package/dist/server.cjs +73 -73
  322. package/dist/server.d.mts +15 -15
  323. package/dist/server.d.ts +15 -15
  324. package/dist/server.mjs +47 -47
  325. package/dist/{session-AK2OA5UZ.mjs → session-4IB34X35.mjs} +2 -2
  326. package/dist/session-MOYQJ7E6.cjs +24 -0
  327. package/dist/{spa-router.d-C3LzwTlY.d.ts → spa-router.d-BOwuVkMl.d.ts} +20 -4
  328. package/dist/{spa-router.d-BLE188EL.d.mts → spa-router.d-CDpftSsk.d.mts} +20 -4
  329. package/dist/{ssg.d-DisOfj0I.d.ts → ssg.d-BTVqyq8T.d.ts} +2 -2
  330. package/dist/{ssg.d-QrFyU6T4.d.mts → ssg.d-Bx_WFuwg.d.mts} +2 -2
  331. package/dist/storage.cjs +2 -2
  332. package/dist/storage.d.mts +112 -96
  333. package/dist/storage.d.ts +112 -96
  334. package/dist/storage.mjs +1 -1
  335. package/dist/testing.cjs +11 -11
  336. package/dist/testing.d.mts +4 -4
  337. package/dist/testing.d.ts +4 -4
  338. package/dist/testing.mjs +8 -8
  339. package/dist/{types.d-DW2vyaUq.d.mts → types.d-C5hlNbHa.d.mts} +8 -1
  340. package/dist/{types.d-DW2vyaUq.d.ts → types.d-C5hlNbHa.d.ts} +8 -1
  341. package/dist/{utils.d-BlWZFgdL.d.mts → utils.d-JkrpS-NJ.d.mts} +1 -1
  342. package/dist/{utils.d-7YcgfTCK.d.ts → utils.d-_dvevm5s.d.ts} +1 -1
  343. package/dist/version.cjs +2 -2
  344. package/dist/version.mjs +1 -1
  345. package/dist/vite.cjs +39 -37
  346. package/dist/vite.d.mts +15 -10
  347. package/dist/vite.d.ts +15 -10
  348. package/dist/vite.mjs +38 -36
  349. package/dist/workflows.cjs +3 -3
  350. package/dist/workflows.mjs +2 -2
  351. package/package.json +7 -1
  352. package/types/images.d.ts +9 -0
  353. package/dist/analyzer-KVTUYGTT.cjs +0 -16
  354. package/dist/search-client-6NVC6HM2.cjs +0 -15
  355. package/dist/session-H4TWP73H.cjs +0 -24
  356. package/dist/{chunk-GFXKO4UW.mjs → chunk-3XTRT3MB.mjs} +48 -48
  357. package/dist/{chunk-JKFN3YVG.mjs → chunk-6JWXHPVR.mjs} +0 -0
  358. package/dist/{chunk-522K362I.mjs → chunk-C2OLXVUC.mjs} +0 -0
  359. package/dist/{chunk-MALGIHIC.cjs → chunk-HS4JPIGR.cjs} +0 -0
  360. package/dist/{chunk-CUZT7474.cjs → chunk-TCMRLW3K.cjs} +0 -0
  361. package/dist/{chunk-Q3DO7MVK.mjs → chunk-URBP6DLH.mjs} +0 -0
  362. package/dist/{chunk-AOTD2N5P.cjs → chunk-WGWWRV2M.cjs} +0 -0
  363. package/dist/{chunk-L7Y65BQU.cjs → chunk-WHEQJN4G.cjs} +48 -48
@@ -28,11 +28,11 @@ import {
28
28
  } from "./chunk-KQH2COEJ.mjs";
29
29
  import {
30
30
  FARM_MOBILE_SESSION_PLUGIN
31
- } from "./chunk-CBP7AKZH.mjs";
31
+ } from "./chunk-6GJZJAED.mjs";
32
32
  import {
33
33
  collectFarmNativeServerFns,
34
34
  findFarmNativeScreenFiles
35
- } from "./chunk-S6RUJRWI.mjs";
35
+ } from "./chunk-QHAISITM.mjs";
36
36
  import {
37
37
  assertFarmDocsAdapterServesNoGuardedPages,
38
38
  compileFarmDocsAdapterEdgeManifest,
@@ -41,7 +41,7 @@ import {
41
41
  hasFarmDocsRuntimeAdapter,
42
42
  listFarmDocsAdapterPages,
43
43
  listFarmDocsPagePaths
44
- } from "./chunk-VCW6BR6U.mjs";
44
+ } from "./chunk-EG5YBYHO.mjs";
45
45
  import {
46
46
  FARM_DOCS_LAST_MODIFIED_MANIFEST,
47
47
  createFarmDocsHandler,
@@ -54,18 +54,18 @@ import {
54
54
  loadFarmDocsPage,
55
55
  resolveFarmDocsContentDir,
56
56
  toFarmDocsMarkdownPage
57
- } from "./chunk-LPXJEZJK.mjs";
57
+ } from "./chunk-KCJBIWBM.mjs";
58
58
  import {
59
59
  generateFarmDocsSearchClientRuntime,
60
60
  isFarmDocsSearchEnabled,
61
61
  resolveFarmDocsSearchClientModule
62
- } from "./chunk-ALEUMLJN.mjs";
62
+ } from "./chunk-67JTJCAS.mjs";
63
63
  import {
64
64
  CDN_CACHE_CONTROL_HEADERS
65
- } from "./chunk-URQW27KO.mjs";
65
+ } from "./chunk-UBLKPREL.mjs";
66
66
  import {
67
67
  FARM_PRERENDER_ENV
68
- } from "./chunk-E7V2GYBP.mjs";
68
+ } from "./chunk-V73Y4UBL.mjs";
69
69
  import {
70
70
  loadFarmDocsEngine
71
71
  } from "./chunk-LRPPXKCX.mjs";
@@ -74,7 +74,7 @@ import {
74
74
  getDeployTargetForPreset,
75
75
  hasCustomFarmRouteContext,
76
76
  resolveDeployOutputPath
77
- } from "./chunk-LIC6CMLB.mjs";
77
+ } from "./chunk-4MIDUSIX.mjs";
78
78
  import {
79
79
  resolveFarmInstrumentationFile
80
80
  } from "./chunk-57QAQU4F.mjs";
@@ -86,6 +86,7 @@ import {
86
86
  } from "./chunk-BRNPLD22.mjs";
87
87
  import {
88
88
  DEFAULT_NOT_FOUND_STYLES,
89
+ FARM_EARLY_NAVIGATION_SOURCE,
89
90
  FARM_LAYOUT_ELEMENT_CLIENT_SOURCE,
90
91
  FARM_NAVIGATION_SCRIPT_SOURCE,
91
92
  FARM_NAVIGATION_STREAM_READER_SOURCE,
@@ -116,23 +117,23 @@ import {
116
117
  resolveFarmNotFoundComponentPath,
117
118
  resolveFarmRouteRootStrategy,
118
119
  toBakedMarkdownSourcePath
119
- } from "./chunk-AHGOHPRN.mjs";
120
+ } from "./chunk-ZDYYZX73.mjs";
120
121
  import {
121
122
  TAILWIND_CSS_BROWSER_TARGET,
122
123
  generateFarmClientPluginEntryCode,
123
124
  hasFarmServerRuntimePlugins,
124
125
  includesTailwindVitePlugin,
125
126
  loadTailwindVitePlugin
126
- } from "./chunk-VO5XDZHK.mjs";
127
+ } from "./chunk-RPA45OQS.mjs";
127
128
  import {
128
129
  PluginManager
129
- } from "./chunk-522K362I.mjs";
130
+ } from "./chunk-C2OLXVUC.mjs";
130
131
  import {
131
132
  generateFarmTypeArtifacts,
132
133
  readRouteRenderingDirectiveFromFile,
133
134
  resolveRouteRenderingConfig,
134
135
  resolveRouteRenderingConfigFromFile
135
- } from "./chunk-A7EJATEW.mjs";
136
+ } from "./chunk-YN3YMSKD.mjs";
136
137
  import {
137
138
  HOISTED_HEAD_ELEMENT,
138
139
  appMiddlewareMayHandlePath,
@@ -145,7 +146,7 @@ import {
145
146
  layoutsCanCoverSamePage,
146
147
  routeBoundaryCoversDirectory,
147
148
  stripRouteGroups
148
- } from "./chunk-H76C5AOU.mjs";
149
+ } from "./chunk-3K2E55BJ.mjs";
149
150
  import {
150
151
  FARM_NATIVE_TREE_CONTENT_TYPE
151
152
  } from "./chunk-LLZSYFOM.mjs";
@@ -159,15 +160,15 @@ import {
159
160
  listFarmBuiltInRoutePaths,
160
161
  resolveFarmApiCatalogInput,
161
162
  resolveFarmAppManifestInput
162
- } from "./chunk-PNWRH6TR.mjs";
163
+ } from "./chunk-3JQBQG7K.mjs";
163
164
  import {
164
165
  FARM_DEFAULT_MCP_PATH,
165
166
  createFarmDefaultMCPServer,
166
167
  farmConfigMountsMCP
167
- } from "./chunk-JA6RML7C.mjs";
168
+ } from "./chunk-HR4N2K4V.mjs";
168
169
  import {
169
170
  isFarmPreviewDeploymentEnvironment
170
- } from "./chunk-A37D6LOS.mjs";
171
+ } from "./chunk-RQBGHHOQ.mjs";
171
172
  import {
172
173
  FARM_NATIVE_SERVER_FN_PLUGIN
173
174
  } from "./chunk-L4RTTTVE.mjs";
@@ -188,7 +189,7 @@ import {
188
189
  withFarmSourceSnapshot,
189
190
  withFarmSourceSnapshotOf,
190
191
  withPackageClientBoundaryCache
191
- } from "./chunk-7RQ5KAK6.mjs";
192
+ } from "./chunk-MDEFTF63.mjs";
192
193
  import {
193
194
  generateFarmDocsAdapterClientRuntime,
194
195
  getFarmDocsAdapterConfigModule
@@ -208,9 +209,6 @@ import {
208
209
  import {
209
210
  resolveFarmServerComponentsMode
210
211
  } from "./chunk-4QENVMG7.mjs";
211
- import {
212
- getFarmAppDirectories
213
- } from "./chunk-4STJ6LGR.mjs";
214
212
  import {
215
213
  REACT_RENDERER,
216
214
  getFarmRendererCapabilities,
@@ -221,13 +219,16 @@ import {
221
219
  loadFarmRendererVitePlugins,
222
220
  resolveFarmRendererAppSetup
223
221
  } from "./chunk-GCRT6GJG.mjs";
222
+ import {
223
+ getFarmAppDirectories
224
+ } from "./chunk-4STJ6LGR.mjs";
224
225
  import {
225
226
  applyFarmCronVercelCrons,
226
227
  createFarmCronCloudflareConfig,
227
228
  mergeScheduledTasks,
228
229
  prepareFarmCronForNitro,
229
230
  toFarmCronCloudflareScheduledTasks
230
- } from "./chunk-CSAIIMY3.mjs";
231
+ } from "./chunk-ATISIC6G.mjs";
231
232
  import {
232
233
  resolveServerActionsConfig
233
234
  } from "./chunk-NLATR3T3.mjs";
@@ -239,39 +240,39 @@ import {
239
240
  isFarmMarkdownPageFile,
240
241
  parseMarkdownFrontmatter,
241
242
  readFarmMarkdownRouteConfig
242
- } from "./chunk-BGUTIQII.mjs";
243
+ } from "./chunk-MUZHULW2.mjs";
243
244
  import {
244
245
  resolveFarmMdxComponentsModulePath,
245
246
  resolveMdxConfig
246
247
  } from "./chunk-UIJOLBUL.mjs";
247
248
  import {
248
249
  getFarmMarkdownAlternatePath
249
- } from "./chunk-R5X7FDOG.mjs";
250
+ } from "./chunk-YU2MNIIY.mjs";
250
251
  import {
251
252
  withPlainDiagnostics
252
253
  } from "./chunk-MGKWYPE3.mjs";
253
254
  import {
254
255
  applyFarmWorkflowVercelCrons,
255
256
  prepareFarmWorkflowsForNitro
256
- } from "./chunk-OGVOKAQU.mjs";
257
+ } from "./chunk-COTFX4GT.mjs";
257
258
  import {
258
259
  getFarmIntegrationPluginServerRuntime,
259
260
  getIntegrationProviders
260
- } from "./chunk-JKFN3YVG.mjs";
261
+ } from "./chunk-6JWXHPVR.mjs";
261
262
  import {
262
263
  FARM_INTEGRATION_API_BASE_PATH_KEY
263
264
  } from "./chunk-CZOXZ6WQ.mjs";
264
265
  import {
265
266
  _collectFarmStorageModules
266
- } from "./chunk-IGE5BAWK.mjs";
267
+ } from "./chunk-QBJ6N5MT.mjs";
267
268
  import {
268
269
  appendMiddlewareDirectory,
269
270
  appendMiddlewareRoutePath,
270
271
  compareMiddlewareRouteLocations
271
- } from "./chunk-PKXGFQZS.mjs";
272
+ } from "./chunk-QD34VE4N.mjs";
272
273
  import {
273
274
  APIRouteManager
274
- } from "./chunk-5REIO5DT.mjs";
275
+ } from "./chunk-KKVRWNDH.mjs";
275
276
  import {
276
277
  readFarmI18nCatalogs
277
278
  } from "./chunk-VO55MMBX.mjs";
@@ -292,14 +293,14 @@ import {
292
293
  logger,
293
294
  toPosixPath,
294
295
  toViteModuleId
295
- } from "./chunk-Z3QXQN4U.mjs";
296
+ } from "./chunk-U6GMCDRS.mjs";
296
297
  import {
297
298
  resolveFarmAPIServerBasePath,
298
299
  resolveFarmAPIServerRoutePath
299
300
  } from "./chunk-2I6PUKWJ.mjs";
300
301
  import {
301
302
  FARM_VERSION
302
- } from "./chunk-VRJAMU34.mjs";
303
+ } from "./chunk-JGEN2FIT.mjs";
303
304
  import {
304
305
  FARM_VIDEO_PLAYER_PATH
305
306
  } from "./chunk-AG27TI6Q.mjs";
@@ -794,21 +795,26 @@ function collectFarmClientModulePreloads(bundle, options) {
794
795
  ...staticImports(chunk, loaded, [])
795
796
  ].map(index);
796
797
  }
797
- const routerFiles = [];
798
- const routerLoaded = new Set(entryLoaded);
799
- for (const routerModule of options.routerModules ?? []) {
800
- const chunk = chunks.find(
801
- (candidate) => candidate.isDynamicEntry && candidate.facadeModuleId && path4.resolve(candidate.facadeModuleId.split("?")[0]) === path4.resolve(routerModule)
802
- );
803
- if (!chunk || routerLoaded.has(chunk.fileName)) continue;
804
- routerLoaded.add(chunk.fileName);
805
- routerFiles.push(chunk.fileName);
806
- staticImports(chunk, routerLoaded, routerFiles);
807
- }
798
+ const dynamicFiles = (moduleIds) => {
799
+ const into = [];
800
+ const loaded = new Set(entryLoaded);
801
+ for (const moduleId of moduleIds ?? []) {
802
+ const chunk = chunks.find(
803
+ (candidate) => candidate.isDynamicEntry && candidate.facadeModuleId && path4.resolve(candidate.facadeModuleId.split("?")[0]) === path4.resolve(moduleId)
804
+ );
805
+ if (!chunk || loaded.has(chunk.fileName)) continue;
806
+ loaded.add(chunk.fileName);
807
+ into.push(chunk.fileName);
808
+ staticImports(chunk, loaded, into);
809
+ }
810
+ return into;
811
+ };
812
+ const rendererFiles = dynamicFiles(options.rendererModules);
808
813
  return {
809
814
  files,
810
815
  entry: entryFiles.map(index),
811
- router: routerFiles.map(index),
816
+ router: dynamicFiles(options.routerModules).map(index),
817
+ ...rendererFiles.length > 0 ? { renderer: rendererFiles.map(index) } : {},
812
818
  modules
813
819
  };
814
820
  }
@@ -817,10 +823,15 @@ function createFarmClientModulePreloadPlugin(options) {
817
823
  name: "farm-client-module-preloads",
818
824
  enforce: "post",
819
825
  async generateBundle(_output, bundle) {
826
+ const rendererModules = [];
827
+ for (const specifier of options.rendererImports ?? []) {
828
+ const resolved = await this.resolve(specifier, options.rendererImporter);
829
+ if (resolved) rendererModules.push(resolved.id);
830
+ }
820
831
  await fs.mkdir(options.buildDir, { recursive: true });
821
832
  await fs.writeFile(
822
833
  path4.join(options.buildDir, FARM_CLIENT_MODULE_PRELOADS_FILE),
823
- JSON.stringify(collectFarmClientModulePreloads(bundle, options))
834
+ JSON.stringify(collectFarmClientModulePreloads(bundle, { ...options, rendererModules }))
824
835
  );
825
836
  }
826
837
  };
@@ -1698,12 +1709,15 @@ function createFarmPrivateClientSourcemapsPlugin(options) {
1698
1709
  return {
1699
1710
  name: "farm-private-client-sourcemaps",
1700
1711
  enforce: "post",
1701
- generateBundle(_output, bundle) {
1702
- maps = [];
1703
- for (const [fileName, output] of Object.entries(bundle)) {
1704
- if (output.type !== "asset" || !fileName.endsWith(".map")) continue;
1705
- maps.push([fileName, output.source ?? ""]);
1706
- delete bundle[fileName];
1712
+ generateBundle: {
1713
+ order: "post",
1714
+ handler(_output, bundle) {
1715
+ maps = [];
1716
+ for (const [fileName, output] of Object.entries(bundle)) {
1717
+ if (output.type !== "asset" || !fileName.endsWith(".map")) continue;
1718
+ maps.push([fileName, output.source ?? ""]);
1719
+ delete bundle[fileName];
1720
+ }
1707
1721
  }
1708
1722
  },
1709
1723
  async writeBundle() {
@@ -3070,7 +3084,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3070
3084
  if (!mobile) await removeFarmMobileClientManifest(path16.dirname(outputDir));
3071
3085
  const viteBuild = productionVite.build;
3072
3086
  const { farmIslandContainersPlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.mjs");
3073
- const { PluginManager: PluginManager2 } = await import("./plugin-TV6W7YNK.mjs");
3087
+ const { PluginManager: PluginManager2 } = await import("./plugin-33I3V42N.mjs");
3074
3088
  const fs5 = await import("fs/promises");
3075
3089
  const pluginManager = new PluginManager2({
3076
3090
  config,
@@ -3489,7 +3503,15 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3489
3503
  routerModules: [
3490
3504
  path16.join(clientEntryDir, "farm-client-router.tsx"),
3491
3505
  path16.join(clientEntryDir, `${FARM_CLIENT_ROUTE_TABLE_MODULE}.tsx`)
3492
- ]
3506
+ ],
3507
+ // What the islands entry loads with its first render or hydration (RFC 0010).
3508
+ ...islandsMode && isReactRenderer(config.renderer) ? {
3509
+ rendererImports: [
3510
+ "react-dom/client",
3511
+ "@farm.js/core/internal/islands-runtime"
3512
+ ],
3513
+ rendererImporter: clientEntryPath
3514
+ } : {}
3493
3515
  }),
3494
3516
  ...adapterOwnsDocsRuntime && platform === "web" ? [
3495
3517
  createFarmDocsModulePreloadPlugin({
@@ -3662,11 +3684,12 @@ function createHistoryState(path, pageState, currentState) {
3662
3684
 
3663
3685
  async function fetchFarmNavigationDocument(url, headers, recover = true, signal) {
3664
3686
  const deploymentId = window.__FARM_DEPLOYMENT_ID__;
3665
- const response = await fetch(url, {
3666
- headers: createFarmDeploymentRequestHeaders(deploymentId, headers),
3687
+ const requestHeaders = createFarmDeploymentRequestHeaders(deploymentId, headers);
3688
+ const response = await (${streamNavigations ? "(recover && takeFarmEarlyNavigation(url, requestHeaders, signal)) || " : ""}fetch(url, {
3689
+ headers: requestHeaders,
3667
3690
  signal,
3668
3691
  redirect: "manual",
3669
- });
3692
+ }));
3670
3693
  // Let a document navigation follow redirects, including cross-origin chains
3671
3694
  // and fragment inheritance. Never cache/swap their HTML under the source URL.
3672
3695
  if (response.type === "opaqueredirect" || response.redirected) {
@@ -3693,7 +3716,9 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
3693
3716
  return response;
3694
3717
  }
3695
3718
 
3696
- ${streamNavigations ? FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
3719
+ ${streamNavigations ? `${FARM_NAVIGATION_STREAM_READER_SOURCE}
3720
+
3721
+ ${FARM_EARLY_NAVIGATION_SOURCE}` : ""}
3697
3722
 
3698
3723
  function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
3699
3724
  if (error?.name === "FarmDeploymentMismatchError") {
@@ -4854,11 +4879,21 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
4854
4879
  platform
4855
4880
  );
4856
4881
  const appSetupPath = resolveFarmRendererAppSetup(root, renderer);
4857
- const rendererClientImports = isReactRenderer(renderer) ? `import React from "react";
4882
+ const lazyRenderer = islandValues && platform !== "mobile" && isReactRenderer(renderer) && clientRouteSlots.length === 0;
4883
+ const rendererClientImports = lazyRenderer ? `import React from "react";
4884
+ import { holdFarmIslandInteractions, restorePagePosition } from "@farm.js/core/internal/client-runtime";` : isReactRenderer(renderer) ? `import React from "react";
4858
4885
  import { createRoot, hydrateRoot } from "react-dom/client";
4859
- import { restorePagePosition } from "@farm.js/core/internal/client-runtime";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
4886
+ import { restorePagePosition } from "@farm.js/core/internal/client-runtime";` : (
4887
+ // Named exports only, as the server entry and the development client read them. A copy
4888
+ // of the namespace, so feature checks of optional exports don't make Rolldown warn.
4889
+ appSetupPath ? `import * as __farmRendererClient from ${JSON.stringify(renderer.client)};
4890
+ import { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
4860
4891
  import __farmAppSetup from ${JSON.stringify(toPosixPath(appSetupPath))};
4861
- __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
4892
+ const React = { ...__farmRendererClient };
4893
+ __farmConfigureApp(__farmAppSetup);` : `import * as __farmRendererClient from ${JSON.stringify(renderer.client)};
4894
+ import { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};
4895
+ const React = { ...__farmRendererClient };`
4896
+ );
4862
4897
  const providerClientCode = generateFarmIntegrationProviderClientCode(
4863
4898
  integrationProviders,
4864
4899
  root,
@@ -5282,7 +5317,42 @@ installFarmLinkPrefetch();
5282
5317
  });
5283
5318
  const isolatedHydrationEnabled = isolatedBoundaryModules.size > 0;
5284
5319
  const serverTreeEnabled = isolatedHydrationEnabled && clientPages.some((page) => page.serverTree);
5285
- const isolatedHydrationImport = isolatedHydrationEnabled ? `${islandValues ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement${hasServerTreeLayouts ? ", createFarmServerTreeLayout" : ""} } from "@farm.js/core/internal/islands-runtime";` : 'import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";'}${serverTreeEnabled && !islandValues ? '\nimport { createFarmServerTreeElement } from "@farm.js/core/internal/server-tree";' : ""}` : "";
5320
+ const islandsRuntimeExports = [
5321
+ "createFarmIsolatedHydrationRuntime",
5322
+ "createFarmServerPageBoundary",
5323
+ "wrapFarmIsolatedClientGraph",
5324
+ ...serverTreeEnabled ? ["createFarmServerTreeElement"] : [],
5325
+ ...hasServerTreeLayouts ? ["createFarmServerTreeLayout"] : []
5326
+ ].join(", ");
5327
+ const lazyRendererRuntime = lazyRenderer ? `// React DOM${isolatedHydrationEnabled ? " and islx" : ""} load with the first render or hydration (RFC 0010).
5328
+ let createRoot;
5329
+ let hydrateRoot;
5330
+ let farmRendererLoading = null;
5331
+ let farmRendererLoaded = false;${isolatedHydrationEnabled ? `
5332
+ // The boot stops holding interactions once this entry runs. Until islx loads, islands that have not
5333
+ // hydrated hold them here, for their schedulers to replay.
5334
+ const releaseFarmIslandInteractions = holdFarmIslandInteractions("f-island");` : ""}
5335
+ function loadFarmRenderer() {
5336
+ return farmRendererLoading || (farmRendererLoading = Promise.all([
5337
+ import("react-dom/client"),${isolatedHydrationEnabled ? `
5338
+ // Named here, so the build keeps only these of islx's exports.
5339
+ import("@farm.js/core/internal/islands-runtime").then(function({ ${islandsRuntimeExports} }) {
5340
+ return { ${islandsRuntimeExports} };
5341
+ }),` : ""}
5342
+ ]).then(function(modules) {
5343
+ createRoot = modules[0].createRoot;
5344
+ hydrateRoot = modules[0].hydrateRoot;${isolatedHydrationEnabled ? "\n startFarmIslandsRuntime(modules[1]);\n releaseFarmIslandInteractions();" : ""}
5345
+ farmRendererLoaded = true;
5346
+ }, function(error) {${isolatedHydrationEnabled ? `
5347
+ // Without islx a held click would never replay: the page acts natively again.
5348
+ releaseFarmIslandInteractions();` : ""}
5349
+ // A chunk that failed to load can load on a later call.
5350
+ farmRendererLoading = null;
5351
+ throw error;
5352
+ }));
5353
+ }
5354
+ ` : "";
5355
+ const isolatedHydrationImport = lazyRenderer ? "" : isolatedHydrationEnabled ? `${islandValues ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement${hasServerTreeLayouts ? ", createFarmServerTreeLayout" : ""} } from "@farm.js/core/internal/islands-runtime";` : 'import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";'}${serverTreeEnabled && !islandValues ? '\nimport { createFarmServerTreeElement } from "@farm.js/core/internal/server-tree";' : ""}` : "";
5286
5356
  const isolatedHydrationRuntime = isolatedHydrationEnabled ? `const farmIsolatedBoundaryLoaders = {
5287
5357
  ${Array.from(isolatedBoundaryModules.entries()).map(
5288
5358
  ([reference, modulePath]) => ` ${JSON.stringify(reference)}: () => import(${JSON.stringify(modulePath)}),`
@@ -5293,7 +5363,43 @@ async function loadFarmIsolatedBoundary(reference) {
5293
5363
  if (!loader) throw new Error("isolated client boundary loader was not found: " + reference);
5294
5364
  return loader();
5295
5365
  }
5296
- const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
5366
+ ${lazyRenderer ? `let farmIslandsRuntime = null;
5367
+ let FarmServerPage;
5368
+ let wrapFarmIsolatedClientGraph;${serverTreeEnabled ? "\nlet createFarmServerTreeElement;" : ""}${hasServerTreeLayouts ? "\nlet createFarmServerTreeLayout;" : ""}
5369
+ function startFarmIslandsRuntime(islands) {
5370
+ wrapFarmIsolatedClientGraph = islands.wrapFarmIsolatedClientGraph;${serverTreeEnabled ? "\n createFarmServerTreeElement = islands.createFarmServerTreeElement;" : ""}${hasServerTreeLayouts ? "\n createFarmServerTreeLayout = islands.createFarmServerTreeLayout;" : ""}
5371
+ farmIslandsRuntime = islands.createFarmIsolatedHydrationRuntime({
5372
+ ReactRuntime: React,
5373
+ hydrateRoot,
5374
+ load: loadFarmIsolatedBoundary,
5375
+ schedule: scheduleFarmIslandHydration,
5376
+ wrap: wrapWithIntegrationProviders,
5377
+ });
5378
+ // A hydrating layout keeps a non-hydrating page as server HTML; this wrapper runs its islands.
5379
+ FarmServerPage = islands.createFarmServerPageBoundary(React, farmIslandsRuntime);
5380
+ }
5381
+ // Nothing hydrates before islx loads. Until then, calls wait for it in the order they were made,
5382
+ // behind the hydration that loads it; one that fails reports itself to whoever awaited it.
5383
+ function whenFarmIslandsRuntime(call) {
5384
+ if (farmIslandsRuntime) call(farmIslandsRuntime);
5385
+ else if (farmRendererLoading) farmRendererLoading.then(function() { call(farmIslandsRuntime); }, function() {});
5386
+ }
5387
+ const farmIsolatedHydrationRuntime = {
5388
+ hydrate: function(scope, signal) {
5389
+ if (farmIslandsRuntime) return farmIslandsRuntime.hydrate(scope, signal);
5390
+ return loadFarmRenderer().then(function() { return farmIslandsRuntime.hydrate(scope, signal); });
5391
+ },
5392
+ dispose: function(scope) {
5393
+ whenFarmIslandsRuntime(function(runtime) { runtime.dispose(scope); });
5394
+ },
5395
+ // Only a hydrated island has state to carry over.
5396
+ carryOver: function(from, to) {
5397
+ if (farmIslandsRuntime) farmIslandsRuntime.carryOver(from, to);
5398
+ },
5399
+ endStream: function(root) {
5400
+ whenFarmIslandsRuntime(function(runtime) { runtime.endStream(root); });
5401
+ },
5402
+ };` : `const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
5297
5403
  ReactRuntime: React,
5298
5404
  hydrateRoot,
5299
5405
  load: loadFarmIsolatedBoundary,
@@ -5302,7 +5408,7 @@ const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
5302
5408
  });
5303
5409
 
5304
5410
  // A hydrating layout keeps a non-hydrating page as server HTML; this wrapper runs its islands.
5305
- const FarmServerPage = createFarmServerPageBoundary(React, farmIsolatedHydrationRuntime);
5411
+ const FarmServerPage = createFarmServerPageBoundary(React, farmIsolatedHydrationRuntime);`}
5306
5412
 
5307
5413
  function disposeFarmIsolatedClientBoundaries(scope) {
5308
5414
  farmIsolatedHydrationRuntime.dispose(scope);
@@ -5359,7 +5465,7 @@ ${docsNavigationRuntime}
5359
5465
  ${docsAdapterRuntime}
5360
5466
 
5361
5467
  ${imports.join("\n")}
5362
- ${generateFarmDocsSearchClientRuntime(docsSearchEnabled, docsSearchModuleId)}
5468
+ ${generateFarmDocsSearchClientRuntime(docsSearchEnabled, docsSearchModuleId, void 0, lazyRenderer ? "loadFarmRenderer" : void 0)}
5363
5469
 
5364
5470
  ${providerClientCode.runtime}
5365
5471
 
@@ -5379,7 +5485,7 @@ ${generateFarmClientRouteTableRuntime({
5379
5485
  })}
5380
5486
  ${generateClientPageDirectorySource()}
5381
5487
 
5382
- ${isolatedHydrationRuntime}
5488
+ ${lazyRendererRuntime}${isolatedHydrationRuntime}
5383
5489
  ${routeClientGraphRuntime}
5384
5490
 
5385
5491
  const clientRouteSlots = [
@@ -5503,10 +5609,15 @@ function matchRoute(pathname) {
5503
5609
  }
5504
5610
 
5505
5611
  async function loadRouteComponent(route) {
5506
- if (!route.load) return null;
5612
+ if (!route.load) return null;${lazyRenderer ? `
5613
+ // A page component renders with React DOM, which loads beside it (RFC 0010).
5614
+ const renderer = loadFarmRenderer();
5615
+ if (!route.Component) route.Component = await route.load();
5616
+ await renderer;
5617
+ return route.Component;` : `
5507
5618
  if (route.Component) return route.Component;
5508
5619
  route.Component = await route.load();
5509
- return route.Component;
5620
+ return route.Component;`}
5510
5621
  }
5511
5622
 
5512
5623
  // The props the server rendered this document with, as the page receives them:
@@ -5522,7 +5633,9 @@ function reviveServerPageProps(serverProps) {
5522
5633
  async function createMatchedHydrationRoute(matched, pathname, searchParams, navigationPage, serverProps, layoutSource, hydrationContainer) {
5523
5634
  const hydrateLayouts = hasHydratableLayout(pathname);
5524
5635
  const params = matched.params;
5525
- let pageElement = null;
5636
+ let pageElement = null;${lazyRenderer ? `
5637
+ // Only a route that renders a page or its layouts needs React DOM; one of islands hydrates them.
5638
+ if (hydrateLayouts || matched.route.pageShouldHydrate) await loadFarmRenderer();` : ""}
5526
5639
  // Layouts rendered as server trees rebuild from the HTML that carries them.
5527
5640
  if (hydrateLayouts && !(await prepareFarmTreeLayouts(pathname, params, layoutSource))) return null;
5528
5641
 
@@ -5892,7 +6005,9 @@ async function hydrate() {
5892
6005
  );
5893
6006
  window.__FARM_PROPS__ = initialPayload.page;
5894
6007
  window.__FARM_ROUTE_SLOTS__ = initialPayload.slots;
5895
-
6008
+ ${lazyRenderer ? ` // React DOM and islx load with what first renders or hydrates, not here (RFC 0010): a root
6009
+ // that waits for its trigger, or a navigation that swaps its page in, does not wait for them.
6010
+ ` : ""}
5896
6011
  if (await hydrateFarmDocsAdapterRuntime()) {
5897
6012
  return;
5898
6013
  }
@@ -5929,101 +6044,82 @@ async function hydrate() {
5929
6044
  return;
5930
6045
  }
5931
6046
 
6047
+ const pageHydration = scheduleFarmRouteHydration(matched, pathname, container, window.__FARM_PROPS__);
6048
+ ${isolatedHydrationEnabled ? `// Not cancelled with the page: a navigation disposes the islands it removes, and one in a
6049
+ // layout it keeps still waits for its trigger, as on a page of islands only.
6050
+ const isolatedHydration =
6051
+ !hasHydratableLayout(pathname) &&
6052
+ document.querySelector('f-island[src]')
6053
+ ? hydrateFarmIsolatedClientBoundaries(document)
6054
+ : Promise.resolve();
6055
+ await Promise.all([pageHydration, isolatedHydration]);` : "await pageHydration;"}
6056
+ }
6057
+
6058
+ // Hydrates the route's page or layout root in \`container\` when its strategy is due: at once, or
6059
+ // on its idle, visible or interaction trigger (RFC 0003, section 11). The first load schedules it,
6060
+ // and so does a navigation that swaps a page into a root that never hydrated (RFC 0011): nothing
6061
+ // in that root ran, so it waits for the next page's trigger as a first load of that page would.
6062
+ function scheduleFarmRouteHydration(matched, pathname, container, serverProps) {
5932
6063
  container.dataset.farmIsland = "page";
5933
6064
  container.dataset.farmIslandStrategy = matched.route.islandStrategy || "load";
5934
6065
 
5935
6066
  const hydrationController = new AbortController();
5936
6067
  pendingPageHydrationController = hydrationController;
5937
- try {
5938
- const pageHydration = scheduleFarmIslandHydration({
5939
- container,
5940
- strategy: matched.route.islandStrategy,
5941
- signal: hydrationController.signal,
5942
- hydrate: async function() {
5943
- if (
5944
- hydrationController.signal.aborted ||
5945
- !container.isConnected ||
5946
- window.location.pathname !== pathname
5947
- ) {
5948
- return;
5949
- }
5950
- const searchParams = searchParamsToObject(new URLSearchParams(window.location.search));
5951
- const shouldHydrate = !isHydrated && Boolean(container.innerHTML.trim());
5952
- const routeState = await createMatchedHydrationRoute(
5953
- matched,
5954
- pathname,
5955
- searchParams,
5956
- undefined,
5957
- window.__FARM_PROPS__,
5958
- undefined,
5959
- shouldHydrate ? container : undefined,
5960
- );
5961
- if (!routeState) return;
5962
- const hydrationSession = await farmClientRuntime.beginHydration({
5963
- container,
5964
- mode: shouldHydrate ? "hydrate" : "render",
5965
- });
6068
+ return scheduleFarmIslandHydration({
6069
+ container,
6070
+ strategy: matched.route.islandStrategy,
6071
+ signal: hydrationController.signal,
6072
+ hydrate: async function() {
6073
+ if (
6074
+ hydrationController.signal.aborted ||
6075
+ !container.isConnected ||
6076
+ window.location.pathname !== pathname
6077
+ ) {
6078
+ return;
6079
+ }
6080
+ const searchParams = searchParamsToObject(new URLSearchParams(window.location.search));
6081
+ const shouldHydrate = !isHydrated && Boolean(container.innerHTML.trim());
6082
+ const routeState = await createMatchedHydrationRoute(
6083
+ matched,
6084
+ pathname,
6085
+ searchParams,
6086
+ undefined,
6087
+ serverProps,
6088
+ undefined,
6089
+ shouldHydrate ? container : undefined,
6090
+ );
6091
+ if (!routeState) return;
6092
+ const hydrationSession = await farmClientRuntime.beginHydration({
6093
+ container,
6094
+ mode: shouldHydrate ? "hydrate" : "render",
6095
+ });
5966
6096
 
5967
- try {
5968
- // A navigation replaced this route before it hydrated. Like a superseded
5969
- // navigation, that is not a failure, so error hooks never see it.
5970
- if (hydrationController.signal.aborted || !container.isConnected) return;
5971
- if (shouldHydrate) {
5972
- reactRoot = hydrateFarmRoute(container, routeState);
6097
+ try {
6098
+ // A navigation replaced this route before it hydrated. Like a superseded
6099
+ // navigation, that is not a failure, so error hooks never see it.
6100
+ if (hydrationController.signal.aborted || !container.isConnected) return;
6101
+ if (shouldHydrate) {
6102
+ reactRoot = hydrateFarmRoute(container, routeState);
6103
+ reactRootContainer = container;
6104
+ isHydrated = true;
6105
+ } else {
6106
+ if (!reactRoot) {
6107
+ reactRoot = createRoot(container);
5973
6108
  reactRootContainer = container;
5974
- isHydrated = true;
5975
- } else {
5976
- if (!reactRoot) {
5977
- reactRoot = createRoot(container);
5978
- reactRootContainer = container;
5979
- }
5980
- renderFarmRoute(reactRoot, routeState);
5981
6109
  }
5982
- await farmClientRuntime.completeHydration(hydrationSession);
5983
- } catch (error) {
5984
- await farmClientRuntime.failHydration(hydrationSession, error);
5985
- console.error("[Farm.js] Hydration error:", error);
6110
+ renderFarmRoute(reactRoot, routeState);
5986
6111
  }
5987
- },
5988
- });
5989
- ${islandValues ? `// A layout root that waits for a click renders again on a navigation, and a link under the
5990
- // pointer is a navigation on its way: hydrate the root now, as a focus would, so the click
5991
- // updates it instead of rendering it from the start.
5992
- if (hasHydratableLayout(pathname) && (matched.route.islandStrategy || "load") !== "load") {
5993
- const hydrateForLink = function(target) {
5994
- const anchor = target instanceof Element ? target.closest("a[href]") : null;
5995
- const href = anchor && anchor.getAttribute("href");
5996
- if (!href || href.startsWith("#") || hasAbsoluteNavigationHref(href)) return false;
5997
- if (!container.contains(anchor)) return false;
5998
- document.dispatchEvent(
5999
- new CustomEvent("farm:island-interaction", { detail: { target: anchor, kind: null } }),
6000
- );
6001
- return true;
6002
- };
6003
- const onLinkIntent = function(event) {
6004
- if (hydrateForLink(event.target)) document.removeEventListener("mouseover", onLinkIntent, true);
6005
- };
6006
- // The hover that loaded this entry fired before it ran.
6007
- if (!hydrateForLink(container.querySelector("a[href]:hover"))) {
6008
- document.addEventListener("mouseover", onLinkIntent, true);
6009
- void pageHydration.finally(function() {
6010
- document.removeEventListener("mouseover", onLinkIntent, true);
6011
- });
6112
+ await farmClientRuntime.completeHydration(hydrationSession);
6113
+ } catch (error) {
6114
+ await farmClientRuntime.failHydration(hydrationSession, error);
6115
+ console.error("[Farm.js] Hydration error:", error);
6012
6116
  }
6013
- }` : ""}
6014
- ${isolatedHydrationEnabled ? `// Not cancelled with the page: a navigation disposes the islands it removes, and one in a
6015
- // layout it keeps still waits for its trigger, as on a page of islands only.
6016
- const isolatedHydration =
6017
- !hasHydratableLayout(pathname) &&
6018
- document.querySelector('f-island[src]')
6019
- ? hydrateFarmIsolatedClientBoundaries(document)
6020
- : Promise.resolve();
6021
- await Promise.all([pageHydration, isolatedHydration]);` : "await pageHydration;"}
6022
- } finally {
6117
+ },
6118
+ }).finally(function() {
6023
6119
  if (pendingPageHydrationController === hydrationController) {
6024
6120
  pendingPageHydrationController = null;
6025
6121
  }
6026
- }
6122
+ });
6027
6123
  }
6028
6124
 
6029
6125
  /*farm-router-start*/
@@ -6232,11 +6328,9 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
6232
6328
  partialNavigationHeaders: function() {
6233
6329
  const root = document.getElementById("root") || document.body;
6234
6330
  const layouts = getLayoutPatterns(root);
6235
- // The root React owns, or one whose layouts hydrate together but have not yet: the
6236
- // navigation creates it (swapContent).
6237
- const rendersTree = reactRoot
6238
- ? reactRootContainer === root
6239
- : root.id === "root" && hasHydratableLayout(window.location.pathname);
6331
+ // Only a root React owns rebuilds the next page from its tree. One that has not hydrated
6332
+ // swaps the next page's HTML in and keeps waiting (swapContent), without React DOM.
6333
+ const rendersTree = Boolean(reactRoot) && reactRootContainer === root;
6240
6334
  return {
6241
6335
  ...(layouts.length ? { "F-Layouts": JSON.stringify(layouts) } : {}),
6242
6336
  ...(rendersTree ? { "F-Render": "tree" } : {}),
@@ -6575,30 +6669,6 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
6575
6669
  const hydrateLayouts = hasHydratableLayout(newPathname);
6576
6670
  const nextPage = newRoot.querySelector("#__farm_page__");
6577
6671
 
6578
- ${islandValues ? `// A layout that hydrates as one root but has not yet (its client components wait for a
6579
- // click): its first navigation renders the page's payload in a new root, as later ones do.
6580
- if (
6581
- matched && hydrateLayouts && !reactRoot && currentRoot.id === "root" &&
6582
- nextPage?.querySelector('script[type="f/tree"][partial]')
6583
- ) {
6584
- const routeState = await createMatchedHydrationRoute(
6585
- matched,
6586
- newPathname,
6587
- searchParamsToObject(targetUrl.searchParams),
6588
- nextPage,
6589
- nextPageProps,
6590
- newRoot,
6591
- );
6592
- if (!isNavigationCurrent()) return false;
6593
- if (!routeState) return "segment-mismatch";
6594
- cancelPendingPageHydration();
6595
- resetRouteSlotRoots();
6596
- setFarmReactRoot(createRoot(currentRoot), currentRoot);
6597
- renderFarmRoute(reactRoot, routeState);
6598
- window.__FARM_ROUTE_SLOTS__ = nextRouteSlots;
6599
- setFarmHydrated();
6600
- return true;
6601
- }` : ""}
6602
6672
  // If React already owns the shared layout, update that root. React keeps
6603
6673
  // matching layout component instances and their state mounted.
6604
6674
  if (matched && hydrateLayouts && reactRoot && reactRootContainer === currentRoot) {
@@ -6643,24 +6713,51 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
6643
6713
 
6644
6714
  // Check if the new HTML contains an interactive route boundary.
6645
6715
  if (matched) {
6646
- const searchParams = searchParamsToObject(targetUrl.searchParams);
6647
6716
  const pageContainer =
6648
6717
  hydrateLayouts ? currentRoot : document.getElementById("__farm_page__") || currentRoot;
6649
- const routeState = await createMatchedHydrationRoute(
6650
- matched,
6651
- newPathname,
6652
- searchParams,
6653
- undefined,
6654
- nextPageProps,
6655
- undefined,
6656
- pageContainer,
6657
- );
6658
- if (!isNavigationCurrent()) return false;
6659
- if (routeState) {
6660
- setFarmReactRoot(hydrateFarmRoute(pageContainer, routeState), pageContainer);
6661
- setFarmHydrated();
6718
+ if (
6719
+ (hydrateLayouts || matched.route.pageShouldHydrate) &&
6720
+ (matched.route.islandStrategy || "load") !== "load"
6721
+ ) {
6722
+ // A root that waits for its trigger waits after a navigation too, as on a first load:
6723
+ // the page is server HTML and its tree until then, and React DOM loads when it hydrates.
6724
+ scheduleFarmRouteHydration(matched, newPathname, pageContainer, nextPageProps).catch(
6725
+ function(error) {
6726
+ console.error("[Farm.js] Hydration error:", error);
6727
+ },
6728
+ );
6729
+ } else {
6730
+ const searchParams = searchParamsToObject(targetUrl.searchParams);
6731
+ const routeState = await createMatchedHydrationRoute(
6732
+ matched,
6733
+ newPathname,
6734
+ searchParams,
6735
+ undefined,
6736
+ nextPageProps,
6737
+ undefined,
6738
+ pageContainer,
6739
+ );
6740
+ if (!isNavigationCurrent()) return false;
6741
+ if (routeState) {
6742
+ setFarmReactRoot(hydrateFarmRoute(pageContainer, routeState), pageContainer);
6743
+ setFarmHydrated();
6744
+ }
6662
6745
  }
6663
- ${isolatedHydrationEnabled ? `if (matched.route.hasIsolatedClientBoundaries && !hydrateLayouts) {
6746
+ ${isolatedHydrationEnabled ? lazyRenderer ? `if (matched.route.hasIsolatedClientBoundaries && !hydrateLayouts) {
6747
+ if (farmRendererLoaded) {
6748
+ await hydrateFarmIsolatedClientBoundaries(
6749
+ isolatedHydrationScope,
6750
+ navigation.controller.signal,
6751
+ );
6752
+ if (!isNavigationCurrent()) return false;
6753
+ } else {
6754
+ // React DOM and islx are still on their way (RFC 0010): the page shows now, and its
6755
+ // islands hydrate once they arrive. A navigation that removes them first disposes them.
6756
+ hydrateFarmIsolatedClientBoundaries(isolatedHydrationScope).catch(function(error) {
6757
+ console.error("[Farm.js] Hydrating the page's islands failed:", error);
6758
+ });
6759
+ }
6760
+ }` : `if (matched.route.hasIsolatedClientBoundaries && !hydrateLayouts) {
6664
6761
  await hydrateFarmIsolatedClientBoundaries(
6665
6762
  isolatedHydrationScope,
6666
6763
  navigation.controller.signal,
@@ -6813,7 +6910,7 @@ void hydrate();
6813
6910
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime, sourceSnapshot) {
6814
6911
  const viteBuild = productionVite.build;
6815
6912
  const { farmIslandContainersPlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.mjs");
6816
- const { PluginManager: PluginManager2 } = await import("./plugin-TV6W7YNK.mjs");
6913
+ const { PluginManager: PluginManager2 } = await import("./plugin-33I3V42N.mjs");
6817
6914
  const fs5 = await import("fs/promises");
6818
6915
  const pluginManager = new PluginManager2({
6819
6916
  config,
@@ -7728,7 +7825,15 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
7728
7825
  const hasReactSyncRender = isReactRenderer(config.renderer);
7729
7826
  const rendererServerImports = isReactRenderer(config.renderer) ? `import * as React from "react";
7730
7827
  import * as ReactDOMServer from "react-dom/server";
7731
- import { markPagePosition, markLayoutPosition } from "@farm.js/core/internal/production-runtime";${hasIsolatedClientGraphRuntime ? farmIslandsMode ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph, renderFarmServerTreePage, renderFarmServerTreeLayout, withFarmIslandsRender } from "@farm.js/core/internal/islands-runtime";' : '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : `import React, * as ReactDOMServer from ${JSON.stringify(config.renderer.server)};${generateFarmRendererAppSetupServerCode(config)}`;
7828
+ import { markPagePosition, markLayoutPosition } from "@farm.js/core/internal/production-runtime";${hasIsolatedClientGraphRuntime ? farmIslandsMode ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph, renderFarmServerTreePage, renderFarmServerTreeLayout, withFarmIslandsRender } from "@farm.js/core/internal/islands-runtime";' : '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : (
7829
+ // The renderer contract is the server module's named exports, which the development
7830
+ // server reads too; a renderer needs no default export. The entry feature-checks optional
7831
+ // exports (streaming, `capabilities`, `generateHydrationScript`) on a copy of the
7832
+ // namespace, because Rolldown warns about each such read off the namespace itself.
7833
+ `import * as __farmRendererServer from ${JSON.stringify(config.renderer.server)};
7834
+ const ReactDOMServer = { ...__farmRendererServer };
7835
+ const React = ReactDOMServer;${generateFarmRendererAppSetupServerCode(config)}`
7836
+ );
7732
7837
  const routeClientGraphServerRuntime = hasIsolatedClientGraphRuntime ? `function wrapFarmRouteClientGraph(element) {
7733
7838
  return wrapFarmIsolatedClientGraph(React, element);
7734
7839
  }
@@ -9034,9 +9139,9 @@ function farmDocumentBootsClient(markup, hydratesAtLoad, routeSlots) {
9034
9139
  // The boot entry runs the client entry from the URL on its script, with the files listed for what
9035
9140
  // started it. A root that waits (the element a hydrating layout or client page hydrates) is named
9036
9141
  // with its strategy, for the boot to watch.
9037
- function renderFarmClientBootScript(root, rootStrategy, markup, pageModule) {
9142
+ function renderFarmClientBootScript(root, rootStrategy, markup, pageModule, navigation) {
9038
9143
  return stampFarmCspNonce('<script type="module" src="${farmClientBoot ? FARM_CLIENT_BOOT_SRC_PLACEHOLDER : ""}" data-farm-runtime="/__farm_client_js_src__"' +
9039
- renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy) +
9144
+ renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy, navigation) +
9040
9145
  (root ? ' data-farm-root="' + root + '" data-farm-root-strategy="' + rootStrategy + '"' : '') +
9041
9146
  '></script>');
9042
9147
  }
@@ -9826,6 +9931,11 @@ ${generateFarmClientBootRoutesServerSource(`"${FARM_CLIENT_ROUTE_TABLE_PLACEHOLD
9826
9931
  const farmClientEntryPreloadTags = farmClientModulePreloads
9827
9932
  ? farmClientModulePreloads.entry.map(renderFarmClientModulePreload).join("")
9828
9933
  : "";
9934
+ // A document that runs the entry at once (no boot) hydrates with the renderer it imports lazily
9935
+ // (RFC 0010). A client navigation's response runs neither, so it leaves them out.
9936
+ const farmClientRendererPreloadTags = farmClientModulePreloads
9937
+ ? (farmClientModulePreloads.renderer || []).map(renderFarmClientModulePreload).join("")
9938
+ : "";
9829
9939
  // The client modules a document's markup loads: its islands' boundaries and the
9830
9940
  // client references of its server tree. An island with a deferred strategy loads its
9831
9941
  // module on its own trigger, so it is not preloaded.
@@ -9860,14 +9970,14 @@ function collectFarmClientDocumentModules(markup, pageModule, listed) {
9860
9970
  return indexes;
9861
9971
  }
9862
9972
 
9863
- // The modulepreload links for a document: the entry's static imports, then the
9864
- // modules its hydrating page and its markup load.
9865
- function renderFarmClientModulePreloads(markup, pageModule) {
9973
+ // The modulepreload links for a document: the entry's static imports and, unless it answers a
9974
+ // client navigation, the renderer, then the modules its hydrating page and its markup load.
9975
+ function renderFarmClientModulePreloads(markup, pageModule, navigation) {
9866
9976
  // A nonce policy blocks parser-inserted links without the nonce, and the
9867
9977
  // response filter manages nonces on script elements only, so CSP nonce mode
9868
9978
  // keeps the documents it had.
9869
9979
  if (!farmClientModulePreloads || (farmSecurityConfig.csp && farmSecurityConfig.csp.nonce)) return "";
9870
- return farmClientEntryPreloadTags +
9980
+ return farmClientEntryPreloadTags + (navigation ? "" : farmClientRendererPreloadTags) +
9871
9981
  collectFarmClientDocumentModules(markup, pageModule, new Set())
9872
9982
  .map(renderFarmClientModulePreload)
9873
9983
  .join("");
@@ -9875,11 +9985,12 @@ function renderFarmClientModulePreloads(markup, pageModule) {
9875
9985
 
9876
9986
  // What a boot document's runtime fetches as it starts, for the boot to request with it rather
9877
9987
  // than each a round trip after the file that imports it: the entry's static imports, the router
9878
- // and route table a link's intent loads, and the modules the root hydrates with. A root that
9988
+ // and route table a link's intent loads, the renderer the entry renders and hydrates with (RFC
9989
+ // 0010), and the modules the root hydrates with. A root that
9879
9990
  // waits for its time hydrates once the runtime runs, so its modules come with the entry's; one
9880
9991
  // that waits for a click hydrates on an interaction in it, and the boot fetches them then. The
9881
9992
  // boot adds the links itself with the script's nonce, so CSP nonce mode keeps them.
9882
- function renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy) {
9993
+ function renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy, navigation) {
9883
9994
  if (!farmClientModulePreloads) return "";
9884
9995
  const files = farmClientModulePreloads.files;
9885
9996
  const attribute = function(name, indexes) {
@@ -9895,6 +10006,7 @@ function renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy) {
9895
10006
  const waitsForClick = rootStrategy === "interaction";
9896
10007
  return attribute("data-farm-preload", waitsForClick ? entry : entry.concat(rootModules)) +
9897
10008
  attribute("data-farm-preload-router", farmClientModulePreloads.router || []) +
10009
+ attribute("data-farm-preload-renderer", navigation ? [] : farmClientModulePreloads.renderer || []) +
9898
10010
  (waitsForClick ? attribute("data-farm-preload-root", rootModules) : "");
9899
10011
  }
9900
10012
 
@@ -12335,6 +12447,10 @@ ${hasServerRuntimeIntegrations ? `
12335
12447
  // Set once the whole document is rendered: whether it starts with the boot entry, which
12336
12448
  // preloads nothing.
12337
12449
  let farmBootsClient = false;
12450
+ // A client navigation swaps this document in without running its scripts. A route a
12451
+ // shared cache stores renders the same for every request.
12452
+ const farmNavigationRequest = ${farmIslandsMode ? `!farmSharedCacheableRoute &&
12453
+ (request.headers.has("f-stream") || request.headers.has("f-render"))` : "false"};
12338
12454
  // A layout's own <html> document with Farm's head assets merged in and the #root the client
12339
12455
  // hydrates opening its body: the whole document, or a streamed one's opening.
12340
12456
  const composeFarmFullDocument = function(markup) {
@@ -12344,7 +12460,7 @@ ${hasServerRuntimeIntegrations ? `
12344
12460
  );
12345
12461
  composed = composed
12346
12462
  // Inject CSS link after opening head tag or first meta tag
12347
- .replace(/<head([^>]*)>/i, function(match, attrs) { return '<head' + attrs + '>\\n <link rel="stylesheet" href="/__farm_client_css_href__">' + (farmBootsClient ? "" : renderFarmClientModulePreloads(composed, route.clientModule)); })
12463
+ .replace(/<head([^>]*)>/i, function(match, attrs) { return '<head' + attrs + '>\\n <link rel="stylesheet" href="/__farm_client_css_href__">' + (farmBootsClient ? "" : renderFarmClientModulePreloads(composed, route.clientModule, farmNavigationRequest)); })
12348
12464
  .replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n</head>')
12349
12465
  // Explicit metadata wins over renderer and layout titles. Without
12350
12466
  // explicit metadata, a renderer title wins over the layout title.
@@ -12542,7 +12658,8 @@ ${hasServerRuntimeIntegrations ? `
12542
12658
  farmHydratesRoot ? (shouldHydrateLayout ? "root" : "__farm_page__") : "",
12543
12659
  route.rootStrategy,
12544
12660
  html,
12545
- route.clientModule
12661
+ route.clientModule,
12662
+ farmNavigationRequest
12546
12663
  )
12547
12664
  : renderFarmClientEntryScript();
12548
12665
 
@@ -12573,7 +12690,7 @@ ${hasServerRuntimeIntegrations ? `
12573
12690
  \${viewportTags}
12574
12691
  \${hasFavicon ? "" : '<link rel="icon" href="data:,">'}
12575
12692
  \${suppressDefaultTitle ? "" : "<title>" + title + "</title>"}\${metaTags}\${rendererHead ? "\\n " + rendererHead : ""}
12576
- <link rel="stylesheet" href="/__farm_client_css_href__">\${farmBootsClient ? "" : renderFarmClientModulePreloads(html, route.clientModule)}
12693
+ <link rel="stylesheet" href="/__farm_client_css_href__">\${farmBootsClient ? "" : renderFarmClientModulePreloads(html, route.clientModule, farmNavigationRequest)}
12577
12694
  \${renderFarmRendererHydrationScript()}
12578
12695
  </head>
12579
12696
  <body>
@@ -15055,7 +15172,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
15055
15172
  basePath: config.basePath,
15056
15173
  publicDir: config.publicDir
15057
15174
  }),
15058
- farmEnvironmentFunctionsPlugin(),
15175
+ farmEnvironmentFunctionsPlugin({ renderer: config.renderer }),
15059
15176
  // Route modules load here at build time (rendering config, prerendering): `server-only`
15060
15177
  // resolves as it does in the server build. Module-entry packages load pre-bundled, as in
15061
15178
  // `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
@@ -15125,7 +15242,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
15125
15242
  farmPlugin,
15126
15243
  farmServerOnlyEntriesPlugin
15127
15244
  } = await import("./vite.mjs");
15128
- const { PluginManager: PluginManager2 } = await import("./plugin-TV6W7YNK.mjs");
15245
+ const { PluginManager: PluginManager2 } = await import("./plugin-33I3V42N.mjs");
15129
15246
  const pluginManager = new PluginManager2({
15130
15247
  config,
15131
15248
  isDev: false,
@@ -15153,7 +15270,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
15153
15270
  }
15154
15271
  async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
15155
15272
  const { farmI18nClientBridgePlugin, farmIslandContainersPlugin, farmPlugin } = await import("./vite.mjs");
15156
- const { PluginManager: PluginManager2 } = await import("./plugin-TV6W7YNK.mjs");
15273
+ const { PluginManager: PluginManager2 } = await import("./plugin-33I3V42N.mjs");
15157
15274
  const pluginManager = new PluginManager2({
15158
15275
  config,
15159
15276
  isDev: false,
@@ -15195,7 +15312,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
15195
15312
  }
15196
15313
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
15197
15314
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
15198
- import("./nitro-VCJ6QQSI.mjs"),
15315
+ import("./nitro-C3MYDX7V.mjs"),
15199
15316
  import("nitro/builder")
15200
15317
  ]);
15201
15318
  let nitroConfig = await createNitroConfig(