@farm.js/core 0.1.80 → 0.1.82

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 (390) hide show
  1. package/dist/{agent-mcp.d-BPa5n0ld.d.ts → agent-mcp.d-C2Su3x4D.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-DOP95Jxm.d.mts → agent-mcp.d-Yak-LqRd.d.mts} +1 -1
  3. package/dist/agent-runtime.cjs +4 -3
  4. package/dist/agent-runtime.d.mts +2 -1
  5. package/dist/agent-runtime.d.ts +2 -1
  6. package/dist/agent-runtime.mjs +3 -2
  7. package/dist/analyzer-LV23T6QN.cjs +17 -0
  8. package/dist/{analyzer-F7CWE5VA.mjs → analyzer-RPU2KG4J.mjs} +3 -2
  9. package/dist/api/client.cjs +1 -1
  10. package/dist/api/client.mjs +1 -1
  11. package/dist/api/client.native.cjs +1 -1
  12. package/dist/api/client.native.mjs +1 -1
  13. package/dist/api/node.cjs +6 -5
  14. package/dist/api/node.d.mts +4 -3
  15. package/dist/api/node.d.ts +4 -3
  16. package/dist/api/node.mjs +5 -4
  17. package/dist/api/route-manager.cjs +7 -6
  18. package/dist/api/route-manager.d.mts +4 -3
  19. package/dist/api/route-manager.d.ts +4 -3
  20. package/dist/api/route-manager.mjs +6 -5
  21. package/dist/api/runtime.cjs +5 -4
  22. package/dist/api/runtime.d.mts +3 -2
  23. package/dist/api/runtime.d.ts +3 -2
  24. package/dist/api/runtime.mjs +4 -3
  25. package/dist/api.cjs +9 -8
  26. package/dist/api.d.mts +5 -4
  27. package/dist/api.d.ts +5 -4
  28. package/dist/api.mjs +8 -7
  29. package/dist/{app-manifest.d-9UD6BznX.d.mts → app-manifest.d-BcyOFMrg.d.mts} +1 -1
  30. package/dist/{app-manifest.d-CO6Iu0Hx.d.ts → app-manifest.d-DZyXaICz.d.ts} +1 -1
  31. package/dist/app-markdown.cjs +3 -3
  32. package/dist/app-markdown.d.mts +5 -4
  33. package/dist/app-markdown.d.ts +5 -4
  34. package/dist/app-markdown.mjs +2 -2
  35. package/dist/{app.d-DXeRWZK7.d.mts → app.d-C0ePpuaG.d.mts} +30 -4
  36. package/dist/{app.d-DwX1ePhs.d.ts → app.d-CIoXsAbN.d.ts} +30 -4
  37. package/dist/{chunk-Q4TRGTO7.cjs → chunk-26WP75W5.cjs} +32 -16
  38. package/dist/{chunk-7KDCVSTR.mjs → chunk-2PFGA6PB.mjs} +2 -2
  39. package/dist/chunk-2UYYXSUS.mjs +401 -0
  40. package/dist/{chunk-PL7MCYYD.mjs → chunk-3AV4DCXY.mjs} +58 -358
  41. package/dist/{chunk-3GNHJ3RN.cjs → chunk-3BTN3NP7.cjs} +2 -2
  42. package/dist/chunk-3DE6RK7K.cjs +36 -0
  43. package/dist/{chunk-GBW5DU7V.mjs → chunk-47I2MYIR.mjs} +487 -304
  44. package/dist/{chunk-RQBGHHOQ.mjs → chunk-4X7LSGM6.mjs} +1 -1
  45. package/dist/{chunk-QMR2TUVZ.cjs → chunk-52Q4OB4A.cjs} +4 -4
  46. package/dist/{chunk-BPWTSPK6.mjs → chunk-5AL2GXAU.mjs} +1 -1
  47. package/dist/{chunk-GAWSWJJ2.cjs → chunk-5GFTMTX3.cjs} +2 -2
  48. package/dist/chunk-5MMKNW7Q.cjs +54 -0
  49. package/dist/{chunk-AXA2BSX3.cjs → chunk-5MUFW5UU.cjs} +22 -21
  50. package/dist/{chunk-MQOHYV6L.cjs → chunk-5P65LXGU.cjs} +11 -11
  51. package/dist/{chunk-KEU55O2D.mjs → chunk-63ZE6B6M.mjs} +7 -6
  52. package/dist/{chunk-TS3ZHJN5.cjs → chunk-6BPFIYGY.cjs} +3 -3
  53. package/dist/{chunk-NJ4OASLP.mjs → chunk-6QYPP5KC.mjs} +2 -2
  54. package/dist/{chunk-ATISIC6G.mjs → chunk-7VJXYB6S.mjs} +7 -1
  55. package/dist/{chunk-G4SZC2WH.cjs → chunk-AIPZDBP6.cjs} +557 -374
  56. package/dist/{chunk-X4TSMQWF.cjs → chunk-ARORZ3MH.cjs} +548 -397
  57. package/dist/{chunk-K3XKEZR6.mjs → chunk-AUFEM3FB.mjs} +1 -1
  58. package/dist/{chunk-MGKWYPE3.mjs → chunk-AYDVUCXD.mjs} +1 -0
  59. package/dist/{chunk-5OAN7BG5.cjs → chunk-B2PGVHBG.cjs} +4 -4
  60. package/dist/{chunk-WGWWRV2M.cjs → chunk-B3HQTGXS.cjs} +6 -4
  61. package/dist/chunk-B7L24VPX.cjs +401 -0
  62. package/dist/{chunk-5VDJEKGK.cjs → chunk-BBVLOEND.cjs} +1 -1
  63. package/dist/{chunk-XF7MJSUS.mjs → chunk-BCQIXH7L.mjs} +1 -1
  64. package/dist/{chunk-67MZTLTF.cjs → chunk-BCTHOQPP.cjs} +37 -9
  65. package/dist/{chunk-GBESKA76.cjs → chunk-BSX5OGSD.cjs} +1 -1
  66. package/dist/{chunk-CNDBLUKI.mjs → chunk-BVJUFVCU.mjs} +1 -1
  67. package/dist/{chunk-QHAISITM.mjs → chunk-C3VCYOU4.mjs} +1 -1
  68. package/dist/chunk-C5QHZ626.cjs +85 -0
  69. package/dist/{chunk-3K2E55BJ.mjs → chunk-CA2HBLXP.mjs} +13 -3
  70. package/dist/{chunk-ANZLZNNX.cjs → chunk-CD5Z7RR5.cjs} +155 -20
  71. package/dist/{chunk-4MIDUSIX.mjs → chunk-CJDBTTLB.mjs} +17 -17
  72. package/dist/{chunk-RLCOWWE5.cjs → chunk-CN2JOTRO.cjs} +7 -7
  73. package/dist/chunk-D2VAANBS.mjs +48 -0
  74. package/dist/{chunk-XZBBKZGW.mjs → chunk-DAXU2NBE.mjs} +128 -41
  75. package/dist/{chunk-4H4ZXUNB.cjs → chunk-DJ3PVHTW.cjs} +3 -3
  76. package/dist/{chunk-Z5BANEQD.cjs → chunk-DMSXZNQR.cjs} +2 -2
  77. package/dist/{chunk-ZVSQN7NC.cjs → chunk-DRO3NXA3.cjs} +40 -43
  78. package/dist/{chunk-4OFWG4IK.cjs → chunk-EACD6ND7.cjs} +8 -2
  79. package/dist/{chunk-Q4YEAWUK.mjs → chunk-ECVSRE4Y.mjs} +3 -2
  80. package/dist/{chunk-MDEFTF63.mjs → chunk-EL2Z6YFZ.mjs} +25 -28
  81. package/dist/chunk-EZYKV24V.mjs +385 -0
  82. package/dist/{chunk-TVCFY3KK.cjs → chunk-FB4CWSC2.cjs} +12 -12
  83. package/dist/{chunk-IYFBLWXU.cjs → chunk-FULX5RYX.cjs} +61 -361
  84. package/dist/{chunk-V73Y4UBL.mjs → chunk-GXLNARPO.mjs} +151 -16
  85. package/dist/{chunk-ZPEZXQTM.cjs → chunk-HHQEKLZL.cjs} +2 -2
  86. package/dist/{chunk-HNUBRUFQ.cjs → chunk-HQEYZSF3.cjs} +4 -3
  87. package/dist/{chunk-5ZHC6QGD.cjs → chunk-HQKCSJEH.cjs} +8 -2
  88. package/dist/{chunk-RHI67C2V.cjs → chunk-HUGPJFOC.cjs} +1 -35
  89. package/dist/{chunk-44G4XHEL.mjs → chunk-I4DR3HCH.mjs} +11 -11
  90. package/dist/chunk-I4WZRG73.mjs +54 -0
  91. package/dist/{chunk-MUZHULW2.mjs → chunk-ICOJ2BC6.mjs} +23 -7
  92. package/dist/{chunk-MNIR7I7B.mjs → chunk-INKVDO42.mjs} +1 -1
  93. package/dist/{chunk-C2OLXVUC.mjs → chunk-IVP5Q4BX.mjs} +10 -3
  94. package/dist/{chunk-HEDGTXXB.cjs → chunk-JB4BHRFK.cjs} +17 -17
  95. package/dist/{chunk-XKUKWMGX.cjs → chunk-JCYDWJVO.cjs} +3 -3
  96. package/dist/{chunk-CCMP4JD2.cjs → chunk-JK26IMT7.cjs} +1 -1
  97. package/dist/{chunk-WIZRYFB2.cjs → chunk-JYQ6DGPW.cjs} +8 -6
  98. package/dist/{chunk-SVCUSOEF.mjs → chunk-KR5DF7WK.mjs} +1 -1
  99. package/dist/{chunk-TYHWZOA2.mjs → chunk-KWI3SQFX.mjs} +4 -2
  100. package/dist/{chunk-POVHO46S.mjs → chunk-L3RDECA5.mjs} +1 -1
  101. package/dist/{chunk-LVGB5PYK.cjs → chunk-LM2ZDNDD.cjs} +28 -28
  102. package/dist/{chunk-COTFX4GT.mjs → chunk-LTOT5KVJ.mjs} +1 -1
  103. package/dist/{chunk-RPA45OQS.mjs → chunk-MO4UTDQ6.mjs} +1 -1
  104. package/dist/{chunk-DVHFIETW.cjs → chunk-N2EFMN2K.cjs} +18 -18
  105. package/dist/{chunk-MZ5QGWRW.mjs → chunk-N3VMHPIY.mjs} +2 -2
  106. package/dist/{chunk-KKVRWNDH.mjs → chunk-NAHDG6UX.mjs} +4 -4
  107. package/dist/{chunk-UWOCYINY.cjs → chunk-NEKO3HM2.cjs} +12 -2
  108. package/dist/{chunk-SLEHAGGV.mjs → chunk-NQ3Y6E2T.mjs} +7 -1
  109. package/dist/{chunk-ZDYYZX73.mjs → chunk-NRCKBDYP.mjs} +266 -115
  110. package/dist/{chunk-EG5YBYHO.mjs → chunk-OMB7UGVW.mjs} +1 -1
  111. package/dist/{chunk-JGEN2FIT.mjs → chunk-OP5VI4TP.mjs} +1 -1
  112. package/dist/{chunk-7VCLTNED.mjs → chunk-PNMAD3OS.mjs} +1 -35
  113. package/dist/{chunk-3XTRT3MB.mjs → chunk-PO5MZIWK.mjs} +1 -1
  114. package/dist/{chunk-ASYOWPSR.cjs → chunk-PWDBWXQI.cjs} +2 -1
  115. package/dist/{chunk-WJ2O2MPP.cjs → chunk-Q2VOT3K2.cjs} +494 -407
  116. package/dist/{chunk-7YLDUB4R.cjs → chunk-QCKSYYXK.cjs} +7 -7
  117. package/dist/{chunk-57QAQU4F.mjs → chunk-QRNYSISP.mjs} +1 -1
  118. package/dist/{chunk-3JQBQG7K.mjs → chunk-QSMUMK7Y.mjs} +2 -2
  119. package/dist/{chunk-PRL7FXG4.cjs → chunk-RDNKQ5MK.cjs} +12 -13
  120. package/dist/{chunk-GCRT6GJG.mjs → chunk-RMLR5RMH.mjs} +30 -2
  121. package/dist/{chunk-XY5OZQF6.cjs → chunk-RMPUEH5T.cjs} +2 -2
  122. package/dist/{chunk-7DD5TNPS.cjs → chunk-S7WZUK3B.cjs} +2 -2
  123. package/dist/{chunk-EGHPFXPZ.cjs → chunk-SAPG45RA.cjs} +23 -23
  124. package/dist/{chunk-Z4SMFUZ7.cjs → chunk-U54REWMJ.cjs} +23 -23
  125. package/dist/chunk-U6XYBTUT.mjs +36 -0
  126. package/dist/chunk-UDMBUTJD.mjs +85 -0
  127. package/dist/{chunk-WHEQJN4G.cjs → chunk-UGD53SNO.cjs} +2 -2
  128. package/dist/{chunk-TCMRLW3K.cjs → chunk-VACYUMXW.cjs} +10 -3
  129. package/dist/{chunk-SDICLSQU.cjs → chunk-VMBIKDKW.cjs} +10 -10
  130. package/dist/{chunk-WBPVLCNE.mjs → chunk-VPGEYX5Y.mjs} +4 -4
  131. package/dist/chunk-VS7HLH4S.cjs +385 -0
  132. package/dist/{chunk-UGLTOLTJ.cjs → chunk-W76C7TCW.cjs} +2 -2
  133. package/dist/chunk-WMRGIQTA.cjs +48 -0
  134. package/dist/{chunk-52LTENRE.cjs → chunk-WOAXQ5MZ.cjs} +9 -9
  135. package/dist/{chunk-C6HGUTXB.mjs → chunk-XBSIGZ4J.mjs} +2 -3
  136. package/dist/{chunk-6JWXHPVR.mjs → chunk-XRSNW4IU.mjs} +4 -2
  137. package/dist/{chunk-2RRTOKRZ.mjs → chunk-YHM4PXJY.mjs} +1 -1
  138. package/dist/{chunk-A5D3UMLJ.mjs → chunk-YSU3WCW6.mjs} +1 -1
  139. package/dist/{chunk-4STJ6LGR.mjs → chunk-Z3RM3VA2.mjs} +1 -1
  140. package/dist/{chunk-YN3YMSKD.mjs → chunk-ZIZRIZLP.mjs} +3 -3
  141. package/dist/{cli-runtime.d-DPNTN-JV.d.mts → cli-runtime.d-Hnvvadz7.d.mts} +5 -5
  142. package/dist/{cli-runtime.d-8BhZy_wr.d.ts → cli-runtime.d-I0MphTbc.d.ts} +5 -5
  143. package/dist/{client-component.d-CkDcob6D.d.ts → client-component.d-5QEvtJsg.d.ts} +1 -1
  144. package/dist/{client-component.d-CMCdyAr8.d.mts → client-component.d-DapRqtSC.d.mts} +1 -1
  145. package/dist/{client-plugins.d-WcMwOZGZ.d.mts → client-plugins.d-C1WM3ieD.d.mts} +7 -13
  146. package/dist/{client-plugins.d-BYIovYqX.d.ts → client-plugins.d-DcmDzcSC.d.ts} +7 -13
  147. package/dist/client-plugins.d.mts +2 -1
  148. package/dist/client-plugins.d.ts +2 -1
  149. package/dist/client.cjs +9 -8
  150. package/dist/client.d.mts +20 -151
  151. package/dist/client.d.ts +20 -151
  152. package/dist/client.mjs +8 -7
  153. package/dist/config.d.mts +2 -1
  154. package/dist/config.d.ts +2 -1
  155. package/dist/cron.cjs +2 -2
  156. package/dist/cron.mjs +1 -1
  157. package/dist/desktop.d.mts +3 -2
  158. package/dist/desktop.d.ts +3 -2
  159. package/dist/{devtools-JJOYTIMS.cjs → devtools-5B7NZE6F.cjs} +15 -14
  160. package/dist/{devtools-F3FDFV26.mjs → devtools-C5GXZZ7E.mjs} +12 -11
  161. package/dist/docs.cjs +14 -13
  162. package/dist/docs.d.mts +4 -3
  163. package/dist/docs.d.ts +4 -3
  164. package/dist/docs.mjs +13 -12
  165. package/dist/environment/vite.cjs +7 -6
  166. package/dist/environment/vite.mjs +6 -5
  167. package/dist/{handler.d-s3IM6pbJ.d.mts → handler.d-B8bPCBzl.d.mts} +1 -1
  168. package/dist/{handler.d-BwdOyc9x.d.ts → handler.d-Cliwo6Nu.d.ts} +1 -1
  169. package/dist/{headers.d-BR-OXrqQ.d.mts → headers.d-CVwSpSGX.d.mts} +1 -1
  170. package/dist/{headers.d-CAW4wPey.d.ts → headers.d-C_btqjV6.d.ts} +1 -1
  171. package/dist/index.cjs +68 -65
  172. package/dist/{index.d-BEVK61zS.d.mts → index.d-DFuMZk9-.d.mts} +1 -1
  173. package/dist/{index.d-ah2c89Wu.d.ts → index.d-hOEbMcLk.d.ts} +1 -1
  174. package/dist/index.d.mts +25 -23
  175. package/dist/index.d.ts +25 -23
  176. package/dist/index.mjs +72 -69
  177. package/dist/instrumentation.cjs +3 -3
  178. package/dist/instrumentation.mjs +2 -2
  179. package/dist/integrations/orm.d.mts +2 -1
  180. package/dist/integrations/orm.d.ts +2 -1
  181. package/dist/integrations.cjs +4 -3
  182. package/dist/integrations.d.mts +2 -1
  183. package/dist/integrations.d.ts +2 -1
  184. package/dist/integrations.mjs +3 -2
  185. package/dist/internal/app-markdown-runtime.cjs +2 -2
  186. package/dist/internal/app-markdown-runtime.d.mts +12 -5
  187. package/dist/internal/app-markdown-runtime.d.ts +12 -5
  188. package/dist/internal/app-markdown-runtime.mjs +1 -1
  189. package/dist/internal/build-runtime.cjs +49 -47
  190. package/dist/internal/build-runtime.d.mts +5 -4
  191. package/dist/internal/build-runtime.d.ts +5 -4
  192. package/dist/internal/build-runtime.mjs +48 -46
  193. package/dist/internal/cli-runtime.cjs +25 -24
  194. package/dist/internal/cli-runtime.d.mts +8 -7
  195. package/dist/internal/cli-runtime.d.ts +8 -7
  196. package/dist/internal/cli-runtime.mjs +26 -25
  197. package/dist/internal/client-error-overlay.cjs +4 -4
  198. package/dist/internal/client-error-overlay.mjs +1 -1
  199. package/dist/internal/client-runtime.cjs +76 -15
  200. package/dist/internal/client-runtime.d.mts +18 -7
  201. package/dist/internal/client-runtime.d.ts +18 -7
  202. package/dist/internal/client-runtime.mjs +67 -6
  203. package/dist/internal/compression-runtime.d.mts +2 -1
  204. package/dist/internal/compression-runtime.d.ts +2 -1
  205. package/dist/internal/config-runtime.cjs +14 -13
  206. package/dist/internal/config-runtime.d.mts +4 -3
  207. package/dist/internal/config-runtime.d.ts +4 -3
  208. package/dist/internal/config-runtime.mjs +13 -12
  209. package/dist/internal/docs-precompiled-runtime.cjs +1 -1
  210. package/dist/internal/docs-precompiled-runtime.mjs +1 -1
  211. package/dist/internal/form-actions.cjs +3 -3
  212. package/dist/internal/form-actions.mjs +2 -2
  213. package/dist/internal/infra-analytics-runtime.cjs +9 -7
  214. package/dist/internal/infra-analytics-runtime.d.mts +8 -2
  215. package/dist/internal/infra-analytics-runtime.d.ts +8 -2
  216. package/dist/internal/infra-analytics-runtime.mjs +9 -7
  217. package/dist/internal/island-codec.cjs +3 -3
  218. package/dist/internal/island-codec.mjs +2 -2
  219. package/dist/internal/island-value-store.d.mts +1 -1
  220. package/dist/internal/island-value-store.d.ts +1 -1
  221. package/dist/internal/islands-boot.cjs +63 -23
  222. package/dist/internal/islands-boot.d.mts +5 -3
  223. package/dist/internal/islands-boot.d.ts +5 -3
  224. package/dist/internal/islands-boot.mjs +58 -18
  225. package/dist/internal/islands-runtime.cjs +10 -56
  226. package/dist/internal/islands-runtime.mjs +6 -52
  227. package/dist/internal/islands-server.cjs +4 -4
  228. package/dist/internal/islands-server.mjs +3 -3
  229. package/dist/internal/islx-actions-client.cjs +36 -0
  230. package/dist/internal/islx-actions-client.d.mts +13 -0
  231. package/dist/internal/islx-actions-client.d.ts +13 -0
  232. package/dist/internal/islx-actions-client.mjs +36 -0
  233. package/dist/internal/islx-actions-server.cjs +8 -0
  234. package/dist/internal/islx-actions-server.d.mts +6 -0
  235. package/dist/internal/islx-actions-server.d.ts +6 -0
  236. package/dist/internal/islx-actions-server.mjs +8 -0
  237. package/dist/internal/islx-client.d.mts +0 -4
  238. package/dist/internal/islx-client.d.ts +0 -4
  239. package/dist/internal/isolated-boundary.cjs +3 -3
  240. package/dist/internal/isolated-boundary.d.mts +1 -1
  241. package/dist/internal/isolated-boundary.d.ts +1 -1
  242. package/dist/internal/isolated-boundary.mjs +2 -2
  243. package/dist/internal/metadata-image-runtime.cjs +4 -2
  244. package/dist/internal/metadata-image-runtime.d.mts +18 -2
  245. package/dist/internal/metadata-image-runtime.d.ts +18 -2
  246. package/dist/internal/metadata-image-runtime.mjs +5 -3
  247. package/dist/internal/native-server-fns.cjs +5 -4
  248. package/dist/internal/native-server-fns.mjs +4 -3
  249. package/dist/internal/navigation-neutral.cjs +36 -0
  250. package/dist/internal/navigation-neutral.d.mts +14 -0
  251. package/dist/internal/navigation-neutral.d.ts +14 -0
  252. package/dist/internal/navigation-neutral.mjs +36 -0
  253. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  254. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  255. package/dist/internal/production-runtime.cjs +30 -25
  256. package/dist/internal/production-runtime.d.mts +14 -11
  257. package/dist/internal/production-runtime.d.ts +14 -11
  258. package/dist/internal/production-runtime.mjs +35 -30
  259. package/dist/internal/server-tree.cjs +5 -4
  260. package/dist/internal/server-tree.d.mts +3 -4
  261. package/dist/internal/server-tree.d.ts +3 -4
  262. package/dist/internal/server-tree.mjs +4 -3
  263. package/dist/internal/spa-router.cjs +3 -3
  264. package/dist/internal/spa-router.d.mts +4 -3
  265. package/dist/internal/spa-router.d.ts +4 -3
  266. package/dist/internal/spa-router.mjs +2 -2
  267. package/dist/internal/start-manifest.d.mts +2 -1
  268. package/dist/internal/start-manifest.d.ts +2 -1
  269. package/dist/internal/vercel-edge-middleware.cjs +1 -1
  270. package/dist/internal/vercel-edge-middleware.mjs +1 -1
  271. package/dist/island-value-protocol.d-fEoc1m8e.d.mts +27 -0
  272. package/dist/island-value-protocol.d-fEoc1m8e.d.ts +27 -0
  273. package/dist/{layers-5ZD4764G.mjs → layers-744BBUY5.mjs} +2 -2
  274. package/dist/layers-XLOMMQP7.cjs +21 -0
  275. package/dist/markdown.d.mts +2 -1
  276. package/dist/markdown.d.ts +2 -1
  277. package/dist/middleware.cjs +5 -5
  278. package/dist/middleware.d.mts +2 -1
  279. package/dist/middleware.d.ts +2 -1
  280. package/dist/middleware.mjs +4 -4
  281. package/dist/{mount.d-DcoPFqv5.d.ts → mount.d-CAovYKfs.d.ts} +1 -1
  282. package/dist/{mount.d-Ylo-CmzK.d.mts → mount.d-DLeYxeRR.d.mts} +1 -1
  283. package/dist/{native-server-fn-handler-TNVFEQW3.cjs → native-server-fn-handler-57TCQPSM.cjs} +4 -4
  284. package/dist/{native-server-fn-handler-OXFTI6V5.mjs → native-server-fn-handler-PYK65A46.mjs} +3 -3
  285. package/dist/{navigation-delegate.d-2MK4YSlL.d.ts → navigation-delegate.d-BLM-8Q3Z.d.ts} +1 -1
  286. package/dist/{navigation-delegate.d-BA5h0fbE.d.mts → navigation-delegate.d-Chv93QS6.d.mts} +1 -1
  287. package/dist/navigation-errors.d-DwHtoMyR.d.mts +13 -0
  288. package/dist/navigation-errors.d-DwHtoMyR.d.ts +13 -0
  289. package/dist/navigation.cjs +6 -6
  290. package/dist/navigation.d.mts +7 -6
  291. package/dist/navigation.d.ts +7 -6
  292. package/dist/navigation.mjs +5 -5
  293. package/dist/{nitro-C3MYDX7V.mjs → nitro-FK3SZM4H.mjs} +2 -2
  294. package/dist/{nitro-6UOJXJZ6.cjs → nitro-YDFMH5PY.cjs} +6 -6
  295. package/dist/node-module-bundle-TNSY5PAC.cjs +15 -0
  296. package/dist/{node-module-bundle-XPLBMXRD.mjs → node-module-bundle-ZWCQJCKA.mjs} +3 -1
  297. package/dist/{plugin-LN3JBZRR.cjs → plugin-3PT7I26P.cjs} +2 -2
  298. package/dist/{plugin-33I3V42N.mjs → plugin-QOTAPTVV.mjs} +1 -1
  299. package/dist/plugin.cjs +41 -37
  300. package/dist/plugin.d.mts +6 -5
  301. package/dist/plugin.d.ts +6 -5
  302. package/dist/plugin.mjs +40 -36
  303. package/dist/query/client.cjs +10 -10
  304. package/dist/query/client.mjs +5 -5
  305. package/dist/{render-plan.d-2o-AG-ot.d.ts → render-plan.d-BSTjTH8h.d.ts} +1 -1
  306. package/dist/{render-plan.d-ChYBMhLu.d.mts → render-plan.d-CK5Lggyb.d.mts} +1 -1
  307. package/dist/renderer/none/server.cjs +5 -1
  308. package/dist/renderer/none/server.d.mts +3 -1
  309. package/dist/renderer/none/server.d.ts +3 -1
  310. package/dist/renderer/none/server.mjs +4 -0
  311. package/dist/renderer/react/server.cjs +6 -6
  312. package/dist/renderer/react/server.mjs +3 -3
  313. package/dist/renderer-client.cjs +79 -17
  314. package/dist/renderer-client.d.mts +13 -97
  315. package/dist/renderer-client.d.ts +13 -97
  316. package/dist/renderer-client.mjs +69 -7
  317. package/dist/renderer.cjs +4 -2
  318. package/dist/renderer.d.mts +43 -5
  319. package/dist/renderer.d.ts +43 -5
  320. package/dist/renderer.mjs +3 -1
  321. package/dist/{request.d-RCnCBuWq.d.mts → request.d-BhggxQf3.d.mts} +1 -1
  322. package/dist/{request.d-CE0FIkiM.d.ts → request.d-CyJS9bjm.d.ts} +1 -1
  323. package/dist/request.d.mts +3 -2
  324. package/dist/request.d.ts +3 -2
  325. package/dist/{route-rendering.d-BTPOM2nU.d.ts → route-rendering.d-BLPPmI5I.d.ts} +1 -1
  326. package/dist/{route-rendering.d-BZJnfKsp.d.mts → route-rendering.d-CUpG2mZJ.d.mts} +1 -1
  327. package/dist/{router.d-BU_WE6Ol.d.ts → router.d-0X2Ki6rf.d.ts} +1 -1
  328. package/dist/{router.d-D8Vvwl4i.d.mts → router.d-2NQM1Kgw.d.mts} +1 -1
  329. package/dist/routes.cjs +1 -1
  330. package/dist/routes.d.mts +2 -1
  331. package/dist/routes.d.ts +2 -1
  332. package/dist/routes.mjs +1 -1
  333. package/dist/{rsc-pipeline-A3R4U26C.cjs → rsc-pipeline-5AOF64FL.cjs} +19 -18
  334. package/dist/{rsc-pipeline-JZWVSHOR.mjs → rsc-pipeline-DNRLYOJ7.mjs} +18 -17
  335. package/dist/{runtime-SQFRHRGJ.mjs → runtime-EHG2FRXZ.mjs} +18 -17
  336. package/dist/{runtime-WZ3CHHGJ.cjs → runtime-ZVHG5SRB.cjs} +20 -19
  337. package/dist/{runtime.d-DJ6IIKcF.d.ts → runtime.d-CXuwkUgr.d.ts} +1 -1
  338. package/dist/{runtime.d-BnmuOXVD.d.mts → runtime.d-CaFXcu_Q.d.mts} +1 -1
  339. package/dist/server-action-security.cjs +1 -1
  340. package/dist/server-action-security.mjs +1 -1
  341. package/dist/{server-components-status.d-BeqSXcjM.d.ts → server-components-status.d-BdeFD8ZH.d.ts} +1 -1
  342. package/dist/{server-components-status.d-BzOg9M8g.d.mts → server-components-status.d-Cp7zvBm5.d.mts} +1 -1
  343. package/dist/server-fn.cjs +3 -3
  344. package/dist/server-fn.mjs +2 -2
  345. package/dist/server-plugins.cjs +1 -1
  346. package/dist/server-plugins.d.mts +4 -3
  347. package/dist/server-plugins.d.ts +4 -3
  348. package/dist/server-plugins.mjs +1 -1
  349. package/dist/server-query.cjs +4 -4
  350. package/dist/server-query.mjs +3 -3
  351. package/dist/server.cjs +82 -71
  352. package/dist/server.d.mts +12 -11
  353. package/dist/server.d.ts +12 -11
  354. package/dist/server.mjs +61 -50
  355. package/dist/{spa-router.d-BOwuVkMl.d.ts → spa-router.d-Bjgl-Osi.d.ts} +3 -3
  356. package/dist/{spa-router.d-CDpftSsk.d.mts → spa-router.d-l3G38xHa.d.mts} +3 -3
  357. package/dist/{ssg.d-BTVqyq8T.d.ts → ssg.d-DDca17Lc.d.ts} +2 -2
  358. package/dist/{ssg.d-Bx_WFuwg.d.mts → ssg.d-RnlHOqUL.d.mts} +2 -2
  359. package/dist/store-core.d-BZjuC6Zc.d.mts +309 -0
  360. package/dist/store-core.d-BaOUOPf7.d.ts +309 -0
  361. package/dist/testing.cjs +7 -6
  362. package/dist/testing.d.mts +2 -1
  363. package/dist/testing.d.ts +2 -1
  364. package/dist/testing.mjs +6 -5
  365. package/dist/{utils.d-_dvevm5s.d.ts → utils.d-D8TWmpWo.d.ts} +1 -1
  366. package/dist/{utils.d-JkrpS-NJ.d.mts → utils.d-tdzw0_zQ.d.mts} +1 -1
  367. package/dist/version.cjs +2 -2
  368. package/dist/version.mjs +1 -1
  369. package/dist/vite.cjs +43 -37
  370. package/dist/vite.d.mts +18 -7
  371. package/dist/vite.d.ts +18 -7
  372. package/dist/vite.mjs +42 -36
  373. package/dist/workflows.cjs +2 -2
  374. package/dist/workflows.mjs +1 -1
  375. package/package.json +17 -2
  376. package/dist/analyzer-I7RBBQ65.cjs +0 -16
  377. package/dist/chunk-CQL5ZGFU.cjs +0 -50
  378. package/dist/chunk-HONTCUK6.mjs +0 -203
  379. package/dist/chunk-K6PGK7DC.cjs +0 -203
  380. package/dist/chunk-NBIVGHAT.mjs +0 -50
  381. package/dist/island-value-protocol.d-BRayRghM.d.mts +0 -12
  382. package/dist/island-value-protocol.d-BRayRghM.d.ts +0 -12
  383. package/dist/layers-HMEGUEXM.cjs +0 -21
  384. package/dist/node-module-bundle-M6BISE2P.cjs +0 -13
  385. package/dist/{chunk-EY7ED5UW.mjs → chunk-3RVLJTFZ.mjs} +3 -3
  386. package/dist/{chunk-UJPE75GF.mjs → chunk-J2VUPCCR.mjs} +3 -3
  387. package/dist/{chunk-PBJ7MEOV.cjs → chunk-OZUINP2P.cjs} +2 -2
  388. package/dist/{chunk-7FQFK3OA.mjs → chunk-V7HNYR76.mjs} +3 -3
  389. package/dist/{chunk-2FK47RRZ.cjs → chunk-VGHDPEPQ.cjs} +2 -2
  390. package/dist/{chunk-CGIVCGH5.cjs → chunk-XOFJUSWC.cjs} +2 -2
