@farm.js/core 0.1.86 → 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.
- package/dist/{agent-mcp.d-7uKdOttc.d.ts → agent-mcp.d-BdM0pIrD.d.ts} +1 -1
- package/dist/{agent-mcp.d-LChlR2au.d.mts → agent-mcp.d-CMGqpUbk.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-LLU2Z6I4.cjs +17 -0
- package/dist/{analyzer-I5S5YKHM.mjs → analyzer-W4EB7DHL.mjs} +2 -2
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.cjs +3 -3
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +2 -2
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +4 -4
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +3 -3
- package/dist/{app-manifest.d-QMdmqqCr.d.mts → app-manifest.d-BeDB2OVm.d.mts} +1 -1
- package/dist/{app-manifest.d-CRp21oAz.d.ts → app-manifest.d-COhjPgHn.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-Bvpc2eJq.d.mts → app.d-AVZXCfcO.d.mts} +5 -4
- package/dist/{app.d-DEKpJEp4.d.ts → app.d-b3A4cca5.d.ts} +5 -4
- package/dist/{chunk-SB74WCKC.mjs → chunk-26HESRBL.mjs} +4 -4
- package/dist/chunk-2HTNASSB.cjs +134 -0
- package/dist/{chunk-BAD6T5NU.cjs → chunk-33WR5XV5.cjs} +4 -4
- package/dist/{chunk-YMAE32O7.mjs → chunk-3F55K4MC.mjs} +1 -1
- package/dist/{chunk-CVKTYG4L.mjs → chunk-4FGTNYHE.mjs} +2 -2
- package/dist/{chunk-CFKAYV7B.mjs → chunk-5D73SKF3.mjs} +1 -1
- package/dist/{chunk-Q3YWQEUS.cjs → chunk-7BNVUIGL.cjs} +2 -2
- package/dist/{chunk-RA5OUXOJ.mjs → chunk-A2PPQ5LB.mjs} +2 -2
- package/dist/{chunk-KHIEGVG7.mjs → chunk-ALOFMAFA.mjs} +10 -4
- package/dist/{chunk-BLZCAFGJ.cjs → chunk-CXHVRHM2.cjs} +2 -2
- package/dist/{chunk-3RVLJTFZ.mjs → chunk-D7LXBLUW.mjs} +1 -1
- package/dist/{chunk-45ANSCTO.mjs → chunk-EZYNIADW.mjs} +63 -37
- package/dist/{chunk-NAHDG6UX.mjs → chunk-HFRG2IQS.mjs} +1 -1
- package/dist/{chunk-7H2TXT2K.mjs → chunk-HX5HLFBZ.mjs} +7 -0
- package/dist/{chunk-2NKNP4AH.cjs → chunk-HYL372GW.cjs} +1 -1
- package/dist/{chunk-25JGHAGH.cjs → chunk-I2RBHZF7.cjs} +15 -8
- package/dist/{chunk-NXOZRI3B.cjs → chunk-IM422XKU.cjs} +2 -2
- package/dist/{chunk-6QYPP5KC.mjs → chunk-K5FLQJW5.mjs} +2 -2
- package/dist/chunk-K6RMOB25.mjs +134 -0
- package/dist/{chunk-UAQQUQWE.mjs → chunk-LBJOHMTB.mjs} +1 -1
- package/dist/{chunk-QYWP5KDY.mjs → chunk-LIWVPE72.mjs} +59 -21
- package/dist/{chunk-FDU4Q4QP.cjs → chunk-MZR22RAC.cjs} +10 -4
- package/dist/chunk-NDMPGFKL.cjs +47 -0
- package/dist/{chunk-YHM4PXJY.mjs → chunk-O5YM6GU3.mjs} +1 -1
- package/dist/{chunk-GWPANDW3.mjs → chunk-O7K4HMAQ.mjs} +1 -1
- package/dist/{chunk-7UTRNV6R.mjs → chunk-Q73LRKLP.mjs} +1 -1
- package/dist/{chunk-3TKGMIPX.mjs → chunk-QLRI2BX5.mjs} +90 -11
- package/dist/{chunk-PAENAKTC.mjs → chunk-QSDIJ45N.mjs} +1 -1
- package/dist/{chunk-UDWBTABT.cjs → chunk-RGYS5OPL.cjs} +3 -3
- package/dist/{chunk-FWLXYNWA.cjs → chunk-SDNYULFS.cjs} +347 -321
- package/dist/chunk-TCGPBSVY.mjs +47 -0
- package/dist/{chunk-P253SZJF.cjs → chunk-TI4BZV6M.cjs} +353 -274
- package/dist/{chunk-QYDGIXQ5.cjs → chunk-U3A46QFD.cjs} +9 -9
- package/dist/{chunk-VGHDPEPQ.cjs → chunk-UA77C2ZA.cjs} +2 -2
- package/dist/{chunk-U54REWMJ.cjs → chunk-VCI776NG.cjs} +13 -13
- package/dist/{chunk-IAERD73G.cjs → chunk-VCZ4EM5K.cjs} +367 -329
- package/dist/{chunk-5P65LXGU.cjs → chunk-WSQ3S3NV.cjs} +2 -2
- package/dist/{chunk-VTEAUQMT.mjs → chunk-X2SMVPLH.mjs} +19 -3
- package/dist/{chunk-TQJ35BBW.cjs → chunk-XFUPWRKT.cjs} +4 -4
- package/dist/{chunk-DJ3PVHTW.cjs → chunk-XGPRM7OK.cjs} +3 -3
- package/dist/{chunk-CPSFDQKJ.cjs → chunk-Z43CIBUR.cjs} +20 -4
- package/dist/{chunk-L2IULWKV.cjs → chunk-ZCX2XJPY.cjs} +3 -3
- package/dist/{cli-runtime.d-DaElKjaL.d.ts → cli-runtime.d-jqZ7YCsm.d.ts} +5 -5
- package/dist/{cli-runtime.d-C7aMfoTq.d.mts → cli-runtime.d-qL44rqYO.d.mts} +5 -5
- package/dist/{client-component.d-miqIXyQv.d.mts → client-component.d-B2L2LyAr.d.mts} +1 -1
- package/dist/{client-component.d-CZG02pIh.d.ts → client-component.d-BDD5aiUb.d.ts} +1 -1
- package/dist/{client-plugins.d-BVXjyIkY.d.ts → client-plugins.d-Crct3m_r.d.ts} +14 -5
- package/dist/{client-plugins.d-BwKwuO_0.d.mts → client-plugins.d-Dzc3vOw_.d.mts} +14 -5
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +8 -7
- package/dist/client.d.ts +8 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-A3L7WNTB.cjs → devtools-GPIKZ5AV.cjs} +5 -3
- package/dist/{devtools-DGC2247E.mjs → devtools-GWJZPWIW.mjs} +4 -2
- package/dist/docs.cjs +6 -4
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +5 -3
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/font.cjs +4 -2
- package/dist/font.d.mts +13 -1
- package/dist/font.d.ts +13 -1
- package/dist/font.mjs +3 -1
- package/dist/{handler.d-BKTWzzNA.d.mts → handler.d-B1S1ZBqS.d.mts} +1 -1
- package/dist/{handler.d-Dzpyg3-N.d.ts → handler.d-ZweCBJD4.d.ts} +1 -1
- package/dist/{headers.d-PZyXcDAH.d.ts → headers.d-BgBdQN8x.d.ts} +1 -1
- package/dist/{headers.d-5opjyhXw.d.mts → headers.d-C-yGl_f6.d.mts} +1 -1
- package/dist/image-attributes.d-BMPDQO1q.d.mts +55 -0
- package/dist/image-attributes.d-BMPDQO1q.d.ts +55 -0
- package/dist/image.cjs +5 -127
- package/dist/image.d.mts +3 -13
- package/dist/image.d.ts +3 -13
- package/dist/image.mjs +5 -127
- package/dist/index.cjs +24 -22
- package/dist/{index.d-C0Mie66f.d.mts → index.d-13h3oDu7.d.mts} +1 -1
- package/dist/{index.d-DV2q-0mE.d.ts → index.d-CtoniAXT.d.ts} +1 -1
- package/dist/index.d.mts +24 -23
- package/dist/index.d.ts +24 -23
- package/dist/index.mjs +23 -21
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +19 -19
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +18 -18
- package/dist/internal/cli-runtime.cjs +5 -3
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +4 -2
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +66 -40
- package/dist/internal/client-runtime.d.mts +6 -6
- package/dist/internal/client-runtime.d.ts +6 -6
- package/dist/internal/client-runtime.mjs +53 -27
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +6 -4
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +5 -3
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-boot.cjs +44 -16
- package/dist/internal/islands-boot.d.mts +3 -1
- package/dist/internal/islands-boot.d.ts +3 -1
- package/dist/internal/islands-boot.mjs +28 -0
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +6 -6
- package/dist/internal/production-runtime.d.mts +10 -10
- package/dist/internal/production-runtime.d.ts +10 -10
- package/dist/internal/production-runtime.mjs +5 -5
- package/dist/internal/renderer-islands.cjs +35 -8
- package/dist/internal/renderer-islands.d.mts +9 -1
- package/dist/internal/renderer-islands.d.ts +9 -1
- package/dist/internal/renderer-islands.mjs +35 -8
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/{island-runtime.d-BA7EPo1v.d.ts → island-runtime.d-D2Mh5eTU.d.ts} +5 -1
- package/dist/{island-runtime.d-BBS_YUSX.d.mts → island-runtime.d-lrpEJlgg.d.mts} +5 -1
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.mjs +3 -3
- package/dist/{mount.d-gWul1GA1.d.ts → mount.d-DyKlRR6z.d.ts} +1 -1
- package/dist/{mount.d-CZ_qL1iS.d.mts → mount.d-_6Un9wdK.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BBTzhJLj.d.mts → navigation-delegate.d-ChfinbWB.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BZsYEAet.d.ts → navigation-delegate.d-fMgELdAe.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{plugin-QOTAPTVV.mjs → plugin-EVKQZBNW.mjs} +1 -1
- package/dist/{plugin-3PT7I26P.cjs → plugin-MWO3G2XM.cjs} +2 -2
- package/dist/plugin.cjs +16 -16
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +15 -15
- package/dist/{render-plan.d-AaJsYPX-.d.ts → render-plan.d-D0FV9lDT.d.ts} +1 -1
- package/dist/{render-plan.d-bnWxS12w.d.mts → render-plan.d-DaM1NPnm.d.mts} +1 -1
- package/dist/renderer-client.cjs +6 -1
- package/dist/renderer-client.d.mts +6 -5
- package/dist/renderer-client.d.ts +6 -5
- package/dist/renderer-client.mjs +5 -0
- package/dist/renderer.cjs +3 -3
- package/dist/renderer.mjs +2 -2
- package/dist/{request.d-CAeitOG1.d.ts → request.d-CrXC7voZ.d.ts} +1 -1
- package/dist/{request.d-C2HOn3Hi.d.mts → request.d-DVSLilGx.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-CYA-ulnX.d.mts → route-rendering.d-CWi3UYtR.d.mts} +1 -1
- package/dist/{route-rendering.d-A1dIkUK5.d.ts → route-rendering.d-OfbM_rj8.d.ts} +1 -1
- package/dist/{router.d-A_Yt6jYz.d.ts → router.d-D5Mp7bpO.d.ts} +1 -1
- package/dist/{router.d-8lxnzlkr.d.mts → router.d-DrQ1QDFk.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-BROS3NEB.mjs → rsc-pipeline-KLMQU3YP.mjs} +5 -3
- package/dist/{rsc-pipeline-SNGPAXGW.cjs → rsc-pipeline-TQOSDWOU.cjs} +6 -4
- package/dist/{runtime-SLJLW37A.mjs → runtime-BDPBO65S.mjs} +5 -3
- package/dist/{runtime-7T5TRAWL.cjs → runtime-CQSCRVZ7.cjs} +7 -5
- package/dist/{runtime.d-C_rZ9_DD.d.mts → runtime.d-BVj6apd0.d.mts} +1 -1
- package/dist/{runtime.d-BPyvWrgQ.d.ts → runtime.d-D7QYVJGO.d.ts} +1 -1
- package/dist/{server-components-status.d-BpxiEMQE.d.mts → server-components-status.d-BDVcxi0z.d.mts} +1 -1
- package/dist/{server-components-status.d-C2UEKJn7.d.ts → server-components-status.d-CfKDpmCH.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +37 -37
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +17 -17
- package/dist/{spa-router.d-Cw5i_15e.d.ts → spa-router.d-BXxoU3Cv.d.ts} +2 -2
- package/dist/{spa-router.d-BD-6WX1R.d.mts → spa-router.d-CXgvy-7L.d.mts} +2 -2
- package/dist/{ssg.d-CCE9aob5.d.mts → ssg.d-DS-gXUbf.d.mts} +2 -2
- package/dist/{ssg.d-Bifiq0EL.d.ts → ssg.d-jXlUAKzg.d.ts} +2 -2
- package/dist/{store-core.d-BN2MxSG9.d.mts → store-core.d-CDbVAbTn.d.mts} +3 -2
- package/dist/{store-core.d-5tVn5vi1.d.ts → store-core.d-D00BsbnO.d.ts} +3 -2
- package/dist/testing.cjs +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +2 -2
- package/dist/{utils.d-BUjpSNIO.d.ts → utils.d-BODwBtkz.d.ts} +1 -1
- package/dist/{utils.d-wGPLeVbq.d.mts → utils.d-Cmj-fzds.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +21 -19
- package/dist/vite.d.mts +21 -7
- package/dist/vite.d.ts +21 -7
- package/dist/vite.mjs +20 -18
- package/package.json +2 -2
- package/dist/analyzer-OEMQSLYT.cjs +0 -17
- package/dist/chunk-7EPYN7GW.cjs +0 -30
- package/dist/chunk-HZOMT5DY.mjs +0 -30
- package/dist/{chunk-4B6YJ5DS.cjs → chunk-4ZVKDHS6.cjs} +3 -3
- package/dist/{chunk-4EEAPBNV.mjs → chunk-PEQJ4UUT.mjs} +3 -3
|
@@ -56,10 +56,10 @@ var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
var
|
|
59
|
+
var _chunk4ZVKDHS6cjs = require('./chunk-4ZVKDHS6.cjs');
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
var
|
|
62
|
+
var _chunkXFUPWRKTcjs = require('./chunk-XFUPWRKT.cjs');
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
@@ -104,7 +104,7 @@ var _chunkWOAXQ5MZcjs = require('./chunk-WOAXQ5MZ.cjs');
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
var
|
|
107
|
+
var _chunkU3A46QFDcjs = require('./chunk-U3A46QFD.cjs');
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
@@ -168,9 +168,6 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
168
168
|
var _chunkT7UC2ORAcjs = require('./chunk-T7UC2ORA.cjs');
|
|
169
169
|
|
|
170
170
|
|
|
171
|
-
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
172
|
-
|
|
173
|
-
|
|
174
171
|
var _chunkHQKCSJEHcjs = require('./chunk-HQKCSJEH.cjs');
|
|
175
172
|
|
|
176
173
|
|
|
@@ -267,7 +264,8 @@ var _chunkJRGR5Z4Kcjs = require('./chunk-JRGR5Z4K.cjs');
|
|
|
267
264
|
var _chunkSNP33A33cjs = require('./chunk-SNP33A33.cjs');
|
|
268
265
|
|
|
269
266
|
|
|
270
|
-
|
|
267
|
+
|
|
268
|
+
var _chunkI2RBHZF7cjs = require('./chunk-I2RBHZF7.cjs');
|
|
271
269
|
|
|
272
270
|
|
|
273
271
|
var _chunkZMSVKVI3cjs = require('./chunk-ZMSVKVI3.cjs');
|
|
@@ -306,12 +304,15 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
306
304
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
307
305
|
|
|
308
306
|
|
|
309
|
-
var
|
|
307
|
+
var _chunkHYL372GWcjs = require('./chunk-HYL372GW.cjs');
|
|
310
308
|
|
|
311
309
|
|
|
312
310
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
313
311
|
|
|
314
312
|
|
|
313
|
+
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
314
|
+
|
|
315
|
+
|
|
315
316
|
var _chunkWKVYF2B5cjs = require('./chunk-WKVYF2B5.cjs');
|
|
316
317
|
|
|
317
318
|
|
|
@@ -507,7 +508,7 @@ var RouteManager = class _RouteManager {
|
|
|
507
508
|
this.redirects = /* @__PURE__ */ new Map();
|
|
508
509
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
509
510
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
510
|
-
this.programmaticClientRoutes =
|
|
511
|
+
this.programmaticClientRoutes = _chunkU3A46QFDcjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
511
512
|
// The hydration settings each route rule returned, by file.
|
|
512
513
|
this.rendererRouteHydration = /* @__PURE__ */ new Map();
|
|
513
514
|
this.disposeRendererHydration = () => {
|
|
@@ -596,7 +597,7 @@ var RouteManager = class _RouteManager {
|
|
|
596
597
|
});
|
|
597
598
|
}
|
|
598
599
|
}
|
|
599
|
-
this.disposeRendererHydration =
|
|
600
|
+
this.disposeRendererHydration = _chunkU3A46QFDcjs.setFarmRendererHydrationScope.call(void 0,
|
|
600
601
|
_chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, this.config).map((source) => source.root),
|
|
601
602
|
renderer,
|
|
602
603
|
routeModules
|
|
@@ -632,7 +633,7 @@ var RouteManager = class _RouteManager {
|
|
|
632
633
|
await this.discoverFileRoutes(source);
|
|
633
634
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
634
635
|
}
|
|
635
|
-
this.programmaticClientRoutes =
|
|
636
|
+
this.programmaticClientRoutes = _chunkU3A46QFDcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
636
637
|
for (const slot of this.routeSlots.values()) {
|
|
637
638
|
if (slot.interception && !this.pageRouteShapes.has(_chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
638
639
|
throw new (0, _chunkML4TOUZPcjs.AmbiguousRouteError)(
|
|
@@ -651,8 +652,8 @@ var RouteManager = class _RouteManager {
|
|
|
651
652
|
)
|
|
652
653
|
);
|
|
653
654
|
this.orderedLayouts = Array.from(this.layouts.values()).sort(
|
|
654
|
-
(left, right) =>
|
|
655
|
-
).map((entry) => ({ entry, groupScope:
|
|
655
|
+
(left, right) => _chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, right.pattern)
|
|
656
|
+
).map((entry) => ({ entry, groupScope: _chunk4ZVKDHS6cjs.getRouteGroupScope.call(void 0, entry.pattern) }));
|
|
656
657
|
for (const slot of this.routeSlots.values()) {
|
|
657
658
|
if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
|
|
658
659
|
this.routeSlotOwnerSegments.set(
|
|
@@ -925,11 +926,11 @@ var RouteManager = class _RouteManager {
|
|
|
925
926
|
return this.clientManifestCache.manifest;
|
|
926
927
|
}
|
|
927
928
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
928
|
-
const compute = () =>
|
|
929
|
+
const compute = () => _chunkU3A46QFDcjs.withFarmSourceSnapshot.call(void 0,
|
|
929
930
|
() => this.computeClientManifest(normalizedProjectRoot),
|
|
930
931
|
this.sourceSnapshot
|
|
931
932
|
);
|
|
932
|
-
return cacheFile ?
|
|
933
|
+
return cacheFile ? _chunkU3A46QFDcjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
|
|
933
934
|
}
|
|
934
935
|
/**
|
|
935
936
|
* @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
|
|
@@ -938,7 +939,7 @@ var RouteManager = class _RouteManager {
|
|
|
938
939
|
*/
|
|
939
940
|
trackSourceChanges() {
|
|
940
941
|
this.sourceChangeTracking = true;
|
|
941
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
942
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkU3A46QFDcjs.FarmSourceSnapshotStore)())));
|
|
942
943
|
}
|
|
943
944
|
/**
|
|
944
945
|
* @internal A production build edits no source while it runs, so what the plan reads, parses and
|
|
@@ -947,7 +948,7 @@ var RouteManager = class _RouteManager {
|
|
|
947
948
|
*/
|
|
948
949
|
keepBuildSourceSnapshot() {
|
|
949
950
|
if (this.sourceChangeTracking) return;
|
|
950
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
951
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkU3A46QFDcjs.FarmSourceSnapshotStore)(false))));
|
|
951
952
|
}
|
|
952
953
|
/**
|
|
953
954
|
* @internal Hands the snapshot keepBuildSourceSnapshot kept to the build, which clears it once
|
|
@@ -990,7 +991,7 @@ var RouteManager = class _RouteManager {
|
|
|
990
991
|
return false;
|
|
991
992
|
}
|
|
992
993
|
const previous = _optionalChain([this, 'access', _18 => _18.sourceSnapshot, 'optionalAccess', _19 => _19.peekSource, 'call', _20 => _20(path4.default.resolve(file))]);
|
|
993
|
-
return previous !== void 0 &&
|
|
994
|
+
return previous !== void 0 && _chunkU3A46QFDcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
|
|
994
995
|
}
|
|
995
996
|
/**
|
|
996
997
|
* A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
|
|
@@ -1001,7 +1002,7 @@ var RouteManager = class _RouteManager {
|
|
|
1001
1002
|
if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
|
|
1002
1003
|
return { ...previous.plan };
|
|
1003
1004
|
}
|
|
1004
|
-
const { result, files } =
|
|
1005
|
+
const { result, files } = _chunkU3A46QFDcjs.traceFarmSourceReads.call(void 0, compute);
|
|
1005
1006
|
const sources = /* @__PURE__ */ new Set();
|
|
1006
1007
|
for (const file of files) {
|
|
1007
1008
|
const source = this.planSourcePath(file);
|
|
@@ -1009,7 +1010,7 @@ var RouteManager = class _RouteManager {
|
|
|
1009
1010
|
}
|
|
1010
1011
|
if (!this.sourceChangeTracking) {
|
|
1011
1012
|
for (const source of sources) {
|
|
1012
|
-
if (!this.planStamps.has(source)) this.planStamps.set(source,
|
|
1013
|
+
if (!this.planStamps.has(source)) this.planStamps.set(source, _chunkU3A46QFDcjs.getFarmSourceStamp.call(void 0, source));
|
|
1013
1014
|
}
|
|
1014
1015
|
}
|
|
1015
1016
|
this.ownerPlans.set(key, { plan: result, files: sources, planKey });
|
|
@@ -1029,7 +1030,7 @@ var RouteManager = class _RouteManager {
|
|
|
1029
1030
|
const isUnchanged = (file) => {
|
|
1030
1031
|
let result = unchanged.get(file);
|
|
1031
1032
|
if (result === void 0) {
|
|
1032
|
-
result = this.planStamps.get(file) ===
|
|
1033
|
+
result = this.planStamps.get(file) === _chunkU3A46QFDcjs.getFarmSourceStamp.call(void 0, file);
|
|
1033
1034
|
unchanged.set(file, result);
|
|
1034
1035
|
}
|
|
1035
1036
|
return result;
|
|
@@ -1076,7 +1077,7 @@ var RouteManager = class _RouteManager {
|
|
|
1076
1077
|
*/
|
|
1077
1078
|
inspectPackages(operation) {
|
|
1078
1079
|
const file = this.packageClientBoundaryCacheFile;
|
|
1079
|
-
return file ?
|
|
1080
|
+
return file ? _chunkU3A46QFDcjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
|
|
1080
1081
|
}
|
|
1081
1082
|
computeClientManifest(normalizedProjectRoot) {
|
|
1082
1083
|
const toUrlPath = (absolutePath) => {
|
|
@@ -1099,14 +1100,14 @@ var RouteManager = class _RouteManager {
|
|
|
1099
1100
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
1100
1101
|
);
|
|
1101
1102
|
}
|
|
1102
|
-
const isolatedMode =
|
|
1103
|
+
const isolatedMode = _chunkU3A46QFDcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
1103
1104
|
_optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.isolatedClientHydration]),
|
|
1104
1105
|
{
|
|
1105
1106
|
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _30 => _30.config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.serverComponents])) === "rsc",
|
|
1106
1107
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
1107
1108
|
}
|
|
1108
1109
|
);
|
|
1109
|
-
const planOptions =
|
|
1110
|
+
const planOptions = _chunkU3A46QFDcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
1110
1111
|
this.config.renderer,
|
|
1111
1112
|
Boolean(unsupportedIntegrationProvider)
|
|
1112
1113
|
);
|
|
@@ -1116,7 +1117,7 @@ var RouteManager = class _RouteManager {
|
|
|
1116
1117
|
if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
|
|
1117
1118
|
edited = /* @__PURE__ */ new Set();
|
|
1118
1119
|
for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
|
|
1119
|
-
if (
|
|
1120
|
+
if (_chunkU3A46QFDcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
|
|
1120
1121
|
const source = this.planSourcePath(file);
|
|
1121
1122
|
if (source) edited.add(source);
|
|
1122
1123
|
}
|
|
@@ -1131,13 +1132,13 @@ var RouteManager = class _RouteManager {
|
|
|
1131
1132
|
metadata: this.planRouteModule(
|
|
1132
1133
|
`layout:${entry.modulePath}`,
|
|
1133
1134
|
edited,
|
|
1134
|
-
() =>
|
|
1135
|
+
() => _chunkU3A46QFDcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1135
1136
|
entry.modulePath,
|
|
1136
1137
|
normalizedProjectRoot,
|
|
1137
1138
|
isolatedMode,
|
|
1138
1139
|
layoutPlanOptions
|
|
1139
1140
|
),
|
|
1140
|
-
|
|
1141
|
+
_chunkU3A46QFDcjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1141
1142
|
entry.modulePath,
|
|
1142
1143
|
normalizedProjectRoot,
|
|
1143
1144
|
isolatedMode,
|
|
@@ -1145,7 +1146,7 @@ var RouteManager = class _RouteManager {
|
|
|
1145
1146
|
)
|
|
1146
1147
|
)
|
|
1147
1148
|
}));
|
|
1148
|
-
const markdownComponentsPlan =
|
|
1149
|
+
const markdownComponentsPlan = _chunkU3A46QFDcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
1149
1150
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
1150
1151
|
normalizedProjectRoot,
|
|
1151
1152
|
isolatedMode,
|
|
@@ -1161,13 +1162,13 @@ var RouteManager = class _RouteManager {
|
|
|
1161
1162
|
metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
|
|
1162
1163
|
`page:${entry.modulePath}`,
|
|
1163
1164
|
edited,
|
|
1164
|
-
() =>
|
|
1165
|
+
() => _chunkU3A46QFDcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1165
1166
|
entry.modulePath,
|
|
1166
1167
|
normalizedProjectRoot,
|
|
1167
1168
|
isolatedMode,
|
|
1168
1169
|
pagePlanOptions
|
|
1169
1170
|
),
|
|
1170
|
-
|
|
1171
|
+
_chunkU3A46QFDcjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1171
1172
|
entry.modulePath,
|
|
1172
1173
|
normalizedProjectRoot,
|
|
1173
1174
|
isolatedMode,
|
|
@@ -1197,18 +1198,18 @@ var RouteManager = class _RouteManager {
|
|
|
1197
1198
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1198
1199
|
);
|
|
1199
1200
|
}
|
|
1200
|
-
|
|
1201
|
+
_chunkU3A46QFDcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
1201
1202
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1202
1203
|
pattern: entry.pattern,
|
|
1203
|
-
depth:
|
|
1204
|
+
depth: _chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
1204
1205
|
metadata
|
|
1205
1206
|
})),
|
|
1206
1207
|
routeEntries.map(({ entry, metadata }) => ({
|
|
1207
1208
|
pattern: getRouteEntryDirectory(entry),
|
|
1208
|
-
depth:
|
|
1209
|
+
depth: _chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
|
|
1209
1210
|
metadata
|
|
1210
1211
|
})),
|
|
1211
|
-
|
|
1212
|
+
_chunk4ZVKDHS6cjs.routeBoundaryCoversDirectory,
|
|
1212
1213
|
{ serverOwners: islandsMode }
|
|
1213
1214
|
);
|
|
1214
1215
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
@@ -1228,7 +1229,7 @@ var RouteManager = class _RouteManager {
|
|
|
1228
1229
|
const routes = routeEntries.map(({ entry, metadata }) => {
|
|
1229
1230
|
const programmaticPage = this.programmaticPages.get(entry.modulePath);
|
|
1230
1231
|
const layoutShouldHydrate = layoutEntries.some(
|
|
1231
|
-
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate &&
|
|
1232
|
+
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunk4ZVKDHS6cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
|
|
1232
1233
|
);
|
|
1233
1234
|
return {
|
|
1234
1235
|
pattern: entry.pattern,
|
|
@@ -1244,8 +1245,8 @@ var RouteManager = class _RouteManager {
|
|
|
1244
1245
|
modulePath: toUrlPath(boundary.modulePath)
|
|
1245
1246
|
}))
|
|
1246
1247
|
} : {},
|
|
1247
|
-
...
|
|
1248
|
-
renderPlan:
|
|
1248
|
+
..._chunkU3A46QFDcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
1249
|
+
renderPlan: _chunk4ZVKDHS6cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
1249
1250
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
1250
1251
|
layoutShouldHydrate,
|
|
1251
1252
|
islandStrategy: metadata.islandStrategy
|
|
@@ -1261,7 +1262,7 @@ var RouteManager = class _RouteManager {
|
|
|
1261
1262
|
}))
|
|
1262
1263
|
};
|
|
1263
1264
|
});
|
|
1264
|
-
const treeLayoutPatterns = islandsMode ?
|
|
1265
|
+
const treeLayoutPatterns = islandsMode ? _chunk4ZVKDHS6cjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
1265
1266
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1266
1267
|
pattern: entry.pattern,
|
|
1267
1268
|
shouldHydrate: metadata.shouldHydrate,
|
|
@@ -1286,7 +1287,7 @@ var RouteManager = class _RouteManager {
|
|
|
1286
1287
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
1287
1288
|
}));
|
|
1288
1289
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
1289
|
-
const metadata =
|
|
1290
|
+
const metadata = _chunkU3A46QFDcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
1290
1291
|
return {
|
|
1291
1292
|
name: entry.name,
|
|
1292
1293
|
ownerPattern: entry.ownerPattern,
|
|
@@ -1302,7 +1303,7 @@ var RouteManager = class _RouteManager {
|
|
|
1302
1303
|
};
|
|
1303
1304
|
});
|
|
1304
1305
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
1305
|
-
metadata:
|
|
1306
|
+
metadata: _chunkU3A46QFDcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1306
1307
|
entry.modulePath,
|
|
1307
1308
|
normalizedProjectRoot,
|
|
1308
1309
|
isolatedMode,
|
|
@@ -1401,14 +1402,14 @@ var RouteManager = class _RouteManager {
|
|
|
1401
1402
|
// Loaded on render: the route runtime manifest only reads metadata and rendering config.
|
|
1402
1403
|
components: () => _chunkHQEYZSF3cjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
|
|
1403
1404
|
root: this.config.root,
|
|
1404
|
-
loadModule: viteServer ? (componentModulePath) =>
|
|
1405
|
+
loadModule: viteServer ? (componentModulePath) => _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
|
|
1405
1406
|
}),
|
|
1406
1407
|
config: mdxConfig,
|
|
1407
1408
|
renderer: _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
|
|
1408
1409
|
});
|
|
1409
1410
|
}
|
|
1410
1411
|
if (this.viteServer) {
|
|
1411
|
-
const module = await
|
|
1412
|
+
const module = await _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
|
|
1412
1413
|
return module;
|
|
1413
1414
|
} else {
|
|
1414
1415
|
const module = await import(
|
|
@@ -1433,7 +1434,7 @@ var RouteManager = class _RouteManager {
|
|
|
1433
1434
|
return createLayoutModuleFromProgrammaticLayout(programmaticLayout);
|
|
1434
1435
|
}
|
|
1435
1436
|
if (this.viteServer) {
|
|
1436
|
-
const module = await
|
|
1437
|
+
const module = await _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
|
|
1437
1438
|
return module;
|
|
1438
1439
|
} else {
|
|
1439
1440
|
const module = await import(
|
|
@@ -1452,7 +1453,7 @@ var RouteManager = class _RouteManager {
|
|
|
1452
1453
|
*/
|
|
1453
1454
|
createRoutePattern(route) {
|
|
1454
1455
|
if (route.segments.length === 0) return "/";
|
|
1455
|
-
return "/" + route.segments.map(
|
|
1456
|
+
return "/" + route.segments.map(_chunk4ZVKDHS6cjs.formatRouteSegment).join("/");
|
|
1456
1457
|
}
|
|
1457
1458
|
registerPageRoute(entry) {
|
|
1458
1459
|
_chunkML4TOUZPcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
|
|
@@ -1573,7 +1574,7 @@ var RouteManager = class _RouteManager {
|
|
|
1573
1574
|
for (const file of files) {
|
|
1574
1575
|
const route = _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, file);
|
|
1575
1576
|
const modulePath = modulePathOf(file);
|
|
1576
|
-
const pattern =
|
|
1577
|
+
const pattern = _chunk4ZVKDHS6cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1577
1578
|
const existing = target.get(pattern);
|
|
1578
1579
|
if (_optionalChain([existing, 'optionalAccess', _51 => _51.sourceRoot]) === source.root) {
|
|
1579
1580
|
throw new Error(
|
|
@@ -1595,7 +1596,7 @@ var RouteManager = class _RouteManager {
|
|
|
1595
1596
|
const modulePath = path4.default.join(appDir, file);
|
|
1596
1597
|
const pattern = this.createRoutePattern(slot.route);
|
|
1597
1598
|
const ownerPattern = this.createRoutePattern(slot.ownerRoute);
|
|
1598
|
-
const ownerDirectory =
|
|
1599
|
+
const ownerDirectory = _chunk4ZVKDHS6cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
|
|
1599
1600
|
const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
|
|
1600
1601
|
const existing = this.routeSlots.get(key);
|
|
1601
1602
|
if (_optionalChain([existing, 'optionalAccess', _52 => _52.sourceRoot]) === source.root) {
|
|
@@ -1677,11 +1678,11 @@ var RouteManager = class _RouteManager {
|
|
|
1677
1678
|
srcDir: source.srcDir,
|
|
1678
1679
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1679
1680
|
});
|
|
1680
|
-
const graph = this.viteServer ?
|
|
1681
|
+
const graph = this.viteServer ? _chunkU3A46QFDcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1681
1682
|
for (const { filePath, manifest } of manifests) {
|
|
1682
1683
|
if (graph) {
|
|
1683
1684
|
clientRoutes.push(
|
|
1684
|
-
|
|
1685
|
+
_chunkU3A46QFDcjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1685
1686
|
graph,
|
|
1686
1687
|
routesFile: toRealPath(filePath),
|
|
1687
1688
|
routes: manifest.routes,
|
|
@@ -1712,7 +1713,7 @@ var RouteManager = class _RouteManager {
|
|
|
1712
1713
|
}
|
|
1713
1714
|
if (definition.kind === "layout") {
|
|
1714
1715
|
const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
|
|
1715
|
-
const pattern =
|
|
1716
|
+
const pattern = _chunk4ZVKDHS6cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1716
1717
|
const existing = this.layouts.get(pattern);
|
|
1717
1718
|
if (_optionalChain([existing, 'optionalAccess', _56 => _56.sourceRoot]) === source.root) {
|
|
1718
1719
|
throw new Error(
|
|
@@ -1744,7 +1745,7 @@ var RouteManager = class _RouteManager {
|
|
|
1744
1745
|
async loadProgrammaticRoutesModule(filePath) {
|
|
1745
1746
|
if (this.viteServer) {
|
|
1746
1747
|
const viteRoot = _optionalChain([this, 'access', _57 => _57.viteServer, 'access', _58 => _58.config, 'optionalAccess', _59 => _59.root]) || this.config.root || process.cwd();
|
|
1747
|
-
return await
|
|
1748
|
+
return await _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, this.viteServer, _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, filePath, viteRoot));
|
|
1748
1749
|
}
|
|
1749
1750
|
return await import(
|
|
1750
1751
|
/* @vite-ignore */
|
|
@@ -1759,7 +1760,7 @@ var RouteManager = class _RouteManager {
|
|
|
1759
1760
|
const matchingLayouts = [];
|
|
1760
1761
|
for (const { entry, groupScope } of this.orderedLayouts) {
|
|
1761
1762
|
if (!_chunk7U4XF76Rcjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
|
|
1762
|
-
if (groupScope !== null && !
|
|
1763
|
+
if (groupScope !== null && !_chunk4ZVKDHS6cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
|
|
1763
1764
|
continue;
|
|
1764
1765
|
}
|
|
1765
1766
|
matchingLayouts.push(entry);
|
|
@@ -1840,14 +1841,14 @@ var RouteManager = class _RouteManager {
|
|
|
1840
1841
|
let page = route;
|
|
1841
1842
|
for (const boundaryEntry of boundaries.values()) {
|
|
1842
1843
|
if (!_chunk7U4XF76Rcjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
|
|
1843
|
-
const groupScope =
|
|
1844
|
+
const groupScope = _chunk4ZVKDHS6cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
|
|
1844
1845
|
if (groupScope !== null) {
|
|
1845
1846
|
if (page === void 0) page = this.matchPageRoute(_chunk7U4XF76Rcjs.splitRoutePath.call(void 0, normalizedPath));
|
|
1846
|
-
if (!
|
|
1847
|
+
if (!_chunk4ZVKDHS6cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
|
|
1847
1848
|
}
|
|
1848
1849
|
const depth = boundaryEntry.route.segments.length;
|
|
1849
1850
|
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _60 => _60.route, 'access', _61 => _61.segments, 'access', _62 => _62.length]), () => ( -1));
|
|
1850
|
-
if (!bestMatch || depth > bestDepth || depth === bestDepth &&
|
|
1851
|
+
if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
|
|
1851
1852
|
bestMatch = boundaryEntry;
|
|
1852
1853
|
}
|
|
1853
1854
|
}
|
|
@@ -1974,7 +1975,7 @@ var RouteManager = class _RouteManager {
|
|
|
1974
1975
|
}
|
|
1975
1976
|
};
|
|
1976
1977
|
function getPageDirectoryField(route, pattern) {
|
|
1977
|
-
const directory =
|
|
1978
|
+
const directory = _chunk4ZVKDHS6cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1978
1979
|
return directory === pattern ? {} : { directory };
|
|
1979
1980
|
}
|
|
1980
1981
|
function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
|
|
@@ -2098,11 +2099,11 @@ function createFarmDevClientManifest(manifest, options) {
|
|
|
2098
2099
|
}
|
|
2099
2100
|
for (const layout of manifest.layouts) {
|
|
2100
2101
|
if (layoutPatterns && !layoutPatterns.has(layout.pattern)) continue;
|
|
2101
|
-
const groupScope =
|
|
2102
|
+
const groupScope = _chunk4ZVKDHS6cjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
2102
2103
|
clientManifest.layouts[layout.pattern] = {
|
|
2103
2104
|
modulePath: layout.modulePath,
|
|
2104
2105
|
pattern: layout.pattern,
|
|
2105
|
-
...groupScope ? { urlPattern:
|
|
2106
|
+
...groupScope ? { urlPattern: _chunk4ZVKDHS6cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
|
|
2106
2107
|
shouldHydrate: layout.shouldHydrate,
|
|
2107
2108
|
islandStrategy: layout.islandStrategy,
|
|
2108
2109
|
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
@@ -2209,7 +2210,7 @@ function farmFontImportsPlugin(options = {}) {
|
|
|
2209
2210
|
production
|
|
2210
2211
|
);
|
|
2211
2212
|
},
|
|
2212
|
-
async transform(code, id) {
|
|
2213
|
+
async transform(code, id, transformOptions) {
|
|
2213
2214
|
const result = await transformFarmFontCalls({
|
|
2214
2215
|
code,
|
|
2215
2216
|
id,
|
|
@@ -2220,6 +2221,13 @@ function farmFontImportsPlugin(options = {}) {
|
|
|
2220
2221
|
register: (moduleId, calls) => registry.register(moduleId, calls, production)
|
|
2221
2222
|
});
|
|
2222
2223
|
if (!result) registry.clearModule(id.split("?", 1)[0]);
|
|
2224
|
+
const server = this.environment ? this.environment.config.consumer === "server" : _optionalChain([transformOptions, 'optionalAccess', _64 => _64.ssr]) === true;
|
|
2225
|
+
const cleanId = id.split("?", 1)[0];
|
|
2226
|
+
if (server && MODULE_EXTENSION_RE.test(cleanId) && _optionalChain([options, 'access', _65 => _65.isLayoutModule, 'optionalCall', _66 => _66(cleanId)])) {
|
|
2227
|
+
const source = _nullishCoalesce(_optionalChain([result, 'optionalAccess', _67 => _67.code]), () => ( code));
|
|
2228
|
+
const inferred = addInferredLayoutFonts(source, this.parse(source));
|
|
2229
|
+
if (inferred) return { code: inferred, map: null };
|
|
2230
|
+
}
|
|
2223
2231
|
return result ? { code: result.code, map: null } : null;
|
|
2224
2232
|
},
|
|
2225
2233
|
async generateBundle(_options, bundle) {
|
|
@@ -2564,6 +2572,74 @@ ${FONT_SECTION_END}
|
|
|
2564
2572
|
return resource;
|
|
2565
2573
|
}
|
|
2566
2574
|
};
|
|
2575
|
+
function isFarmLayoutModule(id, appDirs) {
|
|
2576
|
+
if (!/\/layout\.[cm]?[jt]sx?$/.test(id)) return false;
|
|
2577
|
+
return appDirs.some((appDir) => id.startsWith(`${appDir.replace(/\\/g, "/")}/`));
|
|
2578
|
+
}
|
|
2579
|
+
var LAYOUT_FONTS_EXPORT = "__farmLayoutFonts";
|
|
2580
|
+
var LAYOUT_FONT_PROPERTIES = /* @__PURE__ */ new Set(["className", "variable"]);
|
|
2581
|
+
function addInferredLayoutFonts(code, ast) {
|
|
2582
|
+
const body = (Array.isArray(ast.body) ? ast.body : []).filter(isAstNode);
|
|
2583
|
+
if (body.some((statement) => statement.type === "ExportAllDeclaration")) return null;
|
|
2584
|
+
if (moduleExports(body, "fonts") || moduleExports(body, LAYOUT_FONTS_EXPORT)) return null;
|
|
2585
|
+
const bindings = moduleScopeBindings(body);
|
|
2586
|
+
const uses = [];
|
|
2587
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2588
|
+
walkAst(ast, (node) => {
|
|
2589
|
+
if (node.type !== "MemberExpression" || node.computed === true) return;
|
|
2590
|
+
if (!isAstNode(node.object) || node.object.type !== "Identifier") return;
|
|
2591
|
+
const name = node.object.name;
|
|
2592
|
+
const property2 = readPropertyName(node.property);
|
|
2593
|
+
if (typeof name !== "string" || !bindings.has(name)) return;
|
|
2594
|
+
if (!property2 || !LAYOUT_FONT_PROPERTIES.has(property2)) return;
|
|
2595
|
+
const key = `${name}.${property2}`;
|
|
2596
|
+
if (seen.has(key)) return;
|
|
2597
|
+
seen.add(key);
|
|
2598
|
+
uses.push(`[${name}, ${JSON.stringify(property2)}]`);
|
|
2599
|
+
});
|
|
2600
|
+
if (uses.length === 0) return null;
|
|
2601
|
+
return `${code}
|
|
2602
|
+
import { inferFarmLayoutFonts as __farmInferLayoutFonts } from "@farm.js/core/font";
|
|
2603
|
+
export const ${LAYOUT_FONTS_EXPORT} = /* @__PURE__ */ __farmInferLayoutFonts([${uses.join(", ")}]);
|
|
2604
|
+
`;
|
|
2605
|
+
}
|
|
2606
|
+
function moduleExports(body, name) {
|
|
2607
|
+
return body.some((statement) => {
|
|
2608
|
+
if (statement.type !== "ExportNamedDeclaration") return false;
|
|
2609
|
+
const specifiers = Array.isArray(statement.specifiers) ? statement.specifiers : [];
|
|
2610
|
+
if (specifiers.some((specifier) => readPropertyName(specifier.exported) === name)) return true;
|
|
2611
|
+
return isAstNode(statement.declaration) && declaredNames(statement.declaration).includes(name);
|
|
2612
|
+
});
|
|
2613
|
+
}
|
|
2614
|
+
function moduleScopeBindings(body) {
|
|
2615
|
+
const names = /* @__PURE__ */ new Set();
|
|
2616
|
+
for (const statement of body) {
|
|
2617
|
+
if (statement.type === "ImportDeclaration") {
|
|
2618
|
+
if (statement.importKind === "type") continue;
|
|
2619
|
+
const specifiers = Array.isArray(statement.specifiers) ? statement.specifiers : [];
|
|
2620
|
+
for (const specifier of specifiers) {
|
|
2621
|
+
if (specifier.importKind === "type" || !isAstNode(specifier.local)) continue;
|
|
2622
|
+
if (typeof specifier.local.name === "string") names.add(specifier.local.name);
|
|
2623
|
+
}
|
|
2624
|
+
continue;
|
|
2625
|
+
}
|
|
2626
|
+
const declaration = statement.type === "ExportNamedDeclaration" || statement.type === "ExportDefaultDeclaration" ? statement.declaration : statement;
|
|
2627
|
+
if (isAstNode(declaration)) for (const name of declaredNames(declaration)) names.add(name);
|
|
2628
|
+
}
|
|
2629
|
+
return names;
|
|
2630
|
+
}
|
|
2631
|
+
function declaredNames(declaration) {
|
|
2632
|
+
if (declaration.type === "VariableDeclaration") {
|
|
2633
|
+
const declarations = Array.isArray(declaration.declarations) ? declaration.declarations : [];
|
|
2634
|
+
return declarations.flatMap(
|
|
2635
|
+
(declarator) => isAstNode(declarator.id) && declarator.id.type === "Identifier" && typeof declarator.id.name === "string" ? [declarator.id.name] : []
|
|
2636
|
+
);
|
|
2637
|
+
}
|
|
2638
|
+
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && isAstNode(declaration.id) && typeof declaration.id.name === "string") {
|
|
2639
|
+
return [declaration.id.name];
|
|
2640
|
+
}
|
|
2641
|
+
return [];
|
|
2642
|
+
}
|
|
2567
2643
|
function findFontBindings(ast) {
|
|
2568
2644
|
const named = /* @__PURE__ */ new Map();
|
|
2569
2645
|
const namespaces = /* @__PURE__ */ new Set();
|
|
@@ -2698,7 +2774,7 @@ function readFontOptions(code, id, call) {
|
|
|
2698
2774
|
const declaration = call.ancestors.at(-2);
|
|
2699
2775
|
const statement = call.ancestors.at(-3);
|
|
2700
2776
|
const statementParent = call.ancestors.at(-4);
|
|
2701
|
-
const isModuleScope = _optionalChain([declaration, 'optionalAccess',
|
|
2777
|
+
const isModuleScope = _optionalChain([declaration, 'optionalAccess', _68 => _68.type]) === "VariableDeclaration" && (_optionalChain([statement, 'optionalAccess', _69 => _69.type]) === "Program" || _optionalChain([statement, 'optionalAccess', _70 => _70.type]) === "ExportNamedDeclaration" && _optionalChain([statementParent, 'optionalAccess', _71 => _71.type]) === "Program");
|
|
2702
2778
|
if (!isModuleScope || call.ancestors.some((ancestor) => isFunctionNode(ancestor))) {
|
|
2703
2779
|
throw fontError(id, `${call.kind}() must be declared directly at module scope`);
|
|
2704
2780
|
}
|
|
@@ -3264,17 +3340,17 @@ function resolveProviderModule(moduleId, root) {
|
|
|
3264
3340
|
|
|
3265
3341
|
// src/server-actions-mode.ts
|
|
3266
3342
|
function resolveFarmIslxActionsMode(config) {
|
|
3267
|
-
if (_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3343
|
+
if (_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _72 => _72.experimental, 'optionalAccess', _73 => _73.serverComponents])) === "islands") {
|
|
3268
3344
|
return "islands";
|
|
3269
3345
|
}
|
|
3270
|
-
if (_optionalChain([config, 'access',
|
|
3346
|
+
if (_optionalChain([config, 'access', _74 => _74.experimental, 'optionalAccess', _75 => _75.serverActions]) !== true) return null;
|
|
3271
3347
|
const renderer = config.renderer;
|
|
3272
3348
|
if (renderer === void 0 || renderer === false) return null;
|
|
3273
3349
|
if (_chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, renderer) || _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer)) return null;
|
|
3274
3350
|
return "renderer";
|
|
3275
3351
|
}
|
|
3276
3352
|
function farmBrowserServerFnsEnabled(config) {
|
|
3277
|
-
return _optionalChain([config, 'access',
|
|
3353
|
+
return _optionalChain([config, 'access', _76 => _76.experimental, 'optionalAccess', _77 => _77.serverActions]) === true && resolveFarmIslxActionsMode(config) !== null;
|
|
3278
3354
|
}
|
|
3279
3355
|
|
|
3280
3356
|
// src/island-inference.ts
|
|
@@ -3317,7 +3393,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
3317
3393
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
3318
3394
|
parse: parseFarmIslandSource,
|
|
3319
3395
|
resolve: (specifier, importer) => {
|
|
3320
|
-
const resolved =
|
|
3396
|
+
const resolved = _chunkU3A46QFDcjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
3321
3397
|
return resolved.local ? resolved.path : null;
|
|
3322
3398
|
}
|
|
3323
3399
|
});
|
|
@@ -3337,7 +3413,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
3337
3413
|
if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
|
|
3338
3414
|
return cached.result;
|
|
3339
3415
|
}
|
|
3340
|
-
const { result, files } =
|
|
3416
|
+
const { result, files } = _chunkU3A46QFDcjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
|
|
3341
3417
|
const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
|
|
3342
3418
|
routeRootInferences.set(key, {
|
|
3343
3419
|
stamps: [...read].map((file) => [file, modifiedAt(file)]),
|
|
@@ -3354,7 +3430,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3354
3430
|
const files = [];
|
|
3355
3431
|
const modules = [];
|
|
3356
3432
|
for (const owner of owners) {
|
|
3357
|
-
const rendered =
|
|
3433
|
+
const rendered = _chunkU3A46QFDcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
3358
3434
|
if (!rendered) {
|
|
3359
3435
|
return {
|
|
3360
3436
|
strategy: null,
|
|
@@ -3370,7 +3446,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3370
3446
|
source = fs2.default.readFileSync(module, "utf8");
|
|
3371
3447
|
} catch (e11) {
|
|
3372
3448
|
}
|
|
3373
|
-
if (
|
|
3449
|
+
if (_chunkU3A46QFDcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
3374
3450
|
}
|
|
3375
3451
|
for (const module of modules) {
|
|
3376
3452
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -3382,7 +3458,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3382
3458
|
function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
|
|
3383
3459
|
const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3384
3460
|
const onRoute = layouts.filter(
|
|
3385
|
-
(layout) =>
|
|
3461
|
+
(layout) => _chunk4ZVKDHS6cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
|
|
3386
3462
|
);
|
|
3387
3463
|
const declared = [
|
|
3388
3464
|
...page.islandStrategy ? [page.islandStrategy] : [],
|
|
@@ -3415,7 +3491,7 @@ var _stream = require('stream');
|
|
|
3415
3491
|
|
|
3416
3492
|
function resolveFarmNotFoundComponentPath(config, appDirs, discovered) {
|
|
3417
3493
|
const extensions = _chunkT7UC2ORAcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
|
|
3418
|
-
const configuredPath = _optionalChain([config, 'access',
|
|
3494
|
+
const configuredPath = _optionalChain([config, 'access', _78 => _78.notFound, 'optionalAccess', _79 => _79.component, 'optionalAccess', _80 => _80.trim, 'call', _81 => _81()]);
|
|
3419
3495
|
if (configuredPath) {
|
|
3420
3496
|
const componentPath = path4.default.isAbsolute(configuredPath) ? path4.default.normalize(configuredPath) : path4.default.resolve(config.root, configuredPath);
|
|
3421
3497
|
if (!extensions.some((extension) => componentPath.endsWith(extension))) {
|
|
@@ -3454,11 +3530,11 @@ function getFarmLayoutKey(pattern, params) {
|
|
|
3454
3530
|
);
|
|
3455
3531
|
}
|
|
3456
3532
|
function countFarmKeptLayouts(layoutsHeader, layouts, params) {
|
|
3457
|
-
const chain =
|
|
3533
|
+
const chain = _chunk4ZVKDHS6cjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
|
|
3458
3534
|
if (chain.length === 0) return 0;
|
|
3459
3535
|
const keys = layouts.map((layout) => getFarmLayoutKey(layout.pattern, params));
|
|
3460
|
-
if (chain[0] === keys[0]) return
|
|
3461
|
-
return keys.length > 1 ? 1 +
|
|
3536
|
+
if (chain[0] === keys[0]) return _chunk4ZVKDHS6cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
|
|
3537
|
+
return keys.length > 1 ? 1 + _chunk4ZVKDHS6cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
|
|
3462
3538
|
}
|
|
3463
3539
|
function createFarmFlushToken() {
|
|
3464
3540
|
const bytes = new Uint8Array(16);
|
|
@@ -3713,7 +3789,7 @@ function createDefaultErrorDiagnostics(error, root) {
|
|
|
3713
3789
|
function canBootFarmIslandsClient(config) {
|
|
3714
3790
|
const docs = config.docs;
|
|
3715
3791
|
const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
|
|
3716
|
-
return _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3792
|
+
return _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _82 => _82.experimental, 'optionalAccess', _83 => _83.serverComponents])) === "islands" && !docsEnabled && _chunkDMSXZNQRcjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkDMSXZNQRcjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
|
|
3717
3793
|
}
|
|
3718
3794
|
|
|
3719
3795
|
// src/islands-kept-layouts.ts
|
|
@@ -3761,7 +3837,7 @@ var DECLARATION_STATEMENTS = /* @__PURE__ */ new Set([
|
|
|
3761
3837
|
function parse(code, file) {
|
|
3762
3838
|
const extension = path4.default.extname(file).slice(1);
|
|
3763
3839
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" ? "jsx" : "tsx";
|
|
3764
|
-
return
|
|
3840
|
+
return _chunkU3A46QFDcjs.memoizeInFarmSourceSnapshot.call(void 0, `ast:${lang}`, code, () => {
|
|
3765
3841
|
try {
|
|
3766
3842
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
3767
3843
|
} catch (e14) {
|
|
@@ -3851,11 +3927,11 @@ function findFarmRequestDecidingConstruct(code, file) {
|
|
|
3851
3927
|
reason = "import.meta";
|
|
3852
3928
|
return;
|
|
3853
3929
|
case "CallExpression":
|
|
3854
|
-
if (_optionalChain([current, 'access',
|
|
3930
|
+
if (_optionalChain([current, 'access', _84 => _84.callee, 'optionalAccess', _85 => _85.type]) === "Identifier" && current.callee.name === "use") {
|
|
3855
3931
|
reason = "a use() call";
|
|
3856
3932
|
return;
|
|
3857
3933
|
}
|
|
3858
|
-
if (_optionalChain([current, 'access',
|
|
3934
|
+
if (_optionalChain([current, 'access', _86 => _86.callee, 'optionalAccess', _87 => _87.type]) === "MemberExpression" && !current.callee.computed && _optionalChain([current, 'access', _88 => _88.callee, 'access', _89 => _89.object, 'optionalAccess', _90 => _90.type]) === "Identifier" && current.callee.object.name === "Math" && _optionalChain([current, 'access', _91 => _91.callee, 'access', _92 => _92.property, 'optionalAccess', _93 => _93.name]) === "random") {
|
|
3859
3935
|
reason = "Math.random()";
|
|
3860
3936
|
return;
|
|
3861
3937
|
}
|
|
@@ -3896,14 +3972,14 @@ function isReference(node, parent, key) {
|
|
|
3896
3972
|
}
|
|
3897
3973
|
function readSource(file) {
|
|
3898
3974
|
try {
|
|
3899
|
-
|
|
3975
|
+
_chunkU3A46QFDcjs.noteFarmSourceRead.call(void 0, file);
|
|
3900
3976
|
return fs2.default.readFileSync(file, "utf8");
|
|
3901
3977
|
} catch (e15) {
|
|
3902
3978
|
return null;
|
|
3903
3979
|
}
|
|
3904
3980
|
}
|
|
3905
3981
|
function explainFarmKeptLayoutRender(modulePath, root) {
|
|
3906
|
-
const entry =
|
|
3982
|
+
const entry = _chunkU3A46QFDcjs.resolveModuleSourcePath.call(void 0, modulePath, root);
|
|
3907
3983
|
if (!entry) return `${modulePath} does not resolve`;
|
|
3908
3984
|
const visited = /* @__PURE__ */ new Set();
|
|
3909
3985
|
const check = (file) => {
|
|
@@ -3913,7 +3989,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3913
3989
|
if (!SCRIPT_SOURCE.test(file)) return `${path4.default.relative(root, file)} is not a script`;
|
|
3914
3990
|
const code = readSource(file);
|
|
3915
3991
|
if (code === null) return `${path4.default.relative(root, file)} cannot be read`;
|
|
3916
|
-
const { reason, imports } =
|
|
3992
|
+
const { reason, imports } = _chunkU3A46QFDcjs.memoizeInFarmSourceSnapshot.call(void 0,
|
|
3917
3993
|
"kept-layout-module",
|
|
3918
3994
|
code,
|
|
3919
3995
|
() => findFarmRequestDecidingConstruct(code, file)
|
|
@@ -3926,7 +4002,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3926
4002
|
return `${path4.default.relative(root, file)} imports ${imported.names.join(", ")} from ${imported.source}`;
|
|
3927
4003
|
}
|
|
3928
4004
|
if (ASSET_SOURCE.test(imported.source.split("?")[0])) continue;
|
|
3929
|
-
const resolved =
|
|
4005
|
+
const resolved = _chunkU3A46QFDcjs.resolveImportedModule.call(void 0, file, imported.source, root);
|
|
3930
4006
|
if (!resolved.path || !resolved.local) {
|
|
3931
4007
|
return `${path4.default.relative(root, file)} imports ${imported.source}`;
|
|
3932
4008
|
}
|
|
@@ -3941,15 +4017,15 @@ var answers = /* @__PURE__ */ new Map();
|
|
|
3941
4017
|
function canFarmSkipKeptLayoutRender(modulePath, root) {
|
|
3942
4018
|
const key = `${root}\0${modulePath}`;
|
|
3943
4019
|
const known = answers.get(key);
|
|
3944
|
-
if (known && known.stamps.every(([file, stamp]) =>
|
|
4020
|
+
if (known && known.stamps.every(([file, stamp]) => _chunkU3A46QFDcjs.getFarmSourceStamp.call(void 0, file) === stamp)) {
|
|
3945
4021
|
return known.skip;
|
|
3946
4022
|
}
|
|
3947
|
-
const { result, files } =
|
|
4023
|
+
const { result, files } = _chunkU3A46QFDcjs.traceFarmSourceReads.call(void 0,
|
|
3948
4024
|
() => explainFarmKeptLayoutRender(modulePath, root) === null
|
|
3949
4025
|
);
|
|
3950
4026
|
answers.set(key, {
|
|
3951
4027
|
skip: result,
|
|
3952
|
-
stamps: files.map((file) => [file,
|
|
4028
|
+
stamps: files.map((file) => [file, _chunkU3A46QFDcjs.getFarmSourceStamp.call(void 0, file)])
|
|
3953
4029
|
});
|
|
3954
4030
|
return result;
|
|
3955
4031
|
}
|
|
@@ -3984,7 +4060,7 @@ function pipeFarmRendererWebStream(runtime) {
|
|
|
3984
4060
|
source.once("error", (error) => {
|
|
3985
4061
|
if (settleShell(error)) return;
|
|
3986
4062
|
callbacks.onError(error);
|
|
3987
|
-
_optionalChain([destination, 'optionalAccess',
|
|
4063
|
+
_optionalChain([destination, 'optionalAccess', _94 => _94.end, 'call', _95 => _95()]);
|
|
3988
4064
|
});
|
|
3989
4065
|
},
|
|
3990
4066
|
(error) => settleShell(error)
|
|
@@ -3992,12 +4068,12 @@ function pipeFarmRendererWebStream(runtime) {
|
|
|
3992
4068
|
return {
|
|
3993
4069
|
pipe(target) {
|
|
3994
4070
|
destination = target;
|
|
3995
|
-
_optionalChain([source, 'optionalAccess',
|
|
4071
|
+
_optionalChain([source, 'optionalAccess', _96 => _96.pipe, 'call', _97 => _97(target)]);
|
|
3996
4072
|
},
|
|
3997
4073
|
abort() {
|
|
3998
4074
|
aborted = true;
|
|
3999
|
-
_optionalChain([source, 'optionalAccess',
|
|
4000
|
-
_optionalChain([destination, 'optionalAccess',
|
|
4075
|
+
_optionalChain([source, 'optionalAccess', _98 => _98.destroy, 'call', _99 => _99()]);
|
|
4076
|
+
_optionalChain([destination, 'optionalAccess', _100 => _100.end, 'call', _101 => _101()]);
|
|
4001
4077
|
}
|
|
4002
4078
|
};
|
|
4003
4079
|
};
|
|
@@ -4077,7 +4153,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
4077
4153
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
4078
4154
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
4079
4155
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
4080
|
-
_chunk7U4XF76Rcjs.logger.warn(
|
|
4156
|
+
_chunk7U4XF76Rcjs.logger.warn(_chunkU3A46QFDcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
4081
4157
|
}
|
|
4082
4158
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
4083
4159
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
@@ -4114,7 +4190,7 @@ function appendResponseHeader(res, name, value) {
|
|
|
4114
4190
|
}
|
|
4115
4191
|
}
|
|
4116
4192
|
function requestHeader(req, name) {
|
|
4117
|
-
const value = _optionalChain([req, 'access',
|
|
4193
|
+
const value = _optionalChain([req, 'access', _102 => _102.headers, 'optionalAccess', _103 => _103[name]]);
|
|
4118
4194
|
return Array.isArray(value) ? value[0] : value;
|
|
4119
4195
|
}
|
|
4120
4196
|
function appendResponseVary(res, value) {
|
|
@@ -4128,7 +4204,7 @@ function appendResponseVary(res, value) {
|
|
|
4128
4204
|
function renderI18nAlternateLinks(requestPath, snapshot, options) {
|
|
4129
4205
|
if (snapshot.routing === "none") return "";
|
|
4130
4206
|
const url = new URL(requestPath, "http://farm.local");
|
|
4131
|
-
return
|
|
4207
|
+
return _chunk4ZVKDHS6cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
|
|
4132
4208
|
}
|
|
4133
4209
|
var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
4134
4210
|
function createPPRRefreshScript() {
|
|
@@ -4219,12 +4295,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4219
4295
|
}
|
|
4220
4296
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4221
4297
|
const params = parseRouteModuleSchema(
|
|
4222
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4298
|
+
_optionalChain([schemas, 'optionalAccess', _104 => _104.params]),
|
|
4223
4299
|
input.props.params,
|
|
4224
4300
|
"params",
|
|
4225
4301
|
input.routePath
|
|
4226
4302
|
);
|
|
4227
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4303
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _105 => _105.search]), input.search, "search", input.routePath);
|
|
4228
4304
|
return {
|
|
4229
4305
|
...input.props,
|
|
4230
4306
|
params,
|
|
@@ -4267,6 +4343,7 @@ var ServerRenderer = class {
|
|
|
4267
4343
|
constructor(config, routeManager, i18nRuntime, viteServer) {
|
|
4268
4344
|
this.ssgManifest = [];
|
|
4269
4345
|
this.dataCache = _chunkBIAGSYIZcjs.getFarmDataCache.call(void 0, );
|
|
4346
|
+
this.rendererServerModuleCurrent = () => true;
|
|
4270
4347
|
this.config = config;
|
|
4271
4348
|
this.routeManager = routeManager;
|
|
4272
4349
|
this.i18nRuntime = i18nRuntime;
|
|
@@ -4275,7 +4352,7 @@ var ServerRenderer = class {
|
|
|
4275
4352
|
this.loadSSGManifest();
|
|
4276
4353
|
}
|
|
4277
4354
|
async initialize() {
|
|
4278
|
-
if (this.rendererRuntime) return;
|
|
4355
|
+
if (this.rendererRuntime && this.rendererServerModuleCurrent()) return;
|
|
4279
4356
|
if (this.islandValues()) {
|
|
4280
4357
|
_chunkWOAXQ5MZcjs.installFarmIslandValues.call(void 0, );
|
|
4281
4358
|
(await import("./internal/islands-server.cjs")).installFarmIslandsServer();
|
|
@@ -4283,15 +4360,16 @@ var ServerRenderer = class {
|
|
|
4283
4360
|
} else {
|
|
4284
4361
|
_chunkWOAXQ5MZcjs.uninstallFarmIslandValues.call(void 0, );
|
|
4285
4362
|
}
|
|
4286
|
-
if (_optionalChain([this, 'access',
|
|
4363
|
+
if (_optionalChain([this, 'access', _106 => _106.config, 'access', _107 => _107.notFound, 'optionalAccess', _108 => _108.component, 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()])) {
|
|
4287
4364
|
resolveFarmNotFoundComponentPath(this.config, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config));
|
|
4288
4365
|
}
|
|
4289
|
-
const loaded = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer) ? this.reactRenderer = await import("./renderer/react/server.cjs") : _chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? await import("./renderer/none/server.cjs") : this.viteServer ? await
|
|
4366
|
+
const loaded = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer) ? this.reactRenderer = await import("./renderer/react/server.cjs") : _chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? await import("./renderer/none/server.cjs") : this.viteServer ? await _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
|
|
4290
4367
|
_chunkT7UC2ORAcjs.resolveFarmRendererModule.call(void 0,
|
|
4291
4368
|
this.config.root || process.cwd(),
|
|
4292
4369
|
this.config.renderer.server
|
|
4293
4370
|
)
|
|
4294
4371
|
).href);
|
|
4372
|
+
this.rendererServerModuleCurrent = this.viteServer && !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer) && !_chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? _chunkI2RBHZF7cjs.createFarmDevModuleCheck.call(void 0, this.viteServer, loaded) : () => true;
|
|
4295
4373
|
const runtime = loaded;
|
|
4296
4374
|
_chunkT7UC2ORAcjs.assertFarmRendererServerModule.call(void 0, runtime, this.config.renderer);
|
|
4297
4375
|
_chunkT7UC2ORAcjs.assertFarmRendererStreamingRuntime.call(void 0,
|
|
@@ -4301,7 +4379,7 @@ var ServerRenderer = class {
|
|
|
4301
4379
|
"node"
|
|
4302
4380
|
);
|
|
4303
4381
|
this.rendererRuntime = islands && this.islandValues() ? withFarmIslandsRenders(runtime, islands) : runtime;
|
|
4304
|
-
_optionalChain([this, 'access',
|
|
4382
|
+
_optionalChain([this, 'access', _111 => _111.routeManager, 'access', _112 => _112.setRendererRuntime, 'optionalCall', _113 => _113(this.rendererRuntime)]);
|
|
4305
4383
|
await this.applyRendererAppSetup();
|
|
4306
4384
|
}
|
|
4307
4385
|
/**
|
|
@@ -4321,7 +4399,7 @@ var ServerRenderer = class {
|
|
|
4321
4399
|
`Renderer \`${this.config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`
|
|
4322
4400
|
);
|
|
4323
4401
|
}
|
|
4324
|
-
const setupModule = this.viteServer ? await
|
|
4402
|
+
const setupModule = this.viteServer ? await _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, this.viteServer, appSetupPath) : await import(_url.pathToFileURL.call(void 0, appSetupPath).href);
|
|
4325
4403
|
if (setupModule === this.appliedAppSetupModule) return;
|
|
4326
4404
|
this.appliedAppSetupModule = setupModule;
|
|
4327
4405
|
configureApp(setupModule.default);
|
|
@@ -4371,7 +4449,7 @@ var ServerRenderer = class {
|
|
|
4371
4449
|
/// Stylesheets the app imported through JS (fontsource packages, component
|
|
4372
4450
|
/// CSS) that the document must link alongside globals.css — see #658.
|
|
4373
4451
|
collectDevStyleHrefs() {
|
|
4374
|
-
const graph = _optionalChain([this, 'access',
|
|
4452
|
+
const graph = _optionalChain([this, 'access', _114 => _114.viteServer, 'optionalAccess', _115 => _115.moduleGraph]);
|
|
4375
4453
|
if (!graph) return [];
|
|
4376
4454
|
return collectDevStylesheetUrls(
|
|
4377
4455
|
graph.idToModuleMap.values(),
|
|
@@ -4422,7 +4500,7 @@ var ServerRenderer = class {
|
|
|
4422
4500
|
"data-farm-layout-boundary": "true",
|
|
4423
4501
|
"data-farm-layout-pattern": pattern,
|
|
4424
4502
|
...segment ? { "data-farm-layout-key": segment.key } : {},
|
|
4425
|
-
..._optionalChain([segment, 'optionalAccess',
|
|
4503
|
+
..._optionalChain([segment, 'optionalAccess', _116 => _116.kept]) ? { "data-farm-layout-kept": "true" } : {},
|
|
4426
4504
|
style: { display: "contents" }
|
|
4427
4505
|
},
|
|
4428
4506
|
layoutElement
|
|
@@ -4518,7 +4596,7 @@ var ServerRenderer = class {
|
|
|
4518
4596
|
);
|
|
4519
4597
|
return { html: rendered.html, head: rendered.head || "" };
|
|
4520
4598
|
}
|
|
4521
|
-
const { head, body } =
|
|
4599
|
+
const { head, body } = _chunk4ZVKDHS6cjs.takeFarmHoistedHead.call(void 0,
|
|
4522
4600
|
await this.renderElementToCompleteHTML(element, options),
|
|
4523
4601
|
true
|
|
4524
4602
|
);
|
|
@@ -4526,7 +4604,7 @@ var ServerRenderer = class {
|
|
|
4526
4604
|
}
|
|
4527
4605
|
/** Islands mode sends large prop values once, keyed by content (RFC 0003). */
|
|
4528
4606
|
islandValues() {
|
|
4529
|
-
return _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access',
|
|
4607
|
+
return _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _117 => _117.config, 'access', _118 => _118.experimental, 'optionalAccess', _119 => _119.serverComponents])) === "islands";
|
|
4530
4608
|
}
|
|
4531
4609
|
/**
|
|
4532
4610
|
* The page's element. Only React renders an async component, so for any other renderer Farm
|
|
@@ -4535,7 +4613,7 @@ var ServerRenderer = class {
|
|
|
4535
4613
|
*/
|
|
4536
4614
|
async createPageElement(PageComponent, pageProps) {
|
|
4537
4615
|
const runtime = this.rendererRuntime;
|
|
4538
|
-
if (_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer) || typeof PageComponent !== "function" || _optionalChain([PageComponent, 'access',
|
|
4616
|
+
if (_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer) || typeof PageComponent !== "function" || _optionalChain([PageComponent, 'access', _120 => _120.constructor, 'optionalAccess', _121 => _121.name]) !== "AsyncFunction") {
|
|
4539
4617
|
return runtime.createElement(PageComponent, pageProps);
|
|
4540
4618
|
}
|
|
4541
4619
|
const result = await PageComponent(pageProps);
|
|
@@ -4634,7 +4712,7 @@ var ServerRenderer = class {
|
|
|
4634
4712
|
rejectLateRedirects: true
|
|
4635
4713
|
}
|
|
4636
4714
|
);
|
|
4637
|
-
return fragmentTag ?
|
|
4715
|
+
return fragmentTag ? _chunk4ZVKDHS6cjs.takeFarmNavigationOutlet.call(void 0, html, fragmentTag) : html;
|
|
4638
4716
|
}
|
|
4639
4717
|
/**
|
|
4640
4718
|
* A built-in docs runtime page (`docs.entry`, no adapter) under layouts that hydrate, or whose
|
|
@@ -4644,7 +4722,7 @@ var ServerRenderer = class {
|
|
|
4644
4722
|
* Any other docs response is sent as it is.
|
|
4645
4723
|
*/
|
|
4646
4724
|
async wrapDocsResponseWithLayouts(request2, response) {
|
|
4647
|
-
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
4725
|
+
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _122 => _122.headers, 'access', _123 => _123.get, 'call', _124 => _124("content-type"), 'optionalAccess', _125 => _125.toLowerCase, 'call', _126 => _126(), 'access', _127 => _127.includes, 'call', _128 => _128("text/html")])) {
|
|
4648
4726
|
return response;
|
|
4649
4727
|
}
|
|
4650
4728
|
await this.initialize();
|
|
@@ -4659,14 +4737,14 @@ var ServerRenderer = class {
|
|
|
4659
4737
|
return {
|
|
4660
4738
|
pattern: layout.pattern,
|
|
4661
4739
|
modulePath: layout.modulePath,
|
|
4662
|
-
shouldHydrate: _optionalChain([entry, 'optionalAccess',
|
|
4663
|
-
islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
4664
|
-
hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess',
|
|
4665
|
-
serverTree: _optionalChain([entry, 'optionalAccess',
|
|
4666
|
-
islands: _optionalChain([entry, 'optionalAccess',
|
|
4740
|
+
shouldHydrate: _optionalChain([entry, 'optionalAccess', _129 => _129.shouldHydrate]) === true,
|
|
4741
|
+
islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _130 => _130.islandStrategy]), () => ( null)),
|
|
4742
|
+
hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess', _131 => _131.hasIsolatedClientBoundaries]) === true,
|
|
4743
|
+
serverTree: _optionalChain([entry, 'optionalAccess', _132 => _132.serverTree]) === true,
|
|
4744
|
+
islands: _optionalChain([entry, 'optionalAccess', _133 => _133.hasIsolatedClientBoundaries]) === true
|
|
4667
4745
|
};
|
|
4668
4746
|
});
|
|
4669
|
-
if (!
|
|
4747
|
+
if (!_chunk4ZVKDHS6cjs.farmDocsLayoutsWrapPage.call(void 0, layouts)) return response;
|
|
4670
4748
|
const shouldHydrateLayout = layouts.some((layout) => layout.shouldHydrate);
|
|
4671
4749
|
const hasIsolatedClientBoundaries = layouts.some(
|
|
4672
4750
|
(layout) => layout.hasIsolatedClientBoundaries
|
|
@@ -4685,10 +4763,10 @@ var ServerRenderer = class {
|
|
|
4685
4763
|
);
|
|
4686
4764
|
const treeLayouts = layouts.map((layout, index) => ({
|
|
4687
4765
|
...layout,
|
|
4688
|
-
Component: _optionalChain([modules, 'access',
|
|
4766
|
+
Component: _optionalChain([modules, 'access', _134 => _134[index], 'optionalAccess', _135 => _135.default])
|
|
4689
4767
|
}));
|
|
4690
|
-
const islandStrategy =
|
|
4691
|
-
const tree = await
|
|
4768
|
+
const islandStrategy = _chunk4ZVKDHS6cjs.resolveFarmDocsLayoutIslandStrategy.call(void 0, treeLayouts);
|
|
4769
|
+
const tree = await _chunk4ZVKDHS6cjs.createFarmDocsLayoutTree.call(void 0, this.rendererRuntime, {
|
|
4692
4770
|
pageHtml: bodyMatch[2],
|
|
4693
4771
|
layouts: treeLayouts,
|
|
4694
4772
|
params: matched.params,
|
|
@@ -4709,7 +4787,7 @@ var ServerRenderer = class {
|
|
|
4709
4787
|
)
|
|
4710
4788
|
)
|
|
4711
4789
|
);
|
|
4712
|
-
const rootMarkup =
|
|
4790
|
+
const rootMarkup = _chunk4ZVKDHS6cjs.placeFarmDocsLayoutRoot.call(void 0, rendered.html);
|
|
4713
4791
|
const clientLayouts = layouts.map((layout) => ({
|
|
4714
4792
|
pattern: layout.pattern,
|
|
4715
4793
|
modulePath: _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, layout.modulePath, root),
|
|
@@ -4751,7 +4829,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4751
4829
|
const head = [
|
|
4752
4830
|
...this.collectDevStyleLinks(),
|
|
4753
4831
|
`<script type="module" src="/@vite/client"></script>`,
|
|
4754
|
-
source.includes("window._$HY") ? "" : _optionalChain([this, 'access',
|
|
4832
|
+
source.includes("window._$HY") ? "" : _optionalChain([this, 'access', _136 => _136.rendererRuntime, 'access', _137 => _137.generateHydrationScript, 'optionalCall', _138 => _138()]),
|
|
4755
4833
|
bootstrapScript
|
|
4756
4834
|
].filter(Boolean).map((markup) => _chunk6JHZPB52cjs.stampFarmCspNonce.call(void 0, markup)).concat(rendered.head || []).join("\n ");
|
|
4757
4835
|
const clientScript = source.includes('src="/@farm/client.js"') ? "" : `
|
|
@@ -4770,7 +4848,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4770
4848
|
async runWithRequestContext(request2, fn) {
|
|
4771
4849
|
return _chunk2RSVYJT6cjs._runWithCurrentRequest.call(void 0,
|
|
4772
4850
|
request2,
|
|
4773
|
-
() => _optionalChain([this, 'access',
|
|
4851
|
+
() => _optionalChain([this, 'access', _139 => _139.i18nRuntime, 'optionalAccess', _140 => _140.config, 'access', _141 => _141.enabled]) ? _chunkSXXSQVKKcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
|
|
4774
4852
|
redirect: false
|
|
4775
4853
|
}) : fn()
|
|
4776
4854
|
);
|
|
@@ -4919,7 +4997,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4919
4997
|
setImmediate(async () => {
|
|
4920
4998
|
try {
|
|
4921
4999
|
const mod = await this.routeManager.loadRouteModule(page.filePath);
|
|
4922
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
5000
|
+
if (!_optionalChain([mod, 'optionalAccess', _142 => _142.default])) return;
|
|
4923
5001
|
const { route, layouts } = this.routeManager.matchRoute(page.urlPath);
|
|
4924
5002
|
const layoutModules = await Promise.all(
|
|
4925
5003
|
layouts.map((l) => this.routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -4933,7 +5011,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4933
5011
|
};
|
|
4934
5012
|
let pageElement = await this.createPageElement(PageComponent, pageProps);
|
|
4935
5013
|
const pageMetadata = _nullishCoalesce(routeManifest.routes.find(
|
|
4936
|
-
(entry) => entry.pattern === _optionalChain([route, 'optionalAccess',
|
|
5014
|
+
(entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _143 => _143.pattern])
|
|
4937
5015
|
), () => ( {
|
|
4938
5016
|
shouldHydrate: false,
|
|
4939
5017
|
islandStrategy: null
|
|
@@ -5041,7 +5119,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5041
5119
|
* such as a partial test double, has none.
|
|
5042
5120
|
*/
|
|
5043
5121
|
publishSearchPreserveRoutes() {
|
|
5044
|
-
_chunkWKVYF2B5cjs._setFarmSearchPreserveRoutes.call(void 0, _nullishCoalesce(_optionalChain([this, 'access',
|
|
5122
|
+
_chunkWKVYF2B5cjs._setFarmSearchPreserveRoutes.call(void 0, _nullishCoalesce(_optionalChain([this, 'access', _144 => _144.routeManager, 'access', _145 => _145.getSearchPreserveRoutes, 'optionalCall', _146 => _146()]), () => ( [])));
|
|
5045
5123
|
}
|
|
5046
5124
|
async renderPage(req, res) {
|
|
5047
5125
|
await this.initialize();
|
|
@@ -5057,7 +5135,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5057
5135
|
}
|
|
5058
5136
|
const request2 = this.createPageRequest(req, res);
|
|
5059
5137
|
const runtime = this.i18nRuntime;
|
|
5060
|
-
if (_optionalChain([runtime, 'optionalAccess',
|
|
5138
|
+
if (_optionalChain([runtime, 'optionalAccess', _147 => _147.config, 'access', _148 => _148.enabled])) {
|
|
5061
5139
|
const resolution = runtime.resolveRequest(request2);
|
|
5062
5140
|
const varyHeaders = _chunk7Q2YWZF7cjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
|
|
5063
5141
|
for (const header of varyHeaders) appendResponseVary(res, header);
|
|
@@ -5096,7 +5174,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5096
5174
|
createPageRequestOnce(req, res) {
|
|
5097
5175
|
const observable = typeof req.once === "function" && typeof res.once === "function";
|
|
5098
5176
|
return _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5099
|
-
trustProxy: _optionalChain([this, 'access',
|
|
5177
|
+
trustProxy: _optionalChain([this, 'access', _149 => _149.config, 'access', _150 => _150.server, 'optionalAccess', _151 => _151.trustProxy]),
|
|
5100
5178
|
signal: observable ? _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0,
|
|
5101
5179
|
req,
|
|
5102
5180
|
res
|
|
@@ -5126,7 +5204,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5126
5204
|
};
|
|
5127
5205
|
let pprShellWrite;
|
|
5128
5206
|
try {
|
|
5129
|
-
const url = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
5207
|
+
const url = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _152 => _152.config, 'access', _153 => _153.server, 'optionalAccess', _154 => _154.trustProxy]) });
|
|
5130
5208
|
pathname = url.pathname;
|
|
5131
5209
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
|
|
5132
5210
|
searchParamsObject = _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, url.searchParams);
|
|
@@ -5289,11 +5367,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5289
5367
|
searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
|
|
5290
5368
|
error
|
|
5291
5369
|
};
|
|
5292
|
-
if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess',
|
|
5370
|
+
if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _155 => _155.notFound])) {
|
|
5293
5371
|
res.statusCode = 404;
|
|
5294
5372
|
PageComponent = programmaticRouteComponents.notFound;
|
|
5295
5373
|
pageProps = routeStateProps;
|
|
5296
|
-
} else if (_optionalChain([programmaticRouteComponents, 'optionalAccess',
|
|
5374
|
+
} else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _156 => _156.error])) {
|
|
5297
5375
|
res.statusCode = 500;
|
|
5298
5376
|
PageComponent = programmaticRouteComponents.error;
|
|
5299
5377
|
pageProps = routeStateProps;
|
|
@@ -5304,7 +5382,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5304
5382
|
const renderingConfig = await _chunkXMVZXZ32cjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5305
5383
|
routeModule,
|
|
5306
5384
|
route.modulePath,
|
|
5307
|
-
{ experimentalPPR: _optionalChain([this, 'access',
|
|
5385
|
+
{ experimentalPPR: _optionalChain([this, 'access', _157 => _157.config, 'access', _158 => _158.experimental, 'optionalAccess', _159 => _159.ppr]) === true }
|
|
5308
5386
|
);
|
|
5309
5387
|
const pprBypassReason = renderingConfig.ppr ? this.getPPRShellBypassReason(req, middlewareMap, middlewareContext, pluginExposedContext) : void 0;
|
|
5310
5388
|
const islandsNavigationRequest = Boolean(
|
|
@@ -5315,7 +5393,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5315
5393
|
let pprShellOptions = canCachePPRShell ? {
|
|
5316
5394
|
pathname,
|
|
5317
5395
|
search: url.search,
|
|
5318
|
-
locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess',
|
|
5396
|
+
locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _160 => _160.locale]), () => ( "")),
|
|
5319
5397
|
origin: pprI18nSnapshot && pprI18nSnapshot.routing !== "none" ? url.origin : "",
|
|
5320
5398
|
revalidate: renderingConfig.revalidate
|
|
5321
5399
|
} : void 0;
|
|
@@ -5393,7 +5471,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5393
5471
|
const routeManifestEntry = routeManifest.routes.find(
|
|
5394
5472
|
(entry) => entry.pattern === route.pattern
|
|
5395
5473
|
);
|
|
5396
|
-
const moduleMetadata = routeManifestEntry ||
|
|
5474
|
+
const moduleMetadata = routeManifestEntry || _chunkU3A46QFDcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
5397
5475
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
5398
5476
|
const renderedRouteSlots = await Promise.all(
|
|
5399
5477
|
routeSlots.map(async (slot) => {
|
|
@@ -5444,20 +5522,20 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5444
5522
|
if (moduleMetadata.suppressedAsyncHydration) {
|
|
5445
5523
|
warnSuppressedAsyncHydrationOnce(
|
|
5446
5524
|
route.modulePath,
|
|
5447
|
-
_optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5525
|
+
_optionalChain([routeManifestEntry, 'optionalAccess', _161 => _161.suppressedAsyncHydrationReason])
|
|
5448
5526
|
);
|
|
5449
5527
|
}
|
|
5450
5528
|
const layoutHydrationMetadata = layouts.map((layout) => {
|
|
5451
5529
|
const manifestEntry = routeManifest.layouts.find(
|
|
5452
5530
|
(entry) => entry.pattern === layout.pattern
|
|
5453
5531
|
);
|
|
5454
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
5532
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _162 => _162.suppressedAsyncHydration])) {
|
|
5455
5533
|
warnSuppressedAsyncHydrationOnce(
|
|
5456
5534
|
layout.modulePath,
|
|
5457
5535
|
manifestEntry.suppressedAsyncHydrationReason
|
|
5458
5536
|
);
|
|
5459
5537
|
}
|
|
5460
|
-
if (typeof _optionalChain([manifestEntry, 'optionalAccess',
|
|
5538
|
+
if (typeof _optionalChain([manifestEntry, 'optionalAccess', _163 => _163.shouldHydrate]) === "boolean") {
|
|
5461
5539
|
return {
|
|
5462
5540
|
isClientComponent: manifestEntry.isClientComponent === true,
|
|
5463
5541
|
shouldHydrate: manifestEntry.shouldHydrate,
|
|
@@ -5478,11 +5556,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5478
5556
|
const clientLayouts = layouts.map((layout, index) => ({
|
|
5479
5557
|
pattern: layout.pattern,
|
|
5480
5558
|
modulePath: _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, layout.modulePath, this.config.root),
|
|
5481
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5482
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
5483
|
-
..._optionalChain([layoutHydrationMetadata, 'access',
|
|
5559
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _164 => _164[index], 'optionalAccess', _165 => _165.shouldHydrate]) === true,
|
|
5560
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _166 => _166[index], 'optionalAccess', _167 => _167.islandStrategy]), () => ( null)),
|
|
5561
|
+
..._optionalChain([layoutHydrationMetadata, 'access', _168 => _168[index], 'optionalAccess', _169 => _169.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
|
|
5484
5562
|
// Islands mode: the browser rebuilds this layout from its tree, not its module.
|
|
5485
|
-
...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access',
|
|
5563
|
+
...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _170 => _170[index], 'optionalAccess', _171 => _171.serverTree]) === true ? { serverTree: true } : {}
|
|
5486
5564
|
}));
|
|
5487
5565
|
const hydrationStrategies = [
|
|
5488
5566
|
...shouldHydrate && moduleMetadata.islandStrategy ? [moduleMetadata.islandStrategy] : [],
|
|
@@ -5496,9 +5574,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5496
5574
|
layouts.map((layout, index) => ({
|
|
5497
5575
|
pattern: layout.pattern,
|
|
5498
5576
|
modulePath: layout.modulePath,
|
|
5499
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5500
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5501
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
5577
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _172 => _172[index], 'optionalAccess', _173 => _173.shouldHydrate]) === true,
|
|
5578
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _174 => _174[index], 'optionalAccess', _175 => _175.hasIsolatedClientBoundaries]) === true,
|
|
5579
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _176 => _176[index], 'optionalAccess', _177 => _177.islandStrategy]), () => ( null))
|
|
5502
5580
|
})),
|
|
5503
5581
|
this.config.root || process.cwd(),
|
|
5504
5582
|
true
|
|
@@ -5506,10 +5584,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5506
5584
|
const hasHydratableRouteSlots = renderedRouteSlots.some(
|
|
5507
5585
|
(slot) => slot.isClientComponent || slot.shouldHydrate
|
|
5508
5586
|
);
|
|
5509
|
-
const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5587
|
+
const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _178 => _178.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
|
|
5510
5588
|
req.__FARM_PAGE_PATH__ = route.modulePath;
|
|
5511
5589
|
req.__FARM_ROUTE__ = pathname;
|
|
5512
|
-
req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access',
|
|
5590
|
+
req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access', _179 => _179[0], 'optionalAccess', _180 => _180.modulePath]);
|
|
5513
5591
|
req.__FARM_IS_CLIENT_COMPONENT__ = isClientComponent;
|
|
5514
5592
|
req.__FARM_PAGE_SHOULD_HYDRATE__ = shouldHydrate;
|
|
5515
5593
|
req.__FARM_LAYOUT_SHOULD_HYDRATE__ = shouldHydrateLayout;
|
|
@@ -5520,7 +5598,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5520
5598
|
req.__FARM_SHOULD_HYDRATE__ = shouldHydrate || shouldHydrateLayout || hasIsolatedClientBoundaries;
|
|
5521
5599
|
req.__FARM_ISLAND_STRATEGY__ = hydrationIslandStrategy;
|
|
5522
5600
|
req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ = hasHydratableRouteSlots;
|
|
5523
|
-
req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess',
|
|
5601
|
+
req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _181 => _181.modulePath]) ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
|
|
5524
5602
|
req.__FARM_ROUTE_SLOTS__ = renderedRouteSlots.map((slot) => ({
|
|
5525
5603
|
name: slot.name,
|
|
5526
5604
|
ownerPattern: slot.ownerPattern,
|
|
@@ -5592,7 +5670,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5592
5670
|
} else if (shouldHydrateLayout && !(isClientComponent || shouldHydrate) && this.rendererRuntime.isolateServerPageGraph) {
|
|
5593
5671
|
pageElement = await this.isolateServerPage(
|
|
5594
5672
|
pageElement,
|
|
5595
|
-
_optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5673
|
+
_optionalChain([routeManifestEntry, 'optionalAccess', _182 => _182.serverTree]) === true
|
|
5596
5674
|
);
|
|
5597
5675
|
}
|
|
5598
5676
|
pageElement = await this.createPageBoundary(pageElement, {
|
|
@@ -5607,7 +5685,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5607
5685
|
if (keptLayouts > 0 && !layouts.slice(0, keptLayouts).every((layout) => canFarmSkipKeptLayoutRender(layout.modulePath, keptRoot))) {
|
|
5608
5686
|
let keptElement = null;
|
|
5609
5687
|
for (let i = keptLayouts - 1; i >= 0; i--) {
|
|
5610
|
-
const KeptLayout = _optionalChain([layoutModules, 'access',
|
|
5688
|
+
const KeptLayout = _optionalChain([layoutModules, 'access', _183 => _183[i], 'optionalAccess', _184 => _184.default]);
|
|
5611
5689
|
if (KeptLayout) {
|
|
5612
5690
|
keptElement = this.rendererRuntime.createElement(KeptLayout, {
|
|
5613
5691
|
children: keptElement,
|
|
@@ -5660,7 +5738,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5660
5738
|
);
|
|
5661
5739
|
slotProps[slot.name] = slotElement;
|
|
5662
5740
|
}
|
|
5663
|
-
wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access',
|
|
5741
|
+
wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _185 => _185[i], 'optionalAccess', _186 => _186.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
|
|
5664
5742
|
LayoutComponent,
|
|
5665
5743
|
{ params },
|
|
5666
5744
|
{ children: wrappedElement, ...slotProps },
|
|
@@ -5803,7 +5881,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5803
5881
|
}
|
|
5804
5882
|
}
|
|
5805
5883
|
emitFarmRenderError(req, pathname, error);
|
|
5806
|
-
const errorStatus =
|
|
5884
|
+
const errorStatus = _chunk4ZVKDHS6cjs.resolveDefaultErrorStatus.call(void 0, error);
|
|
5807
5885
|
if (pprRefreshRoute) {
|
|
5808
5886
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5809
5887
|
type: "ppr.refresh.error",
|
|
@@ -5838,7 +5916,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5838
5916
|
}
|
|
5839
5917
|
await this.renderError(req, res, error, errorStatus);
|
|
5840
5918
|
} finally {
|
|
5841
|
-
_optionalChain([pprShellWrite, 'optionalAccess',
|
|
5919
|
+
_optionalChain([pprShellWrite, 'optionalAccess', _187 => _187.release, 'call', _188 => _188()]);
|
|
5842
5920
|
}
|
|
5843
5921
|
}
|
|
5844
5922
|
async wrapWithIntegrationProviders(element) {
|
|
@@ -5850,7 +5928,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5850
5928
|
const rendererCapabilities = _chunkT7UC2ORAcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
|
|
5851
5929
|
if (!rendererCapabilities.functionComponents) {
|
|
5852
5930
|
throw new Error(
|
|
5853
|
-
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access',
|
|
5931
|
+
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _189 => _189.config, 'access', _190 => _190.renderer, 'optionalAccess', _191 => _191.name]), () => ( "the configured renderer"))}\` cannot.`
|
|
5854
5932
|
);
|
|
5855
5933
|
}
|
|
5856
5934
|
if (provider.type === "clerk" && !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer)) {
|
|
@@ -5866,7 +5944,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5866
5944
|
path10.resolve(this.config.root, provider.component.module),
|
|
5867
5945
|
this.config.root
|
|
5868
5946
|
) : provider.component.module;
|
|
5869
|
-
const providerModule = this.viteServer ? await
|
|
5947
|
+
const providerModule = this.viteServer ? await _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, this.viteServer, providerModuleId) : await importRuntimeModule(
|
|
5870
5948
|
provider.component.module.startsWith(".") ? _url.pathToFileURL.call(void 0, path10.resolve(this.config.root, provider.component.module)).href : provider.component.module
|
|
5871
5949
|
);
|
|
5872
5950
|
ProviderComponent = providerModule[provider.component.export || "default"];
|
|
@@ -5889,7 +5967,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5889
5967
|
}
|
|
5890
5968
|
if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
|
|
5891
5969
|
_nullishCoalesce(providerSourceModule, () => ( "")),
|
|
5892
|
-
_chunkT7UC2ORAcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access',
|
|
5970
|
+
_chunkT7UC2ORAcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _192 => _192.config, 'access', _193 => _193.renderer, 'optionalAccess', _194 => _194.componentExtensions]))
|
|
5893
5971
|
)) {
|
|
5894
5972
|
ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
|
|
5895
5973
|
}
|
|
@@ -6018,7 +6096,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6018
6096
|
);
|
|
6019
6097
|
}
|
|
6020
6098
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6021
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6099
|
+
trustProxy: _optionalChain([this, 'access', _195 => _195.config, 'access', _196 => _196.server, 'optionalAccess', _197 => _197.trustProxy])
|
|
6022
6100
|
});
|
|
6023
6101
|
const url = new URL(request2.url);
|
|
6024
6102
|
const llmsContext = match.metadata.kind === "llms" || match.metadata.kind === "llms-full" ? await this.createLlmsTxtContext(request2, {
|
|
@@ -6036,7 +6114,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6036
6114
|
origin: await this.getAgentOrigin(request2),
|
|
6037
6115
|
readMarkdown: llmsContext.markdown
|
|
6038
6116
|
}) : value;
|
|
6039
|
-
const response =
|
|
6117
|
+
const response = _chunk4ZVKDHS6cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
6040
6118
|
method,
|
|
6041
6119
|
request: request2
|
|
6042
6120
|
});
|
|
@@ -6054,7 +6132,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6054
6132
|
}
|
|
6055
6133
|
/** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
|
|
6056
6134
|
getGeneratedLlmsKind(pathname) {
|
|
6057
|
-
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access',
|
|
6135
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _198 => _198.config, 'access', _199 => _199.agent, 'optionalAccess', _200 => _200.llmsTxt]));
|
|
6058
6136
|
if (!config.enabled) return null;
|
|
6059
6137
|
if (pathname === "/llms.txt") return "llms";
|
|
6060
6138
|
return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
|
|
@@ -6062,9 +6140,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6062
6140
|
async renderGeneratedLlmsTxt(req, res, kind) {
|
|
6063
6141
|
try {
|
|
6064
6142
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6065
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6143
|
+
trustProxy: _optionalChain([this, 'access', _201 => _201.config, 'access', _202 => _202.server, 'optionalAccess', _203 => _203.trustProxy])
|
|
6066
6144
|
});
|
|
6067
|
-
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access',
|
|
6145
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _204 => _204.config, 'access', _205 => _205.agent, 'optionalAccess', _206 => _206.llmsTxt]));
|
|
6068
6146
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
6069
6147
|
const body = kind === "llms-full" ? await _chunkOLKYHTLNcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
|
|
6070
6148
|
origin: await this.getAgentOrigin(request2),
|
|
@@ -6072,7 +6150,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6072
6150
|
}) : context.defaults;
|
|
6073
6151
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6074
6152
|
res,
|
|
6075
|
-
|
|
6153
|
+
_chunk4ZVKDHS6cjs.createFarmMetadataRouteResponse.call(void 0,
|
|
6076
6154
|
kind,
|
|
6077
6155
|
body,
|
|
6078
6156
|
{ revalidate: config.revalidate },
|
|
@@ -6091,23 +6169,23 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6091
6169
|
}
|
|
6092
6170
|
}
|
|
6093
6171
|
getAgentCrawlers() {
|
|
6094
|
-
return _chunkEACD6ND7cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access',
|
|
6172
|
+
return _chunkEACD6ND7cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _207 => _207.config, 'access', _208 => _208.agent, 'optionalAccess', _209 => _209.crawlers]));
|
|
6095
6173
|
}
|
|
6096
6174
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
6097
6175
|
async renderGeneratedRobotsTxt(req, res) {
|
|
6098
6176
|
try {
|
|
6099
|
-
const sitemapPath = _optionalChain([this, 'access',
|
|
6177
|
+
const sitemapPath = _optionalChain([this, 'access', _210 => _210.routeManager, 'access', _211 => _211.matchMetadataRoute, 'call', _212 => _212("/sitemap.xml"), 'optionalAccess', _213 => _213.metadata, 'access', _214 => _214.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
|
|
6100
6178
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6101
6179
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6102
6180
|
const robots = _chunkEACD6ND7cjs.createFarmAgentRobots.call(void 0, {
|
|
6103
6181
|
crawlers: this.getAgentCrawlers(),
|
|
6104
6182
|
sitemapPath,
|
|
6105
|
-
metadataBase: _optionalChain([rootMetadata, 'optionalAccess',
|
|
6183
|
+
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _215 => _215.metadataBase]),
|
|
6106
6184
|
basePath: this.config.basePath
|
|
6107
6185
|
});
|
|
6108
6186
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6109
6187
|
res,
|
|
6110
|
-
|
|
6188
|
+
_chunk4ZVKDHS6cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
6111
6189
|
);
|
|
6112
6190
|
} catch (error) {
|
|
6113
6191
|
_chunk7U4XF76Rcjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
@@ -6121,13 +6199,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6121
6199
|
}
|
|
6122
6200
|
}
|
|
6123
6201
|
getAgentSitemap() {
|
|
6124
|
-
return _chunkEACD6ND7cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access',
|
|
6202
|
+
return _chunkEACD6ND7cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _216 => _216.config, 'access', _217 => _217.agent, 'optionalAccess', _218 => _218.sitemap]));
|
|
6125
6203
|
}
|
|
6126
6204
|
/** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
|
|
6127
6205
|
async renderGeneratedSitemap(req, res) {
|
|
6128
6206
|
try {
|
|
6129
6207
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6130
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6208
|
+
trustProxy: _optionalChain([this, 'access', _219 => _219.config, 'access', _220 => _220.server, 'optionalAccess', _221 => _221.trustProxy])
|
|
6131
6209
|
});
|
|
6132
6210
|
const sources = await Promise.all(
|
|
6133
6211
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -6138,8 +6216,8 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6138
6216
|
}),
|
|
6139
6217
|
fs7.promises.stat(route.modulePath).catch(() => void 0)
|
|
6140
6218
|
]);
|
|
6141
|
-
if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess',
|
|
6142
|
-
return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess',
|
|
6219
|
+
if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _222 => _222.metadata]))) return null;
|
|
6220
|
+
return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _223 => _223.mtime, 'access', _224 => _224.toISOString, 'call', _225 => _225()]) };
|
|
6143
6221
|
})
|
|
6144
6222
|
);
|
|
6145
6223
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
@@ -6149,15 +6227,15 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6149
6227
|
{
|
|
6150
6228
|
origin: new URL(request2.url).origin,
|
|
6151
6229
|
config: this.getAgentSitemap(),
|
|
6152
|
-
metadataBase: _optionalChain([rootMetadata, 'optionalAccess',
|
|
6230
|
+
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _226 => _226.metadataBase]),
|
|
6153
6231
|
basePath: this.config.basePath,
|
|
6154
6232
|
trailingSlash: this.config.trailingSlash,
|
|
6155
|
-
i18n: _optionalChain([this, 'access',
|
|
6233
|
+
i18n: _optionalChain([this, 'access', _227 => _227.i18nRuntime, 'optionalAccess', _228 => _228.config])
|
|
6156
6234
|
}
|
|
6157
6235
|
);
|
|
6158
6236
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6159
6237
|
res,
|
|
6160
|
-
|
|
6238
|
+
_chunk4ZVKDHS6cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
|
|
6161
6239
|
);
|
|
6162
6240
|
} catch (error) {
|
|
6163
6241
|
_chunk7U4XF76Rcjs.logger.error(`Generated sitemap.xml failed: ${error}`);
|
|
@@ -6184,9 +6262,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6184
6262
|
* matcher) covers, as the production build decides.
|
|
6185
6263
|
*/
|
|
6186
6264
|
getAgentListedRoutes() {
|
|
6187
|
-
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access',
|
|
6265
|
+
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _229 => _229.middlewareRoutes, 'optionalCall', _230 => _230()]), () => ( [])) };
|
|
6188
6266
|
return [...this.routeManager.getRoutes()].filter(
|
|
6189
|
-
([pattern]) => !pattern.includes("[") && !
|
|
6267
|
+
([pattern]) => !pattern.includes("[") && !_chunk4ZVKDHS6cjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
|
|
6190
6268
|
);
|
|
6191
6269
|
}
|
|
6192
6270
|
/**
|
|
@@ -6210,22 +6288,22 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6210
6288
|
* or a registered server such as the docs engine's. Production applies the same rules.
|
|
6211
6289
|
*/
|
|
6212
6290
|
getDefaultMCPServer() {
|
|
6213
|
-
if (_optionalChain([this, 'access',
|
|
6214
|
-
if (_optionalChain([this, 'access',
|
|
6291
|
+
if (_optionalChain([this, 'access', _231 => _231.config, 'access', _232 => _232.agent, 'optionalAccess', _233 => _233.mcp]) !== true || _chunkW53Z4WDIcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
|
|
6292
|
+
if (_optionalChain([this, 'access', _234 => _234.apiRouteExists, 'optionalCall', _235 => _235("/api/mcp")])) return void 0;
|
|
6215
6293
|
if (this.routeManager.matchRoute(_chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
6216
6294
|
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0,
|
|
6217
6295
|
readAppPackageIdentity(this.config.root),
|
|
6218
|
-
|
|
6296
|
+
_chunkHYL372GWcjs.FARM_VERSION
|
|
6219
6297
|
))));
|
|
6220
6298
|
return _chunkW53Z4WDIcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
6221
6299
|
}
|
|
6222
6300
|
async renderDefaultMCP(req, res) {
|
|
6223
6301
|
const server = this.getDefaultMCPServer();
|
|
6224
|
-
const request2 = _nullishCoalesce(_chunk2RSVYJT6cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
6302
|
+
const request2 = _nullishCoalesce(_chunk2RSVYJT6cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _236 => _236.config, 'access', _237 => _237.server, 'optionalAccess', _238 => _238.trustProxy]) })));
|
|
6225
6303
|
try {
|
|
6226
6304
|
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-IUL6OPC3.cjs");
|
|
6227
6305
|
const origin = new URL(request2.url).origin;
|
|
6228
|
-
const i18n = _optionalChain([this, 'access',
|
|
6306
|
+
const i18n = _optionalChain([this, 'access', _239 => _239.i18nRuntime, 'optionalAccess', _240 => _240.config]);
|
|
6229
6307
|
const metadataBase = await this.getRootMetadataBase();
|
|
6230
6308
|
const response = await handleFarmDefaultMCPRequest(request2, {
|
|
6231
6309
|
server,
|
|
@@ -6273,7 +6351,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6273
6351
|
}
|
|
6274
6352
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
6275
6353
|
async createLlmsTxtContext(request2, options = {}) {
|
|
6276
|
-
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access',
|
|
6354
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _241 => _241.config, 'access', _242 => _242.agent, 'optionalAccess', _243 => _243.llmsTxt]));
|
|
6277
6355
|
const origin = await this.getAgentOrigin(request2);
|
|
6278
6356
|
const sources = await Promise.all(
|
|
6279
6357
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -6299,7 +6377,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6299
6377
|
include: config.include,
|
|
6300
6378
|
exclude: config.exclude,
|
|
6301
6379
|
trailingSlash: this.config.trailingSlash,
|
|
6302
|
-
i18n: _optionalChain([this, 'access',
|
|
6380
|
+
i18n: _optionalChain([this, 'access', _244 => _244.i18nRuntime, 'optionalAccess', _245 => _245.config])
|
|
6303
6381
|
}
|
|
6304
6382
|
);
|
|
6305
6383
|
return {
|
|
@@ -6309,7 +6387,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6309
6387
|
pages,
|
|
6310
6388
|
config,
|
|
6311
6389
|
rootMetadata,
|
|
6312
|
-
mcp: _optionalChain([this, 'access',
|
|
6390
|
+
mcp: _optionalChain([this, 'access', _246 => _246.config, 'access', _247 => _247.agent, 'optionalAccess', _248 => _248.aiCatalog]) === false ? [] : _chunkXFUPWRKTcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
6313
6391
|
basePath: this.config.basePath,
|
|
6314
6392
|
apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
6315
6393
|
_chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
|
|
@@ -6339,7 +6417,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6339
6417
|
async getRootMetadataBase() {
|
|
6340
6418
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6341
6419
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6342
|
-
return _optionalChain([rootMetadata, 'optionalAccess',
|
|
6420
|
+
return _optionalChain([rootMetadata, 'optionalAccess', _249 => _249.metadataBase]);
|
|
6343
6421
|
}
|
|
6344
6422
|
/**
|
|
6345
6423
|
* Reads page mirrors back through this dev server, the way its .md handler
|
|
@@ -6351,8 +6429,8 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6351
6429
|
* body is discarded.
|
|
6352
6430
|
*/
|
|
6353
6431
|
createDevMarkdownReader(req) {
|
|
6354
|
-
const socket = _optionalChain([req, 'optionalAccess',
|
|
6355
|
-
if (_optionalChain([req, 'optionalAccess',
|
|
6432
|
+
const socket = _optionalChain([req, 'optionalAccess', _250 => _250.socket]);
|
|
6433
|
+
if (_optionalChain([req, 'optionalAccess', _251 => _251.method, 'optionalAccess', _252 => _252.toUpperCase, 'call', _253 => _253()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _254 => _254.localAddress]) || !socket.localPort) {
|
|
6356
6434
|
return async () => null;
|
|
6357
6435
|
}
|
|
6358
6436
|
if (socket.encrypted) {
|
|
@@ -6400,7 +6478,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6400
6478
|
renderer: this.getMetadataImageRenderer(),
|
|
6401
6479
|
component: isRendererCompiledComponent(
|
|
6402
6480
|
options.image.modulePath,
|
|
6403
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
6481
|
+
_nullishCoalesce(_optionalChain([this, 'access', _255 => _255.config, 'access', _256 => _256.renderer, 'optionalAccess', _257 => _257.componentExtensions]), () => ( []))
|
|
6404
6482
|
)
|
|
6405
6483
|
});
|
|
6406
6484
|
await this.writeMetadataImageResponse(req, res, handlerResult, imageModule);
|
|
@@ -6428,7 +6506,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6428
6506
|
}
|
|
6429
6507
|
const etag = `"${image.staticInfo.hash}"`;
|
|
6430
6508
|
const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6431
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6509
|
+
trustProxy: _optionalChain([this, 'access', _258 => _258.config, 'access', _259 => _259.server, 'optionalAccess', _260 => _260.trustProxy])
|
|
6432
6510
|
});
|
|
6433
6511
|
const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
|
|
6434
6512
|
res.setHeader("Content-Type", image.staticInfo.contentType);
|
|
@@ -6479,7 +6557,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6479
6557
|
});
|
|
6480
6558
|
let wrapped = errorElement;
|
|
6481
6559
|
const boundaryLayouts = options.errorPattern === void 0 ? options.layouts : options.layouts.filter(
|
|
6482
|
-
(layout) => !("pattern" in layout) ||
|
|
6560
|
+
(layout) => !("pattern" in layout) || _chunk4ZVKDHS6cjs.routeBoundaryCoversDirectory.call(void 0,
|
|
6483
6561
|
layout.pattern,
|
|
6484
6562
|
options.errorPattern
|
|
6485
6563
|
)
|
|
@@ -6535,7 +6613,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6535
6613
|
*/
|
|
6536
6614
|
renderPreHydrationHold(req, bootClient) {
|
|
6537
6615
|
const hydrates = req.__FARM_IS_CLIENT_COMPONENT__ === true || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true;
|
|
6538
|
-
return hydrates && !bootClient && !this.isIslandsOnlyPage(req) ?
|
|
6616
|
+
return hydrates && !bootClient && !this.isIslandsOnlyPage(req) ? _chunk4ZVKDHS6cjs.createPreHydrationClickQueueScript.call(void 0, ) : "";
|
|
6539
6617
|
}
|
|
6540
6618
|
async renderBufferedSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6541
6619
|
const startedAt = Date.now();
|
|
@@ -6583,7 +6661,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6583
6661
|
</script>`);
|
|
6584
6662
|
const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
|
|
6585
6663
|
const rendererHydrationScript = farmScripts(
|
|
6586
|
-
_optionalChain([this, 'access',
|
|
6664
|
+
_optionalChain([this, 'access', _261 => _261.rendererRuntime, 'access', _262 => _262.generateHydrationScript, 'optionalCall', _263 => _263()]) || ""
|
|
6587
6665
|
);
|
|
6588
6666
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
6589
6667
|
const farmClientScript = farmScripts(
|
|
@@ -6594,7 +6672,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6594
6672
|
element,
|
|
6595
6673
|
{
|
|
6596
6674
|
rejectLateNavigation: _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0,
|
|
6597
|
-
_optionalChain([req, 'access',
|
|
6675
|
+
_optionalChain([req, 'access', _264 => _264.headers, 'optionalAccess', _265 => _265[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
|
|
6598
6676
|
)
|
|
6599
6677
|
}
|
|
6600
6678
|
);
|
|
@@ -6606,7 +6684,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6606
6684
|
viewport: viewportTags
|
|
6607
6685
|
} = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6608
6686
|
pathname: getFarmMetadataPathname(req),
|
|
6609
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6687
|
+
jsonLd: _optionalChain([this, 'access', _266 => _266.config, 'access', _267 => _267.agent, 'optionalAccess', _268 => _268.jsonLd])
|
|
6610
6688
|
});
|
|
6611
6689
|
const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
6612
6690
|
const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
|
|
@@ -6616,19 +6694,19 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6616
6694
|
i18nSnapshot,
|
|
6617
6695
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6618
6696
|
) : "";
|
|
6619
|
-
const themeDocument =
|
|
6697
|
+
const themeDocument = _chunk4ZVKDHS6cjs.createFarmThemeDocumentParts.call(void 0,
|
|
6620
6698
|
this.config.theme,
|
|
6621
6699
|
this.config.basePath,
|
|
6622
6700
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
6623
6701
|
);
|
|
6624
6702
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
6625
|
-
const fullDocument =
|
|
6703
|
+
const fullDocument = _chunk4ZVKDHS6cjs.extractFarmFullDocument.call(void 0, _chunk4ZVKDHS6cjs.markFarmDocumentLayouts.call(void 0, content));
|
|
6626
6704
|
let html;
|
|
6627
6705
|
if (fullDocument) {
|
|
6628
6706
|
const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
|
|
6629
|
-
const documentHtml = shouldReplaceLayoutTitle ?
|
|
6630
|
-
const effectiveRendererHead = hasExplicitTitle ?
|
|
6631
|
-
html =
|
|
6707
|
+
const documentHtml = shouldReplaceLayoutTitle ? _chunk4ZVKDHS6cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
|
|
6708
|
+
const effectiveRendererHead = hasExplicitTitle ? _chunk4ZVKDHS6cjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
|
|
6709
|
+
html = _chunk4ZVKDHS6cjs.composeFarmFullDocument.call(void 0, documentHtml, {
|
|
6632
6710
|
fallbackIcon: !hasFavicon,
|
|
6633
6711
|
viewport: viewportTags,
|
|
6634
6712
|
htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
|
|
@@ -6655,7 +6733,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6655
6733
|
});
|
|
6656
6734
|
} else {
|
|
6657
6735
|
html = `<!DOCTYPE html>
|
|
6658
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6736
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _269 => _269.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6659
6737
|
<head>
|
|
6660
6738
|
${themeDocument.head}
|
|
6661
6739
|
<meta charset="utf-8">
|
|
@@ -6687,7 +6765,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6687
6765
|
const securedHtml = this.secureDocumentHTML(req, html);
|
|
6688
6766
|
if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
|
|
6689
6767
|
res.end();
|
|
6690
|
-
if (!options.captureStaticShell) await _optionalChain([options, 'access',
|
|
6768
|
+
if (!options.captureStaticShell) await _optionalChain([options, 'access', _270 => _270.onComplete, 'optionalCall', _271 => _271(securedHtml)]);
|
|
6691
6769
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
6692
6770
|
type: "render.stream.complete",
|
|
6693
6771
|
route,
|
|
@@ -6697,7 +6775,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6697
6775
|
emitFarmRenderError(req, route, error);
|
|
6698
6776
|
throw error;
|
|
6699
6777
|
} finally {
|
|
6700
|
-
_optionalChain([clearMiddlewareData, 'optionalCall',
|
|
6778
|
+
_optionalChain([clearMiddlewareData, 'optionalCall', _272 => _272()]);
|
|
6701
6779
|
}
|
|
6702
6780
|
}
|
|
6703
6781
|
/**
|
|
@@ -6707,11 +6785,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6707
6785
|
* call (async, a class, or one using hooks) falls back to detection from the stream.
|
|
6708
6786
|
*/
|
|
6709
6787
|
async rootLayoutRendersDocument(req) {
|
|
6710
|
-
const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access',
|
|
6788
|
+
const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access', _273 => _273.routeManager, 'access', _274 => _274.getLayouts, 'call', _275 => _275(), 'access', _276 => _276.get, 'call', _277 => _277("/"), 'optionalAccess', _278 => _278.modulePath]) : void 0)));
|
|
6711
6789
|
if (!modulePath) return false;
|
|
6712
6790
|
try {
|
|
6713
6791
|
const Layout = (await this.routeManager.loadLayoutModule(modulePath)).default;
|
|
6714
|
-
if (typeof Layout !== "function" || _optionalChain([Layout, 'access',
|
|
6792
|
+
if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _279 => _279.prototype, 'optionalAccess', _280 => _280.isReactComponent]) || _optionalChain([Layout, 'access', _281 => _281.constructor, 'optionalAccess', _282 => _282.name]) === "AsyncFunction") {
|
|
6715
6793
|
return false;
|
|
6716
6794
|
}
|
|
6717
6795
|
const cached = documentLayouts.get(Layout);
|
|
@@ -6737,7 +6815,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6737
6815
|
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (_chunkT7UC2ORAcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node").web && runtime.renderToReadableStream ? pipeFarmRendererWebStream(runtime) : void 0)));
|
|
6738
6816
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6739
6817
|
const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument(req);
|
|
6740
|
-
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access',
|
|
6818
|
+
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _283 => _283.headers, 'optionalAccess', _284 => _284[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && options.captureStaticShell) {
|
|
6741
6819
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
6742
6820
|
}
|
|
6743
6821
|
return new Promise((resolve3, reject) => {
|
|
@@ -6815,7 +6893,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6815
6893
|
const waitingRoot = this.islandValues() && !islandsOnlyPage && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true && rootStrategy !== void 0 && rootStrategy !== "load" ? req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? "root" : "__farm_page__" : null;
|
|
6816
6894
|
const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts && _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ) !== "mobile" && canBootFarmIslandsClient(this.config);
|
|
6817
6895
|
const hydrationClickQueueScript = this.renderPreHydrationHold(req, bootClient);
|
|
6818
|
-
const rendererHydrationScript = _optionalChain([this, 'access',
|
|
6896
|
+
const rendererHydrationScript = _optionalChain([this, 'access', _285 => _285.rendererRuntime, 'access', _286 => _286.generateHydrationScript, 'optionalCall', _287 => _287()]) || "";
|
|
6819
6897
|
const {
|
|
6820
6898
|
title,
|
|
6821
6899
|
tags: metaTags,
|
|
@@ -6824,7 +6902,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6824
6902
|
viewport: viewportTags
|
|
6825
6903
|
} = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6826
6904
|
pathname: getFarmMetadataPathname(req),
|
|
6827
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6905
|
+
jsonLd: _optionalChain([this, 'access', _288 => _288.config, 'access', _289 => _289.agent, 'optionalAccess', _290 => _290.jsonLd])
|
|
6828
6906
|
});
|
|
6829
6907
|
const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6830
6908
|
const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -6833,7 +6911,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6833
6911
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6834
6912
|
) : "";
|
|
6835
6913
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6836
|
-
const themeDocument =
|
|
6914
|
+
const themeDocument = _chunk4ZVKDHS6cjs.createFarmThemeDocumentParts.call(void 0,
|
|
6837
6915
|
this.config.theme,
|
|
6838
6916
|
this.config.basePath,
|
|
6839
6917
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
@@ -6852,7 +6930,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6852
6930
|
formState: _chunkOZUINP2Pcjs.getFarmFormState.call(void 0, ),
|
|
6853
6931
|
onShellReady() {
|
|
6854
6932
|
if (pendingNavigationError) {
|
|
6855
|
-
_optionalChain([abort, 'optionalCall',
|
|
6933
|
+
_optionalChain([abort, 'optionalCall', _291 => _291(pendingNavigationError)]);
|
|
6856
6934
|
if (clearMiddlewareData) {
|
|
6857
6935
|
clearMiddlewareData();
|
|
6858
6936
|
}
|
|
@@ -6870,7 +6948,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6870
6948
|
console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
|
|
6871
6949
|
}
|
|
6872
6950
|
const shell = `<!DOCTYPE html>
|
|
6873
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6951
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _292 => _292.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6874
6952
|
<head>
|
|
6875
6953
|
${themeDocument.head}
|
|
6876
6954
|
<meta charset="utf-8">
|
|
@@ -6892,14 +6970,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6892
6970
|
let pendingShell = streamDocument ? "" : stampDocumentHTML(shell);
|
|
6893
6971
|
let heldHead = "";
|
|
6894
6972
|
const releaseShell = (complete) => {
|
|
6895
|
-
const split =
|
|
6973
|
+
const split = _chunk4ZVKDHS6cjs.takeFarmHoistedHead.call(void 0, heldHead, complete);
|
|
6896
6974
|
if (!split) return null;
|
|
6897
|
-
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ?
|
|
6898
|
-
const opened =
|
|
6975
|
+
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? _chunk4ZVKDHS6cjs.removeFarmDocumentTitles.call(void 0, pendingShell) : pendingShell;
|
|
6976
|
+
const opened = _chunk4ZVKDHS6cjs.appendFarmHead.call(void 0, shellHead, split.head);
|
|
6899
6977
|
pendingShell = "";
|
|
6900
6978
|
heldHead = "";
|
|
6901
6979
|
htmlParts.push(opened);
|
|
6902
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
6980
|
+
_optionalChain([staticShellParts, 'optionalAccess', _293 => _293.push, 'call', _294 => _294(opened)]);
|
|
6903
6981
|
res.write(opened);
|
|
6904
6982
|
return split.body;
|
|
6905
6983
|
};
|
|
@@ -6911,11 +6989,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6911
6989
|
${stampDocumentHTML(earlyClientScript)}`
|
|
6912
6990
|
)
|
|
6913
6991
|
} : document;
|
|
6914
|
-
const documentTransform = streamDocument ?
|
|
6992
|
+
const documentTransform = streamDocument ? _chunk4ZVKDHS6cjs.createFarmStreamedDocumentTransform.call(void 0,
|
|
6915
6993
|
(opening) => withEarlyClient(
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
hasExplicitTitle ?
|
|
6994
|
+
_chunk4ZVKDHS6cjs.openFarmStreamedDocument.call(void 0,
|
|
6995
|
+
_chunk4ZVKDHS6cjs.markFarmDocumentLayouts.call(void 0,
|
|
6996
|
+
hasExplicitTitle ? _chunk4ZVKDHS6cjs.removeFarmDocumentTitles.call(void 0, opening) : opening
|
|
6919
6997
|
),
|
|
6920
6998
|
{
|
|
6921
6999
|
fallbackIcon: !hasFavicon,
|
|
@@ -6956,7 +7034,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6956
7034
|
const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
|
|
6957
7035
|
if (!checkedFullDocument && renderedText) {
|
|
6958
7036
|
documentPrefix += renderedText;
|
|
6959
|
-
const prefix =
|
|
7037
|
+
const prefix = _chunk4ZVKDHS6cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
|
|
6960
7038
|
if (prefix !== "pending") {
|
|
6961
7039
|
checkedFullDocument = true;
|
|
6962
7040
|
documentPrefix = "";
|
|
@@ -6975,7 +7053,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6975
7053
|
staticShellClosed = true;
|
|
6976
7054
|
if (!suspenseHoleEmitted) {
|
|
6977
7055
|
suspenseHoleEmitted = true;
|
|
6978
|
-
_optionalChain([options, 'access',
|
|
7056
|
+
_optionalChain([options, 'access', _295 => _295.onSuspenseHoleDetected, 'optionalCall', _296 => _296()]);
|
|
6979
7057
|
}
|
|
6980
7058
|
} else {
|
|
6981
7059
|
staticShellParts.push(chunkText);
|
|
@@ -7027,7 +7105,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7027
7105
|
const body = releaseShell(true);
|
|
7028
7106
|
if (body) {
|
|
7029
7107
|
htmlParts.push(body);
|
|
7030
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
7108
|
+
_optionalChain([staticShellParts, 'optionalAccess', _297 => _297.push, 'call', _298 => _298(body)]);
|
|
7031
7109
|
res.write(body);
|
|
7032
7110
|
}
|
|
7033
7111
|
}
|
|
@@ -7059,8 +7137,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7059
7137
|
recordRenderedChunk(tail, rewritten);
|
|
7060
7138
|
if (tail) res.write(tail);
|
|
7061
7139
|
}
|
|
7062
|
-
const documentEnd = _optionalChain([documentTransform, 'optionalAccess',
|
|
7063
|
-
if (_optionalChain([documentEnd, 'optionalAccess',
|
|
7140
|
+
const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _299 => _299.end, 'call', _300 => _300()]);
|
|
7141
|
+
if (_optionalChain([documentEnd, 'optionalAccess', _301 => _301.text])) {
|
|
7064
7142
|
recordRenderedChunk(documentEnd.text, "");
|
|
7065
7143
|
res.write(documentEnd.text);
|
|
7066
7144
|
}
|
|
@@ -7071,7 +7149,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7071
7149
|
deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
|
|
7072
7150
|
earlyClient,
|
|
7073
7151
|
// A full document: Farm's #root closes only where Farm opened it.
|
|
7074
|
-
..._optionalChain([documentEnd, 'optionalAccess',
|
|
7152
|
+
..._optionalChain([documentEnd, 'optionalAccess', _302 => _302.document]) ? { closeRoot: documentEnd.rootOpened } : {}
|
|
7075
7153
|
})
|
|
7076
7154
|
);
|
|
7077
7155
|
htmlParts.push(footer);
|
|
@@ -7178,7 +7256,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7178
7256
|
* rules and the not-found lookup scans `src/app` as before.
|
|
7179
7257
|
*/
|
|
7180
7258
|
getRendererNotFoundPath() {
|
|
7181
|
-
return _optionalChain([this, 'access',
|
|
7259
|
+
return _optionalChain([this, 'access', _303 => _303.config, 'access', _304 => _304.renderer, 'optionalAccess', _305 => _305.routes]) ? this.routeManager.getRendererNotFoundPath() : void 0;
|
|
7182
7260
|
}
|
|
7183
7261
|
/** The app's not-found component, or null when it relies on the built-in page. */
|
|
7184
7262
|
async loadNotFoundModule() {
|
|
@@ -7191,7 +7269,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7191
7269
|
return await this.routeManager.loadRouteModule(notFoundPath);
|
|
7192
7270
|
}
|
|
7193
7271
|
async loadNotFoundComponent() {
|
|
7194
|
-
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async
|
|
7272
|
+
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _306 => _306.default]), async () => ( null));
|
|
7195
7273
|
}
|
|
7196
7274
|
/** The not-found document's head: layout and not-found metadata, as production renders it. */
|
|
7197
7275
|
async notFoundMetadataHead(layoutModule, notFoundModule) {
|
|
@@ -7214,13 +7292,13 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7214
7292
|
*/
|
|
7215
7293
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
7216
7294
|
if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
|
|
7217
|
-
return
|
|
7295
|
+
return _chunk4ZVKDHS6cjs.createLateRedirectRecovery.call(void 0,
|
|
7218
7296
|
this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
|
|
7219
7297
|
this.getCspNonce(req) || ""
|
|
7220
7298
|
);
|
|
7221
7299
|
}
|
|
7222
7300
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7223
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7301
|
+
trustProxy: _optionalChain([this, 'access', _307 => _307.config, 'access', _308 => _308.server, 'optionalAccess', _309 => _309.trustProxy])
|
|
7224
7302
|
}).pathname;
|
|
7225
7303
|
let content = this.defaultNotFoundContent();
|
|
7226
7304
|
const NotFoundComponent = await this.loadNotFoundComponent();
|
|
@@ -7235,12 +7313,12 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7235
7313
|
_chunk7U4XF76Rcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
7236
7314
|
}
|
|
7237
7315
|
}
|
|
7238
|
-
return
|
|
7316
|
+
return _chunk4ZVKDHS6cjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
|
|
7239
7317
|
}
|
|
7240
7318
|
async render404(req, res) {
|
|
7241
7319
|
res.statusCode = 404;
|
|
7242
7320
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7243
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7321
|
+
trustProxy: _optionalChain([this, 'access', _310 => _310.config, 'access', _311 => _311.server, 'optionalAccess', _312 => _312.trustProxy])
|
|
7244
7322
|
}).pathname;
|
|
7245
7323
|
if (_chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7246
7324
|
res.setHeader("Content-Type", "application/json");
|
|
@@ -7267,7 +7345,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7267
7345
|
const appDir = path10.join(this.config.root, this.config.srcDir, "app");
|
|
7268
7346
|
const notFoundExtensions = _chunkT7UC2ORAcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7269
7347
|
let layoutModule = null;
|
|
7270
|
-
const rendererRootLayout = _optionalChain([this, 'access',
|
|
7348
|
+
const rendererRootLayout = _optionalChain([this, 'access', _313 => _313.config, 'access', _314 => _314.renderer, 'optionalAccess', _315 => _315.routes]) ? _optionalChain([this, 'access', _316 => _316.routeManager, 'access', _317 => _317.getLayouts, 'call', _318 => _318(), 'access', _319 => _319.get, 'call', _320 => _320("/"), 'optionalAccess', _321 => _321.modulePath]) : void 0;
|
|
7271
7349
|
try {
|
|
7272
7350
|
for (const layoutPath of rendererRootLayout ? [rendererRootLayout] : notFoundExtensions.map((ext) => path10.join(appDir, `layout${ext}`))) {
|
|
7273
7351
|
if (fs7.existsSync(layoutPath)) {
|
|
@@ -7282,9 +7360,9 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7282
7360
|
);
|
|
7283
7361
|
if (notFoundPath) {
|
|
7284
7362
|
const notFoundModule = await this.loadNotFoundModule();
|
|
7285
|
-
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess',
|
|
7363
|
+
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _322 => _322.default]), () => ( null));
|
|
7286
7364
|
if (NotFoundComponent) {
|
|
7287
|
-
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess',
|
|
7365
|
+
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _323 => _323.default]), () => ( null));
|
|
7288
7366
|
let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
|
|
7289
7367
|
if (LayoutComponent) {
|
|
7290
7368
|
element = this.rendererRuntime.createElement(LayoutComponent, {
|
|
@@ -7321,23 +7399,23 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7321
7399
|
res.statusCode = statusCode;
|
|
7322
7400
|
const isDev = process.env.NODE_ENV === "development";
|
|
7323
7401
|
const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7324
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7402
|
+
trustProxy: _optionalChain([this, 'access', _324 => _324.config, 'access', _325 => _325.server, 'optionalAccess', _326 => _326.trustProxy])
|
|
7325
7403
|
});
|
|
7326
7404
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7327
|
-
const statusText =
|
|
7405
|
+
const statusText = _chunk4ZVKDHS6cjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
7328
7406
|
const content = this.stampFarmScripts(
|
|
7329
7407
|
req,
|
|
7330
|
-
|
|
7408
|
+
_chunk4ZVKDHS6cjs.createDefaultErrorMarkup.call(void 0, {
|
|
7331
7409
|
statusCode,
|
|
7332
7410
|
statusText,
|
|
7333
7411
|
requestPath: requestUrl.pathname,
|
|
7334
7412
|
method: req.method || "GET",
|
|
7335
|
-
message: _optionalChain([diagnostics, 'optionalAccess',
|
|
7336
|
-
errorName: _optionalChain([diagnostics, 'optionalAccess',
|
|
7337
|
-
stack: _optionalChain([diagnostics, 'optionalAccess',
|
|
7338
|
-
sourceFrame: _optionalChain([diagnostics, 'optionalAccess',
|
|
7413
|
+
message: _optionalChain([diagnostics, 'optionalAccess', _327 => _327.message]),
|
|
7414
|
+
errorName: _optionalChain([diagnostics, 'optionalAccess', _328 => _328.name]),
|
|
7415
|
+
stack: _optionalChain([diagnostics, 'optionalAccess', _329 => _329.stack]),
|
|
7416
|
+
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _330 => _330.sourceFrame]),
|
|
7339
7417
|
development: isDev,
|
|
7340
|
-
farmVersion:
|
|
7418
|
+
farmVersion: _chunkHYL372GWcjs.FARM_VERSION,
|
|
7341
7419
|
nodeVersion: process.version,
|
|
7342
7420
|
mode: isDev ? "development" : "production"
|
|
7343
7421
|
})
|
|
@@ -7363,9 +7441,9 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7363
7441
|
*/
|
|
7364
7442
|
getI18nAlternateOptions(req, metadata) {
|
|
7365
7443
|
return {
|
|
7366
|
-
metadataBase: _optionalChain([metadata, 'optionalAccess',
|
|
7367
|
-
origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7368
|
-
languages: _optionalChain([metadata, 'optionalAccess',
|
|
7444
|
+
metadataBase: _optionalChain([metadata, 'optionalAccess', _331 => _331.metadataBase]),
|
|
7445
|
+
origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _332 => _332.config, 'access', _333 => _333.server, 'optionalAccess', _334 => _334.trustProxy]) }).origin : void 0,
|
|
7446
|
+
languages: _optionalChain([metadata, 'optionalAccess', _335 => _335.alternates, 'optionalAccess', _336 => _336.languages])
|
|
7369
7447
|
};
|
|
7370
7448
|
}
|
|
7371
7449
|
createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
|
|
@@ -7384,20 +7462,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7384
7462
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
7385
7463
|
) : "";
|
|
7386
7464
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
7387
|
-
const themeDocument =
|
|
7465
|
+
const themeDocument = _chunk4ZVKDHS6cjs.createFarmThemeDocumentParts.call(void 0,
|
|
7388
7466
|
this.config.theme,
|
|
7389
7467
|
this.config.basePath,
|
|
7390
7468
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
7391
7469
|
);
|
|
7392
7470
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
7393
7471
|
const rendererHydrationScript = farmScripts(
|
|
7394
|
-
_optionalChain([this, 'access',
|
|
7472
|
+
_optionalChain([this, 'access', _337 => _337.rendererRuntime, 'access', _338 => _338.generateHydrationScript, 'optionalCall', _339 => _339()]) || ""
|
|
7395
7473
|
);
|
|
7396
|
-
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access',
|
|
7397
|
-
const fullDocument =
|
|
7474
|
+
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _340 => _340.metadata, 'optionalAccess', _341 => _341.viewport]));
|
|
7475
|
+
const fullDocument = _chunk4ZVKDHS6cjs.extractFarmFullDocument.call(void 0, _chunk4ZVKDHS6cjs.markFarmDocumentLayouts.call(void 0, content));
|
|
7398
7476
|
if (fullDocument) {
|
|
7399
|
-
return
|
|
7400
|
-
metadataHead ?
|
|
7477
|
+
return _chunk4ZVKDHS6cjs.composeFarmFullDocument.call(void 0,
|
|
7478
|
+
metadataHead ? _chunk4ZVKDHS6cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
|
|
7401
7479
|
{
|
|
7402
7480
|
fallbackIcon: !metadataHead,
|
|
7403
7481
|
viewport: viewportTags,
|
|
@@ -7423,7 +7501,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7423
7501
|
);
|
|
7424
7502
|
}
|
|
7425
7503
|
return `<!DOCTYPE html>
|
|
7426
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
7504
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _342 => _342.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
7427
7505
|
<head>
|
|
7428
7506
|
${themeDocument.head}
|
|
7429
7507
|
<meta charset="utf-8">
|
|
@@ -7464,7 +7542,7 @@ ${clientScript}
|
|
|
7464
7542
|
const deploymentId = this.getDeploymentId();
|
|
7465
7543
|
res.setHeader(_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
|
|
7466
7544
|
if ((req.method || "GET").toUpperCase() !== "GET") return;
|
|
7467
|
-
const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7545
|
+
const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _343 => _343.config, 'access', _344 => _344.server, 'optionalAccess', _345 => _345.trustProxy]) }).protocol === "https:";
|
|
7468
7546
|
const cookie = _chunkNLBHLPEOcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
|
|
7469
7547
|
const existing = res.getHeader("Set-Cookie");
|
|
7470
7548
|
if (Array.isArray(existing)) {
|
|
@@ -7607,10 +7685,10 @@ var FarmApp = class {
|
|
|
7607
7685
|
env: config.env || { server: {}, public: {} },
|
|
7608
7686
|
suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
|
|
7609
7687
|
experimental: {
|
|
7610
|
-
serverComponents: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7611
|
-
serverActions: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7612
|
-
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7613
|
-
ppr: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7688
|
+
serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _346 => _346.experimental, 'optionalAccess', _347 => _347.serverComponents]), () => ( false)),
|
|
7689
|
+
serverActions: _nullishCoalesce(_optionalChain([config, 'access', _348 => _348.experimental, 'optionalAccess', _349 => _349.serverActions]), () => ( false)),
|
|
7690
|
+
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _350 => _350.experimental, 'optionalAccess', _351 => _351.isolatedClientHydration]), () => ( "off")),
|
|
7691
|
+
ppr: _nullishCoalesce(_optionalChain([config, 'access', _352 => _352.experimental, 'optionalAccess', _353 => _353.ppr]), () => ( false)),
|
|
7614
7692
|
...config.experimental
|
|
7615
7693
|
},
|
|
7616
7694
|
agent: _nullishCoalesce(config.agent, () => ( {})),
|
|
@@ -7630,7 +7708,7 @@ var FarmApp = class {
|
|
|
7630
7708
|
);
|
|
7631
7709
|
}
|
|
7632
7710
|
async verifyAppStructure() {
|
|
7633
|
-
if (typeof _optionalChain([this, 'access',
|
|
7711
|
+
if (typeof _optionalChain([this, 'access', _354 => _354.config, 'access', _355 => _355.renderer, 'optionalAccess', _356 => _356.routes]) === "function") return;
|
|
7634
7712
|
const appDirs = _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config);
|
|
7635
7713
|
const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunk7U4XF76Rcjs.fileExists.call(void 0, appDir)))).some(
|
|
7636
7714
|
Boolean
|
|
@@ -7670,7 +7748,7 @@ function isResolvedAuthConfig(value) {
|
|
|
7670
7748
|
);
|
|
7671
7749
|
}
|
|
7672
7750
|
function normalizeFarmAppAPIConfig(config) {
|
|
7673
|
-
if (typeof _optionalChain([config, 'optionalAccess',
|
|
7751
|
+
if (typeof _optionalChain([config, 'optionalAccess', _357 => _357.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _358 => _358.basePath]) === "function") {
|
|
7674
7752
|
throw new Error(
|
|
7675
7753
|
"Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
|
|
7676
7754
|
);
|
|
@@ -7685,7 +7763,7 @@ function createFarmApp(config, viteServer) {
|
|
|
7685
7763
|
var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
|
|
7686
7764
|
var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
|
|
7687
7765
|
function resolveFarmImageProviderForRuntime(images, options) {
|
|
7688
|
-
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess',
|
|
7766
|
+
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _359 => _359.provider]), () => ( "auto"));
|
|
7689
7767
|
if (provider === "none") return images;
|
|
7690
7768
|
const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
|
|
7691
7769
|
if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
|
|
@@ -7826,9 +7904,9 @@ function staticValue(node) {
|
|
|
7826
7904
|
}
|
|
7827
7905
|
}
|
|
7828
7906
|
function property(object, name) {
|
|
7829
|
-
return _optionalChain([object, 'access',
|
|
7907
|
+
return _optionalChain([object, 'access', _360 => _360.properties, 'access', _361 => _361.find, 'call', _362 => _362(
|
|
7830
7908
|
(entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
|
|
7831
|
-
), 'optionalAccess',
|
|
7909
|
+
), 'optionalAccess', _363 => _363.value]);
|
|
7832
7910
|
}
|
|
7833
7911
|
function toolFromObject(object) {
|
|
7834
7912
|
const name = staticValue(property(object, "name"));
|
|
@@ -7874,7 +7952,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7874
7952
|
if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
|
|
7875
7953
|
continue;
|
|
7876
7954
|
for (const specifier of statement.specifiers) {
|
|
7877
|
-
const imported = _nullishCoalesce(_optionalChain([specifier, 'access',
|
|
7955
|
+
const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _364 => _364.imported, 'optionalAccess', _365 => _365.name]), () => ( _optionalChain([specifier, 'access', _366 => _366.imported, 'optionalAccess', _367 => _367.value])));
|
|
7878
7956
|
if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
|
|
7879
7957
|
locals.set(specifier.local.name, imported);
|
|
7880
7958
|
}
|
|
@@ -7890,7 +7968,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7890
7968
|
const [argument] = current.arguments;
|
|
7891
7969
|
if (definer && argument) {
|
|
7892
7970
|
const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
|
|
7893
|
-
(element) => _optionalChain([element, 'optionalAccess',
|
|
7971
|
+
(element) => _optionalChain([element, 'optionalAccess', _368 => _368.type]) === "ObjectExpression"
|
|
7894
7972
|
) : [] : argument.type === "ObjectExpression" ? [argument] : [];
|
|
7895
7973
|
for (const object of objects) {
|
|
7896
7974
|
const tool = toolFromObject(object);
|
|
@@ -7951,8 +8029,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
|
7951
8029
|
|
|
7952
8030
|
var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
7953
8031
|
function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
7954
|
-
const client = _optionalChain([cache2, 'optionalAccess',
|
|
7955
|
-
const adapter = _optionalChain([client, 'optionalAccess',
|
|
8032
|
+
const client = _optionalChain([cache2, 'optionalAccess', _369 => _369.client]);
|
|
8033
|
+
const adapter = _optionalChain([client, 'optionalAccess', _370 => _370.adapter]);
|
|
7956
8034
|
if (adapter === void 0) return void 0;
|
|
7957
8035
|
if (typeof adapter !== "string" || adapter.trim().length === 0) {
|
|
7958
8036
|
throw new Error(
|
|
@@ -7967,8 +8045,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
|
7967
8045
|
);
|
|
7968
8046
|
}
|
|
7969
8047
|
const options = {};
|
|
7970
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
7971
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
8048
|
+
if (_optionalChain([client, 'optionalAccess', _371 => _371.version]) !== void 0) options.version = client.version;
|
|
8049
|
+
if (_optionalChain([client, 'optionalAccess', _372 => _372.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
|
|
7972
8050
|
return { importPath: found.replace(/\\/g, "/"), options };
|
|
7973
8051
|
}
|
|
7974
8052
|
function resolveAdapterFile(resolved) {
|
|
@@ -8426,7 +8504,7 @@ function redactFarmDocsClientConfig(code, filename) {
|
|
|
8426
8504
|
const current = node;
|
|
8427
8505
|
if (current.type === "Property") {
|
|
8428
8506
|
const name = propertyKeyName(current);
|
|
8429
|
-
const valueType = _optionalChain([current, 'access',
|
|
8507
|
+
const valueType = _optionalChain([current, 'access', _373 => _373.value, 'optionalAccess', _374 => _374.type]);
|
|
8430
8508
|
const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkXJDB564Acjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
|
|
8431
8509
|
if (name && credential) {
|
|
8432
8510
|
edits.push(
|
|
@@ -8469,7 +8547,7 @@ function farmDocsClientConfigPlugin(configModule) {
|
|
|
8469
8547
|
// Never matches without a docs config module, so the bundler never calls the handler.
|
|
8470
8548
|
filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
|
|
8471
8549
|
handler(code, id, options) {
|
|
8472
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
8550
|
+
if (_optionalChain([options, 'optionalAccess', _375 => _375.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
|
|
8473
8551
|
const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
|
|
8474
8552
|
return redacted === null ? null : { code: redacted, map: null };
|
|
8475
8553
|
}
|
|
@@ -8572,7 +8650,7 @@ function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
|
8572
8650
|
return Array.from(
|
|
8573
8651
|
/* @__PURE__ */ new Set([
|
|
8574
8652
|
...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE,
|
|
8575
|
-
..._optionalChain([renderer, 'optionalAccess',
|
|
8653
|
+
..._optionalChain([renderer, 'optionalAccess', _376 => _376.optimizeDeps]) || [],
|
|
8576
8654
|
// Farm's browser entry imports a renderer's client module, and no app file does, so Vite's
|
|
8577
8655
|
// scan never sees it and finds it only on the first page request, then bundles again. The
|
|
8578
8656
|
// React entry imports `react-dom/client` instead, which is already listed. A linked
|
|
@@ -8609,7 +8687,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
|
8609
8687
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
8610
8688
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
8611
8689
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
8612
|
-
..._optionalChain([entries, 'optionalAccess',
|
|
8690
|
+
..._optionalChain([entries, 'optionalAccess', _377 => _377.length]) ? { entries: [...entries] } : {},
|
|
8613
8691
|
// Vite's dependency scan compiles JSX on its own: with the app tsconfig's `jsxImportSource`
|
|
8614
8692
|
// when there is one, otherwise as React, whatever the renderer's plugin set for its own
|
|
8615
8693
|
// transforms. React is the default already, and naming it here would override a tsconfig
|
|
@@ -8650,8 +8728,8 @@ function mergeFarmViteAlias(farmValue, userValue) {
|
|
|
8650
8728
|
return [...userEntries, ...normalize(farmValue).filter((entry) => !userNames.has(entry.find))];
|
|
8651
8729
|
}
|
|
8652
8730
|
function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
8653
|
-
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8654
|
-
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8731
|
+
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _378 => _378.optimizeDeps, 'optionalAccess', _379 => _379.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _380 => _380.optimizeDeps, 'optionalAccess', _381 => _381.noDiscovery])));
|
|
8732
|
+
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _382 => _382.optimizeDeps, 'optionalAccess', _383 => _383.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _384 => _384.optimizeDeps, 'optionalAccess', _385 => _385.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _386 => _386.optimizeDeps, 'optionalAccess', _387 => _387.holdUntilCrawlEnd]))));
|
|
8655
8733
|
return {
|
|
8656
8734
|
...farmConfig,
|
|
8657
8735
|
...userConfig,
|
|
@@ -8663,9 +8741,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8663
8741
|
resolve: {
|
|
8664
8742
|
...farmConfig.resolve,
|
|
8665
8743
|
...userConfig.resolve,
|
|
8666
|
-
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access',
|
|
8744
|
+
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _388 => _388.resolve, 'optionalAccess', _389 => _389.alias]), _optionalChain([userConfig, 'access', _390 => _390.resolve, 'optionalAccess', _391 => _391.alias])),
|
|
8667
8745
|
dedupe: Array.from(
|
|
8668
|
-
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access',
|
|
8746
|
+
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _392 => _392.resolve, 'optionalAccess', _393 => _393.dedupe]) || [], ..._optionalChain([userConfig, 'access', _394 => _394.resolve, 'optionalAccess', _395 => _395.dedupe]) || []])
|
|
8669
8747
|
)
|
|
8670
8748
|
},
|
|
8671
8749
|
optimizeDeps: {
|
|
@@ -8675,21 +8753,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8675
8753
|
holdUntilCrawlEnd,
|
|
8676
8754
|
include: Array.from(
|
|
8677
8755
|
/* @__PURE__ */ new Set([
|
|
8678
|
-
..._optionalChain([farmConfig, 'access',
|
|
8679
|
-
..._optionalChain([userConfig, 'access',
|
|
8756
|
+
..._optionalChain([farmConfig, 'access', _396 => _396.optimizeDeps, 'optionalAccess', _397 => _397.include]) || [],
|
|
8757
|
+
..._optionalChain([userConfig, 'access', _398 => _398.optimizeDeps, 'optionalAccess', _399 => _399.include]) || []
|
|
8680
8758
|
])
|
|
8681
8759
|
),
|
|
8682
8760
|
exclude: Array.from(
|
|
8683
8761
|
/* @__PURE__ */ new Set([
|
|
8684
|
-
..._optionalChain([farmConfig, 'access',
|
|
8685
|
-
..._optionalChain([userConfig, 'access',
|
|
8762
|
+
..._optionalChain([farmConfig, 'access', _400 => _400.optimizeDeps, 'optionalAccess', _401 => _401.exclude]) || [],
|
|
8763
|
+
..._optionalChain([userConfig, 'access', _402 => _402.optimizeDeps, 'optionalAccess', _403 => _403.exclude]) || []
|
|
8686
8764
|
])
|
|
8687
8765
|
)
|
|
8688
8766
|
},
|
|
8689
8767
|
ssr: {
|
|
8690
8768
|
...farmConfig.ssr,
|
|
8691
8769
|
...userConfig.ssr,
|
|
8692
|
-
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access',
|
|
8770
|
+
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _404 => _404.ssr, 'optionalAccess', _405 => _405.noExternal]), _optionalChain([userConfig, 'access', _406 => _406.ssr, 'optionalAccess', _407 => _407.noExternal]))
|
|
8693
8771
|
}
|
|
8694
8772
|
};
|
|
8695
8773
|
}
|
|
@@ -8760,8 +8838,8 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8760
8838
|
...userRolldownOptions
|
|
8761
8839
|
};
|
|
8762
8840
|
const merged = mergeFarmViteConfig(farmConfig, shared);
|
|
8763
|
-
const farmBundlerOptions = _optionalChain([farmConfig, 'access',
|
|
8764
|
-
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess',
|
|
8841
|
+
const farmBundlerOptions = _optionalChain([farmConfig, 'access', _408 => _408.build, 'optionalAccess', _409 => _409.rollupOptions]);
|
|
8842
|
+
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _410 => _410.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _411 => _411.output]);
|
|
8765
8843
|
return {
|
|
8766
8844
|
...merged,
|
|
8767
8845
|
build: {
|
|
@@ -8778,7 +8856,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8778
8856
|
esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
|
|
8779
8857
|
ssr: {
|
|
8780
8858
|
...merged.ssr,
|
|
8781
|
-
external: mergeExternal(_optionalChain([farmConfig, 'access',
|
|
8859
|
+
external: mergeExternal(_optionalChain([farmConfig, 'access', _412 => _412.ssr, 'optionalAccess', _413 => _413.external]), _optionalChain([userConfig, 'access', _414 => _414.ssr, 'optionalAccess', _415 => _415.external]))
|
|
8782
8860
|
}
|
|
8783
8861
|
};
|
|
8784
8862
|
}
|
|
@@ -8859,4 +8937,5 @@ ${FARM_DARK_VARIANT}
|
|
|
8859
8937
|
|
|
8860
8938
|
|
|
8861
8939
|
|
|
8862
|
-
|
|
8940
|
+
|
|
8941
|
+
exports.inspectStaticMetadataImage = inspectStaticMetadataImage; exports.RouteManager = RouteManager; exports.createFarmDevClientManifest = createFarmDevClientManifest; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.isFarmLayoutModule = isFarmLayoutModule; exports.mergeFarmFontCss = mergeFarmFontCss; exports.resolveDevGlobalStylesheetHref = resolveDevGlobalStylesheetHref; exports.collectDevStylesheetUrls = collectDevStylesheetUrls; exports.farmDevServerStylesheetsPlugin = farmDevServerStylesheetsPlugin; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.isRendererCompiledComponent = isRendererCompiledComponent; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.resolveFarmIslxActionsMode = resolveFarmIslxActionsMode; exports.farmBrowserServerFnsEnabled = farmBrowserServerFnsEnabled; exports.inferFarmIslandStrategy = inferFarmIslandStrategy; exports.invalidateFarmRouteRootInferences = invalidateFarmRouteRootInferences; exports.resolveFarmRouteRootStrategy = resolveFarmRouteRootStrategy; exports.canBootFarmIslandsClient = canBootFarmIslandsClient; exports.canFarmSkipKeptLayoutRender = canFarmSkipKeptLayoutRender; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.resolveFarmImageServerRuntime = resolveFarmImageServerRuntime; exports.toBakedMarkdownSourcePath = toBakedMarkdownSourcePath; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE = FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE; exports.FARM_NAVIGATION_SCRIPT_SOURCE = FARM_NAVIGATION_SCRIPT_SOURCE; exports.FARM_NAVIGATION_STREAM_READER_SOURCE = FARM_NAVIGATION_STREAM_READER_SOURCE; exports.FARM_EARLY_NAVIGATION_SOURCE = FARM_EARLY_NAVIGATION_SOURCE; exports.FARM_REFRESH_FIELDS_SOURCE = FARM_REFRESH_FIELDS_SOURCE; exports.exactIdPattern = exactIdPattern; exports.fileNamePattern = fileNamePattern; exports.redactFarmDocsClientConfig = redactFarmDocsClientConfig; exports.isFarmDocsClientConfigModule = isFarmDocsClientConfigModule; exports.farmDocsClientConfigPlugin = farmDocsClientConfigPlugin; exports.FARM_VIDEO_PLAYER_HTML = FARM_VIDEO_PLAYER_HTML; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteAlias = mergeFarmViteAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin;
|