@farm.js/core 0.1.87 → 0.2.0-beta.0
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/analyzer-B2TRJT3B.cjs +17 -0
- package/dist/{analyzer-W4EB7DHL.mjs → analyzer-PWHYGER6.mjs} +2 -2
- package/dist/api/route-manager.cjs +3 -3
- package/dist/api/route-manager.mjs +2 -2
- package/dist/api.cjs +4 -4
- package/dist/api.mjs +3 -3
- package/dist/{chunk-B7L24VPX.cjs → chunk-22KXTL3I.cjs} +6 -4
- package/dist/{chunk-FULX5RYX.cjs → chunk-2OR5WAD5.cjs} +19 -13
- package/dist/{chunk-WSQ3S3NV.cjs → chunk-3MY6TNNE.cjs} +13 -12
- package/dist/{chunk-A4WWKG2B.cjs → chunk-5ZWXTIGE.cjs} +2 -2
- package/dist/{chunk-HYL372GW.cjs → chunk-6266WH6X.cjs} +1 -1
- package/dist/chunk-65LZRVCZ.mjs +18 -0
- package/dist/{chunk-ZCX2XJPY.cjs → chunk-7LBNWL3L.cjs} +2 -2
- package/dist/{chunk-4FGTNYHE.mjs → chunk-BJHXFEAF.mjs} +2 -2
- package/dist/chunk-BQHIJOZM.cjs +13 -0
- package/dist/{chunk-VCZ4EM5K.cjs → chunk-CFLRUCN7.cjs} +143 -136
- package/dist/{chunk-IM422XKU.cjs → chunk-CNGGEHXY.cjs} +2 -2
- package/dist/{chunk-B5QRNCIE.mjs → chunk-DATICPTO.mjs} +1 -1
- package/dist/{chunk-XMVZXZ32.cjs → chunk-ERV422FO.cjs} +2 -2
- package/dist/{chunk-33WR5XV5.cjs → chunk-FEWCWBOF.cjs} +4 -4
- package/dist/{chunk-FLMALEY2.mjs → chunk-GGD57DJA.mjs} +3 -25
- package/dist/{chunk-HQ2VAJLW.mjs → chunk-GV5D5EM6.mjs} +1 -1
- package/dist/{chunk-6MZSTPD2.mjs → chunk-H47EH24T.mjs} +1 -1
- package/dist/{chunk-OBVBII5K.cjs → chunk-HU4R2PPW.cjs} +2 -2
- package/dist/{chunk-N3VMHPIY.mjs → chunk-HZY63K5C.mjs} +2 -2
- package/dist/{chunk-HFRG2IQS.mjs → chunk-JDO3X7RB.mjs} +5 -4
- package/dist/{chunk-XFUPWRKT.cjs → chunk-JGUMFTZT.cjs} +4 -4
- package/dist/chunk-JIGWHFA5.mjs +32 -0
- package/dist/{chunk-YBXIVQCE.cjs → chunk-JP5TWUK2.cjs} +4 -4
- package/dist/{chunk-UGD53SNO.cjs → chunk-KQ6TYQU7.cjs} +16 -12
- package/dist/{chunk-K5FLQJW5.mjs → chunk-L6ZL35ZJ.mjs} +6 -4
- package/dist/{chunk-Q73LRKLP.mjs → chunk-LUGQUU4S.mjs} +1 -1
- package/dist/{chunk-LIWVPE72.mjs → chunk-M4CNAZMS.mjs} +23 -16
- package/dist/{chunk-QLRI2BX5.mjs → chunk-MM4U2NNI.mjs} +4 -4
- package/dist/{chunk-5D73SKF3.mjs → chunk-MRULVIH3.mjs} +1 -1
- package/dist/{chunk-LBJOHMTB.mjs → chunk-MZPPT5NA.mjs} +1 -1
- package/dist/{chunk-2UYYXSUS.mjs → chunk-N5NRXLCX.mjs} +4 -2
- package/dist/{chunk-U3A46QFD.cjs → chunk-PA3VZNWU.cjs} +6 -6
- package/dist/{chunk-2PJVEL56.cjs → chunk-PCAEJNQF.cjs} +5 -27
- package/dist/{chunk-TI4BZV6M.cjs → chunk-PQ6DBVJ2.cjs} +53 -53
- package/dist/chunk-PTAGDZ7I.mjs +13 -0
- package/dist/{chunk-3AV4DCXY.mjs → chunk-PWTBXYJY.mjs} +12 -6
- package/dist/{chunk-PO5MZIWK.mjs → chunk-QBXS4TNG.mjs} +6 -2
- package/dist/chunk-QZUCVJZJ.cjs +18 -0
- package/dist/{chunk-EZYNIADW.mjs → chunk-SCOKBXHS.mjs} +45 -29
- package/dist/{chunk-CXHVRHM2.cjs → chunk-SG5RFGV6.cjs} +2 -2
- package/dist/{chunk-VCI776NG.cjs → chunk-SUACCCZG.cjs} +12 -10
- package/dist/{chunk-CN2JOTRO.cjs → chunk-THGSPDFD.cjs} +7 -7
- package/dist/{chunk-SDNYULFS.cjs → chunk-TQFIZRON.cjs} +157 -141
- package/dist/{chunk-7BNVUIGL.cjs → chunk-VMGQOP7X.cjs} +2 -2
- package/dist/{chunk-4SJ22WTT.mjs → chunk-W3ZBLFLU.mjs} +1 -1
- package/dist/{chunk-26HESRBL.mjs → chunk-WOTAU3BN.mjs} +1 -1
- package/dist/{chunk-JB4BHRFK.cjs → chunk-WP77JDKI.cjs} +16 -16
- package/dist/{chunk-3F55K4MC.mjs → chunk-WPB6HJC7.mjs} +1 -1
- package/dist/{chunk-VPGEYX5Y.mjs → chunk-WX752VMN.mjs} +2 -2
- package/dist/{chunk-O7K4HMAQ.mjs → chunk-XJJQAFZX.mjs} +1 -1
- package/dist/{chunk-RGYS5OPL.cjs → chunk-XRYLMTYF.cjs} +3 -3
- package/dist/{chunk-QSDIJ45N.mjs → chunk-YCHIR3X6.mjs} +1 -1
- package/dist/chunk-YIGUFJMR.cjs +32 -0
- package/dist/{chunk-A2PPQ5LB.mjs → chunk-ZOD6EYWE.mjs} +1 -1
- package/dist/client.cjs +8 -6
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -5
- package/dist/{devtools-GWJZPWIW.mjs → devtools-2CRVXV7E.mjs} +1 -1
- package/dist/{devtools-GPIKZ5AV.cjs → devtools-RL4AU5KD.cjs} +2 -2
- package/dist/docs.cjs +3 -3
- package/dist/docs.mjs +2 -2
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/i18n/client.cjs +11 -10
- package/dist/i18n/client.mjs +3 -2
- package/dist/index.cjs +30 -28
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +25 -23
- package/dist/internal/build-runtime.cjs +17 -17
- package/dist/internal/build-runtime.mjs +16 -16
- package/dist/internal/cli-runtime.cjs +5 -5
- package/dist/internal/cli-runtime.mjs +4 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +11 -12
- package/dist/internal/client-runtime.d.mts +6 -4
- package/dist/internal/client-runtime.d.ts +6 -4
- package/dist/internal/client-runtime.mjs +11 -12
- package/dist/internal/config-runtime.cjs +3 -3
- package/dist/internal/config-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-boot.cjs +20 -15
- package/dist/internal/islands-boot.mjs +6 -1
- 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 +4 -4
- package/dist/internal/production-runtime.mjs +3 -3
- package/dist/internal/spa-router.cjs +4 -3
- package/dist/internal/spa-router.d.mts +1 -1
- package/dist/internal/spa-router.d.ts +1 -1
- package/dist/internal/spa-router.mjs +3 -2
- package/dist/{manager-PX4QN4HK.cjs → manager-D4DZRBRS.cjs} +4 -4
- package/dist/{manager-OMTC5FOJ.mjs → manager-PKPQGBAE.mjs} +3 -3
- package/dist/{navigation-delegate.d-ChfinbWB.d.mts → navigation-delegate.d-B9GjWbov.d.mts} +1 -1
- package/dist/{navigation-delegate.d-fMgELdAe.d.ts → navigation-delegate.d-BbW1_pf_.d.ts} +1 -1
- package/dist/navigation.cjs +6 -5
- package/dist/navigation.d.mts +2 -2
- package/dist/navigation.d.ts +2 -2
- package/dist/navigation.mjs +5 -4
- package/dist/plugin.cjs +12 -12
- package/dist/plugin.mjs +11 -11
- package/dist/query/client.cjs +8 -7
- package/dist/query/client.mjs +3 -2
- package/dist/renderer-client.cjs +14 -13
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +5 -4
- package/dist/{router.d-D5Mp7bpO.d.ts → router.d-Bm9FNSu3.d.ts} +1 -1
- package/dist/{router.d-DrQ1QDFk.d.mts → router.d-YKVirmj4.d.mts} +1 -1
- package/dist/{rsc-pipeline-TQOSDWOU.cjs → rsc-pipeline-3DYC5ZXW.cjs} +3 -3
- package/dist/{rsc-pipeline-KLMQU3YP.mjs → rsc-pipeline-LRB4ZG6I.mjs} +2 -2
- package/dist/{runtime-BDPBO65S.mjs → runtime-3WJNNAAR.mjs} +2 -2
- package/dist/{runtime-CQSCRVZ7.cjs → runtime-CRFF32H6.cjs} +4 -4
- package/dist/server.cjs +47 -33
- package/dist/server.mjs +27 -13
- package/dist/{spa-router.d-CXgvy-7L.d.mts → spa-router.d-DGmropfK.d.mts} +3 -1
- package/dist/{spa-router.d-BXxoU3Cv.d.ts → spa-router.d-nE1jHNGt.d.ts} +3 -1
- package/dist/{store-core.d-D00BsbnO.d.ts → store-core.d-B5cwOd8g.d.ts} +2 -2
- package/dist/{store-core.d-CDbVAbTn.d.mts → store-core.d-C-gATBwd.d.mts} +2 -2
- package/dist/testing.cjs +2 -2
- package/dist/testing.mjs +2 -2
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +12 -12
- package/dist/vite.mjs +11 -11
- package/package.json +3 -3
- package/dist/analyzer-LLU2Z6I4.cjs +0 -17
- package/dist/chunk-SBDWCDS6.cjs +0 -8
- package/dist/chunk-YX6AFPXC.mjs +0 -8
- /package/dist/{chunk-ALOFMAFA.mjs → chunk-BGEA4K7C.mjs} +0 -0
- /package/dist/{chunk-MZR22RAC.cjs → chunk-IRPXOTEN.cjs} +0 -0
|
@@ -28,7 +28,7 @@ var _chunkYUCU6XB4cjs = require('./chunk-YUCU6XB4.cjs');
|
|
|
28
28
|
var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunk6266WH6Xcjs = require('./chunk-6266WH6X.cjs');
|
|
32
32
|
|
|
33
33
|
// src/environment-vite.ts
|
|
34
34
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
@@ -886,7 +886,7 @@ function usePackageScanCacheFile(file) {
|
|
|
886
886
|
const stored = /* @__PURE__ */ new Map();
|
|
887
887
|
try {
|
|
888
888
|
const value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
|
|
889
|
-
if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm ===
|
|
889
|
+
if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm === _chunk6266WH6Xcjs.FARM_VERSION && value.scans && typeof value.scans === "object") {
|
|
890
890
|
for (const [directory, scan] of Object.entries(value.scans)) {
|
|
891
891
|
if (isStoredPackageScan(scan)) stored.set(directory, scan);
|
|
892
892
|
}
|
|
@@ -915,7 +915,7 @@ function persistPackageScanCache() {
|
|
|
915
915
|
_fs2.default.mkdirSync(_path2.default.dirname(cache2.file), { recursive: true });
|
|
916
916
|
_fs2.default.writeFileSync(
|
|
917
917
|
temporary,
|
|
918
|
-
JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm:
|
|
918
|
+
JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm: _chunk6266WH6Xcjs.FARM_VERSION, scans })
|
|
919
919
|
);
|
|
920
920
|
_fs2.default.renameSync(temporary, cache2.file);
|
|
921
921
|
cache2.dirty = false;
|
|
@@ -2218,7 +2218,7 @@ var PackageClientBoundaryCache = class {
|
|
|
2218
2218
|
}
|
|
2219
2219
|
const contents = JSON.stringify({
|
|
2220
2220
|
schema: SCHEMA_VERSION,
|
|
2221
|
-
farm:
|
|
2221
|
+
farm: _chunk6266WH6Xcjs.FARM_VERSION,
|
|
2222
2222
|
paths,
|
|
2223
2223
|
entries
|
|
2224
2224
|
});
|
|
@@ -2258,7 +2258,7 @@ function readStoredCache(file) {
|
|
|
2258
2258
|
} catch (e37) {
|
|
2259
2259
|
return null;
|
|
2260
2260
|
}
|
|
2261
|
-
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !==
|
|
2261
|
+
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunk6266WH6Xcjs.FARM_VERSION) {
|
|
2262
2262
|
return null;
|
|
2263
2263
|
}
|
|
2264
2264
|
const { paths, entries } = value;
|
|
@@ -2269,7 +2269,7 @@ function readStoredCache(file) {
|
|
|
2269
2269
|
const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
|
|
2270
2270
|
if (usable.length > 0) valid[key] = usable;
|
|
2271
2271
|
}
|
|
2272
|
-
return { schema: SCHEMA_VERSION, farm:
|
|
2272
|
+
return { schema: SCHEMA_VERSION, farm: _chunk6266WH6Xcjs.FARM_VERSION, paths, entries: valid };
|
|
2273
2273
|
}
|
|
2274
2274
|
function isRecord(value) {
|
|
2275
2275
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkYIGUFJMRcjs = require('./chunk-YIGUFJMR.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
var _chunk7Q2YWZF7cjs = require('./chunk-7Q2YWZF7.cjs');
|
|
4
7
|
|
|
5
8
|
|
|
@@ -9,27 +12,6 @@ var _chunkAOKXITZ6cjs = require('./chunk-AOKXITZ6.cjs');
|
|
|
9
12
|
|
|
10
13
|
var _chunkGYJT2U7Jcjs = require('./chunk-GYJT2U7J.cjs');
|
|
11
14
|
|
|
12
|
-
// src/client/navigation-url.ts
|
|
13
|
-
var FARM_NAVIGATION_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
14
|
-
function isFarmBlockedNavigationURL(url) {
|
|
15
|
-
if (FARM_NAVIGATION_PROTOCOLS.has(url.protocol)) return false;
|
|
16
|
-
console.error(`[Farm.js] Blocked navigation to a ${url.protocol} URL as a security precaution.`);
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
function isFarmScriptURL(href) {
|
|
20
|
-
try {
|
|
21
|
-
return new URL(href, "http://farm.invalid").protocol === "javascript:";
|
|
22
|
-
} catch (e) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function isFarmExternalNavigationURL(url, currentOrigin) {
|
|
27
|
-
return url.protocol !== "http:" && url.protocol !== "https:" || url.origin !== currentOrigin;
|
|
28
|
-
}
|
|
29
|
-
function resolveFarmNavigationURL(href, documentUrl) {
|
|
30
|
-
return new URL(href, documentUrl);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
15
|
// src/i18n/client-state.ts
|
|
34
16
|
var listeners = /* @__PURE__ */ new Set();
|
|
35
17
|
var compiledFarmI18nMessages = /* @__PURE__ */ new Map();
|
|
@@ -62,7 +44,7 @@ function isFarmLocaleChangeHref(href) {
|
|
|
62
44
|
const snapshot = getFarmI18nClientState();
|
|
63
45
|
if (!snapshot || typeof window === "undefined") return false;
|
|
64
46
|
if (snapshot.routing === "none") return false;
|
|
65
|
-
const target = resolveFarmNavigationURL(href, window.location.href);
|
|
47
|
+
const target = _chunkYIGUFJMRcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
|
|
66
48
|
const match = _chunkGYJT2U7Jcjs.resolveFarmLocalePath.call(void 0, target.pathname, snapshot);
|
|
67
49
|
const targetLocale = match.locale || snapshot.defaultLocale;
|
|
68
50
|
return targetLocale !== snapshot.locale;
|
|
@@ -83,8 +65,4 @@ function rememberFarmLinkLocale(anchor) {
|
|
|
83
65
|
|
|
84
66
|
|
|
85
67
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
exports.isFarmBlockedNavigationURL = isFarmBlockedNavigationURL; exports.isFarmScriptURL = isFarmScriptURL; exports.isFarmExternalNavigationURL = isFarmExternalNavigationURL; exports.resolveFarmNavigationURL = resolveFarmNavigationURL; exports.compiledFarmI18nMessages = compiledFarmI18nMessages; exports.getFarmI18nClientState = getFarmI18nClientState; exports.subscribeFarmI18n = subscribeFarmI18n; exports._hydrateFarmI18n = _hydrateFarmI18n; exports.localizeActiveFarmHref = localizeActiveFarmHref; exports.isFarmLocaleChangeHref = isFarmLocaleChangeHref; exports.rememberFarmLinkLocale = rememberFarmLinkLocale;
|
|
68
|
+
exports.compiledFarmI18nMessages = compiledFarmI18nMessages; exports.getFarmI18nClientState = getFarmI18nClientState; exports.subscribeFarmI18n = subscribeFarmI18n; exports._hydrateFarmI18n = _hydrateFarmI18n; exports.localizeActiveFarmHref = localizeActiveFarmHref; exports.isFarmLocaleChangeHref = isFarmLocaleChangeHref; exports.rememberFarmLinkLocale = rememberFarmLinkLocale;
|
|
@@ -9,7 +9,7 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkERV422FOcjs = require('./chunk-ERV422FO.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkZSVFI7JMcjs = require('./chunk-ZSVFI7JM.cjs');
|
|
@@ -59,7 +59,7 @@ var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
|
59
59
|
var _chunk4ZVKDHS6cjs = require('./chunk-4ZVKDHS6.cjs');
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
var
|
|
62
|
+
var _chunkJGUMFTZTcjs = require('./chunk-JGUMFTZT.cjs');
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
@@ -104,7 +104,7 @@ var _chunkWOAXQ5MZcjs = require('./chunk-WOAXQ5MZ.cjs');
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
var
|
|
107
|
+
var _chunkPA3VZNWUcjs = require('./chunk-PA3VZNWU.cjs');
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
@@ -304,7 +304,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
304
304
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
305
305
|
|
|
306
306
|
|
|
307
|
-
var
|
|
307
|
+
var _chunk6266WH6Xcjs = require('./chunk-6266WH6X.cjs');
|
|
308
308
|
|
|
309
309
|
|
|
310
310
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -508,7 +508,7 @@ var RouteManager = class _RouteManager {
|
|
|
508
508
|
this.redirects = /* @__PURE__ */ new Map();
|
|
509
509
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
510
510
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
511
|
-
this.programmaticClientRoutes =
|
|
511
|
+
this.programmaticClientRoutes = _chunkPA3VZNWUcjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
512
512
|
// The hydration settings each route rule returned, by file.
|
|
513
513
|
this.rendererRouteHydration = /* @__PURE__ */ new Map();
|
|
514
514
|
this.disposeRendererHydration = () => {
|
|
@@ -597,7 +597,7 @@ var RouteManager = class _RouteManager {
|
|
|
597
597
|
});
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
this.disposeRendererHydration =
|
|
600
|
+
this.disposeRendererHydration = _chunkPA3VZNWUcjs.setFarmRendererHydrationScope.call(void 0,
|
|
601
601
|
_chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, this.config).map((source) => source.root),
|
|
602
602
|
renderer,
|
|
603
603
|
routeModules
|
|
@@ -633,7 +633,7 @@ var RouteManager = class _RouteManager {
|
|
|
633
633
|
await this.discoverFileRoutes(source);
|
|
634
634
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
635
635
|
}
|
|
636
|
-
this.programmaticClientRoutes =
|
|
636
|
+
this.programmaticClientRoutes = _chunkPA3VZNWUcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
637
637
|
for (const slot of this.routeSlots.values()) {
|
|
638
638
|
if (slot.interception && !this.pageRouteShapes.has(_chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
639
639
|
throw new (0, _chunkML4TOUZPcjs.AmbiguousRouteError)(
|
|
@@ -926,11 +926,11 @@ var RouteManager = class _RouteManager {
|
|
|
926
926
|
return this.clientManifestCache.manifest;
|
|
927
927
|
}
|
|
928
928
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
929
|
-
const compute = () =>
|
|
929
|
+
const compute = () => _chunkPA3VZNWUcjs.withFarmSourceSnapshot.call(void 0,
|
|
930
930
|
() => this.computeClientManifest(normalizedProjectRoot),
|
|
931
931
|
this.sourceSnapshot
|
|
932
932
|
);
|
|
933
|
-
return cacheFile ?
|
|
933
|
+
return cacheFile ? _chunkPA3VZNWUcjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
|
|
934
934
|
}
|
|
935
935
|
/**
|
|
936
936
|
* @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
|
|
@@ -939,7 +939,7 @@ var RouteManager = class _RouteManager {
|
|
|
939
939
|
*/
|
|
940
940
|
trackSourceChanges() {
|
|
941
941
|
this.sourceChangeTracking = true;
|
|
942
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
942
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkPA3VZNWUcjs.FarmSourceSnapshotStore)())));
|
|
943
943
|
}
|
|
944
944
|
/**
|
|
945
945
|
* @internal A production build edits no source while it runs, so what the plan reads, parses and
|
|
@@ -948,7 +948,7 @@ var RouteManager = class _RouteManager {
|
|
|
948
948
|
*/
|
|
949
949
|
keepBuildSourceSnapshot() {
|
|
950
950
|
if (this.sourceChangeTracking) return;
|
|
951
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
951
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkPA3VZNWUcjs.FarmSourceSnapshotStore)(false))));
|
|
952
952
|
}
|
|
953
953
|
/**
|
|
954
954
|
* @internal Hands the snapshot keepBuildSourceSnapshot kept to the build, which clears it once
|
|
@@ -991,7 +991,7 @@ var RouteManager = class _RouteManager {
|
|
|
991
991
|
return false;
|
|
992
992
|
}
|
|
993
993
|
const previous = _optionalChain([this, 'access', _18 => _18.sourceSnapshot, 'optionalAccess', _19 => _19.peekSource, 'call', _20 => _20(path4.default.resolve(file))]);
|
|
994
|
-
return previous !== void 0 &&
|
|
994
|
+
return previous !== void 0 && _chunkPA3VZNWUcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
|
|
995
995
|
}
|
|
996
996
|
/**
|
|
997
997
|
* A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
|
|
@@ -1002,7 +1002,7 @@ var RouteManager = class _RouteManager {
|
|
|
1002
1002
|
if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
|
|
1003
1003
|
return { ...previous.plan };
|
|
1004
1004
|
}
|
|
1005
|
-
const { result, files } =
|
|
1005
|
+
const { result, files } = _chunkPA3VZNWUcjs.traceFarmSourceReads.call(void 0, compute);
|
|
1006
1006
|
const sources = /* @__PURE__ */ new Set();
|
|
1007
1007
|
for (const file of files) {
|
|
1008
1008
|
const source = this.planSourcePath(file);
|
|
@@ -1010,7 +1010,7 @@ var RouteManager = class _RouteManager {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
if (!this.sourceChangeTracking) {
|
|
1012
1012
|
for (const source of sources) {
|
|
1013
|
-
if (!this.planStamps.has(source)) this.planStamps.set(source,
|
|
1013
|
+
if (!this.planStamps.has(source)) this.planStamps.set(source, _chunkPA3VZNWUcjs.getFarmSourceStamp.call(void 0, source));
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
1016
|
this.ownerPlans.set(key, { plan: result, files: sources, planKey });
|
|
@@ -1030,7 +1030,7 @@ var RouteManager = class _RouteManager {
|
|
|
1030
1030
|
const isUnchanged = (file) => {
|
|
1031
1031
|
let result = unchanged.get(file);
|
|
1032
1032
|
if (result === void 0) {
|
|
1033
|
-
result = this.planStamps.get(file) ===
|
|
1033
|
+
result = this.planStamps.get(file) === _chunkPA3VZNWUcjs.getFarmSourceStamp.call(void 0, file);
|
|
1034
1034
|
unchanged.set(file, result);
|
|
1035
1035
|
}
|
|
1036
1036
|
return result;
|
|
@@ -1077,7 +1077,7 @@ var RouteManager = class _RouteManager {
|
|
|
1077
1077
|
*/
|
|
1078
1078
|
inspectPackages(operation) {
|
|
1079
1079
|
const file = this.packageClientBoundaryCacheFile;
|
|
1080
|
-
return file ?
|
|
1080
|
+
return file ? _chunkPA3VZNWUcjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
|
|
1081
1081
|
}
|
|
1082
1082
|
computeClientManifest(normalizedProjectRoot) {
|
|
1083
1083
|
const toUrlPath = (absolutePath) => {
|
|
@@ -1100,14 +1100,14 @@ var RouteManager = class _RouteManager {
|
|
|
1100
1100
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
1101
1101
|
);
|
|
1102
1102
|
}
|
|
1103
|
-
const isolatedMode =
|
|
1103
|
+
const isolatedMode = _chunkPA3VZNWUcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
1104
1104
|
_optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.isolatedClientHydration]),
|
|
1105
1105
|
{
|
|
1106
1106
|
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _30 => _30.config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.serverComponents])) === "rsc",
|
|
1107
1107
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
1108
1108
|
}
|
|
1109
1109
|
);
|
|
1110
|
-
const planOptions =
|
|
1110
|
+
const planOptions = _chunkPA3VZNWUcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
1111
1111
|
this.config.renderer,
|
|
1112
1112
|
Boolean(unsupportedIntegrationProvider)
|
|
1113
1113
|
);
|
|
@@ -1117,7 +1117,7 @@ var RouteManager = class _RouteManager {
|
|
|
1117
1117
|
if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
|
|
1118
1118
|
edited = /* @__PURE__ */ new Set();
|
|
1119
1119
|
for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
|
|
1120
|
-
if (
|
|
1120
|
+
if (_chunkPA3VZNWUcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
|
|
1121
1121
|
const source = this.planSourcePath(file);
|
|
1122
1122
|
if (source) edited.add(source);
|
|
1123
1123
|
}
|
|
@@ -1132,13 +1132,13 @@ var RouteManager = class _RouteManager {
|
|
|
1132
1132
|
metadata: this.planRouteModule(
|
|
1133
1133
|
`layout:${entry.modulePath}`,
|
|
1134
1134
|
edited,
|
|
1135
|
-
() =>
|
|
1135
|
+
() => _chunkPA3VZNWUcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1136
1136
|
entry.modulePath,
|
|
1137
1137
|
normalizedProjectRoot,
|
|
1138
1138
|
isolatedMode,
|
|
1139
1139
|
layoutPlanOptions
|
|
1140
1140
|
),
|
|
1141
|
-
|
|
1141
|
+
_chunkPA3VZNWUcjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1142
1142
|
entry.modulePath,
|
|
1143
1143
|
normalizedProjectRoot,
|
|
1144
1144
|
isolatedMode,
|
|
@@ -1146,7 +1146,7 @@ var RouteManager = class _RouteManager {
|
|
|
1146
1146
|
)
|
|
1147
1147
|
)
|
|
1148
1148
|
}));
|
|
1149
|
-
const markdownComponentsPlan =
|
|
1149
|
+
const markdownComponentsPlan = _chunkPA3VZNWUcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
1150
1150
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
1151
1151
|
normalizedProjectRoot,
|
|
1152
1152
|
isolatedMode,
|
|
@@ -1162,13 +1162,13 @@ var RouteManager = class _RouteManager {
|
|
|
1162
1162
|
metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
|
|
1163
1163
|
`page:${entry.modulePath}`,
|
|
1164
1164
|
edited,
|
|
1165
|
-
() =>
|
|
1165
|
+
() => _chunkPA3VZNWUcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1166
1166
|
entry.modulePath,
|
|
1167
1167
|
normalizedProjectRoot,
|
|
1168
1168
|
isolatedMode,
|
|
1169
1169
|
pagePlanOptions
|
|
1170
1170
|
),
|
|
1171
|
-
|
|
1171
|
+
_chunkPA3VZNWUcjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1172
1172
|
entry.modulePath,
|
|
1173
1173
|
normalizedProjectRoot,
|
|
1174
1174
|
isolatedMode,
|
|
@@ -1198,7 +1198,7 @@ var RouteManager = class _RouteManager {
|
|
|
1198
1198
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1199
1199
|
);
|
|
1200
1200
|
}
|
|
1201
|
-
|
|
1201
|
+
_chunkPA3VZNWUcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
1202
1202
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1203
1203
|
pattern: entry.pattern,
|
|
1204
1204
|
depth: _chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
@@ -1245,7 +1245,7 @@ var RouteManager = class _RouteManager {
|
|
|
1245
1245
|
modulePath: toUrlPath(boundary.modulePath)
|
|
1246
1246
|
}))
|
|
1247
1247
|
} : {},
|
|
1248
|
-
...
|
|
1248
|
+
..._chunkPA3VZNWUcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
1249
1249
|
renderPlan: _chunk4ZVKDHS6cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
1250
1250
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
1251
1251
|
layoutShouldHydrate,
|
|
@@ -1287,7 +1287,7 @@ var RouteManager = class _RouteManager {
|
|
|
1287
1287
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
1288
1288
|
}));
|
|
1289
1289
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
1290
|
-
const metadata =
|
|
1290
|
+
const metadata = _chunkPA3VZNWUcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
1291
1291
|
return {
|
|
1292
1292
|
name: entry.name,
|
|
1293
1293
|
ownerPattern: entry.ownerPattern,
|
|
@@ -1303,7 +1303,7 @@ var RouteManager = class _RouteManager {
|
|
|
1303
1303
|
};
|
|
1304
1304
|
});
|
|
1305
1305
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
1306
|
-
metadata:
|
|
1306
|
+
metadata: _chunkPA3VZNWUcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1307
1307
|
entry.modulePath,
|
|
1308
1308
|
normalizedProjectRoot,
|
|
1309
1309
|
isolatedMode,
|
|
@@ -1678,11 +1678,11 @@ var RouteManager = class _RouteManager {
|
|
|
1678
1678
|
srcDir: source.srcDir,
|
|
1679
1679
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1680
1680
|
});
|
|
1681
|
-
const graph = this.viteServer ?
|
|
1681
|
+
const graph = this.viteServer ? _chunkPA3VZNWUcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1682
1682
|
for (const { filePath, manifest } of manifests) {
|
|
1683
1683
|
if (graph) {
|
|
1684
1684
|
clientRoutes.push(
|
|
1685
|
-
|
|
1685
|
+
_chunkPA3VZNWUcjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1686
1686
|
graph,
|
|
1687
1687
|
routesFile: toRealPath(filePath),
|
|
1688
1688
|
routes: manifest.routes,
|
|
@@ -1896,7 +1896,7 @@ var RouteManager = class _RouteManager {
|
|
|
1896
1896
|
}));
|
|
1897
1897
|
const i18n = this.getI18nConfig();
|
|
1898
1898
|
const docsAdapterRoutes = this.getDocsAdapterRoutes();
|
|
1899
|
-
const result = await
|
|
1899
|
+
const result = await _chunkERV422FOcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
1900
1900
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
|
|
1901
1901
|
...docsAdapterRoutes ? { docsAdapterRoutes } : {}
|
|
1902
1902
|
});
|
|
@@ -1943,7 +1943,7 @@ var RouteManager = class _RouteManager {
|
|
|
1943
1943
|
async isRouteSSG(modulePath) {
|
|
1944
1944
|
try {
|
|
1945
1945
|
const mod = await this.loadRouteModule(modulePath);
|
|
1946
|
-
const rendering = await
|
|
1946
|
+
const rendering = await _chunkERV422FOcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1947
1947
|
return rendering.ssg;
|
|
1948
1948
|
} catch (e2) {
|
|
1949
1949
|
return false;
|
|
@@ -1955,7 +1955,7 @@ var RouteManager = class _RouteManager {
|
|
|
1955
1955
|
async hasRouteISR(modulePath) {
|
|
1956
1956
|
try {
|
|
1957
1957
|
const mod = await this.loadRouteModule(modulePath);
|
|
1958
|
-
const rendering = await
|
|
1958
|
+
const rendering = await _chunkERV422FOcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1959
1959
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
1960
1960
|
} catch (e3) {
|
|
1961
1961
|
return false;
|
|
@@ -1967,7 +1967,7 @@ var RouteManager = class _RouteManager {
|
|
|
1967
1967
|
async getRouteRevalidateInterval(modulePath) {
|
|
1968
1968
|
try {
|
|
1969
1969
|
const mod = await this.loadRouteModule(modulePath);
|
|
1970
|
-
const rendering = await
|
|
1970
|
+
const rendering = await _chunkERV422FOcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1971
1971
|
return rendering.revalidate;
|
|
1972
1972
|
} catch (e4) {
|
|
1973
1973
|
return void 0;
|
|
@@ -3393,7 +3393,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
3393
3393
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
3394
3394
|
parse: parseFarmIslandSource,
|
|
3395
3395
|
resolve: (specifier, importer) => {
|
|
3396
|
-
const resolved =
|
|
3396
|
+
const resolved = _chunkPA3VZNWUcjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
3397
3397
|
return resolved.local ? resolved.path : null;
|
|
3398
3398
|
}
|
|
3399
3399
|
});
|
|
@@ -3413,7 +3413,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
3413
3413
|
if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
|
|
3414
3414
|
return cached.result;
|
|
3415
3415
|
}
|
|
3416
|
-
const { result, files } =
|
|
3416
|
+
const { result, files } = _chunkPA3VZNWUcjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
|
|
3417
3417
|
const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
|
|
3418
3418
|
routeRootInferences.set(key, {
|
|
3419
3419
|
stamps: [...read].map((file) => [file, modifiedAt(file)]),
|
|
@@ -3430,7 +3430,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3430
3430
|
const files = [];
|
|
3431
3431
|
const modules = [];
|
|
3432
3432
|
for (const owner of owners) {
|
|
3433
|
-
const rendered =
|
|
3433
|
+
const rendered = _chunkPA3VZNWUcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
3434
3434
|
if (!rendered) {
|
|
3435
3435
|
return {
|
|
3436
3436
|
strategy: null,
|
|
@@ -3446,7 +3446,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3446
3446
|
source = fs2.default.readFileSync(module, "utf8");
|
|
3447
3447
|
} catch (e11) {
|
|
3448
3448
|
}
|
|
3449
|
-
if (
|
|
3449
|
+
if (_chunkPA3VZNWUcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
3450
3450
|
}
|
|
3451
3451
|
for (const module of modules) {
|
|
3452
3452
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -3837,7 +3837,7 @@ var DECLARATION_STATEMENTS = /* @__PURE__ */ new Set([
|
|
|
3837
3837
|
function parse(code, file) {
|
|
3838
3838
|
const extension = path4.default.extname(file).slice(1);
|
|
3839
3839
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" ? "jsx" : "tsx";
|
|
3840
|
-
return
|
|
3840
|
+
return _chunkPA3VZNWUcjs.memoizeInFarmSourceSnapshot.call(void 0, `ast:${lang}`, code, () => {
|
|
3841
3841
|
try {
|
|
3842
3842
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
3843
3843
|
} catch (e14) {
|
|
@@ -3972,14 +3972,14 @@ function isReference(node, parent, key) {
|
|
|
3972
3972
|
}
|
|
3973
3973
|
function readSource(file) {
|
|
3974
3974
|
try {
|
|
3975
|
-
|
|
3975
|
+
_chunkPA3VZNWUcjs.noteFarmSourceRead.call(void 0, file);
|
|
3976
3976
|
return fs2.default.readFileSync(file, "utf8");
|
|
3977
3977
|
} catch (e15) {
|
|
3978
3978
|
return null;
|
|
3979
3979
|
}
|
|
3980
3980
|
}
|
|
3981
3981
|
function explainFarmKeptLayoutRender(modulePath, root) {
|
|
3982
|
-
const entry =
|
|
3982
|
+
const entry = _chunkPA3VZNWUcjs.resolveModuleSourcePath.call(void 0, modulePath, root);
|
|
3983
3983
|
if (!entry) return `${modulePath} does not resolve`;
|
|
3984
3984
|
const visited = /* @__PURE__ */ new Set();
|
|
3985
3985
|
const check = (file) => {
|
|
@@ -3989,7 +3989,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3989
3989
|
if (!SCRIPT_SOURCE.test(file)) return `${path4.default.relative(root, file)} is not a script`;
|
|
3990
3990
|
const code = readSource(file);
|
|
3991
3991
|
if (code === null) return `${path4.default.relative(root, file)} cannot be read`;
|
|
3992
|
-
const { reason, imports } =
|
|
3992
|
+
const { reason, imports } = _chunkPA3VZNWUcjs.memoizeInFarmSourceSnapshot.call(void 0,
|
|
3993
3993
|
"kept-layout-module",
|
|
3994
3994
|
code,
|
|
3995
3995
|
() => findFarmRequestDecidingConstruct(code, file)
|
|
@@ -4002,7 +4002,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
4002
4002
|
return `${path4.default.relative(root, file)} imports ${imported.names.join(", ")} from ${imported.source}`;
|
|
4003
4003
|
}
|
|
4004
4004
|
if (ASSET_SOURCE.test(imported.source.split("?")[0])) continue;
|
|
4005
|
-
const resolved =
|
|
4005
|
+
const resolved = _chunkPA3VZNWUcjs.resolveImportedModule.call(void 0, file, imported.source, root);
|
|
4006
4006
|
if (!resolved.path || !resolved.local) {
|
|
4007
4007
|
return `${path4.default.relative(root, file)} imports ${imported.source}`;
|
|
4008
4008
|
}
|
|
@@ -4017,15 +4017,15 @@ var answers = /* @__PURE__ */ new Map();
|
|
|
4017
4017
|
function canFarmSkipKeptLayoutRender(modulePath, root) {
|
|
4018
4018
|
const key = `${root}\0${modulePath}`;
|
|
4019
4019
|
const known = answers.get(key);
|
|
4020
|
-
if (known && known.stamps.every(([file, stamp]) =>
|
|
4020
|
+
if (known && known.stamps.every(([file, stamp]) => _chunkPA3VZNWUcjs.getFarmSourceStamp.call(void 0, file) === stamp)) {
|
|
4021
4021
|
return known.skip;
|
|
4022
4022
|
}
|
|
4023
|
-
const { result, files } =
|
|
4023
|
+
const { result, files } = _chunkPA3VZNWUcjs.traceFarmSourceReads.call(void 0,
|
|
4024
4024
|
() => explainFarmKeptLayoutRender(modulePath, root) === null
|
|
4025
4025
|
);
|
|
4026
4026
|
answers.set(key, {
|
|
4027
4027
|
skip: result,
|
|
4028
|
-
stamps: files.map((file) => [file,
|
|
4028
|
+
stamps: files.map((file) => [file, _chunkPA3VZNWUcjs.getFarmSourceStamp.call(void 0, file)])
|
|
4029
4029
|
});
|
|
4030
4030
|
return result;
|
|
4031
4031
|
}
|
|
@@ -4153,7 +4153,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
4153
4153
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
4154
4154
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
4155
4155
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
4156
|
-
_chunk7U4XF76Rcjs.logger.warn(
|
|
4156
|
+
_chunk7U4XF76Rcjs.logger.warn(_chunkPA3VZNWUcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
4157
4157
|
}
|
|
4158
4158
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
4159
4159
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
@@ -4879,7 +4879,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4879
4879
|
* Check if a path should be served from SSG cache
|
|
4880
4880
|
*/
|
|
4881
4881
|
async shouldServeSSG(pathname) {
|
|
4882
|
-
const ssgPage =
|
|
4882
|
+
const ssgPage = _chunkERV422FOcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
4883
4883
|
if (!ssgPage) return null;
|
|
4884
4884
|
const cached = await this.getCachedSSGPage(pathname);
|
|
4885
4885
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -5379,7 +5379,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5379
5379
|
throw error;
|
|
5380
5380
|
}
|
|
5381
5381
|
}
|
|
5382
|
-
const renderingConfig = await
|
|
5382
|
+
const renderingConfig = await _chunkERV422FOcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5383
5383
|
routeModule,
|
|
5384
5384
|
route.modulePath,
|
|
5385
5385
|
{ experimentalPPR: _optionalChain([this, 'access', _157 => _157.config, 'access', _158 => _158.experimental, 'optionalAccess', _159 => _159.ppr]) === true }
|
|
@@ -5471,7 +5471,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5471
5471
|
const routeManifestEntry = routeManifest.routes.find(
|
|
5472
5472
|
(entry) => entry.pattern === route.pattern
|
|
5473
5473
|
);
|
|
5474
|
-
const moduleMetadata = routeManifestEntry ||
|
|
5474
|
+
const moduleMetadata = routeManifestEntry || _chunkPA3VZNWUcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
5475
5475
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
5476
5476
|
const renderedRouteSlots = await Promise.all(
|
|
5477
5477
|
routeSlots.map(async (slot) => {
|
|
@@ -6293,7 +6293,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6293
6293
|
if (this.routeManager.matchRoute(_chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
6294
6294
|
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0,
|
|
6295
6295
|
readAppPackageIdentity(this.config.root),
|
|
6296
|
-
|
|
6296
|
+
_chunk6266WH6Xcjs.FARM_VERSION
|
|
6297
6297
|
))));
|
|
6298
6298
|
return _chunkW53Z4WDIcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
6299
6299
|
}
|
|
@@ -6387,7 +6387,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6387
6387
|
pages,
|
|
6388
6388
|
config,
|
|
6389
6389
|
rootMetadata,
|
|
6390
|
-
mcp: _optionalChain([this, 'access', _246 => _246.config, 'access', _247 => _247.agent, 'optionalAccess', _248 => _248.aiCatalog]) === false ? [] :
|
|
6390
|
+
mcp: _optionalChain([this, 'access', _246 => _246.config, 'access', _247 => _247.agent, 'optionalAccess', _248 => _248.aiCatalog]) === false ? [] : _chunkJGUMFTZTcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
6391
6391
|
basePath: this.config.basePath,
|
|
6392
6392
|
apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
6393
6393
|
_chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
|
|
@@ -7415,7 +7415,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7415
7415
|
stack: _optionalChain([diagnostics, 'optionalAccess', _329 => _329.stack]),
|
|
7416
7416
|
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _330 => _330.sourceFrame]),
|
|
7417
7417
|
development: isDev,
|
|
7418
|
-
farmVersion:
|
|
7418
|
+
farmVersion: _chunk6266WH6Xcjs.FARM_VERSION,
|
|
7419
7419
|
nodeVersion: process.version,
|
|
7420
7420
|
mode: isDev ? "development" : "production"
|
|
7421
7421
|
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/api/route-files.ts
|
|
2
|
+
function hasPolyroutePlugin(plugins) {
|
|
3
|
+
return plugins?.some((plugin) => plugin.name === "polyroute") === true;
|
|
4
|
+
}
|
|
5
|
+
function isFarmAPIRouteFileName(fileName, polyroute = false) {
|
|
6
|
+
if (polyroute && fileName === "route.rs") return true;
|
|
7
|
+
return /^route\.(?:ts|tsx|js|jsx)$/.test(fileName);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
hasPolyroutePlugin,
|
|
12
|
+
isFarmAPIRouteFileName
|
|
13
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
targetsCurrentContext
|
|
3
|
+
} from "./chunk-65LZRVCZ.mjs";
|
|
1
4
|
import {
|
|
2
5
|
invokeMutationWithRetry
|
|
3
6
|
} from "./chunk-GL3ZDHKI.mjs";
|
|
@@ -17,13 +20,15 @@ import {
|
|
|
17
20
|
normalizeStoreKeys,
|
|
18
21
|
pickStoreState,
|
|
19
22
|
resolveFarmLink
|
|
20
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-N5NRXLCX.mjs";
|
|
21
24
|
import {
|
|
22
|
-
isFarmBlockedNavigationURL,
|
|
23
25
|
isFarmLocaleChangeHref,
|
|
24
|
-
rememberFarmLinkLocale
|
|
26
|
+
rememberFarmLinkLocale
|
|
27
|
+
} from "./chunk-GGD57DJA.mjs";
|
|
28
|
+
import {
|
|
29
|
+
isFarmBlockedNavigationURL,
|
|
25
30
|
resolveFarmNavigationURL
|
|
26
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-JIGWHFA5.mjs";
|
|
27
32
|
import {
|
|
28
33
|
getFarmClientDataCache
|
|
29
34
|
} from "./chunk-C64XOPBZ.mjs";
|
|
@@ -1115,10 +1120,12 @@ function LinkInner({
|
|
|
1115
1120
|
if (event.defaultPrevented) return;
|
|
1116
1121
|
if (isExternal) return;
|
|
1117
1122
|
if (event.currentTarget.hasAttribute("download")) return;
|
|
1118
|
-
if (
|
|
1123
|
+
if (!targetsCurrentContext(event.currentTarget)) return;
|
|
1119
1124
|
if (isModifierEvent(event)) return;
|
|
1120
1125
|
if (event.button !== 0) return;
|
|
1121
1126
|
if (typeof window !== "undefined") {
|
|
1127
|
+
if (!event.currentTarget.target && window.__FARM_RSC_HYDRATED)
|
|
1128
|
+
return;
|
|
1122
1129
|
event.preventDefault();
|
|
1123
1130
|
if (isFarmLocaleChangeHref(localizedHref)) {
|
|
1124
1131
|
rememberFarmLinkLocale(event.currentTarget);
|
|
@@ -1140,7 +1147,6 @@ function LinkInner({
|
|
|
1140
1147
|
replace,
|
|
1141
1148
|
scroll,
|
|
1142
1149
|
viewTransition,
|
|
1143
|
-
target,
|
|
1144
1150
|
isExternal,
|
|
1145
1151
|
isScriptHref,
|
|
1146
1152
|
onClick
|
|
@@ -4,11 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-RSEAX5MW.mjs";
|
|
5
5
|
import {
|
|
6
6
|
_hydrateFarmI18n,
|
|
7
|
+
isFarmLocaleChangeHref
|
|
8
|
+
} from "./chunk-GGD57DJA.mjs";
|
|
9
|
+
import {
|
|
7
10
|
isFarmBlockedNavigationURL,
|
|
8
11
|
isFarmExternalNavigationURL,
|
|
9
|
-
|
|
12
|
+
isFarmSameDocumentFragment,
|
|
10
13
|
resolveFarmNavigationURL
|
|
11
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JIGWHFA5.mjs";
|
|
12
15
|
import {
|
|
13
16
|
createClientCancellation
|
|
14
17
|
} from "./chunk-H227LYHT.mjs";
|
|
@@ -468,6 +471,7 @@ var SPARouter = class {
|
|
|
468
471
|
if (isFarmLocaleChangeHref(href)) return;
|
|
469
472
|
const url = resolveFarmNavigationURL(href, window.location.href);
|
|
470
473
|
if (isFarmExternalNavigationURL(url, window.location.origin)) return;
|
|
474
|
+
if (isFarmSameDocumentFragment(url.href, window.location.href)) return;
|
|
471
475
|
if (this.options.shouldUseDocumentNavigation(url.pathname)) return;
|
|
472
476
|
const fullPath = url.pathname + url.search;
|
|
473
477
|
const interceptFrom = window.location.pathname + window.location.search;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }// src/client/link-navigation.ts
|
|
2
|
+
function targetsCurrentContext(anchor) {
|
|
3
|
+
const target = anchor.target || _optionalChain([anchor, 'access', _ => _.ownerDocument, 'access', _2 => _2.querySelector, 'call', _3 => _3("base[target]"), 'optionalAccess', _4 => _4.target]);
|
|
4
|
+
return !target || target === "_self";
|
|
5
|
+
}
|
|
6
|
+
function readFarmLinkNavigateOptions(anchor) {
|
|
7
|
+
const viewTransition = anchor.getAttribute("data-view-transition");
|
|
8
|
+
return {
|
|
9
|
+
replace: anchor.hasAttribute("data-replace"),
|
|
10
|
+
scroll: !anchor.hasAttribute("data-no-scroll"),
|
|
11
|
+
viewTransition: viewTransition === "auto" ? "auto" : viewTransition === "true"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.targetsCurrentContext = targetsCurrentContext; exports.readFarmLinkNavigateOptions = readFarmLinkNavigateOptions;
|