@farm.js/core 0.1.85 → 0.1.87

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 (242) hide show
  1. package/dist/{agent-mcp.d-7uKdOttc.d.ts → agent-mcp.d-BdM0pIrD.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-LChlR2au.d.mts → agent-mcp.d-CMGqpUbk.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +1 -1
  4. package/dist/agent-runtime.d.ts +1 -1
  5. package/dist/analyzer-LLU2Z6I4.cjs +17 -0
  6. package/dist/{analyzer-R6KNJ6IO.mjs → analyzer-W4EB7DHL.mjs} +2 -2
  7. package/dist/api/node.d.mts +3 -3
  8. package/dist/api/node.d.ts +3 -3
  9. package/dist/api/route-manager.cjs +3 -3
  10. package/dist/api/route-manager.d.mts +3 -3
  11. package/dist/api/route-manager.d.ts +3 -3
  12. package/dist/api/route-manager.mjs +2 -2
  13. package/dist/api/runtime.d.mts +2 -2
  14. package/dist/api/runtime.d.ts +2 -2
  15. package/dist/api.cjs +4 -4
  16. package/dist/api.d.mts +4 -4
  17. package/dist/api.d.ts +4 -4
  18. package/dist/api.mjs +3 -3
  19. package/dist/{app-manifest.d-QMdmqqCr.d.mts → app-manifest.d-BeDB2OVm.d.mts} +1 -1
  20. package/dist/{app-manifest.d-CRp21oAz.d.ts → app-manifest.d-COhjPgHn.d.ts} +1 -1
  21. package/dist/app-markdown.d.mts +2 -2
  22. package/dist/app-markdown.d.ts +2 -2
  23. package/dist/{app.d-Bvpc2eJq.d.mts → app.d-AVZXCfcO.d.mts} +5 -4
  24. package/dist/{app.d-DEKpJEp4.d.ts → app.d-b3A4cca5.d.ts} +5 -4
  25. package/dist/{chunk-3TCFONUE.mjs → chunk-26HESRBL.mjs} +60 -11
  26. package/dist/chunk-2HTNASSB.cjs +134 -0
  27. package/dist/{chunk-RVJQHQCG.cjs → chunk-33WR5XV5.cjs} +4 -4
  28. package/dist/{chunk-J7VIXTPQ.mjs → chunk-3F55K4MC.mjs} +1 -1
  29. package/dist/{chunk-YX532KEF.mjs → chunk-4FGTNYHE.mjs} +2 -2
  30. package/dist/{chunk-MYSH5Y4E.mjs → chunk-4IE3YK7U.mjs} +1 -1
  31. package/dist/{chunk-CWUQBECF.mjs → chunk-4SJ22WTT.mjs} +1 -1
  32. package/dist/{chunk-YS647ASS.mjs → chunk-5D73SKF3.mjs} +1 -1
  33. package/dist/{chunk-Q7GB3I4O.cjs → chunk-7BNVUIGL.cjs} +2 -2
  34. package/dist/{chunk-2DMOB6BH.mjs → chunk-A2PPQ5LB.mjs} +3 -3
  35. package/dist/{chunk-4QCMTIBM.mjs → chunk-ALOFMAFA.mjs} +11 -5
  36. package/dist/{chunk-HKJIUZS5.cjs → chunk-CXHVRHM2.cjs} +2 -2
  37. package/dist/{chunk-3RVLJTFZ.mjs → chunk-D7LXBLUW.mjs} +1 -1
  38. package/dist/{chunk-GFVPQ25Z.mjs → chunk-EZYNIADW.mjs} +65 -39
  39. package/dist/{chunk-NAHDG6UX.mjs → chunk-HFRG2IQS.mjs} +1 -1
  40. package/dist/{chunk-BCCCPFHQ.mjs → chunk-HV6CYSMF.mjs} +3 -0
  41. package/dist/{chunk-7H2TXT2K.mjs → chunk-HX5HLFBZ.mjs} +7 -0
  42. package/dist/{chunk-3HWNYLQV.cjs → chunk-HYL372GW.cjs} +1 -1
  43. package/dist/{chunk-25JGHAGH.cjs → chunk-I2RBHZF7.cjs} +15 -8
  44. package/dist/{chunk-BZN5HX7Y.cjs → chunk-IM422XKU.cjs} +2 -2
  45. package/dist/{chunk-6QYPP5KC.mjs → chunk-K5FLQJW5.mjs} +2 -2
  46. package/dist/chunk-K6RMOB25.mjs +134 -0
  47. package/dist/{chunk-CDZ55QRD.mjs → chunk-LBJOHMTB.mjs} +1 -1
  48. package/dist/{chunk-U6HUVY5R.mjs → chunk-LIWVPE72.mjs} +61 -23
  49. package/dist/{chunk-BBX4RPOV.cjs → chunk-MZR22RAC.cjs} +17 -11
  50. package/dist/chunk-NDMPGFKL.cjs +47 -0
  51. package/dist/{chunk-YHM4PXJY.mjs → chunk-O5YM6GU3.mjs} +1 -1
  52. package/dist/{chunk-XIXAUXV3.mjs → chunk-O7K4HMAQ.mjs} +1 -1
  53. package/dist/{chunk-PQR5A7R2.mjs → chunk-Q73LRKLP.mjs} +1 -1
  54. package/dist/{chunk-X7RSOEMQ.mjs → chunk-QLRI2BX5.mjs} +94 -15
  55. package/dist/{chunk-Z3LOPHSO.mjs → chunk-QSDIJ45N.mjs} +1 -1
  56. package/dist/{chunk-QUHDVJMR.cjs → chunk-RGYS5OPL.cjs} +3 -3
  57. package/dist/{chunk-UEQC4ZLP.cjs → chunk-SDNYULFS.cjs} +385 -359
  58. package/dist/{chunk-3OKSEJ33.cjs → chunk-T7UC2ORA.cjs} +3 -0
  59. package/dist/chunk-TCGPBSVY.mjs +47 -0
  60. package/dist/{chunk-H6C45DCF.cjs → chunk-TI4BZV6M.cjs} +393 -314
  61. package/dist/{chunk-OYM6VJEF.cjs → chunk-U3A46QFD.cjs} +140 -91
  62. package/dist/{chunk-VGHDPEPQ.cjs → chunk-UA77C2ZA.cjs} +2 -2
  63. package/dist/{chunk-U54REWMJ.cjs → chunk-VCI776NG.cjs} +13 -13
  64. package/dist/{chunk-WYTK7HQS.cjs → chunk-VCZ4EM5K.cjs} +391 -353
  65. package/dist/{chunk-F7JVO3OZ.cjs → chunk-VGZIIOU6.cjs} +4 -4
  66. package/dist/{chunk-5P65LXGU.cjs → chunk-WSQ3S3NV.cjs} +2 -2
  67. package/dist/{chunk-RQ6XX5IN.mjs → chunk-X2SMVPLH.mjs} +20 -4
  68. package/dist/{chunk-TOUC6BR3.cjs → chunk-XFUPWRKT.cjs} +4 -4
  69. package/dist/{chunk-DJ3PVHTW.cjs → chunk-XGPRM7OK.cjs} +3 -3
  70. package/dist/{chunk-L3BSHASB.cjs → chunk-XMVZXZ32.cjs} +4 -4
  71. package/dist/{chunk-L5HDCDFT.mjs → chunk-YNPVG2GG.mjs} +1 -1
  72. package/dist/{chunk-MAPHNGTF.cjs → chunk-Z43CIBUR.cjs} +21 -5
  73. package/dist/{chunk-7TPLDPNC.cjs → chunk-ZCX2XJPY.cjs} +10 -10
  74. package/dist/{chunk-GLNVLCUH.cjs → chunk-ZSVFI7JM.cjs} +6 -6
  75. package/dist/{cli-runtime.d-DaElKjaL.d.ts → cli-runtime.d-jqZ7YCsm.d.ts} +5 -5
  76. package/dist/{cli-runtime.d-C7aMfoTq.d.mts → cli-runtime.d-qL44rqYO.d.mts} +5 -5
  77. package/dist/{client-component.d-miqIXyQv.d.mts → client-component.d-B2L2LyAr.d.mts} +1 -1
  78. package/dist/{client-component.d-CZG02pIh.d.ts → client-component.d-BDD5aiUb.d.ts} +1 -1
  79. package/dist/{client-plugins.d-BVXjyIkY.d.ts → client-plugins.d-Crct3m_r.d.ts} +14 -5
  80. package/dist/{client-plugins.d-BwKwuO_0.d.mts → client-plugins.d-Dzc3vOw_.d.mts} +14 -5
  81. package/dist/client-plugins.d.mts +1 -1
  82. package/dist/client-plugins.d.ts +1 -1
  83. package/dist/client.d.mts +8 -7
  84. package/dist/client.d.ts +8 -7
  85. package/dist/config.d.mts +1 -1
  86. package/dist/config.d.ts +1 -1
  87. package/dist/desktop.d.mts +2 -2
  88. package/dist/desktop.d.ts +2 -2
  89. package/dist/{devtools-SXL5RFE5.cjs → devtools-GPIKZ5AV.cjs} +7 -5
  90. package/dist/{devtools-34ZQWX3M.mjs → devtools-GWJZPWIW.mjs} +5 -3
  91. package/dist/docs.cjs +7 -5
  92. package/dist/docs.d.mts +3 -3
  93. package/dist/docs.d.ts +3 -3
  94. package/dist/docs.mjs +6 -4
  95. package/dist/environment/vite.cjs +5 -5
  96. package/dist/environment/vite.mjs +4 -4
  97. package/dist/font.cjs +4 -2
  98. package/dist/font.d.mts +13 -1
  99. package/dist/font.d.ts +13 -1
  100. package/dist/font.mjs +3 -1
  101. package/dist/{handler.d-BKTWzzNA.d.mts → handler.d-B1S1ZBqS.d.mts} +1 -1
  102. package/dist/{handler.d-Dzpyg3-N.d.ts → handler.d-ZweCBJD4.d.ts} +1 -1
  103. package/dist/{headers.d-PZyXcDAH.d.ts → headers.d-BgBdQN8x.d.ts} +1 -1
  104. package/dist/{headers.d-5opjyhXw.d.mts → headers.d-C-yGl_f6.d.mts} +1 -1
  105. package/dist/image-attributes.d-BMPDQO1q.d.mts +55 -0
  106. package/dist/image-attributes.d-BMPDQO1q.d.ts +55 -0
  107. package/dist/image.cjs +5 -127
  108. package/dist/image.d.mts +3 -13
  109. package/dist/image.d.ts +3 -13
  110. package/dist/image.mjs +5 -127
  111. package/dist/index.cjs +28 -26
  112. package/dist/{index.d-C0Mie66f.d.mts → index.d-13h3oDu7.d.mts} +1 -1
  113. package/dist/{index.d-DV2q-0mE.d.ts → index.d-CtoniAXT.d.ts} +1 -1
  114. package/dist/index.d.mts +24 -23
  115. package/dist/index.d.ts +24 -23
  116. package/dist/index.mjs +27 -25
  117. package/dist/integrations/orm.d.mts +1 -1
  118. package/dist/integrations/orm.d.ts +1 -1
  119. package/dist/integrations.d.mts +1 -1
  120. package/dist/integrations.d.ts +1 -1
  121. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  122. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  123. package/dist/internal/build-runtime.cjs +23 -23
  124. package/dist/internal/build-runtime.d.mts +4 -4
  125. package/dist/internal/build-runtime.d.ts +4 -4
  126. package/dist/internal/build-runtime.mjs +22 -22
  127. package/dist/internal/cli-runtime.cjs +9 -7
  128. package/dist/internal/cli-runtime.d.mts +7 -7
  129. package/dist/internal/cli-runtime.d.ts +7 -7
  130. package/dist/internal/cli-runtime.mjs +8 -6
  131. package/dist/internal/client-error-overlay.cjs +4 -4
  132. package/dist/internal/client-error-overlay.mjs +1 -1
  133. package/dist/internal/client-runtime.cjs +66 -40
  134. package/dist/internal/client-runtime.d.mts +6 -6
  135. package/dist/internal/client-runtime.d.ts +6 -6
  136. package/dist/internal/client-runtime.mjs +53 -27
  137. package/dist/internal/compression-runtime.d.mts +1 -1
  138. package/dist/internal/compression-runtime.d.ts +1 -1
  139. package/dist/internal/config-runtime.cjs +7 -5
  140. package/dist/internal/config-runtime.d.mts +3 -3
  141. package/dist/internal/config-runtime.d.ts +3 -3
  142. package/dist/internal/config-runtime.mjs +6 -4
  143. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  144. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  145. package/dist/internal/islands-boot.cjs +44 -16
  146. package/dist/internal/islands-boot.d.mts +3 -1
  147. package/dist/internal/islands-boot.d.ts +3 -1
  148. package/dist/internal/islands-boot.mjs +28 -0
  149. package/dist/internal/native-server-fns.cjs +4 -4
  150. package/dist/internal/native-server-fns.mjs +3 -3
  151. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  152. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  153. package/dist/internal/production-runtime.cjs +6 -6
  154. package/dist/internal/production-runtime.d.mts +10 -10
  155. package/dist/internal/production-runtime.d.ts +10 -10
  156. package/dist/internal/production-runtime.mjs +5 -5
  157. package/dist/internal/renderer-islands.cjs +35 -8
  158. package/dist/internal/renderer-islands.d.mts +9 -1
  159. package/dist/internal/renderer-islands.d.ts +9 -1
  160. package/dist/internal/renderer-islands.mjs +35 -8
  161. package/dist/internal/spa-router.d.mts +3 -3
  162. package/dist/internal/spa-router.d.ts +3 -3
  163. package/dist/internal/start-manifest.d.mts +1 -1
  164. package/dist/internal/start-manifest.d.ts +1 -1
  165. package/dist/{island-runtime.d-BA7EPo1v.d.ts → island-runtime.d-D2Mh5eTU.d.ts} +5 -1
  166. package/dist/{island-runtime.d-BBS_YUSX.d.mts → island-runtime.d-lrpEJlgg.d.mts} +5 -1
  167. package/dist/markdown.d.mts +1 -1
  168. package/dist/markdown.d.ts +1 -1
  169. package/dist/middleware.cjs +4 -4
  170. package/dist/middleware.d.mts +1 -1
  171. package/dist/middleware.d.ts +1 -1
  172. package/dist/middleware.mjs +3 -3
  173. package/dist/{mount.d-gWul1GA1.d.ts → mount.d-DyKlRR6z.d.ts} +1 -1
  174. package/dist/{mount.d-CZ_qL1iS.d.mts → mount.d-_6Un9wdK.d.mts} +1 -1
  175. package/dist/{navigation-delegate.d-BBTzhJLj.d.mts → navigation-delegate.d-ChfinbWB.d.mts} +1 -1
  176. package/dist/{navigation-delegate.d-BZsYEAet.d.ts → navigation-delegate.d-fMgELdAe.d.ts} +1 -1
  177. package/dist/navigation.d.mts +4 -4
  178. package/dist/navigation.d.ts +4 -4
  179. package/dist/{plugin-QOTAPTVV.mjs → plugin-EVKQZBNW.mjs} +1 -1
  180. package/dist/{plugin-3PT7I26P.cjs → plugin-MWO3G2XM.cjs} +2 -2
  181. package/dist/plugin.cjs +20 -20
  182. package/dist/plugin.d.mts +5 -5
  183. package/dist/plugin.d.ts +5 -5
  184. package/dist/plugin.mjs +19 -19
  185. package/dist/{render-plan.d-AaJsYPX-.d.ts → render-plan.d-D0FV9lDT.d.ts} +1 -1
  186. package/dist/{render-plan.d-bnWxS12w.d.mts → render-plan.d-DaM1NPnm.d.mts} +1 -1
  187. package/dist/renderer-client.cjs +6 -1
  188. package/dist/renderer-client.d.mts +6 -5
  189. package/dist/renderer-client.d.ts +6 -5
  190. package/dist/renderer-client.mjs +5 -0
  191. package/dist/renderer.cjs +4 -4
  192. package/dist/renderer.d.mts +10 -2
  193. package/dist/renderer.d.ts +10 -2
  194. package/dist/renderer.mjs +3 -3
  195. package/dist/{request.d-CAeitOG1.d.ts → request.d-CrXC7voZ.d.ts} +1 -1
  196. package/dist/{request.d-C2HOn3Hi.d.mts → request.d-DVSLilGx.d.mts} +1 -1
  197. package/dist/request.d.mts +2 -2
  198. package/dist/request.d.ts +2 -2
  199. package/dist/{route-rendering.d-CYA-ulnX.d.mts → route-rendering.d-CWi3UYtR.d.mts} +1 -1
  200. package/dist/{route-rendering.d-A1dIkUK5.d.ts → route-rendering.d-OfbM_rj8.d.ts} +1 -1
  201. package/dist/{router.d-A_Yt6jYz.d.ts → router.d-D5Mp7bpO.d.ts} +1 -1
  202. package/dist/{router.d-8lxnzlkr.d.mts → router.d-DrQ1QDFk.d.mts} +1 -1
  203. package/dist/routes.d.mts +1 -1
  204. package/dist/routes.d.ts +1 -1
  205. package/dist/{rsc-pipeline-MW2V3WEE.mjs → rsc-pipeline-KLMQU3YP.mjs} +7 -5
  206. package/dist/{rsc-pipeline-ESPGX4VX.cjs → rsc-pipeline-TQOSDWOU.cjs} +8 -6
  207. package/dist/{runtime-KGSOEMLT.mjs → runtime-BDPBO65S.mjs} +7 -5
  208. package/dist/{runtime-FCMLEBTX.cjs → runtime-CQSCRVZ7.cjs} +12 -10
  209. package/dist/{runtime.d-C_rZ9_DD.d.mts → runtime.d-BVj6apd0.d.mts} +1 -1
  210. package/dist/{runtime.d-BPyvWrgQ.d.ts → runtime.d-D7QYVJGO.d.ts} +1 -1
  211. package/dist/{server-components-status.d-BpxiEMQE.d.mts → server-components-status.d-BDVcxi0z.d.mts} +1 -1
  212. package/dist/{server-components-status.d-C2UEKJn7.d.ts → server-components-status.d-CfKDpmCH.d.ts} +1 -1
  213. package/dist/server-plugins.d.mts +3 -3
  214. package/dist/server-plugins.d.ts +3 -3
  215. package/dist/server.cjs +45 -45
  216. package/dist/server.d.mts +11 -11
  217. package/dist/server.d.ts +11 -11
  218. package/dist/server.mjs +21 -21
  219. package/dist/{spa-router.d-Cw5i_15e.d.ts → spa-router.d-BXxoU3Cv.d.ts} +2 -2
  220. package/dist/{spa-router.d-BD-6WX1R.d.mts → spa-router.d-CXgvy-7L.d.mts} +2 -2
  221. package/dist/{ssg.d-CCE9aob5.d.mts → ssg.d-DS-gXUbf.d.mts} +2 -2
  222. package/dist/{ssg.d-Bifiq0EL.d.ts → ssg.d-jXlUAKzg.d.ts} +2 -2
  223. package/dist/{store-core.d-BN2MxSG9.d.mts → store-core.d-CDbVAbTn.d.mts} +3 -2
  224. package/dist/{store-core.d-5tVn5vi1.d.ts → store-core.d-D00BsbnO.d.ts} +3 -2
  225. package/dist/testing.cjs +2 -2
  226. package/dist/testing.d.mts +1 -1
  227. package/dist/testing.d.ts +1 -1
  228. package/dist/testing.mjs +2 -2
  229. package/dist/{utils.d-BUjpSNIO.d.ts → utils.d-BODwBtkz.d.ts} +1 -1
  230. package/dist/{utils.d-wGPLeVbq.d.mts → utils.d-Cmj-fzds.d.mts} +1 -1
  231. package/dist/version.cjs +2 -2
  232. package/dist/version.mjs +1 -1
  233. package/dist/vite.cjs +25 -23
  234. package/dist/vite.d.mts +21 -7
  235. package/dist/vite.d.ts +21 -7
  236. package/dist/vite.mjs +24 -22
  237. package/package.json +2 -2
  238. package/dist/analyzer-XVY76XMM.cjs +0 -17
  239. package/dist/chunk-7EPYN7GW.cjs +0 -30
  240. package/dist/chunk-HZOMT5DY.mjs +0 -30
  241. package/dist/{chunk-4B6YJ5DS.cjs → chunk-4ZVKDHS6.cjs} +3 -3
  242. package/dist/{chunk-4EEAPBNV.mjs → chunk-PEQJ4UUT.mjs} +3 -3
@@ -0,0 +1,134 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
+
3
+
4
+
5
+
6
+
7
+ var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
8
+
9
+ // src/image-attributes.ts
10
+ var FALLBACK_CONFIG = {
11
+ provider: "auto",
12
+ path: _chunkMCSRMEQVcjs.DEFAULT_FARM_IMAGE_PATH,
13
+ deviceSizes: _chunkMCSRMEQVcjs.DEFAULT_FARM_IMAGE_DEVICE_SIZES,
14
+ imageSizes: _chunkMCSRMEQVcjs.DEFAULT_FARM_IMAGE_SIZES,
15
+ qualities: _chunkMCSRMEQVcjs.DEFAULT_FARM_IMAGE_QUALITIES,
16
+ formats: _chunkMCSRMEQVcjs.DEFAULT_FARM_IMAGE_FORMATS
17
+ };
18
+ function getImageConfig() {
19
+ return typeof __FARM_IMAGE_CONFIG__ !== "undefined" && __FARM_IMAGE_CONFIG__ ? __FARM_IMAGE_CONFIG__ : FALLBACK_CONFIG;
20
+ }
21
+ function defaultImageLoader(config) {
22
+ return ({ src, width, quality }) => {
23
+ const query = new URLSearchParams({
24
+ url: src,
25
+ w: String(width),
26
+ q: String(quality)
27
+ });
28
+ return `${config.path}?${query}`;
29
+ };
30
+ }
31
+ function getClosestQuality(quality, allowed) {
32
+ const requested = _nullishCoalesce(quality, () => ( 75));
33
+ return allowed.reduce(
34
+ (closest, candidate) => Math.abs(candidate - requested) < Math.abs(closest - requested) ? candidate : closest
35
+ );
36
+ }
37
+ function getCandidateWidths(config, width, sizes, fill) {
38
+ const allSizes = [.../* @__PURE__ */ new Set([...config.imageSizes, ...config.deviceSizes])].sort(
39
+ (left, right) => left - right
40
+ );
41
+ if (fill || sizes) {
42
+ const viewportPercentages = [..._nullishCoalesce(_optionalChain([sizes, 'optionalAccess', _ => _.matchAll, 'call', _2 => _2(/(^|\s)(\d{1,3})vw/g)]), () => ( []))].map(
43
+ (match) => Number(match[2])
44
+ );
45
+ if (viewportPercentages.length > 0) {
46
+ const smallestRatio = Math.min(...viewportPercentages) / 100;
47
+ const minimum = config.deviceSizes[0] * smallestRatio;
48
+ return { widths: allSizes.filter((candidate) => candidate >= minimum), descriptor: "w" };
49
+ }
50
+ return { widths: allSizes, descriptor: "w" };
51
+ }
52
+ if (!width) return { widths: config.deviceSizes.slice(), descriptor: "w" };
53
+ const requested = [width, width * 2];
54
+ const widths = requested.map(
55
+ (target) => _nullishCoalesce(allSizes.find((candidate) => candidate >= target), () => ( allSizes.at(-1)))
56
+ );
57
+ return { widths: [...new Set(widths)], descriptor: "x" };
58
+ }
59
+ function isStaticImageData(value) {
60
+ return typeof value === "object" && value !== null && typeof value.src === "string";
61
+ }
62
+ function shouldSkipOptimization(src, config) {
63
+ return config.provider === "none" || src.startsWith("data:") || src.startsWith("blob:") || /\.svg(?:$|[?#])/i.test(src);
64
+ }
65
+ function resolveImageAttributes(options) {
66
+ const {
67
+ src: srcInput,
68
+ alt,
69
+ width: widthInput,
70
+ height: heightInput,
71
+ fill = false,
72
+ quality: qualityInput,
73
+ sizes: sizesInput,
74
+ loading,
75
+ preload = false,
76
+ placeholder = "empty",
77
+ blurDataURL: blurDataURLInput,
78
+ unoptimized: unoptimizedInput = false,
79
+ loader: loaderInput,
80
+ style,
81
+ ...rest
82
+ } = options;
83
+ const config = getImageConfig();
84
+ const staticImage = isStaticImageData(srcInput) ? srcInput : void 0;
85
+ const src = typeof srcInput === "string" ? srcInput : srcInput.src;
86
+ const width = Number(_nullishCoalesce(widthInput, () => ( _optionalChain([staticImage, 'optionalAccess', _3 => _3.width])))) || void 0;
87
+ const height = Number(_nullishCoalesce(heightInput, () => ( _optionalChain([staticImage, 'optionalAccess', _4 => _4.height])))) || void 0;
88
+ const blurDataURL = _nullishCoalesce(blurDataURLInput, () => ( _optionalChain([staticImage, 'optionalAccess', _5 => _5.blurDataURL])));
89
+ if (!fill && (!width || !height)) {
90
+ throw new TypeError(
91
+ "Farm Image requires width and height unless src is a static import or fill is enabled"
92
+ );
93
+ }
94
+ if (fill && (widthInput !== void 0 || heightInput !== void 0)) {
95
+ throw new TypeError("Farm Image cannot use width or height together with fill");
96
+ }
97
+ if (placeholder === "blur" && !blurDataURL) {
98
+ throw new TypeError("Farm Image placeholder=blur requires a static import or blurDataURL");
99
+ }
100
+ const unoptimized = unoptimizedInput || shouldSkipOptimization(src, config);
101
+ const quality = getClosestQuality(qualityInput, config.qualities);
102
+ const loader = _nullishCoalesce(loaderInput, () => ( defaultImageLoader(config)));
103
+ const sizes = _nullishCoalesce(sizesInput, () => ( (fill ? "100vw" : void 0)));
104
+ const candidates = getCandidateWidths(config, width, sizes, fill);
105
+ const srcSet = unoptimized ? void 0 : candidates.widths.map((candidate, index) => {
106
+ const descriptor = candidates.descriptor === "w" ? `${candidate}w` : `${index + 1}x`;
107
+ return `${loader({ src, width: candidate, quality })} ${descriptor}`;
108
+ }).join(", ");
109
+ const renderedSrc = unoptimized ? src : loader({ src, width: _nullishCoalesce(_nullishCoalesce(candidates.widths.at(-1), () => ( width)), () => ( config.deviceSizes[0])), quality });
110
+ const fillStyle = fill ? { position: "absolute", inset: 0, width: "100%", height: "100%" } : void 0;
111
+ const placeholderStyle = placeholder === "blur" ? {
112
+ backgroundImage: `url("${blurDataURL}")`,
113
+ backgroundPosition: "50% 50%",
114
+ backgroundRepeat: "no-repeat",
115
+ backgroundSize: "cover"
116
+ } : void 0;
117
+ return {
118
+ ...rest,
119
+ alt,
120
+ src: renderedSrc,
121
+ srcSet,
122
+ sizes,
123
+ width: fill ? void 0 : width,
124
+ height: fill ? void 0 : height,
125
+ loading: preload ? "eager" : _nullishCoalesce(loading, () => ( "lazy")),
126
+ fetchPriority: preload ? "high" : rest.fetchPriority,
127
+ decoding: _nullishCoalesce(rest.decoding, () => ( "async")),
128
+ style: { ...fillStyle, ...placeholderStyle, ...style }
129
+ };
130
+ }
131
+
132
+
133
+
134
+ exports.resolveImageAttributes = resolveImageAttributes;
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
- var _chunkTOUC6BR3cjs = require('./chunk-TOUC6BR3.cjs');
3
+ var _chunkXFUPWRKTcjs = require('./chunk-XFUPWRKT.cjs');
4
4
 
5
5
 
6
6
 
@@ -354,7 +354,7 @@ function requestEvent(metadata, method, status, durationMs) {
354
354
  id: uuid(),
355
355
  requestId: metadata.id,
356
356
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
357
- route: routeTemplate(_chunkTOUC6BR3cjs.getFarmRouteLabel.call(void 0, metadata.route)),
357
+ route: routeTemplate(_chunkXFUPWRKTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
358
358
  ...metadata.path ? { path: metadata.path } : {},
359
359
  agent: metadata.agent,
360
360
  kind: "request",
@@ -410,7 +410,7 @@ function toolEvent(metadata, event, payloads) {
410
410
  id: uuid(),
411
411
  requestId: metadata.id,
412
412
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
413
- route: routeTemplate(_chunkTOUC6BR3cjs.getFarmRouteLabel.call(void 0, metadata.route)),
413
+ route: routeTemplate(_chunkXFUPWRKTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
414
414
  ...metadata.path ? { path: metadata.path } : {},
415
415
  agent: metadata.agent,
416
416
  kind: "mcp.tool",
@@ -496,7 +496,7 @@ async function receiveWebMCPReport(request, exporter, options, webmcp, waitUntil
496
496
  exporter.enqueue({
497
497
  id: uuid(),
498
498
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
499
- route: routeTemplate(_chunkTOUC6BR3cjs.getFarmRouteLabel.call(void 0, route)),
499
+ route: routeTemplate(_chunkXFUPWRKTcjs.getFarmRouteLabel.call(void 0, route)),
500
500
  ...path ? { path } : {},
501
501
  agent: _chunk2NOHVIJ3cjs.classifyFarmClient.call(void 0, request),
502
502
  kind: "mcp.tool",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readAliases,
3
3
  resolveFile
4
- } from "./chunk-CDZ55QRD.mjs";
4
+ } from "./chunk-LBJOHMTB.mjs";
5
5
  import {
6
6
  transformFarmServerFns
7
7
  } from "./chunk-GNZIAJGB.mjs";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-HR4N2K4V.mjs";
5
5
  import {
6
6
  normalizeFarmProductionSiteOrigin
7
- } from "./chunk-PQR5A7R2.mjs";
7
+ } from "./chunk-Q73LRKLP.mjs";
8
8
  import {
9
9
  resolveFarmAppManifestConfig
10
10
  } from "./chunk-SQ5O7I3L.mjs";
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-YT2ZMLXK.mjs";
30
30
  import {
31
31
  FARM_VERSION
32
- } from "./chunk-XIXAUXV3.mjs";
32
+ } from "./chunk-O7K4HMAQ.mjs";
33
33
  import {
34
34
  applyFarmBasePath
35
35
  } from "./chunk-SF3JB56B.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isExplicitFarmServerComponentsMode,
3
3
  resolveFarmServerComponentsMode
4
- } from "./chunk-BCCCPFHQ.mjs";
4
+ } from "./chunk-HV6CYSMF.mjs";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-U6GMCDRS.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createRouteTypeDeclarations,
3
3
  generateRouteTypes
4
- } from "./chunk-L5HDCDFT.mjs";
4
+ } from "./chunk-YNPVG2GG.mjs";
5
5
  import {
6
6
  APITypeGenerator
7
7
  } from "./chunk-HQ2VAJLW.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFarmRouteLabel
3
- } from "./chunk-YX532KEF.mjs";
3
+ } from "./chunk-4FGTNYHE.mjs";
4
4
  import {
5
5
  _classifyFarmMCPSession,
6
6
  _farmMCPClientSession,
@@ -18,14 +18,14 @@ var _chunkCCAUIBIScjs = require('./chunk-CCAUIBIS.cjs');
18
18
  var _chunkWMRGIQTAcjs = require('./chunk-WMRGIQTA.cjs');
19
19
 
20
20
 
21
- var _chunk3HWNYLQVcjs = require('./chunk-3HWNYLQV.cjs');
21
+ var _chunkHYL372GWcjs = require('./chunk-HYL372GW.cjs');
22
22
 
23
23
  // src/mobile/analyzer.ts
24
24
  var _crypto = require('crypto');
25
25
  var _fs = require('fs');
26
26
  var _promises = require('fs/promises');
27
27
  var _path = require('path'); var path = _interopRequireWildcard(_path);
28
- var ANALYZER_VERSION = `8:${_chunk3HWNYLQVcjs.FARM_VERSION}`;
28
+ var ANALYZER_VERSION = `8:${_chunkHYL372GWcjs.FARM_VERSION}`;
29
29
  var INTRINSIC_KINDS = {};
30
30
  for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
31
31
  INTRINSIC_KINDS[tag] = "View";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-RLEAVG6G.mjs";
4
4
  import {
5
5
  resolveDeployOutputPath
6
- } from "./chunk-4QCMTIBM.mjs";
6
+ } from "./chunk-ALOFMAFA.mjs";
7
7
  import {
8
8
  farmDesktopDevGuardPlugin,
9
9
  loadFarmReactPlugin
@@ -22,7 +22,7 @@ import {
22
22
  formatFarmRscBlockingMessage,
23
23
  inspectFarmServerComponents,
24
24
  resolveFarmRscCheckConfig
25
- } from "./chunk-MYSH5Y4E.mjs";
25
+ } from "./chunk-4IE3YK7U.mjs";
26
26
 
