@farm.js/core 0.1.81 → 0.1.83
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-Cxi3214_.d.ts → agent-mcp.d-7uKdOttc.d.ts} +1 -1
- package/dist/{agent-mcp.d-DMqOqnOA.d.mts → agent-mcp.d-LChlR2au.d.mts} +1 -1
- package/dist/agent-runtime.cjs +4 -3
- package/dist/agent-runtime.d.mts +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/agent-runtime.mjs +3 -2
- package/dist/analyzer-WGH6J2HN.cjs +17 -0
- package/dist/{analyzer-IC66UJCU.mjs → analyzer-Y6IY26HI.mjs} +2 -2
- package/dist/api/node.cjs +5 -4
- package/dist/api/node.d.mts +4 -3
- package/dist/api/node.d.ts +4 -3
- package/dist/api/node.mjs +4 -3
- package/dist/api/route-manager.cjs +5 -4
- package/dist/api/route-manager.d.mts +4 -3
- package/dist/api/route-manager.d.ts +4 -3
- package/dist/api/route-manager.mjs +4 -3
- package/dist/api/runtime.cjs +4 -3
- package/dist/api/runtime.d.mts +3 -2
- package/dist/api/runtime.d.ts +3 -2
- package/dist/api/runtime.mjs +3 -2
- package/dist/api.cjs +7 -6
- package/dist/api.d.mts +5 -4
- package/dist/api.d.ts +5 -4
- package/dist/api.mjs +6 -5
- package/dist/{app-manifest.d-C8Cswd31.d.ts → app-manifest.d-CRp21oAz.d.ts} +1 -1
- package/dist/{app-manifest.d-Bbxp5kes.d.mts → app-manifest.d-QMdmqqCr.d.mts} +1 -1
- package/dist/app-markdown.d.mts +3 -2
- package/dist/app-markdown.d.ts +3 -2
- package/dist/{app.d-DGIoFt5D.d.ts → app.d-CVPu_hoD.d.ts} +51 -4
- package/dist/{app.d-BJuSurgy.d.mts → app.d-eSm7jgoc.d.mts} +51 -4
- package/dist/{chunk-NSLRK5DK.cjs → chunk-3CZ4MJHW.cjs} +1 -1
- package/dist/{chunk-CPZZBCPO.cjs → chunk-3DAJXBSL.cjs} +2 -2
- package/dist/chunk-3DE6RK7K.cjs +36 -0
- package/dist/{chunk-XMHERKSE.mjs → chunk-42IBGQTN.mjs} +5 -12
- package/dist/{chunk-GY63XD6K.mjs → chunk-43N3X6OO.mjs} +1 -1
- package/dist/{chunk-MOGRRZMW.cjs → chunk-55UJGUBP.cjs} +35 -30
- package/dist/{chunk-BPWTSPK6.mjs → chunk-5AL2GXAU.mjs} +1 -1
- package/dist/{chunk-GAWSWJJ2.cjs → chunk-5GFTMTX3.cjs} +2 -2
- package/dist/{chunk-LKIG5SM6.cjs → chunk-5P65LXGU.cjs} +9 -9
- package/dist/{chunk-TPA2PV5J.mjs → chunk-5V6HSJFG.mjs} +24 -1
- package/dist/chunk-5X5GJU5A.cjs +426 -0
- package/dist/{chunk-UF4BNKKJ.mjs → chunk-6QYPP5KC.mjs} +2 -2
- package/dist/{chunk-ATISIC6G.mjs → chunk-7VJXYB6S.mjs} +7 -1
- package/dist/{chunk-OIWDEDUO.cjs → chunk-7X2CYE66.cjs} +419 -357
- package/dist/{chunk-XOGCNKB7.cjs → chunk-A5BHJHDF.cjs} +3 -3
- package/dist/{chunk-WGWWRV2M.cjs → chunk-B3HQTGXS.cjs} +6 -4
- package/dist/{chunk-HTNJ7A4D.mjs → chunk-B5SJYXJK.mjs} +177 -67
- package/dist/chunk-BUQR7KKO.mjs +17 -0
- package/dist/{chunk-OO4GVGM3.mjs → chunk-CA2HBLXP.mjs} +11 -1
- package/dist/{chunk-724WT3NI.mjs → chunk-CRE642TW.mjs} +1 -1
- package/dist/{chunk-Z5BANEQD.cjs → chunk-DMSXZNQR.cjs} +2 -2
- package/dist/{chunk-IPG6B25T.mjs → chunk-DPUZVGXH.mjs} +203 -54
- package/dist/{chunk-ZIYJWJV2.cjs → chunk-DZTWUEBB.cjs} +8 -8
- package/dist/{chunk-4OFWG4IK.cjs → chunk-EACD6ND7.cjs} +8 -2
- package/dist/{chunk-46UV2E7I.cjs → chunk-EFI6QWBQ.cjs} +200 -90
- package/dist/chunk-ELNRKD4V.mjs +426 -0
- package/dist/{chunk-XOXCQGAF.mjs → chunk-FFWSER54.mjs} +1 -1
- package/dist/chunk-FZ7OUN5M.cjs +30 -0
- package/dist/{chunk-5MMKNW7Q.cjs → chunk-H7REG7OX.cjs} +15 -8
- package/dist/{chunk-5ZHC6QGD.cjs → chunk-HQKCSJEH.cjs} +8 -2
- package/dist/{chunk-OUDNUFVR.cjs → chunk-HRH7OKBQ.cjs} +6 -4
- package/dist/{chunk-RHI67C2V.cjs → chunk-HUGPJFOC.cjs} +1 -35
- package/dist/{chunk-ADQ2LATR.cjs → chunk-IABI62FH.cjs} +2 -2
- package/dist/{chunk-TLSGRK7E.mjs → chunk-IAIRQAHA.mjs} +3 -1
- package/dist/{chunk-C2OLXVUC.mjs → chunk-IVP5Q4BX.mjs} +10 -3
- package/dist/{chunk-EX6ZSN5P.cjs → chunk-IZYFP7IN.cjs} +17 -24
- package/dist/chunk-J6RFB324.cjs +17 -0
- package/dist/{chunk-CL7BUGVB.cjs → chunk-JHRJ5V2F.cjs} +509 -360
- package/dist/{chunk-WIZRYFB2.cjs → chunk-JYQ6DGPW.cjs} +8 -6
- package/dist/{chunk-POL5RCVU.mjs → chunk-K3GHY7GY.mjs} +14 -9
- package/dist/{chunk-TYHWZOA2.mjs → chunk-KWI3SQFX.mjs} +4 -2
- package/dist/{chunk-UVV3I5QA.cjs → chunk-L2GUEYHR.cjs} +29 -6
- package/dist/{chunk-POVHO46S.mjs → chunk-L3RDECA5.mjs} +1 -1
- package/dist/{chunk-E3HBD2K3.cjs → chunk-LN6FAYNB.cjs} +36 -31
- package/dist/chunk-M6AJZ4XR.mjs +30 -0
- package/dist/{chunk-RPA45OQS.mjs → chunk-MO4UTDQ6.mjs} +1 -1
- package/dist/{chunk-6WVRVGKC.mjs → chunk-NAHDG6UX.mjs} +1 -1
- package/dist/{chunk-NOYKBGUK.mjs → chunk-NDWI6FDH.mjs} +558 -212
- package/dist/{chunk-OFVCWV2D.cjs → chunk-NEKO3HM2.cjs} +11 -1
- package/dist/{chunk-M6DAIE4T.cjs → chunk-NGTZHWBG.cjs} +78 -9
- package/dist/{chunk-D77OGI6X.mjs → chunk-NKVBWPXR.mjs} +1 -1
- package/dist/{chunk-SLEHAGGV.mjs → chunk-NQ3Y6E2T.mjs} +7 -1
- package/dist/{chunk-W6C3LEXX.cjs → chunk-OM6JIIJU.cjs} +155 -20
- package/dist/{chunk-S3IWDDQ3.mjs → chunk-ORBBAA7B.mjs} +1 -1
- package/dist/{chunk-7VCLTNED.mjs → chunk-PNMAD3OS.mjs} +1 -35
- package/dist/{chunk-BJWJP5A4.mjs → chunk-R3VLM2MW.mjs} +3 -3
- package/dist/{chunk-I4WZRG73.mjs → chunk-RB5IGN3N.mjs} +13 -6
- package/dist/{chunk-2HMSSPCZ.mjs → chunk-RGTZAM6Y.mjs} +71 -2
- package/dist/{chunk-IM3UINTZ.mjs → chunk-RNJX3MD6.mjs} +151 -16
- package/dist/{chunk-EJCVG25Z.mjs → chunk-S3R4JDRO.mjs} +17 -9
- package/dist/{chunk-2Y2HRZQY.cjs → chunk-SLIXHUMS.cjs} +931 -585
- package/dist/{chunk-WFVSAT7Y.cjs → chunk-T7HGXF7D.cjs} +3 -3
- package/dist/{chunk-ZKNXCRUQ.cjs → chunk-U54REWMJ.cjs} +23 -23
- package/dist/{chunk-YH7ENV3K.mjs → chunk-U56Z3755.mjs} +13 -8
- package/dist/chunk-U6XYBTUT.mjs +36 -0
- package/dist/{chunk-TCMRLW3K.cjs → chunk-VACYUMXW.cjs} +10 -3
- package/dist/{chunk-RZ6XUEQS.mjs → chunk-VQ6IXALL.mjs} +2 -2
- package/dist/{chunk-UGLTOLTJ.cjs → chunk-W76C7TCW.cjs} +2 -2
- package/dist/{chunk-FYZD7DUS.cjs → chunk-WCSBYQOT.cjs} +4 -4
- package/dist/{chunk-5N526T7Q.mjs → chunk-WZV2G2A6.mjs} +95 -33
- package/dist/{chunk-SM2SYWAR.cjs → chunk-XJDB564A.cjs} +18 -10
- package/dist/{chunk-6JWXHPVR.mjs → chunk-XRSNW4IU.mjs} +4 -2
- package/dist/{cli-runtime.d-D8O1v2_X.d.mts → cli-runtime.d-C7aMfoTq.d.mts} +8 -6
- package/dist/{cli-runtime.d-hf4L1MNP.d.ts → cli-runtime.d-DaElKjaL.d.ts} +8 -6
- package/dist/{client-component.d-DFwUHlOz.d.mts → client-component.d-DLMCzmUx.d.mts} +1 -1
- package/dist/{client-component.d-CX8UCQh-.d.ts → client-component.d-DLknFP8l.d.ts} +1 -1
- package/dist/{client-plugins.d-qWp8hNwd.d.ts → client-plugins.d-BVXjyIkY.d.ts} +20 -1
- package/dist/{client-plugins.d-BflSNO-b.d.mts → client-plugins.d-BwKwuO_0.d.mts} +20 -1
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client.cjs +4 -3
- package/dist/client.d.mts +10 -9
- package/dist/client.d.ts +10 -9
- package/dist/client.mjs +3 -2
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/desktop.d.mts +3 -2
- package/dist/desktop.d.ts +3 -2
- package/dist/{devtools-XJHODO5H.mjs → devtools-OI52TCSD.mjs} +8 -7
- package/dist/{devtools-EI5N366Z.cjs → devtools-ZM2AR36W.cjs} +11 -10
- package/dist/docs.cjs +13 -11
- package/dist/docs.d.mts +15 -6
- package/dist/docs.d.ts +15 -6
- package/dist/docs.mjs +12 -10
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.d.mts +1 -0
- package/dist/environment/vite.d.ts +1 -0
- package/dist/environment/vite.mjs +3 -3
- package/dist/{generate-route-types.d-CaGMIaNI.d.mts → generate-route-types.d-BFOMM8Ef.d.mts} +3 -0
- package/dist/{generate-route-types.d-B76M5R11.d.ts → generate-route-types.d-C2m8myHb.d.ts} +3 -0
- package/dist/{handler.d-DoH5Krkq.d.mts → handler.d-BKTWzzNA.d.mts} +1 -1
- package/dist/{handler.d-C2oRihfa.d.ts → handler.d-Dzpyg3-N.d.ts} +1 -1
- package/dist/{headers.d-BrX53wFQ.d.mts → headers.d-5opjyhXw.d.mts} +1 -1
- package/dist/{headers.d-Dj0mfYpb.d.ts → headers.d-PZyXcDAH.d.ts} +1 -1
- package/dist/index.cjs +38 -35
- package/dist/{index.d-DzDHOttz.d.mts → index.d-C0Mie66f.d.mts} +1 -1
- package/dist/{index.d-Dhc2scRl.d.ts → index.d-DV2q-0mE.d.ts} +1 -1
- package/dist/index.d.mts +26 -25
- package/dist/index.d.ts +26 -25
- package/dist/index.mjs +38 -35
- package/dist/integrations/orm.d.mts +2 -1
- package/dist/integrations/orm.d.ts +2 -1
- package/dist/integrations.cjs +4 -3
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/integrations.mjs +3 -2
- package/dist/internal/app-markdown-runtime.d.mts +3 -2
- package/dist/internal/app-markdown-runtime.d.ts +3 -2
- package/dist/internal/build-runtime.cjs +31 -30
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +30 -29
- package/dist/internal/cli-runtime.cjs +12 -11
- package/dist/internal/cli-runtime.d.mts +8 -7
- package/dist/internal/cli-runtime.d.ts +8 -7
- package/dist/internal/cli-runtime.mjs +11 -10
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +2 -1
- package/dist/internal/compression-runtime.d.ts +2 -1
- package/dist/internal/config-runtime.cjs +10 -9
- package/dist/internal/config-runtime.d.mts +6 -5
- package/dist/internal/config-runtime.d.ts +6 -5
- package/dist/internal/config-runtime.mjs +9 -8
- package/dist/internal/infra-analytics-runtime.cjs +8 -6
- package/dist/internal/infra-analytics-runtime.d.mts +8 -2
- package/dist/internal/infra-analytics-runtime.d.ts +8 -2
- package/dist/internal/infra-analytics-runtime.mjs +8 -6
- package/dist/internal/islands-action-client.cjs +18 -0
- package/dist/internal/islands-action-client.d.mts +18 -0
- package/dist/internal/islands-action-client.d.ts +18 -0
- package/dist/internal/islands-action-client.mjs +18 -0
- package/dist/internal/islands-boot.cjs +54 -20
- package/dist/internal/islands-boot.d.mts +5 -3
- package/dist/internal/islands-boot.d.ts +5 -3
- package/dist/internal/islands-boot.mjs +49 -15
- package/dist/internal/islands-runtime.cjs +3 -8
- package/dist/internal/islands-runtime.mjs +4 -9
- package/dist/internal/islx-actions-client.cjs +4 -3
- package/dist/internal/islx-actions-client.mjs +3 -2
- package/dist/internal/islx-actions-server.d.mts +0 -2
- package/dist/internal/islx-actions-server.d.ts +0 -2
- package/dist/internal/islx-client.cjs +13 -1
- package/dist/internal/islx-client.d.mts +11 -0
- package/dist/internal/islx-client.d.ts +11 -0
- package/dist/internal/islx-client.mjs +14 -0
- package/dist/internal/metadata-image-runtime.d.mts +1 -0
- package/dist/internal/metadata-image-runtime.d.ts +1 -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 +12 -7
- package/dist/internal/production-runtime.d.mts +14 -12
- package/dist/internal/production-runtime.d.ts +14 -12
- package/dist/internal/production-runtime.mjs +11 -6
- 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 +2 -1
- package/dist/internal/start-manifest.d.ts +2 -1
- package/dist/markdown.d.mts +2 -1
- package/dist/markdown.d.ts +2 -1
- package/dist/middleware.d.mts +2 -1
- package/dist/middleware.d.ts +2 -1
- package/dist/mobile.d.mts +6 -3
- package/dist/mobile.d.ts +6 -3
- package/dist/{mount.d-DOaeUoWq.d.mts → mount.d-CZ_qL1iS.d.mts} +1 -1
- package/dist/{mount.d-DwXjaOHY.d.ts → mount.d-gWul1GA1.d.ts} +1 -1
- package/dist/{navigation-delegate.d-BElGUMgt.d.mts → navigation-delegate.d-BBTzhJLj.d.mts} +1 -1
- package/dist/{navigation-delegate.d-o3pPd9VI.d.ts → navigation-delegate.d-BZsYEAet.d.ts} +1 -1
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/{nitro-YLTGVGK4.mjs → nitro-FK3SZM4H.mjs} +1 -1
- package/dist/{nitro-XGIO6EQN.cjs → nitro-YDFMH5PY.cjs} +4 -4
- package/dist/{plugin-LN3JBZRR.cjs → plugin-3PT7I26P.cjs} +2 -2
- package/dist/{plugin-33I3V42N.mjs → plugin-QOTAPTVV.mjs} +1 -1
- package/dist/plugin.cjs +25 -23
- package/dist/plugin.d.mts +6 -6
- package/dist/plugin.d.ts +6 -6
- package/dist/plugin.mjs +24 -22
- package/dist/{render-plan.d-BD06tqFA.d.ts → render-plan.d-AaJsYPX-.d.ts} +1 -1
- package/dist/{render-plan.d-xWCRAJeR.d.mts → render-plan.d-bnWxS12w.d.mts} +1 -1
- package/dist/renderer-client.cjs +54 -10
- package/dist/renderer-client.d.mts +8 -7
- package/dist/renderer-client.d.ts +8 -7
- package/dist/renderer-client.mjs +50 -6
- package/dist/renderer.cjs +6 -2
- package/dist/renderer.d.mts +97 -4
- package/dist/renderer.d.ts +97 -4
- package/dist/renderer.mjs +5 -1
- package/dist/{request.d-Dx82V8bz.d.mts → request.d-C2HOn3Hi.d.mts} +1 -1
- package/dist/{request.d-DUMuWxSN.d.ts → request.d-CAeitOG1.d.ts} +1 -1
- package/dist/request.d.mts +3 -2
- package/dist/request.d.ts +3 -2
- package/dist/{route-rendering.d-BwBVpLtD.d.ts → route-rendering.d-A1dIkUK5.d.ts} +1 -1
- package/dist/{route-rendering.d-DJh6GauM.d.mts → route-rendering.d-CYA-ulnX.d.mts} +1 -1
- package/dist/{router.d-BtkKDxUB.d.mts → router.d-8lxnzlkr.d.mts} +1 -1
- package/dist/{router.d-CJBSG5jr.d.ts → router.d-A_Yt6jYz.d.ts} +1 -1
- package/dist/{routes.d-CCccJRrp.d.mts → routes.d-BWvpUoYu.d.mts} +1 -1
- package/dist/{routes.d-b7khoRoU.d.ts → routes.d-D7RWvfqL.d.ts} +1 -1
- package/dist/routes.d.mts +2 -1
- package/dist/routes.d.ts +2 -1
- package/dist/{rsc-pipeline-H5AXQA7A.cjs → rsc-pipeline-MFJZGDPE.cjs} +11 -10
- package/dist/{rsc-pipeline-GD6KLOIG.mjs → rsc-pipeline-TRZVFCBX.mjs} +10 -9
- package/dist/{runtime-YWQVBC3V.cjs → runtime-MJUG2HGR.cjs} +15 -13
- package/dist/{runtime-OJ7FXFUI.mjs → runtime-O4Y3Z6V3.mjs} +11 -9
- package/dist/{runtime.d-BQnD0cfC.d.ts → runtime.d-BPyvWrgQ.d.ts} +1 -1
- package/dist/{runtime.d-C4SuZXf6.d.mts → runtime.d-C_rZ9_DD.d.mts} +1 -1
- package/dist/{server-components-status.d-9rH7ZoEq.d.mts → server-components-status.d-BpxiEMQE.d.mts} +1 -1
- package/dist/{server-components-status.d-rfKOcE0N.d.ts → server-components-status.d-C2UEKJn7.d.ts} +1 -1
- package/dist/server-plugins.d.mts +4 -3
- package/dist/server-plugins.d.ts +4 -3
- package/dist/server-query-call.d-rVM_lsYk.d.mts +15 -0
- package/dist/server-query-call.d-rVM_lsYk.d.ts +15 -0
- package/dist/server-query-client.cjs +5 -3
- package/dist/server-query-client.d.mts +3 -2
- package/dist/server-query-client.d.ts +3 -2
- package/dist/server-query-client.mjs +5 -3
- package/dist/{server-query-runtime.d-DXRNhX_3.d.ts → server-query-runtime.d-BlHd90D0.d.ts} +2 -8
- package/dist/{server-query-runtime.d-aP52iuL5.d.mts → server-query-runtime.d-CCLGkQtE.d.mts} +2 -8
- package/dist/server.cjs +58 -52
- package/dist/server.d.mts +12 -12
- package/dist/server.d.ts +12 -12
- package/dist/server.mjs +34 -28
- package/dist/{spa-router.d-V6XLSTCy.d.mts → spa-router.d-BD-6WX1R.d.mts} +2 -2
- package/dist/{spa-router.d-DMKiBsHH.d.ts → spa-router.d-Cw5i_15e.d.ts} +2 -2
- package/dist/{ssg.d-MNedvvMB.d.ts → ssg.d-Bifiq0EL.d.ts} +2 -2
- package/dist/{ssg.d-BnCKPQL0.d.mts → ssg.d-CCE9aob5.d.mts} +2 -2
- package/dist/{store-core.d-Ad5biajo.d.ts → store-core.d-5tVn5vi1.d.ts} +12 -4
- package/dist/{store-core.d-BqJI1-ix.d.mts → store-core.d-BN2MxSG9.d.mts} +12 -4
- package/dist/testing.cjs +5 -4
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/testing.mjs +4 -3
- package/dist/{utils.d-BdjHKDuT.d.ts → utils.d-BUjpSNIO.d.ts} +1 -1
- package/dist/{utils.d-BEKLWa0Z.d.mts → utils.d-wGPLeVbq.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +25 -23
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +24 -22
- package/package.json +7 -2
- package/dist/analyzer-435DCIQ6.cjs +0 -17
- package/dist/chunk-AHVF5GI2.cjs +0 -229
- package/dist/chunk-ONSZP5JK.mjs +0 -229
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkDMSXZNQRcjs = require('./chunk-DMSXZNQR.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkHRH7OKBQcjs = require('./chunk-HRH7OKBQ.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkBBVLOENDcjs = require('./chunk-BBVLOEND.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunk5X5GJU5Acjs = require('./chunk-5X5GJU5A.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
19
20
|
|
|
20
21
|
|
|
22
|
+
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
21
23
|
|
|
22
24
|
|
|
23
25
|
|
|
@@ -48,33 +50,34 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
48
50
|
|
|
49
51
|
|
|
50
52
|
|
|
51
|
-
var _chunkOFVCWV2Dcjs = require('./chunk-OFVCWV2D.cjs');
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
|
|
55
56
|
|
|
56
|
-
var _chunkOZUINP2Pcjs = require('./chunk-OZUINP2P.cjs');
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
var
|
|
59
|
+
var _chunkNEKO3HM2cjs = require('./chunk-NEKO3HM2.cjs');
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
var _chunkOZUINP2Pcjs = require('./chunk-OZUINP2P.cjs');
|
|
64
65
|
|
|
65
66
|
|
|
67
|
+
var _chunkWCSBYQOTcjs = require('./chunk-WCSBYQOT.cjs');
|
|
66
68
|
|
|
67
|
-
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
68
69
|
|
|
69
70
|
|
|
70
71
|
|
|
71
|
-
var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
var
|
|
75
|
+
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
76
|
+
|
|
76
77
|
|
|
77
78
|
|
|
79
|
+
var _chunkWOAXQ5MZcjs = require('./chunk-WOAXQ5MZ.cjs');
|
|
80
|
+
|
|
78
81
|
|
|
79
82
|
|
|
80
83
|
|
|
@@ -99,21 +102,20 @@ var _chunkWOAXQ5MZcjs = require('./chunk-WOAXQ5MZ.cjs');
|
|
|
99
102
|
|
|
100
103
|
|
|
101
104
|
|
|
102
|
-
var _chunk46UV2E7Icjs = require('./chunk-46UV2E7I.cjs');
|
|
103
105
|
|
|
104
106
|
|
|
105
|
-
var
|
|
107
|
+
var _chunkEFI6QWBQcjs = require('./chunk-EFI6QWBQ.cjs');
|
|
106
108
|
|
|
107
109
|
|
|
108
110
|
|
|
109
111
|
var _chunk5AMH6AFAcjs = require('./chunk-5AMH6AFA.cjs');
|
|
110
112
|
|
|
111
113
|
|
|
112
|
-
var
|
|
114
|
+
var _chunkXJDB564Acjs = require('./chunk-XJDB564A.cjs');
|
|
113
115
|
|
|
114
116
|
|
|
115
117
|
|
|
116
|
-
var
|
|
118
|
+
var _chunkL2GUEYHRcjs = require('./chunk-L2GUEYHR.cjs');
|
|
117
119
|
|
|
118
120
|
|
|
119
121
|
var _chunkIIHZ2BEEcjs = require('./chunk-IIHZ2BEE.cjs');
|
|
@@ -126,7 +128,7 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
|
126
128
|
|
|
127
129
|
|
|
128
130
|
|
|
129
|
-
var
|
|
131
|
+
var _chunkEACD6ND7cjs = require('./chunk-EACD6ND7.cjs');
|
|
130
132
|
|
|
131
133
|
|
|
132
134
|
|
|
@@ -165,13 +167,13 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
165
167
|
|
|
166
168
|
|
|
167
169
|
|
|
168
|
-
var
|
|
170
|
+
var _chunkNGTZHWBGcjs = require('./chunk-NGTZHWBG.cjs');
|
|
169
171
|
|
|
170
172
|
|
|
171
173
|
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
172
174
|
|
|
173
175
|
|
|
174
|
-
var
|
|
176
|
+
var _chunkHQKCSJEHcjs = require('./chunk-HQKCSJEH.cjs');
|
|
175
177
|
|
|
176
178
|
|
|
177
179
|
var _chunkXRFGOYXGcjs = require('./chunk-XRFGOYXG.cjs');
|
|
@@ -208,7 +210,7 @@ var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
|
|
|
208
210
|
|
|
209
211
|
|
|
210
212
|
|
|
211
|
-
var
|
|
213
|
+
var _chunkB3HQTGXScjs = require('./chunk-B3HQTGXS.cjs');
|
|
212
214
|
|
|
213
215
|
|
|
214
216
|
var _chunkNW3DL2PMcjs = require('./chunk-NW3DL2PM.cjs');
|
|
@@ -306,7 +308,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
306
308
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
307
309
|
|
|
308
310
|
|
|
309
|
-
var
|
|
311
|
+
var _chunk3CZ4MJHWcjs = require('./chunk-3CZ4MJHW.cjs');
|
|
310
312
|
|
|
311
313
|
|
|
312
314
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -507,7 +509,15 @@ var RouteManager = class _RouteManager {
|
|
|
507
509
|
this.redirects = /* @__PURE__ */ new Map();
|
|
508
510
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
509
511
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
510
|
-
this.programmaticClientRoutes =
|
|
512
|
+
this.programmaticClientRoutes = _chunkEFI6QWBQcjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
513
|
+
// The hydration settings each route rule returned, by file.
|
|
514
|
+
this.rendererRouteHydration = /* @__PURE__ */ new Map();
|
|
515
|
+
this.disposeRendererHydration = () => {
|
|
516
|
+
};
|
|
517
|
+
// The directories a renderer's route rules scan, and the files they mapped, absolute with `/`
|
|
518
|
+
// separators.
|
|
519
|
+
this.rendererRouteDirs = [];
|
|
520
|
+
this.rendererRouteModules = /* @__PURE__ */ new Set();
|
|
511
521
|
this.discovery = Promise.resolve();
|
|
512
522
|
this.reportedIslandsErrors = /* @__PURE__ */ new Set();
|
|
513
523
|
// Each route module's hydration plan from the last plan, with the source files it read, so a dev
|
|
@@ -558,10 +568,65 @@ var RouteManager = class _RouteManager {
|
|
|
558
568
|
this.programmaticPages = next.programmaticPages;
|
|
559
569
|
this.programmaticLayouts = next.programmaticLayouts;
|
|
560
570
|
this.programmaticClientRoutes = next.programmaticClientRoutes;
|
|
571
|
+
this.rendererNotFoundPath = next.rendererNotFoundPath;
|
|
572
|
+
this.rendererRouteHydration = next.rendererRouteHydration;
|
|
573
|
+
this.rendererRouteDirs = next.rendererRouteDirs;
|
|
574
|
+
this.rendererRouteModules = next.rendererRouteModules;
|
|
575
|
+
this.recordRendererHydration();
|
|
561
576
|
});
|
|
562
577
|
this.discovery = discovery;
|
|
563
578
|
return discovery;
|
|
564
579
|
}
|
|
580
|
+
/**
|
|
581
|
+
* Hands the client-module reader the renderer's hydration levels for this scan's pages and
|
|
582
|
+
* layouts (`hydration` and route rules on the renderer descriptor).
|
|
583
|
+
*/
|
|
584
|
+
recordRendererHydration() {
|
|
585
|
+
this.disposeRendererHydration();
|
|
586
|
+
const renderer = this.config.renderer;
|
|
587
|
+
const routeModules = [];
|
|
588
|
+
for (const [kind, entries] of [
|
|
589
|
+
["page", this.routes.values()],
|
|
590
|
+
["layout", this.layouts.values()]
|
|
591
|
+
]) {
|
|
592
|
+
for (const entry of entries) {
|
|
593
|
+
if (entry.source === "programmatic") continue;
|
|
594
|
+
routeModules.push({
|
|
595
|
+
modulePath: entry.modulePath,
|
|
596
|
+
kind,
|
|
597
|
+
hydration: this.rendererRouteHydration.get(entry.modulePath)
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
this.disposeRendererHydration = _chunkEFI6QWBQcjs.setFarmRendererHydrationScope.call(void 0,
|
|
602
|
+
_chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, this.config).map((source) => source.root),
|
|
603
|
+
renderer,
|
|
604
|
+
routeModules
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* The not-found page a renderer's `routes()` mapped, null when it mapped none, or undefined when
|
|
609
|
+
* the renderer has no route rules and Farm looks for `src/app/not-found.*` itself.
|
|
610
|
+
*/
|
|
611
|
+
getRendererNotFoundPath() {
|
|
612
|
+
return this.rendererNotFoundPath;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Whether `file` is under a directory a renderer's route rules scan, where adding or removing a
|
|
616
|
+
* file can change the routes.
|
|
617
|
+
*/
|
|
618
|
+
isRendererRouteFile(file) {
|
|
619
|
+
if (this.rendererRouteDirs.length === 0) return false;
|
|
620
|
+
const normalized = file.replace(/\\/g, "/");
|
|
621
|
+
return this.rendererRouteDirs.some((dir) => normalized.startsWith(`${dir}/`));
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Whether `file` is a page, layout, loading, error or not-found file a renderer's route rules
|
|
625
|
+
* mapped, where an edit can change what the route renders or whether it hydrates.
|
|
626
|
+
*/
|
|
627
|
+
isRendererRouteModule(file) {
|
|
628
|
+
return this.rendererRouteModules.size > 0 && this.rendererRouteModules.has(file.replace(/\\/g, "/"));
|
|
629
|
+
}
|
|
565
630
|
/** Fill this manager's empty route tables. Only a fresh manager made by discoverRoutes runs it. */
|
|
566
631
|
async discoverInto() {
|
|
567
632
|
const programmaticClientRoutes = [];
|
|
@@ -569,7 +634,7 @@ var RouteManager = class _RouteManager {
|
|
|
569
634
|
await this.discoverFileRoutes(source);
|
|
570
635
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
571
636
|
}
|
|
572
|
-
this.programmaticClientRoutes =
|
|
637
|
+
this.programmaticClientRoutes = _chunkEFI6QWBQcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
573
638
|
for (const slot of this.routeSlots.values()) {
|
|
574
639
|
if (slot.interception && !this.pageRouteShapes.has(_chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
575
640
|
throw new (0, _chunkML4TOUZPcjs.AmbiguousRouteError)(
|
|
@@ -588,8 +653,8 @@ var RouteManager = class _RouteManager {
|
|
|
588
653
|
)
|
|
589
654
|
);
|
|
590
655
|
this.orderedLayouts = Array.from(this.layouts.values()).sort(
|
|
591
|
-
(left, right) =>
|
|
592
|
-
).map((entry) => ({ entry, groupScope:
|
|
656
|
+
(left, right) => _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, right.pattern)
|
|
657
|
+
).map((entry) => ({ entry, groupScope: _chunkNEKO3HM2cjs.getRouteGroupScope.call(void 0, entry.pattern) }));
|
|
593
658
|
for (const slot of this.routeSlots.values()) {
|
|
594
659
|
if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
|
|
595
660
|
this.routeSlotOwnerSegments.set(
|
|
@@ -862,11 +927,11 @@ var RouteManager = class _RouteManager {
|
|
|
862
927
|
return this.clientManifestCache.manifest;
|
|
863
928
|
}
|
|
864
929
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
865
|
-
const compute = () =>
|
|
930
|
+
const compute = () => _chunkEFI6QWBQcjs.withFarmSourceSnapshot.call(void 0,
|
|
866
931
|
() => this.computeClientManifest(normalizedProjectRoot),
|
|
867
932
|
this.sourceSnapshot
|
|
868
933
|
);
|
|
869
|
-
return cacheFile ?
|
|
934
|
+
return cacheFile ? _chunkEFI6QWBQcjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
|
|
870
935
|
}
|
|
871
936
|
/**
|
|
872
937
|
* @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
|
|
@@ -875,7 +940,7 @@ var RouteManager = class _RouteManager {
|
|
|
875
940
|
*/
|
|
876
941
|
trackSourceChanges() {
|
|
877
942
|
this.sourceChangeTracking = true;
|
|
878
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
943
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkEFI6QWBQcjs.FarmSourceSnapshotStore)())));
|
|
879
944
|
}
|
|
880
945
|
/**
|
|
881
946
|
* @internal A production build edits no source while it runs, so what the plan reads, parses and
|
|
@@ -884,7 +949,7 @@ var RouteManager = class _RouteManager {
|
|
|
884
949
|
*/
|
|
885
950
|
keepBuildSourceSnapshot() {
|
|
886
951
|
if (this.sourceChangeTracking) return;
|
|
887
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
952
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkEFI6QWBQcjs.FarmSourceSnapshotStore)(false))));
|
|
888
953
|
}
|
|
889
954
|
/**
|
|
890
955
|
* @internal Hands the snapshot keepBuildSourceSnapshot kept to the build, which clears it once
|
|
@@ -927,7 +992,7 @@ var RouteManager = class _RouteManager {
|
|
|
927
992
|
return false;
|
|
928
993
|
}
|
|
929
994
|
const previous = _optionalChain([this, 'access', _18 => _18.sourceSnapshot, 'optionalAccess', _19 => _19.peekSource, 'call', _20 => _20(path4.default.resolve(file))]);
|
|
930
|
-
return previous !== void 0 &&
|
|
995
|
+
return previous !== void 0 && _chunkEFI6QWBQcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
|
|
931
996
|
}
|
|
932
997
|
/**
|
|
933
998
|
* A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
|
|
@@ -938,7 +1003,7 @@ var RouteManager = class _RouteManager {
|
|
|
938
1003
|
if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
|
|
939
1004
|
return { ...previous.plan };
|
|
940
1005
|
}
|
|
941
|
-
const { result, files } =
|
|
1006
|
+
const { result, files } = _chunkEFI6QWBQcjs.traceFarmSourceReads.call(void 0, compute);
|
|
942
1007
|
const sources = /* @__PURE__ */ new Set();
|
|
943
1008
|
for (const file of files) {
|
|
944
1009
|
const source = this.planSourcePath(file);
|
|
@@ -946,7 +1011,7 @@ var RouteManager = class _RouteManager {
|
|
|
946
1011
|
}
|
|
947
1012
|
if (!this.sourceChangeTracking) {
|
|
948
1013
|
for (const source of sources) {
|
|
949
|
-
if (!this.planStamps.has(source)) this.planStamps.set(source,
|
|
1014
|
+
if (!this.planStamps.has(source)) this.planStamps.set(source, _chunkEFI6QWBQcjs.getFarmSourceStamp.call(void 0, source));
|
|
950
1015
|
}
|
|
951
1016
|
}
|
|
952
1017
|
this.ownerPlans.set(key, { plan: result, files: sources, planKey });
|
|
@@ -966,7 +1031,7 @@ var RouteManager = class _RouteManager {
|
|
|
966
1031
|
const isUnchanged = (file) => {
|
|
967
1032
|
let result = unchanged.get(file);
|
|
968
1033
|
if (result === void 0) {
|
|
969
|
-
result = this.planStamps.get(file) ===
|
|
1034
|
+
result = this.planStamps.get(file) === _chunkEFI6QWBQcjs.getFarmSourceStamp.call(void 0, file);
|
|
970
1035
|
unchanged.set(file, result);
|
|
971
1036
|
}
|
|
972
1037
|
return result;
|
|
@@ -1013,7 +1078,7 @@ var RouteManager = class _RouteManager {
|
|
|
1013
1078
|
*/
|
|
1014
1079
|
inspectPackages(operation) {
|
|
1015
1080
|
const file = this.packageClientBoundaryCacheFile;
|
|
1016
|
-
return file ?
|
|
1081
|
+
return file ? _chunkEFI6QWBQcjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
|
|
1017
1082
|
}
|
|
1018
1083
|
computeClientManifest(normalizedProjectRoot) {
|
|
1019
1084
|
const toUrlPath = (absolutePath) => {
|
|
@@ -1025,7 +1090,7 @@ var RouteManager = class _RouteManager {
|
|
|
1025
1090
|
}
|
|
1026
1091
|
return absolutePath;
|
|
1027
1092
|
};
|
|
1028
|
-
const integrationProviders =
|
|
1093
|
+
const integrationProviders = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
|
|
1029
1094
|
(provider) => provider.component || provider.type === "clerk"
|
|
1030
1095
|
);
|
|
1031
1096
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
@@ -1036,14 +1101,14 @@ var RouteManager = class _RouteManager {
|
|
|
1036
1101
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
1037
1102
|
);
|
|
1038
1103
|
}
|
|
1039
|
-
const isolatedMode =
|
|
1104
|
+
const isolatedMode = _chunkEFI6QWBQcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
1040
1105
|
_optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.isolatedClientHydration]),
|
|
1041
1106
|
{
|
|
1042
1107
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _30 => _30.config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.serverComponents])) === "rsc",
|
|
1043
1108
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
1044
1109
|
}
|
|
1045
1110
|
);
|
|
1046
|
-
const planOptions =
|
|
1111
|
+
const planOptions = _chunkEFI6QWBQcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
1047
1112
|
this.config.renderer,
|
|
1048
1113
|
Boolean(unsupportedIntegrationProvider)
|
|
1049
1114
|
);
|
|
@@ -1053,7 +1118,7 @@ var RouteManager = class _RouteManager {
|
|
|
1053
1118
|
if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
|
|
1054
1119
|
edited = /* @__PURE__ */ new Set();
|
|
1055
1120
|
for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
|
|
1056
|
-
if (
|
|
1121
|
+
if (_chunkEFI6QWBQcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
|
|
1057
1122
|
const source = this.planSourcePath(file);
|
|
1058
1123
|
if (source) edited.add(source);
|
|
1059
1124
|
}
|
|
@@ -1068,13 +1133,13 @@ var RouteManager = class _RouteManager {
|
|
|
1068
1133
|
metadata: this.planRouteModule(
|
|
1069
1134
|
`layout:${entry.modulePath}`,
|
|
1070
1135
|
edited,
|
|
1071
|
-
() =>
|
|
1136
|
+
() => _chunkEFI6QWBQcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1072
1137
|
entry.modulePath,
|
|
1073
1138
|
normalizedProjectRoot,
|
|
1074
1139
|
isolatedMode,
|
|
1075
1140
|
layoutPlanOptions
|
|
1076
1141
|
),
|
|
1077
|
-
|
|
1142
|
+
_chunkEFI6QWBQcjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1078
1143
|
entry.modulePath,
|
|
1079
1144
|
normalizedProjectRoot,
|
|
1080
1145
|
isolatedMode,
|
|
@@ -1082,7 +1147,7 @@ var RouteManager = class _RouteManager {
|
|
|
1082
1147
|
)
|
|
1083
1148
|
)
|
|
1084
1149
|
}));
|
|
1085
|
-
const markdownComponentsPlan =
|
|
1150
|
+
const markdownComponentsPlan = _chunkEFI6QWBQcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
1086
1151
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
1087
1152
|
normalizedProjectRoot,
|
|
1088
1153
|
isolatedMode,
|
|
@@ -1098,13 +1163,13 @@ var RouteManager = class _RouteManager {
|
|
|
1098
1163
|
metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
|
|
1099
1164
|
`page:${entry.modulePath}`,
|
|
1100
1165
|
edited,
|
|
1101
|
-
() =>
|
|
1166
|
+
() => _chunkEFI6QWBQcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1102
1167
|
entry.modulePath,
|
|
1103
1168
|
normalizedProjectRoot,
|
|
1104
1169
|
isolatedMode,
|
|
1105
1170
|
pagePlanOptions
|
|
1106
1171
|
),
|
|
1107
|
-
|
|
1172
|
+
_chunkEFI6QWBQcjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1108
1173
|
entry.modulePath,
|
|
1109
1174
|
normalizedProjectRoot,
|
|
1110
1175
|
isolatedMode,
|
|
@@ -1134,18 +1199,18 @@ var RouteManager = class _RouteManager {
|
|
|
1134
1199
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1135
1200
|
);
|
|
1136
1201
|
}
|
|
1137
|
-
|
|
1202
|
+
_chunkEFI6QWBQcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
1138
1203
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1139
1204
|
pattern: entry.pattern,
|
|
1140
|
-
depth:
|
|
1205
|
+
depth: _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
1141
1206
|
metadata
|
|
1142
1207
|
})),
|
|
1143
1208
|
routeEntries.map(({ entry, metadata }) => ({
|
|
1144
1209
|
pattern: getRouteEntryDirectory(entry),
|
|
1145
|
-
depth:
|
|
1210
|
+
depth: _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
|
|
1146
1211
|
metadata
|
|
1147
1212
|
})),
|
|
1148
|
-
|
|
1213
|
+
_chunkNEKO3HM2cjs.routeBoundaryCoversDirectory,
|
|
1149
1214
|
{ serverOwners: islandsMode }
|
|
1150
1215
|
);
|
|
1151
1216
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
@@ -1165,7 +1230,7 @@ var RouteManager = class _RouteManager {
|
|
|
1165
1230
|
const routes = routeEntries.map(({ entry, metadata }) => {
|
|
1166
1231
|
const programmaticPage = this.programmaticPages.get(entry.modulePath);
|
|
1167
1232
|
const layoutShouldHydrate = layoutEntries.some(
|
|
1168
|
-
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate &&
|
|
1233
|
+
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkNEKO3HM2cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
|
|
1169
1234
|
);
|
|
1170
1235
|
return {
|
|
1171
1236
|
pattern: entry.pattern,
|
|
@@ -1181,8 +1246,8 @@ var RouteManager = class _RouteManager {
|
|
|
1181
1246
|
modulePath: toUrlPath(boundary.modulePath)
|
|
1182
1247
|
}))
|
|
1183
1248
|
} : {},
|
|
1184
|
-
...
|
|
1185
|
-
renderPlan:
|
|
1249
|
+
..._chunkEFI6QWBQcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
1250
|
+
renderPlan: _chunkNEKO3HM2cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
1186
1251
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
1187
1252
|
layoutShouldHydrate,
|
|
1188
1253
|
islandStrategy: metadata.islandStrategy
|
|
@@ -1198,7 +1263,7 @@ var RouteManager = class _RouteManager {
|
|
|
1198
1263
|
}))
|
|
1199
1264
|
};
|
|
1200
1265
|
});
|
|
1201
|
-
const treeLayoutPatterns = islandsMode ?
|
|
1266
|
+
const treeLayoutPatterns = islandsMode ? _chunkNEKO3HM2cjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
1202
1267
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1203
1268
|
pattern: entry.pattern,
|
|
1204
1269
|
shouldHydrate: metadata.shouldHydrate,
|
|
@@ -1223,7 +1288,7 @@ var RouteManager = class _RouteManager {
|
|
|
1223
1288
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
1224
1289
|
}));
|
|
1225
1290
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
1226
|
-
const metadata =
|
|
1291
|
+
const metadata = _chunkEFI6QWBQcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
1227
1292
|
return {
|
|
1228
1293
|
name: entry.name,
|
|
1229
1294
|
ownerPattern: entry.ownerPattern,
|
|
@@ -1239,7 +1304,7 @@ var RouteManager = class _RouteManager {
|
|
|
1239
1304
|
};
|
|
1240
1305
|
});
|
|
1241
1306
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
1242
|
-
metadata:
|
|
1307
|
+
metadata: _chunkEFI6QWBQcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1243
1308
|
entry.modulePath,
|
|
1244
1309
|
normalizedProjectRoot,
|
|
1245
1310
|
isolatedMode,
|
|
@@ -1341,7 +1406,7 @@ var RouteManager = class _RouteManager {
|
|
|
1341
1406
|
loadModule: viteServer ? (componentModulePath) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
|
|
1342
1407
|
}),
|
|
1343
1408
|
config: mdxConfig,
|
|
1344
|
-
renderer:
|
|
1409
|
+
renderer: _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
|
|
1345
1410
|
});
|
|
1346
1411
|
}
|
|
1347
1412
|
if (this.viteServer) {
|
|
@@ -1389,7 +1454,7 @@ var RouteManager = class _RouteManager {
|
|
|
1389
1454
|
*/
|
|
1390
1455
|
createRoutePattern(route) {
|
|
1391
1456
|
if (route.segments.length === 0) return "/";
|
|
1392
|
-
return "/" + route.segments.map(
|
|
1457
|
+
return "/" + route.segments.map(_chunkNEKO3HM2cjs.formatRouteSegment).join("/");
|
|
1393
1458
|
}
|
|
1394
1459
|
registerPageRoute(entry) {
|
|
1395
1460
|
_chunkML4TOUZPcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
|
|
@@ -1408,15 +1473,42 @@ var RouteManager = class _RouteManager {
|
|
|
1408
1473
|
}
|
|
1409
1474
|
async discoverFileRoutes(source) {
|
|
1410
1475
|
const appDir = _chunk7U4XF76Rcjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
|
|
1411
|
-
const componentExtensions =
|
|
1476
|
+
const componentExtensions = _chunkNGTZHWBGcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
|
|
1412
1477
|
(extension) => extension.slice(1)
|
|
1413
1478
|
);
|
|
1414
1479
|
const componentGlob = componentExtensions.join(",");
|
|
1415
|
-
const
|
|
1480
|
+
const rendererRoutes = await _chunk5X5GJU5Acjs.resolveFarmRendererRoutes.call(void 0, {
|
|
1481
|
+
renderer: this.config.renderer,
|
|
1482
|
+
root: source.root,
|
|
1483
|
+
srcDir: source.srcDir
|
|
1484
|
+
});
|
|
1485
|
+
const routeModulePaths = /* @__PURE__ */ new Map();
|
|
1486
|
+
const modulePathOf = (file) => _nullishCoalesce(routeModulePaths.get(file), () => ( path4.default.join(appDir, file)));
|
|
1487
|
+
const rendererFiles = (kind) => (_nullishCoalesce(_optionalChain([rendererRoutes, 'optionalAccess', _48 => _48.entries]), () => ( []))).filter((entry) => entry.kind === kind).map((entry) => {
|
|
1488
|
+
routeModulePaths.set(entry.routeFile, entry.modulePath);
|
|
1489
|
+
if (entry.hydration.hydrate !== void 0 || entry.hydration.strategy !== void 0) {
|
|
1490
|
+
this.rendererRouteHydration.set(entry.modulePath, entry.hydration);
|
|
1491
|
+
}
|
|
1492
|
+
return entry.routeFile;
|
|
1493
|
+
});
|
|
1494
|
+
if (rendererRoutes) {
|
|
1495
|
+
this.rendererRouteDirs.push(rendererRoutes.dir.replace(/\\/g, "/"));
|
|
1496
|
+
for (const entry of rendererRoutes.entries) {
|
|
1497
|
+
this.rendererRouteModules.add(entry.modulePath.replace(/\\/g, "/"));
|
|
1498
|
+
}
|
|
1499
|
+
const notFound = rendererRoutes.entries.find((entry) => entry.kind === "not-found");
|
|
1500
|
+
if (notFound || this.rendererNotFoundPath === void 0) {
|
|
1501
|
+
this.rendererNotFoundPath = _nullishCoalesce(_optionalChain([notFound, 'optionalAccess', _49 => _49.modulePath]), () => ( null));
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
const pageFiles = rendererRoutes ? [
|
|
1505
|
+
...rendererFiles("page"),
|
|
1506
|
+
...await safeGlobFiles(`**/@*/**/page.{${componentGlob},md,mdx}`, appDir)
|
|
1507
|
+
] : await safeGlobFiles(`**/page.{${componentGlob},md,mdx}`, appDir);
|
|
1416
1508
|
const slotDefaultFiles = await safeGlobFiles(`**/@*/**/default.{${componentGlob}}`, appDir);
|
|
1417
|
-
const layoutFiles = await safeGlobFiles(`**/layout.{${componentGlob}}`, appDir);
|
|
1418
|
-
const loadingFiles = await safeGlobFiles(`**/loading.{${componentGlob}}`, appDir);
|
|
1419
|
-
const errorFiles = await safeGlobFiles(`**/error.{${componentGlob}}`, appDir);
|
|
1509
|
+
const layoutFiles = rendererRoutes ? rendererFiles("layout") : await safeGlobFiles(`**/layout.{${componentGlob}}`, appDir);
|
|
1510
|
+
const loadingFiles = rendererRoutes ? rendererFiles("loading") : await safeGlobFiles(`**/loading.{${componentGlob}}`, appDir);
|
|
1511
|
+
const errorFiles = rendererRoutes ? rendererFiles("error") : await safeGlobFiles(`**/error.{${componentGlob}}`, appDir);
|
|
1420
1512
|
const metadataImageFiles = await safeGlobFiles(
|
|
1421
1513
|
`**/{opengraph-image,twitter-image}.{${componentGlob},png,jpg,jpeg,gif,webp}`,
|
|
1422
1514
|
appDir
|
|
@@ -1444,21 +1536,21 @@ var RouteManager = class _RouteManager {
|
|
|
1444
1536
|
const markdownFiles = group.files.filter(_chunk26WP75W5cjs.isFarmMarkdownPageFile);
|
|
1445
1537
|
if (componentFiles.length > 1) {
|
|
1446
1538
|
throw new Error(
|
|
1447
|
-
`Duplicate page route "${pattern}". Found ${componentFiles.map(
|
|
1539
|
+
`Duplicate page route "${pattern}". Found ${componentFiles.map(modulePathOf).join(" and ")}.`
|
|
1448
1540
|
);
|
|
1449
1541
|
}
|
|
1450
1542
|
if (markdownFiles.length > 1) {
|
|
1451
1543
|
throw new Error(
|
|
1452
|
-
`Duplicate markdown representation for page route "${pattern}". Found ${markdownFiles.map(
|
|
1544
|
+
`Duplicate markdown representation for page route "${pattern}". Found ${markdownFiles.map(modulePathOf).join(" and ")}.`
|
|
1453
1545
|
);
|
|
1454
1546
|
}
|
|
1455
1547
|
const componentFile = componentFiles[0];
|
|
1456
1548
|
const markdownFile = markdownFiles[0];
|
|
1457
1549
|
const primaryFile = componentFile || markdownFile;
|
|
1458
1550
|
if (!primaryFile) continue;
|
|
1459
|
-
const modulePath =
|
|
1551
|
+
const modulePath = modulePathOf(primaryFile);
|
|
1460
1552
|
const existing = this.routes.get(pattern);
|
|
1461
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1553
|
+
if (_optionalChain([existing, 'optionalAccess', _50 => _50.sourceRoot]) === source.root) {
|
|
1462
1554
|
throw new Error(
|
|
1463
1555
|
`Duplicate page route "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
|
|
1464
1556
|
);
|
|
@@ -1467,7 +1559,7 @@ var RouteManager = class _RouteManager {
|
|
|
1467
1559
|
route: group.route,
|
|
1468
1560
|
modulePath,
|
|
1469
1561
|
...markdownFile ? {
|
|
1470
|
-
markdownSourcePath:
|
|
1562
|
+
markdownSourcePath: modulePathOf(markdownFile)
|
|
1471
1563
|
} : {},
|
|
1472
1564
|
pattern,
|
|
1473
1565
|
...getPageDirectoryField(group.route, pattern),
|
|
@@ -1482,10 +1574,10 @@ var RouteManager = class _RouteManager {
|
|
|
1482
1574
|
]) {
|
|
1483
1575
|
for (const file of files) {
|
|
1484
1576
|
const route = _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, file);
|
|
1485
|
-
const modulePath =
|
|
1486
|
-
const pattern =
|
|
1577
|
+
const modulePath = modulePathOf(file);
|
|
1578
|
+
const pattern = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1487
1579
|
const existing = target.get(pattern);
|
|
1488
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1580
|
+
if (_optionalChain([existing, 'optionalAccess', _51 => _51.sourceRoot]) === source.root) {
|
|
1489
1581
|
throw new Error(
|
|
1490
1582
|
`Duplicate ${kind} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
|
|
1491
1583
|
);
|
|
@@ -1505,10 +1597,10 @@ var RouteManager = class _RouteManager {
|
|
|
1505
1597
|
const modulePath = path4.default.join(appDir, file);
|
|
1506
1598
|
const pattern = this.createRoutePattern(slot.route);
|
|
1507
1599
|
const ownerPattern = this.createRoutePattern(slot.ownerRoute);
|
|
1508
|
-
const ownerDirectory =
|
|
1600
|
+
const ownerDirectory = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
|
|
1509
1601
|
const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
|
|
1510
1602
|
const existing = this.routeSlots.get(key);
|
|
1511
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1603
|
+
if (_optionalChain([existing, 'optionalAccess', _52 => _52.sourceRoot]) === source.root) {
|
|
1512
1604
|
throw new Error(
|
|
1513
1605
|
`Duplicate route slot "${slot.name}" for "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
|
|
1514
1606
|
);
|
|
@@ -1537,7 +1629,7 @@ var RouteManager = class _RouteManager {
|
|
|
1537
1629
|
const key = `${kind}:${pattern}`;
|
|
1538
1630
|
const existing = this.metadataImages.get(key);
|
|
1539
1631
|
const sourceType = isStaticMetadataImageFile(file) ? "static" : "module";
|
|
1540
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1632
|
+
if (_optionalChain([existing, 'optionalAccess', _53 => _53.sourceRoot]) === source.root) {
|
|
1541
1633
|
throw new Error(
|
|
1542
1634
|
`Duplicate ${fileName} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}. Keep only one static image or module per route segment.`
|
|
1543
1635
|
);
|
|
@@ -1565,7 +1657,7 @@ var RouteManager = class _RouteManager {
|
|
|
1565
1657
|
const pattern = this.createRoutePattern(route);
|
|
1566
1658
|
const key = `${descriptor.kind}:${pattern}`;
|
|
1567
1659
|
const existing = this.metadataRoutes.get(key);
|
|
1568
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1660
|
+
if (_optionalChain([existing, 'optionalAccess', _54 => _54.sourceRoot]) === source.root) {
|
|
1569
1661
|
throw new Error(
|
|
1570
1662
|
`Duplicate ${descriptor.fileName} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}. Keep only one .ts or .js metadata route per segment.`
|
|
1571
1663
|
);
|
|
@@ -1587,11 +1679,11 @@ var RouteManager = class _RouteManager {
|
|
|
1587
1679
|
srcDir: source.srcDir,
|
|
1588
1680
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1589
1681
|
});
|
|
1590
|
-
const graph = this.viteServer ?
|
|
1682
|
+
const graph = this.viteServer ? _chunkEFI6QWBQcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1591
1683
|
for (const { filePath, manifest } of manifests) {
|
|
1592
1684
|
if (graph) {
|
|
1593
1685
|
clientRoutes.push(
|
|
1594
|
-
|
|
1686
|
+
_chunkEFI6QWBQcjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1595
1687
|
graph,
|
|
1596
1688
|
routesFile: toRealPath(filePath),
|
|
1597
1689
|
routes: manifest.routes,
|
|
@@ -1604,7 +1696,7 @@ var RouteManager = class _RouteManager {
|
|
|
1604
1696
|
const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.path, "page");
|
|
1605
1697
|
const pattern = this.createRoutePattern(route);
|
|
1606
1698
|
const existing = this.routes.get(pattern);
|
|
1607
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1699
|
+
if (_optionalChain([existing, 'optionalAccess', _55 => _55.sourceRoot]) === source.root) {
|
|
1608
1700
|
throw new Error(
|
|
1609
1701
|
`Duplicate page route "${pattern}". Found both ${existing.modulePath} and programmatic route in ${filePath}.`
|
|
1610
1702
|
);
|
|
@@ -1622,9 +1714,9 @@ var RouteManager = class _RouteManager {
|
|
|
1622
1714
|
}
|
|
1623
1715
|
if (definition.kind === "layout") {
|
|
1624
1716
|
const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
|
|
1625
|
-
const pattern =
|
|
1717
|
+
const pattern = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1626
1718
|
const existing = this.layouts.get(pattern);
|
|
1627
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1719
|
+
if (_optionalChain([existing, 'optionalAccess', _56 => _56.sourceRoot]) === source.root) {
|
|
1628
1720
|
throw new Error(
|
|
1629
1721
|
`Duplicate layout route "${pattern}". Found both ${existing.modulePath} and programmatic route in ${filePath}.`
|
|
1630
1722
|
);
|
|
@@ -1653,7 +1745,7 @@ var RouteManager = class _RouteManager {
|
|
|
1653
1745
|
}
|
|
1654
1746
|
async loadProgrammaticRoutesModule(filePath) {
|
|
1655
1747
|
if (this.viteServer) {
|
|
1656
|
-
const viteRoot = _optionalChain([this, 'access',
|
|
1748
|
+
const viteRoot = _optionalChain([this, 'access', _57 => _57.viteServer, 'access', _58 => _58.config, 'optionalAccess', _59 => _59.root]) || this.config.root || process.cwd();
|
|
1657
1749
|
return await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, filePath, viteRoot));
|
|
1658
1750
|
}
|
|
1659
1751
|
return await import(
|
|
@@ -1669,7 +1761,7 @@ var RouteManager = class _RouteManager {
|
|
|
1669
1761
|
const matchingLayouts = [];
|
|
1670
1762
|
for (const { entry, groupScope } of this.orderedLayouts) {
|
|
1671
1763
|
if (!_chunk7U4XF76Rcjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
|
|
1672
|
-
if (groupScope !== null && !
|
|
1764
|
+
if (groupScope !== null && !_chunkNEKO3HM2cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
|
|
1673
1765
|
continue;
|
|
1674
1766
|
}
|
|
1675
1767
|
matchingLayouts.push(entry);
|
|
@@ -1750,14 +1842,14 @@ var RouteManager = class _RouteManager {
|
|
|
1750
1842
|
let page = route;
|
|
1751
1843
|
for (const boundaryEntry of boundaries.values()) {
|
|
1752
1844
|
if (!_chunk7U4XF76Rcjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
|
|
1753
|
-
const groupScope =
|
|
1845
|
+
const groupScope = _chunkNEKO3HM2cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
|
|
1754
1846
|
if (groupScope !== null) {
|
|
1755
1847
|
if (page === void 0) page = this.matchPageRoute(_chunk7U4XF76Rcjs.splitRoutePath.call(void 0, normalizedPath));
|
|
1756
|
-
if (!
|
|
1848
|
+
if (!_chunkNEKO3HM2cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
|
|
1757
1849
|
}
|
|
1758
1850
|
const depth = boundaryEntry.route.segments.length;
|
|
1759
|
-
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess',
|
|
1760
|
-
if (!bestMatch || depth > bestDepth || depth === bestDepth &&
|
|
1851
|
+
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _60 => _60.route, 'access', _61 => _61.segments, 'access', _62 => _62.length]), () => ( -1));
|
|
1852
|
+
if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
|
|
1761
1853
|
bestMatch = boundaryEntry;
|
|
1762
1854
|
}
|
|
1763
1855
|
}
|
|
@@ -1784,8 +1876,6 @@ var RouteManager = class _RouteManager {
|
|
|
1784
1876
|
getDocsAdapterRoutes() {
|
|
1785
1877
|
const docs = this.config.docs;
|
|
1786
1878
|
if (!docs || typeof docs !== "object" || !docs.enabled) return void 0;
|
|
1787
|
-
const usesAdapter = Boolean(docs.adapter && docs.adapter.server && docs.adapter.react);
|
|
1788
|
-
if (usesAdapter && !_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, this.config.renderer)) return void 0;
|
|
1789
1879
|
const entry = `/${String(docs.entry || "docs").replace(/^\/+|\/+$/g, "")}`;
|
|
1790
1880
|
return {
|
|
1791
1881
|
owns: (routePath) => entry === "/" || routePath === entry || routePath.startsWith(`${entry}/`),
|
|
@@ -1807,7 +1897,7 @@ var RouteManager = class _RouteManager {
|
|
|
1807
1897
|
}));
|
|
1808
1898
|
const i18n = this.getI18nConfig();
|
|
1809
1899
|
const docsAdapterRoutes = this.getDocsAdapterRoutes();
|
|
1810
|
-
const result = await
|
|
1900
|
+
const result = await _chunkHRH7OKBQcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
1811
1901
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
|
|
1812
1902
|
...docsAdapterRoutes ? { docsAdapterRoutes } : {}
|
|
1813
1903
|
});
|
|
@@ -1854,7 +1944,7 @@ var RouteManager = class _RouteManager {
|
|
|
1854
1944
|
async isRouteSSG(modulePath) {
|
|
1855
1945
|
try {
|
|
1856
1946
|
const mod = await this.loadRouteModule(modulePath);
|
|
1857
|
-
const rendering = await
|
|
1947
|
+
const rendering = await _chunkHRH7OKBQcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1858
1948
|
return rendering.ssg;
|
|
1859
1949
|
} catch (e2) {
|
|
1860
1950
|
return false;
|
|
@@ -1866,7 +1956,7 @@ var RouteManager = class _RouteManager {
|
|
|
1866
1956
|
async hasRouteISR(modulePath) {
|
|
1867
1957
|
try {
|
|
1868
1958
|
const mod = await this.loadRouteModule(modulePath);
|
|
1869
|
-
const rendering = await
|
|
1959
|
+
const rendering = await _chunkHRH7OKBQcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1870
1960
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
1871
1961
|
} catch (e3) {
|
|
1872
1962
|
return false;
|
|
@@ -1878,7 +1968,7 @@ var RouteManager = class _RouteManager {
|
|
|
1878
1968
|
async getRouteRevalidateInterval(modulePath) {
|
|
1879
1969
|
try {
|
|
1880
1970
|
const mod = await this.loadRouteModule(modulePath);
|
|
1881
|
-
const rendering = await
|
|
1971
|
+
const rendering = await _chunkHRH7OKBQcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1882
1972
|
return rendering.revalidate;
|
|
1883
1973
|
} catch (e4) {
|
|
1884
1974
|
return void 0;
|
|
@@ -1886,7 +1976,7 @@ var RouteManager = class _RouteManager {
|
|
|
1886
1976
|
}
|
|
1887
1977
|
};
|
|
1888
1978
|
function getPageDirectoryField(route, pattern) {
|
|
1889
|
-
const directory =
|
|
1979
|
+
const directory = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1890
1980
|
return directory === pattern ? {} : { directory };
|
|
1891
1981
|
}
|
|
1892
1982
|
function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
|
|
@@ -2010,11 +2100,11 @@ function createFarmDevClientManifest(manifest, options) {
|
|
|
2010
2100
|
}
|
|
2011
2101
|
for (const layout of manifest.layouts) {
|
|
2012
2102
|
if (layoutPatterns && !layoutPatterns.has(layout.pattern)) continue;
|
|
2013
|
-
const groupScope =
|
|
2103
|
+
const groupScope = _chunkNEKO3HM2cjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
2014
2104
|
clientManifest.layouts[layout.pattern] = {
|
|
2015
2105
|
modulePath: layout.modulePath,
|
|
2016
2106
|
pattern: layout.pattern,
|
|
2017
|
-
...groupScope ? { urlPattern:
|
|
2107
|
+
...groupScope ? { urlPattern: _chunkNEKO3HM2cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
|
|
2018
2108
|
shouldHydrate: layout.shouldHydrate,
|
|
2019
2109
|
islandStrategy: layout.islandStrategy,
|
|
2020
2110
|
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
@@ -2092,7 +2182,7 @@ function farmFontImportsPlugin(options = {}) {
|
|
|
2092
2182
|
return;
|
|
2093
2183
|
}
|
|
2094
2184
|
const resource = registry.getDevResource(pathname);
|
|
2095
|
-
if (!_optionalChain([resource, 'optionalAccess',
|
|
2185
|
+
if (!_optionalChain([resource, 'optionalAccess', _63 => _63.bytes])) {
|
|
2096
2186
|
next();
|
|
2097
2187
|
return;
|
|
2098
2188
|
}
|
|
@@ -2610,7 +2700,7 @@ function readFontOptions(code, id, call) {
|
|
|
2610
2700
|
const declaration = call.ancestors.at(-2);
|
|
2611
2701
|
const statement = call.ancestors.at(-3);
|
|
2612
2702
|
const statementParent = call.ancestors.at(-4);
|
|
2613
|
-
const isModuleScope = _optionalChain([declaration, 'optionalAccess',
|
|
2703
|
+
const isModuleScope = _optionalChain([declaration, 'optionalAccess', _64 => _64.type]) === "VariableDeclaration" && (_optionalChain([statement, 'optionalAccess', _65 => _65.type]) === "Program" || _optionalChain([statement, 'optionalAccess', _66 => _66.type]) === "ExportNamedDeclaration" && _optionalChain([statementParent, 'optionalAccess', _67 => _67.type]) === "Program");
|
|
2614
2704
|
if (!isModuleScope || call.ancestors.some((ancestor) => isFunctionNode(ancestor))) {
|
|
2615
2705
|
throw fontError(id, `${call.kind}() must be declared directly at module scope`);
|
|
2616
2706
|
}
|
|
@@ -3089,7 +3179,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
|
|
|
3089
3179
|
let hasClerkProvider = false;
|
|
3090
3180
|
renderedProviders.forEach((provider, index) => {
|
|
3091
3181
|
let componentExpression = "null";
|
|
3092
|
-
if (
|
|
3182
|
+
if (_chunkB3HQTGXScjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
3093
3183
|
const namespace = `FarmIntegrationProviderModule${index}`;
|
|
3094
3184
|
imports.push(
|
|
3095
3185
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -3146,7 +3236,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
|
|
|
3146
3236
|
const entries = [];
|
|
3147
3237
|
let needsMarkHelper = false;
|
|
3148
3238
|
providers.forEach((provider, index) => {
|
|
3149
|
-
if (!
|
|
3239
|
+
if (!_chunkB3HQTGXScjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
|
|
3150
3240
|
const namespace = `FarmServerIntegrationProviderModule${index}`;
|
|
3151
3241
|
imports.push(
|
|
3152
3242
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -3176,17 +3266,17 @@ function resolveProviderModule(moduleId, root) {
|
|
|
3176
3266
|
|
|
3177
3267
|
// src/server-actions-mode.ts
|
|
3178
3268
|
function resolveFarmIslxActionsMode(config) {
|
|
3179
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3269
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _68 => _68.experimental, 'optionalAccess', _69 => _69.serverComponents])) === "islands") {
|
|
3180
3270
|
return "islands";
|
|
3181
3271
|
}
|
|
3182
|
-
if (_optionalChain([config, 'access',
|
|
3272
|
+
if (_optionalChain([config, 'access', _70 => _70.experimental, 'optionalAccess', _71 => _71.serverActions]) !== true) return null;
|
|
3183
3273
|
const renderer = config.renderer;
|
|
3184
3274
|
if (renderer === void 0 || renderer === false) return null;
|
|
3185
|
-
if (
|
|
3275
|
+
if (_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, renderer) || _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer)) return null;
|
|
3186
3276
|
return "renderer";
|
|
3187
3277
|
}
|
|
3188
3278
|
function farmBrowserServerFnsEnabled(config) {
|
|
3189
|
-
return _optionalChain([config, 'access',
|
|
3279
|
+
return _optionalChain([config, 'access', _72 => _72.experimental, 'optionalAccess', _73 => _73.serverActions]) === true && resolveFarmIslxActionsMode(config) !== null;
|
|
3190
3280
|
}
|
|
3191
3281
|
|
|
3192
3282
|
// src/island-inference.ts
|
|
@@ -3229,7 +3319,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
3229
3319
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
3230
3320
|
parse: parseFarmIslandSource,
|
|
3231
3321
|
resolve: (specifier, importer) => {
|
|
3232
|
-
const resolved =
|
|
3322
|
+
const resolved = _chunkEFI6QWBQcjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
3233
3323
|
return resolved.local ? resolved.path : null;
|
|
3234
3324
|
}
|
|
3235
3325
|
});
|
|
@@ -3249,7 +3339,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
3249
3339
|
if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
|
|
3250
3340
|
return cached.result;
|
|
3251
3341
|
}
|
|
3252
|
-
const { result, files } =
|
|
3342
|
+
const { result, files } = _chunkEFI6QWBQcjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
|
|
3253
3343
|
const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
|
|
3254
3344
|
routeRootInferences.set(key, {
|
|
3255
3345
|
stamps: [...read].map((file) => [file, modifiedAt(file)]),
|
|
@@ -3266,7 +3356,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3266
3356
|
const files = [];
|
|
3267
3357
|
const modules = [];
|
|
3268
3358
|
for (const owner of owners) {
|
|
3269
|
-
const rendered =
|
|
3359
|
+
const rendered = _chunkEFI6QWBQcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
3270
3360
|
if (!rendered) {
|
|
3271
3361
|
return {
|
|
3272
3362
|
strategy: null,
|
|
@@ -3282,7 +3372,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3282
3372
|
source = fs2.default.readFileSync(module, "utf8");
|
|
3283
3373
|
} catch (e11) {
|
|
3284
3374
|
}
|
|
3285
|
-
if (
|
|
3375
|
+
if (_chunkEFI6QWBQcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
3286
3376
|
}
|
|
3287
3377
|
for (const module of modules) {
|
|
3288
3378
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -3294,7 +3384,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3294
3384
|
function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
|
|
3295
3385
|
const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3296
3386
|
const onRoute = layouts.filter(
|
|
3297
|
-
(layout) =>
|
|
3387
|
+
(layout) => _chunkNEKO3HM2cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
|
|
3298
3388
|
);
|
|
3299
3389
|
const declared = [
|
|
3300
3390
|
...page.islandStrategy ? [page.islandStrategy] : [],
|
|
@@ -3325,9 +3415,9 @@ var _stream = require('stream');
|
|
|
3325
3415
|
// src/not-found.ts
|
|
3326
3416
|
|
|
3327
3417
|
|
|
3328
|
-
function resolveFarmNotFoundComponentPath(config, appDirs) {
|
|
3329
|
-
const extensions =
|
|
3330
|
-
const configuredPath = _optionalChain([config, 'access',
|
|
3418
|
+
function resolveFarmNotFoundComponentPath(config, appDirs, discovered) {
|
|
3419
|
+
const extensions = _chunkNGTZHWBGcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
|
|
3420
|
+
const configuredPath = _optionalChain([config, 'access', _74 => _74.notFound, 'optionalAccess', _75 => _75.component, 'optionalAccess', _76 => _76.trim, 'call', _77 => _77()]);
|
|
3331
3421
|
if (configuredPath) {
|
|
3332
3422
|
const componentPath = path4.default.isAbsolute(configuredPath) ? path4.default.normalize(configuredPath) : path4.default.resolve(config.root, configuredPath);
|
|
3333
3423
|
if (!extensions.some((extension) => componentPath.endsWith(extension))) {
|
|
@@ -3340,6 +3430,7 @@ function resolveFarmNotFoundComponentPath(config, appDirs) {
|
|
|
3340
3430
|
}
|
|
3341
3431
|
return componentPath;
|
|
3342
3432
|
}
|
|
3433
|
+
if (discovered !== void 0) return discovered;
|
|
3343
3434
|
let discoveredPath = null;
|
|
3344
3435
|
for (const appDir of appDirs) {
|
|
3345
3436
|
for (const extension of extensions) {
|
|
@@ -3365,11 +3456,11 @@ function getFarmLayoutKey(pattern, params) {
|
|
|
3365
3456
|
);
|
|
3366
3457
|
}
|
|
3367
3458
|
function countFarmKeptLayouts(layoutsHeader, layouts, params) {
|
|
3368
|
-
const chain =
|
|
3459
|
+
const chain = _chunkNEKO3HM2cjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
|
|
3369
3460
|
if (chain.length === 0) return 0;
|
|
3370
3461
|
const keys = layouts.map((layout) => getFarmLayoutKey(layout.pattern, params));
|
|
3371
|
-
if (chain[0] === keys[0]) return
|
|
3372
|
-
return keys.length > 1 ? 1 +
|
|
3462
|
+
if (chain[0] === keys[0]) return _chunkNEKO3HM2cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
|
|
3463
|
+
return keys.length > 1 ? 1 + _chunkNEKO3HM2cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
|
|
3373
3464
|
}
|
|
3374
3465
|
function createFarmFlushToken() {
|
|
3375
3466
|
const bytes = new Uint8Array(16);
|
|
@@ -3624,7 +3715,7 @@ function createDefaultErrorDiagnostics(error, root) {
|
|
|
3624
3715
|
function canBootFarmIslandsClient(config) {
|
|
3625
3716
|
const docs = config.docs;
|
|
3626
3717
|
const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
|
|
3627
|
-
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3718
|
+
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _78 => _78.experimental, 'optionalAccess', _79 => _79.serverComponents])) === "islands" && !docsEnabled && _chunkDMSXZNQRcjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkDMSXZNQRcjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
|
|
3628
3719
|
}
|
|
3629
3720
|
|
|
3630
3721
|
// src/islands-kept-layouts.ts
|
|
@@ -3672,7 +3763,7 @@ var DECLARATION_STATEMENTS = /* @__PURE__ */ new Set([
|
|
|
3672
3763
|
function parse(code, file) {
|
|
3673
3764
|
const extension = path4.default.extname(file).slice(1);
|
|
3674
3765
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" ? "jsx" : "tsx";
|
|
3675
|
-
return
|
|
3766
|
+
return _chunkEFI6QWBQcjs.memoizeInFarmSourceSnapshot.call(void 0, `ast:${lang}`, code, () => {
|
|
3676
3767
|
try {
|
|
3677
3768
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
3678
3769
|
} catch (e14) {
|
|
@@ -3762,11 +3853,11 @@ function findFarmRequestDecidingConstruct(code, file) {
|
|
|
3762
3853
|
reason = "import.meta";
|
|
3763
3854
|
return;
|
|
3764
3855
|
case "CallExpression":
|
|
3765
|
-
if (_optionalChain([current, 'access',
|
|
3856
|
+
if (_optionalChain([current, 'access', _80 => _80.callee, 'optionalAccess', _81 => _81.type]) === "Identifier" && current.callee.name === "use") {
|
|
3766
3857
|
reason = "a use() call";
|
|
3767
3858
|
return;
|
|
3768
3859
|
}
|
|
3769
|
-
if (_optionalChain([current, 'access',
|
|
3860
|
+
if (_optionalChain([current, 'access', _82 => _82.callee, 'optionalAccess', _83 => _83.type]) === "MemberExpression" && !current.callee.computed && _optionalChain([current, 'access', _84 => _84.callee, 'access', _85 => _85.object, 'optionalAccess', _86 => _86.type]) === "Identifier" && current.callee.object.name === "Math" && _optionalChain([current, 'access', _87 => _87.callee, 'access', _88 => _88.property, 'optionalAccess', _89 => _89.name]) === "random") {
|
|
3770
3861
|
reason = "Math.random()";
|
|
3771
3862
|
return;
|
|
3772
3863
|
}
|
|
@@ -3807,14 +3898,14 @@ function isReference(node, parent, key) {
|
|
|
3807
3898
|
}
|
|
3808
3899
|
function readSource(file) {
|
|
3809
3900
|
try {
|
|
3810
|
-
|
|
3901
|
+
_chunkEFI6QWBQcjs.noteFarmSourceRead.call(void 0, file);
|
|
3811
3902
|
return fs2.default.readFileSync(file, "utf8");
|
|
3812
3903
|
} catch (e15) {
|
|
3813
3904
|
return null;
|
|
3814
3905
|
}
|
|
3815
3906
|
}
|
|
3816
3907
|
function explainFarmKeptLayoutRender(modulePath, root) {
|
|
3817
|
-
const entry =
|
|
3908
|
+
const entry = _chunkEFI6QWBQcjs.resolveModuleSourcePath.call(void 0, modulePath, root);
|
|
3818
3909
|
if (!entry) return `${modulePath} does not resolve`;
|
|
3819
3910
|
const visited = /* @__PURE__ */ new Set();
|
|
3820
3911
|
const check = (file) => {
|
|
@@ -3824,7 +3915,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3824
3915
|
if (!SCRIPT_SOURCE.test(file)) return `${path4.default.relative(root, file)} is not a script`;
|
|
3825
3916
|
const code = readSource(file);
|
|
3826
3917
|
if (code === null) return `${path4.default.relative(root, file)} cannot be read`;
|
|
3827
|
-
const { reason, imports } =
|
|
3918
|
+
const { reason, imports } = _chunkEFI6QWBQcjs.memoizeInFarmSourceSnapshot.call(void 0,
|
|
3828
3919
|
"kept-layout-module",
|
|
3829
3920
|
code,
|
|
3830
3921
|
() => findFarmRequestDecidingConstruct(code, file)
|
|
@@ -3837,7 +3928,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3837
3928
|
return `${path4.default.relative(root, file)} imports ${imported.names.join(", ")} from ${imported.source}`;
|
|
3838
3929
|
}
|
|
3839
3930
|
if (ASSET_SOURCE.test(imported.source.split("?")[0])) continue;
|
|
3840
|
-
const resolved =
|
|
3931
|
+
const resolved = _chunkEFI6QWBQcjs.resolveImportedModule.call(void 0, file, imported.source, root);
|
|
3841
3932
|
if (!resolved.path || !resolved.local) {
|
|
3842
3933
|
return `${path4.default.relative(root, file)} imports ${imported.source}`;
|
|
3843
3934
|
}
|
|
@@ -3852,15 +3943,15 @@ var answers = /* @__PURE__ */ new Map();
|
|
|
3852
3943
|
function canFarmSkipKeptLayoutRender(modulePath, root) {
|
|
3853
3944
|
const key = `${root}\0${modulePath}`;
|
|
3854
3945
|
const known = answers.get(key);
|
|
3855
|
-
if (known && known.stamps.every(([file, stamp]) =>
|
|
3946
|
+
if (known && known.stamps.every(([file, stamp]) => _chunkEFI6QWBQcjs.getFarmSourceStamp.call(void 0, file) === stamp)) {
|
|
3856
3947
|
return known.skip;
|
|
3857
3948
|
}
|
|
3858
|
-
const { result, files } =
|
|
3949
|
+
const { result, files } = _chunkEFI6QWBQcjs.traceFarmSourceReads.call(void 0,
|
|
3859
3950
|
() => explainFarmKeptLayoutRender(modulePath, root) === null
|
|
3860
3951
|
);
|
|
3861
3952
|
answers.set(key, {
|
|
3862
3953
|
skip: result,
|
|
3863
|
-
stamps: files.map((file) => [file,
|
|
3954
|
+
stamps: files.map((file) => [file, _chunkEFI6QWBQcjs.getFarmSourceStamp.call(void 0, file)])
|
|
3864
3955
|
});
|
|
3865
3956
|
return result;
|
|
3866
3957
|
}
|
|
@@ -3895,7 +3986,7 @@ function pipeFarmRendererWebStream(runtime) {
|
|
|
3895
3986
|
source.once("error", (error) => {
|
|
3896
3987
|
if (settleShell(error)) return;
|
|
3897
3988
|
callbacks.onError(error);
|
|
3898
|
-
_optionalChain([destination, 'optionalAccess',
|
|
3989
|
+
_optionalChain([destination, 'optionalAccess', _90 => _90.end, 'call', _91 => _91()]);
|
|
3899
3990
|
});
|
|
3900
3991
|
},
|
|
3901
3992
|
(error) => settleShell(error)
|
|
@@ -3903,12 +3994,12 @@ function pipeFarmRendererWebStream(runtime) {
|
|
|
3903
3994
|
return {
|
|
3904
3995
|
pipe(target) {
|
|
3905
3996
|
destination = target;
|
|
3906
|
-
_optionalChain([source, 'optionalAccess',
|
|
3997
|
+
_optionalChain([source, 'optionalAccess', _92 => _92.pipe, 'call', _93 => _93(target)]);
|
|
3907
3998
|
},
|
|
3908
3999
|
abort() {
|
|
3909
4000
|
aborted = true;
|
|
3910
|
-
_optionalChain([source, 'optionalAccess',
|
|
3911
|
-
_optionalChain([destination, 'optionalAccess',
|
|
4001
|
+
_optionalChain([source, 'optionalAccess', _94 => _94.destroy, 'call', _95 => _95()]);
|
|
4002
|
+
_optionalChain([destination, 'optionalAccess', _96 => _96.end, 'call', _97 => _97()]);
|
|
3912
4003
|
}
|
|
3913
4004
|
};
|
|
3914
4005
|
};
|
|
@@ -3988,7 +4079,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
3988
4079
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
3989
4080
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
3990
4081
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
3991
|
-
_chunk7U4XF76Rcjs.logger.warn(
|
|
4082
|
+
_chunk7U4XF76Rcjs.logger.warn(_chunkEFI6QWBQcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
3992
4083
|
}
|
|
3993
4084
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
3994
4085
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
@@ -4025,7 +4116,7 @@ function appendResponseHeader(res, name, value) {
|
|
|
4025
4116
|
}
|
|
4026
4117
|
}
|
|
4027
4118
|
function requestHeader(req, name) {
|
|
4028
|
-
const value = _optionalChain([req, 'access',
|
|
4119
|
+
const value = _optionalChain([req, 'access', _98 => _98.headers, 'optionalAccess', _99 => _99[name]]);
|
|
4029
4120
|
return Array.isArray(value) ? value[0] : value;
|
|
4030
4121
|
}
|
|
4031
4122
|
function appendResponseVary(res, value) {
|
|
@@ -4039,16 +4130,12 @@ function appendResponseVary(res, value) {
|
|
|
4039
4130
|
function renderI18nAlternateLinks(requestPath, snapshot, options) {
|
|
4040
4131
|
if (snapshot.routing === "none") return "";
|
|
4041
4132
|
const url = new URL(requestPath, "http://farm.local");
|
|
4042
|
-
return
|
|
4133
|
+
return _chunkNEKO3HM2cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
|
|
4043
4134
|
}
|
|
4044
4135
|
var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
4045
4136
|
function createPPRRefreshScript() {
|
|
4046
4137
|
return `<script>(function(){if(window.__FARM_PPR_REFRESHING__)return;window.__FARM_PPR_REFRESHING__=true;var owner=document.currentScript;function applyState(doc){doc.querySelectorAll("script[data-farm-refresh-state]").forEach(function(source){var script=document.createElement("script");if(owner&&owner.nonce)script.nonce=owner.nonce;script.textContent=source.textContent||"";document.head.appendChild(script);script.remove();});}function key(node){return node.nodeType===1?node.getAttribute("id"):null}function compatible(current,next){if(current.nodeType!==next.nodeType)return false;if(current.nodeType===1&¤t.tagName!==next.tagName)return false;var currentKey=key(current);var nextKey=key(next);return currentKey||nextKey?currentKey===nextKey:true}function syncAttributes(current,next){Array.from(current.attributes).forEach(function(attribute){if(!next.hasAttribute(attribute.name))current.removeAttribute(attribute.name)});Array.from(next.attributes).forEach(function(attribute){if(current.getAttribute(attribute.name)!==attribute.value)current.setAttribute(attribute.name,attribute.value)})}function syncChildren(current,next){var cursor=current.firstChild;Array.from(next.childNodes).forEach(function(nextChild){if(cursor&&compatible(cursor,nextChild)){var matched=cursor;cursor=cursor.nextSibling;syncNode(matched,nextChild);return}var candidate=cursor;while(candidate&&!compatible(candidate,nextChild))candidate=candidate.nextSibling;if(candidate){current.insertBefore(candidate,cursor);syncNode(candidate,nextChild);return}current.insertBefore(nextChild.cloneNode(true),cursor)});while(cursor){var stale=cursor;cursor=cursor.nextSibling;stale.remove()}}function syncNode(current,next){if(current.nodeType===3||current.nodeType===8){if(current.nodeValue!==next.nodeValue)current.nodeValue=next.nodeValue;return}if(current.nodeType!==1)return;var tag=current.tagName;var value=tag==="INPUT"&¤t.type==="file"?null:"value" in current?current.value:null;var checked="checked" in current?current.checked:null;var selected=tag==="SELECT"?Array.from(current.options).map(function(option){return option.selected}):null;var focused=document.activeElement===current;var selection=focused&&typeof current.selectionStart==="number"?[current.selectionStart,current.selectionEnd,current.selectionDirection]:null;syncAttributes(current,next);syncChildren(current,next);if(value!==null)current.value=value;if(checked!==null)current.checked=checked;if(selected)Array.from(current.options).forEach(function(option,index){option.selected=selected[index]===true});if(selection)try{current.setSelectionRange(selection[0],selection[1],selection[2])}catch{}}function replaceRoot(html){var doc=new DOMParser().parseFromString(html,"text/html");var next=doc.getElementById("root");var current=document.getElementById("root");if(!next||!current)return false;applyState(doc);syncNode(current,next);return true}var attempts=0,settle;window.__FARM_PPR_REFRESH_PROMISE__=new Promise(function(resolve){settle=resolve;});function release(){window.__FARM_PPR_REFRESHING__=false;}function retry(){settle();if(window.__FARM_PPR_HYDRATING__||attempts>=${PPR_REFRESH_MAX_ATTEMPTS})return release();if(navigator.onLine===false){window.addEventListener("online",run,{once:true});return;}setTimeout(run,1000*Math.pow(2,attempts-1));}function run(){if(window.__FARM_PPR_HYDRATING__)return release();attempts++;fetch(window.location.href,{cache:"no-store",credentials:"same-origin",headers:{"x-farm-ppr-refresh":"1"}}).then(function(response){if(!response.ok)throw new Error("status "+response.status);return response.text();}).then(function(html){if(window.__FARM_PPR_HYDRATING__)return release();if(!replaceRoot(html))throw new Error("no root");settle();}).catch(retry);}run();})();</script>`;
|
|
4047
4138
|
}
|
|
4048
|
-
function createPreHydrationClickQueueScript() {
|
|
4049
|
-
const selector = JSON.stringify(_chunk7KJJ4SBScjs.FARM_ISLAND_REPLAYABLE_SELECTOR);
|
|
4050
|
-
return `<script>(function(){if(window.__FARM_PREHYDRATION_CLICK_QUEUE__)return;var queue=[];window.__FARM_PREHYDRATION_CLICK_QUEUE__=queue;window.__FARM_HYDRATED__=false;document.documentElement.dataset.farmHydrated="false";function isModified(event){return !!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}function inHydrated(node){return !!(node&&node.closest&&node.closest('[data-farm-island-hydrated="true"]'))}function closestQueuedTarget(target){while(target&&target!==document.documentElement){if(target.matches&&target.matches(${selector}))return target;target=target.parentElement}return null}function announce(target,kind){document.dispatchEvent(new CustomEvent("farm:island-interaction",{detail:{target:target,kind:kind||null}}))}function submits(target,kind){return kind==="submit"||!!(target.form&&target.type==="submit")}function hold(event,target,kind){if(!(submits(target,kind)&&queue.some(function(item){return item.target===target}))){queue.push({target:target,kind:kind,createdAt:Date.now()});announce(target,kind)}event.preventDefault();event.stopImmediatePropagation()}document.addEventListener("click",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented||event.button!==0||isModified(event))return;var target=closestQueuedTarget(event.target);if(!target||target.closest&&target.closest("a[href]")||inHydrated(target))return;hold(event,target,"click")},true);document.addEventListener("submit",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented)return;var form=event.target;if(!form||form.nodeName!=="FORM"||inHydrated(form))return;hold(event,form,"submit")},true);function observe(event){if(window.__FARM_HYDRATED__)return;var target=event.target;if(!(target&&target.closest)||inHydrated(target))return;announce(target,null)}document.addEventListener("pointerdown",observe,true);document.addEventListener("focusin",observe,true);})();</script>`;
|
|
4051
|
-
}
|
|
4052
4139
|
function rendererRenderOptions() {
|
|
4053
4140
|
const nonce = _chunk3BIASUGRcjs._resolveCurrentCspNonce.call(void 0, );
|
|
4054
4141
|
return nonce ? { nonce } : void 0;
|
|
@@ -4134,12 +4221,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4134
4221
|
}
|
|
4135
4222
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4136
4223
|
const params = parseRouteModuleSchema(
|
|
4137
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4224
|
+
_optionalChain([schemas, 'optionalAccess', _100 => _100.params]),
|
|
4138
4225
|
input.props.params,
|
|
4139
4226
|
"params",
|
|
4140
4227
|
input.routePath
|
|
4141
4228
|
);
|
|
4142
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4229
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _101 => _101.search]), input.search, "search", input.routePath);
|
|
4143
4230
|
return {
|
|
4144
4231
|
...input.props,
|
|
4145
4232
|
params,
|
|
@@ -4198,25 +4285,25 @@ var ServerRenderer = class {
|
|
|
4198
4285
|
} else {
|
|
4199
4286
|
_chunkWOAXQ5MZcjs.uninstallFarmIslandValues.call(void 0, );
|
|
4200
4287
|
}
|
|
4201
|
-
if (_optionalChain([this, 'access',
|
|
4288
|
+
if (_optionalChain([this, 'access', _102 => _102.config, 'access', _103 => _103.notFound, 'optionalAccess', _104 => _104.component, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()])) {
|
|
4202
4289
|
resolveFarmNotFoundComponentPath(this.config, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config));
|
|
4203
4290
|
}
|
|
4204
|
-
const loaded =
|
|
4205
|
-
|
|
4291
|
+
const loaded = _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer) ? this.reactRenderer = await import("./renderer/react/server.cjs") : _chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? await import("./renderer/none/server.cjs") : this.viteServer ? await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
|
|
4292
|
+
_chunkNGTZHWBGcjs.resolveFarmRendererModule.call(void 0,
|
|
4206
4293
|
this.config.root || process.cwd(),
|
|
4207
4294
|
this.config.renderer.server
|
|
4208
4295
|
)
|
|
4209
4296
|
).href);
|
|
4210
4297
|
const runtime = loaded;
|
|
4211
|
-
|
|
4212
|
-
|
|
4298
|
+
_chunkNGTZHWBGcjs.assertFarmRendererServerModule.call(void 0, runtime, this.config.renderer);
|
|
4299
|
+
_chunkNGTZHWBGcjs.assertFarmRendererStreamingRuntime.call(void 0,
|
|
4213
4300
|
this.config.renderer.name,
|
|
4214
4301
|
this.config.renderer,
|
|
4215
4302
|
runtime,
|
|
4216
4303
|
"node"
|
|
4217
4304
|
);
|
|
4218
4305
|
this.rendererRuntime = islands && this.islandValues() ? withFarmIslandsRenders(runtime, islands) : runtime;
|
|
4219
|
-
_optionalChain([this, 'access',
|
|
4306
|
+
_optionalChain([this, 'access', _107 => _107.routeManager, 'access', _108 => _108.setRendererRuntime, 'optionalCall', _109 => _109(this.rendererRuntime)]);
|
|
4220
4307
|
await this.applyRendererAppSetup();
|
|
4221
4308
|
}
|
|
4222
4309
|
/**
|
|
@@ -4225,7 +4312,7 @@ var ServerRenderer = class {
|
|
|
4225
4312
|
* re-applied on the next request without restarting.
|
|
4226
4313
|
*/
|
|
4227
4314
|
async applyRendererAppSetup() {
|
|
4228
|
-
const appSetupPath =
|
|
4315
|
+
const appSetupPath = _chunkNGTZHWBGcjs.resolveFarmRendererAppSetup.call(void 0,
|
|
4229
4316
|
this.config.root || process.cwd(),
|
|
4230
4317
|
this.config.renderer
|
|
4231
4318
|
);
|
|
@@ -4241,7 +4328,10 @@ var ServerRenderer = class {
|
|
|
4241
4328
|
this.appliedAppSetupModule = setupModule;
|
|
4242
4329
|
configureApp(setupModule.default);
|
|
4243
4330
|
}
|
|
4244
|
-
createPageBoundary(pageElement, options) {
|
|
4331
|
+
async createPageBoundary(pageElement, options) {
|
|
4332
|
+
if (options.pageShouldHydrate && !options.layoutShouldHydrate) {
|
|
4333
|
+
pageElement = await this.wrapIslandIntegrationProviders(pageElement);
|
|
4334
|
+
}
|
|
4245
4335
|
const boundary = this.rendererRuntime.createElement(
|
|
4246
4336
|
"div",
|
|
4247
4337
|
{
|
|
@@ -4256,6 +4346,15 @@ var ServerRenderer = class {
|
|
|
4256
4346
|
);
|
|
4257
4347
|
return options.pageShouldHydrate && !options.layoutShouldHydrate && this.reactRenderer ? this.reactRenderer.markPagePosition(boundary) : boundary;
|
|
4258
4348
|
}
|
|
4349
|
+
/**
|
|
4350
|
+
* The browser hydrates a page island or a route slot as its own root, inside the integration
|
|
4351
|
+
* providers, so the server renders the providers inside it too, or a provider that renders
|
|
4352
|
+
* markup (a Vue `<slot />` renders fragment markers) puts the root's HTML out of step. React
|
|
4353
|
+
* lines an island up with its tree position instead, and its providers render no markup.
|
|
4354
|
+
*/
|
|
4355
|
+
async wrapIslandIntegrationProviders(element) {
|
|
4356
|
+
return this.reactRenderer ? element : this.wrapWithIntegrationProviders(element);
|
|
4357
|
+
}
|
|
4259
4358
|
/// The app's `<srcDir>/app/globals.css`, linked only when it exists, as the
|
|
4260
4359
|
/// production build imports it only when it exists. An app without one gets
|
|
4261
4360
|
/// no stylesheet link rather than a failing request.
|
|
@@ -4274,7 +4373,7 @@ var ServerRenderer = class {
|
|
|
4274
4373
|
/// Stylesheets the app imported through JS (fontsource packages, component
|
|
4275
4374
|
/// CSS) that the document must link alongside globals.css — see #658.
|
|
4276
4375
|
collectDevStyleHrefs() {
|
|
4277
|
-
const graph = _optionalChain([this, 'access',
|
|
4376
|
+
const graph = _optionalChain([this, 'access', _110 => _110.viteServer, 'optionalAccess', _111 => _111.moduleGraph]);
|
|
4278
4377
|
if (!graph) return [];
|
|
4279
4378
|
return collectDevStylesheetUrls(
|
|
4280
4379
|
graph.idToModuleMap.values(),
|
|
@@ -4325,7 +4424,7 @@ var ServerRenderer = class {
|
|
|
4325
4424
|
"data-farm-layout-boundary": "true",
|
|
4326
4425
|
"data-farm-layout-pattern": pattern,
|
|
4327
4426
|
...segment ? { "data-farm-layout-key": segment.key } : {},
|
|
4328
|
-
..._optionalChain([segment, 'optionalAccess',
|
|
4427
|
+
..._optionalChain([segment, 'optionalAccess', _112 => _112.kept]) ? { "data-farm-layout-kept": "true" } : {},
|
|
4329
4428
|
style: { display: "contents" }
|
|
4330
4429
|
},
|
|
4331
4430
|
layoutElement
|
|
@@ -4356,10 +4455,10 @@ var ServerRenderer = class {
|
|
|
4356
4455
|
return serverTree && this.rendererRuntime.renderServerTreePage ? this.rendererRuntime.renderServerTreePage(element, { values: false }) : this.rendererRuntime.isolateServerPageGraph(element);
|
|
4357
4456
|
}
|
|
4358
4457
|
async renderElementToCompleteHTML(element, options = {}) {
|
|
4359
|
-
const streaming =
|
|
4458
|
+
const streaming = _chunkNGTZHWBGcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
|
|
4360
4459
|
const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
|
|
4361
4460
|
if (renderToPipeableStream) {
|
|
4362
|
-
const inlineBoundaries =
|
|
4461
|
+
const inlineBoundaries = _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer);
|
|
4363
4462
|
return await new Promise((resolve3, reject) => {
|
|
4364
4463
|
const chunks = [];
|
|
4365
4464
|
let shellReady = false;
|
|
@@ -4405,7 +4504,7 @@ var ServerRenderer = class {
|
|
|
4405
4504
|
element,
|
|
4406
4505
|
rendererRenderOptions()
|
|
4407
4506
|
);
|
|
4408
|
-
return await
|
|
4507
|
+
return await _chunkNGTZHWBGcjs.readFarmRendererWebStream.call(void 0, stream);
|
|
4409
4508
|
}
|
|
4410
4509
|
return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
|
|
4411
4510
|
}
|
|
@@ -4421,7 +4520,7 @@ var ServerRenderer = class {
|
|
|
4421
4520
|
);
|
|
4422
4521
|
return { html: rendered.html, head: rendered.head || "" };
|
|
4423
4522
|
}
|
|
4424
|
-
const { head, body } =
|
|
4523
|
+
const { head, body } = _chunkNEKO3HM2cjs.takeFarmHoistedHead.call(void 0,
|
|
4425
4524
|
await this.renderElementToCompleteHTML(element, options),
|
|
4426
4525
|
true
|
|
4427
4526
|
);
|
|
@@ -4429,7 +4528,7 @@ var ServerRenderer = class {
|
|
|
4429
4528
|
}
|
|
4430
4529
|
/** Islands mode sends large prop values once, keyed by content (RFC 0003). */
|
|
4431
4530
|
islandValues() {
|
|
4432
|
-
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access',
|
|
4531
|
+
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _113 => _113.config, 'access', _114 => _114.experimental, 'optionalAccess', _115 => _115.serverComponents])) === "islands";
|
|
4433
4532
|
}
|
|
4434
4533
|
/**
|
|
4435
4534
|
* The page's element. Only React renders an async component, so for any other renderer Farm
|
|
@@ -4438,7 +4537,7 @@ var ServerRenderer = class {
|
|
|
4438
4537
|
*/
|
|
4439
4538
|
async createPageElement(PageComponent, pageProps) {
|
|
4440
4539
|
const runtime = this.rendererRuntime;
|
|
4441
|
-
if (
|
|
4540
|
+
if (_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer) || typeof PageComponent !== "function" || _optionalChain([PageComponent, 'access', _116 => _116.constructor, 'optionalAccess', _117 => _117.name]) !== "AsyncFunction") {
|
|
4442
4541
|
return runtime.createElement(PageComponent, pageProps);
|
|
4443
4542
|
}
|
|
4444
4543
|
const result = await PageComponent(pageProps);
|
|
@@ -4473,7 +4572,7 @@ var ServerRenderer = class {
|
|
|
4473
4572
|
} else if (input.layoutShouldHydrate && !input.pageShouldHydrate && this.rendererRuntime.isolateServerPageGraph) {
|
|
4474
4573
|
element = await this.isolateServerPage(element, input.serverTree === true);
|
|
4475
4574
|
}
|
|
4476
|
-
element = this.createPageBoundary(element, {
|
|
4575
|
+
element = await this.createPageBoundary(element, {
|
|
4477
4576
|
pageShouldHydrate: input.pageShouldHydrate,
|
|
4478
4577
|
layoutShouldHydrate: input.layoutShouldHydrate,
|
|
4479
4578
|
islandStrategy: input.islandStrategy
|
|
@@ -4498,7 +4597,11 @@ var ServerRenderer = class {
|
|
|
4498
4597
|
continue;
|
|
4499
4598
|
}
|
|
4500
4599
|
let slotElement = this.rendererRuntime.createElement(slot.module.default, slot.props);
|
|
4501
|
-
if (slot.shouldHydrate !== false)
|
|
4600
|
+
if (slot.shouldHydrate !== false) {
|
|
4601
|
+
slotElement = this.wrapClientGraph(
|
|
4602
|
+
await this.wrapIslandIntegrationProviders(slotElement)
|
|
4603
|
+
);
|
|
4604
|
+
}
|
|
4502
4605
|
slotProps[slot.name] = this.rendererRuntime.createElement(
|
|
4503
4606
|
"div",
|
|
4504
4607
|
{
|
|
@@ -4533,7 +4636,7 @@ var ServerRenderer = class {
|
|
|
4533
4636
|
rejectLateRedirects: true
|
|
4534
4637
|
}
|
|
4535
4638
|
);
|
|
4536
|
-
return fragmentTag ?
|
|
4639
|
+
return fragmentTag ? _chunkNEKO3HM2cjs.takeFarmNavigationOutlet.call(void 0, html, fragmentTag) : html;
|
|
4537
4640
|
}
|
|
4538
4641
|
/**
|
|
4539
4642
|
* A built-in docs runtime page (`docs.entry`, no adapter) under layouts that hydrate, or whose
|
|
@@ -4543,7 +4646,7 @@ var ServerRenderer = class {
|
|
|
4543
4646
|
* Any other docs response is sent as it is.
|
|
4544
4647
|
*/
|
|
4545
4648
|
async wrapDocsResponseWithLayouts(request2, response) {
|
|
4546
|
-
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
4649
|
+
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _118 => _118.headers, 'access', _119 => _119.get, 'call', _120 => _120("content-type"), 'optionalAccess', _121 => _121.toLowerCase, 'call', _122 => _122(), 'access', _123 => _123.includes, 'call', _124 => _124("text/html")])) {
|
|
4547
4650
|
return response;
|
|
4548
4651
|
}
|
|
4549
4652
|
await this.initialize();
|
|
@@ -4558,14 +4661,14 @@ var ServerRenderer = class {
|
|
|
4558
4661
|
return {
|
|
4559
4662
|
pattern: layout.pattern,
|
|
4560
4663
|
modulePath: layout.modulePath,
|
|
4561
|
-
shouldHydrate: _optionalChain([entry, 'optionalAccess',
|
|
4562
|
-
islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
4563
|
-
hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess',
|
|
4564
|
-
serverTree: _optionalChain([entry, 'optionalAccess',
|
|
4565
|
-
islands: _optionalChain([entry, 'optionalAccess',
|
|
4664
|
+
shouldHydrate: _optionalChain([entry, 'optionalAccess', _125 => _125.shouldHydrate]) === true,
|
|
4665
|
+
islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _126 => _126.islandStrategy]), () => ( null)),
|
|
4666
|
+
hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess', _127 => _127.hasIsolatedClientBoundaries]) === true,
|
|
4667
|
+
serverTree: _optionalChain([entry, 'optionalAccess', _128 => _128.serverTree]) === true,
|
|
4668
|
+
islands: _optionalChain([entry, 'optionalAccess', _129 => _129.hasIsolatedClientBoundaries]) === true
|
|
4566
4669
|
};
|
|
4567
4670
|
});
|
|
4568
|
-
if (!
|
|
4671
|
+
if (!_chunkNEKO3HM2cjs.farmDocsLayoutsWrapPage.call(void 0, layouts)) return response;
|
|
4569
4672
|
const shouldHydrateLayout = layouts.some((layout) => layout.shouldHydrate);
|
|
4570
4673
|
const hasIsolatedClientBoundaries = layouts.some(
|
|
4571
4674
|
(layout) => layout.hasIsolatedClientBoundaries
|
|
@@ -4584,10 +4687,10 @@ var ServerRenderer = class {
|
|
|
4584
4687
|
);
|
|
4585
4688
|
const treeLayouts = layouts.map((layout, index) => ({
|
|
4586
4689
|
...layout,
|
|
4587
|
-
Component: _optionalChain([modules, 'access',
|
|
4690
|
+
Component: _optionalChain([modules, 'access', _130 => _130[index], 'optionalAccess', _131 => _131.default])
|
|
4588
4691
|
}));
|
|
4589
|
-
const islandStrategy =
|
|
4590
|
-
const tree = await
|
|
4692
|
+
const islandStrategy = _chunkNEKO3HM2cjs.resolveFarmDocsLayoutIslandStrategy.call(void 0, treeLayouts);
|
|
4693
|
+
const tree = await _chunkNEKO3HM2cjs.createFarmDocsLayoutTree.call(void 0, this.rendererRuntime, {
|
|
4591
4694
|
pageHtml: bodyMatch[2],
|
|
4592
4695
|
layouts: treeLayouts,
|
|
4593
4696
|
params: matched.params,
|
|
@@ -4608,7 +4711,7 @@ var ServerRenderer = class {
|
|
|
4608
4711
|
)
|
|
4609
4712
|
)
|
|
4610
4713
|
);
|
|
4611
|
-
const rootMarkup =
|
|
4714
|
+
const rootMarkup = _chunkNEKO3HM2cjs.placeFarmDocsLayoutRoot.call(void 0, rendered.html);
|
|
4612
4715
|
const clientLayouts = layouts.map((layout) => ({
|
|
4613
4716
|
pattern: layout.pattern,
|
|
4614
4717
|
modulePath: _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, layout.modulePath, root),
|
|
@@ -4644,13 +4747,13 @@ window.__FARM_ISLAND_STRATEGY__ = ${serializeInlineValue(islandStrategy)};
|
|
|
4644
4747
|
window.__FARM_PAGE_MODULE__ = "";
|
|
4645
4748
|
window.__FARM_LOADING_MODULE__ = null;
|
|
4646
4749
|
window.__FARM_MANIFEST__ = ${serializeInlineValue(clientManifest)};
|
|
4647
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${serializeInlineValue(
|
|
4750
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${serializeInlineValue(_chunkB3HQTGXScjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
4648
4751
|
window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "null"};
|
|
4649
4752
|
</script>`;
|
|
4650
4753
|
const head = [
|
|
4651
4754
|
...this.collectDevStyleLinks(),
|
|
4652
4755
|
`<script type="module" src="/@vite/client"></script>`,
|
|
4653
|
-
source.includes("window._$HY") ? "" : _optionalChain([this, 'access',
|
|
4756
|
+
source.includes("window._$HY") ? "" : _optionalChain([this, 'access', _132 => _132.rendererRuntime, 'access', _133 => _133.generateHydrationScript, 'optionalCall', _134 => _134()]),
|
|
4654
4757
|
bootstrapScript
|
|
4655
4758
|
].filter(Boolean).map((markup) => _chunk6JHZPB52cjs.stampFarmCspNonce.call(void 0, markup)).concat(rendered.head || []).join("\n ");
|
|
4656
4759
|
const clientScript = source.includes('src="/@farm/client.js"') ? "" : `
|
|
@@ -4669,7 +4772,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4669
4772
|
async runWithRequestContext(request2, fn) {
|
|
4670
4773
|
return _chunk2RSVYJT6cjs._runWithCurrentRequest.call(void 0,
|
|
4671
4774
|
request2,
|
|
4672
|
-
() => _optionalChain([this, 'access',
|
|
4775
|
+
() => _optionalChain([this, 'access', _135 => _135.i18nRuntime, 'optionalAccess', _136 => _136.config, 'access', _137 => _137.enabled]) ? _chunkSXXSQVKKcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
|
|
4673
4776
|
redirect: false
|
|
4674
4777
|
}) : fn()
|
|
4675
4778
|
);
|
|
@@ -4700,7 +4803,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4700
4803
|
* Check if a path should be served from SSG cache
|
|
4701
4804
|
*/
|
|
4702
4805
|
async shouldServeSSG(pathname) {
|
|
4703
|
-
const ssgPage =
|
|
4806
|
+
const ssgPage = _chunkHRH7OKBQcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
4704
4807
|
if (!ssgPage) return null;
|
|
4705
4808
|
const cached = await this.getCachedSSGPage(pathname);
|
|
4706
4809
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -4818,7 +4921,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4818
4921
|
setImmediate(async () => {
|
|
4819
4922
|
try {
|
|
4820
4923
|
const mod = await this.routeManager.loadRouteModule(page.filePath);
|
|
4821
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
4924
|
+
if (!_optionalChain([mod, 'optionalAccess', _138 => _138.default])) return;
|
|
4822
4925
|
const { route, layouts } = this.routeManager.matchRoute(page.urlPath);
|
|
4823
4926
|
const layoutModules = await Promise.all(
|
|
4824
4927
|
layouts.map((l) => this.routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -4832,7 +4935,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4832
4935
|
};
|
|
4833
4936
|
let pageElement = await this.createPageElement(PageComponent, pageProps);
|
|
4834
4937
|
const pageMetadata = _nullishCoalesce(routeManifest.routes.find(
|
|
4835
|
-
(entry) => entry.pattern === _optionalChain([route, 'optionalAccess',
|
|
4938
|
+
(entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _139 => _139.pattern])
|
|
4836
4939
|
), () => ( {
|
|
4837
4940
|
shouldHydrate: false,
|
|
4838
4941
|
islandStrategy: null
|
|
@@ -4844,7 +4947,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4844
4947
|
}))
|
|
4845
4948
|
);
|
|
4846
4949
|
const layoutShouldHydrate = layoutMetadata.some((metadata) => metadata.shouldHydrate);
|
|
4847
|
-
pageElement = this.createPageBoundary(pageElement, {
|
|
4950
|
+
pageElement = await this.createPageBoundary(pageElement, {
|
|
4848
4951
|
pageShouldHydrate: pageMetadata.shouldHydrate,
|
|
4849
4952
|
layoutShouldHydrate,
|
|
4850
4953
|
islandStrategy: pageMetadata.islandStrategy
|
|
@@ -4861,7 +4964,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4861
4964
|
if (pageMetadata.shouldHydrate && !layoutShouldHydrate && this.reactRenderer) {
|
|
4862
4965
|
pageElement = this.reactRenderer.markLayoutPosition(pageElement);
|
|
4863
4966
|
}
|
|
4864
|
-
const html = await this.
|
|
4967
|
+
const { html, head: rendererHead } = await this.renderElementToDocumentParts(
|
|
4865
4968
|
await this.wrapWithIntegrationProviders(pageElement)
|
|
4866
4969
|
);
|
|
4867
4970
|
const mergedMetadata = await this.resolveRouteMetadata({
|
|
@@ -4870,8 +4973,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4870
4973
|
pageProps,
|
|
4871
4974
|
pathname: page.urlPath
|
|
4872
4975
|
});
|
|
4873
|
-
const { title, tags, hasFavicon } = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, mergedMetadata);
|
|
4874
|
-
const
|
|
4976
|
+
const { title, tags, hasFavicon, hasExplicitTitle } = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, mergedMetadata);
|
|
4977
|
+
const titleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
4978
|
+
const metadataHead = `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}${titleTag}${tags}${rendererHead}`;
|
|
4875
4979
|
const fullDocument = this.createFullHTML(
|
|
4876
4980
|
html,
|
|
4877
4981
|
pageMetadata.shouldHydrate === true,
|
|
@@ -4939,7 +5043,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4939
5043
|
* such as a partial test double, has none.
|
|
4940
5044
|
*/
|
|
4941
5045
|
publishSearchPreserveRoutes() {
|
|
4942
|
-
_chunkWKVYF2B5cjs._setFarmSearchPreserveRoutes.call(void 0, _nullishCoalesce(_optionalChain([this, 'access',
|
|
5046
|
+
_chunkWKVYF2B5cjs._setFarmSearchPreserveRoutes.call(void 0, _nullishCoalesce(_optionalChain([this, 'access', _140 => _140.routeManager, 'access', _141 => _141.getSearchPreserveRoutes, 'optionalCall', _142 => _142()]), () => ( [])));
|
|
4943
5047
|
}
|
|
4944
5048
|
async renderPage(req, res) {
|
|
4945
5049
|
await this.initialize();
|
|
@@ -4955,7 +5059,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4955
5059
|
}
|
|
4956
5060
|
const request2 = this.createPageRequest(req, res);
|
|
4957
5061
|
const runtime = this.i18nRuntime;
|
|
4958
|
-
if (_optionalChain([runtime, 'optionalAccess',
|
|
5062
|
+
if (_optionalChain([runtime, 'optionalAccess', _143 => _143.config, 'access', _144 => _144.enabled])) {
|
|
4959
5063
|
const resolution = runtime.resolveRequest(request2);
|
|
4960
5064
|
const varyHeaders = _chunk7Q2YWZF7cjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
|
|
4961
5065
|
for (const header of varyHeaders) appendResponseVary(res, header);
|
|
@@ -4994,7 +5098,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4994
5098
|
createPageRequestOnce(req, res) {
|
|
4995
5099
|
const observable = typeof req.once === "function" && typeof res.once === "function";
|
|
4996
5100
|
return _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
4997
|
-
trustProxy: _optionalChain([this, 'access',
|
|
5101
|
+
trustProxy: _optionalChain([this, 'access', _145 => _145.config, 'access', _146 => _146.server, 'optionalAccess', _147 => _147.trustProxy]),
|
|
4998
5102
|
signal: observable ? _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0,
|
|
4999
5103
|
req,
|
|
5000
5104
|
res
|
|
@@ -5024,7 +5128,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5024
5128
|
};
|
|
5025
5129
|
let pprShellWrite;
|
|
5026
5130
|
try {
|
|
5027
|
-
const url = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
5131
|
+
const url = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _148 => _148.config, 'access', _149 => _149.server, 'optionalAccess', _150 => _150.trustProxy]) });
|
|
5028
5132
|
pathname = url.pathname;
|
|
5029
5133
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
|
|
5030
5134
|
searchParamsObject = _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, url.searchParams);
|
|
@@ -5187,11 +5291,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5187
5291
|
searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
|
|
5188
5292
|
error
|
|
5189
5293
|
};
|
|
5190
|
-
if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess',
|
|
5294
|
+
if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _151 => _151.notFound])) {
|
|
5191
5295
|
res.statusCode = 404;
|
|
5192
5296
|
PageComponent = programmaticRouteComponents.notFound;
|
|
5193
5297
|
pageProps = routeStateProps;
|
|
5194
|
-
} else if (_optionalChain([programmaticRouteComponents, 'optionalAccess',
|
|
5298
|
+
} else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _152 => _152.error])) {
|
|
5195
5299
|
res.statusCode = 500;
|
|
5196
5300
|
PageComponent = programmaticRouteComponents.error;
|
|
5197
5301
|
pageProps = routeStateProps;
|
|
@@ -5199,10 +5303,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5199
5303
|
throw error;
|
|
5200
5304
|
}
|
|
5201
5305
|
}
|
|
5202
|
-
const renderingConfig = await
|
|
5306
|
+
const renderingConfig = await _chunkHRH7OKBQcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5203
5307
|
routeModule,
|
|
5204
5308
|
route.modulePath,
|
|
5205
|
-
{ experimentalPPR: _optionalChain([this, 'access',
|
|
5309
|
+
{ experimentalPPR: _optionalChain([this, 'access', _153 => _153.config, 'access', _154 => _154.experimental, 'optionalAccess', _155 => _155.ppr]) === true }
|
|
5206
5310
|
);
|
|
5207
5311
|
const pprBypassReason = renderingConfig.ppr ? this.getPPRShellBypassReason(req, middlewareMap, middlewareContext, pluginExposedContext) : void 0;
|
|
5208
5312
|
const islandsNavigationRequest = Boolean(
|
|
@@ -5213,7 +5317,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5213
5317
|
let pprShellOptions = canCachePPRShell ? {
|
|
5214
5318
|
pathname,
|
|
5215
5319
|
search: url.search,
|
|
5216
|
-
locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess',
|
|
5320
|
+
locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _156 => _156.locale]), () => ( "")),
|
|
5217
5321
|
origin: pprI18nSnapshot && pprI18nSnapshot.routing !== "none" ? url.origin : "",
|
|
5218
5322
|
revalidate: renderingConfig.revalidate
|
|
5219
5323
|
} : void 0;
|
|
@@ -5291,7 +5395,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5291
5395
|
const routeManifestEntry = routeManifest.routes.find(
|
|
5292
5396
|
(entry) => entry.pattern === route.pattern
|
|
5293
5397
|
);
|
|
5294
|
-
const moduleMetadata = routeManifestEntry ||
|
|
5398
|
+
const moduleMetadata = routeManifestEntry || _chunkEFI6QWBQcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
5295
5399
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
5296
5400
|
const renderedRouteSlots = await Promise.all(
|
|
5297
5401
|
routeSlots.map(async (slot) => {
|
|
@@ -5342,20 +5446,20 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5342
5446
|
if (moduleMetadata.suppressedAsyncHydration) {
|
|
5343
5447
|
warnSuppressedAsyncHydrationOnce(
|
|
5344
5448
|
route.modulePath,
|
|
5345
|
-
_optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5449
|
+
_optionalChain([routeManifestEntry, 'optionalAccess', _157 => _157.suppressedAsyncHydrationReason])
|
|
5346
5450
|
);
|
|
5347
5451
|
}
|
|
5348
5452
|
const layoutHydrationMetadata = layouts.map((layout) => {
|
|
5349
5453
|
const manifestEntry = routeManifest.layouts.find(
|
|
5350
5454
|
(entry) => entry.pattern === layout.pattern
|
|
5351
5455
|
);
|
|
5352
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
5456
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _158 => _158.suppressedAsyncHydration])) {
|
|
5353
5457
|
warnSuppressedAsyncHydrationOnce(
|
|
5354
5458
|
layout.modulePath,
|
|
5355
5459
|
manifestEntry.suppressedAsyncHydrationReason
|
|
5356
5460
|
);
|
|
5357
5461
|
}
|
|
5358
|
-
if (typeof _optionalChain([manifestEntry, 'optionalAccess',
|
|
5462
|
+
if (typeof _optionalChain([manifestEntry, 'optionalAccess', _159 => _159.shouldHydrate]) === "boolean") {
|
|
5359
5463
|
return {
|
|
5360
5464
|
isClientComponent: manifestEntry.isClientComponent === true,
|
|
5361
5465
|
shouldHydrate: manifestEntry.shouldHydrate,
|
|
@@ -5376,11 +5480,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5376
5480
|
const clientLayouts = layouts.map((layout, index) => ({
|
|
5377
5481
|
pattern: layout.pattern,
|
|
5378
5482
|
modulePath: _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, layout.modulePath, this.config.root),
|
|
5379
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5380
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
5381
|
-
..._optionalChain([layoutHydrationMetadata, 'access',
|
|
5483
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _160 => _160[index], 'optionalAccess', _161 => _161.shouldHydrate]) === true,
|
|
5484
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _162 => _162[index], 'optionalAccess', _163 => _163.islandStrategy]), () => ( null)),
|
|
5485
|
+
..._optionalChain([layoutHydrationMetadata, 'access', _164 => _164[index], 'optionalAccess', _165 => _165.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
|
|
5382
5486
|
// Islands mode: the browser rebuilds this layout from its tree, not its module.
|
|
5383
|
-
...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access',
|
|
5487
|
+
...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _166 => _166[index], 'optionalAccess', _167 => _167.serverTree]) === true ? { serverTree: true } : {}
|
|
5384
5488
|
}));
|
|
5385
5489
|
const hydrationStrategies = [
|
|
5386
5490
|
...shouldHydrate && moduleMetadata.islandStrategy ? [moduleMetadata.islandStrategy] : [],
|
|
@@ -5394,9 +5498,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5394
5498
|
layouts.map((layout, index) => ({
|
|
5395
5499
|
pattern: layout.pattern,
|
|
5396
5500
|
modulePath: layout.modulePath,
|
|
5397
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5398
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5399
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
5501
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _168 => _168[index], 'optionalAccess', _169 => _169.shouldHydrate]) === true,
|
|
5502
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _170 => _170[index], 'optionalAccess', _171 => _171.hasIsolatedClientBoundaries]) === true,
|
|
5503
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _172 => _172[index], 'optionalAccess', _173 => _173.islandStrategy]), () => ( null))
|
|
5400
5504
|
})),
|
|
5401
5505
|
this.config.root || process.cwd(),
|
|
5402
5506
|
true
|
|
@@ -5404,10 +5508,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5404
5508
|
const hasHydratableRouteSlots = renderedRouteSlots.some(
|
|
5405
5509
|
(slot) => slot.isClientComponent || slot.shouldHydrate
|
|
5406
5510
|
);
|
|
5407
|
-
const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5511
|
+
const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _174 => _174.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
|
|
5408
5512
|
req.__FARM_PAGE_PATH__ = route.modulePath;
|
|
5409
5513
|
req.__FARM_ROUTE__ = pathname;
|
|
5410
|
-
req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access',
|
|
5514
|
+
req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access', _175 => _175[0], 'optionalAccess', _176 => _176.modulePath]);
|
|
5411
5515
|
req.__FARM_IS_CLIENT_COMPONENT__ = isClientComponent;
|
|
5412
5516
|
req.__FARM_PAGE_SHOULD_HYDRATE__ = shouldHydrate;
|
|
5413
5517
|
req.__FARM_LAYOUT_SHOULD_HYDRATE__ = shouldHydrateLayout;
|
|
@@ -5418,7 +5522,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5418
5522
|
req.__FARM_SHOULD_HYDRATE__ = shouldHydrate || shouldHydrateLayout || hasIsolatedClientBoundaries;
|
|
5419
5523
|
req.__FARM_ISLAND_STRATEGY__ = hydrationIslandStrategy;
|
|
5420
5524
|
req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ = hasHydratableRouteSlots;
|
|
5421
|
-
req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess',
|
|
5525
|
+
req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _177 => _177.modulePath]) ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
|
|
5422
5526
|
req.__FARM_ROUTE_SLOTS__ = renderedRouteSlots.map((slot) => ({
|
|
5423
5527
|
name: slot.name,
|
|
5424
5528
|
ownerPattern: slot.ownerPattern,
|
|
@@ -5490,10 +5594,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5490
5594
|
} else if (shouldHydrateLayout && !(isClientComponent || shouldHydrate) && this.rendererRuntime.isolateServerPageGraph) {
|
|
5491
5595
|
pageElement = await this.isolateServerPage(
|
|
5492
5596
|
pageElement,
|
|
5493
|
-
_optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5597
|
+
_optionalChain([routeManifestEntry, 'optionalAccess', _178 => _178.serverTree]) === true
|
|
5494
5598
|
);
|
|
5495
5599
|
}
|
|
5496
|
-
pageElement = this.createPageBoundary(pageElement, {
|
|
5600
|
+
pageElement = await this.createPageBoundary(pageElement, {
|
|
5497
5601
|
pageShouldHydrate: isClientComponent || shouldHydrate,
|
|
5498
5602
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
5499
5603
|
islandStrategy: hydrationIslandStrategy
|
|
@@ -5505,7 +5609,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5505
5609
|
if (keptLayouts > 0 && !layouts.slice(0, keptLayouts).every((layout) => canFarmSkipKeptLayoutRender(layout.modulePath, keptRoot))) {
|
|
5506
5610
|
let keptElement = null;
|
|
5507
5611
|
for (let i = keptLayouts - 1; i >= 0; i--) {
|
|
5508
|
-
const KeptLayout = _optionalChain([layoutModules, 'access',
|
|
5612
|
+
const KeptLayout = _optionalChain([layoutModules, 'access', _179 => _179[i], 'optionalAccess', _180 => _180.default]);
|
|
5509
5613
|
if (KeptLayout) {
|
|
5510
5614
|
keptElement = this.rendererRuntime.createElement(KeptLayout, {
|
|
5511
5615
|
children: keptElement,
|
|
@@ -5542,7 +5646,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5542
5646
|
slot.module.default,
|
|
5543
5647
|
slot.props
|
|
5544
5648
|
);
|
|
5545
|
-
if (slot.shouldHydrate)
|
|
5649
|
+
if (slot.shouldHydrate) {
|
|
5650
|
+
slotElement = this.wrapClientGraph(
|
|
5651
|
+
await this.wrapIslandIntegrationProviders(slotElement)
|
|
5652
|
+
);
|
|
5653
|
+
}
|
|
5546
5654
|
slotElement = this.rendererRuntime.createElement(
|
|
5547
5655
|
"div",
|
|
5548
5656
|
{
|
|
@@ -5554,7 +5662,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5554
5662
|
);
|
|
5555
5663
|
slotProps[slot.name] = slotElement;
|
|
5556
5664
|
}
|
|
5557
|
-
wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access',
|
|
5665
|
+
wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _181 => _181[i], 'optionalAccess', _182 => _182.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
|
|
5558
5666
|
LayoutComponent,
|
|
5559
5667
|
{ params },
|
|
5560
5668
|
{ children: wrappedElement, ...slotProps },
|
|
@@ -5697,7 +5805,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5697
5805
|
}
|
|
5698
5806
|
}
|
|
5699
5807
|
emitFarmRenderError(req, pathname, error);
|
|
5700
|
-
const errorStatus =
|
|
5808
|
+
const errorStatus = _chunkNEKO3HM2cjs.resolveDefaultErrorStatus.call(void 0, error);
|
|
5701
5809
|
if (pprRefreshRoute) {
|
|
5702
5810
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5703
5811
|
type: "ppr.refresh.error",
|
|
@@ -5732,29 +5840,29 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5732
5840
|
}
|
|
5733
5841
|
await this.renderError(req, res, error, errorStatus);
|
|
5734
5842
|
} finally {
|
|
5735
|
-
_optionalChain([pprShellWrite, 'optionalAccess',
|
|
5843
|
+
_optionalChain([pprShellWrite, 'optionalAccess', _183 => _183.release, 'call', _184 => _184()]);
|
|
5736
5844
|
}
|
|
5737
5845
|
}
|
|
5738
5846
|
async wrapWithIntegrationProviders(element) {
|
|
5739
|
-
const providers =
|
|
5847
|
+
const providers = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, this.config.integrations);
|
|
5740
5848
|
let wrapped = element;
|
|
5741
5849
|
for (let i = providers.length - 1; i >= 0; i--) {
|
|
5742
5850
|
const provider = providers[i];
|
|
5743
5851
|
if (provider.component || provider.type === "clerk") {
|
|
5744
|
-
const rendererCapabilities =
|
|
5852
|
+
const rendererCapabilities = _chunkNGTZHWBGcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
|
|
5745
5853
|
if (!rendererCapabilities.functionComponents) {
|
|
5746
5854
|
throw new Error(
|
|
5747
|
-
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access',
|
|
5855
|
+
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _185 => _185.config, 'access', _186 => _186.renderer, 'optionalAccess', _187 => _187.name]), () => ( "the configured renderer"))}\` cannot.`
|
|
5748
5856
|
);
|
|
5749
5857
|
}
|
|
5750
|
-
if (provider.type === "clerk" && !
|
|
5858
|
+
if (provider.type === "clerk" && !_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer)) {
|
|
5751
5859
|
throw new Error(
|
|
5752
5860
|
`Integration provider \`${provider.name}\` uses Clerk's React components, which require the React renderer.`
|
|
5753
5861
|
);
|
|
5754
5862
|
}
|
|
5755
5863
|
let ProviderComponent;
|
|
5756
5864
|
let providerSourceModule;
|
|
5757
|
-
if (
|
|
5865
|
+
if (_chunkB3HQTGXScjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
5758
5866
|
providerSourceModule = provider.component.module;
|
|
5759
5867
|
const providerModuleId = provider.component.module.startsWith(".") ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0,
|
|
5760
5868
|
path10.resolve(this.config.root, provider.component.module),
|
|
@@ -5783,7 +5891,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5783
5891
|
}
|
|
5784
5892
|
if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
|
|
5785
5893
|
_nullishCoalesce(providerSourceModule, () => ( "")),
|
|
5786
|
-
|
|
5894
|
+
_chunkNGTZHWBGcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _188 => _188.config, 'access', _189 => _189.renderer, 'optionalAccess', _190 => _190.componentExtensions]))
|
|
5787
5895
|
)) {
|
|
5788
5896
|
ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
|
|
5789
5897
|
}
|
|
@@ -5912,7 +6020,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5912
6020
|
);
|
|
5913
6021
|
}
|
|
5914
6022
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5915
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6023
|
+
trustProxy: _optionalChain([this, 'access', _191 => _191.config, 'access', _192 => _192.server, 'optionalAccess', _193 => _193.trustProxy])
|
|
5916
6024
|
});
|
|
5917
6025
|
const url = new URL(request2.url);
|
|
5918
6026
|
const llmsContext = match.metadata.kind === "llms" || match.metadata.kind === "llms-full" ? await this.createLlmsTxtContext(request2, {
|
|
@@ -5930,7 +6038,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5930
6038
|
origin: await this.getAgentOrigin(request2),
|
|
5931
6039
|
readMarkdown: llmsContext.markdown
|
|
5932
6040
|
}) : value;
|
|
5933
|
-
const response =
|
|
6041
|
+
const response = _chunkNEKO3HM2cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
5934
6042
|
method,
|
|
5935
6043
|
request: request2
|
|
5936
6044
|
});
|
|
@@ -5948,7 +6056,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5948
6056
|
}
|
|
5949
6057
|
/** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
|
|
5950
6058
|
getGeneratedLlmsKind(pathname) {
|
|
5951
|
-
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access',
|
|
6059
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _194 => _194.config, 'access', _195 => _195.agent, 'optionalAccess', _196 => _196.llmsTxt]));
|
|
5952
6060
|
if (!config.enabled) return null;
|
|
5953
6061
|
if (pathname === "/llms.txt") return "llms";
|
|
5954
6062
|
return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
|
|
@@ -5956,9 +6064,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5956
6064
|
async renderGeneratedLlmsTxt(req, res, kind) {
|
|
5957
6065
|
try {
|
|
5958
6066
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5959
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6067
|
+
trustProxy: _optionalChain([this, 'access', _197 => _197.config, 'access', _198 => _198.server, 'optionalAccess', _199 => _199.trustProxy])
|
|
5960
6068
|
});
|
|
5961
|
-
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access',
|
|
6069
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _200 => _200.config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.llmsTxt]));
|
|
5962
6070
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
5963
6071
|
const body = kind === "llms-full" ? await _chunkOLKYHTLNcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
|
|
5964
6072
|
origin: await this.getAgentOrigin(request2),
|
|
@@ -5966,7 +6074,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5966
6074
|
}) : context.defaults;
|
|
5967
6075
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5968
6076
|
res,
|
|
5969
|
-
|
|
6077
|
+
_chunkNEKO3HM2cjs.createFarmMetadataRouteResponse.call(void 0,
|
|
5970
6078
|
kind,
|
|
5971
6079
|
body,
|
|
5972
6080
|
{ revalidate: config.revalidate },
|
|
@@ -5985,23 +6093,23 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5985
6093
|
}
|
|
5986
6094
|
}
|
|
5987
6095
|
getAgentCrawlers() {
|
|
5988
|
-
return
|
|
6096
|
+
return _chunkEACD6ND7cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _203 => _203.config, 'access', _204 => _204.agent, 'optionalAccess', _205 => _205.crawlers]));
|
|
5989
6097
|
}
|
|
5990
6098
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
5991
6099
|
async renderGeneratedRobotsTxt(req, res) {
|
|
5992
6100
|
try {
|
|
5993
|
-
const sitemapPath = _optionalChain([this, 'access',
|
|
6101
|
+
const sitemapPath = _optionalChain([this, 'access', _206 => _206.routeManager, 'access', _207 => _207.matchMetadataRoute, 'call', _208 => _208("/sitemap.xml"), 'optionalAccess', _209 => _209.metadata, 'access', _210 => _210.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
|
|
5994
6102
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5995
6103
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5996
|
-
const robots =
|
|
6104
|
+
const robots = _chunkEACD6ND7cjs.createFarmAgentRobots.call(void 0, {
|
|
5997
6105
|
crawlers: this.getAgentCrawlers(),
|
|
5998
6106
|
sitemapPath,
|
|
5999
|
-
metadataBase: _optionalChain([rootMetadata, 'optionalAccess',
|
|
6107
|
+
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _211 => _211.metadataBase]),
|
|
6000
6108
|
basePath: this.config.basePath
|
|
6001
6109
|
});
|
|
6002
6110
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6003
6111
|
res,
|
|
6004
|
-
|
|
6112
|
+
_chunkNEKO3HM2cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
6005
6113
|
);
|
|
6006
6114
|
} catch (error) {
|
|
6007
6115
|
_chunk7U4XF76Rcjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
@@ -6015,13 +6123,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6015
6123
|
}
|
|
6016
6124
|
}
|
|
6017
6125
|
getAgentSitemap() {
|
|
6018
|
-
return
|
|
6126
|
+
return _chunkEACD6ND7cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _212 => _212.config, 'access', _213 => _213.agent, 'optionalAccess', _214 => _214.sitemap]));
|
|
6019
6127
|
}
|
|
6020
6128
|
/** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
|
|
6021
6129
|
async renderGeneratedSitemap(req, res) {
|
|
6022
6130
|
try {
|
|
6023
6131
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6024
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6132
|
+
trustProxy: _optionalChain([this, 'access', _215 => _215.config, 'access', _216 => _216.server, 'optionalAccess', _217 => _217.trustProxy])
|
|
6025
6133
|
});
|
|
6026
6134
|
const sources = await Promise.all(
|
|
6027
6135
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -6032,26 +6140,26 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6032
6140
|
}),
|
|
6033
6141
|
fs7.promises.stat(route.modulePath).catch(() => void 0)
|
|
6034
6142
|
]);
|
|
6035
|
-
if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess',
|
|
6036
|
-
return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess',
|
|
6143
|
+
if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _218 => _218.metadata]))) return null;
|
|
6144
|
+
return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _219 => _219.mtime, 'access', _220 => _220.toISOString, 'call', _221 => _221()]) };
|
|
6037
6145
|
})
|
|
6038
6146
|
);
|
|
6039
6147
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6040
6148
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6041
|
-
const sitemap =
|
|
6149
|
+
const sitemap = _chunkEACD6ND7cjs.createFarmDefaultSitemap.call(void 0,
|
|
6042
6150
|
sources.filter((source) => source !== null),
|
|
6043
6151
|
{
|
|
6044
6152
|
origin: new URL(request2.url).origin,
|
|
6045
6153
|
config: this.getAgentSitemap(),
|
|
6046
|
-
metadataBase: _optionalChain([rootMetadata, 'optionalAccess',
|
|
6154
|
+
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _222 => _222.metadataBase]),
|
|
6047
6155
|
basePath: this.config.basePath,
|
|
6048
6156
|
trailingSlash: this.config.trailingSlash,
|
|
6049
|
-
i18n: _optionalChain([this, 'access',
|
|
6157
|
+
i18n: _optionalChain([this, 'access', _223 => _223.i18nRuntime, 'optionalAccess', _224 => _224.config])
|
|
6050
6158
|
}
|
|
6051
6159
|
);
|
|
6052
6160
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6053
6161
|
res,
|
|
6054
|
-
|
|
6162
|
+
_chunkNEKO3HM2cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
|
|
6055
6163
|
);
|
|
6056
6164
|
} catch (error) {
|
|
6057
6165
|
_chunk7U4XF76Rcjs.logger.error(`Generated sitemap.xml failed: ${error}`);
|
|
@@ -6078,9 +6186,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6078
6186
|
* matcher) covers, as the production build decides.
|
|
6079
6187
|
*/
|
|
6080
6188
|
getAgentListedRoutes() {
|
|
6081
|
-
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access',
|
|
6189
|
+
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _225 => _225.middlewareRoutes, 'optionalCall', _226 => _226()]), () => ( [])) };
|
|
6082
6190
|
return [...this.routeManager.getRoutes()].filter(
|
|
6083
|
-
([pattern]) => !pattern.includes("[") && !
|
|
6191
|
+
([pattern]) => !pattern.includes("[") && !_chunkNEKO3HM2cjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
|
|
6084
6192
|
);
|
|
6085
6193
|
}
|
|
6086
6194
|
/**
|
|
@@ -6104,22 +6212,22 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6104
6212
|
* or a registered server such as the docs engine's. Production applies the same rules.
|
|
6105
6213
|
*/
|
|
6106
6214
|
getDefaultMCPServer() {
|
|
6107
|
-
if (_optionalChain([this, 'access',
|
|
6108
|
-
if (_optionalChain([this, 'access',
|
|
6215
|
+
if (_optionalChain([this, 'access', _227 => _227.config, 'access', _228 => _228.agent, 'optionalAccess', _229 => _229.mcp]) !== true || _chunkW53Z4WDIcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
|
|
6216
|
+
if (_optionalChain([this, 'access', _230 => _230.apiRouteExists, 'optionalCall', _231 => _231("/api/mcp")])) return void 0;
|
|
6109
6217
|
if (this.routeManager.matchRoute(_chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
6110
6218
|
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0,
|
|
6111
6219
|
readAppPackageIdentity(this.config.root),
|
|
6112
|
-
|
|
6220
|
+
_chunk3CZ4MJHWcjs.FARM_VERSION
|
|
6113
6221
|
))));
|
|
6114
6222
|
return _chunkW53Z4WDIcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
6115
6223
|
}
|
|
6116
6224
|
async renderDefaultMCP(req, res) {
|
|
6117
6225
|
const server = this.getDefaultMCPServer();
|
|
6118
|
-
const request2 = _nullishCoalesce(_chunk2RSVYJT6cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
6226
|
+
const request2 = _nullishCoalesce(_chunk2RSVYJT6cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _232 => _232.config, 'access', _233 => _233.server, 'optionalAccess', _234 => _234.trustProxy]) })));
|
|
6119
6227
|
try {
|
|
6120
6228
|
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-IUL6OPC3.cjs");
|
|
6121
6229
|
const origin = new URL(request2.url).origin;
|
|
6122
|
-
const i18n = _optionalChain([this, 'access',
|
|
6230
|
+
const i18n = _optionalChain([this, 'access', _235 => _235.i18nRuntime, 'optionalAccess', _236 => _236.config]);
|
|
6123
6231
|
const metadataBase = await this.getRootMetadataBase();
|
|
6124
6232
|
const response = await handleFarmDefaultMCPRequest(request2, {
|
|
6125
6233
|
server,
|
|
@@ -6167,7 +6275,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6167
6275
|
}
|
|
6168
6276
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
6169
6277
|
async createLlmsTxtContext(request2, options = {}) {
|
|
6170
|
-
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access',
|
|
6278
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _237 => _237.config, 'access', _238 => _238.agent, 'optionalAccess', _239 => _239.llmsTxt]));
|
|
6171
6279
|
const origin = await this.getAgentOrigin(request2);
|
|
6172
6280
|
const sources = await Promise.all(
|
|
6173
6281
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -6193,7 +6301,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6193
6301
|
include: config.include,
|
|
6194
6302
|
exclude: config.exclude,
|
|
6195
6303
|
trailingSlash: this.config.trailingSlash,
|
|
6196
|
-
i18n: _optionalChain([this, 'access',
|
|
6304
|
+
i18n: _optionalChain([this, 'access', _240 => _240.i18nRuntime, 'optionalAccess', _241 => _241.config])
|
|
6197
6305
|
}
|
|
6198
6306
|
);
|
|
6199
6307
|
return {
|
|
@@ -6203,7 +6311,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6203
6311
|
pages,
|
|
6204
6312
|
config,
|
|
6205
6313
|
rootMetadata,
|
|
6206
|
-
mcp: _optionalChain([this, 'access',
|
|
6314
|
+
mcp: _optionalChain([this, 'access', _242 => _242.config, 'access', _243 => _243.agent, 'optionalAccess', _244 => _244.aiCatalog]) === false ? [] : _chunkWCSBYQOTcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
6207
6315
|
basePath: this.config.basePath,
|
|
6208
6316
|
apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
6209
6317
|
_chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
|
|
@@ -6233,7 +6341,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6233
6341
|
async getRootMetadataBase() {
|
|
6234
6342
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6235
6343
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6236
|
-
return _optionalChain([rootMetadata, 'optionalAccess',
|
|
6344
|
+
return _optionalChain([rootMetadata, 'optionalAccess', _245 => _245.metadataBase]);
|
|
6237
6345
|
}
|
|
6238
6346
|
/**
|
|
6239
6347
|
* Reads page mirrors back through this dev server, the way its .md handler
|
|
@@ -6245,8 +6353,8 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6245
6353
|
* body is discarded.
|
|
6246
6354
|
*/
|
|
6247
6355
|
createDevMarkdownReader(req) {
|
|
6248
|
-
const socket = _optionalChain([req, 'optionalAccess',
|
|
6249
|
-
if (_optionalChain([req, 'optionalAccess',
|
|
6356
|
+
const socket = _optionalChain([req, 'optionalAccess', _246 => _246.socket]);
|
|
6357
|
+
if (_optionalChain([req, 'optionalAccess', _247 => _247.method, 'optionalAccess', _248 => _248.toUpperCase, 'call', _249 => _249()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _250 => _250.localAddress]) || !socket.localPort) {
|
|
6250
6358
|
return async () => null;
|
|
6251
6359
|
}
|
|
6252
6360
|
if (socket.encrypted) {
|
|
@@ -6294,7 +6402,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6294
6402
|
renderer: this.getMetadataImageRenderer(),
|
|
6295
6403
|
component: isRendererCompiledComponent(
|
|
6296
6404
|
options.image.modulePath,
|
|
6297
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
6405
|
+
_nullishCoalesce(_optionalChain([this, 'access', _251 => _251.config, 'access', _252 => _252.renderer, 'optionalAccess', _253 => _253.componentExtensions]), () => ( []))
|
|
6298
6406
|
)
|
|
6299
6407
|
});
|
|
6300
6408
|
await this.writeMetadataImageResponse(req, res, handlerResult, imageModule);
|
|
@@ -6310,7 +6418,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6310
6418
|
}
|
|
6311
6419
|
/** The renderer that draws a metadata image: none for React, whose elements Satori reads directly. */
|
|
6312
6420
|
getMetadataImageRenderer() {
|
|
6313
|
-
return
|
|
6421
|
+
return _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime;
|
|
6314
6422
|
}
|
|
6315
6423
|
async writeStaticMetadataImageResponse(req, res, image) {
|
|
6316
6424
|
const method = (req.method || "GET").toUpperCase();
|
|
@@ -6322,7 +6430,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6322
6430
|
}
|
|
6323
6431
|
const etag = `"${image.staticInfo.hash}"`;
|
|
6324
6432
|
const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6325
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6433
|
+
trustProxy: _optionalChain([this, 'access', _254 => _254.config, 'access', _255 => _255.server, 'optionalAccess', _256 => _256.trustProxy])
|
|
6326
6434
|
});
|
|
6327
6435
|
const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
|
|
6328
6436
|
res.setHeader("Content-Type", image.staticInfo.contentType);
|
|
@@ -6373,7 +6481,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6373
6481
|
});
|
|
6374
6482
|
let wrapped = errorElement;
|
|
6375
6483
|
const boundaryLayouts = options.errorPattern === void 0 ? options.layouts : options.layouts.filter(
|
|
6376
|
-
(layout) => !("pattern" in layout) ||
|
|
6484
|
+
(layout) => !("pattern" in layout) || _chunkNEKO3HM2cjs.routeBoundaryCoversDirectory.call(void 0,
|
|
6377
6485
|
layout.pattern,
|
|
6378
6486
|
options.errorPattern
|
|
6379
6487
|
)
|
|
@@ -6416,6 +6524,21 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6416
6524
|
return false;
|
|
6417
6525
|
}
|
|
6418
6526
|
}
|
|
6527
|
+
/**
|
|
6528
|
+
* Islands mode: a page whose route hydrates nothing as a root hydrates only islands, which hold
|
|
6529
|
+
* their own clicks, so nothing else on it is held, as in production.
|
|
6530
|
+
*/
|
|
6531
|
+
isIslandsOnlyPage(req) {
|
|
6532
|
+
return this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
|
|
6533
|
+
}
|
|
6534
|
+
/**
|
|
6535
|
+
* The head script that holds a page's clicks and submits until it hydrates, which the client
|
|
6536
|
+
* replays once it has. Production writes it into the same pages, streamed or buffered.
|
|
6537
|
+
*/
|
|
6538
|
+
renderPreHydrationHold(req, bootClient) {
|
|
6539
|
+
const hydrates = req.__FARM_IS_CLIENT_COMPONENT__ === true || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true;
|
|
6540
|
+
return hydrates && !bootClient && !this.isIslandsOnlyPage(req) ? _chunkNEKO3HM2cjs.createPreHydrationClickQueueScript.call(void 0, ) : "";
|
|
6541
|
+
}
|
|
6419
6542
|
async renderBufferedSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6420
6543
|
const startedAt = Date.now();
|
|
6421
6544
|
const route = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
@@ -6457,22 +6580,23 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
|
|
|
6457
6580
|
window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
|
|
6458
6581
|
window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
|
|
6459
6582
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
6460
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6583
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkB3HQTGXScjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6461
6584
|
window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
6462
6585
|
</script>`);
|
|
6463
6586
|
const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
|
|
6464
6587
|
const rendererHydrationScript = farmScripts(
|
|
6465
|
-
_optionalChain([this, 'access',
|
|
6588
|
+
_optionalChain([this, 'access', _257 => _257.rendererRuntime, 'access', _258 => _258.generateHydrationScript, 'optionalCall', _259 => _259()]) || ""
|
|
6466
6589
|
);
|
|
6467
6590
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
6468
6591
|
const farmClientScript = farmScripts(
|
|
6469
6592
|
`<script type="module" src="/@farm/client.js"></script>`
|
|
6470
6593
|
);
|
|
6594
|
+
const holdScript = farmScripts(this.renderPreHydrationHold(req, false));
|
|
6471
6595
|
const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
|
|
6472
6596
|
element,
|
|
6473
6597
|
{
|
|
6474
6598
|
rejectLateNavigation: _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0,
|
|
6475
|
-
_optionalChain([req, 'access',
|
|
6599
|
+
_optionalChain([req, 'access', _260 => _260.headers, 'optionalAccess', _261 => _261[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
|
|
6476
6600
|
)
|
|
6477
6601
|
}
|
|
6478
6602
|
);
|
|
@@ -6484,7 +6608,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6484
6608
|
viewport: viewportTags
|
|
6485
6609
|
} = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6486
6610
|
pathname: getFarmMetadataPathname(req),
|
|
6487
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6611
|
+
jsonLd: _optionalChain([this, 'access', _262 => _262.config, 'access', _263 => _263.agent, 'optionalAccess', _264 => _264.jsonLd])
|
|
6488
6612
|
});
|
|
6489
6613
|
const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
6490
6614
|
const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
|
|
@@ -6494,19 +6618,19 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6494
6618
|
i18nSnapshot,
|
|
6495
6619
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6496
6620
|
) : "";
|
|
6497
|
-
const themeDocument =
|
|
6621
|
+
const themeDocument = _chunkNEKO3HM2cjs.createFarmThemeDocumentParts.call(void 0,
|
|
6498
6622
|
this.config.theme,
|
|
6499
6623
|
this.config.basePath,
|
|
6500
6624
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
6501
6625
|
);
|
|
6502
6626
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
6503
|
-
const fullDocument =
|
|
6627
|
+
const fullDocument = _chunkNEKO3HM2cjs.extractFarmFullDocument.call(void 0, _chunkNEKO3HM2cjs.markFarmDocumentLayouts.call(void 0, content));
|
|
6504
6628
|
let html;
|
|
6505
6629
|
if (fullDocument) {
|
|
6506
6630
|
const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
|
|
6507
|
-
const documentHtml = shouldReplaceLayoutTitle ?
|
|
6508
|
-
const effectiveRendererHead = hasExplicitTitle ?
|
|
6509
|
-
html =
|
|
6631
|
+
const documentHtml = shouldReplaceLayoutTitle ? _chunkNEKO3HM2cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
|
|
6632
|
+
const effectiveRendererHead = hasExplicitTitle ? _chunkNEKO3HM2cjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
|
|
6633
|
+
html = _chunkNEKO3HM2cjs.composeFarmFullDocument.call(void 0, documentHtml, {
|
|
6510
6634
|
fallbackIcon: !hasFavicon,
|
|
6511
6635
|
viewport: viewportTags,
|
|
6512
6636
|
htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
|
|
@@ -6526,13 +6650,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6526
6650
|
...this.collectDevStyleLinks(),
|
|
6527
6651
|
viteClientScript,
|
|
6528
6652
|
rendererHydrationScript,
|
|
6529
|
-
bootstrapScript
|
|
6653
|
+
bootstrapScript,
|
|
6654
|
+
holdScript
|
|
6530
6655
|
].filter(Boolean).join("\n "),
|
|
6531
6656
|
bodyFooter: [deferredScript, farmClientScript].filter(Boolean).join("\n ")
|
|
6532
6657
|
});
|
|
6533
6658
|
} else {
|
|
6534
6659
|
html = `<!DOCTYPE html>
|
|
6535
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6660
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _265 => _265.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6536
6661
|
<head>
|
|
6537
6662
|
${themeDocument.head}
|
|
6538
6663
|
<meta charset="utf-8">
|
|
@@ -6546,7 +6671,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6546
6671
|
${l}`).join("")}
|
|
6547
6672
|
${viteClientScript}
|
|
6548
6673
|
${rendererHydrationScript}
|
|
6549
|
-
${bootstrapScript}
|
|
6674
|
+
${bootstrapScript}${holdScript ? `
|
|
6675
|
+
${holdScript}` : ""}
|
|
6550
6676
|
</head>
|
|
6551
6677
|
<body class="">
|
|
6552
6678
|
<div id="root">${content}</div>
|
|
@@ -6563,7 +6689,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6563
6689
|
const securedHtml = this.secureDocumentHTML(req, html);
|
|
6564
6690
|
if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
|
|
6565
6691
|
res.end();
|
|
6566
|
-
if (!options.captureStaticShell) await _optionalChain([options, 'access',
|
|
6692
|
+
if (!options.captureStaticShell) await _optionalChain([options, 'access', _266 => _266.onComplete, 'optionalCall', _267 => _267(securedHtml)]);
|
|
6567
6693
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
6568
6694
|
type: "render.stream.complete",
|
|
6569
6695
|
route,
|
|
@@ -6573,7 +6699,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6573
6699
|
emitFarmRenderError(req, route, error);
|
|
6574
6700
|
throw error;
|
|
6575
6701
|
} finally {
|
|
6576
|
-
_optionalChain([clearMiddlewareData, 'optionalCall',
|
|
6702
|
+
_optionalChain([clearMiddlewareData, 'optionalCall', _268 => _268()]);
|
|
6577
6703
|
}
|
|
6578
6704
|
}
|
|
6579
6705
|
/**
|
|
@@ -6583,11 +6709,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6583
6709
|
* call (async, a class, or one using hooks) falls back to detection from the stream.
|
|
6584
6710
|
*/
|
|
6585
6711
|
async rootLayoutRendersDocument(req) {
|
|
6586
|
-
const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access',
|
|
6712
|
+
const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access', _269 => _269.routeManager, 'access', _270 => _270.getLayouts, 'call', _271 => _271(), 'access', _272 => _272.get, 'call', _273 => _273("/"), 'optionalAccess', _274 => _274.modulePath]) : void 0)));
|
|
6587
6713
|
if (!modulePath) return false;
|
|
6588
6714
|
try {
|
|
6589
6715
|
const Layout = (await this.routeManager.loadLayoutModule(modulePath)).default;
|
|
6590
|
-
if (typeof Layout !== "function" || _optionalChain([Layout, 'access',
|
|
6716
|
+
if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _275 => _275.prototype, 'optionalAccess', _276 => _276.isReactComponent]) || _optionalChain([Layout, 'access', _277 => _277.constructor, 'optionalAccess', _278 => _278.name]) === "AsyncFunction") {
|
|
6591
6717
|
return false;
|
|
6592
6718
|
}
|
|
6593
6719
|
const cached = documentLayouts.get(Layout);
|
|
@@ -6610,10 +6736,10 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6610
6736
|
}
|
|
6611
6737
|
async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6612
6738
|
const runtime = this.rendererRuntime;
|
|
6613
|
-
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (
|
|
6739
|
+
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (_chunkNGTZHWBGcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node").web && runtime.renderToReadableStream ? pipeFarmRendererWebStream(runtime) : void 0)));
|
|
6614
6740
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6615
6741
|
const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument(req);
|
|
6616
|
-
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access',
|
|
6742
|
+
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _279 => _279.headers, 'optionalAccess', _280 => _280[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer))) {
|
|
6617
6743
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
6618
6744
|
}
|
|
6619
6745
|
return new Promise((resolve3, reject) => {
|
|
@@ -6683,14 +6809,15 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
|
|
|
6683
6809
|
req.__FARM_LOADING_MODULE_PATH__ || null
|
|
6684
6810
|
)};
|
|
6685
6811
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
6686
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6812
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkB3HQTGXScjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6687
6813
|
window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
6688
6814
|
</script>${_chunkOZUINP2Pcjs.renderFarmFormStateScript.call(void 0, )}`;
|
|
6689
|
-
const islandsOnlyPage = this.
|
|
6815
|
+
const islandsOnlyPage = this.isIslandsOnlyPage(req);
|
|
6690
6816
|
const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
|
|
6691
6817
|
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;
|
|
6692
6818
|
const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts && _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ) !== "mobile" && canBootFarmIslandsClient(this.config);
|
|
6693
|
-
const hydrationClickQueueScript =
|
|
6819
|
+
const hydrationClickQueueScript = this.renderPreHydrationHold(req, bootClient);
|
|
6820
|
+
const rendererHydrationScript = _optionalChain([this, 'access', _281 => _281.rendererRuntime, 'access', _282 => _282.generateHydrationScript, 'optionalCall', _283 => _283()]) || "";
|
|
6694
6821
|
const {
|
|
6695
6822
|
title,
|
|
6696
6823
|
tags: metaTags,
|
|
@@ -6699,7 +6826,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6699
6826
|
viewport: viewportTags
|
|
6700
6827
|
} = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6701
6828
|
pathname: getFarmMetadataPathname(req),
|
|
6702
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6829
|
+
jsonLd: _optionalChain([this, 'access', _284 => _284.config, 'access', _285 => _285.agent, 'optionalAccess', _286 => _286.jsonLd])
|
|
6703
6830
|
});
|
|
6704
6831
|
const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6705
6832
|
const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -6708,7 +6835,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6708
6835
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6709
6836
|
) : "";
|
|
6710
6837
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6711
|
-
const themeDocument =
|
|
6838
|
+
const themeDocument = _chunkNEKO3HM2cjs.createFarmThemeDocumentParts.call(void 0,
|
|
6712
6839
|
this.config.theme,
|
|
6713
6840
|
this.config.basePath,
|
|
6714
6841
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
@@ -6727,7 +6854,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6727
6854
|
formState: _chunkOZUINP2Pcjs.getFarmFormState.call(void 0, ),
|
|
6728
6855
|
onShellReady() {
|
|
6729
6856
|
if (pendingNavigationError) {
|
|
6730
|
-
_optionalChain([abort, 'optionalCall',
|
|
6857
|
+
_optionalChain([abort, 'optionalCall', _287 => _287(pendingNavigationError)]);
|
|
6731
6858
|
if (clearMiddlewareData) {
|
|
6732
6859
|
clearMiddlewareData();
|
|
6733
6860
|
}
|
|
@@ -6745,7 +6872,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6745
6872
|
console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
|
|
6746
6873
|
}
|
|
6747
6874
|
const shell = `<!DOCTYPE html>
|
|
6748
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6875
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _288 => _288.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6749
6876
|
<head>
|
|
6750
6877
|
${themeDocument.head}
|
|
6751
6878
|
<meta charset="utf-8">
|
|
@@ -6756,7 +6883,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6756
6883
|
${fontHead}
|
|
6757
6884
|
${globalStylesheetLink}${devStyleLinks.map((l) => `
|
|
6758
6885
|
${l}`).join("")}
|
|
6759
|
-
<script type="module" src="/@vite/client"></script
|
|
6886
|
+
<script type="module" src="/@vite/client"></script>${rendererHydrationScript ? `
|
|
6887
|
+
${rendererHydrationScript}` : ""}
|
|
6760
6888
|
${propsScript}
|
|
6761
6889
|
${hydrationClickQueueScript}
|
|
6762
6890
|
</head>
|
|
@@ -6766,14 +6894,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6766
6894
|
let pendingShell = streamDocument ? "" : stampDocumentHTML(shell);
|
|
6767
6895
|
let heldHead = "";
|
|
6768
6896
|
const releaseShell = (complete) => {
|
|
6769
|
-
const split =
|
|
6897
|
+
const split = _chunkNEKO3HM2cjs.takeFarmHoistedHead.call(void 0, heldHead, complete);
|
|
6770
6898
|
if (!split) return null;
|
|
6771
|
-
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ?
|
|
6772
|
-
const opened =
|
|
6899
|
+
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? _chunkNEKO3HM2cjs.removeFarmDocumentTitles.call(void 0, pendingShell) : pendingShell;
|
|
6900
|
+
const opened = _chunkNEKO3HM2cjs.appendFarmHead.call(void 0, shellHead, split.head);
|
|
6773
6901
|
pendingShell = "";
|
|
6774
6902
|
heldHead = "";
|
|
6775
6903
|
htmlParts.push(opened);
|
|
6776
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
6904
|
+
_optionalChain([staticShellParts, 'optionalAccess', _289 => _289.push, 'call', _290 => _290(opened)]);
|
|
6777
6905
|
res.write(opened);
|
|
6778
6906
|
return split.body;
|
|
6779
6907
|
};
|
|
@@ -6785,11 +6913,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6785
6913
|
${stampDocumentHTML(earlyClientScript)}`
|
|
6786
6914
|
)
|
|
6787
6915
|
} : document;
|
|
6788
|
-
const documentTransform = streamDocument ?
|
|
6916
|
+
const documentTransform = streamDocument ? _chunkNEKO3HM2cjs.createFarmStreamedDocumentTransform.call(void 0,
|
|
6789
6917
|
(opening) => withEarlyClient(
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
hasExplicitTitle ?
|
|
6918
|
+
_chunkNEKO3HM2cjs.openFarmStreamedDocument.call(void 0,
|
|
6919
|
+
_chunkNEKO3HM2cjs.markFarmDocumentLayouts.call(void 0,
|
|
6920
|
+
hasExplicitTitle ? _chunkNEKO3HM2cjs.removeFarmDocumentTitles.call(void 0, opening) : opening
|
|
6793
6921
|
),
|
|
6794
6922
|
{
|
|
6795
6923
|
fallbackIcon: !hasFavicon,
|
|
@@ -6810,6 +6938,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6810
6938
|
globalStylesheetLink,
|
|
6811
6939
|
...devStyleLinks,
|
|
6812
6940
|
`<script type="module" src="/@vite/client"></script>`,
|
|
6941
|
+
rendererHydrationScript,
|
|
6813
6942
|
propsScript,
|
|
6814
6943
|
hydrationClickQueueScript
|
|
6815
6944
|
].filter(Boolean).join("\n ")
|
|
@@ -6829,7 +6958,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6829
6958
|
const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
|
|
6830
6959
|
if (!checkedFullDocument && renderedText) {
|
|
6831
6960
|
documentPrefix += renderedText;
|
|
6832
|
-
const prefix =
|
|
6961
|
+
const prefix = _chunkNEKO3HM2cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
|
|
6833
6962
|
if (prefix !== "pending") {
|
|
6834
6963
|
checkedFullDocument = true;
|
|
6835
6964
|
documentPrefix = "";
|
|
@@ -6848,7 +6977,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6848
6977
|
staticShellClosed = true;
|
|
6849
6978
|
if (!suspenseHoleEmitted) {
|
|
6850
6979
|
suspenseHoleEmitted = true;
|
|
6851
|
-
_optionalChain([options, 'access',
|
|
6980
|
+
_optionalChain([options, 'access', _291 => _291.onSuspenseHoleDetected, 'optionalCall', _292 => _292()]);
|
|
6852
6981
|
}
|
|
6853
6982
|
} else {
|
|
6854
6983
|
staticShellParts.push(chunkText);
|
|
@@ -6900,7 +7029,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6900
7029
|
const body = releaseShell(true);
|
|
6901
7030
|
if (body) {
|
|
6902
7031
|
htmlParts.push(body);
|
|
6903
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
7032
|
+
_optionalChain([staticShellParts, 'optionalAccess', _293 => _293.push, 'call', _294 => _294(body)]);
|
|
6904
7033
|
res.write(body);
|
|
6905
7034
|
}
|
|
6906
7035
|
}
|
|
@@ -6932,8 +7061,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6932
7061
|
recordRenderedChunk(tail, rewritten);
|
|
6933
7062
|
if (tail) res.write(tail);
|
|
6934
7063
|
}
|
|
6935
|
-
const documentEnd = _optionalChain([documentTransform, 'optionalAccess',
|
|
6936
|
-
if (_optionalChain([documentEnd, 'optionalAccess',
|
|
7064
|
+
const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _295 => _295.end, 'call', _296 => _296()]);
|
|
7065
|
+
if (_optionalChain([documentEnd, 'optionalAccess', _297 => _297.text])) {
|
|
6937
7066
|
recordRenderedChunk(documentEnd.text, "");
|
|
6938
7067
|
res.write(documentEnd.text);
|
|
6939
7068
|
}
|
|
@@ -6944,7 +7073,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6944
7073
|
deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
|
|
6945
7074
|
earlyClient,
|
|
6946
7075
|
// A full document: Farm's #root closes only where Farm opened it.
|
|
6947
|
-
..._optionalChain([documentEnd, 'optionalAccess',
|
|
7076
|
+
..._optionalChain([documentEnd, 'optionalAccess', _298 => _298.document]) ? { closeRoot: documentEnd.rootOpened } : {}
|
|
6948
7077
|
})
|
|
6949
7078
|
);
|
|
6950
7079
|
htmlParts.push(footer);
|
|
@@ -7046,17 +7175,25 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7046
7175
|
const snapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
7047
7176
|
return snapshot && url.startsWith("/") && !url.startsWith("//") ? _chunkGYJT2U7Jcjs.localizeFarmHref.call(void 0, url, snapshot.locale, snapshot) : url;
|
|
7048
7177
|
}
|
|
7178
|
+
/**
|
|
7179
|
+
* The not-found page the renderer's `routes()` mapped, or undefined when the renderer has no route
|
|
7180
|
+
* rules and the not-found lookup scans `src/app` as before.
|
|
7181
|
+
*/
|
|
7182
|
+
getRendererNotFoundPath() {
|
|
7183
|
+
return _optionalChain([this, 'access', _299 => _299.config, 'access', _300 => _300.renderer, 'optionalAccess', _301 => _301.routes]) ? this.routeManager.getRendererNotFoundPath() : void 0;
|
|
7184
|
+
}
|
|
7049
7185
|
/** The app's not-found component, or null when it relies on the built-in page. */
|
|
7050
7186
|
async loadNotFoundModule() {
|
|
7051
7187
|
const notFoundPath = resolveFarmNotFoundComponentPath(
|
|
7052
7188
|
this.config,
|
|
7053
|
-
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config)
|
|
7189
|
+
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config),
|
|
7190
|
+
this.getRendererNotFoundPath()
|
|
7054
7191
|
);
|
|
7055
7192
|
if (!notFoundPath) return null;
|
|
7056
7193
|
return await this.routeManager.loadRouteModule(notFoundPath);
|
|
7057
7194
|
}
|
|
7058
7195
|
async loadNotFoundComponent() {
|
|
7059
|
-
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async
|
|
7196
|
+
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _302 => _302.default]), async () => ( null));
|
|
7060
7197
|
}
|
|
7061
7198
|
/** The not-found document's head: layout and not-found metadata, as production renders it. */
|
|
7062
7199
|
async notFoundMetadataHead(layoutModule, notFoundModule) {
|
|
@@ -7079,13 +7216,13 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7079
7216
|
*/
|
|
7080
7217
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
7081
7218
|
if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
|
|
7082
|
-
return
|
|
7219
|
+
return _chunkNEKO3HM2cjs.createLateRedirectRecovery.call(void 0,
|
|
7083
7220
|
this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
|
|
7084
7221
|
this.getCspNonce(req) || ""
|
|
7085
7222
|
);
|
|
7086
7223
|
}
|
|
7087
7224
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7088
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7225
|
+
trustProxy: _optionalChain([this, 'access', _303 => _303.config, 'access', _304 => _304.server, 'optionalAccess', _305 => _305.trustProxy])
|
|
7089
7226
|
}).pathname;
|
|
7090
7227
|
let content = this.defaultNotFoundContent();
|
|
7091
7228
|
const NotFoundComponent = await this.loadNotFoundComponent();
|
|
@@ -7100,14 +7237,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7100
7237
|
_chunk7U4XF76Rcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
7101
7238
|
}
|
|
7102
7239
|
}
|
|
7103
|
-
return
|
|
7240
|
+
return _chunkNEKO3HM2cjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
|
|
7104
7241
|
}
|
|
7105
7242
|
async render404(req, res) {
|
|
7106
7243
|
res.statusCode = 404;
|
|
7107
7244
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7108
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7245
|
+
trustProxy: _optionalChain([this, 'access', _306 => _306.config, 'access', _307 => _307.server, 'optionalAccess', _308 => _308.trustProxy])
|
|
7109
7246
|
}).pathname;
|
|
7110
|
-
if (
|
|
7247
|
+
if (_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7111
7248
|
res.setHeader("Content-Type", "application/json");
|
|
7112
7249
|
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
7113
7250
|
return;
|
|
@@ -7130,11 +7267,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7130
7267
|
return;
|
|
7131
7268
|
}
|
|
7132
7269
|
const appDir = path10.join(this.config.root, this.config.srcDir, "app");
|
|
7133
|
-
const notFoundExtensions =
|
|
7270
|
+
const notFoundExtensions = _chunkNGTZHWBGcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7134
7271
|
let layoutModule = null;
|
|
7272
|
+
const rendererRootLayout = _optionalChain([this, 'access', _309 => _309.config, 'access', _310 => _310.renderer, 'optionalAccess', _311 => _311.routes]) ? _optionalChain([this, 'access', _312 => _312.routeManager, 'access', _313 => _313.getLayouts, 'call', _314 => _314(), 'access', _315 => _315.get, 'call', _316 => _316("/"), 'optionalAccess', _317 => _317.modulePath]) : void 0;
|
|
7135
7273
|
try {
|
|
7136
|
-
for (const
|
|
7137
|
-
const layoutPath = path10.join(appDir, `layout${ext}`);
|
|
7274
|
+
for (const layoutPath of rendererRootLayout ? [rendererRootLayout] : notFoundExtensions.map((ext) => path10.join(appDir, `layout${ext}`))) {
|
|
7138
7275
|
if (fs7.existsSync(layoutPath)) {
|
|
7139
7276
|
layoutModule = await this.routeManager.loadLayoutModule(layoutPath);
|
|
7140
7277
|
break;
|
|
@@ -7142,13 +7279,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7142
7279
|
}
|
|
7143
7280
|
const notFoundPath = resolveFarmNotFoundComponentPath(
|
|
7144
7281
|
this.config,
|
|
7145
|
-
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config)
|
|
7282
|
+
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config),
|
|
7283
|
+
this.getRendererNotFoundPath()
|
|
7146
7284
|
);
|
|
7147
7285
|
if (notFoundPath) {
|
|
7148
7286
|
const notFoundModule = await this.loadNotFoundModule();
|
|
7149
|
-
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess',
|
|
7287
|
+
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _318 => _318.default]), () => ( null));
|
|
7150
7288
|
if (NotFoundComponent) {
|
|
7151
|
-
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess',
|
|
7289
|
+
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _319 => _319.default]), () => ( null));
|
|
7152
7290
|
let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
|
|
7153
7291
|
if (LayoutComponent) {
|
|
7154
7292
|
element = this.rendererRuntime.createElement(LayoutComponent, {
|
|
@@ -7185,23 +7323,23 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7185
7323
|
res.statusCode = statusCode;
|
|
7186
7324
|
const isDev = process.env.NODE_ENV === "development";
|
|
7187
7325
|
const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7188
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7326
|
+
trustProxy: _optionalChain([this, 'access', _320 => _320.config, 'access', _321 => _321.server, 'optionalAccess', _322 => _322.trustProxy])
|
|
7189
7327
|
});
|
|
7190
7328
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7191
|
-
const statusText =
|
|
7329
|
+
const statusText = _chunkNEKO3HM2cjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
7192
7330
|
const content = this.stampFarmScripts(
|
|
7193
7331
|
req,
|
|
7194
|
-
|
|
7332
|
+
_chunkNEKO3HM2cjs.createDefaultErrorMarkup.call(void 0, {
|
|
7195
7333
|
statusCode,
|
|
7196
7334
|
statusText,
|
|
7197
7335
|
requestPath: requestUrl.pathname,
|
|
7198
7336
|
method: req.method || "GET",
|
|
7199
|
-
message: _optionalChain([diagnostics, 'optionalAccess',
|
|
7200
|
-
errorName: _optionalChain([diagnostics, 'optionalAccess',
|
|
7201
|
-
stack: _optionalChain([diagnostics, 'optionalAccess',
|
|
7202
|
-
sourceFrame: _optionalChain([diagnostics, 'optionalAccess',
|
|
7337
|
+
message: _optionalChain([diagnostics, 'optionalAccess', _323 => _323.message]),
|
|
7338
|
+
errorName: _optionalChain([diagnostics, 'optionalAccess', _324 => _324.name]),
|
|
7339
|
+
stack: _optionalChain([diagnostics, 'optionalAccess', _325 => _325.stack]),
|
|
7340
|
+
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _326 => _326.sourceFrame]),
|
|
7203
7341
|
development: isDev,
|
|
7204
|
-
farmVersion:
|
|
7342
|
+
farmVersion: _chunk3CZ4MJHWcjs.FARM_VERSION,
|
|
7205
7343
|
nodeVersion: process.version,
|
|
7206
7344
|
mode: isDev ? "development" : "production"
|
|
7207
7345
|
})
|
|
@@ -7227,9 +7365,9 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7227
7365
|
*/
|
|
7228
7366
|
getI18nAlternateOptions(req, metadata) {
|
|
7229
7367
|
return {
|
|
7230
|
-
metadataBase: _optionalChain([metadata, 'optionalAccess',
|
|
7231
|
-
origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7232
|
-
languages: _optionalChain([metadata, 'optionalAccess',
|
|
7368
|
+
metadataBase: _optionalChain([metadata, 'optionalAccess', _327 => _327.metadataBase]),
|
|
7369
|
+
origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _328 => _328.config, 'access', _329 => _329.server, 'optionalAccess', _330 => _330.trustProxy]) }).origin : void 0,
|
|
7370
|
+
languages: _optionalChain([metadata, 'optionalAccess', _331 => _331.alternates, 'optionalAccess', _332 => _332.languages])
|
|
7233
7371
|
};
|
|
7234
7372
|
}
|
|
7235
7373
|
createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
|
|
@@ -7239,7 +7377,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7239
7377
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
7240
7378
|
const integrationManifestScript = farmScripts(`<script>
|
|
7241
7379
|
window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
|
|
7242
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
7380
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkB3HQTGXScjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
7243
7381
|
${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
|
|
7244
7382
|
</script>`);
|
|
7245
7383
|
const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -7248,20 +7386,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7248
7386
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
7249
7387
|
) : "";
|
|
7250
7388
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
7251
|
-
const themeDocument =
|
|
7389
|
+
const themeDocument = _chunkNEKO3HM2cjs.createFarmThemeDocumentParts.call(void 0,
|
|
7252
7390
|
this.config.theme,
|
|
7253
7391
|
this.config.basePath,
|
|
7254
7392
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
7255
7393
|
);
|
|
7256
7394
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
7257
7395
|
const rendererHydrationScript = farmScripts(
|
|
7258
|
-
_optionalChain([this, 'access',
|
|
7396
|
+
_optionalChain([this, 'access', _333 => _333.rendererRuntime, 'access', _334 => _334.generateHydrationScript, 'optionalCall', _335 => _335()]) || ""
|
|
7259
7397
|
);
|
|
7260
|
-
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access',
|
|
7261
|
-
const fullDocument =
|
|
7398
|
+
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _336 => _336.metadata, 'optionalAccess', _337 => _337.viewport]));
|
|
7399
|
+
const fullDocument = _chunkNEKO3HM2cjs.extractFarmFullDocument.call(void 0, _chunkNEKO3HM2cjs.markFarmDocumentLayouts.call(void 0, content));
|
|
7262
7400
|
if (fullDocument) {
|
|
7263
|
-
return
|
|
7264
|
-
metadataHead ?
|
|
7401
|
+
return _chunkNEKO3HM2cjs.composeFarmFullDocument.call(void 0,
|
|
7402
|
+
metadataHead ? _chunkNEKO3HM2cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
|
|
7265
7403
|
{
|
|
7266
7404
|
fallbackIcon: !metadataHead,
|
|
7267
7405
|
viewport: viewportTags,
|
|
@@ -7287,7 +7425,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7287
7425
|
);
|
|
7288
7426
|
}
|
|
7289
7427
|
return `<!DOCTYPE html>
|
|
7290
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
7428
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _338 => _338.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
7291
7429
|
<head>
|
|
7292
7430
|
${themeDocument.head}
|
|
7293
7431
|
<meta charset="utf-8">
|
|
@@ -7328,7 +7466,7 @@ ${clientScript}
|
|
|
7328
7466
|
const deploymentId = this.getDeploymentId();
|
|
7329
7467
|
res.setHeader(_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
|
|
7330
7468
|
if ((req.method || "GET").toUpperCase() !== "GET") return;
|
|
7331
|
-
const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7469
|
+
const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _339 => _339.config, 'access', _340 => _340.server, 'optionalAccess', _341 => _341.trustProxy]) }).protocol === "https:";
|
|
7332
7470
|
const cookie = _chunkNLBHLPEOcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
|
|
7333
7471
|
const existing = res.getHeader("Set-Cookie");
|
|
7334
7472
|
if (Array.isArray(existing)) {
|
|
@@ -7391,7 +7529,7 @@ var FarmApp = class {
|
|
|
7391
7529
|
await this.serverRenderer.initialize();
|
|
7392
7530
|
await this.verifyAppStructure();
|
|
7393
7531
|
await this.routeManager.discoverRoutes();
|
|
7394
|
-
if (
|
|
7532
|
+
if (_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) this.assertNoPageRoutes();
|
|
7395
7533
|
this.routeManager.generateClientManifest(this.config.root);
|
|
7396
7534
|
if (process.env.FARM_VERBOSE) {
|
|
7397
7535
|
_chunk7U4XF76Rcjs.logger.success("Farm.js application initialized successfully!");
|
|
@@ -7420,17 +7558,17 @@ var FarmApp = class {
|
|
|
7420
7558
|
outDir: config.outDir || "dist",
|
|
7421
7559
|
basePath,
|
|
7422
7560
|
trailingSlash: _nullishCoalesce(config.trailingSlash, () => ( false)),
|
|
7423
|
-
renderer:
|
|
7561
|
+
renderer: _chunkNGTZHWBGcjs.resolveFarmRenderer.call(void 0, config.renderer),
|
|
7424
7562
|
preset: _nullishCoalesce(config.preset, () => ( "node-server")),
|
|
7425
7563
|
deploy: config.deploy || {},
|
|
7426
7564
|
storage: config.storage || {},
|
|
7427
7565
|
schema: config.schema || {},
|
|
7428
7566
|
cache: config.cache || {},
|
|
7429
|
-
auth: isResolvedAuthConfig(config.auth) ? config.auth :
|
|
7567
|
+
auth: isResolvedAuthConfig(config.auth) ? config.auth : _chunkL2GUEYHRcjs.resolveFarmAuthConfig.call(void 0, config.auth),
|
|
7430
7568
|
integrations: config.integrations || {},
|
|
7431
7569
|
plugins: config.plugins || [],
|
|
7432
7570
|
migrations: config.migrations || { commands: [] },
|
|
7433
|
-
cron:
|
|
7571
|
+
cron: _chunkHQKCSJEHcjs.resolveCronConfig.call(void 0, config.cron),
|
|
7434
7572
|
workflows: _chunkBSX5OGSDcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
|
|
7435
7573
|
api: normalizeFarmAppAPIConfig(config.api),
|
|
7436
7574
|
middleware: config.middleware || {},
|
|
@@ -7441,9 +7579,9 @@ var FarmApp = class {
|
|
|
7441
7579
|
security: _chunk6JHZPB52cjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7442
7580
|
images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
|
|
7443
7581
|
config.images,
|
|
7444
|
-
|
|
7582
|
+
_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
|
|
7445
7583
|
),
|
|
7446
|
-
performance:
|
|
7584
|
+
performance: _chunkEACD6ND7cjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7447
7585
|
theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
7448
7586
|
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkZMSVKVI3cjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
|
|
7449
7587
|
root,
|
|
@@ -7464,17 +7602,17 @@ var FarmApp = class {
|
|
|
7464
7602
|
config.devtools,
|
|
7465
7603
|
process.env.NODE_ENV === "production" ? "production" : "development"
|
|
7466
7604
|
),
|
|
7467
|
-
devIndicators:
|
|
7605
|
+
devIndicators: _chunkL2GUEYHRcjs.resolveFarmDevIndicatorsConfig.call(void 0,
|
|
7468
7606
|
config.devIndicators,
|
|
7469
7607
|
process.env.NODE_ENV === "production" ? "production" : "development"
|
|
7470
7608
|
),
|
|
7471
7609
|
env: config.env || { server: {}, public: {} },
|
|
7472
7610
|
suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
|
|
7473
7611
|
experimental: {
|
|
7474
|
-
serverComponents: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7475
|
-
serverActions: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7476
|
-
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7477
|
-
ppr: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7612
|
+
serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _342 => _342.experimental, 'optionalAccess', _343 => _343.serverComponents]), () => ( false)),
|
|
7613
|
+
serverActions: _nullishCoalesce(_optionalChain([config, 'access', _344 => _344.experimental, 'optionalAccess', _345 => _345.serverActions]), () => ( false)),
|
|
7614
|
+
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _346 => _346.experimental, 'optionalAccess', _347 => _347.isolatedClientHydration]), () => ( "off")),
|
|
7615
|
+
ppr: _nullishCoalesce(_optionalChain([config, 'access', _348 => _348.experimental, 'optionalAccess', _349 => _349.ppr]), () => ( false)),
|
|
7478
7616
|
...config.experimental
|
|
7479
7617
|
},
|
|
7480
7618
|
agent: _nullishCoalesce(config.agent, () => ( {})),
|
|
@@ -7494,6 +7632,7 @@ var FarmApp = class {
|
|
|
7494
7632
|
);
|
|
7495
7633
|
}
|
|
7496
7634
|
async verifyAppStructure() {
|
|
7635
|
+
if (typeof _optionalChain([this, 'access', _350 => _350.config, 'access', _351 => _351.renderer, 'optionalAccess', _352 => _352.routes]) === "function") return;
|
|
7497
7636
|
const appDirs = _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config);
|
|
7498
7637
|
const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunk7U4XF76Rcjs.fileExists.call(void 0, appDir)))).some(
|
|
7499
7638
|
Boolean
|
|
@@ -7510,14 +7649,14 @@ var FarmApp = class {
|
|
|
7510
7649
|
`App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
|
|
7511
7650
|
);
|
|
7512
7651
|
}
|
|
7513
|
-
const componentExtensions =
|
|
7652
|
+
const componentExtensions = _chunkNGTZHWBGcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7514
7653
|
const rootLayoutPaths = appDirs.flatMap(
|
|
7515
7654
|
(appDir) => componentExtensions.map((extension) => path4.default.join(appDir, `layout${extension}`))
|
|
7516
7655
|
);
|
|
7517
7656
|
const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunk7U4XF76Rcjs.fileExists.call(void 0, p))).then(
|
|
7518
7657
|
(results) => results.some(Boolean)
|
|
7519
7658
|
);
|
|
7520
|
-
if (!hasRootLayout && !
|
|
7659
|
+
if (!hasRootLayout && !_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7521
7660
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
7522
7661
|
`No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
|
|
7523
7662
|
);
|
|
@@ -7533,7 +7672,7 @@ function isResolvedAuthConfig(value) {
|
|
|
7533
7672
|
);
|
|
7534
7673
|
}
|
|
7535
7674
|
function normalizeFarmAppAPIConfig(config) {
|
|
7536
|
-
if (typeof _optionalChain([config, 'optionalAccess',
|
|
7675
|
+
if (typeof _optionalChain([config, 'optionalAccess', _353 => _353.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _354 => _354.basePath]) === "function") {
|
|
7537
7676
|
throw new Error(
|
|
7538
7677
|
"Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
|
|
7539
7678
|
);
|
|
@@ -7548,7 +7687,7 @@ function createFarmApp(config, viteServer) {
|
|
|
7548
7687
|
var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
|
|
7549
7688
|
var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
|
|
7550
7689
|
function resolveFarmImageProviderForRuntime(images, options) {
|
|
7551
|
-
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess',
|
|
7690
|
+
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _355 => _355.provider]), () => ( "auto"));
|
|
7552
7691
|
if (provider === "none") return images;
|
|
7553
7692
|
const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
|
|
7554
7693
|
if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
|
|
@@ -7689,9 +7828,9 @@ function staticValue(node) {
|
|
|
7689
7828
|
}
|
|
7690
7829
|
}
|
|
7691
7830
|
function property(object, name) {
|
|
7692
|
-
return _optionalChain([object, 'access',
|
|
7831
|
+
return _optionalChain([object, 'access', _356 => _356.properties, 'access', _357 => _357.find, 'call', _358 => _358(
|
|
7693
7832
|
(entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
|
|
7694
|
-
), 'optionalAccess',
|
|
7833
|
+
), 'optionalAccess', _359 => _359.value]);
|
|
7695
7834
|
}
|
|
7696
7835
|
function toolFromObject(object) {
|
|
7697
7836
|
const name = staticValue(property(object, "name"));
|
|
@@ -7737,7 +7876,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7737
7876
|
if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
|
|
7738
7877
|
continue;
|
|
7739
7878
|
for (const specifier of statement.specifiers) {
|
|
7740
|
-
const imported = _nullishCoalesce(_optionalChain([specifier, 'access',
|
|
7879
|
+
const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _360 => _360.imported, 'optionalAccess', _361 => _361.name]), () => ( _optionalChain([specifier, 'access', _362 => _362.imported, 'optionalAccess', _363 => _363.value])));
|
|
7741
7880
|
if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
|
|
7742
7881
|
locals.set(specifier.local.name, imported);
|
|
7743
7882
|
}
|
|
@@ -7753,7 +7892,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7753
7892
|
const [argument] = current.arguments;
|
|
7754
7893
|
if (definer && argument) {
|
|
7755
7894
|
const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
|
|
7756
|
-
(element) => _optionalChain([element, 'optionalAccess',
|
|
7895
|
+
(element) => _optionalChain([element, 'optionalAccess', _364 => _364.type]) === "ObjectExpression"
|
|
7757
7896
|
) : [] : argument.type === "ObjectExpression" ? [argument] : [];
|
|
7758
7897
|
for (const object of objects) {
|
|
7759
7898
|
const tool = toolFromObject(object);
|
|
@@ -7814,8 +7953,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
|
7814
7953
|
|
|
7815
7954
|
var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
7816
7955
|
function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
7817
|
-
const client = _optionalChain([cache2, 'optionalAccess',
|
|
7818
|
-
const adapter = _optionalChain([client, 'optionalAccess',
|
|
7956
|
+
const client = _optionalChain([cache2, 'optionalAccess', _365 => _365.client]);
|
|
7957
|
+
const adapter = _optionalChain([client, 'optionalAccess', _366 => _366.adapter]);
|
|
7819
7958
|
if (adapter === void 0) return void 0;
|
|
7820
7959
|
if (typeof adapter !== "string" || adapter.trim().length === 0) {
|
|
7821
7960
|
throw new Error(
|
|
@@ -7830,8 +7969,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
|
7830
7969
|
);
|
|
7831
7970
|
}
|
|
7832
7971
|
const options = {};
|
|
7833
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
7834
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
7972
|
+
if (_optionalChain([client, 'optionalAccess', _367 => _367.version]) !== void 0) options.version = client.version;
|
|
7973
|
+
if (_optionalChain([client, 'optionalAccess', _368 => _368.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
|
|
7835
7974
|
return { importPath: found.replace(/\\/g, "/"), options };
|
|
7836
7975
|
}
|
|
7837
7976
|
function resolveAdapterFile(resolved) {
|
|
@@ -8036,6 +8175,15 @@ function createFarmNavigationScript(script) {
|
|
|
8036
8175
|
freshScript.textContent = script.textContent || "";
|
|
8037
8176
|
return freshScript;
|
|
8038
8177
|
}
|
|
8178
|
+
// Readies nodes parsed outside the page (DOMParser, a <template>) for the page they move into.
|
|
8179
|
+
// Those parse as a page without scripting, so a <noscript>'s content comes out as elements, whose
|
|
8180
|
+
// images and frames would load once in the page. They become the text the page's own parser makes
|
|
8181
|
+
// of that markup.
|
|
8182
|
+
function adoptFarmParsedNodes(root) {
|
|
8183
|
+
for (const noscript of Array.from(root.querySelectorAll("noscript"))) {
|
|
8184
|
+
noscript.textContent = noscript.innerHTML;
|
|
8185
|
+
}
|
|
8186
|
+
}
|
|
8039
8187
|
// React streams Suspense content after its fallback, in a hidden segment that a reveal script
|
|
8040
8188
|
// ($RC for a boundary, $RS for a segment placeholder) moves into place. This makes the same moves
|
|
8041
8189
|
// in a parsed page, before it goes on screen, and drops the calls it made, so the islands in that
|
|
@@ -8134,7 +8282,8 @@ async function readFarmNavigationStream(body, flushToken) {
|
|
|
8134
8282
|
cancel: function() { reader.cancel().catch(function() {}); },
|
|
8135
8283
|
};
|
|
8136
8284
|
}`;
|
|
8137
|
-
var FARM_EARLY_NAVIGATION_SOURCE = `// The request the boot script sent for a link clicked before the router ran
|
|
8285
|
+
var FARM_EARLY_NAVIGATION_SOURCE = `// The request the boot script sent for a link pressed or clicked before the router ran
|
|
8286
|
+
// (islands-boot.ts).
|
|
8138
8287
|
// The next navigation request takes its response when it is the same request, and aborts it
|
|
8139
8288
|
// otherwise. The held island values may differ: a response for fewer of them carries more values,
|
|
8140
8289
|
// which fits any page. As with a prefetched page, a response sent over 30 seconds ago is not used.
|
|
@@ -8279,8 +8428,8 @@ function redactFarmDocsClientConfig(code, filename) {
|
|
|
8279
8428
|
const current = node;
|
|
8280
8429
|
if (current.type === "Property") {
|
|
8281
8430
|
const name = propertyKeyName(current);
|
|
8282
|
-
const valueType = _optionalChain([current, 'access',
|
|
8283
|
-
const credential = name !== void 0 && (name.toLowerCase() === "headers" ||
|
|
8431
|
+
const valueType = _optionalChain([current, 'access', _369 => _369.value, 'optionalAccess', _370 => _370.type]);
|
|
8432
|
+
const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkXJDB564Acjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
|
|
8284
8433
|
if (name && credential) {
|
|
8285
8434
|
edits.push(
|
|
8286
8435
|
current.shorthand || current.method || current.kind !== "init" ? { start: current.start, end: current.end, text: `${JSON.stringify(name)}: undefined` } : {
|
|
@@ -8322,7 +8471,7 @@ function farmDocsClientConfigPlugin(configModule) {
|
|
|
8322
8471
|
// Never matches without a docs config module, so the bundler never calls the handler.
|
|
8323
8472
|
filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
|
|
8324
8473
|
handler(code, id, options) {
|
|
8325
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
8474
|
+
if (_optionalChain([options, 'optionalAccess', _371 => _371.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
|
|
8326
8475
|
const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
|
|
8327
8476
|
return redacted === null ? null : { code: redacted, map: null };
|
|
8328
8477
|
}
|
|
@@ -8425,13 +8574,13 @@ function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
|
8425
8574
|
return Array.from(
|
|
8426
8575
|
/* @__PURE__ */ new Set([
|
|
8427
8576
|
...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE,
|
|
8428
|
-
..._optionalChain([renderer, 'optionalAccess',
|
|
8577
|
+
..._optionalChain([renderer, 'optionalAccess', _372 => _372.optimizeDeps]) || [],
|
|
8429
8578
|
// Farm's browser entry imports a renderer's client module, and no app file does, so Vite's
|
|
8430
8579
|
// scan never sees it and finds it only on the first page request, then bundles again. The
|
|
8431
8580
|
// React entry imports `react-dom/client` instead, which is already listed. A linked
|
|
8432
8581
|
// renderer stays source: pre-bundling it would copy the packages it shares with the app's
|
|
8433
8582
|
// components into the bundle, so a hook would read a different copy than the renderer set.
|
|
8434
|
-
...renderer && root && !
|
|
8583
|
+
...renderer && root && !_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer) && _chunkPWDBWXQIcjs.isPackageSpecifier.call(void 0, renderer.client) && isInstalledPackage(root, renderer.client) ? [renderer.client] : []
|
|
8435
8584
|
])
|
|
8436
8585
|
);
|
|
8437
8586
|
}
|
|
@@ -8444,7 +8593,7 @@ function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
|
8444
8593
|
});
|
|
8445
8594
|
}
|
|
8446
8595
|
function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
8447
|
-
if (
|
|
8596
|
+
if (_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, renderer)) return { noDiscovery: true, include: [] };
|
|
8448
8597
|
const jsxImportSource = renderer ? renderer.jsxImportSource : void 0;
|
|
8449
8598
|
return {
|
|
8450
8599
|
// Keep normal application dependency discovery for CJS-only packages, but
|
|
@@ -8457,7 +8606,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
|
8457
8606
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
8458
8607
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
8459
8608
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
8460
|
-
..._optionalChain([entries, 'optionalAccess',
|
|
8609
|
+
..._optionalChain([entries, 'optionalAccess', _373 => _373.length]) ? { entries: [...entries] } : {},
|
|
8461
8610
|
// Vite's dependency scan compiles JSX on its own: with the app tsconfig's `jsxImportSource`
|
|
8462
8611
|
// when there is one, otherwise as React, whatever the renderer's plugin set for its own
|
|
8463
8612
|
// transforms. React is the default already, and naming it here would override a tsconfig
|
|
@@ -8498,8 +8647,8 @@ function mergeFarmViteAlias(farmValue, userValue) {
|
|
|
8498
8647
|
return [...userEntries, ...normalize(farmValue).filter((entry) => !userNames.has(entry.find))];
|
|
8499
8648
|
}
|
|
8500
8649
|
function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
8501
|
-
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8502
|
-
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8650
|
+
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _374 => _374.optimizeDeps, 'optionalAccess', _375 => _375.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _376 => _376.optimizeDeps, 'optionalAccess', _377 => _377.noDiscovery])));
|
|
8651
|
+
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _378 => _378.optimizeDeps, 'optionalAccess', _379 => _379.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _380 => _380.optimizeDeps, 'optionalAccess', _381 => _381.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _382 => _382.optimizeDeps, 'optionalAccess', _383 => _383.holdUntilCrawlEnd]))));
|
|
8503
8652
|
return {
|
|
8504
8653
|
...farmConfig,
|
|
8505
8654
|
...userConfig,
|
|
@@ -8511,9 +8660,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8511
8660
|
resolve: {
|
|
8512
8661
|
...farmConfig.resolve,
|
|
8513
8662
|
...userConfig.resolve,
|
|
8514
|
-
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access',
|
|
8663
|
+
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _384 => _384.resolve, 'optionalAccess', _385 => _385.alias]), _optionalChain([userConfig, 'access', _386 => _386.resolve, 'optionalAccess', _387 => _387.alias])),
|
|
8515
8664
|
dedupe: Array.from(
|
|
8516
|
-
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access',
|
|
8665
|
+
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _388 => _388.resolve, 'optionalAccess', _389 => _389.dedupe]) || [], ..._optionalChain([userConfig, 'access', _390 => _390.resolve, 'optionalAccess', _391 => _391.dedupe]) || []])
|
|
8517
8666
|
)
|
|
8518
8667
|
},
|
|
8519
8668
|
optimizeDeps: {
|
|
@@ -8523,21 +8672,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8523
8672
|
holdUntilCrawlEnd,
|
|
8524
8673
|
include: Array.from(
|
|
8525
8674
|
/* @__PURE__ */ new Set([
|
|
8526
|
-
..._optionalChain([farmConfig, 'access',
|
|
8527
|
-
..._optionalChain([userConfig, 'access',
|
|
8675
|
+
..._optionalChain([farmConfig, 'access', _392 => _392.optimizeDeps, 'optionalAccess', _393 => _393.include]) || [],
|
|
8676
|
+
..._optionalChain([userConfig, 'access', _394 => _394.optimizeDeps, 'optionalAccess', _395 => _395.include]) || []
|
|
8528
8677
|
])
|
|
8529
8678
|
),
|
|
8530
8679
|
exclude: Array.from(
|
|
8531
8680
|
/* @__PURE__ */ new Set([
|
|
8532
|
-
..._optionalChain([farmConfig, 'access',
|
|
8533
|
-
..._optionalChain([userConfig, 'access',
|
|
8681
|
+
..._optionalChain([farmConfig, 'access', _396 => _396.optimizeDeps, 'optionalAccess', _397 => _397.exclude]) || [],
|
|
8682
|
+
..._optionalChain([userConfig, 'access', _398 => _398.optimizeDeps, 'optionalAccess', _399 => _399.exclude]) || []
|
|
8534
8683
|
])
|
|
8535
8684
|
)
|
|
8536
8685
|
},
|
|
8537
8686
|
ssr: {
|
|
8538
8687
|
...farmConfig.ssr,
|
|
8539
8688
|
...userConfig.ssr,
|
|
8540
|
-
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access',
|
|
8689
|
+
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _400 => _400.ssr, 'optionalAccess', _401 => _401.noExternal]), _optionalChain([userConfig, 'access', _402 => _402.ssr, 'optionalAccess', _403 => _403.noExternal]))
|
|
8541
8690
|
}
|
|
8542
8691
|
};
|
|
8543
8692
|
}
|
|
@@ -8608,8 +8757,8 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8608
8757
|
...userRolldownOptions
|
|
8609
8758
|
};
|
|
8610
8759
|
const merged = mergeFarmViteConfig(farmConfig, shared);
|
|
8611
|
-
const farmBundlerOptions = _optionalChain([farmConfig, 'access',
|
|
8612
|
-
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess',
|
|
8760
|
+
const farmBundlerOptions = _optionalChain([farmConfig, 'access', _404 => _404.build, 'optionalAccess', _405 => _405.rollupOptions]);
|
|
8761
|
+
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _406 => _406.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _407 => _407.output]);
|
|
8613
8762
|
return {
|
|
8614
8763
|
...merged,
|
|
8615
8764
|
build: {
|
|
@@ -8626,7 +8775,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8626
8775
|
esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
|
|
8627
8776
|
ssr: {
|
|
8628
8777
|
...merged.ssr,
|
|
8629
|
-
external: mergeExternal(_optionalChain([farmConfig, 'access',
|
|
8778
|
+
external: mergeExternal(_optionalChain([farmConfig, 'access', _408 => _408.ssr, 'optionalAccess', _409 => _409.external]), _optionalChain([userConfig, 'access', _410 => _410.ssr, 'optionalAccess', _411 => _411.external]))
|
|
8630
8779
|
}
|
|
8631
8780
|
};
|
|
8632
8781
|
}
|