@@ -1,4 +1,4 @@
1
- import { F as FarmIslandValueStore } from '../island-value-protocol.d-BRayRghM.js';
1
+ import { F as FarmIslandValueStore } from '../island-value-protocol.d-fEoc1m8e.js';
2
2
 
3
3
  /** The page's value store, shared by every copy of the runtime. */
4
4
  declare function getFarmIslandValueStore(): FarmIslandValueStore;
@@ -4,6 +4,7 @@
4
4
  var FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR = 'button,[role="button"],input[type="button"],input[type="submit"],input[type="reset"]';
5
5
  var FARM_ISLANDS_BOOT_VISIBLE_MARGIN = "200px";
6
6
  var FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER = "x-farm-deployment-id";
7
+ var FARM_ISLANDS_BOOT_PREFETCHING_LINK = 'a[data-farm-link]:not([data-farm-prefetch="none"])';
7
8
  var ISLAND = "f-island";
8
9
  var HYDRATED_ISLAND = '[data-farm-island-hydrated="true"]';
9
10
  function submitsForm(target, kind) {
@@ -60,18 +61,19 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
60
61
  const rootId = _optionalChain([script, 'optionalAccess', _11 => _11.dataset, 'access', _12 => _12.farmRoot]);
61
62
  const root = rootId ? document.getElementById(rootId) : null;
62
63
  const preloaded = /* @__PURE__ */ new Set();
64
+ const runtime = new URL(_nullishCoalesce(_optionalChain([script, 'optionalAccess', _13 => _13.dataset, 'access', _14 => _14.farmRuntime]), () => ( "")), document.baseURI);
65
+ const modulepreload = (file) => {
66
+ const link = document.createElement("link");
67
+ link.rel = "modulepreload";
68
+ link.href = new URL(file, runtime).href;
69
+ if (_optionalChain([script, 'optionalAccess', _15 => _15.nonce])) link.nonce = script.nonce;
70
+ document.head.append(link);
71
+ };
63
72
  const preload = (group) => {
64
- const files = _optionalChain([script, 'optionalAccess', _13 => _13.dataset, 'access', _14 => _14[group]]);
73
+ const files = _optionalChain([script, 'optionalAccess', _16 => _16.dataset, 'access', _17 => _17[group]]);
65
74
  if (!script || !files || preloaded.has(group)) return;
66
75
  preloaded.add(group);
67
- const base = new URL(_nullishCoalesce(script.dataset.farmRuntime, () => ( "")), document.baseURI);
68
- for (const file of files.split(" ")) {
69
- const link = document.createElement("link");
70
- link.rel = "modulepreload";
71
- link.href = new URL(file, base).href;
72
- if (script.nonce) link.nonce = script.nonce;
73
- document.head.append(link);
74
- }
76
+ for (const file of files.split(" ")) modulepreload(file);
75
77
  };
76
78
  const release = () => {
77
79
  for (const cleanup of cleanups.splice(0)) cleanup();
@@ -144,16 +146,25 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
144
146
  };
145
147
  for (const type of ["pointerdown", "focusin", "mouseover"]) listen(type, observe, true);
146
148
  const requestPage = (href) => {
149
+ const scope = window;
150
+ const early = scope.__FARM_EARLY_NAVIGATION__;
151
+ if (_optionalChain([early, 'optionalAccess', _18 => _18.url]) === href && Date.now() - early.at <= 3e4) return;
152
+ _optionalChain([early, 'optionalAccess', _19 => _19.controller, 'access', _20 => _20.abort, 'call', _21 => _21()]);
147
153
  const headers = { accept: "text/html" };
154
+ const content = _nullishCoalesce(document.getElementById("root"), () => ( document.body));
155
+ const held = new Set(
156
+ Array.from(
157
+ content.querySelectorAll('script[type="f/value"][name]'),
158
+ (value) => value.getAttribute("name")
159
+ )
160
+ );
161
+ if (held.size) headers["f-values"] = [...held].slice(-128).join(",");
148
162
  const layouts = Array.from(
149
- (_nullishCoalesce(document.getElementById("root"), () => ( document.body))).querySelectorAll(
150
- '[data-farm-layout-boundary="true"]'
151
- ),
163
+ content.querySelectorAll('[data-farm-layout-boundary="true"]'),
152
164
  (boundary) => boundary.getAttribute("data-farm-layout-key") || boundary.getAttribute("data-farm-layout-pattern")
153
165
  ).filter(Boolean);
154
166
  if (layouts.length) headers["f-layouts"] = JSON.stringify(layouts);
155
167
  if (rootId !== "root") headers["f-stream"] = "flush";
156
- const scope = window;
157
168
  if (scope.__FARM_DEPLOYMENT_ID__) {
158
169
  headers[FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER] = scope.__FARM_DEPLOYMENT_ID__;
159
170
  }
@@ -163,6 +174,18 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
163
174
  });
