@farm.js/core 0.1.71 → 0.1.72

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 (222) hide show
  1. package/dist/agent-mcp-handler-KE4J3W7S.cjs +1 -1
  2. package/dist/agent-mcp-handler-VIT4GOSR.mjs +1 -1
  3. package/dist/{agent-mcp.d-BzNw6JI8.d.ts → agent-mcp.d-BO3rZXEM.d.ts} +2 -2
  4. package/dist/{agent-mcp.d-CgFen3EH.d.mts → agent-mcp.d-Cwff7lcA.d.mts} +2 -2
  5. package/dist/agent-runtime.d.mts +3 -3
  6. package/dist/agent-runtime.d.ts +3 -3
  7. package/dist/{analyzer-VK3BAOFI.mjs → analyzer-5Q75LTIL.mjs} +2 -2
  8. package/dist/analyzer-UJG4MIZW.cjs +16 -0
  9. package/dist/api/node.d.mts +5 -5
  10. package/dist/api/node.d.ts +5 -5
  11. package/dist/api/route-manager.cjs +7 -6
  12. package/dist/api/route-manager.d.mts +7 -7
  13. package/dist/api/route-manager.d.ts +7 -7
  14. package/dist/api/route-manager.mjs +6 -5
  15. package/dist/api/runtime.d.mts +4 -4
  16. package/dist/api/runtime.d.ts +4 -4
  17. package/dist/api.cjs +8 -7
  18. package/dist/api.d.mts +8 -8
  19. package/dist/api.d.ts +8 -8
  20. package/dist/api.mjs +7 -6
  21. package/dist/{app-manifest.d-DY4JfJxi.d.ts → app-manifest.d-DwjGkYlP.d.ts} +1 -1
  22. package/dist/{app-manifest.d-DpDK_B1k.d.mts → app-manifest.d-USD_IbFd.d.mts} +1 -1
  23. package/dist/app-markdown.d.mts +4 -4
  24. package/dist/app-markdown.d.ts +4 -4
  25. package/dist/{app.d-BeK6bb1c.d.ts → app.d-DAmF2MAk.d.ts} +48 -6
  26. package/dist/{app.d-D-5UNrFd.d.mts → app.d-fW06_h8h.d.mts} +48 -6
  27. package/dist/{chunk-7A3URI2F.mjs → chunk-2EVESLP3.mjs} +8 -1
  28. package/dist/{chunk-X7LGLF33.mjs → chunk-3JN5M3T5.mjs} +259 -61
  29. package/dist/{chunk-KEB7AGS6.cjs → chunk-3WG7GJQL.cjs} +7 -2
  30. package/dist/{chunk-K66JILV3.cjs → chunk-5LOARKDP.cjs} +2 -2
  31. package/dist/{chunk-UISZLYKY.cjs → chunk-5R4Q5FN7.cjs} +2 -2
  32. package/dist/{chunk-3BQ7QHUH.cjs → chunk-5X6OHJEE.cjs} +15 -3
  33. package/dist/{chunk-GUU3IZSM.mjs → chunk-5XFKWHZD.mjs} +234 -47
  34. package/dist/{chunk-MITIAOUQ.mjs → chunk-645ENY7W.mjs} +2 -2
  35. package/dist/{chunk-RJUCNO7R.mjs → chunk-77VNYVVX.mjs} +1 -1
  36. package/dist/{chunk-PLXD2MJV.cjs → chunk-7QCJDYZQ.cjs} +2 -2
  37. package/dist/{chunk-V25GSH43.mjs → chunk-AUAMXI6N.mjs} +1 -1
  38. package/dist/{chunk-2IFT2CSA.cjs → chunk-BE7AQXJB.cjs} +346 -148
  39. package/dist/{chunk-7BUE2GM6.mjs → chunk-BSXKZPFE.mjs} +70 -19
  40. package/dist/{chunk-2MR4MABG.cjs → chunk-C5AM2XDN.cjs} +54 -4
  41. package/dist/{chunk-KWST2O22.cjs → chunk-CBLRSZQL.cjs} +488 -301
  42. package/dist/{chunk-BBPDJGCU.cjs → chunk-CYOTNHDF.cjs} +2 -2
  43. package/dist/{chunk-W2T6NDNP.mjs → chunk-DGNMXL2O.mjs} +1 -1
  44. package/dist/{chunk-QUFENL7Q.mjs → chunk-DS7JGFW5.mjs} +13 -1
  45. package/dist/{chunk-IGXS54GC.mjs → chunk-E2V7RRFL.mjs} +1 -1
  46. package/dist/{chunk-CSQPMV3Q.cjs → chunk-E3LE6EZH.cjs} +4 -4
  47. package/dist/{chunk-JVA4PIYN.cjs → chunk-ET6WW3FY.cjs} +338 -171
  48. package/dist/{chunk-VXB5CMNC.cjs → chunk-EXN4DTVF.cjs} +2 -2
  49. package/dist/{chunk-SXMWVP2L.cjs → chunk-FSSONJRV.cjs} +4 -4
  50. package/dist/{chunk-Y2SZVIVH.cjs → chunk-GPICBTDV.cjs} +8 -1
  51. package/dist/{chunk-7OHJWFLB.cjs → chunk-HLMUWKAP.cjs} +333 -282
  52. package/dist/{chunk-ZPUAOKHV.cjs → chunk-IWCYRDRQ.cjs} +3 -3
  53. package/dist/{chunk-2AM26UGI.cjs → chunk-NLBK37HI.cjs} +5 -4
  54. package/dist/{chunk-NA77GEIU.mjs → chunk-NV26EGMC.mjs} +51 -1
  55. package/dist/{chunk-DPYBVVL3.cjs → chunk-OSEQL34Q.cjs} +2 -2
  56. package/dist/{chunk-IYDJNCR7.mjs → chunk-OSMUE5ST.mjs} +7 -2
  57. package/dist/{chunk-UQUOSNRN.mjs → chunk-QUYAGU65.mjs} +214 -47
  58. package/dist/{chunk-DPIGYXSV.mjs → chunk-RFWWXEIF.mjs} +1 -1
  59. package/dist/{chunk-E77IA5IF.mjs → chunk-RLFGKJQ6.mjs} +1 -1
  60. package/dist/{chunk-3AUINHFG.mjs → chunk-TNYC3TYP.mjs} +3 -2
  61. package/dist/{chunk-4OD2LXF2.mjs → chunk-VAWDGGW3.mjs} +1 -1
  62. package/dist/{chunk-MU5V7XHL.mjs → chunk-VJSXPN3W.mjs} +3 -0
  63. package/dist/{chunk-DU4VHHPJ.mjs → chunk-VO55MMBX.mjs} +1 -1
  64. package/dist/{chunk-LDVJIBGN.mjs → chunk-VT25ERQK.mjs} +1 -1
  65. package/dist/{chunk-2CQC5CMD.mjs → chunk-WIJF3PBM.mjs} +1 -1
  66. package/dist/{chunk-FILXOEWD.cjs → chunk-YXIQYWOK.cjs} +2 -2
  67. package/dist/{chunk-THG2TVDH.mjs → chunk-YZLEOMMA.mjs} +3 -3
  68. package/dist/{chunk-MEJCP2LX.cjs → chunk-ZDZUFD67.cjs} +1 -1
  69. package/dist/{chunk-Q5HMVGR5.cjs → chunk-ZFEJ2SF2.cjs} +13 -13
  70. package/dist/{chunk-LNVGXUL3.cjs → chunk-ZMSVKVI3.cjs} +3 -0
  71. package/dist/{client-component.d-fYupugbZ.d.ts → client-component.d-9J7CkTWW.d.ts} +2 -2
  72. package/dist/{client-component.d-DwpH251K.d.mts → client-component.d-ciHeCxr-.d.mts} +2 -2
  73. package/dist/{client-plugins.d-BxqFfHpM.d.ts → client-plugins.d-CUOhfapO.d.ts} +4 -3
  74. package/dist/{client-plugins.d-k3bOT5gz.d.mts → client-plugins.d-JnRz5a1o.d.mts} +4 -3
  75. package/dist/client-plugins.d.mts +3 -3
  76. package/dist/client-plugins.d.ts +3 -3
  77. package/dist/client.cjs +1 -1
  78. package/dist/client.d.mts +8 -8
  79. package/dist/client.d.ts +8 -8
  80. package/dist/client.mjs +1 -1
  81. package/dist/config.d.mts +3 -3
  82. package/dist/config.d.ts +3 -3
  83. package/dist/desktop.d.mts +4 -4
  84. package/dist/desktop.d.ts +4 -4
  85. package/dist/{devtools-6MXPFPNJ.mjs → devtools-7JPQMSTQ.mjs} +3 -3
  86. package/dist/{devtools-O5625KCK.cjs → devtools-IZFUYWPG.cjs} +4 -4
  87. package/dist/docs.cjs +5 -5
  88. package/dist/docs.d.mts +4 -4
  89. package/dist/docs.d.ts +4 -4
  90. package/dist/docs.mjs +4 -4
  91. package/dist/environment/vite.cjs +3 -3
  92. package/dist/environment/vite.mjs +2 -2
  93. package/dist/{headers.d-DalIGbVO.d.ts → headers.d-CqpTL_fZ.d.ts} +2 -2
  94. package/dist/{headers.d-sNT7ZQiU.d.mts → headers.d-rbbTKGaN.d.mts} +2 -2
  95. package/dist/i18n/client.cjs +3 -2
  96. package/dist/i18n/client.d.mts +2 -2
  97. package/dist/i18n/client.d.ts +2 -2
  98. package/dist/i18n/client.mjs +2 -1
  99. package/dist/i18n/index.cjs +3 -2
  100. package/dist/i18n/index.d.mts +3 -3
  101. package/dist/i18n/index.d.ts +3 -3
  102. package/dist/i18n/index.mjs +2 -1
  103. package/dist/i18n/server.cjs +6 -5
  104. package/dist/i18n/server.d.mts +5 -5
  105. package/dist/i18n/server.d.ts +5 -5
  106. package/dist/i18n/server.mjs +5 -4
  107. package/dist/index.cjs +22 -22
  108. package/dist/{index.d-BcA-secm.d.ts → index.d-CMKvzHLW.d.ts} +1 -1
  109. package/dist/{index.d-DDHHAv7j.d.mts → index.d-D_B2D9Il.d.mts} +1 -1
  110. package/dist/index.d.mts +23 -23
  111. package/dist/index.d.ts +23 -23
  112. package/dist/index.mjs +21 -21
  113. package/dist/integrations/orm.d.mts +3 -3
  114. package/dist/integrations/orm.d.ts +3 -3
  115. package/dist/integrations.d.mts +3 -3
  116. package/dist/integrations.d.ts +3 -3
  117. package/dist/internal/app-markdown-runtime.d.mts +4 -4
  118. package/dist/internal/app-markdown-runtime.d.ts +4 -4
  119. package/dist/internal/build-runtime.cjs +21 -21
  120. package/dist/internal/build-runtime.d.mts +5 -5
  121. package/dist/internal/build-runtime.d.ts +5 -5
  122. package/dist/internal/build-runtime.mjs +20 -20
  123. package/dist/internal/cli-runtime.cjs +6 -6
  124. package/dist/internal/cli-runtime.mjs +5 -5
  125. package/dist/internal/client-error-overlay.cjs +4 -4
  126. package/dist/internal/client-error-overlay.mjs +1 -1
  127. package/dist/internal/client-runtime.cjs +2 -2
  128. package/dist/internal/client-runtime.d.mts +6 -6
  129. package/dist/internal/client-runtime.d.ts +6 -6
  130. package/dist/internal/client-runtime.mjs +3 -3
  131. package/dist/internal/compression-runtime.d.mts +3 -3
  132. package/dist/internal/compression-runtime.d.ts +3 -3
  133. package/dist/internal/config-runtime.cjs +5 -5
  134. package/dist/internal/config-runtime.d.mts +6 -6
  135. package/dist/internal/config-runtime.d.ts +6 -6
  136. package/dist/internal/config-runtime.mjs +4 -4
  137. package/dist/internal/infra-analytics-runtime.cjs +7 -7
  138. package/dist/internal/infra-analytics-runtime.mjs +5 -5
  139. package/dist/internal/native-server-fns.cjs +4 -4
  140. package/dist/internal/native-server-fns.mjs +3 -3
  141. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  142. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  143. package/dist/internal/production-runtime.cjs +13 -13
  144. package/dist/internal/production-runtime.d.mts +36 -24
  145. package/dist/internal/production-runtime.d.ts +36 -24
  146. package/dist/internal/production-runtime.mjs +12 -12
  147. package/dist/internal/vercel-edge-middleware.d.mts +2 -2
  148. package/dist/internal/vercel-edge-middleware.d.ts +2 -2
  149. package/dist/markdown.d.mts +3 -3
  150. package/dist/markdown.d.ts +3 -3
  151. package/dist/middleware.cjs +3 -3
  152. package/dist/middleware.d.mts +4 -4
  153. package/dist/middleware.d.ts +4 -4
  154. package/dist/middleware.mjs +2 -2
  155. package/dist/mobile.d.mts +3 -3
  156. package/dist/mobile.d.ts +3 -3
  157. package/dist/{mount.d-D3JOux2V.d.ts → mount.d-B0XMxDRh.d.ts} +1 -1
  158. package/dist/{mount.d-C1PONsEe.d.mts → mount.d-ImEO7q8a.d.mts} +1 -1
  159. package/dist/{navigation-delegate.d-CJQQHboA.d.mts → navigation-delegate.d-83Q7ksf7.d.mts} +1 -1
  160. package/dist/{navigation-delegate.d-CQQPbdkE.d.ts → navigation-delegate.d-RRx1CSlb.d.ts} +1 -1
  161. package/dist/navigation.d.mts +6 -6
  162. package/dist/navigation.d.ts +6 -6
  163. package/dist/plugin.cjs +15 -15
  164. package/dist/plugin.d.mts +6 -6
  165. package/dist/plugin.d.ts +6 -6
  166. package/dist/plugin.mjs +14 -14
  167. package/dist/{production-runtime.d-B0IeWWyO.d.mts → production-runtime.d-Bcu37SCo.d.mts} +1 -1
  168. package/dist/{production-runtime.d-q3aHIv5Y.d.ts → production-runtime.d-qPj3XRET.d.ts} +1 -1
  169. package/dist/{render-plan.d-DHuJMJRP.d.ts → render-plan.d-Ds2sXJ5m.d.ts} +1 -1
  170. package/dist/{render-plan.d-CiUj0rq5.d.mts → render-plan.d-wP8nTeRV.d.mts} +1 -1
  171. package/dist/renderer-client.cjs +3 -2
  172. package/dist/renderer-client.d.mts +6 -6
  173. package/dist/renderer-client.d.ts +6 -6
  174. package/dist/renderer-client.mjs +2 -1
  175. package/dist/{request.d-D-F7o7tb.d.mts → request.d-F3h7K37m.d.mts} +1 -1
  176. package/dist/{request.d-DRUbOmYD.d.ts → request.d-zpSn6pu_.d.ts} +1 -1
  177. package/dist/request.d.mts +4 -4
  178. package/dist/request.d.ts +4 -4
  179. package/dist/{resolver.d-9iKC79CU.d.mts → resolver.d-DJgzbdsp.d.mts} +1 -1
  180. package/dist/{resolver.d-CY6mEa_F.d.ts → resolver.d-yaHcGCCG.d.ts} +1 -1
  181. package/dist/{route-rendering.d-KwqM_mlK.d.ts → route-rendering.d-BL0_AdKj.d.ts} +1 -1
  182. package/dist/{route-rendering.d-6smgwT2t.d.mts → route-rendering.d-Mw0ZKG2e.d.mts} +1 -1
  183. package/dist/{router.d-B6sesMRD.d.ts → router.d-BwXigemZ.d.ts} +1 -1
  184. package/dist/{router.d-BYmDeDlp.d.mts → router.d-NGVsU11T.d.mts} +1 -1
  185. package/dist/{routes.d-D3aJw1H5.d.mts → routes.d-CCccJRrp.d.mts} +1 -1
  186. package/dist/{routes.d-K-Qg79AA.d.ts → routes.d-b7khoRoU.d.ts} +1 -1
  187. package/dist/routes.d.mts +3 -3
  188. package/dist/routes.d.ts +3 -3
  189. package/dist/{routing.d-DwSUVZbF.d.mts → routing.d-BhPgtN_S.d.ts} +2 -1
  190. package/dist/{routing.d-BxOZ2YWc.d.ts → routing.d-D67HQmnv.d.mts} +2 -1
  191. package/dist/{rsc-pipeline-P4PCWDO2.cjs → rsc-pipeline-BNXYMG4G.cjs} +5 -5
  192. package/dist/{rsc-pipeline-R2GOKIMU.mjs → rsc-pipeline-DHYZLWSF.mjs} +4 -4
  193. package/dist/{runtime-WA2Q4SLG.cjs → runtime-IWOT6ZVC.cjs} +6 -6
  194. package/dist/{runtime-DP5DYGW5.mjs → runtime-XPYKUNL3.mjs} +4 -4
  195. package/dist/{runtime.d-BFSJf-ww.d.mts → runtime.d-BA3MzhXz.d.mts} +1 -1
  196. package/dist/{runtime.d-nUz0HAL4.d.mts → runtime.d-CTAXWZby.d.mts} +2 -2
  197. package/dist/{runtime.d-CbdMI0Oy.d.ts → runtime.d-OBIZWpx1.d.ts} +1 -1
  198. package/dist/{runtime.d-B_uPfMjA.d.ts → runtime.d-PUA5qBnd.d.ts} +2 -2
  199. package/dist/server-plugins.d.mts +5 -5
  200. package/dist/server-plugins.d.ts +5 -5
  201. package/dist/server.cjs +33 -33
  202. package/dist/server.d.mts +14 -14
  203. package/dist/server.d.ts +14 -14
  204. package/dist/server.mjs +17 -17
  205. package/dist/{spa-router.d-D4EDwR20.d.mts → spa-router.d-BG2XzE5p.d.mts} +3 -3
  206. package/dist/{spa-router.d-mC1D5cTN.d.ts → spa-router.d-DrYT944-.d.ts} +3 -3
  207. package/dist/testing.cjs +6 -5
  208. package/dist/testing.d.mts +3 -3
  209. package/dist/testing.d.ts +3 -3
  210. package/dist/testing.mjs +6 -5
  211. package/dist/{types.d-wVRlLtBf.d.ts → types.d-euATAbE4.d.mts} +4 -0
  212. package/dist/{types.d-wVRlLtBf.d.mts → types.d-euATAbE4.d.ts} +4 -0
  213. package/dist/{utils.d-DxMzteqE.d.mts → utils.d-C1k9BJeD.d.mts} +1 -1
  214. package/dist/{utils.d-A2X3a6z_.d.ts → utils.d-DcF4wxey.d.ts} +1 -1
  215. package/dist/version.cjs +2 -2
  216. package/dist/version.mjs +1 -1
  217. package/dist/vite.cjs +15 -15
  218. package/dist/vite.d.mts +7 -7
  219. package/dist/vite.d.ts +7 -7
  220. package/dist/vite.mjs +14 -14
  221. package/package.json +1 -1
  222. package/dist/analyzer-LPIVRSTJ.cjs +0 -16
