@farm.js/core 0.1.85 → 0.1.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp.d-7uKdOttc.d.ts → agent-mcp.d-BdM0pIrD.d.ts} +1 -1
- package/dist/{agent-mcp.d-LChlR2au.d.mts → agent-mcp.d-CMGqpUbk.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-LLU2Z6I4.cjs +17 -0
- package/dist/{analyzer-R6KNJ6IO.mjs → analyzer-W4EB7DHL.mjs} +2 -2
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.cjs +3 -3
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +2 -2
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +4 -4
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +3 -3
- package/dist/{app-manifest.d-QMdmqqCr.d.mts → app-manifest.d-BeDB2OVm.d.mts} +1 -1
- package/dist/{app-manifest.d-CRp21oAz.d.ts → app-manifest.d-COhjPgHn.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-Bvpc2eJq.d.mts → app.d-AVZXCfcO.d.mts} +5 -4
- package/dist/{app.d-DEKpJEp4.d.ts → app.d-b3A4cca5.d.ts} +5 -4
- package/dist/{chunk-3TCFONUE.mjs → chunk-26HESRBL.mjs} +60 -11
- package/dist/chunk-2HTNASSB.cjs +134 -0
- package/dist/{chunk-RVJQHQCG.cjs → chunk-33WR5XV5.cjs} +4 -4
- package/dist/{chunk-J7VIXTPQ.mjs → chunk-3F55K4MC.mjs} +1 -1
- package/dist/{chunk-YX532KEF.mjs → chunk-4FGTNYHE.mjs} +2 -2
- package/dist/{chunk-MYSH5Y4E.mjs → chunk-4IE3YK7U.mjs} +1 -1
- package/dist/{chunk-CWUQBECF.mjs → chunk-4SJ22WTT.mjs} +1 -1
- package/dist/{chunk-YS647ASS.mjs → chunk-5D73SKF3.mjs} +1 -1
- package/dist/{chunk-Q7GB3I4O.cjs → chunk-7BNVUIGL.cjs} +2 -2
- package/dist/{chunk-2DMOB6BH.mjs → chunk-A2PPQ5LB.mjs} +3 -3
- package/dist/{chunk-4QCMTIBM.mjs → chunk-ALOFMAFA.mjs} +11 -5
- package/dist/{chunk-HKJIUZS5.cjs → chunk-CXHVRHM2.cjs} +2 -2
- package/dist/{chunk-3RVLJTFZ.mjs → chunk-D7LXBLUW.mjs} +1 -1
- package/dist/{chunk-GFVPQ25Z.mjs → chunk-EZYNIADW.mjs} +65 -39
- package/dist/{chunk-NAHDG6UX.mjs → chunk-HFRG2IQS.mjs} +1 -1
- package/dist/{chunk-BCCCPFHQ.mjs → chunk-HV6CYSMF.mjs} +3 -0
- package/dist/{chunk-7H2TXT2K.mjs → chunk-HX5HLFBZ.mjs} +7 -0
- package/dist/{chunk-3HWNYLQV.cjs → chunk-HYL372GW.cjs} +1 -1
- package/dist/{chunk-25JGHAGH.cjs → chunk-I2RBHZF7.cjs} +15 -8
- package/dist/{chunk-BZN5HX7Y.cjs → chunk-IM422XKU.cjs} +2 -2
- package/dist/{chunk-6QYPP5KC.mjs → chunk-K5FLQJW5.mjs} +2 -2
- package/dist/chunk-K6RMOB25.mjs +134 -0
- package/dist/{chunk-CDZ55QRD.mjs → chunk-LBJOHMTB.mjs} +1 -1
- package/dist/{chunk-U6HUVY5R.mjs → chunk-LIWVPE72.mjs} +61 -23
- package/dist/{chunk-BBX4RPOV.cjs → chunk-MZR22RAC.cjs} +17 -11
- package/dist/chunk-NDMPGFKL.cjs +47 -0
- package/dist/{chunk-YHM4PXJY.mjs → chunk-O5YM6GU3.mjs} +1 -1
- package/dist/{chunk-XIXAUXV3.mjs → chunk-O7K4HMAQ.mjs} +1 -1
- package/dist/{chunk-PQR5A7R2.mjs → chunk-Q73LRKLP.mjs} +1 -1
- package/dist/{chunk-X7RSOEMQ.mjs → chunk-QLRI2BX5.mjs} +94 -15
- package/dist/{chunk-Z3LOPHSO.mjs → chunk-QSDIJ45N.mjs} +1 -1
- package/dist/{chunk-QUHDVJMR.cjs → chunk-RGYS5OPL.cjs} +3 -3
- package/dist/{chunk-UEQC4ZLP.cjs → chunk-SDNYULFS.cjs} +385 -359
- package/dist/{chunk-3OKSEJ33.cjs → chunk-T7UC2ORA.cjs} +3 -0
- package/dist/chunk-TCGPBSVY.mjs +47 -0
- package/dist/{chunk-H6C45DCF.cjs → chunk-TI4BZV6M.cjs} +393 -314
- package/dist/{chunk-OYM6VJEF.cjs → chunk-U3A46QFD.cjs} +140 -91
- package/dist/{chunk-VGHDPEPQ.cjs → chunk-UA77C2ZA.cjs} +2 -2
- package/dist/{chunk-U54REWMJ.cjs → chunk-VCI776NG.cjs} +13 -13
- package/dist/{chunk-WYTK7HQS.cjs → chunk-VCZ4EM5K.cjs} +391 -353
- package/dist/{chunk-F7JVO3OZ.cjs → chunk-VGZIIOU6.cjs} +4 -4
- package/dist/{chunk-5P65LXGU.cjs → chunk-WSQ3S3NV.cjs} +2 -2
- package/dist/{chunk-RQ6XX5IN.mjs → chunk-X2SMVPLH.mjs} +20 -4
- package/dist/{chunk-TOUC6BR3.cjs → chunk-XFUPWRKT.cjs} +4 -4
- package/dist/{chunk-DJ3PVHTW.cjs → chunk-XGPRM7OK.cjs} +3 -3
- package/dist/{chunk-L3BSHASB.cjs → chunk-XMVZXZ32.cjs} +4 -4
- package/dist/{chunk-L5HDCDFT.mjs → chunk-YNPVG2GG.mjs} +1 -1
- package/dist/{chunk-MAPHNGTF.cjs → chunk-Z43CIBUR.cjs} +21 -5
- package/dist/{chunk-7TPLDPNC.cjs → chunk-ZCX2XJPY.cjs} +10 -10
- package/dist/{chunk-GLNVLCUH.cjs → chunk-ZSVFI7JM.cjs} +6 -6
- package/dist/{cli-runtime.d-DaElKjaL.d.ts → cli-runtime.d-jqZ7YCsm.d.ts} +5 -5
- package/dist/{cli-runtime.d-C7aMfoTq.d.mts → cli-runtime.d-qL44rqYO.d.mts} +5 -5
- package/dist/{client-component.d-miqIXyQv.d.mts → client-component.d-B2L2LyAr.d.mts} +1 -1
- package/dist/{client-component.d-CZG02pIh.d.ts → client-component.d-BDD5aiUb.d.ts} +1 -1
- package/dist/{client-plugins.d-BVXjyIkY.d.ts → client-plugins.d-Crct3m_r.d.ts} +14 -5
- package/dist/{client-plugins.d-BwKwuO_0.d.mts → client-plugins.d-Dzc3vOw_.d.mts} +14 -5
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +8 -7
- package/dist/client.d.ts +8 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-SXL5RFE5.cjs → devtools-GPIKZ5AV.cjs} +7 -5
- package/dist/{devtools-34ZQWX3M.mjs → devtools-GWJZPWIW.mjs} +5 -3
- package/dist/docs.cjs +7 -5
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +6 -4
- package/dist/environment/vite.cjs +5 -5
- package/dist/environment/vite.mjs +4 -4
- package/dist/font.cjs +4 -2
- package/dist/font.d.mts +13 -1
- package/dist/font.d.ts +13 -1
- package/dist/font.mjs +3 -1
- package/dist/{handler.d-BKTWzzNA.d.mts → handler.d-B1S1ZBqS.d.mts} +1 -1
- package/dist/{handler.d-Dzpyg3-N.d.ts → handler.d-ZweCBJD4.d.ts} +1 -1
- package/dist/{headers.d-PZyXcDAH.d.ts → headers.d-BgBdQN8x.d.ts} +1 -1
- package/dist/{headers.d-5opjyhXw.d.mts → headers.d-C-yGl_f6.d.mts} +1 -1
- package/dist/image-attributes.d-BMPDQO1q.d.mts +55 -0
- package/dist/image-attributes.d-BMPDQO1q.d.ts +55 -0
- package/dist/image.cjs +5 -127
- package/dist/image.d.mts +3 -13
- package/dist/image.d.ts +3 -13
- package/dist/image.mjs +5 -127
- package/dist/index.cjs +28 -26
- package/dist/{index.d-C0Mie66f.d.mts → index.d-13h3oDu7.d.mts} +1 -1
- package/dist/{index.d-DV2q-0mE.d.ts → index.d-CtoniAXT.d.ts} +1 -1
- package/dist/index.d.mts +24 -23
- package/dist/index.d.ts +24 -23
- package/dist/index.mjs +27 -25
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +23 -23
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +22 -22
- package/dist/internal/cli-runtime.cjs +9 -7
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +8 -6
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +66 -40
- package/dist/internal/client-runtime.d.mts +6 -6
- package/dist/internal/client-runtime.d.ts +6 -6
- package/dist/internal/client-runtime.mjs +53 -27
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +7 -5
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +6 -4
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-boot.cjs +44 -16
- package/dist/internal/islands-boot.d.mts +3 -1
- package/dist/internal/islands-boot.d.ts +3 -1
- package/dist/internal/islands-boot.mjs +28 -0
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +6 -6
- package/dist/internal/production-runtime.d.mts +10 -10
- package/dist/internal/production-runtime.d.ts +10 -10
- package/dist/internal/production-runtime.mjs +5 -5
- package/dist/internal/renderer-islands.cjs +35 -8
- package/dist/internal/renderer-islands.d.mts +9 -1
- package/dist/internal/renderer-islands.d.ts +9 -1
- package/dist/internal/renderer-islands.mjs +35 -8
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/{island-runtime.d-BA7EPo1v.d.ts → island-runtime.d-D2Mh5eTU.d.ts} +5 -1
- package/dist/{island-runtime.d-BBS_YUSX.d.mts → island-runtime.d-lrpEJlgg.d.mts} +5 -1
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.mjs +3 -3
- package/dist/{mount.d-gWul1GA1.d.ts → mount.d-DyKlRR6z.d.ts} +1 -1
- package/dist/{mount.d-CZ_qL1iS.d.mts → mount.d-_6Un9wdK.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BBTzhJLj.d.mts → navigation-delegate.d-ChfinbWB.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BZsYEAet.d.ts → navigation-delegate.d-fMgELdAe.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{plugin-QOTAPTVV.mjs → plugin-EVKQZBNW.mjs} +1 -1
- package/dist/{plugin-3PT7I26P.cjs → plugin-MWO3G2XM.cjs} +2 -2
- package/dist/plugin.cjs +20 -20
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +19 -19
- package/dist/{render-plan.d-AaJsYPX-.d.ts → render-plan.d-D0FV9lDT.d.ts} +1 -1
- package/dist/{render-plan.d-bnWxS12w.d.mts → render-plan.d-DaM1NPnm.d.mts} +1 -1
- package/dist/renderer-client.cjs +6 -1
- package/dist/renderer-client.d.mts +6 -5
- package/dist/renderer-client.d.ts +6 -5
- package/dist/renderer-client.mjs +5 -0
- package/dist/renderer.cjs +4 -4
- package/dist/renderer.d.mts +10 -2
- package/dist/renderer.d.ts +10 -2
- package/dist/renderer.mjs +3 -3
- package/dist/{request.d-CAeitOG1.d.ts → request.d-CrXC7voZ.d.ts} +1 -1
- package/dist/{request.d-C2HOn3Hi.d.mts → request.d-DVSLilGx.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-CYA-ulnX.d.mts → route-rendering.d-CWi3UYtR.d.mts} +1 -1
- package/dist/{route-rendering.d-A1dIkUK5.d.ts → route-rendering.d-OfbM_rj8.d.ts} +1 -1
- package/dist/{router.d-A_Yt6jYz.d.ts → router.d-D5Mp7bpO.d.ts} +1 -1
- package/dist/{router.d-8lxnzlkr.d.mts → router.d-DrQ1QDFk.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-MW2V3WEE.mjs → rsc-pipeline-KLMQU3YP.mjs} +7 -5
- package/dist/{rsc-pipeline-ESPGX4VX.cjs → rsc-pipeline-TQOSDWOU.cjs} +8 -6
- package/dist/{runtime-KGSOEMLT.mjs → runtime-BDPBO65S.mjs} +7 -5
- package/dist/{runtime-FCMLEBTX.cjs → runtime-CQSCRVZ7.cjs} +12 -10
- package/dist/{runtime.d-C_rZ9_DD.d.mts → runtime.d-BVj6apd0.d.mts} +1 -1
- package/dist/{runtime.d-BPyvWrgQ.d.ts → runtime.d-D7QYVJGO.d.ts} +1 -1
- package/dist/{server-components-status.d-BpxiEMQE.d.mts → server-components-status.d-BDVcxi0z.d.mts} +1 -1
- package/dist/{server-components-status.d-C2UEKJn7.d.ts → server-components-status.d-CfKDpmCH.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +45 -45
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +21 -21
- package/dist/{spa-router.d-Cw5i_15e.d.ts → spa-router.d-BXxoU3Cv.d.ts} +2 -2
- package/dist/{spa-router.d-BD-6WX1R.d.mts → spa-router.d-CXgvy-7L.d.mts} +2 -2
- package/dist/{ssg.d-CCE9aob5.d.mts → ssg.d-DS-gXUbf.d.mts} +2 -2
- package/dist/{ssg.d-Bifiq0EL.d.ts → ssg.d-jXlUAKzg.d.ts} +2 -2
- package/dist/{store-core.d-BN2MxSG9.d.mts → store-core.d-CDbVAbTn.d.mts} +3 -2
- package/dist/{store-core.d-5tVn5vi1.d.ts → store-core.d-D00BsbnO.d.ts} +3 -2
- package/dist/testing.cjs +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +2 -2
- package/dist/{utils.d-BUjpSNIO.d.ts → utils.d-BODwBtkz.d.ts} +1 -1
- package/dist/{utils.d-wGPLeVbq.d.mts → utils.d-Cmj-fzds.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +25 -23
- package/dist/vite.d.mts +21 -7
- package/dist/vite.d.ts +21 -7
- package/dist/vite.mjs +24 -22
- package/package.json +2 -2
- package/dist/analyzer-XVY76XMM.cjs +0 -17
- package/dist/chunk-7EPYN7GW.cjs +0 -30
- package/dist/chunk-HZOMT5DY.mjs +0 -30
- package/dist/{chunk-4B6YJ5DS.cjs → chunk-4ZVKDHS6.cjs} +3 -3
- package/dist/{chunk-4EEAPBNV.mjs → chunk-PEQJ4UUT.mjs} +3 -3
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
8
|
+
|
|
9
|
+
// src/image-attributes.ts
|
|
10
|
+
var FALLBACK_CONFIG = {
|
|
11
|
+
provider: "auto",
|
|
12
|
+
path: _chunkMCSRMEQVcjs.DEFAULT_FARM_IMAGE_PATH,
|
|
13
|
+
deviceSizes: _chunkMCSRMEQVcjs.DEFAULT_FARM_IMAGE_DEVICE_SIZES,
|
|
14
|
+
imageSizes: _chunkMCSRMEQVcjs.DEFAULT_FARM_IMAGE_SIZES,
|
|
15
|
+
qualities: _chunkMCSRMEQVcjs.DEFAULT_FARM_IMAGE_QUALITIES,
|
|
16
|
+
formats: _chunkMCSRMEQVcjs.DEFAULT_FARM_IMAGE_FORMATS
|
|
17
|
+
};
|
|
18
|
+
function getImageConfig() {
|
|
19
|
+
return typeof __FARM_IMAGE_CONFIG__ !== "undefined" && __FARM_IMAGE_CONFIG__ ? __FARM_IMAGE_CONFIG__ : FALLBACK_CONFIG;
|
|
20
|
+
}
|
|
21
|
+
function defaultImageLoader(config) {
|
|
22
|
+
return ({ src, width, quality }) => {
|
|
23
|
+
const query = new URLSearchParams({
|
|
24
|
+
url: src,
|
|
25
|
+
w: String(width),
|
|
26
|
+
q: String(quality)
|
|
27
|
+
});
|
|
28
|
+
return `${config.path}?${query}`;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function getClosestQuality(quality, allowed) {
|
|
32
|
+
const requested = _nullishCoalesce(quality, () => ( 75));
|
|
33
|
+
return allowed.reduce(
|
|
34
|
+
(closest, candidate) => Math.abs(candidate - requested) < Math.abs(closest - requested) ? candidate : closest
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function getCandidateWidths(config, width, sizes, fill) {
|
|
38
|
+
const allSizes = [.../* @__PURE__ */ new Set([...config.imageSizes, ...config.deviceSizes])].sort(
|
|
39
|
+
(left, right) => left - right
|
|
40
|
+
);
|
|
41
|
+
if (fill || sizes) {
|
|
42
|
+
const viewportPercentages = [..._nullishCoalesce(_optionalChain([sizes, 'optionalAccess', _ => _.matchAll, 'call', _2 => _2(/(^|\s)(\d{1,3})vw/g)]), () => ( []))].map(
|
|
43
|
+
(match) => Number(match[2])
|
|
44
|
+
);
|
|
45
|
+
if (viewportPercentages.length > 0) {
|
|
46
|
+
const smallestRatio = Math.min(...viewportPercentages) / 100;
|
|
47
|
+
const minimum = config.deviceSizes[0] * smallestRatio;
|
|
48
|
+
return { widths: allSizes.filter((candidate) => candidate >= minimum), descriptor: "w" };
|
|
49
|
+
}
|
|
50
|
+
return { widths: allSizes, descriptor: "w" };
|
|
51
|
+
}
|
|
52
|
+
if (!width) return { widths: config.deviceSizes.slice(), descriptor: "w" };
|
|
53
|
+
const requested = [width, width * 2];
|
|
54
|
+
const widths = requested.map(
|
|
55
|
+
(target) => _nullishCoalesce(allSizes.find((candidate) => candidate >= target), () => ( allSizes.at(-1)))
|
|
56
|
+
);
|
|
57
|
+
return { widths: [...new Set(widths)], descriptor: "x" };
|
|
58
|
+
}
|
|
59
|
+
function isStaticImageData(value) {
|
|
60
|
+
return typeof value === "object" && value !== null && typeof value.src === "string";
|
|
61
|
+
}
|
|
62
|
+
function shouldSkipOptimization(src, config) {
|
|
63
|
+
return config.provider === "none" || src.startsWith("data:") || src.startsWith("blob:") || /\.svg(?:$|[?#])/i.test(src);
|
|
64
|
+
}
|
|
65
|
+
function resolveImageAttributes(options) {
|
|
66
|
+
const {
|
|
67
|
+
src: srcInput,
|
|
68
|
+
alt,
|
|
69
|
+
width: widthInput,
|
|
70
|
+
height: heightInput,
|
|
71
|
+
fill = false,
|
|
72
|
+
quality: qualityInput,
|
|
73
|
+
sizes: sizesInput,
|
|
74
|
+
loading,
|
|
75
|
+
preload = false,
|
|
76
|
+
placeholder = "empty",
|
|
77
|
+
blurDataURL: blurDataURLInput,
|
|
78
|
+
unoptimized: unoptimizedInput = false,
|
|
79
|
+
loader: loaderInput,
|
|
80
|
+
style,
|
|
81
|
+
...rest
|
|
82
|
+
} = options;
|
|
83
|
+
const config = getImageConfig();
|
|
84
|
+
const staticImage = isStaticImageData(srcInput) ? srcInput : void 0;
|
|
85
|
+
const src = typeof srcInput === "string" ? srcInput : srcInput.src;
|
|
86
|
+
const width = Number(_nullishCoalesce(widthInput, () => ( _optionalChain([staticImage, 'optionalAccess', _3 => _3.width])))) || void 0;
|
|
87
|
+
const height = Number(_nullishCoalesce(heightInput, () => ( _optionalChain([staticImage, 'optionalAccess', _4 => _4.height])))) || void 0;
|
|
88
|
+
const blurDataURL = _nullishCoalesce(blurDataURLInput, () => ( _optionalChain([staticImage, 'optionalAccess', _5 => _5.blurDataURL])));
|
|
89
|
+
if (!fill && (!width || !height)) {
|
|
90
|
+
throw new TypeError(
|
|
91
|
+
"Farm Image requires width and height unless src is a static import or fill is enabled"
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
if (fill && (widthInput !== void 0 || heightInput !== void 0)) {
|
|
95
|
+
throw new TypeError("Farm Image cannot use width or height together with fill");
|
|
96
|
+
}
|
|
97
|
+
if (placeholder === "blur" && !blurDataURL) {
|
|
98
|
+
throw new TypeError("Farm Image placeholder=blur requires a static import or blurDataURL");
|
|
99
|
+
}
|
|
100
|
+
const unoptimized = unoptimizedInput || shouldSkipOptimization(src, config);
|
|
101
|
+
const quality = getClosestQuality(qualityInput, config.qualities);
|
|
102
|
+
const loader = _nullishCoalesce(loaderInput, () => ( defaultImageLoader(config)));
|
|
103
|
+
const sizes = _nullishCoalesce(sizesInput, () => ( (fill ? "100vw" : void 0)));
|
|
104
|
+
const candidates = getCandidateWidths(config, width, sizes, fill);
|
|
105
|
+
const srcSet = unoptimized ? void 0 : candidates.widths.map((candidate, index) => {
|
|
106
|
+
const descriptor = candidates.descriptor === "w" ? `${candidate}w` : `${index + 1}x`;
|
|
107
|
+
return `${loader({ src, width: candidate, quality })} ${descriptor}`;
|
|
108
|
+
}).join(", ");
|
|
109
|
+
const renderedSrc = unoptimized ? src : loader({ src, width: _nullishCoalesce(_nullishCoalesce(candidates.widths.at(-1), () => ( width)), () => ( config.deviceSizes[0])), quality });
|
|
110
|
+
const fillStyle = fill ? { position: "absolute", inset: 0, width: "100%", height: "100%" } : void 0;
|
|
111
|
+
const placeholderStyle = placeholder === "blur" ? {
|
|
112
|
+
backgroundImage: `url("${blurDataURL}")`,
|
|
113
|
+
backgroundPosition: "50% 50%",
|
|
114
|
+
backgroundRepeat: "no-repeat",
|
|
115
|
+
backgroundSize: "cover"
|
|
116
|
+
} : void 0;
|
|
117
|
+
return {
|
|
118
|
+
...rest,
|
|
119
|
+
alt,
|
|
120
|
+
src: renderedSrc,
|
|
121
|
+
srcSet,
|
|
122
|
+
sizes,
|
|
123
|
+
width: fill ? void 0 : width,
|
|
124
|
+
height: fill ? void 0 : height,
|
|
125
|
+
loading: preload ? "eager" : _nullishCoalesce(loading, () => ( "lazy")),
|
|
126
|
+
fetchPriority: preload ? "high" : rest.fetchPriority,
|
|
127
|
+
decoding: _nullishCoalesce(rest.decoding, () => ( "async")),
|
|
128
|
+
style: { ...fillStyle, ...placeholderStyle, ...style }
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
exports.resolveImageAttributes = resolveImageAttributes;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkXFUPWRKTcjs = require('./chunk-XFUPWRKT.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -354,7 +354,7 @@ function requestEvent(metadata, method, status, durationMs) {
|
|
|
354
354
|
id: uuid(),
|
|
355
355
|
requestId: metadata.id,
|
|
356
356
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
357
|
-
route: routeTemplate(
|
|
357
|
+
route: routeTemplate(_chunkXFUPWRKTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
358
358
|
...metadata.path ? { path: metadata.path } : {},
|
|
359
359
|
agent: metadata.agent,
|
|
360
360
|
kind: "request",
|
|
@@ -410,7 +410,7 @@ function toolEvent(metadata, event, payloads) {
|
|
|
410
410
|
id: uuid(),
|
|
411
411
|
requestId: metadata.id,
|
|
412
412
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
413
|
-
route: routeTemplate(
|
|
413
|
+
route: routeTemplate(_chunkXFUPWRKTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
414
414
|
...metadata.path ? { path: metadata.path } : {},
|
|
415
415
|
agent: metadata.agent,
|
|
416
416
|
kind: "mcp.tool",
|
|
@@ -496,7 +496,7 @@ async function receiveWebMCPReport(request, exporter, options, webmcp, waitUntil
|
|
|
496
496
|
exporter.enqueue({
|
|
497
497
|
id: uuid(),
|
|
498
498
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
499
|
-
route: routeTemplate(
|
|
499
|
+
route: routeTemplate(_chunkXFUPWRKTcjs.getFarmRouteLabel.call(void 0, route)),
|
|
500
500
|
...path ? { path } : {},
|
|
501
501
|
agent: _chunk2NOHVIJ3cjs.classifyFarmClient.call(void 0, request),
|
|
502
502
|
kind: "mcp.tool",
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-HR4N2K4V.mjs";
|
|
5
5
|
import {
|
|
6
6
|
normalizeFarmProductionSiteOrigin
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Q73LRKLP.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveFarmAppManifestConfig
|
|
10
10
|
} from "./chunk-SQ5O7I3L.mjs";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-YT2ZMLXK.mjs";
|
|
30
30
|
import {
|
|
31
31
|
FARM_VERSION
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-O7K4HMAQ.mjs";
|
|
33
33
|
import {
|
|
34
34
|
applyFarmBasePath
|
|
35
35
|
} from "./chunk-SF3JB56B.mjs";
|
|
@@ -18,14 +18,14 @@ var _chunkCCAUIBIScjs = require('./chunk-CCAUIBIS.cjs');
|
|
|
18
18
|
var _chunkWMRGIQTAcjs = require('./chunk-WMRGIQTA.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkHYL372GWcjs = require('./chunk-HYL372GW.cjs');
|
|
22
22
|
|
|
23
23
|
// src/mobile/analyzer.ts
|
|
24
24
|
var _crypto = require('crypto');
|
|
25
25
|
var _fs = require('fs');
|
|
26
26
|
var _promises = require('fs/promises');
|
|
27
27
|
var _path = require('path'); var path = _interopRequireWildcard(_path);
|
|
28
|
-
var ANALYZER_VERSION = `8:${
|
|
28
|
+
var ANALYZER_VERSION = `8:${_chunkHYL372GWcjs.FARM_VERSION}`;
|
|
29
29
|
var INTRINSIC_KINDS = {};
|
|
30
30
|
for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
|
|
31
31
|
INTRINSIC_KINDS[tag] = "View";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-RLEAVG6G.mjs";
|
|
4
4
|
import {
|
|
5
5
|
resolveDeployOutputPath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ALOFMAFA.mjs";
|
|
7
7
|
import {
|
|
8
8
|
farmDesktopDevGuardPlugin,
|
|
9
9
|
loadFarmReactPlugin
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
formatFarmRscBlockingMessage,
|
|
23
23
|
inspectFarmServerComponents,
|
|
24
24
|
resolveFarmRscCheckConfig
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-4IE3YK7U.mjs";
|
|
26
26
|
|
|
27
27
|
// src/rsc-pipeline.ts
|
|
28
28
|
import { readFileSync } from "fs";
|
|
@@ -217,7 +217,7 @@ async function resolveFarmRscServerPlugins(userConfig, config, root) {
|
|
|
217
217
|
}
|
|
218
218
|
async function configureFarmRscPlugins(config, command) {
|
|
219
219
|
if (config.plugins.length === 0) return config;
|
|
220
|
-
const { PluginManager } = await import("./plugin-
|
|
220
|
+
const { PluginManager } = await import("./plugin-EVKQZBNW.mjs");
|
|
221
221
|
const manager = new PluginManager({
|
|
222
222
|
config,
|
|
223
223
|
isDev: command === "serve",
|
|
@@ -16,6 +16,9 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
resolveFarmDevtoolsConfig
|
|
18
18
|
} from "./chunk-CU5SYTJG.mjs";
|
|
19
|
+
import {
|
|
20
|
+
resolveFarmRendererServerComponentsIslands
|
|
21
|
+
} from "./chunk-X2SMVPLH.mjs";
|
|
19
22
|
import {
|
|
20
23
|
resolveFarmAgentCrawlers,
|
|
21
24
|
resolveFarmAgentSitemap,
|
|
@@ -45,10 +48,7 @@ import {
|
|
|
45
48
|
isReactRenderer,
|
|
46
49
|
resolveFarmRenderer,
|
|
47
50
|
resolveFarmServerComponentsMode
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import {
|
|
50
|
-
resolveFarmImageConfig
|
|
51
|
-
} from "./chunk-AOIUYHPH.mjs";
|
|
51
|
+
} from "./chunk-HV6CYSMF.mjs";
|
|
52
52
|
import {
|
|
53
53
|
FARM_CRON_NAME_SEGMENT_PATTERN,
|
|
54
54
|
normalizeCronExpression,
|
|
@@ -94,6 +94,9 @@ import {
|
|
|
94
94
|
import {
|
|
95
95
|
resolveFarmAPIConfig
|
|
96
96
|
} from "./chunk-W6QLRQ3V.mjs";
|
|
97
|
+
import {
|
|
98
|
+
resolveFarmImageConfig
|
|
99
|
+
} from "./chunk-AOIUYHPH.mjs";
|
|
97
100
|
import {
|
|
98
101
|
normalizeFarmDeploymentId
|
|
99
102
|
} from "./chunk-IWJONXPF.mjs";
|
|
@@ -1054,6 +1057,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1054
1057
|
mode
|
|
1055
1058
|
});
|
|
1056
1059
|
userConfig = layerResolution.config;
|
|
1060
|
+
const rendererServerComponentsIslands = resolveFarmRendererServerComponentsIslands(userConfig);
|
|
1057
1061
|
if (userConfig.typescript !== void 0) {
|
|
1058
1062
|
logger.warn(
|
|
1059
1063
|
'The top-level "typescript" option is not supported and has no effect. Configure TypeScript in `tsconfig.json` and run `tsc --noEmit` separately when builds must enforce project type errors.'
|
|
@@ -1181,7 +1185,9 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1181
1185
|
// isolatedClientHydration itself.
|
|
1182
1186
|
isolatedClientHydration: resolveFarmServerComponentsMode(userConfig.experimental?.serverComponents) === "islands" ? "enabled" : "off",
|
|
1183
1187
|
ppr: false,
|
|
1184
|
-
...userConfig.experimental
|
|
1188
|
+
...userConfig.experimental,
|
|
1189
|
+
// Another renderer's islands run without Farm's server components engine, which renders React.
|
|
1190
|
+
...rendererServerComponentsIslands ? { serverComponents: false } : {}
|
|
1185
1191
|
},
|
|
1186
1192
|
agent: resolveFarmAgentConfig(userConfig.agent, {
|
|
1187
1193
|
docs: docs.enabled,
|
|
@@ -18,7 +18,7 @@ var _chunkHR5GU4UUcjs = require('./chunk-HR5GU4UU.cjs');
|
|
|
18
18
|
var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkMZR22RACcjs = require('./chunk-MZR22RAC.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -599,7 +599,7 @@ async function resolveAPIContext(options) {
|
|
|
599
599
|
config: options.config,
|
|
600
600
|
configPath: options.configPath
|
|
601
601
|
}));
|
|
602
|
-
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await
|
|
602
|
+
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkMZR22RACcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
|
|
603
603
|
const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _25 => _25.guardedPaths]), () => ( [])));
|
|
604
604
|
return {
|
|
605
605
|
root,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
collectFarmNativeServerFns,
|
|
34
34
|
findFarmNativeScreenFiles
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-3F55K4MC.mjs";
|
|
36
36
|
import {
|
|
37
37
|
assertFarmDocsAdapterServesNoGuardedPages,
|
|
38
38
|
compileFarmDocsAdapterEdgeManifest,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
farmDocsAdapterServesGuardedPages,
|
|
41
41
|
listFarmDocsAdapterPages,
|
|
42
42
|
listFarmDocsPagePaths
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-QSDIJ45N.mjs";
|
|
44
44
|
import {
|
|
45
45
|
FARM_DOCS_LAST_MODIFIED_MANIFEST,
|
|
46
46
|
createFarmDocsHandler,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
getDeployTargetForPreset,
|
|
71
71
|
hasCustomFarmRouteContext,
|
|
72
72
|
resolveDeployOutputPath
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-ALOFMAFA.mjs";
|
|
74
74
|
import {
|
|
75
75
|
resolveFarmInstrumentationFile
|
|
76
76
|
} from "./chunk-QRNYSISP.mjs";
|
|
@@ -103,6 +103,7 @@ import {
|
|
|
103
103
|
generateClientCachePersistenceCode,
|
|
104
104
|
generateFarmIntegrationProviderClientCode,
|
|
105
105
|
generateFarmIntegrationProviderServerModules,
|
|
106
|
+
isFarmLayoutModule,
|
|
106
107
|
isRendererCompiledComponent,
|
|
107
108
|
mergeFarmFontCss,
|
|
108
109
|
mergeFarmProductionViteConfig,
|
|
@@ -115,7 +116,7 @@ import {
|
|
|
115
116
|
resolveFarmNotFoundComponentPath,
|
|
116
117
|
resolveFarmRouteRootStrategy,
|
|
117
118
|
toBakedMarkdownSourcePath
|
|
118
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-QLRI2BX5.mjs";
|
|
119
120
|
import {
|
|
120
121
|
TAILWIND_CSS_BROWSER_TARGET,
|
|
121
122
|
generateFarmClientPluginEntryCode,
|
|
@@ -131,14 +132,11 @@ import {
|
|
|
131
132
|
readRouteRenderingDirectiveFromFile,
|
|
132
133
|
resolveRouteRenderingConfig,
|
|
133
134
|
resolveRouteRenderingConfigFromFile
|
|
134
|
-
} from "./chunk-
|
|
135
|
-
import {
|
|
136
|
-
usesFarmRendererIslands
|
|
137
|
-
} from "./chunk-RQ6XX5IN.mjs";
|
|
135
|
+
} from "./chunk-4SJ22WTT.mjs";
|
|
138
136
|
import {
|
|
139
137
|
FARM_PRERENDER_ENV,
|
|
140
138
|
_farmWebMCPReportsEnabled
|
|
141
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-5D73SKF3.mjs";
|
|
142
140
|
import {
|
|
143
141
|
HOISTED_HEAD_ELEMENT,
|
|
144
142
|
appMiddlewareMayHandlePath,
|
|
@@ -151,7 +149,7 @@ import {
|
|
|
151
149
|
layoutsCanCoverSamePage,
|
|
152
150
|
routeBoundaryCoversDirectory,
|
|
153
151
|
stripRouteGroups
|
|
154
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-PEQJ4UUT.mjs";
|
|
155
153
|
import {
|
|
156
154
|
FARM_NATIVE_TREE_CONTENT_TYPE
|
|
157
155
|
} from "./chunk-LLZSYFOM.mjs";
|
|
@@ -165,7 +163,7 @@ import {
|
|
|
165
163
|
listFarmBuiltInRoutePaths,
|
|
166
164
|
resolveFarmApiCatalogInput,
|
|
167
165
|
resolveFarmAppManifestInput
|
|
168
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-4FGTNYHE.mjs";
|
|
169
167
|
import {
|
|
170
168
|
FARM_DEFAULT_MCP_PATH,
|
|
171
169
|
createFarmDefaultMCPServer,
|
|
@@ -173,7 +171,7 @@ import {
|
|
|
173
171
|
} from "./chunk-HR4N2K4V.mjs";
|
|
174
172
|
import {
|
|
175
173
|
isFarmPreviewDeploymentEnvironment
|
|
176
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-Q73LRKLP.mjs";
|
|
177
175
|
import {
|
|
178
176
|
FARM_NATIVE_SERVER_FN_PLUGIN
|
|
179
177
|
} from "./chunk-L4RTTTVE.mjs";
|
|
@@ -194,7 +192,7 @@ import {
|
|
|
194
192
|
withFarmSourceSnapshot,
|
|
195
193
|
withFarmSourceSnapshotOf,
|
|
196
194
|
withPackageClientBoundaryCache
|
|
197
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-26HESRBL.mjs";
|
|
198
196
|
import {
|
|
199
197
|
generateFarmDocsAdapterClientRuntime,
|
|
200
198
|
getFarmDocsAdapterConfigModule
|
|
@@ -212,6 +210,9 @@ import {
|
|
|
212
210
|
nitroRouteRulesBelowBasePath,
|
|
213
211
|
routeRulesToNitroRouteRules
|
|
214
212
|
} from "./chunk-YVVY276M.mjs";
|
|
213
|
+
import {
|
|
214
|
+
usesFarmRendererIslands
|
|
215
|
+
} from "./chunk-X2SMVPLH.mjs";
|
|
215
216
|
import {
|
|
216
217
|
applyFarmCspHashesToHtml,
|
|
217
218
|
createFarmCspNonce
|
|
@@ -229,7 +230,7 @@ import {
|
|
|
229
230
|
loadFarmRendererVitePlugins,
|
|
230
231
|
resolveFarmRendererAppSetup,
|
|
231
232
|
resolveFarmServerComponentsMode
|
|
232
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-HV6CYSMF.mjs";
|
|
233
234
|
import {
|
|
234
235
|
applyFarmCronVercelCrons,
|
|
235
236
|
createFarmCronCloudflareConfig,
|
|
@@ -280,7 +281,7 @@ import {
|
|
|
280
281
|
} from "./chunk-QD34VE4N.mjs";
|
|
281
282
|
import {
|
|
282
283
|
APIRouteManager
|
|
283
|
-
} from "./chunk-
|
|
284
|
+
} from "./chunk-HFRG2IQS.mjs";
|
|
284
285
|
import {
|
|
285
286
|
readFarmI18nCatalogs
|
|
286
287
|
} from "./chunk-VO55MMBX.mjs";
|
|
@@ -308,7 +309,7 @@ import {
|
|
|
308
309
|
} from "./chunk-2I6PUKWJ.mjs";
|
|
309
310
|
import {
|
|
310
311
|
FARM_VERSION
|
|
311
|
-
} from "./chunk-
|
|
312
|
+
} from "./chunk-O7K4HMAQ.mjs";
|
|
312
313
|
import {
|
|
313
314
|
FARM_VIDEO_PLAYER_PATH
|
|
314
315
|
} from "./chunk-AG27TI6Q.mjs";
|
|
@@ -893,15 +894,26 @@ function encodeFarmBuildJSONPlaceholder(value) {
|
|
|
893
894
|
|
|
894
895
|
// src/nitro/islands-react-chunk.ts
|
|
895
896
|
var REACT_MODULE = /[\\/]node_modules[\\/](?:react|react-dom|scheduler)[\\/]/;
|
|
896
|
-
|
|
897
|
+
var REACT_DOM_MODULE = /[\\/]node_modules[\\/]react-dom[\\/]/;
|
|
898
|
+
var FARM_EAGER_COMPILE_HINT = "//# allFunctionsCalledOnLoad";
|
|
899
|
+
function createFarmIslandsReactOutput() {
|
|
897
900
|
let entryImportsReact;
|
|
898
901
|
return {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
902
|
+
codeSplitting: {
|
|
903
|
+
groups: [
|
|
904
|
+
{
|
|
905
|
+
debugName: "react",
|
|
906
|
+
name(moduleId, context) {
|
|
907
|
+
if (!REACT_MODULE.test(moduleId)) return null;
|
|
908
|
+
entryImportsReact ?? (entryImportsReact = reactLoadsWithAnEntry(moduleId, context));
|
|
909
|
+
return entryImportsReact ? null : "react";
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
]
|
|
913
|
+
},
|
|
914
|
+
// After minification, so the hint stays the chunk's first line; its source map accounts for it.
|
|
915
|
+
// Rolldown adds a line after any string, an empty one too, so other chunks get none.
|
|
916
|
+
postBanner: ((chunk) => entryImportsReact === false && chunk.moduleIds.some((id) => REACT_DOM_MODULE.test(id)) ? FARM_EAGER_COMPILE_HINT : void 0)
|
|
905
917
|
};
|
|
906
918
|
}
|
|
907
919
|
function reactLoadsWithAnEntry(moduleId, context) {
|
|
@@ -925,14 +937,25 @@ function reactLoadsWithAnEntry(moduleId, context) {
|
|
|
925
937
|
}
|
|
926
938
|
return false;
|
|
927
939
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
940
|
+
var CHUNKING_OPTIONS = [
|
|
941
|
+
"manualChunks",
|
|
942
|
+
"advancedChunks",
|
|
943
|
+
"codeSplitting",
|
|
944
|
+
"inlineDynamicImports"
|
|
945
|
+
];
|
|
946
|
+
function createFarmIslandsReactChunkPlugin() {
|
|
947
|
+
return {
|
|
948
|
+
name: "farm-islands-react-chunk",
|
|
949
|
+
enforce: "post",
|
|
950
|
+
outputOptions: {
|
|
951
|
+
order: "post",
|
|
952
|
+
handler(options) {
|
|
953
|
+
if (CHUNKING_OPTIONS.some((key) => options[key] !== void 0)) return null;
|
|
954
|
+
const { codeSplitting, postBanner } = createFarmIslandsReactOutput();
|
|
955
|
+
return { ...options, codeSplitting, postBanner: options.postBanner ?? postBanner };
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
};
|
|
936
959
|
}
|
|
937
960
|
|
|
938
961
|
// src/nitro/client-route-table.ts
|
|
@@ -3210,7 +3233,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3210
3233
|
farmPlugin,
|
|
3211
3234
|
farmServerOnlyEntriesPlugin
|
|
3212
3235
|
} = await import("./vite.mjs");
|
|
3213
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
3236
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
|
|
3214
3237
|
const fs5 = await import("fs/promises");
|
|
3215
3238
|
const pluginManager = new PluginManager2({
|
|
3216
3239
|
config,
|
|
@@ -3595,7 +3618,6 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3595
3618
|
entryFileNames: "[name]-h[hash].js",
|
|
3596
3619
|
chunkFileNames: "chunks/[name]-h[hash].js",
|
|
3597
3620
|
hashCharacters: "hex",
|
|
3598
|
-
...islandsMode && isReactRenderer(config.renderer) && !configuresFarmClientChunks(config.vite) ? { codeSplitting: { groups: [createFarmIslandsReactChunkGroup()] } } : {},
|
|
3599
3621
|
// Use predictable name for CSS so we can reference it in SSR HTML
|
|
3600
3622
|
assetFileNames: (assetInfo) => {
|
|
3601
3623
|
if (assetInfo.name?.endsWith(".css")) {
|
|
@@ -3665,6 +3687,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3665
3687
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
3666
3688
|
...rendererVitePlugins,
|
|
3667
3689
|
...config.vite.plugins || [],
|
|
3690
|
+
// React in one chunk, unless the app's config or one of its plugins splits chunks.
|
|
3691
|
+
...islandsMode && isReactRenderer(config.renderer) ? [createFarmIslandsReactChunkPlugin()] : [],
|
|
3668
3692
|
farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
|
|
3669
3693
|
farmNavigationPlugin(config.renderer),
|
|
3670
3694
|
farmDocsClientConfigPlugin(
|
|
@@ -5644,8 +5668,9 @@ let hydrateRoot;
|
|
|
5644
5668
|
let farmRendererLoading = null;
|
|
5645
5669
|
let farmRendererLoaded = false;${isolatedHydrationEnabled ? `
|
|
5646
5670
|
// The boot stops holding interactions once this entry runs. Until islx loads, islands that have not
|
|
5647
|
-
// hydrated hold them here, for their schedulers to replay
|
|
5648
|
-
|
|
5671
|
+
// hydrated hold them here, for their schedulers to replay, and a server component's form waits for
|
|
5672
|
+
// islx to post it without a page load.
|
|
5673
|
+
const releaseFarmIslandInteractions = holdFarmIslandInteractions("f-island", loadFarmRenderer);` : ""}
|
|
5649
5674
|
function loadFarmRenderer() {
|
|
5650
5675
|
return farmRendererLoading || (farmRendererLoading = Promise.all([
|
|
5651
5676
|
import("react"),
|
|
@@ -7319,7 +7344,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7319
7344
|
farmPlugin,
|
|
7320
7345
|
farmServerOnlyEntriesPlugin
|
|
7321
7346
|
} = await import("./vite.mjs");
|
|
7322
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
7347
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
|
|
7323
7348
|
const fs5 = await import("fs/promises");
|
|
7324
7349
|
const pluginManager = new PluginManager2({
|
|
7325
7350
|
config,
|
|
@@ -15711,7 +15736,8 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15711
15736
|
farmFontImportsPlugin({
|
|
15712
15737
|
root,
|
|
15713
15738
|
basePath: config.basePath,
|
|
15714
|
-
publicDir: config.publicDir
|
|
15739
|
+
publicDir: config.publicDir,
|
|
15740
|
+
isLayoutModule: (id) => isFarmLayoutModule(id, getFarmAppDirectories(config))
|
|
15715
15741
|
}),
|
|
15716
15742
|
farmEnvironmentFunctionsPlugin({ renderer: config.renderer }),
|
|
15717
15743
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
@@ -15785,7 +15811,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15785
15811
|
farmPlugin,
|
|
15786
15812
|
farmServerOnlyEntriesPlugin
|
|
15787
15813
|
} = await import("./vite.mjs");
|
|
15788
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
15814
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
|
|
15789
15815
|
const pluginManager = new PluginManager2({
|
|
15790
15816
|
config,
|
|
15791
15817
|
isDev: false,
|
|
@@ -15814,7 +15840,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15814
15840
|
}
|
|
15815
15841
|
async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
15816
15842
|
const { farmI18nClientBridgePlugin, farmIslandContainersPlugin, farmPlugin } = await import("./vite.mjs");
|
|
15817
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
15843
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-EVKQZBNW.mjs");
|
|
15818
15844
|
const pluginManager = new PluginManager2({
|
|
15819
15845
|
config,
|
|
15820
15846
|
isDev: false,
|
|
@@ -203,6 +203,9 @@ function resolveFarmRenderer(renderer) {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
+
if (resolved.compile !== void 0 && typeof resolved.compile !== "function") {
|
|
207
|
+
issues.push("`compile` must be a method that returns a file's JavaScript or TSX.");
|
|
208
|
+
}
|
|
206
209
|
if (issues.length > 0) {
|
|
207
210
|
throw new TypeError(
|
|
208
211
|
`Farm renderer \`${resolved.name}\` is invalid:
|
|
@@ -8,6 +8,12 @@ async function startPluginContainer(server) {
|
|
|
8
8
|
await container.buildStart?.();
|
|
9
9
|
startedContainers.add(container);
|
|
10
10
|
}
|
|
11
|
+
function createFarmDevModuleCheck(server, exports, environmentName = "ssr") {
|
|
12
|
+
const modules = server.environments[environmentName]?.runner?.evaluatedModules;
|
|
13
|
+
const node = modules ? Array.from(modules.idToModuleMap.values()).find((module) => module.exports === exports) : void 0;
|
|
14
|
+
if (!modules || !node) return () => true;
|
|
15
|
+
return () => node.evaluated && modules.getModuleById(node.id) === node;
|
|
16
|
+
}
|
|
11
17
|
var FarmDevEnvironmentError = class extends Error {
|
|
12
18
|
};
|
|
13
19
|
async function loadFarmDevModule(server, id, environmentName = "ssr") {
|
|
@@ -90,6 +96,7 @@ function invalidateFailedFarmDevModules(server) {
|
|
|
90
96
|
}
|
|
91
97
|
|
|
92
98
|
export {
|
|
99
|
+
createFarmDevModuleCheck,
|
|
93
100
|
FarmDevEnvironmentError,
|
|
94
101
|
loadFarmDevModule,
|
|
95
102
|
invalidateFarmDevDependents,
|