164
175
  scope.__FARM_EARLY_NAVIGATION__ = { url: href, headers, response, at: Date.now(), controller };
165
176
  };
177
+ listen(
178
+ "pointerdown",
179
+ (event) => {
180
+ const press = event;
181
+ const anchor = routedLink(press.target);
182
+ if (press.button || isModified(press) || !_optionalChain([anchor, 'optionalAccess', _22 => _22.matches, 'call', _23 => _23(FARM_ISLANDS_BOOT_PREFETCHING_LINK)])) {
183
+ return;
184
+ }
185
+ requestPage(anchor.href);
186
+ },
187
+ true
188
+ );
166
189
  listen(
167
190
  "click",
168
191
  (event) => {
@@ -191,19 +214,22 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
191
214
  { rootMargin: FARM_ISLANDS_BOOT_VISIBLE_MARGIN }
192
215
  ) : null;
193
216
  if (visibility) cleanups.push(() => visibility.disconnect());
194
- let idle = false;
195
- const startWhenIdle = () => {
196
- if (idle) return;
197
- idle = true;
217
+ const whenIdle = (callback) => {
198
218
  const idleWindow = window;
199
219
  if (typeof idleWindow.requestIdleCallback === "function") {
200
- const handle = idleWindow.requestIdleCallback(() => void start(), { timeout: 2e3 });
201
- cleanups.push(() => _optionalChain([idleWindow, 'access', _15 => _15.cancelIdleCallback, 'optionalCall', _16 => _16(handle)]));
220
+ const handle = idleWindow.requestIdleCallback(callback, { timeout: 2e3 });
221
+ cleanups.push(() => _optionalChain([idleWindow, 'access', _24 => _24.cancelIdleCallback, 'optionalCall', _25 => _25(handle)]));
202
222
  } else {
203
- const handle = window.setTimeout(() => void start(), 1);
223
+ const handle = window.setTimeout(callback, 1);
204
224
  cleanups.push(() => window.clearTimeout(handle));
205
225
  }
206
226
  };
227
+ let idle = false;
228
+ const startWhenIdle = () => {
229
+ if (idle) return;
230
+ idle = true;
231
+ whenIdle(() => void start());
232
+ };
207
233
  const parsedVisible = [];
208
234
  const observeVisible = (island) => {
209
235
  const targets = island.getClientRects().length > 0 ? [island] : Array.from(island.children);
@@ -211,7 +237,7 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
211
237
  else for (const target of targets) visibility.observe(target);
212
238
  };
213
239
  const considerIsland = (island) => {
214
- if (_optionalChain([island, 'access', _17 => _17.parentElement, 'optionalAccess', _18 => _18.closest, 'call', _19 => _19(ISLAND)])) return;
240
+ if (_optionalChain([island, 'access', _26 => _26.parentElement, 'optionalAccess', _27 => _27.closest, 'call', _28 => _28(ISLAND)])) return;
215
241
  const strategy = island.getAttribute("strategy");
216
242
  if (strategy === "interaction") return;
217
243
  if (strategy === "idle") startWhenIdle();
@@ -234,7 +260,7 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
234
260
  consider(document.documentElement);
235
261
  if (rootId && !root) void start();
236
262
  else if (root && !loading) {
237
- const strategy = _optionalChain([script, 'optionalAccess', _20 => _20.dataset, 'access', _21 => _21.farmRootStrategy]);
263
+ const strategy = _optionalChain([script, 'optionalAccess', _29 => _29.dataset, 'access', _30 => _30.farmRootStrategy]);
238
264
  if (strategy === "idle") startWhenIdle();
239
265
  else if (strategy === "visible") observeVisible(root);
240
266
  else if (strategy !== "interaction") void start();
@@ -256,10 +282,24 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
256
282
  document.removeEventListener("DOMContentLoaded", parsed);
257
283
  });
258
284
  }
285
+ const prefetch = () => {
286
+ const connection = navigator.connection;
287
+ if (loading || !_optionalChain([script, 'optionalAccess', _31 => _31.dataset, 'access', _32 => _32.farmRuntime]) || _optionalChain([connection, 'optionalAccess', _33 => _33.saveData])) return;
288
+ modulepreload(runtime.href);
289
+ preload("farmPreload");
290
+ preload("farmPreloadRouter");
291
+ };
292
+ const prefetchWhenIdle = () => whenIdle(prefetch);
293
+ if (document.readyState === "complete") prefetchWhenIdle();
294
+ else {
295
+ window.addEventListener("load", prefetchWhenIdle, { once: true });
296
+ cleanups.push(() => window.removeEventListener("load", prefetchWhenIdle));
297
+ }
259
298
  }