@@ -82,7 +82,7 @@ var _chunkJX5VOLAVcjs = require('./chunk-JX5VOLAV.cjs');
82
82
  var _chunk5DX3O6TTcjs = require('./chunk-5DX3O6TT.cjs');
83
83
 
84
84
 
85
- var _chunkLNVGXUL3cjs = require('./chunk-LNVGXUL3.cjs');
85
+ var _chunkZMSVKVI3cjs = require('./chunk-ZMSVKVI3.cjs');
86
86
 
87
87
 
88
88
  var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
@@ -1211,7 +1211,12 @@ async function resolveConfig(userConfig, mode) {
1211
1211
  performance: _chunkZUVAGMQ5cjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
1212
1212
  theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),
1213
1213
  publicDir: userConfig.publicDir || "public",
1214
- i18n: _chunkLNVGXUL3cjs.resolveFarmI18nConfig.call(void 0, userConfig.i18n, { root, mode, basePath }),
1214
+ i18n: _chunkZMSVKVI3cjs.resolveFarmI18nConfig.call(void 0, userConfig.i18n, {
1215
+ root,
1216
+ mode,
1217
+ basePath,
1218
+ trailingSlash: _nullishCoalesce(userConfig.trailingSlash, () => ( false))
1219
+ }),
1215
1220
  openapi,
