@farm.js/core 0.1.81 → 0.1.82
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-C2Su3x4D.d.ts} +1 -1
- package/dist/{agent-mcp.d-DMqOqnOA.d.mts → agent-mcp.d-Yak-LqRd.d.mts} +1 -1
- package/dist/agent-runtime.cjs +4 -3
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +3 -2
- package/dist/analyzer-LV23T6QN.cjs +17 -0
- package/dist/{analyzer-IC66UJCU.mjs → analyzer-RPU2KG4J.mjs} +2 -2
- package/dist/api/node.cjs +5 -4
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/node.mjs +4 -3
- package/dist/api/route-manager.cjs +5 -4
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +4 -3
- package/dist/api/runtime.cjs +4 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +3 -2
- package/dist/api.cjs +7 -6
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +6 -5
- package/dist/{app-manifest.d-Bbxp5kes.d.mts → app-manifest.d-BcyOFMrg.d.mts} +1 -1
- package/dist/{app-manifest.d-C8Cswd31.d.ts → app-manifest.d-DZyXaICz.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-BJuSurgy.d.mts → app.d-C0ePpuaG.d.mts} +21 -4
- package/dist/{app.d-DGIoFt5D.d.ts → app.d-CIoXsAbN.d.ts} +21 -4
- package/dist/chunk-3DE6RK7K.cjs +36 -0
- package/dist/{chunk-NOYKBGUK.mjs → chunk-47I2MYIR.mjs} +130 -46
- package/dist/{chunk-GY63XD6K.mjs → chunk-4X7LSGM6.mjs} +1 -1
- package/dist/{chunk-BPWTSPK6.mjs → chunk-5AL2GXAU.mjs} +1 -1
- package/dist/{chunk-GAWSWJJ2.cjs → chunk-5GFTMTX3.cjs} +2 -2
- package/dist/{chunk-CPZZBCPO.cjs → chunk-5MUFW5UU.cjs} +2 -2
- package/dist/{chunk-LKIG5SM6.cjs → chunk-5P65LXGU.cjs} +9 -9
- package/dist/{chunk-XOXCQGAF.mjs → chunk-63ZE6B6M.mjs} +1 -1
- package/dist/{chunk-XOGCNKB7.cjs → chunk-6BPFIYGY.cjs} +3 -3
- package/dist/{chunk-UF4BNKKJ.mjs → chunk-6QYPP5KC.mjs} +2 -2
- package/dist/{chunk-ATISIC6G.mjs → chunk-7VJXYB6S.mjs} +7 -1
- package/dist/{chunk-2Y2HRZQY.cjs → chunk-AIPZDBP6.cjs} +312 -228
- package/dist/{chunk-CL7BUGVB.cjs → chunk-ARORZ3MH.cjs} +286 -240
- package/dist/{chunk-ONSZP5JK.mjs → chunk-AUFEM3FB.mjs} +1 -1
- package/dist/{chunk-FYZD7DUS.cjs → chunk-B2PGVHBG.cjs} +4 -4
- package/dist/{chunk-WGWWRV2M.cjs → chunk-B3HQTGXS.cjs} +6 -4
- package/dist/{chunk-M6DAIE4T.cjs → chunk-BCTHOQPP.cjs} +10 -8
- package/dist/{chunk-S3IWDDQ3.mjs → chunk-C3VCYOU4.mjs} +1 -1
- package/dist/{chunk-OO4GVGM3.mjs → chunk-CA2HBLXP.mjs} +11 -1
- package/dist/{chunk-W6C3LEXX.cjs → chunk-CD5Z7RR5.cjs} +155 -20
- package/dist/{chunk-YH7ENV3K.mjs → chunk-CJDBTTLB.mjs} +4 -4
- package/dist/{chunk-5N526T7Q.mjs → chunk-DAXU2NBE.mjs} +74 -18
- package/dist/{chunk-Z5BANEQD.cjs → chunk-DMSXZNQR.cjs} +2 -2
- package/dist/{chunk-46UV2E7I.cjs → chunk-DRO3NXA3.cjs} +9 -9
- package/dist/{chunk-4OFWG4IK.cjs → chunk-EACD6ND7.cjs} +8 -2
- package/dist/{chunk-HTNJ7A4D.mjs → chunk-EL2Z6YFZ.mjs} +2 -2
- package/dist/{chunk-IM3UINTZ.mjs → chunk-GXLNARPO.mjs} +151 -16
- package/dist/{chunk-E3HBD2K3.cjs → chunk-HHQEKLZL.cjs} +2 -2
- package/dist/{chunk-5ZHC6QGD.cjs → chunk-HQKCSJEH.cjs} +8 -2
- package/dist/{chunk-RHI67C2V.cjs → chunk-HUGPJFOC.cjs} +1 -35
- package/dist/{chunk-BJWJP5A4.mjs → chunk-I4DR3HCH.mjs} +3 -3
- package/dist/{chunk-C2OLXVUC.mjs → chunk-IVP5Q4BX.mjs} +10 -3
- package/dist/{chunk-NSLRK5DK.cjs → chunk-JK26IMT7.cjs} +1 -1
- package/dist/{chunk-WIZRYFB2.cjs → chunk-JYQ6DGPW.cjs} +8 -6
- package/dist/{chunk-TYHWZOA2.mjs → chunk-KWI3SQFX.mjs} +4 -2
- package/dist/{chunk-POVHO46S.mjs → chunk-L3RDECA5.mjs} +1 -1
- package/dist/{chunk-MOGRRZMW.cjs → chunk-LM2ZDNDD.cjs} +16 -16
- package/dist/{chunk-RPA45OQS.mjs → chunk-MO4UTDQ6.mjs} +1 -1
- package/dist/{chunk-ZIYJWJV2.cjs → chunk-N2EFMN2K.cjs} +8 -8
- package/dist/{chunk-6WVRVGKC.mjs → chunk-NAHDG6UX.mjs} +1 -1
- package/dist/{chunk-OFVCWV2D.cjs → chunk-NEKO3HM2.cjs} +11 -1
- package/dist/{chunk-SLEHAGGV.mjs → chunk-NQ3Y6E2T.mjs} +7 -1
- package/dist/{chunk-IPG6B25T.mjs → chunk-NRCKBDYP.mjs} +78 -32
- package/dist/{chunk-POL5RCVU.mjs → chunk-OMB7UGVW.mjs} +1 -1
- package/dist/{chunk-D77OGI6X.mjs → chunk-OP5VI4TP.mjs} +1 -1
- package/dist/{chunk-7VCLTNED.mjs → chunk-PNMAD3OS.mjs} +1 -35
- package/dist/{chunk-OIWDEDUO.cjs → chunk-Q2VOT3K2.cjs} +392 -336
- package/dist/{chunk-RZ6XUEQS.mjs → chunk-QSMUMK7Y.mjs} +2 -2
- package/dist/{chunk-2HMSSPCZ.mjs → chunk-RMLR5RMH.mjs} +4 -2
- package/dist/{chunk-ADQ2LATR.cjs → chunk-RMPUEH5T.cjs} +2 -2
- package/dist/{chunk-AHVF5GI2.cjs → chunk-S7WZUK3B.cjs} +2 -2
- package/dist/{chunk-ZKNXCRUQ.cjs → chunk-U54REWMJ.cjs} +23 -23
- package/dist/chunk-U6XYBTUT.mjs +36 -0
- package/dist/{chunk-TCMRLW3K.cjs → chunk-VACYUMXW.cjs} +10 -3
- package/dist/{chunk-OUDNUFVR.cjs → chunk-VMBIKDKW.cjs} +4 -4
- package/dist/{chunk-UGLTOLTJ.cjs → chunk-W76C7TCW.cjs} +2 -2
- package/dist/{chunk-6JWXHPVR.mjs → chunk-XRSNW4IU.mjs} +4 -2
- package/dist/{chunk-TLSGRK7E.mjs → chunk-ZIZRIZLP.mjs} +1 -1
- package/dist/{cli-runtime.d-D8O1v2_X.d.mts → cli-runtime.d-Hnvvadz7.d.mts} +5 -5
- package/dist/{cli-runtime.d-hf4L1MNP.d.ts → cli-runtime.d-I0MphTbc.d.ts} +5 -5
- package/dist/{client-component.d-CX8UCQh-.d.ts → client-component.d-5QEvtJsg.d.ts} +1 -1
- package/dist/{client-component.d-DFwUHlOz.d.mts → client-component.d-DapRqtSC.d.mts} +1 -1
- package/dist/{client-plugins.d-BflSNO-b.d.mts → client-plugins.d-C1WM3ieD.d.mts} +6 -1
- package/dist/{client-plugins.d-qWp8hNwd.d.ts → client-plugins.d-DcmDzcSC.d.ts} +6 -1
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-EI5N366Z.cjs → devtools-5B7NZE6F.cjs} +10 -9
- package/dist/{devtools-XJHODO5H.mjs → devtools-C5GXZZ7E.mjs} +7 -6
- package/dist/docs.cjs +9 -8
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +8 -7
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/{handler.d-DoH5Krkq.d.mts → handler.d-B8bPCBzl.d.mts} +1 -1
- package/dist/{handler.d-C2oRihfa.d.ts → handler.d-Cliwo6Nu.d.ts} +1 -1
- package/dist/{headers.d-BrX53wFQ.d.mts → headers.d-CVwSpSGX.d.mts} +1 -1
- package/dist/{headers.d-Dj0mfYpb.d.ts → headers.d-C_btqjV6.d.ts} +1 -1
- package/dist/index.cjs +28 -27
- package/dist/{index.d-DzDHOttz.d.mts → index.d-DFuMZk9-.d.mts} +1 -1
- package/dist/{index.d-Dhc2scRl.d.ts → index.d-hOEbMcLk.d.ts} +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.mjs +27 -26
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.cjs +4 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +3 -2
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +26 -25
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +25 -24
- package/dist/internal/cli-runtime.cjs +11 -10
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +10 -9
- 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 +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +9 -8
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +8 -7
- 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-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/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 +11 -6
- package/dist/internal/production-runtime.d.mts +13 -11
- package/dist/internal/production-runtime.d.ts +13 -11
- package/dist/internal/production-runtime.mjs +10 -5
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-DwXjaOHY.d.ts → mount.d-CAovYKfs.d.ts} +1 -1
- package/dist/{mount.d-DOaeUoWq.d.mts → mount.d-DLeYxeRR.d.mts} +1 -1
- package/dist/{navigation-delegate.d-o3pPd9VI.d.ts → navigation-delegate.d-BLM-8Q3Z.d.ts} +1 -1
- package/dist/{navigation-delegate.d-BElGUMgt.d.mts → navigation-delegate.d-Chv93QS6.d.mts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- 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 +21 -19
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +20 -18
- package/dist/{render-plan.d-BD06tqFA.d.ts → render-plan.d-BSTjTH8h.d.ts} +1 -1
- package/dist/{render-plan.d-xWCRAJeR.d.mts → render-plan.d-CK5Lggyb.d.mts} +1 -1
- package/dist/renderer-client.cjs +48 -5
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +48 -5
- package/dist/renderer.cjs +2 -2
- package/dist/renderer.d.mts +10 -0
- package/dist/renderer.d.ts +10 -0
- package/dist/renderer.mjs +1 -1
- package/dist/{request.d-Dx82V8bz.d.mts → request.d-BhggxQf3.d.mts} +1 -1
- package/dist/{request.d-DUMuWxSN.d.ts → request.d-CyJS9bjm.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-BwBVpLtD.d.ts → route-rendering.d-BLPPmI5I.d.ts} +1 -1
- package/dist/{route-rendering.d-DJh6GauM.d.mts → route-rendering.d-CUpG2mZJ.d.mts} +1 -1
- package/dist/{router.d-CJBSG5jr.d.ts → router.d-0X2Ki6rf.d.ts} +1 -1
- package/dist/{router.d-BtkKDxUB.d.mts → router.d-2NQM1Kgw.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-H5AXQA7A.cjs → rsc-pipeline-5AOF64FL.cjs} +10 -9
- package/dist/{rsc-pipeline-GD6KLOIG.mjs → rsc-pipeline-DNRLYOJ7.mjs} +9 -8
- package/dist/{runtime-OJ7FXFUI.mjs → runtime-EHG2FRXZ.mjs} +9 -8
- package/dist/{runtime-YWQVBC3V.cjs → runtime-ZVHG5SRB.cjs} +13 -12
- package/dist/{runtime.d-BQnD0cfC.d.ts → runtime.d-CXuwkUgr.d.ts} +1 -1
- package/dist/{runtime.d-C4SuZXf6.d.mts → runtime.d-CaFXcu_Q.d.mts} +1 -1
- package/dist/{server-components-status.d-rfKOcE0N.d.ts → server-components-status.d-BdeFD8ZH.d.ts} +1 -1
- package/dist/{server-components-status.d-9rH7ZoEq.d.mts → server-components-status.d-Cp7zvBm5.d.mts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +54 -48
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +30 -24
- package/dist/{spa-router.d-DMKiBsHH.d.ts → spa-router.d-Bjgl-Osi.d.ts} +2 -2
- package/dist/{spa-router.d-V6XLSTCy.d.mts → spa-router.d-l3G38xHa.d.mts} +2 -2
- package/dist/{ssg.d-MNedvvMB.d.ts → ssg.d-DDca17Lc.d.ts} +2 -2
- package/dist/{ssg.d-BnCKPQL0.d.mts → ssg.d-RnlHOqUL.d.mts} +2 -2
- package/dist/{store-core.d-BqJI1-ix.d.mts → store-core.d-BZjuC6Zc.d.mts} +11 -3
- package/dist/{store-core.d-Ad5biajo.d.ts → store-core.d-BaOUOPf7.d.ts} +11 -3
- package/dist/testing.cjs +5 -4
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +4 -3
- package/dist/{utils.d-BdjHKDuT.d.ts → utils.d-D8TWmpWo.d.ts} +1 -1
- package/dist/{utils.d-BEKLWa0Z.d.mts → utils.d-tdzw0_zQ.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +21 -19
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +20 -18
- package/package.json +2 -2
- package/dist/analyzer-435DCIQ6.cjs +0 -17
|
@@ -1,12 +1,12 @@
|
|
|
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 _chunkVMBIKDKWcjs = require('./chunk-VMBIKDKW.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkBBVLOENDcjs = require('./chunk-BBVLOEND.cjs');
|
|
@@ -48,7 +48,8 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
|
|
52
|
+
var _chunkNEKO3HM2cjs = require('./chunk-NEKO3HM2.cjs');
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
|
|
@@ -56,7 +57,7 @@ var _chunkOFVCWV2Dcjs = require('./chunk-OFVCWV2D.cjs');
|
|
|
56
57
|
var _chunkOZUINP2Pcjs = require('./chunk-OZUINP2P.cjs');
|
|
57
58
|
|
|
58
59
|
|
|
59
|
-
var
|
|
60
|
+
var _chunkB2PGVHBGcjs = require('./chunk-B2PGVHBG.cjs');
|
|
60
61
|
|
|
61
62
|
|
|
62
63
|
|
|
@@ -99,10 +100,7 @@ var _chunkWOAXQ5MZcjs = require('./chunk-WOAXQ5MZ.cjs');
|
|
|
99
100
|
|
|
100
101
|
|
|
101
102
|
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
|
|
103
|
+
var _chunkDRO3NXA3cjs = require('./chunk-DRO3NXA3.cjs');
|
|
106
104
|
|
|
107
105
|
|
|
108
106
|
|
|
@@ -126,7 +124,7 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
|
126
124
|
|
|
127
125
|
|
|
128
126
|
|
|
129
|
-
var
|
|
127
|
+
var _chunkEACD6ND7cjs = require('./chunk-EACD6ND7.cjs');
|
|
130
128
|
|
|
131
129
|
|
|
132
130
|
|
|
@@ -165,13 +163,13 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
165
163
|
|
|
166
164
|
|
|
167
165
|
|
|
168
|
-
var
|
|
166
|
+
var _chunkBCTHOQPPcjs = require('./chunk-BCTHOQPP.cjs');
|
|
169
167
|
|
|
170
168
|
|
|
171
169
|
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
172
170
|
|
|
173
171
|
|
|
174
|
-
var
|
|
172
|
+
var _chunkHQKCSJEHcjs = require('./chunk-HQKCSJEH.cjs');
|
|
175
173
|
|
|
176
174
|
|
|
177
175
|
var _chunkXRFGOYXGcjs = require('./chunk-XRFGOYXG.cjs');
|
|
@@ -208,7 +206,7 @@ var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
|
|
|
208
206
|
|
|
209
207
|
|
|
210
208
|
|
|
211
|
-
var
|
|
209
|
+
var _chunkB3HQTGXScjs = require('./chunk-B3HQTGXS.cjs');
|
|
212
210
|
|
|
213
211
|
|
|
214
212
|
var _chunkNW3DL2PMcjs = require('./chunk-NW3DL2PM.cjs');
|
|
@@ -306,7 +304,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
306
304
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
307
305
|
|
|
308
306
|
|
|
309
|
-
var
|
|
307
|
+
var _chunkJK26IMT7cjs = require('./chunk-JK26IMT7.cjs');
|
|
310
308
|
|
|
311
309
|
|
|
312
310
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -507,7 +505,7 @@ var RouteManager = class _RouteManager {
|
|
|
507
505
|
this.redirects = /* @__PURE__ */ new Map();
|
|
508
506
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
509
507
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
510
|
-
this.programmaticClientRoutes =
|
|
508
|
+
this.programmaticClientRoutes = _chunkDRO3NXA3cjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
511
509
|
this.discovery = Promise.resolve();
|
|
512
510
|
this.reportedIslandsErrors = /* @__PURE__ */ new Set();
|
|
513
511
|
// Each route module's hydration plan from the last plan, with the source files it read, so a dev
|
|
@@ -569,7 +567,7 @@ var RouteManager = class _RouteManager {
|
|
|
569
567
|
await this.discoverFileRoutes(source);
|
|
570
568
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
571
569
|
}
|
|
572
|
-
this.programmaticClientRoutes =
|
|
570
|
+
this.programmaticClientRoutes = _chunkDRO3NXA3cjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
573
571
|
for (const slot of this.routeSlots.values()) {
|
|
574
572
|
if (slot.interception && !this.pageRouteShapes.has(_chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
575
573
|
throw new (0, _chunkML4TOUZPcjs.AmbiguousRouteError)(
|
|
@@ -588,8 +586,8 @@ var RouteManager = class _RouteManager {
|
|
|
588
586
|
)
|
|
589
587
|
);
|
|
590
588
|
this.orderedLayouts = Array.from(this.layouts.values()).sort(
|
|
591
|
-
(left, right) =>
|
|
592
|
-
).map((entry) => ({ entry, groupScope:
|
|
589
|
+
(left, right) => _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, right.pattern)
|
|
590
|
+
).map((entry) => ({ entry, groupScope: _chunkNEKO3HM2cjs.getRouteGroupScope.call(void 0, entry.pattern) }));
|
|
593
591
|
for (const slot of this.routeSlots.values()) {
|
|
594
592
|
if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
|
|
595
593
|
this.routeSlotOwnerSegments.set(
|
|
@@ -862,11 +860,11 @@ var RouteManager = class _RouteManager {
|
|
|
862
860
|
return this.clientManifestCache.manifest;
|
|
863
861
|
}
|
|
864
862
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
865
|
-
const compute = () =>
|
|
863
|
+
const compute = () => _chunkDRO3NXA3cjs.withFarmSourceSnapshot.call(void 0,
|
|
866
864
|
() => this.computeClientManifest(normalizedProjectRoot),
|
|
867
865
|
this.sourceSnapshot
|
|
868
866
|
);
|
|
869
|
-
return cacheFile ?
|
|
867
|
+
return cacheFile ? _chunkDRO3NXA3cjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
|
|
870
868
|
}
|
|
871
869
|
/**
|
|
872
870
|
* @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
|
|
@@ -875,7 +873,7 @@ var RouteManager = class _RouteManager {
|
|
|
875
873
|
*/
|
|
876
874
|
trackSourceChanges() {
|
|
877
875
|
this.sourceChangeTracking = true;
|
|
878
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
876
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkDRO3NXA3cjs.FarmSourceSnapshotStore)())));
|
|
879
877
|
}
|
|
880
878
|
/**
|
|
881
879
|
* @internal A production build edits no source while it runs, so what the plan reads, parses and
|
|
@@ -884,7 +882,7 @@ var RouteManager = class _RouteManager {
|
|
|
884
882
|
*/
|
|
885
883
|
keepBuildSourceSnapshot() {
|
|
886
884
|
if (this.sourceChangeTracking) return;
|
|
887
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
885
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkDRO3NXA3cjs.FarmSourceSnapshotStore)(false))));
|
|
888
886
|
}
|
|
889
887
|
/**
|
|
890
888
|
* @internal Hands the snapshot keepBuildSourceSnapshot kept to the build, which clears it once
|
|
@@ -927,7 +925,7 @@ var RouteManager = class _RouteManager {
|
|
|
927
925
|
return false;
|
|
928
926
|
}
|
|
929
927
|
const previous = _optionalChain([this, 'access', _18 => _18.sourceSnapshot, 'optionalAccess', _19 => _19.peekSource, 'call', _20 => _20(path4.default.resolve(file))]);
|
|
930
|
-
return previous !== void 0 &&
|
|
928
|
+
return previous !== void 0 && _chunkDRO3NXA3cjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
|
|
931
929
|
}
|
|
932
930
|
/**
|
|
933
931
|
* A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
|
|
@@ -938,7 +936,7 @@ var RouteManager = class _RouteManager {
|
|
|
938
936
|
if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
|
|
939
937
|
return { ...previous.plan };
|
|
940
938
|
}
|
|
941
|
-
const { result, files } =
|
|
939
|
+
const { result, files } = _chunkDRO3NXA3cjs.traceFarmSourceReads.call(void 0, compute);
|
|
942
940
|
const sources = /* @__PURE__ */ new Set();
|
|
943
941
|
for (const file of files) {
|
|
944
942
|
const source = this.planSourcePath(file);
|
|
@@ -946,7 +944,7 @@ var RouteManager = class _RouteManager {
|
|
|
946
944
|
}
|
|
947
945
|
if (!this.sourceChangeTracking) {
|
|
948
946
|
for (const source of sources) {
|
|
949
|
-
if (!this.planStamps.has(source)) this.planStamps.set(source,
|
|
947
|
+
if (!this.planStamps.has(source)) this.planStamps.set(source, _chunkDRO3NXA3cjs.getFarmSourceStamp.call(void 0, source));
|
|
950
948
|
}
|
|
951
949
|
}
|
|
952
950
|
this.ownerPlans.set(key, { plan: result, files: sources, planKey });
|
|
@@ -966,7 +964,7 @@ var RouteManager = class _RouteManager {
|
|
|
966
964
|
const isUnchanged = (file) => {
|
|
967
965
|
let result = unchanged.get(file);
|
|
968
966
|
if (result === void 0) {
|
|
969
|
-
result = this.planStamps.get(file) ===
|
|
967
|
+
result = this.planStamps.get(file) === _chunkDRO3NXA3cjs.getFarmSourceStamp.call(void 0, file);
|
|
970
968
|
unchanged.set(file, result);
|
|
971
969
|
}
|
|
972
970
|
return result;
|
|
@@ -1013,7 +1011,7 @@ var RouteManager = class _RouteManager {
|
|
|
1013
1011
|
*/
|
|
1014
1012
|
inspectPackages(operation) {
|
|
1015
1013
|
const file = this.packageClientBoundaryCacheFile;
|
|
1016
|
-
return file ?
|
|
1014
|
+
return file ? _chunkDRO3NXA3cjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
|
|
1017
1015
|
}
|
|
1018
1016
|
computeClientManifest(normalizedProjectRoot) {
|
|
1019
1017
|
const toUrlPath = (absolutePath) => {
|
|
@@ -1025,7 +1023,7 @@ var RouteManager = class _RouteManager {
|
|
|
1025
1023
|
}
|
|
1026
1024
|
return absolutePath;
|
|
1027
1025
|
};
|
|
1028
|
-
const integrationProviders =
|
|
1026
|
+
const integrationProviders = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
|
|
1029
1027
|
(provider) => provider.component || provider.type === "clerk"
|
|
1030
1028
|
);
|
|
1031
1029
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
@@ -1036,14 +1034,14 @@ var RouteManager = class _RouteManager {
|
|
|
1036
1034
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
1037
1035
|
);
|
|
1038
1036
|
}
|
|
1039
|
-
const isolatedMode =
|
|
1037
|
+
const isolatedMode = _chunkDRO3NXA3cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
1040
1038
|
_optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.isolatedClientHydration]),
|
|
1041
1039
|
{
|
|
1042
1040
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _30 => _30.config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.serverComponents])) === "rsc",
|
|
1043
1041
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
1044
1042
|
}
|
|
1045
1043
|
);
|
|
1046
|
-
const planOptions =
|
|
1044
|
+
const planOptions = _chunkDRO3NXA3cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
1047
1045
|
this.config.renderer,
|
|
1048
1046
|
Boolean(unsupportedIntegrationProvider)
|
|
1049
1047
|
);
|
|
@@ -1053,7 +1051,7 @@ var RouteManager = class _RouteManager {
|
|
|
1053
1051
|
if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
|
|
1054
1052
|
edited = /* @__PURE__ */ new Set();
|
|
1055
1053
|
for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
|
|
1056
|
-
if (
|
|
1054
|
+
if (_chunkDRO3NXA3cjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
|
|
1057
1055
|
const source = this.planSourcePath(file);
|
|
1058
1056
|
if (source) edited.add(source);
|
|
1059
1057
|
}
|
|
@@ -1068,13 +1066,13 @@ var RouteManager = class _RouteManager {
|
|
|
1068
1066
|
metadata: this.planRouteModule(
|
|
1069
1067
|
`layout:${entry.modulePath}`,
|
|
1070
1068
|
edited,
|
|
1071
|
-
() =>
|
|
1069
|
+
() => _chunkDRO3NXA3cjs.getClientModuleHydrationPlan.call(void 0,
|
|
1072
1070
|
entry.modulePath,
|
|
1073
1071
|
normalizedProjectRoot,
|
|
1074
1072
|
isolatedMode,
|
|
1075
1073
|
layoutPlanOptions
|
|
1076
1074
|
),
|
|
1077
|
-
|
|
1075
|
+
_chunkDRO3NXA3cjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1078
1076
|
entry.modulePath,
|
|
1079
1077
|
normalizedProjectRoot,
|
|
1080
1078
|
isolatedMode,
|
|
@@ -1082,7 +1080,7 @@ var RouteManager = class _RouteManager {
|
|
|
1082
1080
|
)
|
|
1083
1081
|
)
|
|
1084
1082
|
}));
|
|
1085
|
-
const markdownComponentsPlan =
|
|
1083
|
+
const markdownComponentsPlan = _chunkDRO3NXA3cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
1086
1084
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
1087
1085
|
normalizedProjectRoot,
|
|
1088
1086
|
isolatedMode,
|
|
@@ -1098,13 +1096,13 @@ var RouteManager = class _RouteManager {
|
|
|
1098
1096
|
metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
|
|
1099
1097
|
`page:${entry.modulePath}`,
|
|
1100
1098
|
edited,
|
|
1101
|
-
() =>
|
|
1099
|
+
() => _chunkDRO3NXA3cjs.getClientModuleHydrationPlan.call(void 0,
|
|
1102
1100
|
entry.modulePath,
|
|
1103
1101
|
normalizedProjectRoot,
|
|
1104
1102
|
isolatedMode,
|
|
1105
1103
|
pagePlanOptions
|
|
1106
1104
|
),
|
|
1107
|
-
|
|
1105
|
+
_chunkDRO3NXA3cjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1108
1106
|
entry.modulePath,
|
|
1109
1107
|
normalizedProjectRoot,
|
|
1110
1108
|
isolatedMode,
|
|
@@ -1134,18 +1132,18 @@ var RouteManager = class _RouteManager {
|
|
|
1134
1132
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1135
1133
|
);
|
|
1136
1134
|
}
|
|
1137
|
-
|
|
1135
|
+
_chunkDRO3NXA3cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
1138
1136
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1139
1137
|
pattern: entry.pattern,
|
|
1140
|
-
depth:
|
|
1138
|
+
depth: _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
1141
1139
|
metadata
|
|
1142
1140
|
})),
|
|
1143
1141
|
routeEntries.map(({ entry, metadata }) => ({
|
|
1144
1142
|
pattern: getRouteEntryDirectory(entry),
|
|
1145
|
-
depth:
|
|
1143
|
+
depth: _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
|
|
1146
1144
|
metadata
|
|
1147
1145
|
})),
|
|
1148
|
-
|
|
1146
|
+
_chunkNEKO3HM2cjs.routeBoundaryCoversDirectory,
|
|
1149
1147
|
{ serverOwners: islandsMode }
|
|
1150
1148
|
);
|
|
1151
1149
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
@@ -1165,7 +1163,7 @@ var RouteManager = class _RouteManager {
|
|
|
1165
1163
|
const routes = routeEntries.map(({ entry, metadata }) => {
|
|
1166
1164
|
const programmaticPage = this.programmaticPages.get(entry.modulePath);
|
|
1167
1165
|
const layoutShouldHydrate = layoutEntries.some(
|
|
1168
|
-
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate &&
|
|
1166
|
+
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkNEKO3HM2cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
|
|
1169
1167
|
);
|
|
1170
1168
|
return {
|
|
1171
1169
|
pattern: entry.pattern,
|
|
@@ -1181,8 +1179,8 @@ var RouteManager = class _RouteManager {
|
|
|
1181
1179
|
modulePath: toUrlPath(boundary.modulePath)
|
|
1182
1180
|
}))
|
|
1183
1181
|
} : {},
|
|
1184
|
-
...
|
|
1185
|
-
renderPlan:
|
|
1182
|
+
..._chunkDRO3NXA3cjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
1183
|
+
renderPlan: _chunkNEKO3HM2cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
1186
1184
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
1187
1185
|
layoutShouldHydrate,
|
|
1188
1186
|
islandStrategy: metadata.islandStrategy
|
|
@@ -1198,7 +1196,7 @@ var RouteManager = class _RouteManager {
|
|
|
1198
1196
|
}))
|
|
1199
1197
|
};
|
|
1200
1198
|
});
|
|
1201
|
-
const treeLayoutPatterns = islandsMode ?
|
|
1199
|
+
const treeLayoutPatterns = islandsMode ? _chunkNEKO3HM2cjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
1202
1200
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1203
1201
|
pattern: entry.pattern,
|
|
1204
1202
|
shouldHydrate: metadata.shouldHydrate,
|
|
@@ -1223,7 +1221,7 @@ var RouteManager = class _RouteManager {
|
|
|
1223
1221
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
1224
1222
|
}));
|
|
1225
1223
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
1226
|
-
const metadata =
|
|
1224
|
+
const metadata = _chunkDRO3NXA3cjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
1227
1225
|
return {
|
|
1228
1226
|
name: entry.name,
|
|
1229
1227
|
ownerPattern: entry.ownerPattern,
|
|
@@ -1239,7 +1237,7 @@ var RouteManager = class _RouteManager {
|
|
|
1239
1237
|
};
|
|
1240
1238
|
});
|
|
1241
1239
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
1242
|
-
metadata:
|
|
1240
|
+
metadata: _chunkDRO3NXA3cjs.getClientModuleHydrationPlan.call(void 0,
|
|
1243
1241
|
entry.modulePath,
|
|
1244
1242
|
normalizedProjectRoot,
|
|
1245
1243
|
isolatedMode,
|
|
@@ -1341,7 +1339,7 @@ var RouteManager = class _RouteManager {
|
|
|
1341
1339
|
loadModule: viteServer ? (componentModulePath) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
|
|
1342
1340
|
}),
|
|
1343
1341
|
config: mdxConfig,
|
|
1344
|
-
renderer:
|
|
1342
|
+
renderer: _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
|
|
1345
1343
|
});
|
|
1346
1344
|
}
|
|
1347
1345
|
if (this.viteServer) {
|
|
@@ -1389,7 +1387,7 @@ var RouteManager = class _RouteManager {
|
|
|
1389
1387
|
*/
|
|
1390
1388
|
createRoutePattern(route) {
|
|
1391
1389
|
if (route.segments.length === 0) return "/";
|
|
1392
|
-
return "/" + route.segments.map(
|
|
1390
|
+
return "/" + route.segments.map(_chunkNEKO3HM2cjs.formatRouteSegment).join("/");
|
|
1393
1391
|
}
|
|
1394
1392
|
registerPageRoute(entry) {
|
|
1395
1393
|
_chunkML4TOUZPcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
|
|
@@ -1408,7 +1406,7 @@ var RouteManager = class _RouteManager {
|
|
|
1408
1406
|
}
|
|
1409
1407
|
async discoverFileRoutes(source) {
|
|
1410
1408
|
const appDir = _chunk7U4XF76Rcjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
|
|
1411
|
-
const componentExtensions =
|
|
1409
|
+
const componentExtensions = _chunkBCTHOQPPcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
|
|
1412
1410
|
(extension) => extension.slice(1)
|
|
1413
1411
|
);
|
|
1414
1412
|
const componentGlob = componentExtensions.join(",");
|
|
@@ -1483,7 +1481,7 @@ var RouteManager = class _RouteManager {
|
|
|
1483
1481
|
for (const file of files) {
|
|
1484
1482
|
const route = _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, file);
|
|
1485
1483
|
const modulePath = path4.default.join(appDir, file);
|
|
1486
|
-
const pattern =
|
|
1484
|
+
const pattern = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1487
1485
|
const existing = target.get(pattern);
|
|
1488
1486
|
if (_optionalChain([existing, 'optionalAccess', _49 => _49.sourceRoot]) === source.root) {
|
|
1489
1487
|
throw new Error(
|
|
@@ -1505,7 +1503,7 @@ var RouteManager = class _RouteManager {
|
|
|
1505
1503
|
const modulePath = path4.default.join(appDir, file);
|
|
1506
1504
|
const pattern = this.createRoutePattern(slot.route);
|
|
1507
1505
|
const ownerPattern = this.createRoutePattern(slot.ownerRoute);
|
|
1508
|
-
const ownerDirectory =
|
|
1506
|
+
const ownerDirectory = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
|
|
1509
1507
|
const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
|
|
1510
1508
|
const existing = this.routeSlots.get(key);
|
|
1511
1509
|
if (_optionalChain([existing, 'optionalAccess', _50 => _50.sourceRoot]) === source.root) {
|
|
@@ -1587,11 +1585,11 @@ var RouteManager = class _RouteManager {
|
|
|
1587
1585
|
srcDir: source.srcDir,
|
|
1588
1586
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1589
1587
|
});
|
|
1590
|
-
const graph = this.viteServer ?
|
|
1588
|
+
const graph = this.viteServer ? _chunkDRO3NXA3cjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1591
1589
|
for (const { filePath, manifest } of manifests) {
|
|
1592
1590
|
if (graph) {
|
|
1593
1591
|
clientRoutes.push(
|
|
1594
|
-
|
|
1592
|
+
_chunkDRO3NXA3cjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1595
1593
|
graph,
|
|
1596
1594
|
routesFile: toRealPath(filePath),
|
|
1597
1595
|
routes: manifest.routes,
|
|
@@ -1622,7 +1620,7 @@ var RouteManager = class _RouteManager {
|
|
|
1622
1620
|
}
|
|
1623
1621
|
if (definition.kind === "layout") {
|
|
1624
1622
|
const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
|
|
1625
|
-
const pattern =
|
|
1623
|
+
const pattern = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1626
1624
|
const existing = this.layouts.get(pattern);
|
|
1627
1625
|
if (_optionalChain([existing, 'optionalAccess', _54 => _54.sourceRoot]) === source.root) {
|
|
1628
1626
|
throw new Error(
|
|
@@ -1669,7 +1667,7 @@ var RouteManager = class _RouteManager {
|
|
|
1669
1667
|
const matchingLayouts = [];
|
|
1670
1668
|
for (const { entry, groupScope } of this.orderedLayouts) {
|
|
1671
1669
|
if (!_chunk7U4XF76Rcjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
|
|
1672
|
-
if (groupScope !== null && !
|
|
1670
|
+
if (groupScope !== null && !_chunkNEKO3HM2cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
|
|
1673
1671
|
continue;
|
|
1674
1672
|
}
|
|
1675
1673
|
matchingLayouts.push(entry);
|
|
@@ -1750,14 +1748,14 @@ var RouteManager = class _RouteManager {
|
|
|
1750
1748
|
let page = route;
|
|
1751
1749
|
for (const boundaryEntry of boundaries.values()) {
|
|
1752
1750
|
if (!_chunk7U4XF76Rcjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
|
|
1753
|
-
const groupScope =
|
|
1751
|
+
const groupScope = _chunkNEKO3HM2cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
|
|
1754
1752
|
if (groupScope !== null) {
|
|
1755
1753
|
if (page === void 0) page = this.matchPageRoute(_chunk7U4XF76Rcjs.splitRoutePath.call(void 0, normalizedPath));
|
|
1756
|
-
if (!
|
|
1754
|
+
if (!_chunkNEKO3HM2cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
|
|
1757
1755
|
}
|
|
1758
1756
|
const depth = boundaryEntry.route.segments.length;
|
|
1759
1757
|
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _58 => _58.route, 'access', _59 => _59.segments, 'access', _60 => _60.length]), () => ( -1));
|
|
1760
|
-
if (!bestMatch || depth > bestDepth || depth === bestDepth &&
|
|
1758
|
+
if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
|
|
1761
1759
|
bestMatch = boundaryEntry;
|
|
1762
1760
|
}
|
|
1763
1761
|
}
|
|
@@ -1785,7 +1783,7 @@ var RouteManager = class _RouteManager {
|
|
|
1785
1783
|
const docs = this.config.docs;
|
|
1786
1784
|
if (!docs || typeof docs !== "object" || !docs.enabled) return void 0;
|
|
1787
1785
|
const usesAdapter = Boolean(docs.adapter && docs.adapter.server && docs.adapter.react);
|
|
1788
|
-
if (usesAdapter && !
|
|
1786
|
+
if (usesAdapter && !_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, this.config.renderer)) return void 0;
|
|
1789
1787
|
const entry = `/${String(docs.entry || "docs").replace(/^\/+|\/+$/g, "")}`;
|
|
1790
1788
|
return {
|
|
1791
1789
|
owns: (routePath) => entry === "/" || routePath === entry || routePath.startsWith(`${entry}/`),
|
|
@@ -1807,7 +1805,7 @@ var RouteManager = class _RouteManager {
|
|
|
1807
1805
|
}));
|
|
1808
1806
|
const i18n = this.getI18nConfig();
|
|
1809
1807
|
const docsAdapterRoutes = this.getDocsAdapterRoutes();
|
|
1810
|
-
const result = await
|
|
1808
|
+
const result = await _chunkVMBIKDKWcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
1811
1809
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
|
|
1812
1810
|
...docsAdapterRoutes ? { docsAdapterRoutes } : {}
|
|
1813
1811
|
});
|
|
@@ -1854,7 +1852,7 @@ var RouteManager = class _RouteManager {
|
|
|
1854
1852
|
async isRouteSSG(modulePath) {
|
|
1855
1853
|
try {
|
|
1856
1854
|
const mod = await this.loadRouteModule(modulePath);
|
|
1857
|
-
const rendering = await
|
|
1855
|
+
const rendering = await _chunkVMBIKDKWcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1858
1856
|
return rendering.ssg;
|
|
1859
1857
|
} catch (e2) {
|
|
1860
1858
|
return false;
|
|
@@ -1866,7 +1864,7 @@ var RouteManager = class _RouteManager {
|
|
|
1866
1864
|
async hasRouteISR(modulePath) {
|
|
1867
1865
|
try {
|
|
1868
1866
|
const mod = await this.loadRouteModule(modulePath);
|
|
1869
|
-
const rendering = await
|
|
1867
|
+
const rendering = await _chunkVMBIKDKWcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1870
1868
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
1871
1869
|
} catch (e3) {
|
|
1872
1870
|
return false;
|
|
@@ -1878,7 +1876,7 @@ var RouteManager = class _RouteManager {
|
|
|
1878
1876
|
async getRouteRevalidateInterval(modulePath) {
|
|
1879
1877
|
try {
|
|
1880
1878
|
const mod = await this.loadRouteModule(modulePath);
|
|
1881
|
-
const rendering = await
|
|
1879
|
+
const rendering = await _chunkVMBIKDKWcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1882
1880
|
return rendering.revalidate;
|
|
1883
1881
|
} catch (e4) {
|
|
1884
1882
|
return void 0;
|
|
@@ -1886,7 +1884,7 @@ var RouteManager = class _RouteManager {
|
|
|
1886
1884
|
}
|
|
1887
1885
|
};
|
|
1888
1886
|
function getPageDirectoryField(route, pattern) {
|
|
1889
|
-
const directory =
|
|
1887
|
+
const directory = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1890
1888
|
return directory === pattern ? {} : { directory };
|
|
1891
1889
|
}
|
|
1892
1890
|
function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
|
|
@@ -2010,11 +2008,11 @@ function createFarmDevClientManifest(manifest, options) {
|
|
|
2010
2008
|
}
|
|
2011
2009
|
for (const layout of manifest.layouts) {
|
|
2012
2010
|
if (layoutPatterns && !layoutPatterns.has(layout.pattern)) continue;
|
|
2013
|
-
const groupScope =
|
|
2011
|
+
const groupScope = _chunkNEKO3HM2cjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
2014
2012
|
clientManifest.layouts[layout.pattern] = {
|
|
2015
2013
|
modulePath: layout.modulePath,
|
|
2016
2014
|
pattern: layout.pattern,
|
|
2017
|
-
...groupScope ? { urlPattern:
|
|
2015
|
+
...groupScope ? { urlPattern: _chunkNEKO3HM2cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
|
|
2018
2016
|
shouldHydrate: layout.shouldHydrate,
|
|
2019
2017
|
islandStrategy: layout.islandStrategy,
|
|
2020
2018
|
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
@@ -3089,7 +3087,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
|
|
|
3089
3087
|
let hasClerkProvider = false;
|
|
3090
3088
|
renderedProviders.forEach((provider, index) => {
|
|
3091
3089
|
let componentExpression = "null";
|
|
3092
|
-
if (
|
|
3090
|
+
if (_chunkB3HQTGXScjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
3093
3091
|
const namespace = `FarmIntegrationProviderModule${index}`;
|
|
3094
3092
|
imports.push(
|
|
3095
3093
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -3146,7 +3144,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
|
|
|
3146
3144
|
const entries = [];
|
|
3147
3145
|
let needsMarkHelper = false;
|
|
3148
3146
|
providers.forEach((provider, index) => {
|
|
3149
|
-
if (!
|
|
3147
|
+
if (!_chunkB3HQTGXScjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
|
|
3150
3148
|
const namespace = `FarmServerIntegrationProviderModule${index}`;
|
|
3151
3149
|
imports.push(
|
|
3152
3150
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -3182,7 +3180,7 @@ function resolveFarmIslxActionsMode(config) {
|
|
|
3182
3180
|
if (_optionalChain([config, 'access', _68 => _68.experimental, 'optionalAccess', _69 => _69.serverActions]) !== true) return null;
|
|
3183
3181
|
const renderer = config.renderer;
|
|
3184
3182
|
if (renderer === void 0 || renderer === false) return null;
|
|
3185
|
-
if (
|
|
3183
|
+
if (_chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, renderer) || _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer)) return null;
|
|
3186
3184
|
return "renderer";
|
|
3187
3185
|
}
|
|
3188
3186
|
function farmBrowserServerFnsEnabled(config) {
|
|
@@ -3229,7 +3227,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
3229
3227
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
3230
3228
|
parse: parseFarmIslandSource,
|
|
3231
3229
|
resolve: (specifier, importer) => {
|
|
3232
|
-
const resolved =
|
|
3230
|
+
const resolved = _chunkDRO3NXA3cjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
3233
3231
|
return resolved.local ? resolved.path : null;
|
|
3234
3232
|
}
|
|
3235
3233
|
});
|
|
@@ -3249,7 +3247,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
3249
3247
|
if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
|
|
3250
3248
|
return cached.result;
|
|
3251
3249
|
}
|
|
3252
|
-
const { result, files } =
|
|
3250
|
+
const { result, files } = _chunkDRO3NXA3cjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
|
|
3253
3251
|
const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
|
|
3254
3252
|
routeRootInferences.set(key, {
|
|
3255
3253
|
stamps: [...read].map((file) => [file, modifiedAt(file)]),
|
|
@@ -3266,7 +3264,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3266
3264
|
const files = [];
|
|
3267
3265
|
const modules = [];
|
|
3268
3266
|
for (const owner of owners) {
|
|
3269
|
-
const rendered =
|
|
3267
|
+
const rendered = _chunkDRO3NXA3cjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
3270
3268
|
if (!rendered) {
|
|
3271
3269
|
return {
|
|
3272
3270
|
strategy: null,
|
|
@@ -3282,7 +3280,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3282
3280
|
source = fs2.default.readFileSync(module, "utf8");
|
|
3283
3281
|
} catch (e11) {
|
|
3284
3282
|
}
|
|
3285
|
-
if (
|
|
3283
|
+
if (_chunkDRO3NXA3cjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
3286
3284
|
}
|
|
3287
3285
|
for (const module of modules) {
|
|
3288
3286
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -3294,7 +3292,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3294
3292
|
function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
|
|
3295
3293
|
const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3296
3294
|
const onRoute = layouts.filter(
|
|
3297
|
-
(layout) =>
|
|
3295
|
+
(layout) => _chunkNEKO3HM2cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
|
|
3298
3296
|
);
|
|
3299
3297
|
const declared = [
|
|
3300
3298
|
...page.islandStrategy ? [page.islandStrategy] : [],
|
|
@@ -3326,7 +3324,7 @@ var _stream = require('stream');
|
|
|
3326
3324
|
|
|
3327
3325
|
|
|
3328
3326
|
function resolveFarmNotFoundComponentPath(config, appDirs) {
|
|
3329
|
-
const extensions =
|
|
3327
|
+
const extensions = _chunkBCTHOQPPcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
|
|
3330
3328
|
const configuredPath = _optionalChain([config, 'access', _72 => _72.notFound, 'optionalAccess', _73 => _73.component, 'optionalAccess', _74 => _74.trim, 'call', _75 => _75()]);
|
|
3331
3329
|
if (configuredPath) {
|
|
3332
3330
|
const componentPath = path4.default.isAbsolute(configuredPath) ? path4.default.normalize(configuredPath) : path4.default.resolve(config.root, configuredPath);
|
|
@@ -3365,11 +3363,11 @@ function getFarmLayoutKey(pattern, params) {
|
|
|
3365
3363
|
);
|
|
3366
3364
|
}
|
|
3367
3365
|
function countFarmKeptLayouts(layoutsHeader, layouts, params) {
|
|
3368
|
-
const chain =
|
|
3366
|
+
const chain = _chunkNEKO3HM2cjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
|
|
3369
3367
|
if (chain.length === 0) return 0;
|
|
3370
3368
|
const keys = layouts.map((layout) => getFarmLayoutKey(layout.pattern, params));
|
|
3371
|
-
if (chain[0] === keys[0]) return
|
|
3372
|
-
return keys.length > 1 ? 1 +
|
|
3369
|
+
if (chain[0] === keys[0]) return _chunkNEKO3HM2cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
|
|
3370
|
+
return keys.length > 1 ? 1 + _chunkNEKO3HM2cjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
|
|
3373
3371
|
}
|
|
3374
3372
|
function createFarmFlushToken() {
|
|
3375
3373
|
const bytes = new Uint8Array(16);
|
|
@@ -3624,7 +3622,7 @@ function createDefaultErrorDiagnostics(error, root) {
|
|
|
3624
3622
|
function canBootFarmIslandsClient(config) {
|
|
3625
3623
|
const docs = config.docs;
|
|
3626
3624
|
const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
|
|
3627
|
-
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _76 => _76.experimental, 'optionalAccess', _77 => _77.serverComponents])) === "islands" && !docsEnabled &&
|
|
3625
|
+
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _76 => _76.experimental, 'optionalAccess', _77 => _77.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
3626
|
}
|
|
3629
3627
|
|
|
3630
3628
|
// src/islands-kept-layouts.ts
|
|
@@ -3672,7 +3670,7 @@ var DECLARATION_STATEMENTS = /* @__PURE__ */ new Set([
|
|
|
3672
3670
|
function parse(code, file) {
|
|
3673
3671
|
const extension = path4.default.extname(file).slice(1);
|
|
3674
3672
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" ? "jsx" : "tsx";
|
|
3675
|
-
return
|
|
3673
|
+
return _chunkDRO3NXA3cjs.memoizeInFarmSourceSnapshot.call(void 0, `ast:${lang}`, code, () => {
|
|
3676
3674
|
try {
|
|
3677
3675
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
3678
3676
|
} catch (e14) {
|
|
@@ -3807,14 +3805,14 @@ function isReference(node, parent, key) {
|
|
|
3807
3805
|
}
|
|
3808
3806
|
function readSource(file) {
|
|
3809
3807
|
try {
|
|
3810
|
-
|
|
3808
|
+
_chunkDRO3NXA3cjs.noteFarmSourceRead.call(void 0, file);
|
|
3811
3809
|
return fs2.default.readFileSync(file, "utf8");
|
|
3812
3810
|
} catch (e15) {
|
|
3813
3811
|
return null;
|
|
3814
3812
|
}
|
|
3815
3813
|
}
|
|
3816
3814
|
function explainFarmKeptLayoutRender(modulePath, root) {
|
|
3817
|
-
const entry =
|
|
3815
|
+
const entry = _chunkDRO3NXA3cjs.resolveModuleSourcePath.call(void 0, modulePath, root);
|
|
3818
3816
|
if (!entry) return `${modulePath} does not resolve`;
|
|
3819
3817
|
const visited = /* @__PURE__ */ new Set();
|
|
3820
3818
|
const check = (file) => {
|
|
@@ -3824,7 +3822,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3824
3822
|
if (!SCRIPT_SOURCE.test(file)) return `${path4.default.relative(root, file)} is not a script`;
|
|
3825
3823
|
const code = readSource(file);
|
|
3826
3824
|
if (code === null) return `${path4.default.relative(root, file)} cannot be read`;
|
|
3827
|
-
const { reason, imports } =
|
|
3825
|
+
const { reason, imports } = _chunkDRO3NXA3cjs.memoizeInFarmSourceSnapshot.call(void 0,
|
|
3828
3826
|
"kept-layout-module",
|
|
3829
3827
|
code,
|
|
3830
3828
|
() => findFarmRequestDecidingConstruct(code, file)
|
|
@@ -3837,7 +3835,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3837
3835
|
return `${path4.default.relative(root, file)} imports ${imported.names.join(", ")} from ${imported.source}`;
|
|
3838
3836
|
}
|
|
3839
3837
|
if (ASSET_SOURCE.test(imported.source.split("?")[0])) continue;
|
|
3840
|
-
const resolved =
|
|
3838
|
+
const resolved = _chunkDRO3NXA3cjs.resolveImportedModule.call(void 0, file, imported.source, root);
|
|
3841
3839
|
if (!resolved.path || !resolved.local) {
|
|
3842
3840
|
return `${path4.default.relative(root, file)} imports ${imported.source}`;
|
|
3843
3841
|
}
|
|
@@ -3852,15 +3850,15 @@ var answers = /* @__PURE__ */ new Map();
|
|
|
3852
3850
|
function canFarmSkipKeptLayoutRender(modulePath, root) {
|
|
3853
3851
|
const key = `${root}\0${modulePath}`;
|
|
3854
3852
|
const known = answers.get(key);
|
|
3855
|
-
if (known && known.stamps.every(([file, stamp]) =>
|
|
3853
|
+
if (known && known.stamps.every(([file, stamp]) => _chunkDRO3NXA3cjs.getFarmSourceStamp.call(void 0, file) === stamp)) {
|
|
3856
3854
|
return known.skip;
|
|
3857
3855
|
}
|
|
3858
|
-
const { result, files } =
|
|
3856
|
+
const { result, files } = _chunkDRO3NXA3cjs.traceFarmSourceReads.call(void 0,
|
|
3859
3857
|
() => explainFarmKeptLayoutRender(modulePath, root) === null
|
|
3860
3858
|
);
|
|
3861
3859
|
answers.set(key, {
|
|
3862
3860
|
skip: result,
|
|
3863
|
-
stamps: files.map((file) => [file,
|
|
3861
|
+
stamps: files.map((file) => [file, _chunkDRO3NXA3cjs.getFarmSourceStamp.call(void 0, file)])
|
|
3864
3862
|
});
|
|
3865
3863
|
return result;
|
|
3866
3864
|
}
|
|
@@ -3988,7 +3986,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
3988
3986
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
3989
3987
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
3990
3988
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
3991
|
-
_chunk7U4XF76Rcjs.logger.warn(
|
|
3989
|
+
_chunk7U4XF76Rcjs.logger.warn(_chunkDRO3NXA3cjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
3992
3990
|
}
|
|
3993
3991
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
3994
3992
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
@@ -4039,16 +4037,12 @@ function appendResponseVary(res, value) {
|
|
|
4039
4037
|
function renderI18nAlternateLinks(requestPath, snapshot, options) {
|
|
4040
4038
|
if (snapshot.routing === "none") return "";
|
|
4041
4039
|
const url = new URL(requestPath, "http://farm.local");
|
|
4042
|
-
return
|
|
4040
|
+
return _chunkNEKO3HM2cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
|
|
4043
4041
|
}
|
|
4044
4042
|
var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
4045
4043
|
function createPPRRefreshScript() {
|
|
4046
4044
|
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
4045
|
}
|
|
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
4046
|
function rendererRenderOptions() {
|
|
4053
4047
|
const nonce = _chunk3BIASUGRcjs._resolveCurrentCspNonce.call(void 0, );
|
|
4054
4048
|
return nonce ? { nonce } : void 0;
|
|
@@ -4201,15 +4195,15 @@ var ServerRenderer = class {
|
|
|
4201
4195
|
if (_optionalChain([this, 'access', _100 => _100.config, 'access', _101 => _101.notFound, 'optionalAccess', _102 => _102.component, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()])) {
|
|
4202
4196
|
resolveFarmNotFoundComponentPath(this.config, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config));
|
|
4203
4197
|
}
|
|
4204
|
-
const loaded =
|
|
4205
|
-
|
|
4198
|
+
const loaded = _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, this.config.renderer) ? this.reactRenderer = await import("./renderer/react/server.cjs") : _chunkBCTHOQPPcjs.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,
|
|
4199
|
+
_chunkBCTHOQPPcjs.resolveFarmRendererModule.call(void 0,
|
|
4206
4200
|
this.config.root || process.cwd(),
|
|
4207
4201
|
this.config.renderer.server
|
|
4208
4202
|
)
|
|
4209
4203
|
).href);
|
|
4210
4204
|
const runtime = loaded;
|
|
4211
|
-
|
|
4212
|
-
|
|
4205
|
+
_chunkBCTHOQPPcjs.assertFarmRendererServerModule.call(void 0, runtime, this.config.renderer);
|
|
4206
|
+
_chunkBCTHOQPPcjs.assertFarmRendererStreamingRuntime.call(void 0,
|
|
4213
4207
|
this.config.renderer.name,
|
|
4214
4208
|
this.config.renderer,
|
|
4215
4209
|
runtime,
|
|
@@ -4225,7 +4219,7 @@ var ServerRenderer = class {
|
|
|
4225
4219
|
* re-applied on the next request without restarting.
|
|
4226
4220
|
*/
|
|
4227
4221
|
async applyRendererAppSetup() {
|
|
4228
|
-
const appSetupPath =
|
|
4222
|
+
const appSetupPath = _chunkBCTHOQPPcjs.resolveFarmRendererAppSetup.call(void 0,
|
|
4229
4223
|
this.config.root || process.cwd(),
|
|
4230
4224
|
this.config.renderer
|
|
4231
4225
|
);
|
|
@@ -4241,7 +4235,10 @@ var ServerRenderer = class {
|
|
|
4241
4235
|
this.appliedAppSetupModule = setupModule;
|
|
4242
4236
|
configureApp(setupModule.default);
|
|
4243
4237
|
}
|
|
4244
|
-
createPageBoundary(pageElement, options) {
|
|
4238
|
+
async createPageBoundary(pageElement, options) {
|
|
4239
|
+
if (options.pageShouldHydrate && !options.layoutShouldHydrate) {
|
|
4240
|
+
pageElement = await this.wrapIslandIntegrationProviders(pageElement);
|
|
4241
|
+
}
|
|
4245
4242
|
const boundary = this.rendererRuntime.createElement(
|
|
4246
4243
|
"div",
|
|
4247
4244
|
{
|
|
@@ -4256,6 +4253,15 @@ var ServerRenderer = class {
|
|
|
4256
4253
|
);
|
|
4257
4254
|
return options.pageShouldHydrate && !options.layoutShouldHydrate && this.reactRenderer ? this.reactRenderer.markPagePosition(boundary) : boundary;
|
|
4258
4255
|
}
|
|
4256
|
+
/**
|
|
4257
|
+
* The browser hydrates a page island or a route slot as its own root, inside the integration
|
|
4258
|
+
* providers, so the server renders the providers inside it too, or a provider that renders
|
|
4259
|
+
* markup (a Vue `<slot />` renders fragment markers) puts the root's HTML out of step. React
|
|
4260
|
+
* lines an island up with its tree position instead, and its providers render no markup.
|
|
4261
|
+
*/
|
|
4262
|
+
async wrapIslandIntegrationProviders(element) {
|
|
4263
|
+
return this.reactRenderer ? element : this.wrapWithIntegrationProviders(element);
|
|
4264
|
+
}
|
|
4259
4265
|
/// The app's `<srcDir>/app/globals.css`, linked only when it exists, as the
|
|
4260
4266
|
/// production build imports it only when it exists. An app without one gets
|
|
4261
4267
|
/// no stylesheet link rather than a failing request.
|
|
@@ -4356,10 +4362,10 @@ var ServerRenderer = class {
|
|
|
4356
4362
|
return serverTree && this.rendererRuntime.renderServerTreePage ? this.rendererRuntime.renderServerTreePage(element, { values: false }) : this.rendererRuntime.isolateServerPageGraph(element);
|
|
4357
4363
|
}
|
|
4358
4364
|
async renderElementToCompleteHTML(element, options = {}) {
|
|
4359
|
-
const streaming =
|
|
4365
|
+
const streaming = _chunkBCTHOQPPcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
|
|
4360
4366
|
const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
|
|
4361
4367
|
if (renderToPipeableStream) {
|
|
4362
|
-
const inlineBoundaries =
|
|
4368
|
+
const inlineBoundaries = _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, this.config.renderer);
|
|
4363
4369
|
return await new Promise((resolve3, reject) => {
|
|
4364
4370
|
const chunks = [];
|
|
4365
4371
|
let shellReady = false;
|
|
@@ -4405,7 +4411,7 @@ var ServerRenderer = class {
|
|
|
4405
4411
|
element,
|
|
4406
4412
|
rendererRenderOptions()
|
|
4407
4413
|
);
|
|
4408
|
-
return await
|
|
4414
|
+
return await _chunkBCTHOQPPcjs.readFarmRendererWebStream.call(void 0, stream);
|
|
4409
4415
|
}
|
|
4410
4416
|
return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
|
|
4411
4417
|
}
|
|
@@ -4421,7 +4427,7 @@ var ServerRenderer = class {
|
|
|
4421
4427
|
);
|
|
4422
4428
|
return { html: rendered.html, head: rendered.head || "" };
|
|
4423
4429
|
}
|
|
4424
|
-
const { head, body } =
|
|
4430
|
+
const { head, body } = _chunkNEKO3HM2cjs.takeFarmHoistedHead.call(void 0,
|
|
4425
4431
|
await this.renderElementToCompleteHTML(element, options),
|
|
4426
4432
|
true
|
|
4427
4433
|
);
|
|
@@ -4438,7 +4444,7 @@ var ServerRenderer = class {
|
|
|
4438
4444
|
*/
|
|
4439
4445
|
async createPageElement(PageComponent, pageProps) {
|
|
4440
4446
|
const runtime = this.rendererRuntime;
|
|
4441
|
-
if (
|
|
4447
|
+
if (_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, this.config.renderer) || typeof PageComponent !== "function" || _optionalChain([PageComponent, 'access', _114 => _114.constructor, 'optionalAccess', _115 => _115.name]) !== "AsyncFunction") {
|
|
4442
4448
|
return runtime.createElement(PageComponent, pageProps);
|
|
4443
4449
|
}
|
|
4444
4450
|
const result = await PageComponent(pageProps);
|
|
@@ -4473,7 +4479,7 @@ var ServerRenderer = class {
|
|
|
4473
4479
|
} else if (input.layoutShouldHydrate && !input.pageShouldHydrate && this.rendererRuntime.isolateServerPageGraph) {
|
|
4474
4480
|
element = await this.isolateServerPage(element, input.serverTree === true);
|
|
4475
4481
|
}
|
|
4476
|
-
element = this.createPageBoundary(element, {
|
|
4482
|
+
element = await this.createPageBoundary(element, {
|
|
4477
4483
|
pageShouldHydrate: input.pageShouldHydrate,
|
|
4478
4484
|
layoutShouldHydrate: input.layoutShouldHydrate,
|
|
4479
4485
|
islandStrategy: input.islandStrategy
|
|
@@ -4498,7 +4504,11 @@ var ServerRenderer = class {
|
|
|
4498
4504
|
continue;
|
|
4499
4505
|
}
|
|
4500
4506
|
let slotElement = this.rendererRuntime.createElement(slot.module.default, slot.props);
|
|
4501
|
-
if (slot.shouldHydrate !== false)
|
|
4507
|
+
if (slot.shouldHydrate !== false) {
|
|
4508
|
+
slotElement = this.wrapClientGraph(
|
|
4509
|
+
await this.wrapIslandIntegrationProviders(slotElement)
|
|
4510
|
+
);
|
|
4511
|
+
}
|
|
4502
4512
|
slotProps[slot.name] = this.rendererRuntime.createElement(
|
|
4503
4513
|
"div",
|
|
4504
4514
|
{
|
|
@@ -4533,7 +4543,7 @@ var ServerRenderer = class {
|
|
|
4533
4543
|
rejectLateRedirects: true
|
|
4534
4544
|
}
|
|
4535
4545
|
);
|
|
4536
|
-
return fragmentTag ?
|
|
4546
|
+
return fragmentTag ? _chunkNEKO3HM2cjs.takeFarmNavigationOutlet.call(void 0, html, fragmentTag) : html;
|
|
4537
4547
|
}
|
|
4538
4548
|
/**
|
|
4539
4549
|
* A built-in docs runtime page (`docs.entry`, no adapter) under layouts that hydrate, or whose
|
|
@@ -4565,7 +4575,7 @@ var ServerRenderer = class {
|
|
|
4565
4575
|
islands: _optionalChain([entry, 'optionalAccess', _127 => _127.hasIsolatedClientBoundaries]) === true
|
|
4566
4576
|
};
|
|
4567
4577
|
});
|
|
4568
|
-
if (!
|
|
4578
|
+
if (!_chunkNEKO3HM2cjs.farmDocsLayoutsWrapPage.call(void 0, layouts)) return response;
|
|
4569
4579
|
const shouldHydrateLayout = layouts.some((layout) => layout.shouldHydrate);
|
|
4570
4580
|
const hasIsolatedClientBoundaries = layouts.some(
|
|
4571
4581
|
(layout) => layout.hasIsolatedClientBoundaries
|
|
@@ -4586,8 +4596,8 @@ var ServerRenderer = class {
|
|
|
4586
4596
|
...layout,
|
|
4587
4597
|
Component: _optionalChain([modules, 'access', _128 => _128[index], 'optionalAccess', _129 => _129.default])
|
|
4588
4598
|
}));
|
|
4589
|
-
const islandStrategy =
|
|
4590
|
-
const tree = await
|
|
4599
|
+
const islandStrategy = _chunkNEKO3HM2cjs.resolveFarmDocsLayoutIslandStrategy.call(void 0, treeLayouts);
|
|
4600
|
+
const tree = await _chunkNEKO3HM2cjs.createFarmDocsLayoutTree.call(void 0, this.rendererRuntime, {
|
|
4591
4601
|
pageHtml: bodyMatch[2],
|
|
4592
4602
|
layouts: treeLayouts,
|
|
4593
4603
|
params: matched.params,
|
|
@@ -4608,7 +4618,7 @@ var ServerRenderer = class {
|
|
|
4608
4618
|
)
|
|
4609
4619
|
)
|
|
4610
4620
|
);
|
|
4611
|
-
const rootMarkup =
|
|
4621
|
+
const rootMarkup = _chunkNEKO3HM2cjs.placeFarmDocsLayoutRoot.call(void 0, rendered.html);
|
|
4612
4622
|
const clientLayouts = layouts.map((layout) => ({
|
|
4613
4623
|
pattern: layout.pattern,
|
|
4614
4624
|
modulePath: _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, layout.modulePath, root),
|
|
@@ -4644,7 +4654,7 @@ window.__FARM_ISLAND_STRATEGY__ = ${serializeInlineValue(islandStrategy)};
|
|
|
4644
4654
|
window.__FARM_PAGE_MODULE__ = "";
|
|
4645
4655
|
window.__FARM_LOADING_MODULE__ = null;
|
|
4646
4656
|
window.__FARM_MANIFEST__ = ${serializeInlineValue(clientManifest)};
|
|
4647
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${serializeInlineValue(
|
|
4657
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${serializeInlineValue(_chunkB3HQTGXScjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
4648
4658
|
window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "null"};
|
|
4649
4659
|
</script>`;
|
|
4650
4660
|
const head = [
|
|
@@ -4700,7 +4710,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4700
4710
|
* Check if a path should be served from SSG cache
|
|
4701
4711
|
*/
|
|
4702
4712
|
async shouldServeSSG(pathname) {
|
|
4703
|
-
const ssgPage =
|
|
4713
|
+
const ssgPage = _chunkVMBIKDKWcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
4704
4714
|
if (!ssgPage) return null;
|
|
4705
4715
|
const cached = await this.getCachedSSGPage(pathname);
|
|
4706
4716
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -4844,7 +4854,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4844
4854
|
}))
|
|
4845
4855
|
);
|
|
4846
4856
|
const layoutShouldHydrate = layoutMetadata.some((metadata) => metadata.shouldHydrate);
|
|
4847
|
-
pageElement = this.createPageBoundary(pageElement, {
|
|
4857
|
+
pageElement = await this.createPageBoundary(pageElement, {
|
|
4848
4858
|
pageShouldHydrate: pageMetadata.shouldHydrate,
|
|
4849
4859
|
layoutShouldHydrate,
|
|
4850
4860
|
islandStrategy: pageMetadata.islandStrategy
|
|
@@ -4861,7 +4871,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4861
4871
|
if (pageMetadata.shouldHydrate && !layoutShouldHydrate && this.reactRenderer) {
|
|
4862
4872
|
pageElement = this.reactRenderer.markLayoutPosition(pageElement);
|
|
4863
4873
|
}
|
|
4864
|
-
const html = await this.
|
|
4874
|
+
const { html, head: rendererHead } = await this.renderElementToDocumentParts(
|
|
4865
4875
|
await this.wrapWithIntegrationProviders(pageElement)
|
|
4866
4876
|
);
|
|
4867
4877
|
const mergedMetadata = await this.resolveRouteMetadata({
|
|
@@ -4870,8 +4880,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4870
4880
|
pageProps,
|
|
4871
4881
|
pathname: page.urlPath
|
|
4872
4882
|
});
|
|
4873
|
-
const { title, tags, hasFavicon } = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, mergedMetadata);
|
|
4874
|
-
const
|
|
4883
|
+
const { title, tags, hasFavicon, hasExplicitTitle } = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, mergedMetadata);
|
|
4884
|
+
const titleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
4885
|
+
const metadataHead = `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}${titleTag}${tags}${rendererHead}`;
|
|
4875
4886
|
const fullDocument = this.createFullHTML(
|
|
4876
4887
|
html,
|
|
4877
4888
|
pageMetadata.shouldHydrate === true,
|
|
@@ -5199,7 +5210,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5199
5210
|
throw error;
|
|
5200
5211
|
}
|
|
5201
5212
|
}
|
|
5202
|
-
const renderingConfig = await
|
|
5213
|
+
const renderingConfig = await _chunkVMBIKDKWcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5203
5214
|
routeModule,
|
|
5204
5215
|
route.modulePath,
|
|
5205
5216
|
{ experimentalPPR: _optionalChain([this, 'access', _151 => _151.config, 'access', _152 => _152.experimental, 'optionalAccess', _153 => _153.ppr]) === true }
|
|
@@ -5291,7 +5302,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5291
5302
|
const routeManifestEntry = routeManifest.routes.find(
|
|
5292
5303
|
(entry) => entry.pattern === route.pattern
|
|
5293
5304
|
);
|
|
5294
|
-
const moduleMetadata = routeManifestEntry ||
|
|
5305
|
+
const moduleMetadata = routeManifestEntry || _chunkDRO3NXA3cjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
5295
5306
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
5296
5307
|
const renderedRouteSlots = await Promise.all(
|
|
5297
5308
|
routeSlots.map(async (slot) => {
|
|
@@ -5493,7 +5504,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5493
5504
|
_optionalChain([routeManifestEntry, 'optionalAccess', _176 => _176.serverTree]) === true
|
|
5494
5505
|
);
|
|
5495
5506
|
}
|
|
5496
|
-
pageElement = this.createPageBoundary(pageElement, {
|
|
5507
|
+
pageElement = await this.createPageBoundary(pageElement, {
|
|
5497
5508
|
pageShouldHydrate: isClientComponent || shouldHydrate,
|
|
5498
5509
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
5499
5510
|
islandStrategy: hydrationIslandStrategy
|
|
@@ -5542,7 +5553,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5542
5553
|
slot.module.default,
|
|
5543
5554
|
slot.props
|
|
5544
5555
|
);
|
|
5545
|
-
if (slot.shouldHydrate)
|
|
5556
|
+
if (slot.shouldHydrate) {
|
|
5557
|
+
slotElement = this.wrapClientGraph(
|
|
5558
|
+
await this.wrapIslandIntegrationProviders(slotElement)
|
|
5559
|
+
);
|
|
5560
|
+
}
|
|
5546
5561
|
slotElement = this.rendererRuntime.createElement(
|
|
5547
5562
|
"div",
|
|
5548
5563
|
{
|
|
@@ -5697,7 +5712,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5697
5712
|
}
|
|
5698
5713
|
}
|
|
5699
5714
|
emitFarmRenderError(req, pathname, error);
|
|
5700
|
-
const errorStatus =
|
|
5715
|
+
const errorStatus = _chunkNEKO3HM2cjs.resolveDefaultErrorStatus.call(void 0, error);
|
|
5701
5716
|
if (pprRefreshRoute) {
|
|
5702
5717
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5703
5718
|
type: "ppr.refresh.error",
|
|
@@ -5736,25 +5751,25 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5736
5751
|
}
|
|
5737
5752
|
}
|
|
5738
5753
|
async wrapWithIntegrationProviders(element) {
|
|
5739
|
-
const providers =
|
|
5754
|
+
const providers = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, this.config.integrations);
|
|
5740
5755
|
let wrapped = element;
|
|
5741
5756
|
for (let i = providers.length - 1; i >= 0; i--) {
|
|
5742
5757
|
const provider = providers[i];
|
|
5743
5758
|
if (provider.component || provider.type === "clerk") {
|
|
5744
|
-
const rendererCapabilities =
|
|
5759
|
+
const rendererCapabilities = _chunkBCTHOQPPcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
|
|
5745
5760
|
if (!rendererCapabilities.functionComponents) {
|
|
5746
5761
|
throw new Error(
|
|
5747
5762
|
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _183 => _183.config, 'access', _184 => _184.renderer, 'optionalAccess', _185 => _185.name]), () => ( "the configured renderer"))}\` cannot.`
|
|
5748
5763
|
);
|
|
5749
5764
|
}
|
|
5750
|
-
if (provider.type === "clerk" && !
|
|
5765
|
+
if (provider.type === "clerk" && !_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, this.config.renderer)) {
|
|
5751
5766
|
throw new Error(
|
|
5752
5767
|
`Integration provider \`${provider.name}\` uses Clerk's React components, which require the React renderer.`
|
|
5753
5768
|
);
|
|
5754
5769
|
}
|
|
5755
5770
|
let ProviderComponent;
|
|
5756
5771
|
let providerSourceModule;
|
|
5757
|
-
if (
|
|
5772
|
+
if (_chunkB3HQTGXScjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
5758
5773
|
providerSourceModule = provider.component.module;
|
|
5759
5774
|
const providerModuleId = provider.component.module.startsWith(".") ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0,
|
|
5760
5775
|
path10.resolve(this.config.root, provider.component.module),
|
|
@@ -5783,7 +5798,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5783
5798
|
}
|
|
5784
5799
|
if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
|
|
5785
5800
|
_nullishCoalesce(providerSourceModule, () => ( "")),
|
|
5786
|
-
|
|
5801
|
+
_chunkBCTHOQPPcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _186 => _186.config, 'access', _187 => _187.renderer, 'optionalAccess', _188 => _188.componentExtensions]))
|
|
5787
5802
|
)) {
|
|
5788
5803
|
ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
|
|
5789
5804
|
}
|
|
@@ -5930,7 +5945,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5930
5945
|
origin: await this.getAgentOrigin(request2),
|
|
5931
5946
|
readMarkdown: llmsContext.markdown
|
|
5932
5947
|
}) : value;
|
|
5933
|
-
const response =
|
|
5948
|
+
const response = _chunkNEKO3HM2cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
5934
5949
|
method,
|
|
5935
5950
|
request: request2
|
|
5936
5951
|
});
|
|
@@ -5966,7 +5981,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5966
5981
|
}) : context.defaults;
|
|
5967
5982
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
5968
5983
|
res,
|
|
5969
|
-
|
|
5984
|
+
_chunkNEKO3HM2cjs.createFarmMetadataRouteResponse.call(void 0,
|
|
5970
5985
|
kind,
|
|
5971
5986
|
body,
|
|
5972
5987
|
{ revalidate: config.revalidate },
|
|
@@ -5985,7 +6000,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5985
6000
|
}
|
|
5986
6001
|
}
|
|
5987
6002
|
getAgentCrawlers() {
|
|
5988
|
-
return
|
|
6003
|
+
return _chunkEACD6ND7cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _201 => _201.config, 'access', _202 => _202.agent, 'optionalAccess', _203 => _203.crawlers]));
|
|
5989
6004
|
}
|
|
5990
6005
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
5991
6006
|
async renderGeneratedRobotsTxt(req, res) {
|
|
@@ -5993,7 +6008,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5993
6008
|
const sitemapPath = _optionalChain([this, 'access', _204 => _204.routeManager, 'access', _205 => _205.matchMetadataRoute, 'call', _206 => _206("/sitemap.xml"), 'optionalAccess', _207 => _207.metadata, 'access', _208 => _208.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
|
|
5994
6009
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5995
6010
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5996
|
-
const robots =
|
|
6011
|
+
const robots = _chunkEACD6ND7cjs.createFarmAgentRobots.call(void 0, {
|
|
5997
6012
|
crawlers: this.getAgentCrawlers(),
|
|
5998
6013
|
sitemapPath,
|
|
5999
6014
|
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _209 => _209.metadataBase]),
|
|
@@ -6001,7 +6016,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6001
6016
|
});
|
|
6002
6017
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6003
6018
|
res,
|
|
6004
|
-
|
|
6019
|
+
_chunkNEKO3HM2cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
6005
6020
|
);
|
|
6006
6021
|
} catch (error) {
|
|
6007
6022
|
_chunk7U4XF76Rcjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
@@ -6015,7 +6030,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6015
6030
|
}
|
|
6016
6031
|
}
|
|
6017
6032
|
getAgentSitemap() {
|
|
6018
|
-
return
|
|
6033
|
+
return _chunkEACD6ND7cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _210 => _210.config, 'access', _211 => _211.agent, 'optionalAccess', _212 => _212.sitemap]));
|
|
6019
6034
|
}
|
|
6020
6035
|
/** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
|
|
6021
6036
|
async renderGeneratedSitemap(req, res) {
|
|
@@ -6038,7 +6053,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6038
6053
|
);
|
|
6039
6054
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6040
6055
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6041
|
-
const sitemap =
|
|
6056
|
+
const sitemap = _chunkEACD6ND7cjs.createFarmDefaultSitemap.call(void 0,
|
|
6042
6057
|
sources.filter((source) => source !== null),
|
|
6043
6058
|
{
|
|
6044
6059
|
origin: new URL(request2.url).origin,
|
|
@@ -6051,7 +6066,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6051
6066
|
);
|
|
6052
6067
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6053
6068
|
res,
|
|
6054
|
-
|
|
6069
|
+
_chunkNEKO3HM2cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
|
|
6055
6070
|
);
|
|
6056
6071
|
} catch (error) {
|
|
6057
6072
|
_chunk7U4XF76Rcjs.logger.error(`Generated sitemap.xml failed: ${error}`);
|
|
@@ -6080,7 +6095,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6080
6095
|
getAgentListedRoutes() {
|
|
6081
6096
|
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _223 => _223.middlewareRoutes, 'optionalCall', _224 => _224()]), () => ( [])) };
|
|
6082
6097
|
return [...this.routeManager.getRoutes()].filter(
|
|
6083
|
-
([pattern]) => !pattern.includes("[") && !
|
|
6098
|
+
([pattern]) => !pattern.includes("[") && !_chunkNEKO3HM2cjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
|
|
6084
6099
|
);
|
|
6085
6100
|
}
|
|
6086
6101
|
/**
|
|
@@ -6109,7 +6124,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6109
6124
|
if (this.routeManager.matchRoute(_chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
6110
6125
|
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0,
|
|
6111
6126
|
readAppPackageIdentity(this.config.root),
|
|
6112
|
-
|
|
6127
|
+
_chunkJK26IMT7cjs.FARM_VERSION
|
|
6113
6128
|
))));
|
|
6114
6129
|
return _chunkW53Z4WDIcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
6115
6130
|
}
|
|
@@ -6203,7 +6218,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6203
6218
|
pages,
|
|
6204
6219
|
config,
|
|
6205
6220
|
rootMetadata,
|
|
6206
|
-
mcp: _optionalChain([this, 'access', _240 => _240.config, 'access', _241 => _241.agent, 'optionalAccess', _242 => _242.aiCatalog]) === false ? [] :
|
|
6221
|
+
mcp: _optionalChain([this, 'access', _240 => _240.config, 'access', _241 => _241.agent, 'optionalAccess', _242 => _242.aiCatalog]) === false ? [] : _chunkB2PGVHBGcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
6207
6222
|
basePath: this.config.basePath,
|
|
6208
6223
|
apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
6209
6224
|
_chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
|
|
@@ -6310,7 +6325,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6310
6325
|
}
|
|
6311
6326
|
/** The renderer that draws a metadata image: none for React, whose elements Satori reads directly. */
|
|
6312
6327
|
getMetadataImageRenderer() {
|
|
6313
|
-
return
|
|
6328
|
+
return _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime;
|
|
6314
6329
|
}
|
|
6315
6330
|
async writeStaticMetadataImageResponse(req, res, image) {
|
|
6316
6331
|
const method = (req.method || "GET").toUpperCase();
|
|
@@ -6373,7 +6388,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6373
6388
|
});
|
|
6374
6389
|
let wrapped = errorElement;
|
|
6375
6390
|
const boundaryLayouts = options.errorPattern === void 0 ? options.layouts : options.layouts.filter(
|
|
6376
|
-
(layout) => !("pattern" in layout) ||
|
|
6391
|
+
(layout) => !("pattern" in layout) || _chunkNEKO3HM2cjs.routeBoundaryCoversDirectory.call(void 0,
|
|
6377
6392
|
layout.pattern,
|
|
6378
6393
|
options.errorPattern
|
|
6379
6394
|
)
|
|
@@ -6416,6 +6431,21 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6416
6431
|
return false;
|
|
6417
6432
|
}
|
|
6418
6433
|
}
|
|
6434
|
+
/**
|
|
6435
|
+
* Islands mode: a page whose route hydrates nothing as a root hydrates only islands, which hold
|
|
6436
|
+
* their own clicks, so nothing else on it is held, as in production.
|
|
6437
|
+
*/
|
|
6438
|
+
isIslandsOnlyPage(req) {
|
|
6439
|
+
return this.islandValues() && req.__FARM_PAGE_SHOULD_HYDRATE__ !== true && req.__FARM_LAYOUT_SHOULD_HYDRATE__ !== true && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true;
|
|
6440
|
+
}
|
|
6441
|
+
/**
|
|
6442
|
+
* The head script that holds a page's clicks and submits until it hydrates, which the client
|
|
6443
|
+
* replays once it has. Production writes it into the same pages, streamed or buffered.
|
|
6444
|
+
*/
|
|
6445
|
+
renderPreHydrationHold(req, bootClient) {
|
|
6446
|
+
const hydrates = req.__FARM_IS_CLIENT_COMPONENT__ === true || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true;
|
|
6447
|
+
return hydrates && !bootClient && !this.isIslandsOnlyPage(req) ? _chunkNEKO3HM2cjs.createPreHydrationClickQueueScript.call(void 0, ) : "";
|
|
6448
|
+
}
|
|
6419
6449
|
async renderBufferedSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6420
6450
|
const startedAt = Date.now();
|
|
6421
6451
|
const route = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
@@ -6457,7 +6487,7 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
|
|
|
6457
6487
|
window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
|
|
6458
6488
|
window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
|
|
6459
6489
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
6460
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6490
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkB3HQTGXScjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6461
6491
|
window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
6462
6492
|
</script>`);
|
|
6463
6493
|
const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
|
|
@@ -6468,6 +6498,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6468
6498
|
const farmClientScript = farmScripts(
|
|
6469
6499
|
`<script type="module" src="/@farm/client.js"></script>`
|
|
6470
6500
|
);
|
|
6501
|
+
const holdScript = farmScripts(this.renderPreHydrationHold(req, false));
|
|
6471
6502
|
const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
|
|
6472
6503
|
element,
|
|
6473
6504
|
{
|
|
@@ -6494,19 +6525,19 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6494
6525
|
i18nSnapshot,
|
|
6495
6526
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6496
6527
|
) : "";
|
|
6497
|
-
const themeDocument =
|
|
6528
|
+
const themeDocument = _chunkNEKO3HM2cjs.createFarmThemeDocumentParts.call(void 0,
|
|
6498
6529
|
this.config.theme,
|
|
6499
6530
|
this.config.basePath,
|
|
6500
6531
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
6501
6532
|
);
|
|
6502
6533
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
6503
|
-
const fullDocument =
|
|
6534
|
+
const fullDocument = _chunkNEKO3HM2cjs.extractFarmFullDocument.call(void 0, _chunkNEKO3HM2cjs.markFarmDocumentLayouts.call(void 0, content));
|
|
6504
6535
|
let html;
|
|
6505
6536
|
if (fullDocument) {
|
|
6506
6537
|
const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
|
|
6507
|
-
const documentHtml = shouldReplaceLayoutTitle ?
|
|
6508
|
-
const effectiveRendererHead = hasExplicitTitle ?
|
|
6509
|
-
html =
|
|
6538
|
+
const documentHtml = shouldReplaceLayoutTitle ? _chunkNEKO3HM2cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
|
|
6539
|
+
const effectiveRendererHead = hasExplicitTitle ? _chunkNEKO3HM2cjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
|
|
6540
|
+
html = _chunkNEKO3HM2cjs.composeFarmFullDocument.call(void 0, documentHtml, {
|
|
6510
6541
|
fallbackIcon: !hasFavicon,
|
|
6511
6542
|
viewport: viewportTags,
|
|
6512
6543
|
htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
|
|
@@ -6526,7 +6557,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6526
6557
|
...this.collectDevStyleLinks(),
|
|
6527
6558
|
viteClientScript,
|
|
6528
6559
|
rendererHydrationScript,
|
|
6529
|
-
bootstrapScript
|
|
6560
|
+
bootstrapScript,
|
|
6561
|
+
holdScript
|
|
6530
6562
|
].filter(Boolean).join("\n "),
|
|
6531
6563
|
bodyFooter: [deferredScript, farmClientScript].filter(Boolean).join("\n ")
|
|
6532
6564
|
});
|
|
@@ -6546,7 +6578,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6546
6578
|
${l}`).join("")}
|
|
6547
6579
|
${viteClientScript}
|
|
6548
6580
|
${rendererHydrationScript}
|
|
6549
|
-
${bootstrapScript}
|
|
6581
|
+
${bootstrapScript}${holdScript ? `
|
|
6582
|
+
${holdScript}` : ""}
|
|
6550
6583
|
</head>
|
|
6551
6584
|
<body class="">
|
|
6552
6585
|
<div id="root">${content}</div>
|
|
@@ -6610,10 +6643,10 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6610
6643
|
}
|
|
6611
6644
|
async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6612
6645
|
const runtime = this.rendererRuntime;
|
|
6613
|
-
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (
|
|
6646
|
+
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (_chunkBCTHOQPPcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node").web && runtime.renderToReadableStream ? pipeFarmRendererWebStream(runtime) : void 0)));
|
|
6614
6647
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6615
6648
|
const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument(req);
|
|
6616
|
-
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _277 => _277.headers, 'optionalAccess', _278 => _278[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !
|
|
6649
|
+
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _277 => _277.headers, 'optionalAccess', _278 => _278[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, this.config.renderer))) {
|
|
6617
6650
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
6618
6651
|
}
|
|
6619
6652
|
return new Promise((resolve3, reject) => {
|
|
@@ -6683,14 +6716,15 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
|
|
|
6683
6716
|
req.__FARM_LOADING_MODULE_PATH__ || null
|
|
6684
6717
|
)};
|
|
6685
6718
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
6686
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6719
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkB3HQTGXScjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6687
6720
|
window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
6688
6721
|
</script>${_chunkOZUINP2Pcjs.renderFarmFormStateScript.call(void 0, )}`;
|
|
6689
|
-
const islandsOnlyPage = this.
|
|
6722
|
+
const islandsOnlyPage = this.isIslandsOnlyPage(req);
|
|
6690
6723
|
const rootStrategy = req.__FARM_ISLAND_STRATEGY__;
|
|
6691
6724
|
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
6725
|
const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts && _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ) !== "mobile" && canBootFarmIslandsClient(this.config);
|
|
6693
|
-
const hydrationClickQueueScript =
|
|
6726
|
+
const hydrationClickQueueScript = this.renderPreHydrationHold(req, bootClient);
|
|
6727
|
+
const rendererHydrationScript = _optionalChain([this, 'access', _279 => _279.rendererRuntime, 'access', _280 => _280.generateHydrationScript, 'optionalCall', _281 => _281()]) || "";
|
|
6694
6728
|
const {
|
|
6695
6729
|
title,
|
|
6696
6730
|
tags: metaTags,
|
|
@@ -6699,7 +6733,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6699
6733
|
viewport: viewportTags
|
|
6700
6734
|
} = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6701
6735
|
pathname: getFarmMetadataPathname(req),
|
|
6702
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6736
|
+
jsonLd: _optionalChain([this, 'access', _282 => _282.config, 'access', _283 => _283.agent, 'optionalAccess', _284 => _284.jsonLd])
|
|
6703
6737
|
});
|
|
6704
6738
|
const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6705
6739
|
const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -6708,7 +6742,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6708
6742
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6709
6743
|
) : "";
|
|
6710
6744
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6711
|
-
const themeDocument =
|
|
6745
|
+
const themeDocument = _chunkNEKO3HM2cjs.createFarmThemeDocumentParts.call(void 0,
|
|
6712
6746
|
this.config.theme,
|
|
6713
6747
|
this.config.basePath,
|
|
6714
6748
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
@@ -6727,7 +6761,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6727
6761
|
formState: _chunkOZUINP2Pcjs.getFarmFormState.call(void 0, ),
|
|
6728
6762
|
onShellReady() {
|
|
6729
6763
|
if (pendingNavigationError) {
|
|
6730
|
-
_optionalChain([abort, 'optionalCall',
|
|
6764
|
+
_optionalChain([abort, 'optionalCall', _285 => _285(pendingNavigationError)]);
|
|
6731
6765
|
if (clearMiddlewareData) {
|
|
6732
6766
|
clearMiddlewareData();
|
|
6733
6767
|
}
|
|
@@ -6745,7 +6779,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6745
6779
|
console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
|
|
6746
6780
|
}
|
|
6747
6781
|
const shell = `<!DOCTYPE html>
|
|
6748
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6782
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _286 => _286.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6749
6783
|
<head>
|
|
6750
6784
|
${themeDocument.head}
|
|
6751
6785
|
<meta charset="utf-8">
|
|
@@ -6756,7 +6790,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6756
6790
|
${fontHead}
|
|
6757
6791
|
${globalStylesheetLink}${devStyleLinks.map((l) => `
|
|
6758
6792
|
${l}`).join("")}
|
|
6759
|
-
<script type="module" src="/@vite/client"></script
|
|
6793
|
+
<script type="module" src="/@vite/client"></script>${rendererHydrationScript ? `
|
|
6794
|
+
${rendererHydrationScript}` : ""}
|
|
6760
6795
|
${propsScript}
|
|
6761
6796
|
${hydrationClickQueueScript}
|
|
6762
6797
|
</head>
|
|
@@ -6766,14 +6801,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6766
6801
|
let pendingShell = streamDocument ? "" : stampDocumentHTML(shell);
|
|
6767
6802
|
let heldHead = "";
|
|
6768
6803
|
const releaseShell = (complete) => {
|
|
6769
|
-
const split =
|
|
6804
|
+
const split = _chunkNEKO3HM2cjs.takeFarmHoistedHead.call(void 0, heldHead, complete);
|
|
6770
6805
|
if (!split) return null;
|
|
6771
|
-
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ?
|
|
6772
|
-
const opened =
|
|
6806
|
+
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? _chunkNEKO3HM2cjs.removeFarmDocumentTitles.call(void 0, pendingShell) : pendingShell;
|
|
6807
|
+
const opened = _chunkNEKO3HM2cjs.appendFarmHead.call(void 0, shellHead, split.head);
|
|
6773
6808
|
pendingShell = "";
|
|
6774
6809
|
heldHead = "";
|
|
6775
6810
|
htmlParts.push(opened);
|
|
6776
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
6811
|
+
_optionalChain([staticShellParts, 'optionalAccess', _287 => _287.push, 'call', _288 => _288(opened)]);
|
|
6777
6812
|
res.write(opened);
|
|
6778
6813
|
return split.body;
|
|
6779
6814
|
};
|
|
@@ -6785,11 +6820,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6785
6820
|
${stampDocumentHTML(earlyClientScript)}`
|
|
6786
6821
|
)
|
|
6787
6822
|
} : document;
|
|
6788
|
-
const documentTransform = streamDocument ?
|
|
6823
|
+
const documentTransform = streamDocument ? _chunkNEKO3HM2cjs.createFarmStreamedDocumentTransform.call(void 0,
|
|
6789
6824
|
(opening) => withEarlyClient(
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
hasExplicitTitle ?
|
|
6825
|
+
_chunkNEKO3HM2cjs.openFarmStreamedDocument.call(void 0,
|
|
6826
|
+
_chunkNEKO3HM2cjs.markFarmDocumentLayouts.call(void 0,
|
|
6827
|
+
hasExplicitTitle ? _chunkNEKO3HM2cjs.removeFarmDocumentTitles.call(void 0, opening) : opening
|
|
6793
6828
|
),
|
|
6794
6829
|
{
|
|
6795
6830
|
fallbackIcon: !hasFavicon,
|
|
@@ -6810,6 +6845,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6810
6845
|
globalStylesheetLink,
|
|
6811
6846
|
...devStyleLinks,
|
|
6812
6847
|
`<script type="module" src="/@vite/client"></script>`,
|
|
6848
|
+
rendererHydrationScript,
|
|
6813
6849
|
propsScript,
|
|
6814
6850
|
hydrationClickQueueScript
|
|
6815
6851
|
].filter(Boolean).join("\n ")
|
|
@@ -6829,7 +6865,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6829
6865
|
const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
|
|
6830
6866
|
if (!checkedFullDocument && renderedText) {
|
|
6831
6867
|
documentPrefix += renderedText;
|
|
6832
|
-
const prefix =
|
|
6868
|
+
const prefix = _chunkNEKO3HM2cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
|
|
6833
6869
|
if (prefix !== "pending") {
|
|
6834
6870
|
checkedFullDocument = true;
|
|
6835
6871
|
documentPrefix = "";
|
|
@@ -6848,7 +6884,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6848
6884
|
staticShellClosed = true;
|
|
6849
6885
|
if (!suspenseHoleEmitted) {
|
|
6850
6886
|
suspenseHoleEmitted = true;
|
|
6851
|
-
_optionalChain([options, 'access',
|
|
6887
|
+
_optionalChain([options, 'access', _289 => _289.onSuspenseHoleDetected, 'optionalCall', _290 => _290()]);
|
|
6852
6888
|
}
|
|
6853
6889
|
} else {
|
|
6854
6890
|
staticShellParts.push(chunkText);
|
|
@@ -6900,7 +6936,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6900
6936
|
const body = releaseShell(true);
|
|
6901
6937
|
if (body) {
|
|
6902
6938
|
htmlParts.push(body);
|
|
6903
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
6939
|
+
_optionalChain([staticShellParts, 'optionalAccess', _291 => _291.push, 'call', _292 => _292(body)]);
|
|
6904
6940
|
res.write(body);
|
|
6905
6941
|
}
|
|
6906
6942
|
}
|
|
@@ -6932,8 +6968,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6932
6968
|
recordRenderedChunk(tail, rewritten);
|
|
6933
6969
|
if (tail) res.write(tail);
|
|
6934
6970
|
}
|
|
6935
|
-
const documentEnd = _optionalChain([documentTransform, 'optionalAccess',
|
|
6936
|
-
if (_optionalChain([documentEnd, 'optionalAccess',
|
|
6971
|
+
const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _293 => _293.end, 'call', _294 => _294()]);
|
|
6972
|
+
if (_optionalChain([documentEnd, 'optionalAccess', _295 => _295.text])) {
|
|
6937
6973
|
recordRenderedChunk(documentEnd.text, "");
|
|
6938
6974
|
res.write(documentEnd.text);
|
|
6939
6975
|
}
|
|
@@ -6944,7 +6980,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6944
6980
|
deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
|
|
6945
6981
|
earlyClient,
|
|
6946
6982
|
// A full document: Farm's #root closes only where Farm opened it.
|
|
6947
|
-
..._optionalChain([documentEnd, 'optionalAccess',
|
|
6983
|
+
..._optionalChain([documentEnd, 'optionalAccess', _296 => _296.document]) ? { closeRoot: documentEnd.rootOpened } : {}
|
|
6948
6984
|
})
|
|
6949
6985
|
);
|
|
6950
6986
|
htmlParts.push(footer);
|
|
@@ -7056,7 +7092,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7056
7092
|
return await this.routeManager.loadRouteModule(notFoundPath);
|
|
7057
7093
|
}
|
|
7058
7094
|
async loadNotFoundComponent() {
|
|
7059
|
-
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async
|
|
7095
|
+
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _297 => _297.default]), async () => ( null));
|
|
7060
7096
|
}
|
|
7061
7097
|
/** The not-found document's head: layout and not-found metadata, as production renders it. */
|
|
7062
7098
|
async notFoundMetadataHead(layoutModule, notFoundModule) {
|
|
@@ -7079,13 +7115,13 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7079
7115
|
*/
|
|
7080
7116
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
7081
7117
|
if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
|
|
7082
|
-
return
|
|
7118
|
+
return _chunkNEKO3HM2cjs.createLateRedirectRecovery.call(void 0,
|
|
7083
7119
|
this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
|
|
7084
7120
|
this.getCspNonce(req) || ""
|
|
7085
7121
|
);
|
|
7086
7122
|
}
|
|
7087
7123
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7088
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7124
|
+
trustProxy: _optionalChain([this, 'access', _298 => _298.config, 'access', _299 => _299.server, 'optionalAccess', _300 => _300.trustProxy])
|
|
7089
7125
|
}).pathname;
|
|
7090
7126
|
let content = this.defaultNotFoundContent();
|
|
7091
7127
|
const NotFoundComponent = await this.loadNotFoundComponent();
|
|
@@ -7100,14 +7136,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7100
7136
|
_chunk7U4XF76Rcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
7101
7137
|
}
|
|
7102
7138
|
}
|
|
7103
|
-
return
|
|
7139
|
+
return _chunkNEKO3HM2cjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
|
|
7104
7140
|
}
|
|
7105
7141
|
async render404(req, res) {
|
|
7106
7142
|
res.statusCode = 404;
|
|
7107
7143
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7108
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7144
|
+
trustProxy: _optionalChain([this, 'access', _301 => _301.config, 'access', _302 => _302.server, 'optionalAccess', _303 => _303.trustProxy])
|
|
7109
7145
|
}).pathname;
|
|
7110
|
-
if (
|
|
7146
|
+
if (_chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7111
7147
|
res.setHeader("Content-Type", "application/json");
|
|
7112
7148
|
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
7113
7149
|
return;
|
|
@@ -7130,7 +7166,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7130
7166
|
return;
|
|
7131
7167
|
}
|
|
7132
7168
|
const appDir = path10.join(this.config.root, this.config.srcDir, "app");
|
|
7133
|
-
const notFoundExtensions =
|
|
7169
|
+
const notFoundExtensions = _chunkBCTHOQPPcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7134
7170
|
let layoutModule = null;
|
|
7135
7171
|
try {
|
|
7136
7172
|
for (const ext of notFoundExtensions) {
|
|
@@ -7146,9 +7182,9 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7146
7182
|
);
|
|
7147
7183
|
if (notFoundPath) {
|
|
7148
7184
|
const notFoundModule = await this.loadNotFoundModule();
|
|
7149
|
-
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess',
|
|
7185
|
+
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _304 => _304.default]), () => ( null));
|
|
7150
7186
|
if (NotFoundComponent) {
|
|
7151
|
-
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess',
|
|
7187
|
+
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _305 => _305.default]), () => ( null));
|
|
7152
7188
|
let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
|
|
7153
7189
|
if (LayoutComponent) {
|
|
7154
7190
|
element = this.rendererRuntime.createElement(LayoutComponent, {
|
|
@@ -7185,23 +7221,23 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7185
7221
|
res.statusCode = statusCode;
|
|
7186
7222
|
const isDev = process.env.NODE_ENV === "development";
|
|
7187
7223
|
const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7188
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7224
|
+
trustProxy: _optionalChain([this, 'access', _306 => _306.config, 'access', _307 => _307.server, 'optionalAccess', _308 => _308.trustProxy])
|
|
7189
7225
|
});
|
|
7190
7226
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7191
|
-
const statusText =
|
|
7227
|
+
const statusText = _chunkNEKO3HM2cjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
7192
7228
|
const content = this.stampFarmScripts(
|
|
7193
7229
|
req,
|
|
7194
|
-
|
|
7230
|
+
_chunkNEKO3HM2cjs.createDefaultErrorMarkup.call(void 0, {
|
|
7195
7231
|
statusCode,
|
|
7196
7232
|
statusText,
|
|
7197
7233
|
requestPath: requestUrl.pathname,
|
|
7198
7234
|
method: req.method || "GET",
|
|
7199
|
-
message: _optionalChain([diagnostics, 'optionalAccess',
|
|
7200
|
-
errorName: _optionalChain([diagnostics, 'optionalAccess',
|
|
7201
|
-
stack: _optionalChain([diagnostics, 'optionalAccess',
|
|
7202
|
-
sourceFrame: _optionalChain([diagnostics, 'optionalAccess',
|
|
7235
|
+
message: _optionalChain([diagnostics, 'optionalAccess', _309 => _309.message]),
|
|
7236
|
+
errorName: _optionalChain([diagnostics, 'optionalAccess', _310 => _310.name]),
|
|
7237
|
+
stack: _optionalChain([diagnostics, 'optionalAccess', _311 => _311.stack]),
|
|
7238
|
+
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _312 => _312.sourceFrame]),
|
|
7203
7239
|
development: isDev,
|
|
7204
|
-
farmVersion:
|
|
7240
|
+
farmVersion: _chunkJK26IMT7cjs.FARM_VERSION,
|
|
7205
7241
|
nodeVersion: process.version,
|
|
7206
7242
|
mode: isDev ? "development" : "production"
|
|
7207
7243
|
})
|
|
@@ -7227,9 +7263,9 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7227
7263
|
*/
|
|
7228
7264
|
getI18nAlternateOptions(req, metadata) {
|
|
7229
7265
|
return {
|
|
7230
|
-
metadataBase: _optionalChain([metadata, 'optionalAccess',
|
|
7231
|
-
origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7232
|
-
languages: _optionalChain([metadata, 'optionalAccess',
|
|
7266
|
+
metadataBase: _optionalChain([metadata, 'optionalAccess', _313 => _313.metadataBase]),
|
|
7267
|
+
origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _314 => _314.config, 'access', _315 => _315.server, 'optionalAccess', _316 => _316.trustProxy]) }).origin : void 0,
|
|
7268
|
+
languages: _optionalChain([metadata, 'optionalAccess', _317 => _317.alternates, 'optionalAccess', _318 => _318.languages])
|
|
7233
7269
|
};
|
|
7234
7270
|
}
|
|
7235
7271
|
createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
|
|
@@ -7239,7 +7275,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7239
7275
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
7240
7276
|
const integrationManifestScript = farmScripts(`<script>
|
|
7241
7277
|
window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
|
|
7242
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
7278
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkB3HQTGXScjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
7243
7279
|
${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
|
|
7244
7280
|
</script>`);
|
|
7245
7281
|
const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -7248,20 +7284,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7248
7284
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
7249
7285
|
) : "";
|
|
7250
7286
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
7251
|
-
const themeDocument =
|
|
7287
|
+
const themeDocument = _chunkNEKO3HM2cjs.createFarmThemeDocumentParts.call(void 0,
|
|
7252
7288
|
this.config.theme,
|
|
7253
7289
|
this.config.basePath,
|
|
7254
7290
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
7255
7291
|
);
|
|
7256
7292
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
7257
7293
|
const rendererHydrationScript = farmScripts(
|
|
7258
|
-
_optionalChain([this, 'access',
|
|
7294
|
+
_optionalChain([this, 'access', _319 => _319.rendererRuntime, 'access', _320 => _320.generateHydrationScript, 'optionalCall', _321 => _321()]) || ""
|
|
7259
7295
|
);
|
|
7260
|
-
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access',
|
|
7261
|
-
const fullDocument =
|
|
7296
|
+
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _322 => _322.metadata, 'optionalAccess', _323 => _323.viewport]));
|
|
7297
|
+
const fullDocument = _chunkNEKO3HM2cjs.extractFarmFullDocument.call(void 0, _chunkNEKO3HM2cjs.markFarmDocumentLayouts.call(void 0, content));
|
|
7262
7298
|
if (fullDocument) {
|
|
7263
|
-
return
|
|
7264
|
-
metadataHead ?
|
|
7299
|
+
return _chunkNEKO3HM2cjs.composeFarmFullDocument.call(void 0,
|
|
7300
|
+
metadataHead ? _chunkNEKO3HM2cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
|
|
7265
7301
|
{
|
|
7266
7302
|
fallbackIcon: !metadataHead,
|
|
7267
7303
|
viewport: viewportTags,
|
|
@@ -7287,7 +7323,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7287
7323
|
);
|
|
7288
7324
|
}
|
|
7289
7325
|
return `<!DOCTYPE html>
|
|
7290
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
7326
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _324 => _324.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
7291
7327
|
<head>
|
|
7292
7328
|
${themeDocument.head}
|
|
7293
7329
|
<meta charset="utf-8">
|
|
@@ -7328,7 +7364,7 @@ ${clientScript}
|
|
|
7328
7364
|
const deploymentId = this.getDeploymentId();
|
|
7329
7365
|
res.setHeader(_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
|
|
7330
7366
|
if ((req.method || "GET").toUpperCase() !== "GET") return;
|
|
7331
|
-
const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7367
|
+
const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _325 => _325.config, 'access', _326 => _326.server, 'optionalAccess', _327 => _327.trustProxy]) }).protocol === "https:";
|
|
7332
7368
|
const cookie = _chunkNLBHLPEOcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
|
|
7333
7369
|
const existing = res.getHeader("Set-Cookie");
|
|
7334
7370
|
if (Array.isArray(existing)) {
|
|
@@ -7391,7 +7427,7 @@ var FarmApp = class {
|
|
|
7391
7427
|
await this.serverRenderer.initialize();
|
|
7392
7428
|
await this.verifyAppStructure();
|
|
7393
7429
|
await this.routeManager.discoverRoutes();
|
|
7394
|
-
if (
|
|
7430
|
+
if (_chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) this.assertNoPageRoutes();
|
|
7395
7431
|
this.routeManager.generateClientManifest(this.config.root);
|
|
7396
7432
|
if (process.env.FARM_VERBOSE) {
|
|
7397
7433
|
_chunk7U4XF76Rcjs.logger.success("Farm.js application initialized successfully!");
|
|
@@ -7420,7 +7456,7 @@ var FarmApp = class {
|
|
|
7420
7456
|
outDir: config.outDir || "dist",
|
|
7421
7457
|
basePath,
|
|
7422
7458
|
trailingSlash: _nullishCoalesce(config.trailingSlash, () => ( false)),
|
|
7423
|
-
renderer:
|
|
7459
|
+
renderer: _chunkBCTHOQPPcjs.resolveFarmRenderer.call(void 0, config.renderer),
|
|
7424
7460
|
preset: _nullishCoalesce(config.preset, () => ( "node-server")),
|
|
7425
7461
|
deploy: config.deploy || {},
|
|
7426
7462
|
storage: config.storage || {},
|
|
@@ -7430,7 +7466,7 @@ var FarmApp = class {
|
|
|
7430
7466
|
integrations: config.integrations || {},
|
|
7431
7467
|
plugins: config.plugins || [],
|
|
7432
7468
|
migrations: config.migrations || { commands: [] },
|
|
7433
|
-
cron:
|
|
7469
|
+
cron: _chunkHQKCSJEHcjs.resolveCronConfig.call(void 0, config.cron),
|
|
7434
7470
|
workflows: _chunkBSX5OGSDcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
|
|
7435
7471
|
api: normalizeFarmAppAPIConfig(config.api),
|
|
7436
7472
|
middleware: config.middleware || {},
|
|
@@ -7441,9 +7477,9 @@ var FarmApp = class {
|
|
|
7441
7477
|
security: _chunk6JHZPB52cjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7442
7478
|
images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
|
|
7443
7479
|
config.images,
|
|
7444
|
-
|
|
7480
|
+
_chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
|
|
7445
7481
|
),
|
|
7446
|
-
performance:
|
|
7482
|
+
performance: _chunkEACD6ND7cjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7447
7483
|
theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
7448
7484
|
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkZMSVKVI3cjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
|
|
7449
7485
|
root,
|
|
@@ -7471,10 +7507,10 @@ var FarmApp = class {
|
|
|
7471
7507
|
env: config.env || { server: {}, public: {} },
|
|
7472
7508
|
suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
|
|
7473
7509
|
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',
|
|
7510
|
+
serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _328 => _328.experimental, 'optionalAccess', _329 => _329.serverComponents]), () => ( false)),
|
|
7511
|
+
serverActions: _nullishCoalesce(_optionalChain([config, 'access', _330 => _330.experimental, 'optionalAccess', _331 => _331.serverActions]), () => ( false)),
|
|
7512
|
+
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _332 => _332.experimental, 'optionalAccess', _333 => _333.isolatedClientHydration]), () => ( "off")),
|
|
7513
|
+
ppr: _nullishCoalesce(_optionalChain([config, 'access', _334 => _334.experimental, 'optionalAccess', _335 => _335.ppr]), () => ( false)),
|
|
7478
7514
|
...config.experimental
|
|
7479
7515
|
},
|
|
7480
7516
|
agent: _nullishCoalesce(config.agent, () => ( {})),
|
|
@@ -7510,14 +7546,14 @@ var FarmApp = class {
|
|
|
7510
7546
|
`App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
|
|
7511
7547
|
);
|
|
7512
7548
|
}
|
|
7513
|
-
const componentExtensions =
|
|
7549
|
+
const componentExtensions = _chunkBCTHOQPPcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7514
7550
|
const rootLayoutPaths = appDirs.flatMap(
|
|
7515
7551
|
(appDir) => componentExtensions.map((extension) => path4.default.join(appDir, `layout${extension}`))
|
|
7516
7552
|
);
|
|
7517
7553
|
const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunk7U4XF76Rcjs.fileExists.call(void 0, p))).then(
|
|
7518
7554
|
(results) => results.some(Boolean)
|
|
7519
7555
|
);
|
|
7520
|
-
if (!hasRootLayout && !
|
|
7556
|
+
if (!hasRootLayout && !_chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7521
7557
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
7522
7558
|
`No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
|
|
7523
7559
|
);
|
|
@@ -7533,7 +7569,7 @@ function isResolvedAuthConfig(value) {
|
|
|
7533
7569
|
);
|
|
7534
7570
|
}
|
|
7535
7571
|
function normalizeFarmAppAPIConfig(config) {
|
|
7536
|
-
if (typeof _optionalChain([config, 'optionalAccess',
|
|
7572
|
+
if (typeof _optionalChain([config, 'optionalAccess', _336 => _336.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _337 => _337.basePath]) === "function") {
|
|
7537
7573
|
throw new Error(
|
|
7538
7574
|
"Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
|
|
7539
7575
|
);
|
|
@@ -7548,7 +7584,7 @@ function createFarmApp(config, viteServer) {
|
|
|
7548
7584
|
var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
|
|
7549
7585
|
var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
|
|
7550
7586
|
function resolveFarmImageProviderForRuntime(images, options) {
|
|
7551
|
-
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess',
|
|
7587
|
+
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _338 => _338.provider]), () => ( "auto"));
|
|
7552
7588
|
if (provider === "none") return images;
|
|
7553
7589
|
const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
|
|
7554
7590
|
if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
|
|
@@ -7689,9 +7725,9 @@ function staticValue(node) {
|
|
|
7689
7725
|
}
|
|
7690
7726
|
}
|
|
7691
7727
|
function property(object, name) {
|
|
7692
|
-
return _optionalChain([object, 'access',
|
|
7728
|
+
return _optionalChain([object, 'access', _339 => _339.properties, 'access', _340 => _340.find, 'call', _341 => _341(
|
|
7693
7729
|
(entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
|
|
7694
|
-
), 'optionalAccess',
|
|
7730
|
+
), 'optionalAccess', _342 => _342.value]);
|
|
7695
7731
|
}
|
|
7696
7732
|
function toolFromObject(object) {
|
|
7697
7733
|
const name = staticValue(property(object, "name"));
|
|
@@ -7737,7 +7773,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7737
7773
|
if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
|
|
7738
7774
|
continue;
|
|
7739
7775
|
for (const specifier of statement.specifiers) {
|
|
7740
|
-
const imported = _nullishCoalesce(_optionalChain([specifier, 'access',
|
|
7776
|
+
const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _343 => _343.imported, 'optionalAccess', _344 => _344.name]), () => ( _optionalChain([specifier, 'access', _345 => _345.imported, 'optionalAccess', _346 => _346.value])));
|
|
7741
7777
|
if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
|
|
7742
7778
|
locals.set(specifier.local.name, imported);
|
|
7743
7779
|
}
|
|
@@ -7753,7 +7789,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7753
7789
|
const [argument] = current.arguments;
|
|
7754
7790
|
if (definer && argument) {
|
|
7755
7791
|
const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
|
|
7756
|
-
(element) => _optionalChain([element, 'optionalAccess',
|
|
7792
|
+
(element) => _optionalChain([element, 'optionalAccess', _347 => _347.type]) === "ObjectExpression"
|
|
7757
7793
|
) : [] : argument.type === "ObjectExpression" ? [argument] : [];
|
|
7758
7794
|
for (const object of objects) {
|
|
7759
7795
|
const tool = toolFromObject(object);
|
|
@@ -7814,8 +7850,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
|
7814
7850
|
|
|
7815
7851
|
var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
7816
7852
|
function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
7817
|
-
const client = _optionalChain([cache2, 'optionalAccess',
|
|
7818
|
-
const adapter = _optionalChain([client, 'optionalAccess',
|
|
7853
|
+
const client = _optionalChain([cache2, 'optionalAccess', _348 => _348.client]);
|
|
7854
|
+
const adapter = _optionalChain([client, 'optionalAccess', _349 => _349.adapter]);
|
|
7819
7855
|
if (adapter === void 0) return void 0;
|
|
7820
7856
|
if (typeof adapter !== "string" || adapter.trim().length === 0) {
|
|
7821
7857
|
throw new Error(
|
|
@@ -7830,8 +7866,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
|
7830
7866
|
);
|
|
7831
7867
|
}
|
|
7832
7868
|
const options = {};
|
|
7833
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
7834
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
7869
|
+
if (_optionalChain([client, 'optionalAccess', _350 => _350.version]) !== void 0) options.version = client.version;
|
|
7870
|
+
if (_optionalChain([client, 'optionalAccess', _351 => _351.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
|
|
7835
7871
|
return { importPath: found.replace(/\\/g, "/"), options };
|
|
7836
7872
|
}
|
|
7837
7873
|
function resolveAdapterFile(resolved) {
|
|
@@ -8036,6 +8072,15 @@ function createFarmNavigationScript(script) {
|
|
|
8036
8072
|
freshScript.textContent = script.textContent || "";
|
|
8037
8073
|
return freshScript;
|
|
8038
8074
|
}
|
|
8075
|
+
// Readies nodes parsed outside the page (DOMParser, a <template>) for the page they move into.
|
|
8076
|
+
// Those parse as a page without scripting, so a <noscript>'s content comes out as elements, whose
|
|
8077
|
+
// images and frames would load once in the page. They become the text the page's own parser makes
|
|
8078
|
+
// of that markup.
|
|
8079
|
+
function adoptFarmParsedNodes(root) {
|
|
8080
|
+
for (const noscript of Array.from(root.querySelectorAll("noscript"))) {
|
|
8081
|
+
noscript.textContent = noscript.innerHTML;
|
|
8082
|
+
}
|
|
8083
|
+
}
|
|
8039
8084
|
// React streams Suspense content after its fallback, in a hidden segment that a reveal script
|
|
8040
8085
|
// ($RC for a boundary, $RS for a segment placeholder) moves into place. This makes the same moves
|
|
8041
8086
|
// in a parsed page, before it goes on screen, and drops the calls it made, so the islands in that
|
|
@@ -8134,7 +8179,8 @@ async function readFarmNavigationStream(body, flushToken) {
|
|
|
8134
8179
|
cancel: function() { reader.cancel().catch(function() {}); },
|
|
8135
8180
|
};
|
|
8136
8181
|
}`;
|
|
8137
|
-
var FARM_EARLY_NAVIGATION_SOURCE = `// The request the boot script sent for a link clicked before the router ran
|
|
8182
|
+
var FARM_EARLY_NAVIGATION_SOURCE = `// The request the boot script sent for a link pressed or clicked before the router ran
|
|
8183
|
+
// (islands-boot.ts).
|
|
8138
8184
|
// The next navigation request takes its response when it is the same request, and aborts it
|
|
8139
8185
|
// otherwise. The held island values may differ: a response for fewer of them carries more values,
|
|
8140
8186
|
// which fits any page. As with a prefetched page, a response sent over 30 seconds ago is not used.
|
|
@@ -8279,7 +8325,7 @@ function redactFarmDocsClientConfig(code, filename) {
|
|
|
8279
8325
|
const current = node;
|
|
8280
8326
|
if (current.type === "Property") {
|
|
8281
8327
|
const name = propertyKeyName(current);
|
|
8282
|
-
const valueType = _optionalChain([current, 'access',
|
|
8328
|
+
const valueType = _optionalChain([current, 'access', _352 => _352.value, 'optionalAccess', _353 => _353.type]);
|
|
8283
8329
|
const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkSM2SYWARcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
|
|
8284
8330
|
if (name && credential) {
|
|
8285
8331
|
edits.push(
|
|
@@ -8322,7 +8368,7 @@ function farmDocsClientConfigPlugin(configModule) {
|
|
|
8322
8368
|
// Never matches without a docs config module, so the bundler never calls the handler.
|
|
8323
8369
|
filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
|
|
8324
8370
|
handler(code, id, options) {
|
|
8325
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
8371
|
+
if (_optionalChain([options, 'optionalAccess', _354 => _354.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
|
|
8326
8372
|
const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
|
|
8327
8373
|
return redacted === null ? null : { code: redacted, map: null };
|
|
8328
8374
|
}
|
|
@@ -8425,13 +8471,13 @@ function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
|
8425
8471
|
return Array.from(
|
|
8426
8472
|
/* @__PURE__ */ new Set([
|
|
8427
8473
|
...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE,
|
|
8428
|
-
..._optionalChain([renderer, 'optionalAccess',
|
|
8474
|
+
..._optionalChain([renderer, 'optionalAccess', _355 => _355.optimizeDeps]) || [],
|
|
8429
8475
|
// Farm's browser entry imports a renderer's client module, and no app file does, so Vite's
|
|
8430
8476
|
// scan never sees it and finds it only on the first page request, then bundles again. The
|
|
8431
8477
|
// React entry imports `react-dom/client` instead, which is already listed. A linked
|
|
8432
8478
|
// renderer stays source: pre-bundling it would copy the packages it shares with the app's
|
|
8433
8479
|
// components into the bundle, so a hook would read a different copy than the renderer set.
|
|
8434
|
-
...renderer && root && !
|
|
8480
|
+
...renderer && root && !_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) && _chunkPWDBWXQIcjs.isPackageSpecifier.call(void 0, renderer.client) && isInstalledPackage(root, renderer.client) ? [renderer.client] : []
|
|
8435
8481
|
])
|
|
8436
8482
|
);
|
|
8437
8483
|
}
|
|
@@ -8444,7 +8490,7 @@ function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
|
8444
8490
|
});
|
|
8445
8491
|
}
|
|
8446
8492
|
function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
8447
|
-
if (
|
|
8493
|
+
if (_chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, renderer)) return { noDiscovery: true, include: [] };
|
|
8448
8494
|
const jsxImportSource = renderer ? renderer.jsxImportSource : void 0;
|
|
8449
8495
|
return {
|
|
8450
8496
|
// Keep normal application dependency discovery for CJS-only packages, but
|
|
@@ -8457,7 +8503,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
|
8457
8503
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
8458
8504
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
8459
8505
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
8460
|
-
..._optionalChain([entries, 'optionalAccess',
|
|
8506
|
+
..._optionalChain([entries, 'optionalAccess', _356 => _356.length]) ? { entries: [...entries] } : {},
|
|
8461
8507
|
// Vite's dependency scan compiles JSX on its own: with the app tsconfig's `jsxImportSource`
|
|
8462
8508
|
// when there is one, otherwise as React, whatever the renderer's plugin set for its own
|
|
8463
8509
|
// transforms. React is the default already, and naming it here would override a tsconfig
|
|
@@ -8498,8 +8544,8 @@ function mergeFarmViteAlias(farmValue, userValue) {
|
|
|
8498
8544
|
return [...userEntries, ...normalize(farmValue).filter((entry) => !userNames.has(entry.find))];
|
|
8499
8545
|
}
|
|
8500
8546
|
function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
8501
|
-
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8502
|
-
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8547
|
+
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _357 => _357.optimizeDeps, 'optionalAccess', _358 => _358.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _359 => _359.optimizeDeps, 'optionalAccess', _360 => _360.noDiscovery])));
|
|
8548
|
+
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _361 => _361.optimizeDeps, 'optionalAccess', _362 => _362.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _363 => _363.optimizeDeps, 'optionalAccess', _364 => _364.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _365 => _365.optimizeDeps, 'optionalAccess', _366 => _366.holdUntilCrawlEnd]))));
|
|
8503
8549
|
return {
|
|
8504
8550
|
...farmConfig,
|
|
8505
8551
|
...userConfig,
|
|
@@ -8511,9 +8557,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8511
8557
|
resolve: {
|
|
8512
8558
|
...farmConfig.resolve,
|
|
8513
8559
|
...userConfig.resolve,
|
|
8514
|
-
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access',
|
|
8560
|
+
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _367 => _367.resolve, 'optionalAccess', _368 => _368.alias]), _optionalChain([userConfig, 'access', _369 => _369.resolve, 'optionalAccess', _370 => _370.alias])),
|
|
8515
8561
|
dedupe: Array.from(
|
|
8516
|
-
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access',
|
|
8562
|
+
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _371 => _371.resolve, 'optionalAccess', _372 => _372.dedupe]) || [], ..._optionalChain([userConfig, 'access', _373 => _373.resolve, 'optionalAccess', _374 => _374.dedupe]) || []])
|
|
8517
8563
|
)
|
|
8518
8564
|
},
|
|
8519
8565
|
optimizeDeps: {
|
|
@@ -8523,21 +8569,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8523
8569
|
holdUntilCrawlEnd,
|
|
8524
8570
|
include: Array.from(
|
|
8525
8571
|
/* @__PURE__ */ new Set([
|
|
8526
|
-
..._optionalChain([farmConfig, 'access',
|
|
8527
|
-
..._optionalChain([userConfig, 'access',
|
|
8572
|
+
..._optionalChain([farmConfig, 'access', _375 => _375.optimizeDeps, 'optionalAccess', _376 => _376.include]) || [],
|
|
8573
|
+
..._optionalChain([userConfig, 'access', _377 => _377.optimizeDeps, 'optionalAccess', _378 => _378.include]) || []
|
|
8528
8574
|
])
|
|
8529
8575
|
),
|
|
8530
8576
|
exclude: Array.from(
|
|
8531
8577
|
/* @__PURE__ */ new Set([
|
|
8532
|
-
..._optionalChain([farmConfig, 'access',
|
|
8533
|
-
..._optionalChain([userConfig, 'access',
|
|
8578
|
+
..._optionalChain([farmConfig, 'access', _379 => _379.optimizeDeps, 'optionalAccess', _380 => _380.exclude]) || [],
|
|
8579
|
+
..._optionalChain([userConfig, 'access', _381 => _381.optimizeDeps, 'optionalAccess', _382 => _382.exclude]) || []
|
|
8534
8580
|
])
|
|
8535
8581
|
)
|
|
8536
8582
|
},
|
|
8537
8583
|
ssr: {
|
|
8538
8584
|
...farmConfig.ssr,
|
|
8539
8585
|
...userConfig.ssr,
|
|
8540
|
-
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access',
|
|
8586
|
+
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _383 => _383.ssr, 'optionalAccess', _384 => _384.noExternal]), _optionalChain([userConfig, 'access', _385 => _385.ssr, 'optionalAccess', _386 => _386.noExternal]))
|
|
8541
8587
|
}
|
|
8542
8588
|
};
|
|
8543
8589
|
}
|
|
@@ -8608,8 +8654,8 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8608
8654
|
...userRolldownOptions
|
|
8609
8655
|
};
|
|
8610
8656
|
const merged = mergeFarmViteConfig(farmConfig, shared);
|
|
8611
|
-
const farmBundlerOptions = _optionalChain([farmConfig, 'access',
|
|
8612
|
-
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess',
|
|
8657
|
+
const farmBundlerOptions = _optionalChain([farmConfig, 'access', _387 => _387.build, 'optionalAccess', _388 => _388.rollupOptions]);
|
|
8658
|
+
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _389 => _389.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _390 => _390.output]);
|
|
8613
8659
|
return {
|
|
8614
8660
|
...merged,
|
|
8615
8661
|
build: {
|
|
@@ -8626,7 +8672,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8626
8672
|
esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
|
|
8627
8673
|
ssr: {
|
|
8628
8674
|
...merged.ssr,
|
|
8629
|
-
external: mergeExternal(_optionalChain([farmConfig, 'access',
|
|
8675
|
+
external: mergeExternal(_optionalChain([farmConfig, 'access', _391 => _391.ssr, 'optionalAccess', _392 => _392.external]), _optionalChain([userConfig, 'access', _393 => _393.ssr, 'optionalAccess', _394 => _394.external]))
|
|
8630
8676
|
}
|
|
8631
8677
|
};
|
|
8632
8678
|
}
|