260
299
 
261
300
 
262
301
 
263
302
 
264
303
 
265
- exports.FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER = FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER; exports.FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR = FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR; exports.FARM_ISLANDS_BOOT_VISIBLE_MARGIN = FARM_ISLANDS_BOOT_VISIBLE_MARGIN; exports.startFarmIslandsBoot = startFarmIslandsBoot;
304
+
305
+ exports.FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER = FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER; exports.FARM_ISLANDS_BOOT_PREFETCHING_LINK = FARM_ISLANDS_BOOT_PREFETCHING_LINK; exports.FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR = FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR; exports.FARM_ISLANDS_BOOT_VISIBLE_MARGIN = FARM_ISLANDS_BOOT_VISIBLE_MARGIN; exports.startFarmIslandsBoot = startFarmIslandsBoot;
@@ -3,8 +3,8 @@ declare const FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR = "button,[role=\"button\"],
3
3
  /** Kept equal to the island scheduler's visibility margin (island-triggers.ts). */
4
4
  declare const FARM_ISLANDS_BOOT_VISIBLE_MARGIN = "200px";
5
5
  /**
6
- * @internal The request for a link clicked before the runtime ran, which the boot sends with the
7
- * click (`window.__FARM_EARLY_NAVIGATION__`). The router's next navigation request takes the
6
+ * @internal The request for a link pressed or clicked before the runtime ran, which the boot sends
7
+ * then (`window.__FARM_EARLY_NAVIGATION__`). The router's next navigation request takes the
8
8
  * response when it would send the same request, and drops it otherwise.
9
9
  */