1216
1221
  middleware: validateMiddlewareConfig(userConfig.middleware) || {},
1217
1222
  notFound: userConfig.notFound || {},
@@ -6,7 +6,7 @@ var _chunkQEJWNXRIcjs = require('./chunk-QEJWNXRI.cjs');
6
6
  var _chunkSBDWCDS6cjs = require('./chunk-SBDWCDS6.cjs');
7
7
 
8
8
 
9
- var _chunk2AM26UGIcjs = require('./chunk-2AM26UGI.cjs');
9
+ var _chunkNLBK37HIcjs = require('./chunk-NLBK37HI.cjs');
10
10
 
11
11
 
12
12
  var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
@@ -371,7 +371,7 @@ var APIRouteManager = class _APIRouteManager {
371
371
  return _chunkXGTFLG73cjs.createFarmInternalServerErrorResponse.call(void 0, );
372
372
  }
373
373
  };
374
- return _optionalChain([this, 'access', _10 => _10.i18n, 'optionalAccess', _11 => _11.config, 'access', _12 => _12.enabled]) ? _chunk2AM26UGIcjs._runWithFarmI18nRequest.call(void 0, this.i18n, request, invoke, {
374
+ return _optionalChain([this, 'access', _10 => _10.i18n, 'optionalAccess', _11 => _11.config, 'access', _12 => _12.enabled]) ? _chunkNLBK37HIcjs._runWithFarmI18nRequest.call(void 0, this.i18n, request, invoke, {
375
375
  redirect: false
376
376
  }) : invoke();
377
377
  };
@@ -17,7 +17,7 @@ var _chunkNAXKOTPPcjs = require('./chunk-NAXKOTPP.cjs');
17
17
  var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
18
18
 
19
19
 
20
- var _chunkKEB7AGS6cjs = require('./chunk-KEB7AGS6.cjs');
20
+ var _chunk3WG7GJQLcjs = require('./chunk-3WG7GJQL.cjs');
21
21
 
22
22
 
23
23
 
@@ -590,7 +590,7 @@ async function resolveAPIContext(options) {
590
590
  config: options.config,
591
591
  configPath: options.configPath
592
592
  }));