27
27
  // src/rsc-pipeline.ts
28
28
  import { readFileSync } from "fs";
@@ -217,7 +217,7 @@ async function resolveFarmRscServerPlugins(userConfig, config, root) {
217
217
  }
218
218
  async function configureFarmRscPlugins(config, command) {
219
219
  if (config.plugins.length === 0) return config;
220
- const { PluginManager } = await import("./plugin-QOTAPTVV.mjs");
220
+ const { PluginManager } = await import("./plugin-EVKQZBNW.mjs");
221
221
  const manager = new PluginManager({
222
222
  config,
223
223
  isDev: command === "serve",
@@ -16,6 +16,9 @@ import {
16
16
  import {
17
17
  resolveFarmDevtoolsConfig
18
18
  } from "./chunk-CU5SYTJG.mjs";
19
+ import {
20
+ resolveFarmRendererServerComponentsIslands
21
+ } from "./chunk-X2SMVPLH.mjs";
19
22
  import {
20
23
  resolveFarmAgentCrawlers,
21
24
  resolveFarmAgentSitemap,
@@ -45,10 +48,7 @@ import {
45
48
  isReactRenderer,
46
49
  resolveFarmRenderer,
47
50
  resolveFarmServerComponentsMode
48
- } from "./chunk-BCCCPFHQ.mjs";
49
- import {
50
- resolveFarmImageConfig
51
- } from "./chunk-AOIUYHPH.mjs";
51
+ } from "./chunk-HV6CYSMF.mjs";
52
52
  import {
53
53
  FARM_CRON_NAME_SEGMENT_PATTERN,
54
54
  normalizeCronExpression,
@@ -94,6 +94,9 @@ import {
94
94
  import {
95
95
  resolveFarmAPIConfig
96
96
  } from "./chunk-W6QLRQ3V.mjs";
97
+ import {
98
+ resolveFarmImageConfig
99
+ } from "./chunk-AOIUYHPH.mjs";
97
100
  import {
98
101
  normalizeFarmDeploymentId
99
102
  } from "./chunk-IWJONXPF.mjs";
@@ -1054,6 +1057,7 @@ async function resolveConfig(userConfig, mode) {
1054
1057
  mode
1055
1058
  });
1056
1059
  userConfig = layerResolution.config;
1060
+ const rendererServerComponentsIslands = resolveFarmRendererServerComponentsIslands(userConfig);
1057
1061
  if (userConfig.typescript !== void 0) {
1058
1062
  logger.warn(
1059
1063
  'The top-level "typescript" option is not supported and has no effect. Configure TypeScript in `tsconfig.json` and run `tsc --noEmit` separately when builds must enforce project type errors.'
@@ -1181,7 +1185,9 @@ async function resolveConfig(userConfig, mode) {
1181
1185
  // isolatedClientHydration itself.
1182
1186
  isolatedClientHydration: resolveFarmServerComponentsMode(userConfig.experimental?.serverComponents) === "islands" ? "enabled" : "off",
1183
1187
  ppr: false,
1184
- ...userConfig.experimental
1188
+ ...userConfig.experimental,
1189
+ // Another renderer's islands run without Farm's server components engine, which renders React.
1190
+ ...rendererServerComponentsIslands ? { serverComponents: false } : {}
1185
1191
  },
1186
1192
  agent: resolveFarmAgentConfig(userConfig.agent, {
1187
1193
  docs: docs.enabled,
@@ -18,7 +18,7 @@ var _chunkHR5GU4UUcjs = require('./chunk-HR5GU4UU.cjs');
18
18
  var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
19
19
 
20
20
 
21
- var _chunkBBX4RPOVcjs = require('./chunk-BBX4RPOV.cjs');
21
+ var _chunkMZR22RACcjs = require('./chunk-MZR22RAC.cjs');
22
22
 
23
23
 
24
24
 
@@ -599,7 +599,7 @@ async function resolveAPIContext(options) {
599
599
  config: options.config,
600
600
  configPath: options.configPath
601
601
  }));
602
- const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkBBX4RPOVcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
602
+ const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkMZR22RACcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
603
603
  const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _25 => _25.guardedPaths]), () => ( [])));
604
604
  return {
605
605
  root,
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-VHIXGZYH.mjs";
29
29
  import {
30
30
  loadFarmDevModule
31
- } from "./chunk-7H2TXT2K.mjs";
31
+ } from "./chunk-HX5HLFBZ.mjs";
32
32
  import {
33
33
  logger
34
34
  } from "./chunk-U6GMCDRS.mjs";
@@ -32,7 +32,7 @@ import {
32
32
  import {
33
33
  collectFarmNativeServerFns,
34
34
  findFarmNativeScreenFiles
35
- } from "./chunk-J7VIXTPQ.mjs";
35
+ } from "./chunk-3F55K4MC.mjs";
36
36
  import {
37
37
  assertFarmDocsAdapterServesNoGuardedPages,
38
38
  compileFarmDocsAdapterEdgeManifest,
@@ -40,7 +40,7 @@ import {
40
40
  farmDocsAdapterServesGuardedPages,
41
41
  listFarmDocsAdapterPages,
42
42
  listFarmDocsPagePaths
43
- } from "./chunk-Z3LOPHSO.mjs";
43
+ } from "./chunk-QSDIJ45N.mjs";
44
44
  import {
45
45
  FARM_DOCS_LAST_MODIFIED_MANIFEST,
46
46
  createFarmDocsHandler,
@@ -70,7 +70,7 @@ import {
70
70
  getDeployTargetForPreset,
71
71
  hasCustomFarmRouteContext,
72
72
  resolveDeployOutputPath
73
- } from "./chunk-4QCMTIBM.mjs";
73
+ } from "./chunk-ALOFMAFA.mjs";
74
74
  import {
75
75
  resolveFarmInstrumentationFile
76
76
  } from "./chunk-QRNYSISP.mjs";
@@ -103,6 +103,7 @@ import {
103
103
  generateClientCachePersistenceCode,
104
104
  generateFarmIntegrationProviderClientCode,
105
105
  generateFarmIntegrationProviderServerModules,
106
+ isFarmLayoutModule,
106
107
  isRendererCompiledComponent,
107
108
  mergeFarmFontCss,
108
109
  mergeFarmProductionViteConfig,
@@ -115,7 +116,7 @@ import {
115
116
  resolveFarmNotFoundComponentPath,
116
117
  resolveFarmRouteRootStrategy,
117
118
  toBakedMarkdownSourcePath
118
- } from "./chunk-X7RSOEMQ.mjs";
119
+ } from "./chunk-QLRI2BX5.mjs";
119
120
  import {
120
121
  TAILWIND_CSS_BROWSER_TARGET,
121
122
  generateFarmClientPluginEntryCode,
@@ -131,14 +132,11 @@ import {
131
132
  readRouteRenderingDirectiveFromFile,
132
133
  resolveRouteRenderingConfig,
133
134
  resolveRouteRenderingConfigFromFile
134
- } from "./chunk-CWUQBECF.mjs";
135
- import {
136
- usesFarmRendererIslands
137
- } from "./chunk-RQ6XX5IN.mjs";
135
+ } from "./chunk-4SJ22WTT.mjs";
138
136
  import {
139
137
  FARM_PRERENDER_ENV,
140
138
  _farmWebMCPReportsEnabled
141
- } from "./chunk-YS647ASS.mjs";
139
+ } from "./chunk-5D73SKF3.mjs";
142
140
  import {
143
141
  HOISTED_HEAD_ELEMENT,
144
142
  appMiddlewareMayHandlePath,
@@ -151,7 +149,7 @@ import {
151
149
  layoutsCanCoverSamePage,
152
150
  routeBoundaryCoversDirectory,
153
151
  stripRouteGroups
154
- } from "./chunk-4EEAPBNV.mjs";
152
+ } from "./chunk-PEQJ4UUT.mjs";
155
153
  import {
156
154
  FARM_NATIVE_TREE_CONTENT_TYPE
157
155
  } from "./chunk-LLZSYFOM.mjs";
@@ -165,7 +163,7 @@ import {
165
163
  listFarmBuiltInRoutePaths,
166
164
  resolveFarmApiCatalogInput,
167
165
  resolveFarmAppManifestInput
168
- } from "./chunk-YX532KEF.mjs";
166
+ } from "./chunk-4FGTNYHE.mjs";
169
167
  import {
170
168
  FARM_DEFAULT_MCP_PATH,
171
169
  createFarmDefaultMCPServer,
@@ -173,7 +171,7 @@ import {
173
171
  } from "./chunk-HR4N2K4V.mjs";
174
172
  import {
175
173
  isFarmPreviewDeploymentEnvironment
176
- } from "./chunk-PQR5A7R2.mjs";
174
+ } from "./chunk-Q73LRKLP.mjs";
177
175
  import {
178
176
  FARM_NATIVE_SERVER_FN_PLUGIN
179
177
  } from "./chunk-L4RTTTVE.mjs";
@@ -194,7 +192,7 @@ import {
194
192
  withFarmSourceSnapshot,
195
193
  withFarmSourceSnapshotOf,
196
194
  withPackageClientBoundaryCache
197
- } from "./chunk-3TCFONUE.mjs";
195
+ } from "./chunk-26HESRBL.mjs";
198
196
  import {
199
197
  generateFarmDocsAdapterClientRuntime,
200
198
  getFarmDocsAdapterConfigModule
@@ -212,6 +210,9 @@ import {
212
210
  nitroRouteRulesBelowBasePath,
213
211
  routeRulesToNitroRouteRules
214
212
  } from "./chunk-YVVY276M.mjs";
213
+ import {
214
+ usesFarmRendererIslands
215
+ } from "./chunk-X2SMVPLH.mjs";
215
216
  import {
216
217
  applyFarmCspHashesToHtml,
217
218
  createFarmCspNonce
@@ -229,7 +230,7 @@ import {
229
230
  loadFarmRendererVitePlugins,
230
231
  resolveFarmRendererAppSetup,
231
232
  resolveFarmServerComponentsMode
232
- } from "./chunk-BCCCPFHQ.mjs";
233
+ } from "./chunk-HV6CYSMF.mjs";
233
234
  import {
234
235
  applyFarmCronVercelCrons,
235
236
  createFarmCronCloudflareConfig,
@@ -280,7 +281,7 @@ import {
280
281
  } from "./chunk-QD34VE4N.mjs";
281
282
  import {
282
283
  APIRouteManager
283
- } from "./chunk-NAHDG6UX.mjs";
284
+ } from "./chunk-HFRG2IQS.mjs";
284
285
  import {
285
286
  readFarmI18nCatalogs
286
287
  } from "./chunk-VO55MMBX.mjs";
@@ -308,7 +309,7 @@ import {
308
309
  } from "./chunk-2I6PUKWJ.mjs";
309
310
  import {
310
311
  FARM_VERSION
311
- } from "./chunk-XIXAUXV3.mjs";
312
+ } from "./chunk-O7K4HMAQ.mjs";
312
313
  import {
313
314
  FARM_VIDEO_PLAYER_PATH
314
315
  } from "./chunk-AG27TI6Q.mjs";
