@farm.js/core 0.1.71 → 0.1.73
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-handler-VIT4GOSR.mjs → agent-mcp-handler-RK7LDYEL.mjs} +5 -5
- package/dist/{agent-mcp-handler-KE4J3W7S.cjs → agent-mcp-handler-VBCA3WZ6.cjs} +6 -6
- package/dist/{agent-mcp.d-BzNw6JI8.d.ts → agent-mcp.d-D_gHjCAE.d.ts} +2 -2
- package/dist/{agent-mcp.d-CgFen3EH.d.mts → agent-mcp.d-PvEf-1mi.d.mts} +2 -2
- package/dist/agent-runtime.d.mts +4 -4
- package/dist/agent-runtime.d.ts +4 -4
- package/dist/{analyzer-VK3BAOFI.mjs → analyzer-MFYCJT75.mjs} +2 -2
- package/dist/analyzer-V5ZMRIIY.cjs +16 -0
- package/dist/api/node.d.mts +6 -6
- package/dist/api/node.d.ts +6 -6
- package/dist/api/route-manager.cjs +7 -6
- package/dist/api/route-manager.d.mts +8 -8
- package/dist/api/route-manager.d.ts +8 -8
- package/dist/api/route-manager.mjs +6 -5
- package/dist/api/runtime.d.mts +5 -5
- package/dist/api/runtime.d.ts +5 -5
- package/dist/api.cjs +8 -7
- package/dist/api.d.mts +9 -9
- package/dist/api.d.ts +9 -9
- package/dist/api.mjs +7 -6
- package/dist/{app-manifest.d-DY4JfJxi.d.ts → app-manifest.d-BpVTg43i.d.ts} +1 -1
- package/dist/{app-manifest.d-DpDK_B1k.d.mts → app-manifest.d-CN7cEWHX.d.mts} +1 -1
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +5 -5
- package/dist/app-markdown.d.ts +5 -5
- package/dist/app-markdown.mjs +3 -3
- package/dist/{app.d-D-5UNrFd.d.mts → app.d-BFWzAdTe.d.mts} +54 -6
- package/dist/{app.d-BeK6bb1c.d.ts → app.d-DO4PTCWm.d.ts} +54 -6
- package/dist/{chunk-7A3URI2F.mjs → chunk-2EVESLP3.mjs} +8 -1
- package/dist/{chunk-IYDJNCR7.mjs → chunk-462MUII7.mjs} +10 -5
- package/dist/{chunk-MWUDEYBI.mjs → chunk-4CTCSKAF.mjs} +1 -1
- package/dist/{chunk-SXMWVP2L.cjs → chunk-4YHGQDTT.cjs} +12 -12
- package/dist/{chunk-YCNHUIPR.cjs → chunk-4Z3YLMSW.cjs} +10 -10
- package/dist/{chunk-K66JILV3.cjs → chunk-5LOARKDP.cjs} +2 -2
- package/dist/{chunk-O32QPFVV.cjs → chunk-5PDMBWAF.cjs} +5 -5
- package/dist/{chunk-IGXS54GC.mjs → chunk-6O6PAZZR.mjs} +1 -1
- package/dist/{chunk-LXEJNWF5.mjs → chunk-73K53YPP.mjs} +2 -2
- package/dist/{chunk-2CQC5CMD.mjs → chunk-7GMBETHM.mjs} +1 -1
- package/dist/{chunk-W2T6NDNP.mjs → chunk-B67CW2LM.mjs} +2 -2
- package/dist/{chunk-CSQPMV3Q.cjs → chunk-CLEWORVY.cjs} +6 -6
- package/dist/{chunk-KPJYBSHL.mjs → chunk-CPMME66W.mjs} +149 -22
- package/dist/{chunk-BBPDJGCU.cjs → chunk-CYOTNHDF.cjs} +2 -2
- package/dist/{chunk-4OD2LXF2.mjs → chunk-CYRIIVD4.mjs} +26 -15
- package/dist/{chunk-DPIGYXSV.mjs → chunk-FRO4BB2T.mjs} +1 -1
- package/dist/{chunk-Y2SZVIVH.cjs → chunk-GPICBTDV.cjs} +8 -1
- package/dist/{chunk-N3XO5AL5.cjs → chunk-GPO3LJDJ.cjs} +2 -2
- package/dist/{chunk-MITIAOUQ.mjs → chunk-GZOKWJIW.mjs} +4 -4
- package/dist/{chunk-NAXKOTPP.cjs → chunk-HFUOLILA.cjs} +21 -21
- package/dist/{chunk-C2JOS77Z.cjs → chunk-HGB4PM2C.cjs} +178 -51
- package/dist/{chunk-2IFT2CSA.cjs → chunk-HTXKSREF.cjs} +515 -151
- package/dist/{chunk-Z3GPAFIA.mjs → chunk-HY6IVQ54.mjs} +1 -1
- package/dist/{chunk-X7LGLF33.mjs → chunk-IBVN7SW5.mjs} +480 -116
- package/dist/{chunk-DPYBVVL3.cjs → chunk-ILQ5DKYF.cjs} +2 -2
- package/dist/{chunk-V25GSH43.mjs → chunk-IXZSBO76.mjs} +1 -1
- package/dist/{chunk-RJUCNO7R.mjs → chunk-JMOCMXTQ.mjs} +1 -1
- package/dist/{chunk-UISZLYKY.cjs → chunk-KDOZORJD.cjs} +52 -41
- package/dist/{chunk-PLXD2MJV.cjs → chunk-KTDG4THT.cjs} +2 -2
- package/dist/{chunk-L6E4SHUB.cjs → chunk-LGR7565L.cjs} +6 -6
- package/dist/chunk-LRPPXKCX.mjs +58 -0
- package/dist/{chunk-GUU3IZSM.mjs → chunk-MJEKMT6B.mjs} +324 -148
- package/dist/chunk-NDOE76QC.cjs +58 -0
- package/dist/{chunk-2AM26UGI.cjs → chunk-NLBK37HI.cjs} +5 -4
- package/dist/{chunk-REP6HWJN.mjs → chunk-OBYM5S5G.mjs} +2 -2
- package/dist/{chunk-ZUVAGMQ5.cjs → chunk-ODBM54RT.cjs} +7 -7
- package/dist/{chunk-J5ASGNKF.mjs → chunk-OIP62QEL.mjs} +1 -1
- package/dist/{chunk-KEB7AGS6.cjs → chunk-OXNZUCHN.cjs} +16 -11
- package/dist/{chunk-2MR4MABG.cjs → chunk-PXAHSCR6.cjs} +58 -8
- package/dist/{chunk-7BUE2GM6.mjs → chunk-QGCSUC5O.mjs} +174 -81
- package/dist/{chunk-VXB5CMNC.cjs → chunk-QKEZLYON.cjs} +2 -2
- package/dist/{chunk-UQUOSNRN.mjs → chunk-REK6HZSU.mjs} +470 -267
- package/dist/{chunk-E77IA5IF.mjs → chunk-RLFGKJQ6.mjs} +1 -1
- package/dist/{chunk-3BQ7QHUH.cjs → chunk-ROCF6UQD.cjs} +17 -8
- package/dist/{chunk-KQAB5LML.mjs → chunk-SUQACHER.mjs} +2 -2
- package/dist/{chunk-NA77GEIU.mjs → chunk-SVQX5HYW.mjs} +53 -3
- package/dist/{chunk-KWST2O22.cjs → chunk-TAU3OF5B.cjs} +611 -435
- package/dist/{chunk-ZPUAOKHV.cjs → chunk-TDCP3Z4T.cjs} +3 -3
- package/dist/{chunk-3AUINHFG.mjs → chunk-TNYC3TYP.mjs} +3 -2
- package/dist/{chunk-TP4RAV7Y.cjs → chunk-TU6VAH4V.cjs} +8 -8
- package/dist/{chunk-MEJCP2LX.cjs → chunk-UVQRMUAR.cjs} +1 -1
- package/dist/{chunk-JMFTKNBA.mjs → chunk-UVZMSRHF.mjs} +2 -2
- package/dist/{chunk-MU5V7XHL.mjs → chunk-VJSXPN3W.mjs} +3 -0
- package/dist/{chunk-DU4VHHPJ.mjs → chunk-VO55MMBX.mjs} +1 -1
- package/dist/{chunk-GF22VGMS.cjs → chunk-VPETSSWN.cjs} +2 -2
- package/dist/{chunk-LDVJIBGN.mjs → chunk-VT25ERQK.mjs} +1 -1
- package/dist/{chunk-AYVGD3PK.mjs → chunk-XI3OXOMK.mjs} +1 -1
- package/dist/{chunk-7OHJWFLB.cjs → chunk-XUSJVHHD.cjs} +466 -373
- package/dist/{chunk-FILXOEWD.cjs → chunk-YXIQYWOK.cjs} +2 -2
- package/dist/{chunk-JVA4PIYN.cjs → chunk-YZK64PZT.cjs} +635 -432
- package/dist/{chunk-THG2TVDH.mjs → chunk-YZLEOMMA.mjs} +3 -3
- package/dist/{chunk-QUFENL7Q.mjs → chunk-Z3IN6GEX.mjs} +16 -7
- package/dist/{chunk-Q5HMVGR5.cjs → chunk-ZFEJ2SF2.cjs} +13 -13
- package/dist/{chunk-LNVGXUL3.cjs → chunk-ZMSVKVI3.cjs} +3 -0
- package/dist/{client-component.d-DwpH251K.d.mts → client-component.d-C71rMuHF.d.mts} +2 -2
- package/dist/{client-component.d-fYupugbZ.d.ts → client-component.d-sF-Znk0j.d.ts} +2 -2
- package/dist/{client-plugins.d-k3bOT5gz.d.mts → client-plugins.d-B-Gd9mWR.d.mts} +5 -4
- package/dist/{client-plugins.d-BxqFfHpM.d.ts → client-plugins.d-MFibjgBg.d.ts} +5 -4
- package/dist/client-plugins.d.mts +4 -4
- package/dist/client-plugins.d.ts +4 -4
- package/dist/client.cjs +1 -1
- package/dist/client.d.mts +9 -9
- package/dist/client.d.ts +9 -9
- package/dist/client.mjs +1 -1
- package/dist/config.d.mts +4 -4
- package/dist/config.d.ts +4 -4
- package/dist/desktop.d.mts +5 -5
- package/dist/desktop.d.ts +5 -5
- package/dist/{devtools-O5625KCK.cjs → devtools-6K4QXFRL.cjs} +7 -7
- package/dist/{devtools-6MXPFPNJ.mjs → devtools-TDIJ6HVC.mjs} +6 -6
- package/dist/docs.cjs +10 -10
- package/dist/docs.d.mts +5 -5
- package/dist/docs.d.ts +5 -5
- package/dist/docs.mjs +9 -9
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/{headers.d-sNT7ZQiU.d.mts → headers.d-BUxGJTsj.d.mts} +2 -2
- package/dist/{headers.d-DalIGbVO.d.ts → headers.d-uQ6BR59u.d.ts} +2 -2
- package/dist/i18n/client.cjs +3 -2
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/client.mjs +2 -1
- package/dist/i18n/index.cjs +3 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.mjs +2 -1
- package/dist/i18n/server.cjs +6 -5
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/i18n/server.mjs +5 -4
- package/dist/index.cjs +32 -30
- package/dist/{index.d-BcA-secm.d.ts → index.d-BCGfxCXY.d.ts} +1 -1
- package/dist/{index.d-DDHHAv7j.d.mts → index.d-CuWOJ-un.d.mts} +1 -1
- package/dist/index.d.mts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.mjs +31 -29
- package/dist/integrations/orm.d.mts +4 -4
- package/dist/integrations/orm.d.ts +4 -4
- package/dist/integrations.d.mts +4 -4
- package/dist/integrations.d.ts +4 -4
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +5 -5
- package/dist/internal/app-markdown-runtime.d.ts +5 -5
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +29 -29
- package/dist/internal/build-runtime.d.mts +6 -6
- package/dist/internal/build-runtime.d.ts +6 -6
- package/dist/internal/build-runtime.mjs +28 -28
- package/dist/internal/cli-runtime.cjs +12 -12
- package/dist/internal/cli-runtime.mjs +11 -11
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +2 -2
- package/dist/internal/client-runtime.d.mts +7 -7
- package/dist/internal/client-runtime.d.ts +7 -7
- package/dist/internal/client-runtime.mjs +3 -3
- package/dist/internal/compression-runtime.d.mts +4 -4
- package/dist/internal/compression-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.cjs +8 -8
- package/dist/internal/config-runtime.d.mts +7 -7
- package/dist/internal/config-runtime.d.ts +7 -7
- package/dist/internal/config-runtime.mjs +7 -7
- package/dist/internal/infra-analytics-runtime.cjs +10 -10
- package/dist/internal/infra-analytics-runtime.mjs +8 -8
- 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 +19 -19
- package/dist/internal/production-runtime.d.mts +37 -25
- package/dist/internal/production-runtime.d.ts +37 -25
- package/dist/internal/production-runtime.mjs +18 -18
- package/dist/internal/vercel-edge-middleware.d.mts +2 -2
- package/dist/internal/vercel-edge-middleware.d.ts +2 -2
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +4 -4
- package/dist/markdown.d.ts +4 -4
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.cjs +3 -3
- package/dist/middleware.d.mts +5 -5
- package/dist/middleware.d.ts +5 -5
- package/dist/middleware.mjs +2 -2
- package/dist/mobile.d.mts +3 -3
- package/dist/mobile.d.ts +3 -3
- package/dist/{mount.d-C1PONsEe.d.mts → mount.d-BIYmcGGg.d.mts} +1 -1
- package/dist/{mount.d-D3JOux2V.d.ts → mount.d-q8k0cJV0.d.ts} +1 -1
- package/dist/{native-tree-L2IIEBXH.mjs → native-tree-OYGKP2NZ.mjs} +2 -2
- package/dist/{native-tree-GF4BH33L.cjs → native-tree-R6CQMDTI.cjs} +3 -3
- package/dist/{navigation-delegate.d-CQQPbdkE.d.ts → navigation-delegate.d-Btfs6Uoa.d.ts} +1 -1
- package/dist/{navigation-delegate.d-CJQQHboA.d.mts → navigation-delegate.d-CYBUupsv.d.mts} +1 -1
- package/dist/navigation.d.mts +7 -7
- package/dist/navigation.d.ts +7 -7
- package/dist/{observability.d-B2363jB6.d.mts → observability.d-DdJRiaIX.d.mts} +27 -3
- package/dist/{observability.d-B2363jB6.d.ts → observability.d-DdJRiaIX.d.ts} +27 -3
- package/dist/observability.d.mts +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/plugin.cjs +21 -21
- package/dist/plugin.d.mts +7 -7
- package/dist/plugin.d.ts +7 -7
- package/dist/plugin.mjs +20 -20
- package/dist/{production-runtime.d-B0IeWWyO.d.mts → production-runtime.d-Bcu37SCo.d.mts} +1 -1
- package/dist/{production-runtime.d-q3aHIv5Y.d.ts → production-runtime.d-qPj3XRET.d.ts} +1 -1
- package/dist/{render-plan.d-DHuJMJRP.d.ts → render-plan.d-0FHusf1D.d.ts} +1 -1
- package/dist/{render-plan.d-CiUj0rq5.d.mts → render-plan.d-BlyxqKMu.d.mts} +1 -1
- package/dist/renderer-client.cjs +3 -2
- package/dist/renderer-client.d.mts +7 -7
- package/dist/renderer-client.d.ts +7 -7
- package/dist/renderer-client.mjs +2 -1
- package/dist/{request.d-DRUbOmYD.d.ts → request.d-CPdVjssg.d.ts} +1 -1
- package/dist/{request.d-D-F7o7tb.d.mts → request.d-CX-gks1l.d.mts} +1 -1
- package/dist/request.d.mts +5 -5
- package/dist/request.d.ts +5 -5
- package/dist/{resolver.d-9iKC79CU.d.mts → resolver.d-DJgzbdsp.d.mts} +1 -1
- package/dist/{resolver.d-CY6mEa_F.d.ts → resolver.d-yaHcGCCG.d.ts} +1 -1
- package/dist/{route-rendering.d-6smgwT2t.d.mts → route-rendering.d-CcvZ_4N2.d.mts} +1 -1
- package/dist/{route-rendering.d-KwqM_mlK.d.ts → route-rendering.d-DcOoSNoG.d.ts} +1 -1
- package/dist/{router.d-BYmDeDlp.d.mts → router.d-C8RHma4A.d.mts} +1 -1
- package/dist/{router.d-B6sesMRD.d.ts → router.d-D2QnK8cM.d.ts} +1 -1
- package/dist/{routes.d-D3aJw1H5.d.mts → routes.d-CCccJRrp.d.mts} +1 -1
- package/dist/{routes.d-K-Qg79AA.d.ts → routes.d-b7khoRoU.d.ts} +1 -1
- package/dist/routes.d.mts +4 -4
- package/dist/routes.d.ts +4 -4
- package/dist/{routing.d-DwSUVZbF.d.mts → routing.d-BhPgtN_S.d.ts} +2 -1
- package/dist/{routing.d-BxOZ2YWc.d.ts → routing.d-D67HQmnv.d.mts} +2 -1
- package/dist/{rsc-pipeline-R2GOKIMU.mjs → rsc-pipeline-LC2FBZAR.mjs} +7 -7
- package/dist/{rsc-pipeline-P4PCWDO2.cjs → rsc-pipeline-NTAM65NT.cjs} +8 -8
- package/dist/{runtime-DP5DYGW5.mjs → runtime-MWAC7NWR.mjs} +7 -7
- package/dist/{runtime-WA2Q4SLG.cjs → runtime-U4PAMTVH.cjs} +9 -9
- package/dist/{runtime.d-CbdMI0Oy.d.ts → runtime.d-1l_1bLrL.d.ts} +1 -1
- package/dist/{runtime.d-BFSJf-ww.d.mts → runtime.d-BQUHHq8M.d.mts} +1 -1
- package/dist/{runtime.d-nUz0HAL4.d.mts → runtime.d-CTAXWZby.d.mts} +2 -2
- package/dist/{runtime.d-B_uPfMjA.d.ts → runtime.d-PUA5qBnd.d.ts} +2 -2
- package/dist/server-plugins.d.mts +6 -6
- package/dist/server-plugins.d.ts +6 -6
- package/dist/server.cjs +43 -41
- package/dist/server.d.mts +15 -15
- package/dist/server.d.ts +15 -15
- package/dist/server.mjs +26 -24
- package/dist/{spa-router.d-mC1D5cTN.d.ts → spa-router.d-BJtXNeqo.d.ts} +3 -3
- package/dist/{spa-router.d-D4EDwR20.d.mts → spa-router.d-BzPdi48R.d.mts} +3 -3
- package/dist/testing.cjs +6 -5
- package/dist/testing.d.mts +4 -4
- package/dist/testing.d.ts +4 -4
- package/dist/testing.mjs +6 -5
- package/dist/{types.d-wVRlLtBf.d.ts → types.d-euATAbE4.d.mts} +4 -0
- package/dist/{types.d-wVRlLtBf.d.mts → types.d-euATAbE4.d.ts} +4 -0
- package/dist/{utils.d-DxMzteqE.d.mts → utils.d-B4ZW-6z6.d.mts} +1 -1
- package/dist/{utils.d-A2X3a6z_.d.ts → utils.d-DquC6qxy.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +23 -21
- package/dist/vite.d.mts +18 -9
- package/dist/vite.d.ts +18 -9
- package/dist/vite.mjs +22 -20
- package/package.json +1 -1
- package/dist/analyzer-LPIVRSTJ.cjs +0 -16
- package/dist/chunk-V3UOEWCB.cjs +0 -46
- package/dist/chunk-VE3FWJBO.mjs +0 -46
|
@@ -9,11 +9,12 @@ import {
|
|
|
9
9
|
collectSSGPages,
|
|
10
10
|
matchSSGPage,
|
|
11
11
|
resolveRouteRenderingConfigFromFile
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-B67CW2LM.mjs";
|
|
13
13
|
import {
|
|
14
14
|
createFarmMetadataImageResponse
|
|
15
15
|
} from "./chunk-CROAFCMW.mjs";
|
|
16
16
|
import {
|
|
17
|
+
appendFarmHead,
|
|
17
18
|
classifyFarmDocumentPrefix,
|
|
18
19
|
composeFarmFullDocument,
|
|
19
20
|
createDefaultErrorMarkup,
|
|
@@ -38,11 +39,13 @@ import {
|
|
|
38
39
|
removeFarmDocumentTitles,
|
|
39
40
|
renderFarmLocaleAlternateLinks,
|
|
40
41
|
resolveDefaultErrorStatus,
|
|
41
|
-
routeBoundaryCoversDirectory
|
|
42
|
-
|
|
42
|
+
routeBoundaryCoversDirectory,
|
|
43
|
+
stripRouteGroups,
|
|
44
|
+
takeFarmHoistedHead
|
|
45
|
+
} from "./chunk-SVQX5HYW.mjs";
|
|
43
46
|
import {
|
|
44
47
|
listFarmMCPLlmsTxtLinks
|
|
45
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-GZOKWJIW.mjs";
|
|
46
49
|
import {
|
|
47
50
|
FARM_DEFAULT_MCP_PATH,
|
|
48
51
|
collectFarmDefaultMCPPages,
|
|
@@ -50,7 +53,7 @@ import {
|
|
|
50
53
|
farmConfigMountsMCP,
|
|
51
54
|
isFarmDefaultMCPPathname,
|
|
52
55
|
resolveFarmDefaultMCPServer
|
|
53
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-UVZMSRHF.mjs";
|
|
54
57
|
import {
|
|
55
58
|
getFarmFormState,
|
|
56
59
|
handleFarmFormActionRequest,
|
|
@@ -61,6 +64,7 @@ import {
|
|
|
61
64
|
uninstallFarmIslandValues
|
|
62
65
|
} from "./chunk-A4PWGL46.mjs";
|
|
63
66
|
import {
|
|
67
|
+
FarmSourceSnapshotStore,
|
|
64
68
|
collectFarmRenderedClientModules,
|
|
65
69
|
createEvaluatedRouteGraph,
|
|
66
70
|
createMarkdownPageHydrationPlanner,
|
|
@@ -70,13 +74,17 @@ import {
|
|
|
70
74
|
getClientModuleMetadata,
|
|
71
75
|
getFarmClientHydrationPlanOptions,
|
|
72
76
|
getIslandStrategyExport,
|
|
77
|
+
isFarmClientModulePlanUnchanged,
|
|
73
78
|
mergeProgrammaticClientRoutes,
|
|
74
79
|
resolveFarmIsolatedClientHydrationMode,
|
|
75
80
|
resolveImportedModule,
|
|
76
81
|
resolveProgrammaticClientRoutes,
|
|
82
|
+
runWithLatestPackageClientBoundaryCache,
|
|
77
83
|
runWithPackageClientBoundaryCacheFile,
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
traceFarmSourceReads,
|
|
85
|
+
usesFarmServerTree,
|
|
86
|
+
withFarmSourceSnapshot
|
|
87
|
+
} from "./chunk-IBVN7SW5.mjs";
|
|
80
88
|
import {
|
|
81
89
|
FARM_ISLAND_REPLAYABLE_SELECTOR
|
|
82
90
|
} from "./chunk-S32PDOLO.mjs";
|
|
@@ -103,7 +111,7 @@ import {
|
|
|
103
111
|
resolveFarmAgentCrawlers,
|
|
104
112
|
resolveFarmAgentSitemap,
|
|
105
113
|
resolveFarmPerformanceConfig
|
|
106
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-OBYM5S5G.mjs";
|
|
107
115
|
import {
|
|
108
116
|
collectFarmLlmsTxtPages,
|
|
109
117
|
createFarmDefaultLlmsTxt,
|
|
@@ -113,7 +121,7 @@ import {
|
|
|
113
121
|
renderFarmLlmsFullTxt,
|
|
114
122
|
resolveFarmAgentOrigin,
|
|
115
123
|
resolveFarmLlmsTxtConfig
|
|
116
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-HY6IVQ54.mjs";
|
|
117
125
|
import {
|
|
118
126
|
createFarmCspNonce,
|
|
119
127
|
createFarmCspNonceRewriter,
|
|
@@ -154,10 +162,10 @@ import {
|
|
|
154
162
|
import {
|
|
155
163
|
createFarmMarkdownRouteModuleFromFile,
|
|
156
164
|
loadFarmMdxComponents
|
|
157
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-XI3OXOMK.mjs";
|
|
158
166
|
import {
|
|
159
167
|
isFarmMarkdownPageFile
|
|
160
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-OIP62QEL.mjs";
|
|
161
169
|
import {
|
|
162
170
|
resolveFarmMdxComponentsModulePath,
|
|
163
171
|
resolveMdxConfig
|
|
@@ -170,7 +178,7 @@ import {
|
|
|
170
178
|
farmRequestWantsMarkdown,
|
|
171
179
|
getFarmMarkdownAlternatePath,
|
|
172
180
|
resolveMarkdownConfig
|
|
173
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-CPMME66W.mjs";
|
|
174
182
|
import {
|
|
175
183
|
resolveWorkflowsConfig
|
|
176
184
|
} from "./chunk-MGZVDX4R.mjs";
|
|
@@ -208,7 +216,7 @@ import {
|
|
|
208
216
|
_setDefaultFarmI18nRuntime,
|
|
209
217
|
createFarmI18nRuntime,
|
|
210
218
|
getFarmI18nClientSnapshot
|
|
211
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-TNYC3TYP.mjs";
|
|
212
220
|
import {
|
|
213
221
|
formatOptionalPeerInstallHint,
|
|
214
222
|
isOptionalPeerInstalled
|
|
@@ -243,7 +251,7 @@ import {
|
|
|
243
251
|
} from "./chunk-TUOO6IK3.mjs";
|
|
244
252
|
import {
|
|
245
253
|
resolveFarmI18nConfig
|
|
246
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-VJSXPN3W.mjs";
|
|
247
255
|
import {
|
|
248
256
|
fileExists,
|
|
249
257
|
globFiles,
|
|
@@ -278,18 +286,14 @@ import {
|
|
|
278
286
|
} from "./chunk-2DA7CLY7.mjs";
|
|
279
287
|
import {
|
|
280
288
|
FARM_VERSION
|
|
281
|
-
} from "./chunk-
|
|
282
|
-
import {
|
|
283
|
-
resolveFarmTrailingSlashRedirect,
|
|
284
|
-
setFarmTrailingSlashPreference
|
|
285
|
-
} from "./chunk-4O26BPUY.mjs";
|
|
289
|
+
} from "./chunk-JMOCMXTQ.mjs";
|
|
286
290
|
import {
|
|
287
291
|
normalizeFarmAPIConfig
|
|
288
292
|
} from "./chunk-W6QLRQ3V.mjs";
|
|
289
293
|
import {
|
|
290
294
|
createFarmLocaleCookie,
|
|
291
295
|
getFarmLocaleVaryHeaders
|
|
292
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-2EVESLP3.mjs";
|
|
293
297
|
import {
|
|
294
298
|
getFarmPageDataRedirect
|
|
295
299
|
} from "./chunk-SD6JGJOM.mjs";
|
|
@@ -313,6 +317,10 @@ import {
|
|
|
313
317
|
getFarmDeploymentMismatch,
|
|
314
318
|
withoutFarmDeploymentCookie
|
|
315
319
|
} from "./chunk-IWJONXPF.mjs";
|
|
320
|
+
import {
|
|
321
|
+
resolveFarmTrailingSlashRedirect,
|
|
322
|
+
setFarmTrailingSlashPreference
|
|
323
|
+
} from "./chunk-4O26BPUY.mjs";
|
|
316
324
|
import {
|
|
317
325
|
createFarmCacheKey
|
|
318
326
|
} from "./chunk-GLOICKDO.mjs";
|
|
@@ -442,6 +450,8 @@ function getRouteSpecificity(entry) {
|
|
|
442
450
|
function compareRouteEntries(left, right) {
|
|
443
451
|
return compareRouteSpecificity(getRouteSpecificity(left), getRouteSpecificity(right));
|
|
444
452
|
}
|
|
453
|
+
var PLAN_SOURCE = /\.(?:[cm]?[jt]sx?|vue|svelte)$/;
|
|
454
|
+
var NODE_MODULES_SEGMENT = `${path2.sep}node_modules${path2.sep}`;
|
|
445
455
|
var RouteManager = class _RouteManager {
|
|
446
456
|
constructor(config, viteServer) {
|
|
447
457
|
this.routes = /* @__PURE__ */ new Map();
|
|
@@ -460,6 +470,14 @@ var RouteManager = class _RouteManager {
|
|
|
460
470
|
this.programmaticClientRoutes = mergeProgrammaticClientRoutes([]);
|
|
461
471
|
this.discovery = Promise.resolve();
|
|
462
472
|
this.reportedIslandsErrors = /* @__PURE__ */ new Set();
|
|
473
|
+
// Each route module's hydration plan from the last plan, with the source files it read, so a dev
|
|
474
|
+
// replan recomputes only the modules that read an edited file. Every replan used to read and
|
|
475
|
+
// walk every route's import graph again, seconds on a large app, before an edit could update.
|
|
476
|
+
this.ownerPlans = /* @__PURE__ */ new Map();
|
|
477
|
+
this.sourceChangeTracking = false;
|
|
478
|
+
this.linkedSources = /* @__PURE__ */ new Map();
|
|
479
|
+
// Source files edited since the last plan; null when the next plan must recompute every module.
|
|
480
|
+
this.editedSources = null;
|
|
463
481
|
this.config = config;
|
|
464
482
|
this.viteServer = viteServer;
|
|
465
483
|
if (viteServer) trackProgrammaticRouteSources();
|
|
@@ -775,10 +793,88 @@ var RouteManager = class _RouteManager {
|
|
|
775
793
|
return this.clientManifestCache.manifest;
|
|
776
794
|
}
|
|
777
795
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
)
|
|
796
|
+
const compute = () => withFarmSourceSnapshot(
|
|
797
|
+
() => this.computeClientManifest(normalizedProjectRoot),
|
|
798
|
+
this.sourceSnapshot
|
|
799
|
+
);
|
|
800
|
+
return cacheFile ? runWithPackageClientBoundaryCacheFile(cacheFile, compute) : compute();
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
|
|
804
|
+
* reuse the plan of each route module that read none of the edited files. Without tracking,
|
|
805
|
+
* every plan recomputes every module.
|
|
806
|
+
*/
|
|
807
|
+
trackSourceChanges() {
|
|
808
|
+
this.sourceChangeTracking = true;
|
|
809
|
+
this.sourceSnapshot ?? (this.sourceSnapshot = new FarmSourceSnapshotStore());
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* @internal A watched file changed. An edit to a script narrows the next replan to the route
|
|
813
|
+
* modules that read it; a script added or removed (where an import may now resolve), or a
|
|
814
|
+
* changed JSON file (a package manifest or tsconfig paths), replans everything. Other files
|
|
815
|
+
* (stylesheets, Markdown, assets) are not read by plans.
|
|
816
|
+
*/
|
|
817
|
+
noteSourceChange(file, event) {
|
|
818
|
+
if (file.endsWith(".d.ts")) return;
|
|
819
|
+
if (PLAN_SOURCE.test(file)) {
|
|
820
|
+
if (event === "update") {
|
|
821
|
+
this.editedSources?.add(path2.resolve(file));
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
} else if (!/\.jsonc?$/.test(file)) {
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
this.editedSources = null;
|
|
828
|
+
this.sourceSnapshot?.clear();
|
|
829
|
+
this.linkedSources.clear();
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* @internal Whether an edit to `file` leaves the current plan as it is: a client module the
|
|
833
|
+
* last plan read whose directive, island and hydrate exports, export shape and imports the edit
|
|
834
|
+
* kept. The next replan reads it again (the watcher reported it).
|
|
835
|
+
*/
|
|
836
|
+
isEditPlanNeutral(file) {
|
|
837
|
+
if (!this.sourceChangeTracking || !this.editedSources || !this.clientManifestCache) {
|
|
838
|
+
return false;
|
|
839
|
+
}
|
|
840
|
+
const previous = this.sourceSnapshot?.peekSource(path2.resolve(file));
|
|
841
|
+
return previous !== void 0 && isFarmClientModulePlanUnchanged(file, previous);
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
|
|
845
|
+
* Callers get a copy, since the route budget rewrites a plan's fields in place.
|
|
846
|
+
*/
|
|
847
|
+
planRouteModule(key, edited, compute) {
|
|
848
|
+
const previous = this.ownerPlans.get(key);
|
|
849
|
+
if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
|
|
850
|
+
return { ...previous.plan };
|
|
851
|
+
}
|
|
852
|
+
const { result, files } = traceFarmSourceReads(compute);
|
|
853
|
+
const sources = /* @__PURE__ */ new Set();
|
|
854
|
+
for (const file of files) {
|
|
855
|
+
const source = this.planSourcePath(file);
|
|
856
|
+
if (source) sources.add(source);
|
|
857
|
+
}
|
|
858
|
+
this.ownerPlans.set(key, { plan: result, files: sources });
|
|
859
|
+
return { ...result };
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* The path the watcher reports for a file a plan read: itself, or the real path of a workspace
|
|
863
|
+
* package's source read through its `node_modules` link. Null for an installed package's file.
|
|
864
|
+
*/
|
|
865
|
+
planSourcePath(file) {
|
|
866
|
+
if (!file.includes(NODE_MODULES_SEGMENT)) return file;
|
|
867
|
+
let source = this.linkedSources.get(file);
|
|
868
|
+
if (source === void 0) {
|
|
869
|
+
try {
|
|
870
|
+
const real = realpathSync(file);
|
|
871
|
+
source = real.includes(NODE_MODULES_SEGMENT) ? null : real;
|
|
872
|
+
} catch {
|
|
873
|
+
source = null;
|
|
874
|
+
}
|
|
875
|
+
this.linkedSources.set(file, source);
|
|
876
|
+
}
|
|
877
|
+
return source;
|
|
782
878
|
}
|
|
783
879
|
/**
|
|
784
880
|
* @internal Keep package client-boundary inspections in `file` between plans, as the dev server
|
|
@@ -787,6 +883,15 @@ var RouteManager = class _RouteManager {
|
|
|
787
883
|
usePackageClientBoundaryCacheFile(file) {
|
|
788
884
|
this.packageClientBoundaryCacheFile = file;
|
|
789
885
|
}
|
|
886
|
+
/**
|
|
887
|
+
* @internal Run `operation` (synchronous) with the package inspections of the latest plan, as
|
|
888
|
+
* the dev server's transforms and renders inspect the packages a module imports. Without a cache
|
|
889
|
+
* file (outside the dev server), it runs as it is.
|
|
890
|
+
*/
|
|
891
|
+
inspectPackages(operation) {
|
|
892
|
+
const file = this.packageClientBoundaryCacheFile;
|
|
893
|
+
return file ? runWithLatestPackageClientBoundaryCache(file, operation) : operation();
|
|
894
|
+
}
|
|
790
895
|
computeClientManifest(normalizedProjectRoot) {
|
|
791
896
|
const toUrlPath = (absolutePath) => {
|
|
792
897
|
const rootRelative = toRootRelativeUrlPath(absolutePath, normalizedProjectRoot);
|
|
@@ -820,27 +925,50 @@ var RouteManager = class _RouteManager {
|
|
|
820
925
|
Boolean(unsupportedIntegrationProvider)
|
|
821
926
|
);
|
|
822
927
|
const islandsMode = resolveFarmServerComponentsMode(this.config.experimental?.serverComponents) === "islands";
|
|
928
|
+
const changed = this.sourceSnapshot?.refresh(this.editedSources ?? []);
|
|
929
|
+
let edited = null;
|
|
930
|
+
if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
|
|
931
|
+
edited = /* @__PURE__ */ new Set();
|
|
932
|
+
for (const [file, previous] of changed ?? []) {
|
|
933
|
+
if (isFarmClientModulePlanUnchanged(file, previous)) continue;
|
|
934
|
+
const source = this.planSourcePath(file);
|
|
935
|
+
if (source) edited.add(source);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
if (!edited) this.ownerPlans.clear();
|
|
823
939
|
const layoutEntries = Array.from(this.layouts.values()).map((entry) => ({
|
|
824
940
|
entry,
|
|
825
|
-
metadata:
|
|
826
|
-
entry.modulePath
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
941
|
+
metadata: this.planRouteModule(
|
|
942
|
+
`layout:${entry.modulePath}`,
|
|
943
|
+
edited,
|
|
944
|
+
() => getClientModuleHydrationPlan(
|
|
945
|
+
entry.modulePath,
|
|
946
|
+
normalizedProjectRoot,
|
|
947
|
+
isolatedMode,
|
|
948
|
+
islandsMode ? { ...planOptions, serverTreeLayouts: true } : planOptions
|
|
949
|
+
)
|
|
830
950
|
)
|
|
831
951
|
}));
|
|
832
|
-
const
|
|
952
|
+
const markdownComponentsPlan = createMarkdownPageHydrationPlanner(
|
|
833
953
|
resolveFarmMdxComponentsModulePath(resolveMdxConfig(this.config.mdx), normalizedProjectRoot),
|
|
834
954
|
normalizedProjectRoot,
|
|
835
955
|
isolatedMode,
|
|
836
956
|
{ ...planOptions, packageReferences: islandsMode }
|
|
837
957
|
);
|
|
958
|
+
let markdownPlan;
|
|
959
|
+
const markdownPagePlan = () => ({
|
|
960
|
+
...markdownPlan ?? (markdownPlan = this.planRouteModule("markdown", edited, markdownComponentsPlan))
|
|
961
|
+
});
|
|
838
962
|
const routeEntries = Array.from(this.routes.values()).map((entry) => ({
|
|
839
963
|
entry,
|
|
840
|
-
metadata: isFarmMarkdownPageFile(entry.modulePath) ? markdownPagePlan() :
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
964
|
+
metadata: isFarmMarkdownPageFile(entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
|
|
965
|
+
`page:${entry.modulePath}`,
|
|
966
|
+
edited,
|
|
967
|
+
() => getClientModuleHydrationPlan(entry.modulePath, normalizedProjectRoot, isolatedMode, {
|
|
968
|
+
...planOptions,
|
|
969
|
+
serverOwners: resolveFarmServerComponentsMode(this.config.experimental?.serverComponents) === "islands"
|
|
970
|
+
})
|
|
971
|
+
)
|
|
844
972
|
}));
|
|
845
973
|
const markdownFallback = routeEntries.find(
|
|
846
974
|
({ entry, metadata }) => isFarmMarkdownPageFile(entry.modulePath) && metadata.fallbackReason
|
|
@@ -997,6 +1125,7 @@ var RouteManager = class _RouteManager {
|
|
|
997
1125
|
logger.error(`[Farm.js] islands mode cannot hydrate ${error}`);
|
|
998
1126
|
}
|
|
999
1127
|
const manifest = { routes, layouts, slots };
|
|
1128
|
+
this.editedSources = this.sourceChangeTracking ? /* @__PURE__ */ new Set() : null;
|
|
1000
1129
|
this.clientManifestCache = {
|
|
1001
1130
|
projectRoot: normalizedProjectRoot,
|
|
1002
1131
|
manifest,
|
|
@@ -1706,6 +1835,58 @@ function toRealPath(filePath) {
|
|
|
1706
1835
|
}
|
|
1707
1836
|
}
|
|
1708
1837
|
|
|
1838
|
+
// src/server/dev-client-manifest.ts
|
|
1839
|
+
var FARM_DEV_CLIENT_MANIFEST_MODULE = "/@farm/manifest";
|
|
1840
|
+
function createFarmDevClientManifest(manifest, options) {
|
|
1841
|
+
const { boot } = options;
|
|
1842
|
+
const layoutPatterns = boot ? new Set(boot.layoutPatterns) : void 0;
|
|
1843
|
+
const owners = boot ? /* @__PURE__ */ new Set([...boot.routePattern ? [boot.routePattern] : [], ...boot.layoutPatterns]) : void 0;
|
|
1844
|
+
const clientManifest = {
|
|
1845
|
+
clientEntry: "/@farm/client.js",
|
|
1846
|
+
routes: {},
|
|
1847
|
+
layouts: {},
|
|
1848
|
+
slots: [],
|
|
1849
|
+
sharedAssets: options.sharedAssets,
|
|
1850
|
+
...boot ? { module: FARM_DEV_CLIENT_MANIFEST_MODULE } : {}
|
|
1851
|
+
};
|
|
1852
|
+
for (const route of manifest.routes) {
|
|
1853
|
+
if (boot && route.pattern !== boot.routePattern && !route.search) continue;
|
|
1854
|
+
clientManifest.routes[route.pattern] = {
|
|
1855
|
+
modulePath: route.modulePath,
|
|
1856
|
+
pattern: route.pattern,
|
|
1857
|
+
...route.directory ? { directory: route.directory } : {},
|
|
1858
|
+
segments: route.segments,
|
|
1859
|
+
search: route.search,
|
|
1860
|
+
isClientComponent: route.isClientComponent,
|
|
1861
|
+
shouldHydrate: route.shouldHydrate,
|
|
1862
|
+
islandStrategy: route.islandStrategy,
|
|
1863
|
+
renderPlan: route.renderPlan,
|
|
1864
|
+
preloads: [route.modulePath],
|
|
1865
|
+
assets: []
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
for (const layout of manifest.layouts) {
|
|
1869
|
+
if (layoutPatterns && !layoutPatterns.has(layout.pattern)) continue;
|
|
1870
|
+
const groupScope = getRouteGroupScope(layout.pattern);
|
|
1871
|
+
clientManifest.layouts[layout.pattern] = {
|
|
1872
|
+
modulePath: layout.modulePath,
|
|
1873
|
+
pattern: layout.pattern,
|
|
1874
|
+
...groupScope ? { urlPattern: stripRouteGroups(layout.pattern), groupScope } : {},
|
|
1875
|
+
shouldHydrate: layout.shouldHydrate,
|
|
1876
|
+
islandStrategy: layout.islandStrategy,
|
|
1877
|
+
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
1878
|
+
...layout.serverTree ? { serverTree: true } : {},
|
|
1879
|
+
preloads: layout.serverTree ? [] : [layout.modulePath],
|
|
1880
|
+
assets: []
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
for (const slot of manifest.slots ?? []) {
|
|
1884
|
+
if (owners && !owners.has(slot.ownerPattern)) continue;
|
|
1885
|
+
clientManifest.slots.push({ ...slot, preloads: [slot.modulePath], assets: [] });
|
|
1886
|
+
}
|
|
1887
|
+
return clientManifest;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1709
1890
|
// src/server/dev-styles.ts
|
|
1710
1891
|
import * as fs from "fs";
|
|
1711
1892
|
import * as path3 from "path";
|
|
@@ -2882,7 +3063,28 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
2882
3063
|
});
|
|
2883
3064
|
return result;
|
|
2884
3065
|
}
|
|
3066
|
+
var routeRootInferences = /* @__PURE__ */ new Map();
|
|
3067
|
+
function invalidateFarmRouteRootInferences() {
|
|
3068
|
+
routeRootInferences.clear();
|
|
3069
|
+
}
|
|
2885
3070
|
function inferFarmRouteRootStrategy(owners, root) {
|
|
3071
|
+
const key = [root ?? "", ...owners.map((owner) => path6.resolve(owner))].join("\n");
|
|
3072
|
+
const cached = routeRootInferences.get(key);
|
|
3073
|
+
if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
|
|
3074
|
+
return cached.result;
|
|
3075
|
+
}
|
|
3076
|
+
const { result, files } = traceFarmSourceReads(() => inferRouteRoot(owners, root));
|
|
3077
|
+
const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
|
|
3078
|
+
routeRootInferences.set(key, {
|
|
3079
|
+
stamps: [...read].map((file) => [file, modifiedAt(file)]),
|
|
3080
|
+
result
|
|
3081
|
+
});
|
|
3082
|
+
return result;
|
|
3083
|
+
}
|
|
3084
|
+
function isInstalledPackageFile(file) {
|
|
3085
|
+
return file.split(path6.sep).includes("node_modules");
|
|
3086
|
+
}
|
|
3087
|
+
function inferRouteRoot(owners, root) {
|
|
2886
3088
|
const files = [];
|
|
2887
3089
|
const modules = [];
|
|
2888
3090
|
for (const owner of owners) {
|
|
@@ -3627,6 +3829,32 @@ var ServerRenderer = class {
|
|
|
3627
3829
|
(href) => `<link rel="stylesheet" href="${escapeHtmlAttribute2(href)}">`
|
|
3628
3830
|
);
|
|
3629
3831
|
}
|
|
3832
|
+
/**
|
|
3833
|
+
* The client manifest a development document inlines: the entries its page reads before the
|
|
3834
|
+
* first navigation. Inlining every route made each document grow with the app (about 650 KB at
|
|
3835
|
+
* 1,000 routes); the client imports the whole manifest only when a navigation needs it.
|
|
3836
|
+
*/
|
|
3837
|
+
createDevBootClientManifest(req, options) {
|
|
3838
|
+
const layouts = req.__FARM_LAYOUTS__ || [];
|
|
3839
|
+
return createFarmDevClientManifest(
|
|
3840
|
+
options.routeManifest ?? this.routeManager.generateClientManifest(this.config.root),
|
|
3841
|
+
{
|
|
3842
|
+
sharedAssets: [
|
|
3843
|
+
...this.devGlobalStylesheetAssets(),
|
|
3844
|
+
...this.collectDevStyleHrefs().map((href) => ({
|
|
3845
|
+
tag: "link",
|
|
3846
|
+
attrs: { rel: "stylesheet", href }
|
|
3847
|
+
}))
|
|
3848
|
+
],
|
|
3849
|
+
boot: {
|
|
3850
|
+
routePattern: options.clientRoutePattern,
|
|
3851
|
+
layoutPatterns: layouts.flatMap(
|
|
3852
|
+
(layout) => typeof layout.pattern === "string" ? [layout.pattern] : []
|
|
3853
|
+
)
|
|
3854
|
+
}
|
|
3855
|
+
}
|
|
3856
|
+
);
|
|
3857
|
+
}
|
|
3630
3858
|
/**
|
|
3631
3859
|
* A layout's boundary. Islands mode keys it (the pattern with its params, as the production
|
|
3632
3860
|
* server does), so a navigation can name the layouts the browser shows; a layout the browser
|
|
@@ -3655,6 +3883,11 @@ var ServerRenderer = class {
|
|
|
3655
3883
|
return this.rendererRuntime.wrapClientGraph(element);
|
|
3656
3884
|
}
|
|
3657
3885
|
/** The page a hydrating layout keeps as server HTML: islands again, or a server tree. */
|
|
3886
|
+
/** The route root's strategy, inspecting packages with the dev server's latest plan's cache. */
|
|
3887
|
+
resolveRouteRootStrategy(...args) {
|
|
3888
|
+
const resolve3 = () => resolveFarmRouteRootStrategy(...args);
|
|
3889
|
+
return typeof this.routeManager.inspectPackages === "function" ? this.routeManager.inspectPackages(resolve3) : resolve3();
|
|
3890
|
+
}
|
|
3658
3891
|
async isolateServerPage(element, serverTree) {
|
|
3659
3892
|
if (islands && this.islandValues()) {
|
|
3660
3893
|
const runtime = islands;
|
|
@@ -3730,7 +3963,11 @@ var ServerRenderer = class {
|
|
|
3730
3963
|
);
|
|
3731
3964
|
return { html: rendered.html, head: rendered.head || "" };
|
|
3732
3965
|
}
|
|
3733
|
-
|
|
3966
|
+
const { head, body } = takeFarmHoistedHead(
|
|
3967
|
+
await this.renderElementToCompleteHTML(element, options),
|
|
3968
|
+
true
|
|
3969
|
+
);
|
|
3970
|
+
return { html: body, head };
|
|
3734
3971
|
}
|
|
3735
3972
|
/** Islands mode sends large prop values once, keyed by content (RFC 0003). */
|
|
3736
3973
|
islandValues() {
|
|
@@ -3890,7 +4127,11 @@ var ServerRenderer = class {
|
|
|
3890
4127
|
key,
|
|
3891
4128
|
{ html },
|
|
3892
4129
|
{
|
|
3893
|
-
|
|
4130
|
+
// revalidatePath() takes the route path (`/pricing`), as the docs show, while the shell
|
|
4131
|
+
// answers the public one (`/console/fr/pricing`): either clears it, as in production.
|
|
4132
|
+
paths: [
|
|
4133
|
+
.../* @__PURE__ */ new Set([options.pathname, this.routeManager.toRoutePathname(options.pathname)])
|
|
4134
|
+
],
|
|
3894
4135
|
tags: ["ppr"],
|
|
3895
4136
|
revalidate: options.revalidate ?? false
|
|
3896
4137
|
}
|
|
@@ -4494,7 +4735,7 @@ var ServerRenderer = class {
|
|
|
4494
4735
|
(metadata) => metadata.shouldHydrate && metadata.islandStrategy ? [metadata.islandStrategy] : []
|
|
4495
4736
|
)
|
|
4496
4737
|
];
|
|
4497
|
-
const hydrationIslandStrategy = this.islandValues() ?
|
|
4738
|
+
const hydrationIslandStrategy = this.islandValues() ? this.resolveRouteRootStrategy(
|
|
4498
4739
|
route,
|
|
4499
4740
|
{ shouldHydrate, islandStrategy: moduleMetadata.islandStrategy ?? null },
|
|
4500
4741
|
layouts.map((layout, index) => ({
|
|
@@ -4708,6 +4949,7 @@ var ServerRenderer = class {
|
|
|
4708
4949
|
{
|
|
4709
4950
|
responseHeaders: pprHeaders,
|
|
4710
4951
|
routeManifest,
|
|
4952
|
+
clientRoutePattern: route.pattern,
|
|
4711
4953
|
captureStaticShell: Boolean(pprShellOptions),
|
|
4712
4954
|
observabilityRoute: pathname,
|
|
4713
4955
|
onSuspenseHoleDetected: pprShellOptions ? () => emitFarmEvent({
|
|
@@ -5210,7 +5452,7 @@ var ServerRenderer = class {
|
|
|
5210
5452
|
const server = this.getDefaultMCPServer();
|
|
5211
5453
|
const request2 = getCurrentRequestOrNull() ?? createWebRequestFromFarmRequest(req, { trustProxy: this.config.server?.trustProxy });
|
|
5212
5454
|
try {
|
|
5213
|
-
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-
|
|
5455
|
+
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-RK7LDYEL.mjs");
|
|
5214
5456
|
const origin = new URL(request2.url).origin;
|
|
5215
5457
|
const i18n = this.i18nRuntime?.config;
|
|
5216
5458
|
const metadataBase = await this.getRootMetadataBase();
|
|
@@ -5470,7 +5712,7 @@ var ServerRenderer = class {
|
|
|
5470
5712
|
options.middlewareMap,
|
|
5471
5713
|
() => _runWithMiddlewareContext(
|
|
5472
5714
|
options.middlewareContext,
|
|
5473
|
-
() => this.
|
|
5715
|
+
() => this.renderElementToCompleteHTML(wrapped)
|
|
5474
5716
|
)
|
|
5475
5717
|
);
|
|
5476
5718
|
res.statusCode = options.statusCode;
|
|
@@ -5502,53 +5744,7 @@ var ServerRenderer = class {
|
|
|
5502
5744
|
res.setHeader(key, value);
|
|
5503
5745
|
}
|
|
5504
5746
|
try {
|
|
5505
|
-
const
|
|
5506
|
-
const clientManifest = {
|
|
5507
|
-
clientEntry: "/@farm/client.js",
|
|
5508
|
-
routes: {},
|
|
5509
|
-
layouts: {},
|
|
5510
|
-
slots: [],
|
|
5511
|
-
sharedAssets: [
|
|
5512
|
-
...this.devGlobalStylesheetAssets(),
|
|
5513
|
-
...this.collectDevStyleHrefs().map((href) => ({
|
|
5514
|
-
tag: "link",
|
|
5515
|
-
attrs: { rel: "stylesheet", href }
|
|
5516
|
-
}))
|
|
5517
|
-
]
|
|
5518
|
-
};
|
|
5519
|
-
for (const routeEntry of manifest.routes) {
|
|
5520
|
-
clientManifest.routes[routeEntry.pattern] = {
|
|
5521
|
-
modulePath: routeEntry.modulePath,
|
|
5522
|
-
pattern: routeEntry.pattern,
|
|
5523
|
-
segments: routeEntry.segments,
|
|
5524
|
-
search: routeEntry.search,
|
|
5525
|
-
isClientComponent: routeEntry.isClientComponent,
|
|
5526
|
-
shouldHydrate: routeEntry.shouldHydrate,
|
|
5527
|
-
islandStrategy: routeEntry.islandStrategy,
|
|
5528
|
-
renderPlan: routeEntry.renderPlan,
|
|
5529
|
-
preloads: [routeEntry.modulePath],
|
|
5530
|
-
assets: []
|
|
5531
|
-
};
|
|
5532
|
-
}
|
|
5533
|
-
for (const layoutEntry of manifest.layouts) {
|
|
5534
|
-
clientManifest.layouts[layoutEntry.pattern] = {
|
|
5535
|
-
modulePath: layoutEntry.modulePath,
|
|
5536
|
-
pattern: layoutEntry.pattern,
|
|
5537
|
-
shouldHydrate: layoutEntry.shouldHydrate,
|
|
5538
|
-
islandStrategy: layoutEntry.islandStrategy,
|
|
5539
|
-
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
5540
|
-
...layoutEntry.serverTree ? { serverTree: true } : {},
|
|
5541
|
-
preloads: layoutEntry.serverTree ? [] : [layoutEntry.modulePath],
|
|
5542
|
-
assets: []
|
|
5543
|
-
};
|
|
5544
|
-
}
|
|
5545
|
-
for (const slotEntry of manifest.slots ?? []) {
|
|
5546
|
-
clientManifest.slots.push({
|
|
5547
|
-
...slotEntry,
|
|
5548
|
-
preloads: [slotEntry.modulePath],
|
|
5549
|
-
assets: []
|
|
5550
|
-
});
|
|
5551
|
-
}
|
|
5747
|
+
const clientManifest = this.createDevBootClientManifest(req, options);
|
|
5552
5748
|
const routeSlots = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
5553
5749
|
(slot) => ({
|
|
5554
5750
|
...slot,
|
|
@@ -5772,53 +5968,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
5772
5968
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
5773
5969
|
const isClientComponent = req.__FARM_IS_CLIENT_COMPONENT__ === true;
|
|
5774
5970
|
const relativePath = pagePath ? toViteModuleId(pagePath, this.config.root) : "/src/app/page.tsx";
|
|
5775
|
-
const
|
|
5776
|
-
const clientManifest = {
|
|
5777
|
-
clientEntry: "/@farm/client.js",
|
|
5778
|
-
routes: {},
|
|
5779
|
-
layouts: {},
|
|
5780
|
-
slots: [],
|
|
5781
|
-
sharedAssets: [
|
|
5782
|
-
...this.devGlobalStylesheetAssets(),
|
|
5783
|
-
...this.collectDevStyleHrefs().map((href) => ({
|
|
5784
|
-
tag: "link",
|
|
5785
|
-
attrs: { rel: "stylesheet", href }
|
|
5786
|
-
}))
|
|
5787
|
-
]
|
|
5788
|
-
};
|
|
5789
|
-
for (const routeEntry of manifest.routes) {
|
|
5790
|
-
clientManifest.routes[routeEntry.pattern] = {
|
|
5791
|
-
modulePath: routeEntry.modulePath,
|
|
5792
|
-
pattern: routeEntry.pattern,
|
|
5793
|
-
segments: routeEntry.segments,
|
|
5794
|
-
search: routeEntry.search,
|
|
5795
|
-
isClientComponent: routeEntry.isClientComponent,
|
|
5796
|
-
shouldHydrate: routeEntry.shouldHydrate,
|
|
5797
|
-
islandStrategy: routeEntry.islandStrategy,
|
|
5798
|
-
renderPlan: routeEntry.renderPlan,
|
|
5799
|
-
preloads: [routeEntry.modulePath],
|
|
5800
|
-
assets: []
|
|
5801
|
-
};
|
|
5802
|
-
}
|
|
5803
|
-
for (const layoutEntry of manifest.layouts) {
|
|
5804
|
-
clientManifest.layouts[layoutEntry.pattern] = {
|
|
5805
|
-
modulePath: layoutEntry.modulePath,
|
|
5806
|
-
pattern: layoutEntry.pattern,
|
|
5807
|
-
shouldHydrate: layoutEntry.shouldHydrate,
|
|
5808
|
-
islandStrategy: layoutEntry.islandStrategy,
|
|
5809
|
-
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
5810
|
-
...layoutEntry.serverTree ? { serverTree: true } : {},
|
|
5811
|
-
preloads: layoutEntry.serverTree ? [] : [layoutEntry.modulePath],
|
|
5812
|
-
assets: []
|
|
5813
|
-
};
|
|
5814
|
-
}
|
|
5815
|
-
for (const slotEntry of manifest.slots ?? []) {
|
|
5816
|
-
clientManifest.slots.push({
|
|
5817
|
-
...slotEntry,
|
|
5818
|
-
preloads: [slotEntry.modulePath],
|
|
5819
|
-
assets: []
|
|
5820
|
-
});
|
|
5821
|
-
}
|
|
5971
|
+
const clientManifest = this.createDevBootClientManifest(req, options);
|
|
5822
5972
|
const routeSlotPayload = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
5823
5973
|
(slot) => ({
|
|
5824
5974
|
...slot,
|
|
@@ -5932,11 +6082,20 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
5932
6082
|
<body class="">${earlyClient ? `
|
|
5933
6083
|
${earlyClientScript}` : ""}
|
|
5934
6084
|
<div id="root">`;
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
6085
|
+
let pendingShell = streamDocument ? "" : stampDocumentHTML(shell);
|
|
6086
|
+
let heldHead = "";
|
|
6087
|
+
const releaseShell = (complete) => {
|
|
6088
|
+
const split = takeFarmHoistedHead(heldHead, complete);
|
|
6089
|
+
if (!split) return null;
|
|
6090
|
+
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? removeFarmDocumentTitles(pendingShell) : pendingShell;
|
|
6091
|
+
const opened = appendFarmHead(shellHead, split.head);
|
|
6092
|
+
pendingShell = "";
|
|
6093
|
+
heldHead = "";
|
|
6094
|
+
htmlParts.push(opened);
|
|
6095
|
+
staticShellParts?.push(opened);
|
|
6096
|
+
res.write(opened);
|
|
6097
|
+
return split.body;
|
|
6098
|
+
};
|
|
5940
6099
|
const withEarlyClient = (document) => earlyClient ? {
|
|
5941
6100
|
...document,
|
|
5942
6101
|
html: document.html.replace(
|
|
@@ -6016,6 +6175,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6016
6175
|
const writableStream = new Writable({
|
|
6017
6176
|
write(chunk, encoding, callback) {
|
|
6018
6177
|
if (flushMarker && chunk === flushMarker) {
|
|
6178
|
+
if (pendingShell) releaseShell(true);
|
|
6019
6179
|
const marker = documentTransform ? documentTransform.write(flushMarker.toString()) : flushMarker;
|
|
6020
6180
|
res.write(marker, () => {
|
|
6021
6181
|
if (typeof res.flush === "function") res.flush();
|
|
@@ -6028,7 +6188,18 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6028
6188
|
firstChunk = false;
|
|
6029
6189
|
}
|
|
6030
6190
|
const chunkText = Buffer.isBuffer(chunk) ? cspStreamDecoder ? cspStreamDecoder.decode(chunk, { stream: true }) : chunk.toString() : String(chunk);
|
|
6031
|
-
|
|
6191
|
+
let securedChunkText = cspNonceRewriter ? cspNonceRewriter.write(chunkText) : chunkText;
|
|
6192
|
+
let held = false;
|
|
6193
|
+
if (pendingShell) {
|
|
6194
|
+
heldHead += securedChunkText;
|
|
6195
|
+
const body = releaseShell(false);
|
|
6196
|
+
if (body === null) {
|
|
6197
|
+
callback();
|
|
6198
|
+
return;
|
|
6199
|
+
}
|
|
6200
|
+
securedChunkText = body;
|
|
6201
|
+
held = true;
|
|
6202
|
+
}
|
|
6032
6203
|
const outputText = documentTransform ? documentTransform.write(securedChunkText) : securedChunkText;
|
|
6033
6204
|
recordRenderedChunk(outputText, securedChunkText);
|
|
6034
6205
|
const onWrite = () => {
|
|
@@ -6038,10 +6209,18 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6038
6209
|
if (documentTransform) {
|
|
6039
6210
|
if (outputText) res.write(outputText, onWrite);
|
|
6040
6211
|
else callback();
|
|
6041
|
-
} else if (cspNonceRewriter) res.write(securedChunkText, onWrite);
|
|
6212
|
+
} else if (cspNonceRewriter || held) res.write(securedChunkText, onWrite);
|
|
6042
6213
|
else res.write(chunk, encoding, onWrite);
|
|
6043
6214
|
},
|
|
6044
6215
|
final: (callback) => {
|
|
6216
|
+
if (pendingShell) {
|
|
6217
|
+
const body = releaseShell(true);
|
|
6218
|
+
if (body) {
|
|
6219
|
+
htmlParts.push(body);
|
|
6220
|
+
staticShellParts?.push(body);
|
|
6221
|
+
res.write(body);
|
|
6222
|
+
}
|
|
6223
|
+
}
|
|
6045
6224
|
if (lateNavigationError) {
|
|
6046
6225
|
const navigationError = lateNavigationError;
|
|
6047
6226
|
lateNavigationError = null;
|
|
@@ -6114,7 +6293,6 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6114
6293
|
});
|
|
6115
6294
|
resolve3();
|
|
6116
6295
|
};
|
|
6117
|
-
res.write(securedShell);
|
|
6118
6296
|
if (typeof res.flush === "function") {
|
|
6119
6297
|
res.flush();
|
|
6120
6298
|
}
|
|
@@ -6230,11 +6408,10 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6230
6408
|
const NotFoundComponent = await this.loadNotFoundComponent();
|
|
6231
6409
|
if (NotFoundComponent) {
|
|
6232
6410
|
try {
|
|
6233
|
-
content = await this.
|
|
6411
|
+
content = await this.renderElementToCompleteHTML(
|
|
6234
6412
|
await this.wrapWithIntegrationProviders(
|
|
6235
6413
|
this.rendererRuntime.createElement(NotFoundComponent, { pathname })
|
|
6236
|
-
)
|
|
6237
|
-
rendererRenderOptions()
|
|
6414
|
+
)
|
|
6238
6415
|
);
|
|
6239
6416
|
} catch (error2) {
|
|
6240
6417
|
logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
@@ -6296,10 +6473,7 @@ window.__FARM_I18N__ = ${getFarmI18nClientSnapshot() ? serializeInlineValue(getF
|
|
|
6296
6473
|
});
|
|
6297
6474
|
}
|
|
6298
6475
|
element = await this.wrapWithIntegrationProviders(element);
|
|
6299
|
-
const content = await this.
|
|
6300
|
-
element,
|
|
6301
|
-
rendererRenderOptions()
|
|
6302
|
-
);
|
|
6476
|
+
const content = await this.renderElementToCompleteHTML(element);
|
|
6303
6477
|
const { head: head2, metadata: metadata2 } = await this.notFoundMetadataHead(layoutModule, notFoundModule);
|
|
6304
6478
|
const html2 = this.createFullHTML(content, false, pathname, head2, { req, metadata: metadata2 });
|
|
6305
6479
|
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
@@ -7660,6 +7834,7 @@ ${FARM_DARK_VARIANT}
|
|
|
7660
7834
|
export {
|
|
7661
7835
|
inspectStaticMetadataImage,
|
|
7662
7836
|
RouteManager,
|
|
7837
|
+
createFarmDevClientManifest,
|
|
7663
7838
|
resolveDevGlobalStylesheetHref,
|
|
7664
7839
|
collectDevStylesheetUrls,
|
|
7665
7840
|
resolveFarmNotFoundComponentPath,
|
|
@@ -7669,6 +7844,7 @@ export {
|
|
|
7669
7844
|
generateFarmIntegrationProviderClientCode,
|
|
7670
7845
|
generateFarmIntegrationProviderServerModules,
|
|
7671
7846
|
inferFarmIslandStrategy,
|
|
7847
|
+
invalidateFarmRouteRootInferences,
|
|
7672
7848
|
resolveFarmRouteRootStrategy,
|
|
7673
7849
|
canBootFarmIslandsClient,
|
|
7674
7850
|
ServerRenderer,
|