593
- const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkKEB7AGS6cjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
593
+ const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunk3WG7GJQLcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
594
594
  const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _28 => _28.guardedPaths]), () => ( [])));
595
595
  return {
596
596
  root,
@@ -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 _chunkSXMWVP2Lcjs = require('./chunk-SXMWVP2L.cjs');
3
+ var _chunkFSSONJRVcjs = require('./chunk-FSSONJRV.cjs');
4
4
 
5
5
 
6
6
  var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
@@ -11,6 +11,9 @@ var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
11
11
 
12
12
  var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
13
13
 
14
+
15
+ var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
16
+
14
17
  // src/plugins/infra-analytics.ts
15
18
  var _async_hooks = require('async_hooks');
16
19
  var FARM_PRERENDER_ENV = "FARM_PRERENDER";
@@ -80,6 +83,12 @@ function classifyFarmInfraAgent(userAgent) {
80
83
  function routeTemplate(pattern) {
81
84
  return typeof pattern === "string" && pattern.length <= 256 && /^\/(?!\/)[a-zA-Z0-9_./:[\]()*-]*$/.test(pattern) ? pattern : "/[unmatched]";
82
85
  }
86
+ var PATH = /^\/(?!\/)[\w!$%&'()*+,\-./:;=@[\]^|~]*$/;
87
+ var MAX_PATH_LENGTH = 1024;
88
+ function requestPath(request) {
89
+ const path = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, new URL(request.url).pathname);
90
+ return path.length <= MAX_PATH_LENGTH && PATH.test(path) ? path : void 0;
91
+ }
83
92
  function duration(value) {
84
93
  return Number.isFinite(value) ? Math.min(864e5, Math.max(0, value)) : 0;
85
94
  }
@@ -263,6 +272,7 @@ function beginRequest(request, route, waitUntil) {
263
272
  return {
264
273
  id: uuid(),
265
274
  agent: classifyFarmInfraAgent(request.headers.get("user-agent")),
275
+ path: requestPath(request),
266
276
  route,
267
277
  completed: false,
268
278
  waitUntil
@@ -273,7 +283,8 @@ function requestEvent(metadata, method, status, durationMs) {
273
283
  id: uuid(),
274
284
  requestId: metadata.id,
275
285
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
276
- route: routeTemplate(_chunkSXMWVP2Lcjs.getFarmRouteLabel.call(void 0, metadata.route)),
286
+ route: routeTemplate(_chunkFSSONJRVcjs.getFarmRouteLabel.call(void 0, metadata.route)),
287
+ ...metadata.path ? { path: metadata.path } : {},
277
288
  agent: metadata.agent,
278
289
  kind: "request",
279
290
  method,
@@ -286,7 +297,8 @@ function toolEvent(metadata, event) {
286
297
  id: uuid(),
287
298
  requestId: metadata.id,
288
299
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
289
- route: routeTemplate(_chunkSXMWVP2Lcjs.getFarmRouteLabel.call(void 0, metadata.route)),
300
+ route: routeTemplate(_chunkFSSONJRVcjs.getFarmRouteLabel.call(void 0, metadata.route)),
301
+ ...metadata.path ? { path: metadata.path } : {},
290
302
  agent: metadata.agent,
291
303
  kind: "mcp.tool",
292
304
  tool: event.tool,
@@ -9,11 +9,12 @@ import {
9
9
  collectSSGPages,
10
10
  matchSSGPage,
11
11
  resolveRouteRenderingConfigFromFile
12
- } from "./chunk-W2T6NDNP.mjs";
12
+ } from "./chunk-DGNMXL2O.mjs";
13
13
  import {
14
14
  createFarmMetadataImageResponse
15
15
  } from "./chunk-CROAFCMW.mjs";
16
16
  import {
17
+ appendFarmHead,
17
18
  classifyFarmDocumentPrefix,
18
19
  composeFarmFullDocument,
19
20
  createDefaultErrorMarkup,
@@ -38,11 +39,12 @@ import {
38
39
  removeFarmDocumentTitles,
39
40
  renderFarmLocaleAlternateLinks,
40
41
  resolveDefaultErrorStatus,
41
- routeBoundaryCoversDirectory
42
- } from "./chunk-NA77GEIU.mjs";
42
+ routeBoundaryCoversDirectory,
43
+ takeFarmHoistedHead
44
+ } from "./chunk-NV26EGMC.mjs";
43
45
  import {
44
46
  listFarmMCPLlmsTxtLinks
45
- } from "./chunk-MITIAOUQ.mjs";
47
+ } from "./chunk-645ENY7W.mjs";
46
48
  import {
47
49
  FARM_DEFAULT_MCP_PATH,
48
50
  collectFarmDefaultMCPPages,
@@ -61,6 +63,7 @@ import {
61
63
  uninstallFarmIslandValues
62
64
  } from "./chunk-A4PWGL46.mjs";
63
65
  import {
66
+ FarmSourceSnapshotStore,
64
67
  collectFarmRenderedClientModules,
65
68
  createEvaluatedRouteGraph,
66
69
  createMarkdownPageHydrationPlanner,
@@ -70,13 +73,17 @@ import {
70
73
  getClientModuleMetadata,
71
74
  getFarmClientHydrationPlanOptions,
72
75
  getIslandStrategyExport,
76
+ isFarmClientModulePlanUnchanged,
73
77
  mergeProgrammaticClientRoutes,
74
78
  resolveFarmIsolatedClientHydrationMode,
75
79
  resolveImportedModule,
76
80
  resolveProgrammaticClientRoutes,
81
+ runWithLatestPackageClientBoundaryCache,
77
82
  runWithPackageClientBoundaryCacheFile,
78
- usesFarmServerTree
79
- } from "./chunk-X7LGLF33.mjs";
83
+ traceFarmSourceReads,
84
+ usesFarmServerTree,
85
+ withFarmSourceSnapshot
86
+ } from "./chunk-3JN5M3T5.mjs";
80
87
  import {
81
88
  FARM_ISLAND_REPLAYABLE_SELECTOR
82
89
  } from "./chunk-S32PDOLO.mjs";
@@ -208,7 +215,7 @@ import {
208
215
  _setDefaultFarmI18nRuntime,
209
216
  createFarmI18nRuntime,
210
217
  getFarmI18nClientSnapshot
211
- } from "./chunk-3AUINHFG.mjs";
218
+ } from "./chunk-TNYC3TYP.mjs";
212
219
  import {
213
220
  formatOptionalPeerInstallHint,
214
221
  isOptionalPeerInstalled
@@ -243,7 +250,7 @@ import {
243
250
  } from "./chunk-TUOO6IK3.mjs";
244
251
  import {
245
252
  resolveFarmI18nConfig
246
- } from "./chunk-MU5V7XHL.mjs";
253
+ } from "./chunk-VJSXPN3W.mjs";
247
254
  import {
248
255
  fileExists,
249
256
  globFiles,
@@ -278,18 +285,14 @@ import {
278
285
  } from "./chunk-2DA7CLY7.mjs";
279
286
  import {
280
287
  FARM_VERSION
281
- } from "./chunk-RJUCNO7R.mjs";
282
- import {
283
- resolveFarmTrailingSlashRedirect,
284
- setFarmTrailingSlashPreference
285
- } from "./chunk-4O26BPUY.mjs";
288
+ } from "./chunk-77VNYVVX.mjs";
286
289
  import {
287
290
  normalizeFarmAPIConfig
288
291
  } from "./chunk-W6QLRQ3V.mjs";
289
292
  import {
290
293
  createFarmLocaleCookie,
291
294
  getFarmLocaleVaryHeaders
292
- } from "./chunk-7A3URI2F.mjs";
295
+ } from "./chunk-2EVESLP3.mjs";
293
296
  import {
294
297
  getFarmPageDataRedirect
295
298
  } from "./chunk-SD6JGJOM.mjs";
@@ -313,6 +316,10 @@ import {
313
316
  getFarmDeploymentMismatch,
314
317
  withoutFarmDeploymentCookie
315
318
  } from "./chunk-IWJONXPF.mjs";
319
+ import {
320
+ resolveFarmTrailingSlashRedirect,
321
+ setFarmTrailingSlashPreference
322
+ } from "./chunk-4O26BPUY.mjs";
316
323
  import {
317
324
  createFarmCacheKey
318
325
  } from "./chunk-GLOICKDO.mjs";
@@ -442,6 +449,8 @@ function getRouteSpecificity(entry) {
442
449
  function compareRouteEntries(left, right) {
443
450
  return compareRouteSpecificity(getRouteSpecificity(left), getRouteSpecificity(right));
444
451
  }
452
+ var PLAN_SOURCE = /\.(?:[cm]?[jt]sx?|vue|svelte)$/;
453
+ var NODE_MODULES_SEGMENT = `${path2.sep}node_modules${path2.sep}`;
445
454
  var RouteManager = class _RouteManager {
446
455
  constructor(config, viteServer) {
447
456
  this.routes = /* @__PURE__ */ new Map();
@@ -460,6 +469,14 @@ var RouteManager = class _RouteManager {
460
469
  this.programmaticClientRoutes = mergeProgrammaticClientRoutes([]);
461
470
  this.discovery = Promise.resolve();
462
471
  this.reportedIslandsErrors = /* @__PURE__ */ new Set();
472
+ // Each route module's hydration plan from the last plan, with the source files it read, so a dev
473
+ // replan recomputes only the modules that read an edited file. Every replan used to read and
474
+ // walk every route's import graph again, seconds on a large app, before an edit could update.
475
+ this.ownerPlans = /* @__PURE__ */ new Map();
476
+ this.sourceChangeTracking = false;
477
+ this.linkedSources = /* @__PURE__ */ new Map();
478
+ // Source files edited since the last plan; null when the next plan must recompute every module.
479
+ this.editedSources = null;
463
480
  this.config = config;
464
481
  this.viteServer = viteServer;
465
482
  if (viteServer) trackProgrammaticRouteSources();
@@ -775,10 +792,88 @@ var RouteManager = class _RouteManager {
775
792
  return this.clientManifestCache.manifest;
776
793
  }
777
794
  const cacheFile = this.packageClientBoundaryCacheFile;
778
- return cacheFile ? runWithPackageClientBoundaryCacheFile(
779
- cacheFile,
780
- () => this.computeClientManifest(normalizedProjectRoot)
781
- ) : this.computeClientManifest(normalizedProjectRoot);
795
+ const compute = () => withFarmSourceSnapshot(
796
+ () => this.computeClientManifest(normalizedProjectRoot),
797
+ this.sourceSnapshot
798
+ );
799
+ return cacheFile ? runWithPackageClientBoundaryCacheFile(cacheFile, compute) : compute();
800
+ }
801
+ /**
802
+ * @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
803
+ * reuse the plan of each route module that read none of the edited files. Without tracking,
804
+ * every plan recomputes every module.
805
+ */
806
+ trackSourceChanges() {
807
+ this.sourceChangeTracking = true;
808
+ this.sourceSnapshot ?? (this.sourceSnapshot = new FarmSourceSnapshotStore());
809
+ }
810
+ /**
811
+ * @internal A watched file changed. An edit to a script narrows the next replan to the route
812
+ * modules that read it; a script added or removed (where an import may now resolve), or a
813
+ * changed JSON file (a package manifest or tsconfig paths), replans everything. Other files
814
+ * (stylesheets, Markdown, assets) are not read by plans.
815
+ */
816
+ noteSourceChange(file, event) {
817
+ if (file.endsWith(".d.ts")) return;
818
+ if (PLAN_SOURCE.test(file)) {
819
+ if (event === "update") {
820
+ this.editedSources?.add(path2.resolve(file));
821
+ return;
822
+ }
823
+ } else if (!/\.jsonc?$/.test(file)) {
824
+ return;
825
+ }
826
+ this.editedSources = null;
827
+ this.sourceSnapshot?.clear();
828
+ this.linkedSources.clear();
829
+ }
830
+ /**
831
+ * @internal Whether an edit to `file` leaves the current plan as it is: a client module the
832
+ * last plan read whose directive, island and hydrate exports, export shape and imports the edit
833
+ * kept. The next replan reads it again (the watcher reported it).
834
+ */
835
+ isEditPlanNeutral(file) {
836
+ if (!this.sourceChangeTracking || !this.editedSources || !this.clientManifestCache) {
837
+ return false;
838
+ }
839
+ const previous = this.sourceSnapshot?.peekSource(path2.resolve(file));
840
+ return previous !== void 0 && isFarmClientModulePlanUnchanged(file, previous);
841
+ }
842
+ /**
843
+ * A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
844
+ * Callers get a copy, since the route budget rewrites a plan's fields in place.
845
+ */
846
+ planRouteModule(key, edited, compute) {
847
+ const previous = this.ownerPlans.get(key);
848
+ if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
849
+ return { ...previous.plan };
850
+ }
851
+ const { result, files } = traceFarmSourceReads(compute);
852
+ const sources = /* @__PURE__ */ new Set();
853
+ for (const file of files) {
854
+ const source = this.planSourcePath(file);
855
+ if (source) sources.add(source);
856
+ }
857
+ this.ownerPlans.set(key, { plan: result, files: sources });
858
+ return { ...result };
859
+ }
860
+ /**
861
+ * The path the watcher reports for a file a plan read: itself, or the real path of a workspace
862
+ * package's source read through its `node_modules` link. Null for an installed package's file.
863
+ */
864
+ planSourcePath(file) {
865
+ if (!file.includes(NODE_MODULES_SEGMENT)) return file;
866
+ let source = this.linkedSources.get(file);
867
+ if (source === void 0) {
868
+ try {
869
+ const real = realpathSync(file);
870
+ source = real.includes(NODE_MODULES_SEGMENT) ? null : real;
871
+ } catch {
872
+ source = null;
873
+ }
874
+ this.linkedSources.set(file, source);
875
+ }
876
+ return source;
782
877
  }
783
878
  /**
784
879
  * @internal Keep package client-boundary inspections in `file` between plans, as the dev server
@@ -787,6 +882,15 @@ var RouteManager = class _RouteManager {
787
882
  usePackageClientBoundaryCacheFile(file) {
788
883
  this.packageClientBoundaryCacheFile = file;
789
884
  }
885
+ /**
886
+ * @internal Run `operation` (synchronous) with the package inspections of the latest plan, as
887
+ * the dev server's transforms and renders inspect the packages a module imports. Without a cache
888
+ * file (outside the dev server), it runs as it is.
889
+ */
890
+ inspectPackages(operation) {
891
+ const file = this.packageClientBoundaryCacheFile;
892
+ return file ? runWithLatestPackageClientBoundaryCache(file, operation) : operation();
893
+ }
790
894
  computeClientManifest(normalizedProjectRoot) {
791
895
  const toUrlPath = (absolutePath) => {
792
896
  const rootRelative = toRootRelativeUrlPath(absolutePath, normalizedProjectRoot);
@@ -820,27 +924,50 @@ var RouteManager = class _RouteManager {
820
924
  Boolean(unsupportedIntegrationProvider)
821
925
  );
822
926
  const islandsMode = resolveFarmServerComponentsMode(this.config.experimental?.serverComponents) === "islands";
927
+ const changed = this.sourceSnapshot?.refresh(this.editedSources ?? []);
928
+ let edited = null;
929
+ if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
930
+ edited = /* @__PURE__ */ new Set();
931
+ for (const [file, previous] of changed ?? []) {
932
+ if (isFarmClientModulePlanUnchanged(file, previous)) continue;
933
+ const source = this.planSourcePath(file);
934
+ if (source) edited.add(source);
935
+ }
936
+ }
937
+ if (!edited) this.ownerPlans.clear();
823
938
  const layoutEntries = Array.from(this.layouts.values()).map((entry) => ({
824
939
  entry,
825
- metadata: getClientModuleHydrationPlan(
826
- entry.modulePath,
827
- normalizedProjectRoot,
828
- isolatedMode,
829
- islandsMode ? { ...planOptions, serverTreeLayouts: true } : planOptions
940
+ metadata: this.planRouteModule(
941
+ `layout:${entry.modulePath}`,
942
+ edited,
943
+ () => getClientModuleHydrationPlan(
944
+ entry.modulePath,
945
+ normalizedProjectRoot,
946
+ isolatedMode,
947
+ islandsMode ? { ...planOptions, serverTreeLayouts: true } : planOptions
948
+ )
830
949
  )
831
950
  }));
832
- const markdownPagePlan = createMarkdownPageHydrationPlanner(
951
+ const markdownComponentsPlan = createMarkdownPageHydrationPlanner(
833
952
  resolveFarmMdxComponentsModulePath(resolveMdxConfig(this.config.mdx), normalizedProjectRoot),
834
953
  normalizedProjectRoot,
835
954
  isolatedMode,
836
955
  { ...planOptions, packageReferences: islandsMode }
837
956
  );
957
+ let markdownPlan;
958
+ const markdownPagePlan = () => ({
959
+ ...markdownPlan ?? (markdownPlan = this.planRouteModule("markdown", edited, markdownComponentsPlan))
960
+ });
838
961
  const routeEntries = Array.from(this.routes.values()).map((entry) => ({
839
962
  entry,
840
- metadata: isFarmMarkdownPageFile(entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(entry.modulePath, normalizedProjectRoot, isolatedMode, {
841
- ...planOptions,
842
- serverOwners: resolveFarmServerComponentsMode(this.config.experimental?.serverComponents) === "islands"
843
- })
963
+ metadata: isFarmMarkdownPageFile(entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
964
+ `page:${entry.modulePath}`,
965
+ edited,
966
+ () => getClientModuleHydrationPlan(entry.modulePath, normalizedProjectRoot, isolatedMode, {
967
+ ...planOptions,
968
+ serverOwners: resolveFarmServerComponentsMode(this.config.experimental?.serverComponents) === "islands"
969
+ })
970
+ )
844
971
  }));
845
972
  const markdownFallback = routeEntries.find(
846
973
  ({ entry, metadata }) => isFarmMarkdownPageFile(entry.modulePath) && metadata.fallbackReason
@@ -997,6 +1124,7 @@ var RouteManager = class _RouteManager {
997
1124
  logger.error(`[Farm.js] islands mode cannot hydrate ${error}`);
998
1125
  }
999
1126
  const manifest = { routes, layouts, slots };
1127
+ this.editedSources = this.sourceChangeTracking ? /* @__PURE__ */ new Set() : null;
1000
1128
  this.clientManifestCache = {
1001
1129
  projectRoot: normalizedProjectRoot,
1002
1130
  manifest,
@@ -2882,7 +3010,28 @@ function inferFarmIslandStrategy(filePath, root) {
2882
3010
  });
2883
3011
  return result;
2884
3012
  }
3013
+ var routeRootInferences = /* @__PURE__ */ new Map();
3014
+ function invalidateFarmRouteRootInferences() {
3015
+ routeRootInferences.clear();
3016
+ }
2885
3017
  function inferFarmRouteRootStrategy(owners, root) {
3018
+ const key = [root ?? "", ...owners.map((owner) => path6.resolve(owner))].join("\n");
3019
+ const cached = routeRootInferences.get(key);
3020
+ if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
3021
+ return cached.result;
3022
+ }
3023
+ const { result, files } = traceFarmSourceReads(() => inferRouteRoot(owners, root));
3024
+ const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
3025
+ routeRootInferences.set(key, {
3026
+ stamps: [...read].map((file) => [file, modifiedAt(file)]),
3027
+ result
3028
+ });
3029
+ return result;
3030
+ }
3031
+ function isInstalledPackageFile(file) {
3032
+ return file.split(path6.sep).includes("node_modules");
3033
+ }
3034
+ function inferRouteRoot(owners, root) {
2886
3035
  const files = [];
2887
3036
  const modules = [];
2888
3037
  for (const owner of owners) {
@@ -3655,6 +3804,11 @@ var ServerRenderer = class {
3655
3804
  return this.rendererRuntime.wrapClientGraph(element);
3656
3805
  }
3657
3806
  /** The page a hydrating layout keeps as server HTML: islands again, or a server tree. */
3807
+ /** The route root's strategy, inspecting packages with the dev server's latest plan's cache. */
3808
+ resolveRouteRootStrategy(...args) {
3809
+ const resolve3 = () => resolveFarmRouteRootStrategy(...args);
3810
+ return typeof this.routeManager.inspectPackages === "function" ? this.routeManager.inspectPackages(resolve3) : resolve3();
3811
+ }
3658
3812
  async isolateServerPage(element, serverTree) {
3659
3813
  if (islands && this.islandValues()) {
3660
3814
  const runtime = islands;
@@ -3730,7 +3884,11 @@ var ServerRenderer = class {
3730
3884
  );
3731
3885
  return { html: rendered.html, head: rendered.head || "" };
3732
3886
  }
3733
- return { html: await this.renderElementToCompleteHTML(element, options), head: "" };
3887
+ const { head, body } = takeFarmHoistedHead(
3888
+ await this.renderElementToCompleteHTML(element, options),
3889
+ true
3890
+ );
3891
+ return { html: body, head };
3734
3892
  }
3735
3893
  /** Islands mode sends large prop values once, keyed by content (RFC 0003). */
3736
3894
  islandValues() {
@@ -3890,7 +4048,11 @@ var ServerRenderer = class {
3890
4048
  key,
3891
4049
  { html },
3892
4050
  {
3893
- paths: [options.pathname],
4051
+ // revalidatePath() takes the route path (`/pricing`), as the docs show, while the shell
4052
+ // answers the public one (`/console/fr/pricing`): either clears it, as in production.
4053
+ paths: [
4054
+ .../* @__PURE__ */ new Set([options.pathname, this.routeManager.toRoutePathname(options.pathname)])
4055
+ ],
3894
4056
  tags: ["ppr"],
3895
4057
  revalidate: options.revalidate ?? false
3896
4058
  }
@@ -4494,7 +4656,7 @@ var ServerRenderer = class {
4494
4656
  (metadata) => metadata.shouldHydrate && metadata.islandStrategy ? [metadata.islandStrategy] : []
4495
4657
  )
4496
4658
  ];
4497
- const hydrationIslandStrategy = this.islandValues() ? resolveFarmRouteRootStrategy(
4659
+ const hydrationIslandStrategy = this.islandValues() ? this.resolveRouteRootStrategy(
4498
4660
  route,
4499
4661
  { shouldHydrate, islandStrategy: moduleMetadata.islandStrategy ?? null },
4500
4662
  layouts.map((layout, index) => ({
@@ -5470,7 +5632,7 @@ var ServerRenderer = class {
5470
5632
  options.middlewareMap,
5471
5633
  () => _runWithMiddlewareContext(
5472
5634
  options.middlewareContext,
5473
- () => this.rendererRuntime.renderToString(wrapped, rendererRenderOptions())
5635
+ () => this.renderElementToCompleteHTML(wrapped)
5474
5636
  )
5475
5637
  );
5476
5638
  res.statusCode = options.statusCode;
@@ -5932,11 +6094,20 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
5932
6094
  <body class="">${earlyClient ? `
5933
6095
  ${earlyClientScript}` : ""}
5934
6096
  <div id="root">`;
5935
- const securedShell = streamDocument ? "" : stampDocumentHTML(shell);
5936
- if (securedShell) {
5937
- htmlParts.push(securedShell);
5938
- staticShellParts?.push(securedShell);
5939
- }
6097
+ let pendingShell = streamDocument ? "" : stampDocumentHTML(shell);
6098
+ let heldHead = "";
6099
+ const releaseShell = (complete) => {
6100
+ const split = takeFarmHoistedHead(heldHead, complete);
6101
+ if (!split) return null;
6102
+ const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? removeFarmDocumentTitles(pendingShell) : pendingShell;
6103
+ const opened = appendFarmHead(shellHead, split.head);
6104
+ pendingShell = "";
6105
+ heldHead = "";
6106
+ htmlParts.push(opened);
6107
+ staticShellParts?.push(opened);
6108
+ res.write(opened);
6109
+ return split.body;
6110
+ };
5940
6111
  const withEarlyClient = (document) => earlyClient ? {
5941
6112
  ...document,
5942
6113
  html: document.html.replace(
@@ -6016,6 +6187,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
6016
6187
  const writableStream = new Writable({
6017
6188
  write(chunk, encoding, callback) {
6018
6189
  if (flushMarker && chunk === flushMarker) {
6190
+ if (pendingShell) releaseShell(true);
6019
6191
  const marker = documentTransform ? documentTransform.write(flushMarker.toString()) : flushMarker;
6020
6192
  res.write(marker, () => {
6021
6193
  if (typeof res.flush === "function") res.flush();
@@ -6028,7 +6200,18 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
6028
6200
  firstChunk = false;
6029
6201
  }
6030
6202
  const chunkText = Buffer.isBuffer(chunk) ? cspStreamDecoder ? cspStreamDecoder.decode(chunk, { stream: true }) : chunk.toString() : String(chunk);
6031
- const securedChunkText = cspNonceRewriter ? cspNonceRewriter.write(chunkText) : chunkText;
6203
+ let securedChunkText = cspNonceRewriter ? cspNonceRewriter.write(chunkText) : chunkText;
6204
+ let held = false;
6205
+ if (pendingShell) {
6206
+ heldHead += securedChunkText;
6207
+ const body = releaseShell(false);
6208
+ if (body === null) {
6209
+ callback();
6210
+ return;
6211
+ }
6212
+ securedChunkText = body;
6213
+ held = true;
6214
+ }
6032
6215
  const outputText = documentTransform ? documentTransform.write(securedChunkText) : securedChunkText;
6033
6216
  recordRenderedChunk(outputText, securedChunkText);
6034
6217
  const onWrite = () => {
@@ -6038,10 +6221,18 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
6038
6221
  if (documentTransform) {
6039
6222
  if (outputText) res.write(outputText, onWrite);
6040
6223
  else callback();
6041
- } else if (cspNonceRewriter) res.write(securedChunkText, onWrite);
6224
+ } else if (cspNonceRewriter || held) res.write(securedChunkText, onWrite);
6042
6225
  else res.write(chunk, encoding, onWrite);
6043
6226
  },
6044
6227
  final: (callback) => {
6228
+ if (pendingShell) {
6229
+ const body = releaseShell(true);
6230
+ if (body) {
6231
+ htmlParts.push(body);
6232
+ staticShellParts?.push(body);
6233
+ res.write(body);
6234
+ }
6235
+ }
6045
6236
  if (lateNavigationError) {
6046
6237
  const navigationError = lateNavigationError;
6047
6238
  lateNavigationError = null;
@@ -6114,7 +6305,6 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
6114
6305
  });
6115
6306
  resolve3();
6116
6307
  };
6117
- res.write(securedShell);
6118
6308
  if (typeof res.flush === "function") {
6119
6309
  res.flush();
6120
6310
  }
@@ -6230,11 +6420,10 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
6230
6420
  const NotFoundComponent = await this.loadNotFoundComponent();
6231
6421
  if (NotFoundComponent) {
6232
6422
  try {
6233
- content = await this.rendererRuntime.renderToString(
6423
+ content = await this.renderElementToCompleteHTML(
6234
6424
  await this.wrapWithIntegrationProviders(
6235
6425
  this.rendererRuntime.createElement(NotFoundComponent, { pathname })
6236
- ),
6237
- rendererRenderOptions()
6426
+ )
6238
6427
  );
6239
6428
  } catch (error2) {
6240
6429
  logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
@@ -6296,10 +6485,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
6296
6485
  });
6297
6486
  }
6298
6487
  element = await this.wrapWithIntegrationProviders(element);
6299
- const content = await this.rendererRuntime.renderToString(
6300
- element,
6301
- rendererRenderOptions()
6302
- );
6488
+ const content = await this.renderElementToCompleteHTML(element);
6303
6489
  const { head: head2, metadata: metadata2 } = await this.notFoundMetadataHead(layoutModule, notFoundModule);
6304
6490
  const html2 = this.createFullHTML(content, false, pathname, head2, { req, metadata: metadata2 });
6305
6491
  res.setHeader("Content-Type", "text/html; charset=utf-8");
@@ -7669,6 +7855,7 @@ export {
7669
7855
  generateFarmIntegrationProviderClientCode,
7670
7856
  generateFarmIntegrationProviderServerModules,
7671
7857
  inferFarmIslandStrategy,
7858
+ invalidateFarmRouteRootInferences,
7672
7859
  resolveFarmRouteRootStrategy,
7673
7860
  canBootFarmIslandsClient,
7674
7861
  ServerRenderer,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-JMFTKNBA.mjs";
5
5
  import {
6
6
  normalizeFarmProductionSiteOrigin
7
- } from "./chunk-V25GSH43.mjs";
7
+ } from "./chunk-AUAMXI6N.mjs";
8
8
  import {
9
9
  resolveFarmAppManifestConfig
10
10
  } from "./chunk-SQ5O7I3L.mjs";
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-QDWMCFTH.mjs";
30
30
  import {
31
31
  FARM_VERSION
32
- } from "./chunk-RJUCNO7R.mjs";
32
+ } from "./chunk-77VNYVVX.mjs";
33
33
  import {
34
34
  applyFarmBasePath
35
35
  } from "./chunk-SF3JB56B.mjs";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.1.71";
2
+ var version = "0.1.72";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -10,7 +10,7 @@ var _chunk42KMUIWZcjs = require('./chunk-42KMUIWZ.cjs');
10
10
  var _chunkXVSBALOYcjs = require('./chunk-XVSBALOY.cjs');
11
11
 
12
12
 
13
- var _chunkKEB7AGS6cjs = require('./chunk-KEB7AGS6.cjs');
13
+ var _chunk3WG7GJQLcjs = require('./chunk-3WG7GJQL.cjs');
14
14
 
15
15
 
16
16
 
@@ -156,7 +156,7 @@ async function createFarmRscViteConfig(userConfig, options) {
156
156
  server: { environmentName: "rsc" },
157
157
  config: {
158
158
  preset: options.preset,
159
- outputDir: options.outputDir && _chunkKEB7AGS6cjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
159
+ outputDir: options.outputDir && _chunk3WG7GJQLcjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
160
160
  }
161
161
  })
162
162
  ]
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FARM_VERSION
3
- } from "./chunk-RJUCNO7R.mjs";
3
+ } from "./chunk-77VNYVVX.mjs";
4
4
 
5
5
  // src/deployment-environment.ts
6
6
  function isFarmProductionDeploymentEnvironment(env = process.env) {