@@ -893,15 +894,26 @@ function encodeFarmBuildJSONPlaceholder(value) {
893
894
 
894
895
  // src/nitro/islands-react-chunk.ts
895
896
  var REACT_MODULE = /[\\/]node_modules[\\/](?:react|react-dom|scheduler)[\\/]/;
896
- function createFarmIslandsReactChunkGroup() {
897
+ var REACT_DOM_MODULE = /[\\/]node_modules[\\/]react-dom[\\/]/;
898
+ var FARM_EAGER_COMPILE_HINT = "//# allFunctionsCalledOnLoad";
899
+ function createFarmIslandsReactOutput() {
897
900
  let entryImportsReact;
898
901
  return {
899
- debugName: "react",
900
- name(moduleId, context) {
901
- if (!REACT_MODULE.test(moduleId)) return null;
902
- entryImportsReact ?? (entryImportsReact = reactLoadsWithAnEntry(moduleId, context));
903
- return entryImportsReact ? null : "react";
904
- }
902
+ codeSplitting: {
903
+ groups: [
904
+ {
905
+ debugName: "react",
906
+ name(moduleId, context) {
907
+ if (!REACT_MODULE.test(moduleId)) return null;
908
+ entryImportsReact ?? (entryImportsReact = reactLoadsWithAnEntry(moduleId, context));
909
+ return entryImportsReact ? null : "react";
910
+ }
911
+ }
912
+ ]
913
+ },
914
+ // After minification, so the hint stays the chunk's first line; its source map accounts for it.
915
+ // Rolldown adds a line after any string, an empty one too, so other chunks get none.
916
+ postBanner: ((chunk) => entryImportsReact === false && chunk.moduleIds.some((id) => REACT_DOM_MODULE.test(id)) ? FARM_EAGER_COMPILE_HINT : void 0)
905
917
  };
906
918
  }
907
919
  function reactLoadsWithAnEntry(moduleId, context) {
@@ -925,14 +937,25 @@ function reactLoadsWithAnEntry(moduleId, context) {
925
937
  }
926
938
  return false;
927
939
  }
928
- function configuresFarmClientChunks(vite) {
929
- const build2 = vite?.build;
930
- const outputs = [build2?.rollupOptions?.output, build2?.rolldownOptions?.output].flat();
931
- return outputs.some(
932
- (output) => !!output && typeof output === "object" && ["manualChunks", "advancedChunks", "codeSplitting", "inlineDynamicImports"].some(
933
- (key) => output[key] !== void 0
934
- )
935
- );
940
+ var CHUNKING_OPTIONS = [
941
+ "manualChunks",
942
+ "advancedChunks",
943
+ "codeSplitting",
944
+ "inlineDynamicImports"
945
+ ];
946
+ function createFarmIslandsReactChunkPlugin() {
947
+ return {
948
+ name: "farm-islands-react-chunk",
949
+ enforce: "post",
950
+ outputOptions: {
951
+ order: "post",
952
+ handler(options) {
953
+ if (CHUNKING_OPTIONS.some((key) => options[key] !== void 0)) return null;
954
+ const { codeSplitting, postBanner } = createFarmIslandsReactOutput();
955
+ return { ...options, codeSplitting, postBanner: options.postBanner ?? postBanner };
956
+ }
957
+ }
958
+ };
936
959
  }
937
960
 
938
961
  // src/nitro/client-route-table.ts
@@ -3210,7 +3233,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3210
3233
  farmPlugin,
3211
3234
  farmServerOnlyEntriesPlugin
3212
3235
  } = await import("./vite.mjs");
3213
- const { PluginManager: PluginManager2 } = await import("./plugin-QOTAPTVV.mjs");
3236
+ const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
3214
3237
  const fs5 = await import("fs/promises");
3215
3238
  const pluginManager = new PluginManager2({
3216
3239
  config,
@@ -3595,7 +3618,6 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3595
3618
  entryFileNames: "[name]-h[hash].js",
3596
3619
  chunkFileNames: "chunks/[name]-h[hash].js",
3597
3620
  hashCharacters: "hex",
3598
- ...islandsMode && isReactRenderer(config.renderer) && !configuresFarmClientChunks(config.vite) ? { codeSplitting: { groups: [createFarmIslandsReactChunkGroup()] } } : {},
3599
3621
  // Use predictable name for CSS so we can reference it in SSR HTML
3600
3622
  assetFileNames: (assetInfo) => {
3601
3623
  if (assetInfo.name?.endsWith(".css")) {
@@ -3665,6 +3687,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3665
3687
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
3666
3688
  ...rendererVitePlugins,
3667
3689
  ...config.vite.plugins || [],
3690
+ // React in one chunk, unless the app's config or one of its plugins splits chunks.
3691
+ ...islandsMode && isReactRenderer(config.renderer) ? [createFarmIslandsReactChunkPlugin()] : [],
3668
3692
  farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
3669
3693
  farmNavigationPlugin(config.renderer),
3670
3694
  farmDocsClientConfigPlugin(
@@ -5644,8 +5668,9 @@ let hydrateRoot;
5644
5668
  let farmRendererLoading = null;
5645
5669
  let farmRendererLoaded = false;${isolatedHydrationEnabled ? `
5646
5670
  // The boot stops holding interactions once this entry runs. Until islx loads, islands that have not
5647
- // hydrated hold them here, for their schedulers to replay.
5648
- const releaseFarmIslandInteractions = holdFarmIslandInteractions("f-island");` : ""}
5671
+ // hydrated hold them here, for their schedulers to replay, and a server component's form waits for
5672
+ // islx to post it without a page load.
5673
+ const releaseFarmIslandInteractions = holdFarmIslandInteractions("f-island", loadFarmRenderer);` : ""}
5649
5674
  function loadFarmRenderer() {
5650
5675
  return farmRendererLoading || (farmRendererLoading = Promise.all([
5651
5676
  import("react"),
@@ -7319,7 +7344,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7319
7344
  farmPlugin,
7320
7345
  farmServerOnlyEntriesPlugin
7321
7346
  } = await import("./vite.mjs");
7322
- const { PluginManager: PluginManager2 } = await import("./plugin-QOTAPTVV.mjs");
7347
+ const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
7323
7348
  const fs5 = await import("fs/promises");
7324
7349
  const pluginManager = new PluginManager2({
7325
7350
  config,
@@ -15711,7 +15736,8 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
15711
15736
  farmFontImportsPlugin({
15712
15737
  root,
15713
15738
  basePath: config.basePath,
15714
- publicDir: config.publicDir
15739
+ publicDir: config.publicDir,
15740
+ isLayoutModule: (id) => isFarmLayoutModule(id, getFarmAppDirectories(config))
15715
15741
  }),
15716
15742
  farmEnvironmentFunctionsPlugin({ renderer: config.renderer }),
15717
15743
  // Route modules load here at build time (rendering config, prerendering): `server-only`
@@ -15785,7 +15811,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
15785
15811
  farmPlugin,
15786
15812
  farmServerOnlyEntriesPlugin
15787
15813
  } = await import("./vite.mjs");
15788
- const { PluginManager: PluginManager2 } = await import("./plugin-QOTAPTVV.mjs");
15814
+ const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
15789
15815
  const pluginManager = new PluginManager2({
15790
15816
  config,
15791
15817
  isDev: false,
@@ -15814,7 +15840,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
15814
15840
  }
15815
15841
  async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
15816
15842
  const { farmI18nClientBridgePlugin, farmIslandContainersPlugin, farmPlugin } = await import("./vite.mjs");
15817
- const { PluginManager: PluginManager2 } = await import("./plugin-QOTAPTVV.mjs");
15843
+ const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
15818
15844
  const pluginManager = new PluginManager2({
15819
15845
  config,
15820
15846
  isDev: false,
@@ -37,7 +37,7 @@ import {
37
37
  } from "./chunk-VHIXGZYH.mjs";
38
38
  import {
39
39
  loadFarmDevModule
40
- } from "./chunk-7H2TXT2K.mjs";
40
+ } from "./chunk-HX5HLFBZ.mjs";
41
41
  import {
42
42
  logger
43
43
  } from "./chunk-U6GMCDRS.mjs";
@@ -203,6 +203,9 @@ function resolveFarmRenderer(renderer) {
203
203
  }
204
204
  }
205
205
  }
206
+ if (resolved.compile !== void 0 && typeof resolved.compile !== "function") {
207
+ issues.push("`compile` must be a method that returns a file's JavaScript or TSX.");
208
+ }
206
209
  if (issues.length > 0) {
207
210
  throw new TypeError(
208
211
  `Farm renderer \`${resolved.name}\` is invalid:
@@ -8,6 +8,12 @@ async function startPluginContainer(server) {
8
8
  await container.buildStart?.();
9
9
  startedContainers.add(container);
10
10
  }
11
+ function createFarmDevModuleCheck(server, exports, environmentName = "ssr") {
12
+ const modules = server.environments[environmentName]?.runner?.evaluatedModules;
13
+ const node = modules ? Array.from(modules.idToModuleMap.values()).find((module) => module.exports === exports) : void 0;
14
+ if (!modules || !node) return () => true;
15
+ return () => node.evaluated && modules.getModuleById(node.id) === node;
16
+ }
11
17
  var FarmDevEnvironmentError = class extends Error {
12
18
  };
13
19
  async function loadFarmDevModule(server, id, environmentName = "ssr") {
@@ -90,6 +96,7 @@ function invalidateFailedFarmDevModules(server) {
90
96
  }
91
97
 
92
98
  export {
99
+ createFarmDevModuleCheck,
93
100
  FarmDevEnvironmentError,
94
101
  loadFarmDevModule,
95
102
  invalidateFarmDevDependents,