10
10
  interface FarmEarlyNavigation {
@@ -20,7 +20,9 @@ interface FarmEarlyNavigation {
20
20
  }
21
21
  /** Kept equal to the routers' deployment header (FARM_DEPLOYMENT_ID_HEADER); a test compares them. */
22
22
  declare const FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER = "x-farm-deployment-id";
23
+ /** A `Link` that prefetches, as its attributes say (resolveLinkAttributes); a test compares them. */
24
+ declare const FARM_ISLANDS_BOOT_PREFETCHING_LINK = "a[data-farm-link]:not([data-farm-prefetch=\"none\"])";
23
25
  /** Starts the runtime when the page first needs it. `load` runs it; it starts as it runs. */
24
26
  declare function startFarmIslandsBoot(load?: () => Promise<unknown>): void;
25
27
 
26
- export { FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER, FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR, FARM_ISLANDS_BOOT_VISIBLE_MARGIN, type FarmEarlyNavigation, startFarmIslandsBoot };
28
+ export { FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER, FARM_ISLANDS_BOOT_PREFETCHING_LINK, FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR, FARM_ISLANDS_BOOT_VISIBLE_MARGIN, type FarmEarlyNavigation, startFarmIslandsBoot };
@@ -3,8 +3,8 @@ declare const FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR = "button,[role=\"button\"],
3
3
  /** Kept equal to the island scheduler's visibility margin (island-triggers.ts). */
4
4
  declare const FARM_ISLANDS_BOOT_VISIBLE_MARGIN = "200px";
5
5
  /**
6
- * @internal The request for a link clicked before the runtime ran, which the boot sends with the
7
- * click (`window.__FARM_EARLY_NAVIGATION__`). The router's next navigation request takes the
6
+ * @internal The request for a link pressed or clicked before the runtime ran, which the boot sends
7
+ * then (`window.__FARM_EARLY_NAVIGATION__`). The router's next navigation request takes the
8
8
  * response when it would send the same request, and drops it otherwise.
9
9
  */
10
10
  interface FarmEarlyNavigation {
@@ -20,7 +20,9 @@ interface FarmEarlyNavigation {
20
20
  }
21
21
  /** Kept equal to the routers' deployment header (FARM_DEPLOYMENT_ID_HEADER); a test compares them. */
22
22
  declare const FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER = "x-farm-deployment-id";
23
+ /** A `Link` that prefetches, as its attributes say (resolveLinkAttributes); a test compares them. */
24
+ declare const FARM_ISLANDS_BOOT_PREFETCHING_LINK = "a[data-farm-link]:not([data-farm-prefetch=\"none\"])";
23
25
  /** Starts the runtime when the page first needs it. `load` runs it; it starts as it runs. */
24
26
  declare function startFarmIslandsBoot(load?: () => Promise<unknown>): void;
25
27
 
26
- export { FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER, FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR, FARM_ISLANDS_BOOT_VISIBLE_MARGIN, type FarmEarlyNavigation, startFarmIslandsBoot };
28
+ export { FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER, FARM_ISLANDS_BOOT_PREFETCHING_LINK, FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR, FARM_ISLANDS_BOOT_VISIBLE_MARGIN, type FarmEarlyNavigation, startFarmIslandsBoot };
@@ -4,6 +4,7 @@ import "../chunk-TIZJYHB7.mjs";
4
4
  var FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR = 'button,[role="button"],input[type="button"],input[type="submit"],input[type="reset"]';
5
5
  var FARM_ISLANDS_BOOT_VISIBLE_MARGIN = "200px";
6
6
  var FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER = "x-farm-deployment-id";
7
+ var FARM_ISLANDS_BOOT_PREFETCHING_LINK = 'a[data-farm-link]:not([data-farm-prefetch="none"])';
7
8
  var ISLAND = "f-island";
8
9
  var HYDRATED_ISLAND = '[data-farm-island-hydrated="true"]';
9
10
  function submitsForm(target, kind) {
@@ -60,18 +61,19 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
60
61
  const rootId = script?.dataset.farmRoot;
61
62
  const root = rootId ? document.getElementById(rootId) : null;
62
63
  const preloaded = /* @__PURE__ */ new Set();
64
+ const runtime = new URL(script?.dataset.farmRuntime ?? "", document.baseURI);
65
+ const modulepreload = (file) => {
66
+ const link = document.createElement("link");
67
+ link.rel = "modulepreload";
68
+ link.href = new URL(file, runtime).href;
69
+ if (script?.nonce) link.nonce = script.nonce;
70
+ document.head.append(link);
71
+ };
63
72
  const preload = (group) => {
64
73
  const files = script?.dataset[group];
65
74
  if (!script || !files || preloaded.has(group)) return;
66
75
  preloaded.add(group);
67
- const base = new URL(script.dataset.farmRuntime ?? "", document.baseURI);
68
- for (const file of files.split(" ")) {
69
- const link = document.createElement("link");
70
- link.rel = "modulepreload";
71
- link.href = new URL(file, base).href;
72
- if (script.nonce) link.nonce = script.nonce;
73
- document.head.append(link);
74
- }
76
+ for (const file of files.split(" ")) modulepreload(file);
75
77
  };
76
78
  const release = () => {
77
79
  for (const cleanup of cleanups.splice(0)) cleanup();
@@ -144,16 +146,25 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
144
146
  };
145
147
  for (const type of ["pointerdown", "focusin", "mouseover"]) listen(type, observe, true);
146
148
  const requestPage = (href) => {
149
+ const scope = window;
150
+ const early = scope.__FARM_EARLY_NAVIGATION__;
151
+ if (early?.url === href && Date.now() - early.at <= 3e4) return;
152
+ early?.controller.abort();
147
153
  const headers = { accept: "text/html" };
154
+ const content = document.getElementById("root") ?? document.body;
155
+ const held = new Set(
156
+ Array.from(
157
+ content.querySelectorAll('script[type="f/value"][name]'),
158
+ (value) => value.getAttribute("name")
159
+ )
160
+ );
161
+ if (held.size) headers["f-values"] = [...held].slice(-128).join(",");
148
162
  const layouts = Array.from(
149
- (document.getElementById("root") ?? document.body).querySelectorAll(
150
- '[data-farm-layout-boundary="true"]'
151
- ),
163
+ content.querySelectorAll('[data-farm-layout-boundary="true"]'),
152
164
  (boundary) => boundary.getAttribute("data-farm-layout-key") || boundary.getAttribute("data-farm-layout-pattern")
153
165
  ).filter(Boolean);
154
166
  if (layouts.length) headers["f-layouts"] = JSON.stringify(layouts);
155
167
  if (rootId !== "root") headers["f-stream"] = "flush";
156
- const scope = window;
157
168
  if (scope.__FARM_DEPLOYMENT_ID__) {
158
169
  headers[FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER] = scope.__FARM_DEPLOYMENT_ID__;
159
170
  }
@@ -163,6 +174,18 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
163
174
  });
164
175
  scope.__FARM_EARLY_NAVIGATION__ = { url: href, headers, response, at: Date.now(), controller };
165
176
  };
177
+ listen(
178
+ "pointerdown",
179
+ (event) => {
180
+ const press = event;
181
+ const anchor = routedLink(press.target);
182
+ if (press.button || isModified(press) || !anchor?.matches(FARM_ISLANDS_BOOT_PREFETCHING_LINK)) {
183
+ return;
184
+ }
185
+ requestPage(anchor.href);
186
+ },
187
+ true
188
+ );
166
189
  listen(
167
190
  "click",
168
191
  (event) => {
@@ -191,19 +214,22 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
191
214
  { rootMargin: FARM_ISLANDS_BOOT_VISIBLE_MARGIN }
192
215
  ) : null;
193
216
  if (visibility) cleanups.push(() => visibility.disconnect());
194
- let idle = false;
195
- const startWhenIdle = () => {
196
- if (idle) return;
197
- idle = true;
217
+ const whenIdle = (callback) => {
198
218
  const idleWindow = window;
199
219
  if (typeof idleWindow.requestIdleCallback === "function") {
200
- const handle = idleWindow.requestIdleCallback(() => void start(), { timeout: 2e3 });
220
+ const handle = idleWindow.requestIdleCallback(callback, { timeout: 2e3 });
201
221
  cleanups.push(() => idleWindow.cancelIdleCallback?.(handle));
202
222
  } else {
203
- const handle = window.setTimeout(() => void start(), 1);
223
+ const handle = window.setTimeout(callback, 1);
204
224
  cleanups.push(() => window.clearTimeout(handle));
205
225
  }
206
226
  };
227
+ let idle = false;
228
+ const startWhenIdle = () => {
229
+ if (idle) return;
230
+ idle = true;
231
+ whenIdle(() => void start());
232
+ };
207
233
  const parsedVisible = [];
208
234
  const observeVisible = (island) => {
209
235
  const targets = island.getClientRects().length > 0 ? [island] : Array.from(island.children);
@@ -256,9 +282,23 @@ function startFarmIslandsBoot(load = loadFarmClientEntry) {
256
282
  document.removeEventListener("DOMContentLoaded", parsed);
257
283
  });
258
284
  }
285
+ const prefetch = () => {
286
+ const connection = navigator.connection;
287
+ if (loading || !script?.dataset.farmRuntime || connection?.saveData) return;
288
+ modulepreload(runtime.href);
289
+ preload("farmPreload");
290
+ preload("farmPreloadRouter");
291
+ };
292
+ const prefetchWhenIdle = () => whenIdle(prefetch);
293
+ if (document.readyState === "complete") prefetchWhenIdle();
294
+ else {
295
+ window.addEventListener("load", prefetchWhenIdle, { once: true });
296
+ cleanups.push(() => window.removeEventListener("load", prefetchWhenIdle));
297
+ }
259
298
  }
260
299
  export {
261
300
  FARM_ISLANDS_BOOT_DEPLOYMENT_HEADER,
301
+ FARM_ISLANDS_BOOT_PREFETCHING_LINK,
262
302
  FARM_ISLANDS_BOOT_REPLAYABLE_SELECTOR,
263
303
  FARM_ISLANDS_BOOT_VISIBLE_MARGIN,
264
304
  startFarmIslandsBoot
@@ -1,21 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
-
4
-
5
- var _chunkEX6ZSN5Pcjs = require('../chunk-EX6ZSN5P.cjs');
3
+ var _chunk5MMKNW7Qcjs = require('../chunk-5MMKNW7Q.cjs');
4
+ require('../chunk-EX6ZSN5P.cjs');
6
5
  require('../chunk-I2BYNELA.cjs');
7
6
  require('../chunk-MPU5DOXX.cjs');
8
-
9
-
10
- var _chunkCKPTIEDXcjs = require('../chunk-CKPTIEDX.cjs');
7
+ require('../chunk-CKPTIEDX.cjs');
11
8
 
12
9
 
13
10
 
14
- var _chunkCQL5ZGFUcjs = require('../chunk-CQL5ZGFU.cjs');
11
+ var _chunkC5QHZ626cjs = require('../chunk-C5QHZ626.cjs');
15
12
  require('../chunk-DXUXQP2T.cjs');
16
-
17
-
18
- var _chunkUZCMMJJTcjs = require('../chunk-UZCMMJJT.cjs');
13
+ require('../chunk-UZCMMJJT.cjs');
19
14
  require('../chunk-UZM3PDKK.cjs');
20
15
 
21
16
  // src/client/islands-runtime.ts
@@ -25,47 +20,6 @@ require('../chunk-UZM3PDKK.cjs');
25
20
 
26
21
 
27
22
  var _client = require('@farm.js/islx/client');
28
-
29
- // src/islands-action-client.ts
30
- function createFarmServerFnTransportError(value) {
31
- const failure = value;
32
- const error = new Error(
33
- failure && typeof failure.message === "string" ? failure.message : "Server function failed"
34
- );
35
- if (failure && failure.name === "ServerFnFailure" && typeof failure.code === "string" && Number.isInteger(failure.status) && failure.status >= 400 && failure.status <= 599 && Object.prototype.hasOwnProperty.call(failure, "data")) {
36
- error.name = "ServerFnFailure";
37
- error.code = failure.code;
38
- error.status = failure.status;
39
- error.data = failure.data;
40
- Object.defineProperty(error, /* @__PURE__ */ Symbol.for("farm.server-fn.failure"), {
41
- value: true,
42
- enumerable: false
43
- });
44
- return error;
45
- }
46
- error.name = "ServerActionError";
47
- return error;
48
- }
49
- var farmIslandsActionInterceptor = async (call, next) => {
50
- const invocation = _chunkEX6ZSN5Pcjs.beginFarmServerQueryAction.call(void 0, call.id, call.args);
51
- let result;
52
- try {
53
- result = await next();
54
- } catch (error2) {
55
- if (error2 instanceof Error && error2.message.startsWith("Server action failed")) {
56
- throw createFarmServerFnTransportError(void 0);
57
- }
58
- throw error2;
59
- }
60
- if (!_chunkCKPTIEDXcjs.isFarmIslandsActionResult.call(void 0, result)) return result;
61
- const { invalidations, error } = result.__farmAction;
62
- if (_chunkEX6ZSN5Pcjs.shouldApplyFarmServerQueryActionResult.call(void 0, invocation))
63
- _chunkUZCMMJJTcjs.applyFarmCacheInvalidations.call(void 0, invalidations);
64
- if (error) throw createFarmServerFnTransportError(error);
65
- return _chunkEX6ZSN5Pcjs.completeFarmServerQueryAction.call(void 0, invocation, result.value);
66
- };
67
-
68
- // src/client/islands-runtime.ts
69
23
  var _react = require('react'); var React = _interopRequireWildcard(_react);
70
24
 
71
25
 
@@ -82,7 +36,7 @@ var _react2 = require('@farm.js/islx/react');
82
36
 
83
37
  var _client3 = require('@farm.js/islx/react/client');
84
38
  var HYDRATED_ATTRIBUTE = "data-farm-hydrated";
85
- var HYDRATED_ISLAND_SELECTOR = `${_chunkCQL5ZGFUcjs.FARM_ISLAND_ELEMENT}[${HYDRATED_ATTRIBUTE}]`;
39
+ var HYDRATED_ISLAND_SELECTOR = `${_chunkC5QHZ626cjs.FARM_ISLAND_ELEMENT}[${HYDRATED_ATTRIBUTE}]`;
86
40
  function createFarmIsolatedHydrationRuntime(options) {
87
41
  const runtime = _client3.createHydrationRuntime.call(void 0, {
88
42
  load: options.load,
@@ -91,7 +45,7 @@ function createFarmIsolatedHydrationRuntime(options) {
91
45
  report: options.report
92
46
  });
93
47
  const router = () => window.__FARM_SPA_ROUTER__;
94
- _client.setActionInterceptor.call(void 0, farmIslandsActionInterceptor);
48
+ _client.setActionInterceptor.call(void 0, _chunk5MMKNW7Qcjs.farmIslandsActionInterceptor);
95
49
  _client.setActionNavigator.call(void 0, {
96
50
  refresh: () => _optionalChain([router, 'call', _ => _(), 'optionalAccess', _2 => _2.refresh, 'optionalCall', _3 => _3({ scroll: false })]),
97
51
  navigate: (href) => {
@@ -145,7 +99,7 @@ function renderFarmServerTreePage(_React, element, options) {
145
99
  isolate: options.isolate,
146
100
  payloadOnly: options.payloadOnly,
147
101
  // The values this request's browser holds (Farm's request store).
148
- held: _nullishCoalesce(_optionalChain([_chunkCQL5ZGFUcjs.getFarmIslandValuesServer.call(void 0, ), 'optionalAccess', _13 => _13.held, 'call', _14 => _14()]), () => ( null))
102
+ held: _nullishCoalesce(_optionalChain([_chunkC5QHZ626cjs.getFarmIslandValuesServer.call(void 0, ), 'optionalAccess', _13 => _13.held, 'call', _14 => _14()]), () => ( null))
149
103
  });
150
104
  }
151
105
  function createFarmServerTreeElement(_React, source, options) {
@@ -164,7 +118,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets, scope) {
164
118
  isolate: _react2.isolateIslands,
165
119
  outlets,
166
120
  scope,
167
- held: _nullishCoalesce(_optionalChain([_chunkCQL5ZGFUcjs.getFarmIslandValuesServer.call(void 0, ), 'optionalAccess', _15 => _15.held, 'call', _16 => _16()]), () => ( null))
121
+ held: _nullishCoalesce(_optionalChain([_chunkC5QHZ626cjs.getFarmIslandValuesServer.call(void 0, ), 'optionalAccess', _15 => _15.held, 'call', _16 => _16()]), () => ( null))
168
122
  });
169
123
  }
170
124
  function createFarmServerTreeLayout(_React, source, scope, options) {
@@ -173,7 +127,7 @@ function createFarmServerTreeLayout(_React, source, scope, options) {
173
127
  function withFarmIslandsRender(element) {
174
128
  return React.createElement(
175
129
  _react2.IslandsProvider,
176
- { held: _nullishCoalesce(_optionalChain([_chunkCQL5ZGFUcjs.getFarmIslandValuesServer.call(void 0, ), 'optionalAccess', _17 => _17.held, 'call', _18 => _18()]), () => ( null)) },
130
+ { held: _nullishCoalesce(_optionalChain([_chunkC5QHZ626cjs.getFarmIslandValuesServer.call(void 0, ), 'optionalAccess', _17 => _17.held, 'call', _18 => _18()]), () => ( null)) },
177
131
  element
178
132
  );
179
133
  }
@@ -1,21 +1,16 @@
1
1
  import {
2
- beginFarmServerQueryAction,
3
- completeFarmServerQueryAction,
4
- shouldApplyFarmServerQueryActionResult
5
- } from "../chunk-XMHERKSE.mjs";
2
+ farmIslandsActionInterceptor
3
+ } from "../chunk-I4WZRG73.mjs";
4
+ import "../chunk-XMHERKSE.mjs";
6
5
  import "../chunk-C64XOPBZ.mjs";
7
6
  import "../chunk-N7XWC6BN.mjs";
8
- import {
9
- isFarmIslandsActionResult
10
- } from "../chunk-X3EFRVXY.mjs";
7
+ import "../chunk-X3EFRVXY.mjs";
11
8
  import {
12
9
  FARM_ISLAND_ELEMENT,
13
10
  getFarmIslandValuesServer
14
- } from "../chunk-NBIVGHAT.mjs";
11
+ } from "../chunk-UDMBUTJD.mjs";
15
12
  import "../chunk-GLOICKDO.mjs";
16
- import {
17
- applyFarmCacheInvalidations
18
- } from "../chunk-AZQXXXDX.mjs";
13
+ import "../chunk-AZQXXXDX.mjs";
19
14
  import "../chunk-TIZJYHB7.mjs";
20
15
 
21
16
  // src/client/islands-runtime.ts
@@ -25,47 +20,6 @@ import {
25
20
  setActionInterceptor,
26
21
  setActionNavigator
27
22
  } from "@farm.js/islx/client";
28
-
29
- // src/islands-action-client.ts
30
- function createFarmServerFnTransportError(value) {
31
- const failure = value;
32
- const error = new Error(
33
- failure && typeof failure.message === "string" ? failure.message : "Server function failed"
34
- );
35
- if (failure && failure.name === "ServerFnFailure" && typeof failure.code === "string" && Number.isInteger(failure.status) && failure.status >= 400 && failure.status <= 599 && Object.prototype.hasOwnProperty.call(failure, "data")) {
36
- error.name = "ServerFnFailure";
37
- error.code = failure.code;
38
- error.status = failure.status;
39
- error.data = failure.data;
40
- Object.defineProperty(error, /* @__PURE__ */ Symbol.for("farm.server-fn.failure"), {
41
- value: true,
42
- enumerable: false
43
- });
44
- return error;
45
- }
46
- error.name = "ServerActionError";
47
- return error;
48
- }
49
- var farmIslandsActionInterceptor = async (call, next) => {
50
- const invocation = beginFarmServerQueryAction(call.id, call.args);
51
- let result;
52
- try {
53
- result = await next();
54
- } catch (error2) {
55
- if (error2 instanceof Error && error2.message.startsWith("Server action failed")) {
56
- throw createFarmServerFnTransportError(void 0);
57
- }
58
- throw error2;
59
- }
60
- if (!isFarmIslandsActionResult(result)) return result;
61
- const { invalidations, error } = result.__farmAction;
62
- if (shouldApplyFarmServerQueryActionResult(invocation))
63
- applyFarmCacheInvalidations(invalidations);
64
- if (error) throw createFarmServerFnTransportError(error);
65
- return completeFarmServerQueryAction(invocation, result.value);
66
- };
67
-
68
- // src/client/islands-runtime.ts
69
23
  import * as React from "react";
70
24
  import {
71
25
  IslandsProvider,
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk52LTENREcjs = require('../chunk-52LTENRE.cjs');
4
- require('../chunk-TVCFY3KK.cjs');
5
- require('../chunk-CQL5ZGFU.cjs');
3
+ var _chunkWOAXQ5MZcjs = require('../chunk-WOAXQ5MZ.cjs');
4
+ require('../chunk-FB4CWSC2.cjs');
5
+ require('../chunk-C5QHZ626.cjs');
6
6
  require('../chunk-3BIASUGR.cjs');
7
7
  require('../chunk-UZM3PDKK.cjs');
8
8
 
9
9
  // src/client/islands-server.ts
10
10
  var _server = require('@farm.js/islx/react/server');
11
11
  function installFarmIslandsServer() {
12
- _server.setRenderStateResolver.call(void 0, _chunk52LTENREcjs.resolveFarmIslandRenderState);
12
+ _server.setRenderStateResolver.call(void 0, _chunkWOAXQ5MZcjs.resolveFarmIslandRenderState);
13
13
  }
14
14
 
15
15
 
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  resolveFarmIslandRenderState
3
- } from "../chunk-7KDCVSTR.mjs";
4
- import "../chunk-MNIR7I7B.mjs";
5
- import "../chunk-NBIVGHAT.mjs";
3
+ } from "../chunk-2PFGA6PB.mjs";
4
+ import "../chunk-INKVDO42.mjs";
5
+ import "../chunk-UDMBUTJD.mjs";
6
6
  import "../chunk-VIXTAVEA.mjs";
7
7
  import "../chunk-TIZJYHB7.mjs";
8
8
 
@@ -0,0 +1,36 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+ var _chunk5MMKNW7Qcjs = require('../chunk-5MMKNW7Q.cjs');
4
+ require('../chunk-EX6ZSN5P.cjs');
5
+ require('../chunk-I2BYNELA.cjs');
6
+ require('../chunk-MPU5DOXX.cjs');
7
+ require('../chunk-CKPTIEDX.cjs');
8
+ require('../chunk-DXUXQP2T.cjs');
9
+ require('../chunk-UZCMMJJT.cjs');
10
+ require('../chunk-UZM3PDKK.cjs');
11
+
12
+ // src/islx/actions-client.ts
13
+
14
+
15
+
16
+
17
+ var _client = require('@farm.js/islx/client');
18
+ var installed = false;
19
+ function installActions() {
20
+ if (installed) return;
21
+ installed = true;
22
+ _client.setActionInterceptor.call(void 0, _chunk5MMKNW7Qcjs.farmIslandsActionInterceptor);
23
+ _client.setActionNavigator.call(void 0, {
24
+ navigate(href) {
25
+ const router = window.__FARM_SPA_ROUTER__;
26
+ return _optionalChain([router, 'optionalAccess', _ => _.navigate]) ? router.navigate(href) : location.assign(href);
27
+ }
28
+ });
29
+ }
30
+ function createServerReference(...args) {
31
+ installActions();
32
+ return _client.createServerReference.call(void 0, ...args);
33
+ }
34
+
35
+
36
+ exports.createServerReference = createServerReference;
@@ -0,0 +1,13 @@
1
+ import { createServerReference as createServerReference$1 } from '@farm.js/islx/client';
2
+
3
+ /**
4
+ * @internal The browser side of server functions in apps whose renderer is not React (see
5
+ * `resolveFarmIslxActionsMode`). A browser module's import of a server function becomes a reference
6
+ * made here, and calling it posts the call to the page. Server queries fill and invalidate Farm's
7
+ * query cache as they do in islands mode, and a redirect from an action navigates on the client.
8
+ * Nothing here imports React.
9
+ */
10
+
11
+ declare function createServerReference(...args: Parameters<typeof createServerReference$1>): ReturnType<typeof createServerReference$1>;
12
+
13
+ export { createServerReference };
@@ -0,0 +1,13 @@
1
+ import { createServerReference as createServerReference$1 } from '@farm.js/islx/client';
2
+
3
+ /**
4
+ * @internal The browser side of server functions in apps whose renderer is not React (see
5
+ * `resolveFarmIslxActionsMode`). A browser module's import of a server function becomes a reference
6
+ * made here, and calling it posts the call to the page. Server queries fill and invalidate Farm's
7
+ * query cache as they do in islands mode, and a redirect from an action navigates on the client.
8
+ * Nothing here imports React.
9
+ */
10
+
11
+ declare function createServerReference(...args: Parameters<typeof createServerReference$1>): ReturnType<typeof createServerReference$1>;
12
+
13
+ export { createServerReference };