@farm.js/core 0.1.85 → 0.1.86
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-R6KNJ6IO.mjs → analyzer-I5S5YKHM.mjs} +2 -2
- package/dist/analyzer-OEMQSLYT.cjs +17 -0
- package/dist/{chunk-3HWNYLQV.cjs → chunk-2NKNP4AH.cjs} +1 -1
- package/dist/{chunk-X7RSOEMQ.mjs → chunk-3TKGMIPX.mjs} +7 -7
- package/dist/{chunk-GFVPQ25Z.mjs → chunk-45ANSCTO.mjs} +12 -12
- package/dist/{chunk-MYSH5Y4E.mjs → chunk-4IE3YK7U.mjs} +1 -1
- package/dist/{chunk-CWUQBECF.mjs → chunk-4SJ22WTT.mjs} +1 -1
- package/dist/{chunk-PQR5A7R2.mjs → chunk-7UTRNV6R.mjs} +1 -1
- package/dist/{chunk-RVJQHQCG.cjs → chunk-BAD6T5NU.cjs} +4 -4
- package/dist/{chunk-HKJIUZS5.cjs → chunk-BLZCAFGJ.cjs} +2 -2
- package/dist/{chunk-YS647ASS.mjs → chunk-CFKAYV7B.mjs} +1 -1
- package/dist/{chunk-MAPHNGTF.cjs → chunk-CPSFDQKJ.cjs} +3 -3
- package/dist/{chunk-YX532KEF.mjs → chunk-CVKTYG4L.mjs} +2 -2
- package/dist/{chunk-BBX4RPOV.cjs → chunk-FDU4Q4QP.cjs} +7 -7
- package/dist/{chunk-UEQC4ZLP.cjs → chunk-FWLXYNWA.cjs} +164 -164
- package/dist/{chunk-XIXAUXV3.mjs → chunk-GWPANDW3.mjs} +1 -1
- package/dist/{chunk-BCCCPFHQ.mjs → chunk-HV6CYSMF.mjs} +3 -0
- package/dist/{chunk-WYTK7HQS.cjs → chunk-IAERD73G.cjs} +155 -155
- package/dist/{chunk-4QCMTIBM.mjs → chunk-KHIEGVG7.mjs} +1 -1
- package/dist/{chunk-7TPLDPNC.cjs → chunk-L2IULWKV.cjs} +9 -9
- package/dist/{chunk-BZN5HX7Y.cjs → chunk-NXOZRI3B.cjs} +2 -2
- package/dist/{chunk-H6C45DCF.cjs → chunk-P253SZJF.cjs} +93 -93
- package/dist/{chunk-Z3LOPHSO.mjs → chunk-PAENAKTC.mjs} +1 -1
- package/dist/{chunk-Q7GB3I4O.cjs → chunk-Q3YWQEUS.cjs} +2 -2
- package/dist/{chunk-OYM6VJEF.cjs → chunk-QYDGIXQ5.cjs} +137 -88
- package/dist/{chunk-U6HUVY5R.mjs → chunk-QYWP5KDY.mjs} +10 -10
- package/dist/{chunk-2DMOB6BH.mjs → chunk-RA5OUXOJ.mjs} +2 -2
- package/dist/{chunk-3TCFONUE.mjs → chunk-SB74WCKC.mjs} +57 -8
- package/dist/{chunk-3OKSEJ33.cjs → chunk-T7UC2ORA.cjs} +3 -0
- package/dist/{chunk-TOUC6BR3.cjs → chunk-TQJ35BBW.cjs} +4 -4
- package/dist/{chunk-CDZ55QRD.mjs → chunk-UAQQUQWE.mjs} +1 -1
- package/dist/{chunk-QUHDVJMR.cjs → chunk-UDWBTABT.cjs} +3 -3
- package/dist/{chunk-F7JVO3OZ.cjs → chunk-VGZIIOU6.cjs} +4 -4
- package/dist/{chunk-RQ6XX5IN.mjs → chunk-VTEAUQMT.mjs} +1 -1
- package/dist/{chunk-L3BSHASB.cjs → chunk-XMVZXZ32.cjs} +4 -4
- package/dist/{chunk-J7VIXTPQ.mjs → chunk-YMAE32O7.mjs} +1 -1
- package/dist/{chunk-L5HDCDFT.mjs → chunk-YNPVG2GG.mjs} +1 -1
- package/dist/{chunk-GLNVLCUH.cjs → chunk-ZSVFI7JM.cjs} +6 -6
- package/dist/{devtools-SXL5RFE5.cjs → devtools-A3L7WNTB.cjs} +4 -4
- package/dist/{devtools-34ZQWX3M.mjs → devtools-DGC2247E.mjs} +2 -2
- package/dist/docs.cjs +4 -4
- package/dist/docs.mjs +3 -3
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/index.cjs +17 -17
- package/dist/index.mjs +16 -16
- package/dist/internal/build-runtime.cjs +18 -18
- package/dist/internal/build-runtime.mjs +17 -17
- package/dist/internal/cli-runtime.cjs +6 -6
- package/dist/internal/cli-runtime.mjs +5 -5
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- 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/plugin.cjs +13 -13
- package/dist/plugin.mjs +12 -12
- package/dist/renderer.cjs +3 -3
- package/dist/renderer.d.mts +10 -2
- package/dist/renderer.d.ts +10 -2
- package/dist/renderer.mjs +2 -2
- package/dist/{rsc-pipeline-MW2V3WEE.mjs → rsc-pipeline-BROS3NEB.mjs} +4 -4
- package/dist/{rsc-pipeline-ESPGX4VX.cjs → rsc-pipeline-SNGPAXGW.cjs} +5 -5
- package/dist/{runtime-FCMLEBTX.cjs → runtime-7T5TRAWL.cjs} +9 -9
- package/dist/{runtime-KGSOEMLT.mjs → runtime-SLJLW37A.mjs} +4 -4
- package/dist/server.cjs +38 -38
- package/dist/server.mjs +14 -14
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +13 -13
- package/dist/vite.mjs +12 -12
- package/package.json +1 -1
- package/dist/analyzer-XVY76XMM.cjs +0 -17
|
@@ -9,13 +9,13 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkXMVZXZ32cjs = require('./chunk-XMVZXZ32.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkZSVFI7JMcjs = require('./chunk-ZSVFI7JM.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkVGZIIOU6cjs = require('./chunk-VGZIIOU6.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
@@ -59,7 +59,7 @@ var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
|
59
59
|
var _chunk4B6YJ5DScjs = require('./chunk-4B6YJ5DS.cjs');
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
var
|
|
62
|
+
var _chunkTQJ35BBWcjs = require('./chunk-TQJ35BBW.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 _chunkQYDGIXQ5cjs = require('./chunk-QYDGIXQ5.cjs');
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
@@ -165,7 +165,7 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
165
165
|
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
var
|
|
168
|
+
var _chunkT7UC2ORAcjs = require('./chunk-T7UC2ORA.cjs');
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
@@ -306,7 +306,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
306
306
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
307
307
|
|
|
308
308
|
|
|
309
|
-
var
|
|
309
|
+
var _chunk2NKNP4AHcjs = require('./chunk-2NKNP4AH.cjs');
|
|
310
310
|
|
|
311
311
|
|
|
312
312
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -507,7 +507,7 @@ var RouteManager = class _RouteManager {
|
|
|
507
507
|
this.redirects = /* @__PURE__ */ new Map();
|
|
508
508
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
509
509
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
510
|
-
this.programmaticClientRoutes =
|
|
510
|
+
this.programmaticClientRoutes = _chunkQYDGIXQ5cjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
511
511
|
// The hydration settings each route rule returned, by file.
|
|
512
512
|
this.rendererRouteHydration = /* @__PURE__ */ new Map();
|
|
513
513
|
this.disposeRendererHydration = () => {
|
|
@@ -596,7 +596,7 @@ var RouteManager = class _RouteManager {
|
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
this.disposeRendererHydration =
|
|
599
|
+
this.disposeRendererHydration = _chunkQYDGIXQ5cjs.setFarmRendererHydrationScope.call(void 0,
|
|
600
600
|
_chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, this.config).map((source) => source.root),
|
|
601
601
|
renderer,
|
|
602
602
|
routeModules
|
|
@@ -632,7 +632,7 @@ var RouteManager = class _RouteManager {
|
|
|
632
632
|
await this.discoverFileRoutes(source);
|
|
633
633
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
634
634
|
}
|
|
635
|
-
this.programmaticClientRoutes =
|
|
635
|
+
this.programmaticClientRoutes = _chunkQYDGIXQ5cjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
636
636
|
for (const slot of this.routeSlots.values()) {
|
|
637
637
|
if (slot.interception && !this.pageRouteShapes.has(_chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
638
638
|
throw new (0, _chunkML4TOUZPcjs.AmbiguousRouteError)(
|
|
@@ -925,11 +925,11 @@ var RouteManager = class _RouteManager {
|
|
|
925
925
|
return this.clientManifestCache.manifest;
|
|
926
926
|
}
|
|
927
927
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
928
|
-
const compute = () =>
|
|
928
|
+
const compute = () => _chunkQYDGIXQ5cjs.withFarmSourceSnapshot.call(void 0,
|
|
929
929
|
() => this.computeClientManifest(normalizedProjectRoot),
|
|
930
930
|
this.sourceSnapshot
|
|
931
931
|
);
|
|
932
|
-
return cacheFile ?
|
|
932
|
+
return cacheFile ? _chunkQYDGIXQ5cjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
|
|
933
933
|
}
|
|
934
934
|
/**
|
|
935
935
|
* @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
|
|
@@ -938,7 +938,7 @@ var RouteManager = class _RouteManager {
|
|
|
938
938
|
*/
|
|
939
939
|
trackSourceChanges() {
|
|
940
940
|
this.sourceChangeTracking = true;
|
|
941
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
941
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkQYDGIXQ5cjs.FarmSourceSnapshotStore)())));
|
|
942
942
|
}
|
|
943
943
|
/**
|
|
944
944
|
* @internal A production build edits no source while it runs, so what the plan reads, parses and
|
|
@@ -947,7 +947,7 @@ var RouteManager = class _RouteManager {
|
|
|
947
947
|
*/
|
|
948
948
|
keepBuildSourceSnapshot() {
|
|
949
949
|
if (this.sourceChangeTracking) return;
|
|
950
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
950
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkQYDGIXQ5cjs.FarmSourceSnapshotStore)(false))));
|
|
951
951
|
}
|
|
952
952
|
/**
|
|
953
953
|
* @internal Hands the snapshot keepBuildSourceSnapshot kept to the build, which clears it once
|
|
@@ -990,7 +990,7 @@ var RouteManager = class _RouteManager {
|
|
|
990
990
|
return false;
|
|
991
991
|
}
|
|
992
992
|
const previous = _optionalChain([this, 'access', _18 => _18.sourceSnapshot, 'optionalAccess', _19 => _19.peekSource, 'call', _20 => _20(path4.default.resolve(file))]);
|
|
993
|
-
return previous !== void 0 &&
|
|
993
|
+
return previous !== void 0 && _chunkQYDGIXQ5cjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
|
|
994
994
|
}
|
|
995
995
|
/**
|
|
996
996
|
* A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
|
|
@@ -1001,7 +1001,7 @@ var RouteManager = class _RouteManager {
|
|
|
1001
1001
|
if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
|
|
1002
1002
|
return { ...previous.plan };
|
|
1003
1003
|
}
|
|
1004
|
-
const { result, files } =
|
|
1004
|
+
const { result, files } = _chunkQYDGIXQ5cjs.traceFarmSourceReads.call(void 0, compute);
|
|
1005
1005
|
const sources = /* @__PURE__ */ new Set();
|
|
1006
1006
|
for (const file of files) {
|
|
1007
1007
|
const source = this.planSourcePath(file);
|
|
@@ -1009,7 +1009,7 @@ var RouteManager = class _RouteManager {
|
|
|
1009
1009
|
}
|
|
1010
1010
|
if (!this.sourceChangeTracking) {
|
|
1011
1011
|
for (const source of sources) {
|
|
1012
|
-
if (!this.planStamps.has(source)) this.planStamps.set(source,
|
|
1012
|
+
if (!this.planStamps.has(source)) this.planStamps.set(source, _chunkQYDGIXQ5cjs.getFarmSourceStamp.call(void 0, source));
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
1015
|
this.ownerPlans.set(key, { plan: result, files: sources, planKey });
|
|
@@ -1029,7 +1029,7 @@ var RouteManager = class _RouteManager {
|
|
|
1029
1029
|
const isUnchanged = (file) => {
|
|
1030
1030
|
let result = unchanged.get(file);
|
|
1031
1031
|
if (result === void 0) {
|
|
1032
|
-
result = this.planStamps.get(file) ===
|
|
1032
|
+
result = this.planStamps.get(file) === _chunkQYDGIXQ5cjs.getFarmSourceStamp.call(void 0, file);
|
|
1033
1033
|
unchanged.set(file, result);
|
|
1034
1034
|
}
|
|
1035
1035
|
return result;
|
|
@@ -1076,7 +1076,7 @@ var RouteManager = class _RouteManager {
|
|
|
1076
1076
|
*/
|
|
1077
1077
|
inspectPackages(operation) {
|
|
1078
1078
|
const file = this.packageClientBoundaryCacheFile;
|
|
1079
|
-
return file ?
|
|
1079
|
+
return file ? _chunkQYDGIXQ5cjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
|
|
1080
1080
|
}
|
|
1081
1081
|
computeClientManifest(normalizedProjectRoot) {
|
|
1082
1082
|
const toUrlPath = (absolutePath) => {
|
|
@@ -1094,29 +1094,29 @@ var RouteManager = class _RouteManager {
|
|
|
1094
1094
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
1095
1095
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
1096
1096
|
);
|
|
1097
|
-
if (_optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.isolatedClientHydration]) === "enabled" &&
|
|
1097
|
+
if (_optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.isolatedClientHydration]) === "enabled" && _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _24 => _24.config, 'access', _25 => _25.experimental, 'optionalAccess', _26 => _26.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
1098
1098
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
1099
1099
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
1100
1100
|
);
|
|
1101
1101
|
}
|
|
1102
|
-
const isolatedMode =
|
|
1102
|
+
const isolatedMode = _chunkQYDGIXQ5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
1103
1103
|
_optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.isolatedClientHydration]),
|
|
1104
1104
|
{
|
|
1105
|
-
serverComponents:
|
|
1105
|
+
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _30 => _30.config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.serverComponents])) === "rsc",
|
|
1106
1106
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
1107
1107
|
}
|
|
1108
1108
|
);
|
|
1109
|
-
const planOptions =
|
|
1109
|
+
const planOptions = _chunkQYDGIXQ5cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
1110
1110
|
this.config.renderer,
|
|
1111
1111
|
Boolean(unsupportedIntegrationProvider)
|
|
1112
1112
|
);
|
|
1113
|
-
const islandsMode =
|
|
1113
|
+
const islandsMode = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _33 => _33.config, 'access', _34 => _34.experimental, 'optionalAccess', _35 => _35.serverComponents])) === "islands";
|
|
1114
1114
|
const changed = _optionalChain([this, 'access', _36 => _36.sourceSnapshot, 'optionalAccess', _37 => _37.refresh, 'call', _38 => _38(_nullishCoalesce(this.editedSources, () => ( [])))]);
|
|
1115
1115
|
let edited = null;
|
|
1116
1116
|
if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
|
|
1117
1117
|
edited = /* @__PURE__ */ new Set();
|
|
1118
1118
|
for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
|
|
1119
|
-
if (
|
|
1119
|
+
if (_chunkQYDGIXQ5cjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
|
|
1120
1120
|
const source = this.planSourcePath(file);
|
|
1121
1121
|
if (source) edited.add(source);
|
|
1122
1122
|
}
|
|
@@ -1131,13 +1131,13 @@ var RouteManager = class _RouteManager {
|
|
|
1131
1131
|
metadata: this.planRouteModule(
|
|
1132
1132
|
`layout:${entry.modulePath}`,
|
|
1133
1133
|
edited,
|
|
1134
|
-
() =>
|
|
1134
|
+
() => _chunkQYDGIXQ5cjs.getClientModuleHydrationPlan.call(void 0,
|
|
1135
1135
|
entry.modulePath,
|
|
1136
1136
|
normalizedProjectRoot,
|
|
1137
1137
|
isolatedMode,
|
|
1138
1138
|
layoutPlanOptions
|
|
1139
1139
|
),
|
|
1140
|
-
|
|
1140
|
+
_chunkQYDGIXQ5cjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1141
1141
|
entry.modulePath,
|
|
1142
1142
|
normalizedProjectRoot,
|
|
1143
1143
|
isolatedMode,
|
|
@@ -1145,7 +1145,7 @@ var RouteManager = class _RouteManager {
|
|
|
1145
1145
|
)
|
|
1146
1146
|
)
|
|
1147
1147
|
}));
|
|
1148
|
-
const markdownComponentsPlan =
|
|
1148
|
+
const markdownComponentsPlan = _chunkQYDGIXQ5cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
1149
1149
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
1150
1150
|
normalizedProjectRoot,
|
|
1151
1151
|
isolatedMode,
|
|
@@ -1161,13 +1161,13 @@ var RouteManager = class _RouteManager {
|
|
|
1161
1161
|
metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
|
|
1162
1162
|
`page:${entry.modulePath}`,
|
|
1163
1163
|
edited,
|
|
1164
|
-
() =>
|
|
1164
|
+
() => _chunkQYDGIXQ5cjs.getClientModuleHydrationPlan.call(void 0,
|
|
1165
1165
|
entry.modulePath,
|
|
1166
1166
|
normalizedProjectRoot,
|
|
1167
1167
|
isolatedMode,
|
|
1168
1168
|
pagePlanOptions
|
|
1169
1169
|
),
|
|
1170
|
-
|
|
1170
|
+
_chunkQYDGIXQ5cjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1171
1171
|
entry.modulePath,
|
|
1172
1172
|
normalizedProjectRoot,
|
|
1173
1173
|
isolatedMode,
|
|
@@ -1197,7 +1197,7 @@ var RouteManager = class _RouteManager {
|
|
|
1197
1197
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1198
1198
|
);
|
|
1199
1199
|
}
|
|
1200
|
-
|
|
1200
|
+
_chunkQYDGIXQ5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
1201
1201
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1202
1202
|
pattern: entry.pattern,
|
|
1203
1203
|
depth: _chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
@@ -1244,7 +1244,7 @@ var RouteManager = class _RouteManager {
|
|
|
1244
1244
|
modulePath: toUrlPath(boundary.modulePath)
|
|
1245
1245
|
}))
|
|
1246
1246
|
} : {},
|
|
1247
|
-
...
|
|
1247
|
+
..._chunkQYDGIXQ5cjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
1248
1248
|
renderPlan: _chunk4B6YJ5DScjs.createFarmRouteRenderPlan.call(void 0, {
|
|
1249
1249
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
1250
1250
|
layoutShouldHydrate,
|
|
@@ -1286,7 +1286,7 @@ var RouteManager = class _RouteManager {
|
|
|
1286
1286
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
1287
1287
|
}));
|
|
1288
1288
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
1289
|
-
const metadata =
|
|
1289
|
+
const metadata = _chunkQYDGIXQ5cjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
1290
1290
|
return {
|
|
1291
1291
|
name: entry.name,
|
|
1292
1292
|
ownerPattern: entry.ownerPattern,
|
|
@@ -1302,7 +1302,7 @@ var RouteManager = class _RouteManager {
|
|
|
1302
1302
|
};
|
|
1303
1303
|
});
|
|
1304
1304
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
1305
|
-
metadata:
|
|
1305
|
+
metadata: _chunkQYDGIXQ5cjs.getClientModuleHydrationPlan.call(void 0,
|
|
1306
1306
|
entry.modulePath,
|
|
1307
1307
|
normalizedProjectRoot,
|
|
1308
1308
|
isolatedMode,
|
|
@@ -1404,7 +1404,7 @@ var RouteManager = class _RouteManager {
|
|
|
1404
1404
|
loadModule: viteServer ? (componentModulePath) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
|
|
1405
1405
|
}),
|
|
1406
1406
|
config: mdxConfig,
|
|
1407
|
-
renderer:
|
|
1407
|
+
renderer: _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
|
|
1408
1408
|
});
|
|
1409
1409
|
}
|
|
1410
1410
|
if (this.viteServer) {
|
|
@@ -1471,11 +1471,11 @@ var RouteManager = class _RouteManager {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
async discoverFileRoutes(source) {
|
|
1473
1473
|
const appDir = _chunk7U4XF76Rcjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
|
|
1474
|
-
const componentExtensions =
|
|
1474
|
+
const componentExtensions = _chunkT7UC2ORAcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
|
|
1475
1475
|
(extension) => extension.slice(1)
|
|
1476
1476
|
);
|
|
1477
1477
|
const componentGlob = componentExtensions.join(",");
|
|
1478
|
-
const rendererRoutes = await
|
|
1478
|
+
const rendererRoutes = await _chunkZSVFI7JMcjs.resolveFarmRendererRoutes.call(void 0, {
|
|
1479
1479
|
renderer: this.config.renderer,
|
|
1480
1480
|
root: source.root,
|
|
1481
1481
|
srcDir: source.srcDir
|
|
@@ -1677,11 +1677,11 @@ var RouteManager = class _RouteManager {
|
|
|
1677
1677
|
srcDir: source.srcDir,
|
|
1678
1678
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1679
1679
|
});
|
|
1680
|
-
const graph = this.viteServer ?
|
|
1680
|
+
const graph = this.viteServer ? _chunkQYDGIXQ5cjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1681
1681
|
for (const { filePath, manifest } of manifests) {
|
|
1682
1682
|
if (graph) {
|
|
1683
1683
|
clientRoutes.push(
|
|
1684
|
-
|
|
1684
|
+
_chunkQYDGIXQ5cjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1685
1685
|
graph,
|
|
1686
1686
|
routesFile: toRealPath(filePath),
|
|
1687
1687
|
routes: manifest.routes,
|
|
@@ -1895,7 +1895,7 @@ var RouteManager = class _RouteManager {
|
|
|
1895
1895
|
}));
|
|
1896
1896
|
const i18n = this.getI18nConfig();
|
|
1897
1897
|
const docsAdapterRoutes = this.getDocsAdapterRoutes();
|
|
1898
|
-
const result = await
|
|
1898
|
+
const result = await _chunkXMVZXZ32cjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
1899
1899
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
|
|
1900
1900
|
...docsAdapterRoutes ? { docsAdapterRoutes } : {}
|
|
1901
1901
|
});
|
|
@@ -1942,7 +1942,7 @@ var RouteManager = class _RouteManager {
|
|
|
1942
1942
|
async isRouteSSG(modulePath) {
|
|
1943
1943
|
try {
|
|
1944
1944
|
const mod = await this.loadRouteModule(modulePath);
|
|
1945
|
-
const rendering = await
|
|
1945
|
+
const rendering = await _chunkXMVZXZ32cjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1946
1946
|
return rendering.ssg;
|
|
1947
1947
|
} catch (e2) {
|
|
1948
1948
|
return false;
|
|
@@ -1954,7 +1954,7 @@ var RouteManager = class _RouteManager {
|
|
|
1954
1954
|
async hasRouteISR(modulePath) {
|
|
1955
1955
|
try {
|
|
1956
1956
|
const mod = await this.loadRouteModule(modulePath);
|
|
1957
|
-
const rendering = await
|
|
1957
|
+
const rendering = await _chunkXMVZXZ32cjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1958
1958
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
1959
1959
|
} catch (e3) {
|
|
1960
1960
|
return false;
|
|
@@ -1966,7 +1966,7 @@ var RouteManager = class _RouteManager {
|
|
|
1966
1966
|
async getRouteRevalidateInterval(modulePath) {
|
|
1967
1967
|
try {
|
|
1968
1968
|
const mod = await this.loadRouteModule(modulePath);
|
|
1969
|
-
const rendering = await
|
|
1969
|
+
const rendering = await _chunkXMVZXZ32cjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1970
1970
|
return rendering.revalidate;
|
|
1971
1971
|
} catch (e4) {
|
|
1972
1972
|
return void 0;
|
|
@@ -3264,13 +3264,13 @@ function resolveProviderModule(moduleId, root) {
|
|
|
3264
3264
|
|
|
3265
3265
|
// src/server-actions-mode.ts
|
|
3266
3266
|
function resolveFarmIslxActionsMode(config) {
|
|
3267
|
-
if (
|
|
3267
|
+
if (_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _68 => _68.experimental, 'optionalAccess', _69 => _69.serverComponents])) === "islands") {
|
|
3268
3268
|
return "islands";
|
|
3269
3269
|
}
|
|
3270
3270
|
if (_optionalChain([config, 'access', _70 => _70.experimental, 'optionalAccess', _71 => _71.serverActions]) !== true) return null;
|
|
3271
3271
|
const renderer = config.renderer;
|
|
3272
3272
|
if (renderer === void 0 || renderer === false) return null;
|
|
3273
|
-
if (
|
|
3273
|
+
if (_chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, renderer) || _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer)) return null;
|
|
3274
3274
|
return "renderer";
|
|
3275
3275
|
}
|
|
3276
3276
|
function farmBrowserServerFnsEnabled(config) {
|
|
@@ -3317,7 +3317,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
3317
3317
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
3318
3318
|
parse: parseFarmIslandSource,
|
|
3319
3319
|
resolve: (specifier, importer) => {
|
|
3320
|
-
const resolved =
|
|
3320
|
+
const resolved = _chunkQYDGIXQ5cjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
3321
3321
|
return resolved.local ? resolved.path : null;
|
|
3322
3322
|
}
|
|
3323
3323
|
});
|
|
@@ -3337,7 +3337,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
3337
3337
|
if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
|
|
3338
3338
|
return cached.result;
|
|
3339
3339
|
}
|
|
3340
|
-
const { result, files } =
|
|
3340
|
+
const { result, files } = _chunkQYDGIXQ5cjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
|
|
3341
3341
|
const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
|
|
3342
3342
|
routeRootInferences.set(key, {
|
|
3343
3343
|
stamps: [...read].map((file) => [file, modifiedAt(file)]),
|
|
@@ -3354,7 +3354,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3354
3354
|
const files = [];
|
|
3355
3355
|
const modules = [];
|
|
3356
3356
|
for (const owner of owners) {
|
|
3357
|
-
const rendered =
|
|
3357
|
+
const rendered = _chunkQYDGIXQ5cjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
3358
3358
|
if (!rendered) {
|
|
3359
3359
|
return {
|
|
3360
3360
|
strategy: null,
|
|
@@ -3370,7 +3370,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3370
3370
|
source = fs2.default.readFileSync(module, "utf8");
|
|
3371
3371
|
} catch (e11) {
|
|
3372
3372
|
}
|
|
3373
|
-
if (
|
|
3373
|
+
if (_chunkQYDGIXQ5cjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
3374
3374
|
}
|
|
3375
3375
|
for (const module of modules) {
|
|
3376
3376
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -3414,7 +3414,7 @@ var _stream = require('stream');
|
|
|
3414
3414
|
|
|
3415
3415
|
|
|
3416
3416
|
function resolveFarmNotFoundComponentPath(config, appDirs, discovered) {
|
|
3417
|
-
const extensions =
|
|
3417
|
+
const extensions = _chunkT7UC2ORAcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
|
|
3418
3418
|
const configuredPath = _optionalChain([config, 'access', _74 => _74.notFound, 'optionalAccess', _75 => _75.component, 'optionalAccess', _76 => _76.trim, 'call', _77 => _77()]);
|
|
3419
3419
|
if (configuredPath) {
|
|
3420
3420
|
const componentPath = path4.default.isAbsolute(configuredPath) ? path4.default.normalize(configuredPath) : path4.default.resolve(config.root, configuredPath);
|
|
@@ -3713,7 +3713,7 @@ function createDefaultErrorDiagnostics(error, root) {
|
|
|
3713
3713
|
function canBootFarmIslandsClient(config) {
|
|
3714
3714
|
const docs = config.docs;
|
|
3715
3715
|
const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
|
|
3716
|
-
return
|
|
3716
|
+
return _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _78 => _78.experimental, 'optionalAccess', _79 => _79.serverComponents])) === "islands" && !docsEnabled && _chunkDMSXZNQRcjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkDMSXZNQRcjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
|
|
3717
3717
|
}
|
|
3718
3718
|
|
|
3719
3719
|
// src/islands-kept-layouts.ts
|
|
@@ -3761,7 +3761,7 @@ var DECLARATION_STATEMENTS = /* @__PURE__ */ new Set([
|
|
|
3761
3761
|
function parse(code, file) {
|
|
3762
3762
|
const extension = path4.default.extname(file).slice(1);
|
|
3763
3763
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" ? "jsx" : "tsx";
|
|
3764
|
-
return
|
|
3764
|
+
return _chunkQYDGIXQ5cjs.memoizeInFarmSourceSnapshot.call(void 0, `ast:${lang}`, code, () => {
|
|
3765
3765
|
try {
|
|
3766
3766
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
3767
3767
|
} catch (e14) {
|
|
@@ -3896,14 +3896,14 @@ function isReference(node, parent, key) {
|
|
|
3896
3896
|
}
|
|
3897
3897
|
function readSource(file) {
|
|
3898
3898
|
try {
|
|
3899
|
-
|
|
3899
|
+
_chunkQYDGIXQ5cjs.noteFarmSourceRead.call(void 0, file);
|
|
3900
3900
|
return fs2.default.readFileSync(file, "utf8");
|
|
3901
3901
|
} catch (e15) {
|
|
3902
3902
|
return null;
|
|
3903
3903
|
}
|
|
3904
3904
|
}
|
|
3905
3905
|
function explainFarmKeptLayoutRender(modulePath, root) {
|
|
3906
|
-
const entry =
|
|
3906
|
+
const entry = _chunkQYDGIXQ5cjs.resolveModuleSourcePath.call(void 0, modulePath, root);
|
|
3907
3907
|
if (!entry) return `${modulePath} does not resolve`;
|
|
3908
3908
|
const visited = /* @__PURE__ */ new Set();
|
|
3909
3909
|
const check = (file) => {
|
|
@@ -3913,7 +3913,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3913
3913
|
if (!SCRIPT_SOURCE.test(file)) return `${path4.default.relative(root, file)} is not a script`;
|
|
3914
3914
|
const code = readSource(file);
|
|
3915
3915
|
if (code === null) return `${path4.default.relative(root, file)} cannot be read`;
|
|
3916
|
-
const { reason, imports } =
|
|
3916
|
+
const { reason, imports } = _chunkQYDGIXQ5cjs.memoizeInFarmSourceSnapshot.call(void 0,
|
|
3917
3917
|
"kept-layout-module",
|
|
3918
3918
|
code,
|
|
3919
3919
|
() => findFarmRequestDecidingConstruct(code, file)
|
|
@@ -3926,7 +3926,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3926
3926
|
return `${path4.default.relative(root, file)} imports ${imported.names.join(", ")} from ${imported.source}`;
|
|
3927
3927
|
}
|
|
3928
3928
|
if (ASSET_SOURCE.test(imported.source.split("?")[0])) continue;
|
|
3929
|
-
const resolved =
|
|
3929
|
+
const resolved = _chunkQYDGIXQ5cjs.resolveImportedModule.call(void 0, file, imported.source, root);
|
|
3930
3930
|
if (!resolved.path || !resolved.local) {
|
|
3931
3931
|
return `${path4.default.relative(root, file)} imports ${imported.source}`;
|
|
3932
3932
|
}
|
|
@@ -3941,15 +3941,15 @@ var answers = /* @__PURE__ */ new Map();
|
|
|
3941
3941
|
function canFarmSkipKeptLayoutRender(modulePath, root) {
|
|
3942
3942
|
const key = `${root}\0${modulePath}`;
|
|
3943
3943
|
const known = answers.get(key);
|
|
3944
|
-
if (known && known.stamps.every(([file, stamp]) =>
|
|
3944
|
+
if (known && known.stamps.every(([file, stamp]) => _chunkQYDGIXQ5cjs.getFarmSourceStamp.call(void 0, file) === stamp)) {
|
|
3945
3945
|
return known.skip;
|
|
3946
3946
|
}
|
|
3947
|
-
const { result, files } =
|
|
3947
|
+
const { result, files } = _chunkQYDGIXQ5cjs.traceFarmSourceReads.call(void 0,
|
|
3948
3948
|
() => explainFarmKeptLayoutRender(modulePath, root) === null
|
|
3949
3949
|
);
|
|
3950
3950
|
answers.set(key, {
|
|
3951
3951
|
skip: result,
|
|
3952
|
-
stamps: files.map((file) => [file,
|
|
3952
|
+
stamps: files.map((file) => [file, _chunkQYDGIXQ5cjs.getFarmSourceStamp.call(void 0, file)])
|
|
3953
3953
|
});
|
|
3954
3954
|
return result;
|
|
3955
3955
|
}
|
|
@@ -4077,7 +4077,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
4077
4077
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
4078
4078
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
4079
4079
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
4080
|
-
_chunk7U4XF76Rcjs.logger.warn(
|
|
4080
|
+
_chunk7U4XF76Rcjs.logger.warn(_chunkQYDGIXQ5cjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
4081
4081
|
}
|
|
4082
4082
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
4083
4083
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
@@ -4286,15 +4286,15 @@ var ServerRenderer = class {
|
|
|
4286
4286
|
if (_optionalChain([this, 'access', _102 => _102.config, 'access', _103 => _103.notFound, 'optionalAccess', _104 => _104.component, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()])) {
|
|
4287
4287
|
resolveFarmNotFoundComponentPath(this.config, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config));
|
|
4288
4288
|
}
|
|
4289
|
-
const loaded =
|
|
4290
|
-
|
|
4289
|
+
const loaded = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer) ? this.reactRenderer = await import("./renderer/react/server.cjs") : _chunkT7UC2ORAcjs.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,
|
|
4290
|
+
_chunkT7UC2ORAcjs.resolveFarmRendererModule.call(void 0,
|
|
4291
4291
|
this.config.root || process.cwd(),
|
|
4292
4292
|
this.config.renderer.server
|
|
4293
4293
|
)
|
|
4294
4294
|
).href);
|
|
4295
4295
|
const runtime = loaded;
|
|
4296
|
-
|
|
4297
|
-
|
|
4296
|
+
_chunkT7UC2ORAcjs.assertFarmRendererServerModule.call(void 0, runtime, this.config.renderer);
|
|
4297
|
+
_chunkT7UC2ORAcjs.assertFarmRendererStreamingRuntime.call(void 0,
|
|
4298
4298
|
this.config.renderer.name,
|
|
4299
4299
|
this.config.renderer,
|
|
4300
4300
|
runtime,
|
|
@@ -4310,7 +4310,7 @@ var ServerRenderer = class {
|
|
|
4310
4310
|
* re-applied on the next request without restarting.
|
|
4311
4311
|
*/
|
|
4312
4312
|
async applyRendererAppSetup() {
|
|
4313
|
-
const appSetupPath =
|
|
4313
|
+
const appSetupPath = _chunkT7UC2ORAcjs.resolveFarmRendererAppSetup.call(void 0,
|
|
4314
4314
|
this.config.root || process.cwd(),
|
|
4315
4315
|
this.config.renderer
|
|
4316
4316
|
);
|
|
@@ -4453,10 +4453,10 @@ var ServerRenderer = class {
|
|
|
4453
4453
|
return serverTree && this.rendererRuntime.renderServerTreePage ? this.rendererRuntime.renderServerTreePage(element, { values: false }) : this.rendererRuntime.isolateServerPageGraph(element);
|
|
4454
4454
|
}
|
|
4455
4455
|
async renderElementToCompleteHTML(element, options = {}) {
|
|
4456
|
-
const streaming =
|
|
4456
|
+
const streaming = _chunkT7UC2ORAcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
|
|
4457
4457
|
const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
|
|
4458
4458
|
if (renderToPipeableStream) {
|
|
4459
|
-
const inlineBoundaries =
|
|
4459
|
+
const inlineBoundaries = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer);
|
|
4460
4460
|
return await new Promise((resolve3, reject) => {
|
|
4461
4461
|
const chunks = [];
|
|
4462
4462
|
let shellReady = false;
|
|
@@ -4502,7 +4502,7 @@ var ServerRenderer = class {
|
|
|
4502
4502
|
element,
|
|
4503
4503
|
rendererRenderOptions()
|
|
4504
4504
|
);
|
|
4505
|
-
return await
|
|
4505
|
+
return await _chunkT7UC2ORAcjs.readFarmRendererWebStream.call(void 0, stream);
|
|
4506
4506
|
}
|
|
4507
4507
|
return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
|
|
4508
4508
|
}
|
|
@@ -4526,7 +4526,7 @@ var ServerRenderer = class {
|
|
|
4526
4526
|
}
|
|
4527
4527
|
/** Islands mode sends large prop values once, keyed by content (RFC 0003). */
|
|
4528
4528
|
islandValues() {
|
|
4529
|
-
return
|
|
4529
|
+
return _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _113 => _113.config, 'access', _114 => _114.experimental, 'optionalAccess', _115 => _115.serverComponents])) === "islands";
|
|
4530
4530
|
}
|
|
4531
4531
|
/**
|
|
4532
4532
|
* The page's element. Only React renders an async component, so for any other renderer Farm
|
|
@@ -4535,7 +4535,7 @@ var ServerRenderer = class {
|
|
|
4535
4535
|
*/
|
|
4536
4536
|
async createPageElement(PageComponent, pageProps) {
|
|
4537
4537
|
const runtime = this.rendererRuntime;
|
|
4538
|
-
if (
|
|
4538
|
+
if (_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer) || typeof PageComponent !== "function" || _optionalChain([PageComponent, 'access', _116 => _116.constructor, 'optionalAccess', _117 => _117.name]) !== "AsyncFunction") {
|
|
4539
4539
|
return runtime.createElement(PageComponent, pageProps);
|
|
4540
4540
|
}
|
|
4541
4541
|
const result = await PageComponent(pageProps);
|
|
@@ -4801,7 +4801,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4801
4801
|
* Check if a path should be served from SSG cache
|
|
4802
4802
|
*/
|
|
4803
4803
|
async shouldServeSSG(pathname) {
|
|
4804
|
-
const ssgPage =
|
|
4804
|
+
const ssgPage = _chunkXMVZXZ32cjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
4805
4805
|
if (!ssgPage) return null;
|
|
4806
4806
|
const cached = await this.getCachedSSGPage(pathname);
|
|
4807
4807
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -5301,7 +5301,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5301
5301
|
throw error;
|
|
5302
5302
|
}
|
|
5303
5303
|
}
|
|
5304
|
-
const renderingConfig = await
|
|
5304
|
+
const renderingConfig = await _chunkXMVZXZ32cjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5305
5305
|
routeModule,
|
|
5306
5306
|
route.modulePath,
|
|
5307
5307
|
{ experimentalPPR: _optionalChain([this, 'access', _153 => _153.config, 'access', _154 => _154.experimental, 'optionalAccess', _155 => _155.ppr]) === true }
|
|
@@ -5393,7 +5393,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5393
5393
|
const routeManifestEntry = routeManifest.routes.find(
|
|
5394
5394
|
(entry) => entry.pattern === route.pattern
|
|
5395
5395
|
);
|
|
5396
|
-
const moduleMetadata = routeManifestEntry ||
|
|
5396
|
+
const moduleMetadata = routeManifestEntry || _chunkQYDGIXQ5cjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
5397
5397
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
5398
5398
|
const renderedRouteSlots = await Promise.all(
|
|
5399
5399
|
routeSlots.map(async (slot) => {
|
|
@@ -5847,13 +5847,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5847
5847
|
for (let i = providers.length - 1; i >= 0; i--) {
|
|
5848
5848
|
const provider = providers[i];
|
|
5849
5849
|
if (provider.component || provider.type === "clerk") {
|
|
5850
|
-
const rendererCapabilities =
|
|
5850
|
+
const rendererCapabilities = _chunkT7UC2ORAcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
|
|
5851
5851
|
if (!rendererCapabilities.functionComponents) {
|
|
5852
5852
|
throw new Error(
|
|
5853
5853
|
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _185 => _185.config, 'access', _186 => _186.renderer, 'optionalAccess', _187 => _187.name]), () => ( "the configured renderer"))}\` cannot.`
|
|
5854
5854
|
);
|
|
5855
5855
|
}
|
|
5856
|
-
if (provider.type === "clerk" && !
|
|
5856
|
+
if (provider.type === "clerk" && !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer)) {
|
|
5857
5857
|
throw new Error(
|
|
5858
5858
|
`Integration provider \`${provider.name}\` uses Clerk's React components, which require the React renderer.`
|
|
5859
5859
|
);
|
|
@@ -5889,7 +5889,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5889
5889
|
}
|
|
5890
5890
|
if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
|
|
5891
5891
|
_nullishCoalesce(providerSourceModule, () => ( "")),
|
|
5892
|
-
|
|
5892
|
+
_chunkT7UC2ORAcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _188 => _188.config, 'access', _189 => _189.renderer, 'optionalAccess', _190 => _190.componentExtensions]))
|
|
5893
5893
|
)) {
|
|
5894
5894
|
ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
|
|
5895
5895
|
}
|
|
@@ -6215,7 +6215,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6215
6215
|
if (this.routeManager.matchRoute(_chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
6216
6216
|
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0,
|
|
6217
6217
|
readAppPackageIdentity(this.config.root),
|
|
6218
|
-
|
|
6218
|
+
_chunk2NKNP4AHcjs.FARM_VERSION
|
|
6219
6219
|
))));
|
|
6220
6220
|
return _chunkW53Z4WDIcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
6221
6221
|
}
|
|
@@ -6309,7 +6309,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6309
6309
|
pages,
|
|
6310
6310
|
config,
|
|
6311
6311
|
rootMetadata,
|
|
6312
|
-
mcp: _optionalChain([this, 'access', _242 => _242.config, 'access', _243 => _243.agent, 'optionalAccess', _244 => _244.aiCatalog]) === false ? [] :
|
|
6312
|
+
mcp: _optionalChain([this, 'access', _242 => _242.config, 'access', _243 => _243.agent, 'optionalAccess', _244 => _244.aiCatalog]) === false ? [] : _chunkTQJ35BBWcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
6313
6313
|
basePath: this.config.basePath,
|
|
6314
6314
|
apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
6315
6315
|
_chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
|
|
@@ -6416,7 +6416,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6416
6416
|
}
|
|
6417
6417
|
/** The renderer that draws a metadata image: none for React, whose elements Satori reads directly. */
|
|
6418
6418
|
getMetadataImageRenderer() {
|
|
6419
|
-
return
|
|
6419
|
+
return _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime;
|
|
6420
6420
|
}
|
|
6421
6421
|
async writeStaticMetadataImageResponse(req, res, image) {
|
|
6422
6422
|
const method = (req.method || "GET").toUpperCase();
|
|
@@ -6734,10 +6734,10 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6734
6734
|
}
|
|
6735
6735
|
async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6736
6736
|
const runtime = this.rendererRuntime;
|
|
6737
|
-
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (
|
|
6737
|
+
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (_chunkT7UC2ORAcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node").web && runtime.renderToReadableStream ? pipeFarmRendererWebStream(runtime) : void 0)));
|
|
6738
6738
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6739
6739
|
const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument(req);
|
|
6740
|
-
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _279 => _279.headers, 'optionalAccess', _280 => _280[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !
|
|
6740
|
+
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _279 => _279.headers, 'optionalAccess', _280 => _280[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, this.config.renderer))) {
|
|
6741
6741
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
6742
6742
|
}
|
|
6743
6743
|
return new Promise((resolve3, reject) => {
|
|
@@ -7242,7 +7242,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7242
7242
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7243
7243
|
trustProxy: _optionalChain([this, 'access', _306 => _306.config, 'access', _307 => _307.server, 'optionalAccess', _308 => _308.trustProxy])
|
|
7244
7244
|
}).pathname;
|
|
7245
|
-
if (
|
|
7245
|
+
if (_chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7246
7246
|
res.setHeader("Content-Type", "application/json");
|
|
7247
7247
|
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
7248
7248
|
return;
|
|
@@ -7265,7 +7265,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7265
7265
|
return;
|
|
7266
7266
|
}
|
|
7267
7267
|
const appDir = path10.join(this.config.root, this.config.srcDir, "app");
|
|
7268
|
-
const notFoundExtensions =
|
|
7268
|
+
const notFoundExtensions = _chunkT7UC2ORAcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7269
7269
|
let layoutModule = null;
|
|
7270
7270
|
const rendererRootLayout = _optionalChain([this, 'access', _309 => _309.config, 'access', _310 => _310.renderer, 'optionalAccess', _311 => _311.routes]) ? _optionalChain([this, 'access', _312 => _312.routeManager, 'access', _313 => _313.getLayouts, 'call', _314 => _314(), 'access', _315 => _315.get, 'call', _316 => _316("/"), 'optionalAccess', _317 => _317.modulePath]) : void 0;
|
|
7271
7271
|
try {
|
|
@@ -7337,7 +7337,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7337
7337
|
stack: _optionalChain([diagnostics, 'optionalAccess', _325 => _325.stack]),
|
|
7338
7338
|
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _326 => _326.sourceFrame]),
|
|
7339
7339
|
development: isDev,
|
|
7340
|
-
farmVersion:
|
|
7340
|
+
farmVersion: _chunk2NKNP4AHcjs.FARM_VERSION,
|
|
7341
7341
|
nodeVersion: process.version,
|
|
7342
7342
|
mode: isDev ? "development" : "production"
|
|
7343
7343
|
})
|
|
@@ -7527,7 +7527,7 @@ var FarmApp = class {
|
|
|
7527
7527
|
await this.serverRenderer.initialize();
|
|
7528
7528
|
await this.verifyAppStructure();
|
|
7529
7529
|
await this.routeManager.discoverRoutes();
|
|
7530
|
-
if (
|
|
7530
|
+
if (_chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) this.assertNoPageRoutes();
|
|
7531
7531
|
this.routeManager.generateClientManifest(this.config.root);
|
|
7532
7532
|
if (process.env.FARM_VERBOSE) {
|
|
7533
7533
|
_chunk7U4XF76Rcjs.logger.success("Farm.js application initialized successfully!");
|
|
@@ -7556,7 +7556,7 @@ var FarmApp = class {
|
|
|
7556
7556
|
outDir: config.outDir || "dist",
|
|
7557
7557
|
basePath,
|
|
7558
7558
|
trailingSlash: _nullishCoalesce(config.trailingSlash, () => ( false)),
|
|
7559
|
-
renderer:
|
|
7559
|
+
renderer: _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, config.renderer),
|
|
7560
7560
|
preset: _nullishCoalesce(config.preset, () => ( "node-server")),
|
|
7561
7561
|
deploy: config.deploy || {},
|
|
7562
7562
|
storage: config.storage || {},
|
|
@@ -7577,7 +7577,7 @@ var FarmApp = class {
|
|
|
7577
7577
|
security: _chunk6JHZPB52cjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7578
7578
|
images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
|
|
7579
7579
|
config.images,
|
|
7580
|
-
|
|
7580
|
+
_chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
|
|
7581
7581
|
),
|
|
7582
7582
|
performance: _chunkEACD6ND7cjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7583
7583
|
theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
@@ -7647,14 +7647,14 @@ var FarmApp = class {
|
|
|
7647
7647
|
`App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
|
|
7648
7648
|
);
|
|
7649
7649
|
}
|
|
7650
|
-
const componentExtensions =
|
|
7650
|
+
const componentExtensions = _chunkT7UC2ORAcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7651
7651
|
const rootLayoutPaths = appDirs.flatMap(
|
|
7652
7652
|
(appDir) => componentExtensions.map((extension) => path4.default.join(appDir, `layout${extension}`))
|
|
7653
7653
|
);
|
|
7654
7654
|
const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunk7U4XF76Rcjs.fileExists.call(void 0, p))).then(
|
|
7655
7655
|
(results) => results.some(Boolean)
|
|
7656
7656
|
);
|
|
7657
|
-
if (!hasRootLayout && !
|
|
7657
|
+
if (!hasRootLayout && !_chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7658
7658
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
7659
7659
|
`No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
|
|
7660
7660
|
);
|
|
@@ -8565,7 +8565,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
|
|
|
8565
8565
|
function isInstalledPackage(root, specifier) {
|
|
8566
8566
|
const parts = specifier.split("/");
|
|
8567
8567
|
const name = specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
|
|
8568
|
-
const directory =
|
|
8568
|
+
const directory = _chunkVGZIIOU6cjs.findFarmAppPackageDir.call(void 0, root, name);
|
|
8569
8569
|
return directory !== void 0 && directory.split(path4.default.sep).includes("node_modules");
|
|
8570
8570
|
}
|
|
8571
8571
|
function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
@@ -8578,9 +8578,9 @@ function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
|
8578
8578
|
// React entry imports `react-dom/client` instead, which is already listed. A linked
|
|
8579
8579
|
// renderer stays source: pre-bundling it would copy the packages it shares with the app's
|
|
8580
8580
|
// components into the bundle, so a hook would read a different copy than the renderer set.
|
|
8581
|
-
...renderer && root && !
|
|
8581
|
+
...renderer && root && !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) && _chunkPWDBWXQIcjs.isPackageSpecifier.call(void 0, renderer.client) && isInstalledPackage(root, renderer.client) ? [renderer.client] : [],
|
|
8582
8582
|
// The islands runtime of a renderer that declares `islands`, which only Farm's entry imports.
|
|
8583
|
-
...renderer && !
|
|
8583
|
+
...renderer && !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) && _chunkT7UC2ORAcjs.getFarmRendererCapabilities.call(void 0, renderer).islands ? [
|
|
8584
8584
|
"@farm.js/core/internal/renderer-islands",
|
|
8585
8585
|
"@farm.js/core > @farm.js/islx/islands/client"
|
|
8586
8586
|
] : []
|
|
@@ -8596,7 +8596,7 @@ function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
|
8596
8596
|
});
|
|
8597
8597
|
}
|
|
8598
8598
|
function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
8599
|
-
if (
|
|
8599
|
+
if (_chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, renderer)) return { noDiscovery: true, include: [] };
|
|
8600
8600
|
const jsxImportSource = renderer ? renderer.jsxImportSource : void 0;
|
|
8601
8601
|
return {
|
|
8602
8602
|
// Keep normal application dependency discovery for CJS-only packages, but
|