@farm.js/core 0.1.83 → 0.1.84
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-Y6IY26HI.mjs → analyzer-7RNO3XKC.mjs} +2 -2
- package/dist/analyzer-PFKA5NI6.cjs +17 -0
- package/dist/{chunk-WCSBYQOT.cjs → chunk-22BTYPIX.cjs} +4 -4
- package/dist/{chunk-NGTZHWBG.cjs → chunk-3OKSEJ33.cjs} +31 -10
- package/dist/{chunk-VQ6IXALL.mjs → chunk-3WM7VBGW.mjs} +2 -2
- package/dist/{chunk-IABI62FH.cjs → chunk-57EEWWUS.cjs} +2 -2
- package/dist/{chunk-7X2CYE66.cjs → chunk-5I4ZGKP2.cjs} +255 -199
- package/dist/{chunk-RGTZAM6Y.mjs → chunk-BCCCPFHQ.mjs} +25 -4
- package/dist/{chunk-55UJGUBP.cjs → chunk-BOEDYXAX.cjs} +13 -13
- package/dist/{chunk-DPUZVGXH.mjs → chunk-BRDGINBB.mjs} +31 -28
- package/dist/{chunk-FFWSER54.mjs → chunk-BZY3SRRD.mjs} +1 -1
- package/dist/{chunk-3CZ4MJHW.cjs → chunk-CVZY4TLW.cjs} +1 -1
- package/dist/{chunk-IAIRQAHA.mjs → chunk-CWUQBECF.mjs} +1 -1
- package/dist/{chunk-WZV2G2A6.mjs → chunk-DFDQGHPU.mjs} +83 -27
- package/dist/{chunk-SLIXHUMS.cjs → chunk-DSWSDDP2.cjs} +230 -201
- package/dist/{chunk-EFI6QWBQ.cjs → chunk-EBSL5TW7.cjs} +15 -15
- package/dist/{chunk-U56Z3755.mjs → chunk-EDBIBO67.mjs} +9 -9
- package/dist/{chunk-BBVLOEND.cjs → chunk-F7JVO3OZ.cjs} +4 -4
- package/dist/{chunk-5X5GJU5A.cjs → chunk-GLNVLCUH.cjs} +6 -6
- package/dist/{chunk-DZTWUEBB.cjs → chunk-HOQ2MYBJ.cjs} +10 -10
- package/dist/{chunk-NKVBWPXR.mjs → chunk-I5CVJ24H.mjs} +1 -1
- package/dist/{chunk-R3VLM2MW.mjs → chunk-INU4K4U4.mjs} +5 -5
- package/dist/{chunk-43N3X6OO.mjs → chunk-IRJSZAJB.mjs} +1 -1
- package/dist/{chunk-NDWI6FDH.mjs → chunk-KXVMWLTC.mjs} +59 -30
- package/dist/{chunk-HRH7OKBQ.cjs → chunk-L3BSHASB.cjs} +4 -4
- package/dist/{chunk-ELNRKD4V.mjs → chunk-L5HDCDFT.mjs} +1 -1
- package/dist/{chunk-RNJX3MD6.mjs → chunk-M5XU22PQ.mjs} +1 -1
- package/dist/chunk-MAPHNGTF.cjs +98 -0
- package/dist/{chunk-RE5E2G5S.cjs → chunk-MNUYXZV7.cjs} +2 -18
- package/dist/{chunk-ORBBAA7B.mjs → chunk-MUUDHWQZ.mjs} +1 -1
- package/dist/{chunk-YSU3WCW6.mjs → chunk-MYSH5Y4E.mjs} +1 -1
- package/dist/{chunk-K3GHY7GY.mjs → chunk-NLHSKKTT.mjs} +1 -1
- package/dist/{chunk-JHRJ5V2F.cjs → chunk-OFVBMS6I.cjs} +165 -162
- package/dist/{chunk-3DAJXBSL.cjs → chunk-OP7BIEUW.cjs} +2 -2
- package/dist/chunk-RJBUI5AN.mjs +18 -0
- package/dist/chunk-RQ6XX5IN.mjs +98 -0
- package/dist/{chunk-LN6FAYNB.cjs → chunk-USMRAC72.cjs} +2 -2
- package/dist/{chunk-B5SJYXJK.mjs → chunk-XLULEFRW.mjs} +6 -6
- package/dist/{chunk-A5BHJHDF.cjs → chunk-YU6VL7H5.cjs} +3 -3
- package/dist/{chunk-OM6JIIJU.cjs → chunk-Z37PDUJR.cjs} +4 -4
- package/dist/{devtools-ZM2AR36W.cjs → devtools-4SVIRV4P.cjs} +6 -6
- package/dist/{devtools-OI52TCSD.mjs → devtools-MWQA5LVN.mjs} +4 -4
- package/dist/docs.cjs +6 -6
- package/dist/docs.mjs +5 -5
- package/dist/environment/vite.cjs +5 -5
- package/dist/environment/vite.mjs +4 -4
- package/dist/index.cjs +25 -24
- package/dist/index.mjs +24 -23
- package/dist/internal/build-runtime.cjs +26 -25
- package/dist/internal/build-runtime.mjs +25 -24
- package/dist/internal/cli-runtime.cjs +8 -8
- package/dist/internal/cli-runtime.mjs +7 -7
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +3 -37
- package/dist/internal/client-runtime.d.ts +3 -37
- package/dist/internal/config-runtime.cjs +6 -6
- package/dist/internal/config-runtime.mjs +5 -5
- 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 +13 -13
- package/dist/internal/production-runtime.mjs +19 -19
- package/dist/internal/renderer-islands.cjs +47 -0
- package/dist/internal/renderer-islands.d.mts +32 -0
- package/dist/internal/renderer-islands.d.ts +32 -0
- package/dist/internal/renderer-islands.mjs +47 -0
- package/dist/island-runtime.d-BA7EPo1v.d.ts +38 -0
- package/dist/island-runtime.d-BBS_YUSX.d.mts +38 -0
- package/dist/plugin.cjs +20 -19
- package/dist/plugin.mjs +19 -18
- package/dist/renderer.cjs +8 -2
- package/dist/renderer.d.mts +81 -1
- package/dist/renderer.d.ts +81 -1
- package/dist/renderer.mjs +7 -1
- package/dist/{rsc-pipeline-MFJZGDPE.cjs → rsc-pipeline-OWBEZ7HB.cjs} +9 -9
- package/dist/{rsc-pipeline-TRZVFCBX.mjs → rsc-pipeline-UT3Z2GDO.mjs} +8 -8
- package/dist/{runtime-O4Y3Z6V3.mjs → runtime-F5I3WY3B.mjs} +10 -11
- package/dist/{runtime-MJUG2HGR.cjs → runtime-SRMQ46SK.cjs} +13 -14
- package/dist/server.cjs +50 -50
- package/dist/server.mjs +28 -28
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +20 -19
- package/dist/vite.d.mts +6 -0
- package/dist/vite.d.ts +6 -0
- package/dist/vite.mjs +19 -18
- package/package.json +8 -3
- package/dist/analyzer-WGH6J2HN.cjs +0 -17
- package/dist/chunk-4QENVMG7.mjs +0 -34
- package/dist/{chunk-NEKO3HM2.cjs → chunk-4B6YJ5DS.cjs} +2 -2
- package/dist/{chunk-CA2HBLXP.mjs → chunk-4EEAPBNV.mjs} +3 -3
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
var _chunkDMSXZNQRcjs = require('./chunk-DMSXZNQR.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
var _chunkHRH7OKBQcjs = require('./chunk-HRH7OKBQ.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkL3BSHASBcjs = require('./chunk-L3BSHASB.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkF7JVO3OZcjs = require('./chunk-F7JVO3OZ.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
var _chunkGLNVLCUHcjs = require('./chunk-GLNVLCUH.cjs');
|
|
18
19
|
|
|
19
|
-
var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -56,23 +56,23 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
var
|
|
59
|
+
var _chunk4B6YJ5DScjs = require('./chunk-4B6YJ5DS.cjs');
|
|
60
60
|
|
|
61
61
|
|
|
62
|
+
var _chunk22BTYPIXcjs = require('./chunk-22BTYPIX.cjs');
|
|
62
63
|
|
|
63
64
|
|
|
64
|
-
var _chunkOZUINP2Pcjs = require('./chunk-OZUINP2P.cjs');
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
var _chunkWCSBYQOTcjs = require('./chunk-WCSBYQOT.cjs');
|
|
68
67
|
|
|
69
68
|
|
|
70
69
|
|
|
70
|
+
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
var
|
|
75
|
+
var _chunkOZUINP2Pcjs = require('./chunk-OZUINP2P.cjs');
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
@@ -104,7 +104,7 @@ var _chunkWOAXQ5MZcjs = require('./chunk-WOAXQ5MZ.cjs');
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
var
|
|
107
|
+
var _chunkEBSL5TW7cjs = require('./chunk-EBSL5TW7.cjs');
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
@@ -136,20 +136,17 @@ var _chunkEACD6ND7cjs = require('./chunk-EACD6ND7.cjs');
|
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
140
|
-
|
|
141
139
|
|
|
142
140
|
|
|
141
|
+
var _chunkOLKYHTLNcjs = require('./chunk-OLKYHTLN.cjs');
|
|
143
142
|
|
|
144
143
|
|
|
145
144
|
|
|
146
145
|
|
|
147
146
|
|
|
148
147
|
|
|
149
|
-
var _chunkOLKYHTLNcjs = require('./chunk-OLKYHTLN.cjs');
|
|
150
148
|
|
|
151
|
-
|
|
152
|
-
var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
|
|
149
|
+
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
153
150
|
|
|
154
151
|
|
|
155
152
|
|
|
@@ -167,7 +164,8 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
167
164
|
|
|
168
165
|
|
|
169
166
|
|
|
170
|
-
|
|
167
|
+
|
|
168
|
+
var _chunk3OKSEJ33cjs = require('./chunk-3OKSEJ33.cjs');
|
|
171
169
|
|
|
172
170
|
|
|
173
171
|
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
@@ -308,7 +306,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
308
306
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
309
307
|
|
|
310
308
|
|
|
311
|
-
var
|
|
309
|
+
var _chunkCVZY4TLWcjs = require('./chunk-CVZY4TLW.cjs');
|
|
312
310
|
|
|
313
311
|
|
|
314
312
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -509,7 +507,7 @@ var RouteManager = class _RouteManager {
|
|
|
509
507
|
this.redirects = /* @__PURE__ */ new Map();
|
|
510
508
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
511
509
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
512
|
-
this.programmaticClientRoutes =
|
|
510
|
+
this.programmaticClientRoutes = _chunkEBSL5TW7cjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
513
511
|
// The hydration settings each route rule returned, by file.
|
|
514
512
|
this.rendererRouteHydration = /* @__PURE__ */ new Map();
|
|
515
513
|
this.disposeRendererHydration = () => {
|
|
@@ -598,7 +596,7 @@ var RouteManager = class _RouteManager {
|
|
|
598
596
|
});
|
|
599
597
|
}
|
|
600
598
|
}
|
|
601
|
-
this.disposeRendererHydration =
|
|
599
|
+
this.disposeRendererHydration = _chunkEBSL5TW7cjs.setFarmRendererHydrationScope.call(void 0,
|
|
602
600
|
_chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, this.config).map((source) => source.root),
|
|
603
601
|
renderer,
|
|
604
602
|
routeModules
|
|
@@ -634,7 +632,7 @@ var RouteManager = class _RouteManager {
|
|
|
634
632
|
await this.discoverFileRoutes(source);
|
|
635
633
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
636
634
|
}
|
|
637
|
-
this.programmaticClientRoutes =
|
|
635
|
+
this.programmaticClientRoutes = _chunkEBSL5TW7cjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
638
636
|
for (const slot of this.routeSlots.values()) {
|
|
639
637
|
if (slot.interception && !this.pageRouteShapes.has(_chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
640
638
|
throw new (0, _chunkML4TOUZPcjs.AmbiguousRouteError)(
|
|
@@ -653,8 +651,8 @@ var RouteManager = class _RouteManager {
|
|
|
653
651
|
)
|
|
654
652
|
);
|
|
655
653
|
this.orderedLayouts = Array.from(this.layouts.values()).sort(
|
|
656
|
-
(left, right) =>
|
|
657
|
-
).map((entry) => ({ entry, groupScope:
|
|
654
|
+
(left, right) => _chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, right.pattern)
|
|
655
|
+
).map((entry) => ({ entry, groupScope: _chunk4B6YJ5DScjs.getRouteGroupScope.call(void 0, entry.pattern) }));
|
|
658
656
|
for (const slot of this.routeSlots.values()) {
|
|
659
657
|
if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
|
|
660
658
|
this.routeSlotOwnerSegments.set(
|
|
@@ -927,11 +925,11 @@ var RouteManager = class _RouteManager {
|
|
|
927
925
|
return this.clientManifestCache.manifest;
|
|
928
926
|
}
|
|
929
927
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
930
|
-
const compute = () =>
|
|
928
|
+
const compute = () => _chunkEBSL5TW7cjs.withFarmSourceSnapshot.call(void 0,
|
|
931
929
|
() => this.computeClientManifest(normalizedProjectRoot),
|
|
932
930
|
this.sourceSnapshot
|
|
933
931
|
);
|
|
934
|
-
return cacheFile ?
|
|
932
|
+
return cacheFile ? _chunkEBSL5TW7cjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
|
|
935
933
|
}
|
|
936
934
|
/**
|
|
937
935
|
* @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
|
|
@@ -940,7 +938,7 @@ var RouteManager = class _RouteManager {
|
|
|
940
938
|
*/
|
|
941
939
|
trackSourceChanges() {
|
|
942
940
|
this.sourceChangeTracking = true;
|
|
943
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
941
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkEBSL5TW7cjs.FarmSourceSnapshotStore)())));
|
|
944
942
|
}
|
|
945
943
|
/**
|
|
946
944
|
* @internal A production build edits no source while it runs, so what the plan reads, parses and
|
|
@@ -949,7 +947,7 @@ var RouteManager = class _RouteManager {
|
|
|
949
947
|
*/
|
|
950
948
|
keepBuildSourceSnapshot() {
|
|
951
949
|
if (this.sourceChangeTracking) return;
|
|
952
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
950
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkEBSL5TW7cjs.FarmSourceSnapshotStore)(false))));
|
|
953
951
|
}
|
|
954
952
|
/**
|
|
955
953
|
* @internal Hands the snapshot keepBuildSourceSnapshot kept to the build, which clears it once
|
|
@@ -992,7 +990,7 @@ var RouteManager = class _RouteManager {
|
|
|
992
990
|
return false;
|
|
993
991
|
}
|
|
994
992
|
const previous = _optionalChain([this, 'access', _18 => _18.sourceSnapshot, 'optionalAccess', _19 => _19.peekSource, 'call', _20 => _20(path4.default.resolve(file))]);
|
|
995
|
-
return previous !== void 0 &&
|
|
993
|
+
return previous !== void 0 && _chunkEBSL5TW7cjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
|
|
996
994
|
}
|
|
997
995
|
/**
|
|
998
996
|
* A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
|
|
@@ -1003,7 +1001,7 @@ var RouteManager = class _RouteManager {
|
|
|
1003
1001
|
if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
|
|
1004
1002
|
return { ...previous.plan };
|
|
1005
1003
|
}
|
|
1006
|
-
const { result, files } =
|
|
1004
|
+
const { result, files } = _chunkEBSL5TW7cjs.traceFarmSourceReads.call(void 0, compute);
|
|
1007
1005
|
const sources = /* @__PURE__ */ new Set();
|
|
1008
1006
|
for (const file of files) {
|
|
1009
1007
|
const source = this.planSourcePath(file);
|
|
@@ -1011,7 +1009,7 @@ var RouteManager = class _RouteManager {
|
|
|
1011
1009
|
}
|
|
1012
1010
|
if (!this.sourceChangeTracking) {
|
|
1013
1011
|
for (const source of sources) {
|
|
1014
|
-
if (!this.planStamps.has(source)) this.planStamps.set(source,
|
|
1012
|
+
if (!this.planStamps.has(source)) this.planStamps.set(source, _chunkEBSL5TW7cjs.getFarmSourceStamp.call(void 0, source));
|
|
1015
1013
|
}
|
|
1016
1014
|
}
|
|
1017
1015
|
this.ownerPlans.set(key, { plan: result, files: sources, planKey });
|
|
@@ -1031,7 +1029,7 @@ var RouteManager = class _RouteManager {
|
|
|
1031
1029
|
const isUnchanged = (file) => {
|
|
1032
1030
|
let result = unchanged.get(file);
|
|
1033
1031
|
if (result === void 0) {
|
|
1034
|
-
result = this.planStamps.get(file) ===
|
|
1032
|
+
result = this.planStamps.get(file) === _chunkEBSL5TW7cjs.getFarmSourceStamp.call(void 0, file);
|
|
1035
1033
|
unchanged.set(file, result);
|
|
1036
1034
|
}
|
|
1037
1035
|
return result;
|
|
@@ -1078,7 +1076,7 @@ var RouteManager = class _RouteManager {
|
|
|
1078
1076
|
*/
|
|
1079
1077
|
inspectPackages(operation) {
|
|
1080
1078
|
const file = this.packageClientBoundaryCacheFile;
|
|
1081
|
-
return file ?
|
|
1079
|
+
return file ? _chunkEBSL5TW7cjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
|
|
1082
1080
|
}
|
|
1083
1081
|
computeClientManifest(normalizedProjectRoot) {
|
|
1084
1082
|
const toUrlPath = (absolutePath) => {
|
|
@@ -1096,29 +1094,29 @@ var RouteManager = class _RouteManager {
|
|
|
1096
1094
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
1097
1095
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
1098
1096
|
);
|
|
1099
|
-
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" && _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _24 => _24.config, 'access', _25 => _25.experimental, 'optionalAccess', _26 => _26.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
1100
1098
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
1101
1099
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
1102
1100
|
);
|
|
1103
1101
|
}
|
|
1104
|
-
const isolatedMode =
|
|
1102
|
+
const isolatedMode = _chunkEBSL5TW7cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
1105
1103
|
_optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.isolatedClientHydration]),
|
|
1106
1104
|
{
|
|
1107
|
-
serverComponents:
|
|
1105
|
+
serverComponents: _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _30 => _30.config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.serverComponents])) === "rsc",
|
|
1108
1106
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
1109
1107
|
}
|
|
1110
1108
|
);
|
|
1111
|
-
const planOptions =
|
|
1109
|
+
const planOptions = _chunkEBSL5TW7cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
1112
1110
|
this.config.renderer,
|
|
1113
1111
|
Boolean(unsupportedIntegrationProvider)
|
|
1114
1112
|
);
|
|
1115
|
-
const islandsMode =
|
|
1113
|
+
const islandsMode = _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _33 => _33.config, 'access', _34 => _34.experimental, 'optionalAccess', _35 => _35.serverComponents])) === "islands";
|
|
1116
1114
|
const changed = _optionalChain([this, 'access', _36 => _36.sourceSnapshot, 'optionalAccess', _37 => _37.refresh, 'call', _38 => _38(_nullishCoalesce(this.editedSources, () => ( [])))]);
|
|
1117
1115
|
let edited = null;
|
|
1118
1116
|
if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
|
|
1119
1117
|
edited = /* @__PURE__ */ new Set();
|
|
1120
1118
|
for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
|
|
1121
|
-
if (
|
|
1119
|
+
if (_chunkEBSL5TW7cjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
|
|
1122
1120
|
const source = this.planSourcePath(file);
|
|
1123
1121
|
if (source) edited.add(source);
|
|
1124
1122
|
}
|
|
@@ -1133,13 +1131,13 @@ var RouteManager = class _RouteManager {
|
|
|
1133
1131
|
metadata: this.planRouteModule(
|
|
1134
1132
|
`layout:${entry.modulePath}`,
|
|
1135
1133
|
edited,
|
|
1136
|
-
() =>
|
|
1134
|
+
() => _chunkEBSL5TW7cjs.getClientModuleHydrationPlan.call(void 0,
|
|
1137
1135
|
entry.modulePath,
|
|
1138
1136
|
normalizedProjectRoot,
|
|
1139
1137
|
isolatedMode,
|
|
1140
1138
|
layoutPlanOptions
|
|
1141
1139
|
),
|
|
1142
|
-
|
|
1140
|
+
_chunkEBSL5TW7cjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1143
1141
|
entry.modulePath,
|
|
1144
1142
|
normalizedProjectRoot,
|
|
1145
1143
|
isolatedMode,
|
|
@@ -1147,7 +1145,7 @@ var RouteManager = class _RouteManager {
|
|
|
1147
1145
|
)
|
|
1148
1146
|
)
|
|
1149
1147
|
}));
|
|
1150
|
-
const markdownComponentsPlan =
|
|
1148
|
+
const markdownComponentsPlan = _chunkEBSL5TW7cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
1151
1149
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
1152
1150
|
normalizedProjectRoot,
|
|
1153
1151
|
isolatedMode,
|
|
@@ -1163,13 +1161,13 @@ var RouteManager = class _RouteManager {
|
|
|
1163
1161
|
metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
|
|
1164
1162
|
`page:${entry.modulePath}`,
|
|
1165
1163
|
edited,
|
|
1166
|
-
() =>
|
|
1164
|
+
() => _chunkEBSL5TW7cjs.getClientModuleHydrationPlan.call(void 0,
|
|
1167
1165
|
entry.modulePath,
|
|
1168
1166
|
normalizedProjectRoot,
|
|
1169
1167
|
isolatedMode,
|
|
1170
1168
|
pagePlanOptions
|
|
1171
1169
|
),
|
|
1172
|
-
|
|
1170
|
+
_chunkEBSL5TW7cjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1173
1171
|
entry.modulePath,
|
|
1174
1172
|
normalizedProjectRoot,
|
|
1175
1173
|
isolatedMode,
|
|
@@ -1199,18 +1197,18 @@ var RouteManager = class _RouteManager {
|
|
|
1199
1197
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1200
1198
|
);
|
|
1201
1199
|
}
|
|
1202
|
-
|
|
1200
|
+
_chunkEBSL5TW7cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
1203
1201
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1204
1202
|
pattern: entry.pattern,
|
|
1205
|
-
depth:
|
|
1203
|
+
depth: _chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
1206
1204
|
metadata
|
|
1207
1205
|
})),
|
|
1208
1206
|
routeEntries.map(({ entry, metadata }) => ({
|
|
1209
1207
|
pattern: getRouteEntryDirectory(entry),
|
|
1210
|
-
depth:
|
|
1208
|
+
depth: _chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
|
|
1211
1209
|
metadata
|
|
1212
1210
|
})),
|
|
1213
|
-
|
|
1211
|
+
_chunk4B6YJ5DScjs.routeBoundaryCoversDirectory,
|
|
1214
1212
|
{ serverOwners: islandsMode }
|
|
1215
1213
|
);
|
|
1216
1214
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
@@ -1230,7 +1228,7 @@ var RouteManager = class _RouteManager {
|
|
|
1230
1228
|
const routes = routeEntries.map(({ entry, metadata }) => {
|
|
1231
1229
|
const programmaticPage = this.programmaticPages.get(entry.modulePath);
|
|
1232
1230
|
const layoutShouldHydrate = layoutEntries.some(
|
|
1233
|
-
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate &&
|
|
1231
|
+
({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunk4B6YJ5DScjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
|
|
1234
1232
|
);
|
|
1235
1233
|
return {
|
|
1236
1234
|
pattern: entry.pattern,
|
|
@@ -1246,8 +1244,8 @@ var RouteManager = class _RouteManager {
|
|
|
1246
1244
|
modulePath: toUrlPath(boundary.modulePath)
|
|
1247
1245
|
}))
|
|
1248
1246
|
} : {},
|
|
1249
|
-
...
|
|
1250
|
-
renderPlan:
|
|
1247
|
+
..._chunkEBSL5TW7cjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
1248
|
+
renderPlan: _chunk4B6YJ5DScjs.createFarmRouteRenderPlan.call(void 0, {
|
|
1251
1249
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
1252
1250
|
layoutShouldHydrate,
|
|
1253
1251
|
islandStrategy: metadata.islandStrategy
|
|
@@ -1263,7 +1261,7 @@ var RouteManager = class _RouteManager {
|
|
|
1263
1261
|
}))
|
|
1264
1262
|
};
|
|
1265
1263
|
});
|
|
1266
|
-
const treeLayoutPatterns = islandsMode ?
|
|
1264
|
+
const treeLayoutPatterns = islandsMode ? _chunk4B6YJ5DScjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
1267
1265
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1268
1266
|
pattern: entry.pattern,
|
|
1269
1267
|
shouldHydrate: metadata.shouldHydrate,
|
|
@@ -1288,7 +1286,7 @@ var RouteManager = class _RouteManager {
|
|
|
1288
1286
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
1289
1287
|
}));
|
|
1290
1288
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
1291
|
-
const metadata =
|
|
1289
|
+
const metadata = _chunkEBSL5TW7cjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
1292
1290
|
return {
|
|
1293
1291
|
name: entry.name,
|
|
1294
1292
|
ownerPattern: entry.ownerPattern,
|
|
@@ -1304,7 +1302,7 @@ var RouteManager = class _RouteManager {
|
|
|
1304
1302
|
};
|
|
1305
1303
|
});
|
|
1306
1304
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
1307
|
-
metadata:
|
|
1305
|
+
metadata: _chunkEBSL5TW7cjs.getClientModuleHydrationPlan.call(void 0,
|
|
1308
1306
|
entry.modulePath,
|
|
1309
1307
|
normalizedProjectRoot,
|
|
1310
1308
|
isolatedMode,
|
|
@@ -1406,7 +1404,7 @@ var RouteManager = class _RouteManager {
|
|
|
1406
1404
|
loadModule: viteServer ? (componentModulePath) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
|
|
1407
1405
|
}),
|
|
1408
1406
|
config: mdxConfig,
|
|
1409
|
-
renderer:
|
|
1407
|
+
renderer: _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
|
|
1410
1408
|
});
|
|
1411
1409
|
}
|
|
1412
1410
|
if (this.viteServer) {
|
|
@@ -1454,7 +1452,7 @@ var RouteManager = class _RouteManager {
|
|
|
1454
1452
|
*/
|
|
1455
1453
|
createRoutePattern(route) {
|
|
1456
1454
|
if (route.segments.length === 0) return "/";
|
|
1457
|
-
return "/" + route.segments.map(
|
|
1455
|
+
return "/" + route.segments.map(_chunk4B6YJ5DScjs.formatRouteSegment).join("/");
|
|
1458
1456
|
}
|
|
1459
1457
|
registerPageRoute(entry) {
|
|
1460
1458
|
_chunkML4TOUZPcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
|
|
@@ -1473,11 +1471,11 @@ var RouteManager = class _RouteManager {
|
|
|
1473
1471
|
}
|
|
1474
1472
|
async discoverFileRoutes(source) {
|
|
1475
1473
|
const appDir = _chunk7U4XF76Rcjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
|
|
1476
|
-
const componentExtensions =
|
|
1474
|
+
const componentExtensions = _chunk3OKSEJ33cjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
|
|
1477
1475
|
(extension) => extension.slice(1)
|
|
1478
1476
|
);
|
|
1479
1477
|
const componentGlob = componentExtensions.join(",");
|
|
1480
|
-
const rendererRoutes = await
|
|
1478
|
+
const rendererRoutes = await _chunkGLNVLCUHcjs.resolveFarmRendererRoutes.call(void 0, {
|
|
1481
1479
|
renderer: this.config.renderer,
|
|
1482
1480
|
root: source.root,
|
|
1483
1481
|
srcDir: source.srcDir
|
|
@@ -1575,7 +1573,7 @@ var RouteManager = class _RouteManager {
|
|
|
1575
1573
|
for (const file of files) {
|
|
1576
1574
|
const route = _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, file);
|
|
1577
1575
|
const modulePath = modulePathOf(file);
|
|
1578
|
-
const pattern =
|
|
1576
|
+
const pattern = _chunk4B6YJ5DScjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1579
1577
|
const existing = target.get(pattern);
|
|
1580
1578
|
if (_optionalChain([existing, 'optionalAccess', _51 => _51.sourceRoot]) === source.root) {
|
|
1581
1579
|
throw new Error(
|
|
@@ -1597,7 +1595,7 @@ var RouteManager = class _RouteManager {
|
|
|
1597
1595
|
const modulePath = path4.default.join(appDir, file);
|
|
1598
1596
|
const pattern = this.createRoutePattern(slot.route);
|
|
1599
1597
|
const ownerPattern = this.createRoutePattern(slot.ownerRoute);
|
|
1600
|
-
const ownerDirectory =
|
|
1598
|
+
const ownerDirectory = _chunk4B6YJ5DScjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
|
|
1601
1599
|
const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
|
|
1602
1600
|
const existing = this.routeSlots.get(key);
|
|
1603
1601
|
if (_optionalChain([existing, 'optionalAccess', _52 => _52.sourceRoot]) === source.root) {
|
|
@@ -1679,11 +1677,11 @@ var RouteManager = class _RouteManager {
|
|
|
1679
1677
|
srcDir: source.srcDir,
|
|
1680
1678
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1681
1679
|
});
|
|
1682
|
-
const graph = this.viteServer ?
|
|
1680
|
+
const graph = this.viteServer ? _chunkEBSL5TW7cjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1683
1681
|
for (const { filePath, manifest } of manifests) {
|
|
1684
1682
|
if (graph) {
|
|
1685
1683
|
clientRoutes.push(
|
|
1686
|
-
|
|
1684
|
+
_chunkEBSL5TW7cjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1687
1685
|
graph,
|
|
1688
1686
|
routesFile: toRealPath(filePath),
|
|
1689
1687
|
routes: manifest.routes,
|
|
@@ -1714,7 +1712,7 @@ var RouteManager = class _RouteManager {
|
|
|
1714
1712
|
}
|
|
1715
1713
|
if (definition.kind === "layout") {
|
|
1716
1714
|
const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
|
|
1717
|
-
const pattern =
|
|
1715
|
+
const pattern = _chunk4B6YJ5DScjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1718
1716
|
const existing = this.layouts.get(pattern);
|
|
1719
1717
|
if (_optionalChain([existing, 'optionalAccess', _56 => _56.sourceRoot]) === source.root) {
|
|
1720
1718
|
throw new Error(
|
|
@@ -1761,7 +1759,7 @@ var RouteManager = class _RouteManager {
|
|
|
1761
1759
|
const matchingLayouts = [];
|
|
1762
1760
|
for (const { entry, groupScope } of this.orderedLayouts) {
|
|
1763
1761
|
if (!_chunk7U4XF76Rcjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
|
|
1764
|
-
if (groupScope !== null && !
|
|
1762
|
+
if (groupScope !== null && !_chunk4B6YJ5DScjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
|
|
1765
1763
|
continue;
|
|
1766
1764
|
}
|
|
1767
1765
|
matchingLayouts.push(entry);
|
|
@@ -1842,14 +1840,14 @@ var RouteManager = class _RouteManager {
|
|
|
1842
1840
|
let page = route;
|
|
1843
1841
|
for (const boundaryEntry of boundaries.values()) {
|
|
1844
1842
|
if (!_chunk7U4XF76Rcjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
|
|
1845
|
-
const groupScope =
|
|
1843
|
+
const groupScope = _chunk4B6YJ5DScjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
|
|
1846
1844
|
if (groupScope !== null) {
|
|
1847
1845
|
if (page === void 0) page = this.matchPageRoute(_chunk7U4XF76Rcjs.splitRoutePath.call(void 0, normalizedPath));
|
|
1848
|
-
if (!
|
|
1846
|
+
if (!_chunk4B6YJ5DScjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
|
|
1849
1847
|
}
|
|
1850
1848
|
const depth = boundaryEntry.route.segments.length;
|
|
1851
1849
|
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _60 => _60.route, 'access', _61 => _61.segments, 'access', _62 => _62.length]), () => ( -1));
|
|
1852
|
-
if (!bestMatch || depth > bestDepth || depth === bestDepth &&
|
|
1850
|
+
if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunk4B6YJ5DScjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
|
|
1853
1851
|
bestMatch = boundaryEntry;
|
|
1854
1852
|
}
|
|
1855
1853
|
}
|
|
@@ -1897,7 +1895,7 @@ var RouteManager = class _RouteManager {
|
|
|
1897
1895
|
}));
|
|
1898
1896
|
const i18n = this.getI18nConfig();
|
|
1899
1897
|
const docsAdapterRoutes = this.getDocsAdapterRoutes();
|
|
1900
|
-
const result = await
|
|
1898
|
+
const result = await _chunkL3BSHASBcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
1901
1899
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
|
|
1902
1900
|
...docsAdapterRoutes ? { docsAdapterRoutes } : {}
|
|
1903
1901
|
});
|
|
@@ -1944,7 +1942,7 @@ var RouteManager = class _RouteManager {
|
|
|
1944
1942
|
async isRouteSSG(modulePath) {
|
|
1945
1943
|
try {
|
|
1946
1944
|
const mod = await this.loadRouteModule(modulePath);
|
|
1947
|
-
const rendering = await
|
|
1945
|
+
const rendering = await _chunkL3BSHASBcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1948
1946
|
return rendering.ssg;
|
|
1949
1947
|
} catch (e2) {
|
|
1950
1948
|
return false;
|
|
@@ -1956,7 +1954,7 @@ var RouteManager = class _RouteManager {
|
|
|
1956
1954
|
async hasRouteISR(modulePath) {
|
|
1957
1955
|
try {
|
|
1958
1956
|
const mod = await this.loadRouteModule(modulePath);
|
|
1959
|
-
const rendering = await
|
|
1957
|
+
const rendering = await _chunkL3BSHASBcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1960
1958
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
1961
1959
|
} catch (e3) {
|
|
1962
1960
|
return false;
|
|
@@ -1968,7 +1966,7 @@ var RouteManager = class _RouteManager {
|
|
|
1968
1966
|
async getRouteRevalidateInterval(modulePath) {
|
|
1969
1967
|
try {
|
|
1970
1968
|
const mod = await this.loadRouteModule(modulePath);
|
|
1971
|
-
const rendering = await
|
|
1969
|
+
const rendering = await _chunkL3BSHASBcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1972
1970
|
return rendering.revalidate;
|
|
1973
1971
|
} catch (e4) {
|
|
1974
1972
|
return void 0;
|
|
@@ -1976,7 +1974,7 @@ var RouteManager = class _RouteManager {
|
|
|
1976
1974
|
}
|
|
1977
1975
|
};
|
|
1978
1976
|
function getPageDirectoryField(route, pattern) {
|
|
1979
|
-
const directory =
|
|
1977
|
+
const directory = _chunk4B6YJ5DScjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1980
1978
|
return directory === pattern ? {} : { directory };
|
|
1981
1979
|
}
|
|
1982
1980
|
function interpolateRedirectDestination(destination, params, catchAllSegments = {}) {
|
|
@@ -2100,11 +2098,11 @@ function createFarmDevClientManifest(manifest, options) {
|
|
|
2100
2098
|
}
|
|
2101
2099
|
for (const layout of manifest.layouts) {
|
|
2102
2100
|
if (layoutPatterns && !layoutPatterns.has(layout.pattern)) continue;
|
|
2103
|
-
const groupScope =
|
|
2101
|
+
const groupScope = _chunk4B6YJ5DScjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
2104
2102
|
clientManifest.layouts[layout.pattern] = {
|
|
2105
2103
|
modulePath: layout.modulePath,
|
|
2106
2104
|
pattern: layout.pattern,
|
|
2107
|
-
...groupScope ? { urlPattern:
|
|
2105
|
+
...groupScope ? { urlPattern: _chunk4B6YJ5DScjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
|
|
2108
2106
|
shouldHydrate: layout.shouldHydrate,
|
|
2109
2107
|
islandStrategy: layout.islandStrategy,
|
|
2110
2108
|
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
@@ -3266,13 +3264,13 @@ function resolveProviderModule(moduleId, root) {
|
|
|
3266
3264
|
|
|
3267
3265
|
// src/server-actions-mode.ts
|
|
3268
3266
|
function resolveFarmIslxActionsMode(config) {
|
|
3269
|
-
if (
|
|
3267
|
+
if (_chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _68 => _68.experimental, 'optionalAccess', _69 => _69.serverComponents])) === "islands") {
|
|
3270
3268
|
return "islands";
|
|
3271
3269
|
}
|
|
3272
3270
|
if (_optionalChain([config, 'access', _70 => _70.experimental, 'optionalAccess', _71 => _71.serverActions]) !== true) return null;
|
|
3273
3271
|
const renderer = config.renderer;
|
|
3274
3272
|
if (renderer === void 0 || renderer === false) return null;
|
|
3275
|
-
if (
|
|
3273
|
+
if (_chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, renderer) || _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer)) return null;
|
|
3276
3274
|
return "renderer";
|
|
3277
3275
|
}
|
|
3278
3276
|
function farmBrowserServerFnsEnabled(config) {
|
|
@@ -3319,7 +3317,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
3319
3317
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
3320
3318
|
parse: parseFarmIslandSource,
|
|
3321
3319
|
resolve: (specifier, importer) => {
|
|
3322
|
-
const resolved =
|
|
3320
|
+
const resolved = _chunkEBSL5TW7cjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
3323
3321
|
return resolved.local ? resolved.path : null;
|
|
3324
3322
|
}
|
|
3325
3323
|
});
|
|
@@ -3339,7 +3337,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
3339
3337
|
if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
|
|
3340
3338
|
return cached.result;
|
|
3341
3339
|
}
|
|
3342
|
-
const { result, files } =
|
|
3340
|
+
const { result, files } = _chunkEBSL5TW7cjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
|
|
3343
3341
|
const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
|
|
3344
3342
|
routeRootInferences.set(key, {
|
|
3345
3343
|
stamps: [...read].map((file) => [file, modifiedAt(file)]),
|
|
@@ -3356,7 +3354,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3356
3354
|
const files = [];
|
|
3357
3355
|
const modules = [];
|
|
3358
3356
|
for (const owner of owners) {
|
|
3359
|
-
const rendered =
|
|
3357
|
+
const rendered = _chunkEBSL5TW7cjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
3360
3358
|
if (!rendered) {
|
|
3361
3359
|
return {
|
|
3362
3360
|
strategy: null,
|
|
@@ -3372,7 +3370,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3372
3370
|
source = fs2.default.readFileSync(module, "utf8");
|
|
3373
3371
|
} catch (e11) {
|
|
3374
3372
|
}
|
|
3375
|
-
if (
|
|
3373
|
+
if (_chunkEBSL5TW7cjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
3376
3374
|
}
|
|
3377
3375
|
for (const module of modules) {
|
|
3378
3376
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -3384,7 +3382,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3384
3382
|
function resolveFarmRouteRootStrategy(route, page, layouts, root, islandsMode) {
|
|
3385
3383
|
const directory = _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3386
3384
|
const onRoute = layouts.filter(
|
|
3387
|
-
(layout) =>
|
|
3385
|
+
(layout) => _chunk4B6YJ5DScjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, directory)
|
|
3388
3386
|
);
|
|
3389
3387
|
const declared = [
|
|
3390
3388
|
...page.islandStrategy ? [page.islandStrategy] : [],
|
|
@@ -3416,7 +3414,7 @@ var _stream = require('stream');
|
|
|
3416
3414
|
|
|
3417
3415
|
|
|
3418
3416
|
function resolveFarmNotFoundComponentPath(config, appDirs, discovered) {
|
|
3419
|
-
const extensions =
|
|
3417
|
+
const extensions = _chunk3OKSEJ33cjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
|
|
3420
3418
|
const configuredPath = _optionalChain([config, 'access', _74 => _74.notFound, 'optionalAccess', _75 => _75.component, 'optionalAccess', _76 => _76.trim, 'call', _77 => _77()]);
|
|
3421
3419
|
if (configuredPath) {
|
|
3422
3420
|
const componentPath = path4.default.isAbsolute(configuredPath) ? path4.default.normalize(configuredPath) : path4.default.resolve(config.root, configuredPath);
|
|
@@ -3456,11 +3454,11 @@ function getFarmLayoutKey(pattern, params) {
|
|
|
3456
3454
|
);
|
|
3457
3455
|
}
|
|
3458
3456
|
function countFarmKeptLayouts(layoutsHeader, layouts, params) {
|
|
3459
|
-
const chain =
|
|
3457
|
+
const chain = _chunk4B6YJ5DScjs.parseFarmLayoutChainHeader.call(void 0, _nullishCoalesce(layoutsHeader, () => ( null)));
|
|
3460
3458
|
if (chain.length === 0) return 0;
|
|
3461
3459
|
const keys = layouts.map((layout) => getFarmLayoutKey(layout.pattern, params));
|
|
3462
|
-
if (chain[0] === keys[0]) return
|
|
3463
|
-
return keys.length > 1 ? 1 +
|
|
3460
|
+
if (chain[0] === keys[0]) return _chunk4B6YJ5DScjs.getSharedLayoutPrefixLength.call(void 0, chain, keys);
|
|
3461
|
+
return keys.length > 1 ? 1 + _chunk4B6YJ5DScjs.getSharedLayoutPrefixLength.call(void 0, chain, keys.slice(1)) : 0;
|
|
3464
3462
|
}
|
|
3465
3463
|
function createFarmFlushToken() {
|
|
3466
3464
|
const bytes = new Uint8Array(16);
|
|
@@ -3715,7 +3713,7 @@ function createDefaultErrorDiagnostics(error, root) {
|
|
|
3715
3713
|
function canBootFarmIslandsClient(config) {
|
|
3716
3714
|
const docs = config.docs;
|
|
3717
3715
|
const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
|
|
3718
|
-
return
|
|
3716
|
+
return _chunk3OKSEJ33cjs.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");
|
|
3719
3717
|
}
|
|
3720
3718
|
|
|
3721
3719
|
// src/islands-kept-layouts.ts
|
|
@@ -3763,7 +3761,7 @@ var DECLARATION_STATEMENTS = /* @__PURE__ */ new Set([
|
|
|
3763
3761
|
function parse(code, file) {
|
|
3764
3762
|
const extension = path4.default.extname(file).slice(1);
|
|
3765
3763
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" ? "jsx" : "tsx";
|
|
3766
|
-
return
|
|
3764
|
+
return _chunkEBSL5TW7cjs.memoizeInFarmSourceSnapshot.call(void 0, `ast:${lang}`, code, () => {
|
|
3767
3765
|
try {
|
|
3768
3766
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
3769
3767
|
} catch (e14) {
|
|
@@ -3898,14 +3896,14 @@ function isReference(node, parent, key) {
|
|
|
3898
3896
|
}
|
|
3899
3897
|
function readSource(file) {
|
|
3900
3898
|
try {
|
|
3901
|
-
|
|
3899
|
+
_chunkEBSL5TW7cjs.noteFarmSourceRead.call(void 0, file);
|
|
3902
3900
|
return fs2.default.readFileSync(file, "utf8");
|
|
3903
3901
|
} catch (e15) {
|
|
3904
3902
|
return null;
|
|
3905
3903
|
}
|
|
3906
3904
|
}
|
|
3907
3905
|
function explainFarmKeptLayoutRender(modulePath, root) {
|
|
3908
|
-
const entry =
|
|
3906
|
+
const entry = _chunkEBSL5TW7cjs.resolveModuleSourcePath.call(void 0, modulePath, root);
|
|
3909
3907
|
if (!entry) return `${modulePath} does not resolve`;
|
|
3910
3908
|
const visited = /* @__PURE__ */ new Set();
|
|
3911
3909
|
const check = (file) => {
|
|
@@ -3915,7 +3913,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3915
3913
|
if (!SCRIPT_SOURCE.test(file)) return `${path4.default.relative(root, file)} is not a script`;
|
|
3916
3914
|
const code = readSource(file);
|
|
3917
3915
|
if (code === null) return `${path4.default.relative(root, file)} cannot be read`;
|
|
3918
|
-
const { reason, imports } =
|
|
3916
|
+
const { reason, imports } = _chunkEBSL5TW7cjs.memoizeInFarmSourceSnapshot.call(void 0,
|
|
3919
3917
|
"kept-layout-module",
|
|
3920
3918
|
code,
|
|
3921
3919
|
() => findFarmRequestDecidingConstruct(code, file)
|
|
@@ -3928,7 +3926,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3928
3926
|
return `${path4.default.relative(root, file)} imports ${imported.names.join(", ")} from ${imported.source}`;
|
|
3929
3927
|
}
|
|
3930
3928
|
if (ASSET_SOURCE.test(imported.source.split("?")[0])) continue;
|
|
3931
|
-
const resolved =
|
|
3929
|
+
const resolved = _chunkEBSL5TW7cjs.resolveImportedModule.call(void 0, file, imported.source, root);
|
|
3932
3930
|
if (!resolved.path || !resolved.local) {
|
|
3933
3931
|
return `${path4.default.relative(root, file)} imports ${imported.source}`;
|
|
3934
3932
|
}
|
|
@@ -3943,15 +3941,15 @@ var answers = /* @__PURE__ */ new Map();
|
|
|
3943
3941
|
function canFarmSkipKeptLayoutRender(modulePath, root) {
|
|
3944
3942
|
const key = `${root}\0${modulePath}`;
|
|
3945
3943
|
const known = answers.get(key);
|
|
3946
|
-
if (known && known.stamps.every(([file, stamp]) =>
|
|
3944
|
+
if (known && known.stamps.every(([file, stamp]) => _chunkEBSL5TW7cjs.getFarmSourceStamp.call(void 0, file) === stamp)) {
|
|
3947
3945
|
return known.skip;
|
|
3948
3946
|
}
|
|
3949
|
-
const { result, files } =
|
|
3947
|
+
const { result, files } = _chunkEBSL5TW7cjs.traceFarmSourceReads.call(void 0,
|
|
3950
3948
|
() => explainFarmKeptLayoutRender(modulePath, root) === null
|
|
3951
3949
|
);
|
|
3952
3950
|
answers.set(key, {
|
|
3953
3951
|
skip: result,
|
|
3954
|
-
stamps: files.map((file) => [file,
|
|
3952
|
+
stamps: files.map((file) => [file, _chunkEBSL5TW7cjs.getFarmSourceStamp.call(void 0, file)])
|
|
3955
3953
|
});
|
|
3956
3954
|
return result;
|
|
3957
3955
|
}
|
|
@@ -4079,7 +4077,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
4079
4077
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
4080
4078
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
4081
4079
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
4082
|
-
_chunk7U4XF76Rcjs.logger.warn(
|
|
4080
|
+
_chunk7U4XF76Rcjs.logger.warn(_chunkEBSL5TW7cjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
4083
4081
|
}
|
|
4084
4082
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
4085
4083
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
@@ -4130,7 +4128,7 @@ function appendResponseVary(res, value) {
|
|
|
4130
4128
|
function renderI18nAlternateLinks(requestPath, snapshot, options) {
|
|
4131
4129
|
if (snapshot.routing === "none") return "";
|
|
4132
4130
|
const url = new URL(requestPath, "http://farm.local");
|
|
4133
|
-
return
|
|
4131
|
+
return _chunk4B6YJ5DScjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
|
|
4134
4132
|
}
|
|
4135
4133
|
var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
4136
4134
|
function createPPRRefreshScript() {
|
|
@@ -4288,15 +4286,15 @@ var ServerRenderer = class {
|
|
|
4288
4286
|
if (_optionalChain([this, 'access', _102 => _102.config, 'access', _103 => _103.notFound, 'optionalAccess', _104 => _104.component, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()])) {
|
|
4289
4287
|
resolveFarmNotFoundComponentPath(this.config, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config));
|
|
4290
4288
|
}
|
|
4291
|
-
const loaded =
|
|
4292
|
-
|
|
4289
|
+
const loaded = _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, this.config.renderer) ? this.reactRenderer = await import("./renderer/react/server.cjs") : _chunk3OKSEJ33cjs.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
|
+
_chunk3OKSEJ33cjs.resolveFarmRendererModule.call(void 0,
|
|
4293
4291
|
this.config.root || process.cwd(),
|
|
4294
4292
|
this.config.renderer.server
|
|
4295
4293
|
)
|
|
4296
4294
|
).href);
|
|
4297
4295
|
const runtime = loaded;
|
|
4298
|
-
|
|
4299
|
-
|
|
4296
|
+
_chunk3OKSEJ33cjs.assertFarmRendererServerModule.call(void 0, runtime, this.config.renderer);
|
|
4297
|
+
_chunk3OKSEJ33cjs.assertFarmRendererStreamingRuntime.call(void 0,
|
|
4300
4298
|
this.config.renderer.name,
|
|
4301
4299
|
this.config.renderer,
|
|
4302
4300
|
runtime,
|
|
@@ -4312,7 +4310,7 @@ var ServerRenderer = class {
|
|
|
4312
4310
|
* re-applied on the next request without restarting.
|
|
4313
4311
|
*/
|
|
4314
4312
|
async applyRendererAppSetup() {
|
|
4315
|
-
const appSetupPath =
|
|
4313
|
+
const appSetupPath = _chunk3OKSEJ33cjs.resolveFarmRendererAppSetup.call(void 0,
|
|
4316
4314
|
this.config.root || process.cwd(),
|
|
4317
4315
|
this.config.renderer
|
|
4318
4316
|
);
|
|
@@ -4455,10 +4453,10 @@ var ServerRenderer = class {
|
|
|
4455
4453
|
return serverTree && this.rendererRuntime.renderServerTreePage ? this.rendererRuntime.renderServerTreePage(element, { values: false }) : this.rendererRuntime.isolateServerPageGraph(element);
|
|
4456
4454
|
}
|
|
4457
4455
|
async renderElementToCompleteHTML(element, options = {}) {
|
|
4458
|
-
const streaming =
|
|
4456
|
+
const streaming = _chunk3OKSEJ33cjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
|
|
4459
4457
|
const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
|
|
4460
4458
|
if (renderToPipeableStream) {
|
|
4461
|
-
const inlineBoundaries =
|
|
4459
|
+
const inlineBoundaries = _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, this.config.renderer);
|
|
4462
4460
|
return await new Promise((resolve3, reject) => {
|
|
4463
4461
|
const chunks = [];
|
|
4464
4462
|
let shellReady = false;
|
|
@@ -4504,7 +4502,7 @@ var ServerRenderer = class {
|
|
|
4504
4502
|
element,
|
|
4505
4503
|
rendererRenderOptions()
|
|
4506
4504
|
);
|
|
4507
|
-
return await
|
|
4505
|
+
return await _chunk3OKSEJ33cjs.readFarmRendererWebStream.call(void 0, stream);
|
|
4508
4506
|
}
|
|
4509
4507
|
return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
|
|
4510
4508
|
}
|
|
@@ -4520,7 +4518,7 @@ var ServerRenderer = class {
|
|
|
4520
4518
|
);
|
|
4521
4519
|
return { html: rendered.html, head: rendered.head || "" };
|
|
4522
4520
|
}
|
|
4523
|
-
const { head, body } =
|
|
4521
|
+
const { head, body } = _chunk4B6YJ5DScjs.takeFarmHoistedHead.call(void 0,
|
|
4524
4522
|
await this.renderElementToCompleteHTML(element, options),
|
|
4525
4523
|
true
|
|
4526
4524
|
);
|
|
@@ -4528,7 +4526,7 @@ var ServerRenderer = class {
|
|
|
4528
4526
|
}
|
|
4529
4527
|
/** Islands mode sends large prop values once, keyed by content (RFC 0003). */
|
|
4530
4528
|
islandValues() {
|
|
4531
|
-
return
|
|
4529
|
+
return _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _113 => _113.config, 'access', _114 => _114.experimental, 'optionalAccess', _115 => _115.serverComponents])) === "islands";
|
|
4532
4530
|
}
|
|
4533
4531
|
/**
|
|
4534
4532
|
* The page's element. Only React renders an async component, so for any other renderer Farm
|
|
@@ -4537,7 +4535,7 @@ var ServerRenderer = class {
|
|
|
4537
4535
|
*/
|
|
4538
4536
|
async createPageElement(PageComponent, pageProps) {
|
|
4539
4537
|
const runtime = this.rendererRuntime;
|
|
4540
|
-
if (
|
|
4538
|
+
if (_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, this.config.renderer) || typeof PageComponent !== "function" || _optionalChain([PageComponent, 'access', _116 => _116.constructor, 'optionalAccess', _117 => _117.name]) !== "AsyncFunction") {
|
|
4541
4539
|
return runtime.createElement(PageComponent, pageProps);
|
|
4542
4540
|
}
|
|
4543
4541
|
const result = await PageComponent(pageProps);
|
|
@@ -4636,7 +4634,7 @@ var ServerRenderer = class {
|
|
|
4636
4634
|
rejectLateRedirects: true
|
|
4637
4635
|
}
|
|
4638
4636
|
);
|
|
4639
|
-
return fragmentTag ?
|
|
4637
|
+
return fragmentTag ? _chunk4B6YJ5DScjs.takeFarmNavigationOutlet.call(void 0, html, fragmentTag) : html;
|
|
4640
4638
|
}
|
|
4641
4639
|
/**
|
|
4642
4640
|
* A built-in docs runtime page (`docs.entry`, no adapter) under layouts that hydrate, or whose
|
|
@@ -4668,7 +4666,7 @@ var ServerRenderer = class {
|
|
|
4668
4666
|
islands: _optionalChain([entry, 'optionalAccess', _129 => _129.hasIsolatedClientBoundaries]) === true
|
|
4669
4667
|
};
|
|
4670
4668
|
});
|
|
4671
|
-
if (!
|
|
4669
|
+
if (!_chunk4B6YJ5DScjs.farmDocsLayoutsWrapPage.call(void 0, layouts)) return response;
|
|
4672
4670
|
const shouldHydrateLayout = layouts.some((layout) => layout.shouldHydrate);
|
|
4673
4671
|
const hasIsolatedClientBoundaries = layouts.some(
|
|
4674
4672
|
(layout) => layout.hasIsolatedClientBoundaries
|
|
@@ -4689,8 +4687,8 @@ var ServerRenderer = class {
|
|
|
4689
4687
|
...layout,
|
|
4690
4688
|
Component: _optionalChain([modules, 'access', _130 => _130[index], 'optionalAccess', _131 => _131.default])
|
|
4691
4689
|
}));
|
|
4692
|
-
const islandStrategy =
|
|
4693
|
-
const tree = await
|
|
4690
|
+
const islandStrategy = _chunk4B6YJ5DScjs.resolveFarmDocsLayoutIslandStrategy.call(void 0, treeLayouts);
|
|
4691
|
+
const tree = await _chunk4B6YJ5DScjs.createFarmDocsLayoutTree.call(void 0, this.rendererRuntime, {
|
|
4694
4692
|
pageHtml: bodyMatch[2],
|
|
4695
4693
|
layouts: treeLayouts,
|
|
4696
4694
|
params: matched.params,
|
|
@@ -4711,7 +4709,7 @@ var ServerRenderer = class {
|
|
|
4711
4709
|
)
|
|
4712
4710
|
)
|
|
4713
4711
|
);
|
|
4714
|
-
const rootMarkup =
|
|
4712
|
+
const rootMarkup = _chunk4B6YJ5DScjs.placeFarmDocsLayoutRoot.call(void 0, rendered.html);
|
|
4715
4713
|
const clientLayouts = layouts.map((layout) => ({
|
|
4716
4714
|
pattern: layout.pattern,
|
|
4717
4715
|
modulePath: _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, layout.modulePath, root),
|
|
@@ -4803,7 +4801,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4803
4801
|
* Check if a path should be served from SSG cache
|
|
4804
4802
|
*/
|
|
4805
4803
|
async shouldServeSSG(pathname) {
|
|
4806
|
-
const ssgPage =
|
|
4804
|
+
const ssgPage = _chunkL3BSHASBcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
4807
4805
|
if (!ssgPage) return null;
|
|
4808
4806
|
const cached = await this.getCachedSSGPage(pathname);
|
|
4809
4807
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -5303,7 +5301,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5303
5301
|
throw error;
|
|
5304
5302
|
}
|
|
5305
5303
|
}
|
|
5306
|
-
const renderingConfig = await
|
|
5304
|
+
const renderingConfig = await _chunkL3BSHASBcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5307
5305
|
routeModule,
|
|
5308
5306
|
route.modulePath,
|
|
5309
5307
|
{ experimentalPPR: _optionalChain([this, 'access', _153 => _153.config, 'access', _154 => _154.experimental, 'optionalAccess', _155 => _155.ppr]) === true }
|
|
@@ -5395,7 +5393,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5395
5393
|
const routeManifestEntry = routeManifest.routes.find(
|
|
5396
5394
|
(entry) => entry.pattern === route.pattern
|
|
5397
5395
|
);
|
|
5398
|
-
const moduleMetadata = routeManifestEntry ||
|
|
5396
|
+
const moduleMetadata = routeManifestEntry || _chunkEBSL5TW7cjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
5399
5397
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
5400
5398
|
const renderedRouteSlots = await Promise.all(
|
|
5401
5399
|
routeSlots.map(async (slot) => {
|
|
@@ -5805,7 +5803,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5805
5803
|
}
|
|
5806
5804
|
}
|
|
5807
5805
|
emitFarmRenderError(req, pathname, error);
|
|
5808
|
-
const errorStatus =
|
|
5806
|
+
const errorStatus = _chunk4B6YJ5DScjs.resolveDefaultErrorStatus.call(void 0, error);
|
|
5809
5807
|
if (pprRefreshRoute) {
|
|
5810
5808
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
5811
5809
|
type: "ppr.refresh.error",
|
|
@@ -5849,13 +5847,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5849
5847
|
for (let i = providers.length - 1; i >= 0; i--) {
|
|
5850
5848
|
const provider = providers[i];
|
|
5851
5849
|
if (provider.component || provider.type === "clerk") {
|
|
5852
|
-
const rendererCapabilities =
|
|
5850
|
+
const rendererCapabilities = _chunk3OKSEJ33cjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
|
|
5853
5851
|
if (!rendererCapabilities.functionComponents) {
|
|
5854
5852
|
throw new Error(
|
|
5855
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.`
|
|
5856
5854
|
);
|
|
5857
5855
|
}
|
|
5858
|
-
if (provider.type === "clerk" && !
|
|
5856
|
+
if (provider.type === "clerk" && !_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, this.config.renderer)) {
|
|
5859
5857
|
throw new Error(
|
|
5860
5858
|
`Integration provider \`${provider.name}\` uses Clerk's React components, which require the React renderer.`
|
|
5861
5859
|
);
|
|
@@ -5891,7 +5889,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5891
5889
|
}
|
|
5892
5890
|
if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
|
|
5893
5891
|
_nullishCoalesce(providerSourceModule, () => ( "")),
|
|
5894
|
-
|
|
5892
|
+
_chunk3OKSEJ33cjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _188 => _188.config, 'access', _189 => _189.renderer, 'optionalAccess', _190 => _190.componentExtensions]))
|
|
5895
5893
|
)) {
|
|
5896
5894
|
ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
|
|
5897
5895
|
}
|
|
@@ -6038,7 +6036,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6038
6036
|
origin: await this.getAgentOrigin(request2),
|
|
6039
6037
|
readMarkdown: llmsContext.markdown
|
|
6040
6038
|
}) : value;
|
|
6041
|
-
const response =
|
|
6039
|
+
const response = _chunk4B6YJ5DScjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
6042
6040
|
method,
|
|
6043
6041
|
request: request2
|
|
6044
6042
|
});
|
|
@@ -6074,7 +6072,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6074
6072
|
}) : context.defaults;
|
|
6075
6073
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6076
6074
|
res,
|
|
6077
|
-
|
|
6075
|
+
_chunk4B6YJ5DScjs.createFarmMetadataRouteResponse.call(void 0,
|
|
6078
6076
|
kind,
|
|
6079
6077
|
body,
|
|
6080
6078
|
{ revalidate: config.revalidate },
|
|
@@ -6109,7 +6107,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6109
6107
|
});
|
|
6110
6108
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6111
6109
|
res,
|
|
6112
|
-
|
|
6110
|
+
_chunk4B6YJ5DScjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
6113
6111
|
);
|
|
6114
6112
|
} catch (error) {
|
|
6115
6113
|
_chunk7U4XF76Rcjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
@@ -6159,7 +6157,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6159
6157
|
);
|
|
6160
6158
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
6161
6159
|
res,
|
|
6162
|
-
|
|
6160
|
+
_chunk4B6YJ5DScjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
|
|
6163
6161
|
);
|
|
6164
6162
|
} catch (error) {
|
|
6165
6163
|
_chunk7U4XF76Rcjs.logger.error(`Generated sitemap.xml failed: ${error}`);
|
|
@@ -6188,7 +6186,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6188
6186
|
getAgentListedRoutes() {
|
|
6189
6187
|
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _225 => _225.middlewareRoutes, 'optionalCall', _226 => _226()]), () => ( [])) };
|
|
6190
6188
|
return [...this.routeManager.getRoutes()].filter(
|
|
6191
|
-
([pattern]) => !pattern.includes("[") && !
|
|
6189
|
+
([pattern]) => !pattern.includes("[") && !_chunk4B6YJ5DScjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
|
|
6192
6190
|
);
|
|
6193
6191
|
}
|
|
6194
6192
|
/**
|
|
@@ -6217,7 +6215,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6217
6215
|
if (this.routeManager.matchRoute(_chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
6218
6216
|
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0,
|
|
6219
6217
|
readAppPackageIdentity(this.config.root),
|
|
6220
|
-
|
|
6218
|
+
_chunkCVZY4TLWcjs.FARM_VERSION
|
|
6221
6219
|
))));
|
|
6222
6220
|
return _chunkW53Z4WDIcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
6223
6221
|
}
|
|
@@ -6311,7 +6309,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6311
6309
|
pages,
|
|
6312
6310
|
config,
|
|
6313
6311
|
rootMetadata,
|
|
6314
|
-
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 ? [] : _chunk22BTYPIXcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
6315
6313
|
basePath: this.config.basePath,
|
|
6316
6314
|
apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
6317
6315
|
_chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
|
|
@@ -6418,7 +6416,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6418
6416
|
}
|
|
6419
6417
|
/** The renderer that draws a metadata image: none for React, whose elements Satori reads directly. */
|
|
6420
6418
|
getMetadataImageRenderer() {
|
|
6421
|
-
return
|
|
6419
|
+
return _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime;
|
|
6422
6420
|
}
|
|
6423
6421
|
async writeStaticMetadataImageResponse(req, res, image) {
|
|
6424
6422
|
const method = (req.method || "GET").toUpperCase();
|
|
@@ -6481,7 +6479,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6481
6479
|
});
|
|
6482
6480
|
let wrapped = errorElement;
|
|
6483
6481
|
const boundaryLayouts = options.errorPattern === void 0 ? options.layouts : options.layouts.filter(
|
|
6484
|
-
(layout) => !("pattern" in layout) ||
|
|
6482
|
+
(layout) => !("pattern" in layout) || _chunk4B6YJ5DScjs.routeBoundaryCoversDirectory.call(void 0,
|
|
6485
6483
|
layout.pattern,
|
|
6486
6484
|
options.errorPattern
|
|
6487
6485
|
)
|
|
@@ -6537,7 +6535,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6537
6535
|
*/
|
|
6538
6536
|
renderPreHydrationHold(req, bootClient) {
|
|
6539
6537
|
const hydrates = req.__FARM_IS_CLIENT_COMPONENT__ === true || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true;
|
|
6540
|
-
return hydrates && !bootClient && !this.isIslandsOnlyPage(req) ?
|
|
6538
|
+
return hydrates && !bootClient && !this.isIslandsOnlyPage(req) ? _chunk4B6YJ5DScjs.createPreHydrationClickQueueScript.call(void 0, ) : "";
|
|
6541
6539
|
}
|
|
6542
6540
|
async renderBufferedSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6543
6541
|
const startedAt = Date.now();
|
|
@@ -6618,19 +6616,19 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6618
6616
|
i18nSnapshot,
|
|
6619
6617
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6620
6618
|
) : "";
|
|
6621
|
-
const themeDocument =
|
|
6619
|
+
const themeDocument = _chunk4B6YJ5DScjs.createFarmThemeDocumentParts.call(void 0,
|
|
6622
6620
|
this.config.theme,
|
|
6623
6621
|
this.config.basePath,
|
|
6624
6622
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
6625
6623
|
);
|
|
6626
6624
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
6627
|
-
const fullDocument =
|
|
6625
|
+
const fullDocument = _chunk4B6YJ5DScjs.extractFarmFullDocument.call(void 0, _chunk4B6YJ5DScjs.markFarmDocumentLayouts.call(void 0, content));
|
|
6628
6626
|
let html;
|
|
6629
6627
|
if (fullDocument) {
|
|
6630
6628
|
const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
|
|
6631
|
-
const documentHtml = shouldReplaceLayoutTitle ?
|
|
6632
|
-
const effectiveRendererHead = hasExplicitTitle ?
|
|
6633
|
-
html =
|
|
6629
|
+
const documentHtml = shouldReplaceLayoutTitle ? _chunk4B6YJ5DScjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
|
|
6630
|
+
const effectiveRendererHead = hasExplicitTitle ? _chunk4B6YJ5DScjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
|
|
6631
|
+
html = _chunk4B6YJ5DScjs.composeFarmFullDocument.call(void 0, documentHtml, {
|
|
6634
6632
|
fallbackIcon: !hasFavicon,
|
|
6635
6633
|
viewport: viewportTags,
|
|
6636
6634
|
htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
|
|
@@ -6736,10 +6734,10 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6736
6734
|
}
|
|
6737
6735
|
async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6738
6736
|
const runtime = this.rendererRuntime;
|
|
6739
|
-
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (
|
|
6737
|
+
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (_chunk3OKSEJ33cjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node").web && runtime.renderToReadableStream ? pipeFarmRendererWebStream(runtime) : void 0)));
|
|
6740
6738
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6741
6739
|
const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument(req);
|
|
6742
|
-
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 || !_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, this.config.renderer))) {
|
|
6743
6741
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
6744
6742
|
}
|
|
6745
6743
|
return new Promise((resolve3, reject) => {
|
|
@@ -6835,7 +6833,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6835
6833
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6836
6834
|
) : "";
|
|
6837
6835
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6838
|
-
const themeDocument =
|
|
6836
|
+
const themeDocument = _chunk4B6YJ5DScjs.createFarmThemeDocumentParts.call(void 0,
|
|
6839
6837
|
this.config.theme,
|
|
6840
6838
|
this.config.basePath,
|
|
6841
6839
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
@@ -6894,10 +6892,10 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6894
6892
|
let pendingShell = streamDocument ? "" : stampDocumentHTML(shell);
|
|
6895
6893
|
let heldHead = "";
|
|
6896
6894
|
const releaseShell = (complete) => {
|
|
6897
|
-
const split =
|
|
6895
|
+
const split = _chunk4B6YJ5DScjs.takeFarmHoistedHead.call(void 0, heldHead, complete);
|
|
6898
6896
|
if (!split) return null;
|
|
6899
|
-
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ?
|
|
6900
|
-
const opened =
|
|
6897
|
+
const shellHead = !hasExplicitTitle && /<title[\s>]/i.test(split.head) ? _chunk4B6YJ5DScjs.removeFarmDocumentTitles.call(void 0, pendingShell) : pendingShell;
|
|
6898
|
+
const opened = _chunk4B6YJ5DScjs.appendFarmHead.call(void 0, shellHead, split.head);
|
|
6901
6899
|
pendingShell = "";
|
|
6902
6900
|
heldHead = "";
|
|
6903
6901
|
htmlParts.push(opened);
|
|
@@ -6913,11 +6911,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6913
6911
|
${stampDocumentHTML(earlyClientScript)}`
|
|
6914
6912
|
)
|
|
6915
6913
|
} : document;
|
|
6916
|
-
const documentTransform = streamDocument ?
|
|
6914
|
+
const documentTransform = streamDocument ? _chunk4B6YJ5DScjs.createFarmStreamedDocumentTransform.call(void 0,
|
|
6917
6915
|
(opening) => withEarlyClient(
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
hasExplicitTitle ?
|
|
6916
|
+
_chunk4B6YJ5DScjs.openFarmStreamedDocument.call(void 0,
|
|
6917
|
+
_chunk4B6YJ5DScjs.markFarmDocumentLayouts.call(void 0,
|
|
6918
|
+
hasExplicitTitle ? _chunk4B6YJ5DScjs.removeFarmDocumentTitles.call(void 0, opening) : opening
|
|
6921
6919
|
),
|
|
6922
6920
|
{
|
|
6923
6921
|
fallbackIcon: !hasFavicon,
|
|
@@ -6958,7 +6956,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6958
6956
|
const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
|
|
6959
6957
|
if (!checkedFullDocument && renderedText) {
|
|
6960
6958
|
documentPrefix += renderedText;
|
|
6961
|
-
const prefix =
|
|
6959
|
+
const prefix = _chunk4B6YJ5DScjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
|
|
6962
6960
|
if (prefix !== "pending") {
|
|
6963
6961
|
checkedFullDocument = true;
|
|
6964
6962
|
documentPrefix = "";
|
|
@@ -7216,7 +7214,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7216
7214
|
*/
|
|
7217
7215
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
7218
7216
|
if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
|
|
7219
|
-
return
|
|
7217
|
+
return _chunk4B6YJ5DScjs.createLateRedirectRecovery.call(void 0,
|
|
7220
7218
|
this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
|
|
7221
7219
|
this.getCspNonce(req) || ""
|
|
7222
7220
|
);
|
|
@@ -7237,14 +7235,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7237
7235
|
_chunk7U4XF76Rcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
7238
7236
|
}
|
|
7239
7237
|
}
|
|
7240
|
-
return
|
|
7238
|
+
return _chunk4B6YJ5DScjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
|
|
7241
7239
|
}
|
|
7242
7240
|
async render404(req, res) {
|
|
7243
7241
|
res.statusCode = 404;
|
|
7244
7242
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7245
7243
|
trustProxy: _optionalChain([this, 'access', _306 => _306.config, 'access', _307 => _307.server, 'optionalAccess', _308 => _308.trustProxy])
|
|
7246
7244
|
}).pathname;
|
|
7247
|
-
if (
|
|
7245
|
+
if (_chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7248
7246
|
res.setHeader("Content-Type", "application/json");
|
|
7249
7247
|
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
7250
7248
|
return;
|
|
@@ -7267,7 +7265,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7267
7265
|
return;
|
|
7268
7266
|
}
|
|
7269
7267
|
const appDir = path10.join(this.config.root, this.config.srcDir, "app");
|
|
7270
|
-
const notFoundExtensions =
|
|
7268
|
+
const notFoundExtensions = _chunk3OKSEJ33cjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7271
7269
|
let layoutModule = null;
|
|
7272
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;
|
|
7273
7271
|
try {
|
|
@@ -7326,10 +7324,10 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7326
7324
|
trustProxy: _optionalChain([this, 'access', _320 => _320.config, 'access', _321 => _321.server, 'optionalAccess', _322 => _322.trustProxy])
|
|
7327
7325
|
});
|
|
7328
7326
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7329
|
-
const statusText =
|
|
7327
|
+
const statusText = _chunk4B6YJ5DScjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
7330
7328
|
const content = this.stampFarmScripts(
|
|
7331
7329
|
req,
|
|
7332
|
-
|
|
7330
|
+
_chunk4B6YJ5DScjs.createDefaultErrorMarkup.call(void 0, {
|
|
7333
7331
|
statusCode,
|
|
7334
7332
|
statusText,
|
|
7335
7333
|
requestPath: requestUrl.pathname,
|
|
@@ -7339,7 +7337,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7339
7337
|
stack: _optionalChain([diagnostics, 'optionalAccess', _325 => _325.stack]),
|
|
7340
7338
|
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _326 => _326.sourceFrame]),
|
|
7341
7339
|
development: isDev,
|
|
7342
|
-
farmVersion:
|
|
7340
|
+
farmVersion: _chunkCVZY4TLWcjs.FARM_VERSION,
|
|
7343
7341
|
nodeVersion: process.version,
|
|
7344
7342
|
mode: isDev ? "development" : "production"
|
|
7345
7343
|
})
|
|
@@ -7386,7 +7384,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7386
7384
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
7387
7385
|
) : "";
|
|
7388
7386
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
7389
|
-
const themeDocument =
|
|
7387
|
+
const themeDocument = _chunk4B6YJ5DScjs.createFarmThemeDocumentParts.call(void 0,
|
|
7390
7388
|
this.config.theme,
|
|
7391
7389
|
this.config.basePath,
|
|
7392
7390
|
_chunk5AMH6AFAcjs.getTheme.call(void 0, )
|
|
@@ -7396,10 +7394,10 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7396
7394
|
_optionalChain([this, 'access', _333 => _333.rendererRuntime, 'access', _334 => _334.generateHydrationScript, 'optionalCall', _335 => _335()]) || ""
|
|
7397
7395
|
);
|
|
7398
7396
|
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _336 => _336.metadata, 'optionalAccess', _337 => _337.viewport]));
|
|
7399
|
-
const fullDocument =
|
|
7397
|
+
const fullDocument = _chunk4B6YJ5DScjs.extractFarmFullDocument.call(void 0, _chunk4B6YJ5DScjs.markFarmDocumentLayouts.call(void 0, content));
|
|
7400
7398
|
if (fullDocument) {
|
|
7401
|
-
return
|
|
7402
|
-
metadataHead ?
|
|
7399
|
+
return _chunk4B6YJ5DScjs.composeFarmFullDocument.call(void 0,
|
|
7400
|
+
metadataHead ? _chunk4B6YJ5DScjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
|
|
7403
7401
|
{
|
|
7404
7402
|
fallbackIcon: !metadataHead,
|
|
7405
7403
|
viewport: viewportTags,
|
|
@@ -7529,7 +7527,7 @@ var FarmApp = class {
|
|
|
7529
7527
|
await this.serverRenderer.initialize();
|
|
7530
7528
|
await this.verifyAppStructure();
|
|
7531
7529
|
await this.routeManager.discoverRoutes();
|
|
7532
|
-
if (
|
|
7530
|
+
if (_chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) this.assertNoPageRoutes();
|
|
7533
7531
|
this.routeManager.generateClientManifest(this.config.root);
|
|
7534
7532
|
if (process.env.FARM_VERBOSE) {
|
|
7535
7533
|
_chunk7U4XF76Rcjs.logger.success("Farm.js application initialized successfully!");
|
|
@@ -7558,7 +7556,7 @@ var FarmApp = class {
|
|
|
7558
7556
|
outDir: config.outDir || "dist",
|
|
7559
7557
|
basePath,
|
|
7560
7558
|
trailingSlash: _nullishCoalesce(config.trailingSlash, () => ( false)),
|
|
7561
|
-
renderer:
|
|
7559
|
+
renderer: _chunk3OKSEJ33cjs.resolveFarmRenderer.call(void 0, config.renderer),
|
|
7562
7560
|
preset: _nullishCoalesce(config.preset, () => ( "node-server")),
|
|
7563
7561
|
deploy: config.deploy || {},
|
|
7564
7562
|
storage: config.storage || {},
|
|
@@ -7579,7 +7577,7 @@ var FarmApp = class {
|
|
|
7579
7577
|
security: _chunk6JHZPB52cjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7580
7578
|
images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
|
|
7581
7579
|
config.images,
|
|
7582
|
-
|
|
7580
|
+
_chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
|
|
7583
7581
|
),
|
|
7584
7582
|
performance: _chunkEACD6ND7cjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7585
7583
|
theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
@@ -7649,14 +7647,14 @@ var FarmApp = class {
|
|
|
7649
7647
|
`App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
|
|
7650
7648
|
);
|
|
7651
7649
|
}
|
|
7652
|
-
const componentExtensions =
|
|
7650
|
+
const componentExtensions = _chunk3OKSEJ33cjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7653
7651
|
const rootLayoutPaths = appDirs.flatMap(
|
|
7654
7652
|
(appDir) => componentExtensions.map((extension) => path4.default.join(appDir, `layout${extension}`))
|
|
7655
7653
|
);
|
|
7656
7654
|
const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunk7U4XF76Rcjs.fileExists.call(void 0, p))).then(
|
|
7657
7655
|
(results) => results.some(Boolean)
|
|
7658
7656
|
);
|
|
7659
|
-
if (!hasRootLayout && !
|
|
7657
|
+
if (!hasRootLayout && !_chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7660
7658
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
7661
7659
|
`No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
|
|
7662
7660
|
);
|
|
@@ -8567,7 +8565,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
|
|
|
8567
8565
|
function isInstalledPackage(root, specifier) {
|
|
8568
8566
|
const parts = specifier.split("/");
|
|
8569
8567
|
const name = specifier.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
|
|
8570
|
-
const directory =
|
|
8568
|
+
const directory = _chunkF7JVO3OZcjs.findFarmAppPackageDir.call(void 0, root, name);
|
|
8571
8569
|
return directory !== void 0 && directory.split(path4.default.sep).includes("node_modules");
|
|
8572
8570
|
}
|
|
8573
8571
|
function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
@@ -8580,7 +8578,12 @@ function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
|
8580
8578
|
// React entry imports `react-dom/client` instead, which is already listed. A linked
|
|
8581
8579
|
// renderer stays source: pre-bundling it would copy the packages it shares with the app's
|
|
8582
8580
|
// components into the bundle, so a hook would read a different copy than the renderer set.
|
|
8583
|
-
...renderer && root && !
|
|
8581
|
+
...renderer && root && !_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) && _chunkPWDBWXQIcjs.isPackageSpecifier.call(void 0, renderer.client) && isInstalledPackage(root, renderer.client) ? [renderer.client] : [],
|
|
8582
|
+
// The islands runtime of a renderer that declares `islands`, which only Farm's entry imports.
|
|
8583
|
+
...renderer && !_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) && _chunk3OKSEJ33cjs.getFarmRendererCapabilities.call(void 0, renderer).islands ? [
|
|
8584
|
+
"@farm.js/core/internal/renderer-islands",
|
|
8585
|
+
"@farm.js/core > @farm.js/islx/islands/client"
|
|
8586
|
+
] : []
|
|
8584
8587
|
])
|
|
8585
8588
|
);
|
|
8586
8589
|
}
|
|
@@ -8593,7 +8596,7 @@ function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
|
8593
8596
|
});
|
|
8594
8597
|
}
|
|
8595
8598
|
function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
8596
|
-
if (
|
|
8599
|
+
if (_chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, renderer)) return { noDiscovery: true, include: [] };
|
|
8597
8600
|
const jsxImportSource = renderer ? renderer.jsxImportSource : void 0;
|
|
8598
8601
|
return {
|
|
8599
8602
|
// Keep normal application dependency discovery for CJS-only packages, but
|