@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
|
@@ -32,7 +32,7 @@ var _chunkMHKPXX3Jcjs = require('./chunk-MHKPXX3J.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkUDWBTABTcjs = require('./chunk-UDWBTABT.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ var _chunkQUHDVJMRcjs = require('./chunk-QUHDVJMR.cjs');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkBLZCAFGJcjs = require('./chunk-BLZCAFGJ.cjs');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
@@ -70,7 +70,7 @@ var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
var
|
|
73
|
+
var _chunkFDU4Q4QPcjs = require('./chunk-FDU4Q4QP.cjs');
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
var _chunk3BTN3NP7cjs = require('./chunk-3BTN3NP7.cjs');
|
|
@@ -115,7 +115,7 @@ var _chunkO4JYMU5Ncjs = require('./chunk-O4JYMU5N.cjs');
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
|
|
118
|
-
var
|
|
118
|
+
var _chunkP253SZJFcjs = require('./chunk-P253SZJF.cjs');
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
|
|
@@ -131,14 +131,14 @@ var _chunkVACYUMXWcjs = require('./chunk-VACYUMXW.cjs');
|
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
|
|
134
|
-
var
|
|
134
|
+
var _chunkXMVZXZ32cjs = require('./chunk-XMVZXZ32.cjs');
|
|
135
135
|
|
|
136
136
|
|
|
137
|
-
var
|
|
137
|
+
var _chunkCPSFDQKJcjs = require('./chunk-CPSFDQKJ.cjs');
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
|
|
141
|
-
var
|
|
141
|
+
var _chunkBAD6T5NUcjs = require('./chunk-BAD6T5NU.cjs');
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
|
|
@@ -165,7 +165,7 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
|
165
165
|
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
var
|
|
168
|
+
var _chunkTQJ35BBWcjs = require('./chunk-TQJ35BBW.cjs');
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
|
|
@@ -173,7 +173,7 @@ var _chunkTOUC6BR3cjs = require('./chunk-TOUC6BR3.cjs');
|
|
|
173
173
|
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
174
174
|
|
|
175
175
|
|
|
176
|
-
var
|
|
176
|
+
var _chunkNXOZRI3Bcjs = require('./chunk-NXOZRI3B.cjs');
|
|
177
177
|
|
|
178
178
|
|
|
179
179
|
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
@@ -194,7 +194,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
|
194
194
|
|
|
195
195
|
|
|
196
196
|
|
|
197
|
-
var
|
|
197
|
+
var _chunkQYDGIXQ5cjs = require('./chunk-QYDGIXQ5.cjs');
|
|
198
198
|
|
|
199
199
|
|
|
200
200
|
|
|
@@ -229,7 +229,7 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
229
229
|
|
|
230
230
|
|
|
231
231
|
|
|
232
|
-
var
|
|
232
|
+
var _chunkT7UC2ORAcjs = require('./chunk-T7UC2ORA.cjs');
|
|
233
233
|
|
|
234
234
|
|
|
235
235
|
|
|
@@ -308,7 +308,7 @@ var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
|
|
|
308
308
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
309
309
|
|
|
310
310
|
|
|
311
|
-
var
|
|
311
|
+
var _chunk2NKNP4AHcjs = require('./chunk-2NKNP4AH.cjs');
|
|
312
312
|
|
|
313
313
|
|
|
314
314
|
var _chunkY3DO7BIJcjs = require('./chunk-Y3DO7BIJ.cjs');
|
|
@@ -661,7 +661,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
661
661
|
isPathGuarded: options.isPathGuarded,
|
|
662
662
|
basePath
|
|
663
663
|
});
|
|
664
|
-
const apiHandler =
|
|
664
|
+
const apiHandler = _chunkBLZCAFGJcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
665
665
|
rootDir: options.root,
|
|
666
666
|
srcDir: options.srcDir,
|
|
667
667
|
docs,
|
|
@@ -1105,7 +1105,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
1105
1105
|
const routes = [];
|
|
1106
1106
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
1107
1107
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
1108
|
-
const rendering = await
|
|
1108
|
+
const rendering = await _chunkXMVZXZ32cjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
1109
1109
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
1110
1110
|
routes.push({
|
|
1111
1111
|
kind: "page",
|
|
@@ -1718,7 +1718,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
|
|
|
1718
1718
|
// removed block used (`readFileSync` for a version, say).
|
|
1719
1719
|
enforce: "pre",
|
|
1720
1720
|
transform: {
|
|
1721
|
-
filter: { id:
|
|
1721
|
+
filter: { id: _chunkP253SZJFcjs.fileNamePattern.call(void 0, configFiles) },
|
|
1722
1722
|
async handler(code, id) {
|
|
1723
1723
|
const file = id.split("?", 1)[0];
|
|
1724
1724
|
if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
|
|
@@ -2037,7 +2037,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
2037
2037
|
logLevel: "silent",
|
|
2038
2038
|
plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
|
|
2039
2039
|
resolve: {
|
|
2040
|
-
alias:
|
|
2040
|
+
alias: _chunkP253SZJFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2041
2041
|
conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
|
|
2042
2042
|
},
|
|
2043
2043
|
transform: {
|
|
@@ -2397,7 +2397,7 @@ function hasReactDomEdgeServerBuild(root) {
|
|
|
2397
2397
|
}
|
|
2398
2398
|
}
|
|
2399
2399
|
function shouldAliasReactServerToWebBuild(renderer, preset) {
|
|
2400
|
-
return
|
|
2400
|
+
return _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
|
|
2401
2401
|
}
|
|
2402
2402
|
function isCloudflareImagePreset(preset) {
|
|
2403
2403
|
return preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module";
|
|
@@ -2439,7 +2439,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2439
2439
|
return {
|
|
2440
2440
|
name: "farm-omitted-metadata-image-runtime",
|
|
2441
2441
|
resolveId: {
|
|
2442
|
-
filter: { id:
|
|
2442
|
+
filter: { id: _chunkP253SZJFcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
|
|
2443
2443
|
handler(source, importer) {
|
|
2444
2444
|
if (source !== "@vercel/og") return null;
|
|
2445
2445
|
const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
|
|
@@ -2448,7 +2448,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2448
2448
|
}
|
|
2449
2449
|
},
|
|
2450
2450
|
load: {
|
|
2451
|
-
filter: { id:
|
|
2451
|
+
filter: { id: _chunkP253SZJFcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
|
|
2452
2452
|
handler(id) {
|
|
2453
2453
|
if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
|
|
2454
2454
|
return `
|
|
@@ -2917,7 +2917,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2917
2917
|
const productionVite = productionViteResult.value;
|
|
2918
2918
|
_chunk7U4XF76Rcjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
|
|
2919
2919
|
const mobileClient = shouldBuildFarmMobileClient(config);
|
|
2920
|
-
const rendererDisabled =
|
|
2920
|
+
const rendererDisabled = _chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
2921
2921
|
const buildClientBundle = async () => {
|
|
2922
2922
|
if (rendererDisabled) {
|
|
2923
2923
|
await fs5.rm(clientOutputDir, { recursive: true, force: true });
|
|
@@ -3068,7 +3068,7 @@ function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
|
|
|
3068
3068
|
for (const route of pageRoutes) {
|
|
3069
3069
|
if (route.source === void 0 || !_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
|
|
3070
3070
|
const { body } = _chunk26WP75W5cjs.parseMarkdownFrontmatter.call(void 0, route.source);
|
|
3071
|
-
const rendering =
|
|
3071
|
+
const rendering = _chunkXMVZXZ32cjs.resolveRouteRenderingConfig.call(void 0,
|
|
3072
3072
|
_chunk26WP75W5cjs.readFarmMarkdownRouteConfig.call(void 0, body),
|
|
3073
3073
|
route.source
|
|
3074
3074
|
);
|
|
@@ -3112,7 +3112,7 @@ async function writeFarmVideoPlayerToClient(outputDir) {
|
|
|
3112
3112
|
const filePath = _path2.default.join(outputDir, _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH.slice(1));
|
|
3113
3113
|
await fs5.mkdir(_path2.default.dirname(filePath), { recursive: true });
|
|
3114
3114
|
try {
|
|
3115
|
-
await fs5.writeFile(filePath,
|
|
3115
|
+
await fs5.writeFile(filePath, _chunkP253SZJFcjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
|
|
3116
3116
|
} catch (error) {
|
|
3117
3117
|
if (error.code !== "EEXIST") throw error;
|
|
3118
3118
|
}
|
|
@@ -3146,7 +3146,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
3146
3146
|
}
|
|
3147
3147
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
3148
3148
|
await fs5.writeFile(fontCssPath, normalizedFontCss);
|
|
3149
|
-
await fs5.writeFile(clientCssPath,
|
|
3149
|
+
await fs5.writeFile(clientCssPath, _chunkP253SZJFcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
3150
3150
|
}
|
|
3151
3151
|
function importsFarmClientBlockedPackage(id, packageName) {
|
|
3152
3152
|
return id === packageName || id.startsWith(`${packageName}/`);
|
|
@@ -3196,10 +3196,10 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
3196
3196
|
}
|
|
3197
3197
|
}
|
|
3198
3198
|
function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, options = {}) {
|
|
3199
|
-
const key =
|
|
3199
|
+
const key = _chunkQYDGIXQ5cjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
|
|
3200
3200
|
let plan = cache.get(key);
|
|
3201
3201
|
if (!plan) {
|
|
3202
|
-
plan =
|
|
3202
|
+
plan = _chunkQYDGIXQ5cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
3203
3203
|
cache.set(key, plan);
|
|
3204
3204
|
}
|
|
3205
3205
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -3228,25 +3228,25 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3228
3228
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
3229
3229
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
3230
3230
|
);
|
|
3231
|
-
if (_optionalChain([config, 'access', _99 => _99.experimental, 'optionalAccess', _100 => _100.isolatedClientHydration]) === "enabled" &&
|
|
3231
|
+
if (_optionalChain([config, 'access', _99 => _99.experimental, 'optionalAccess', _100 => _100.isolatedClientHydration]) === "enabled" && _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _101 => _101.experimental, 'optionalAccess', _102 => _102.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
3232
3232
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3233
3233
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
3234
3234
|
);
|
|
3235
3235
|
}
|
|
3236
|
-
const isolatedMode =
|
|
3236
|
+
const isolatedMode = _chunkQYDGIXQ5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3237
3237
|
_optionalChain([config, 'access', _103 => _103.experimental, 'optionalAccess', _104 => _104.isolatedClientHydration]),
|
|
3238
3238
|
{
|
|
3239
|
-
serverComponents:
|
|
3239
|
+
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _105 => _105.experimental, 'optionalAccess', _106 => _106.serverComponents])) === "rsc",
|
|
3240
3240
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
3241
3241
|
}
|
|
3242
3242
|
);
|
|
3243
|
-
const planOptions =
|
|
3243
|
+
const planOptions = _chunkQYDGIXQ5cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
3244
3244
|
config.renderer,
|
|
3245
3245
|
Boolean(unsupportedIntegrationProvider)
|
|
3246
3246
|
);
|
|
3247
3247
|
const pagePlanOptions = {
|
|
3248
3248
|
...planOptions,
|
|
3249
|
-
serverOwners:
|
|
3249
|
+
serverOwners: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _107 => _107.experimental, 'optionalAccess', _108 => _108.serverComponents])) === "islands"
|
|
3250
3250
|
};
|
|
3251
3251
|
const layoutPlanOptions = {
|
|
3252
3252
|
...planOptions,
|
|
@@ -3254,7 +3254,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3254
3254
|
};
|
|
3255
3255
|
const layoutAppliesToRoute = _chunk4B6YJ5DScjs.routeBoundaryCoversDirectory;
|
|
3256
3256
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3257
|
-
const islandsMode =
|
|
3257
|
+
const islandsMode = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _109 => _109.experimental, 'optionalAccess', _110 => _110.serverComponents])) === "islands";
|
|
3258
3258
|
const adapterOwnsDocsRuntime = _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs);
|
|
3259
3259
|
const docsEntries = _optionalChain([config, 'access', _111 => _111.docs, 'optionalAccess', _112 => _112.enabled]) ? _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).map(
|
|
3260
3260
|
(docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
|
|
@@ -3265,7 +3265,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3265
3265
|
);
|
|
3266
3266
|
const syntheticDocsEntry = _optionalChain([config, 'access', _113 => _113.docs, 'optionalAccess', _114 => _114.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
3267
3267
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
3268
|
-
const plan = (operation) => sourceSnapshot ?
|
|
3268
|
+
const plan = (operation) => sourceSnapshot ? _chunkQYDGIXQ5cjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunkQYDGIXQ5cjs.withFarmSourceSnapshot.call(void 0, operation);
|
|
3269
3269
|
const { clientLayouts, clientRouteSlots } = plan(() => {
|
|
3270
3270
|
const clientLayouts2 = layoutRoutes.map((layout) => {
|
|
3271
3271
|
try {
|
|
@@ -3312,7 +3312,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3312
3312
|
};
|
|
3313
3313
|
}
|
|
3314
3314
|
});
|
|
3315
|
-
const markdownPagePlan =
|
|
3315
|
+
const markdownPagePlan = _chunkQYDGIXQ5cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
3316
3316
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
3317
3317
|
root,
|
|
3318
3318
|
isolatedMode,
|
|
@@ -3328,7 +3328,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3328
3328
|
pagePlanOptions
|
|
3329
3329
|
)
|
|
3330
3330
|
}));
|
|
3331
|
-
|
|
3331
|
+
_chunkQYDGIXQ5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
3332
3332
|
clientLayouts2.map((layout) => ({
|
|
3333
3333
|
pattern: layout.pattern,
|
|
3334
3334
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -3362,7 +3362,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3362
3362
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
3363
3363
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
3364
3364
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3365
|
-
`\u26A0\uFE0F ${
|
|
3365
|
+
`\u26A0\uFE0F ${_chunkQYDGIXQ5cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
|
|
3366
3366
|
);
|
|
3367
3367
|
}
|
|
3368
3368
|
}
|
|
@@ -3397,7 +3397,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3397
3397
|
);
|
|
3398
3398
|
if (metadata.suppressedAsyncHydration) {
|
|
3399
3399
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3400
|
-
`\u26A0\uFE0F ${
|
|
3400
|
+
`\u26A0\uFE0F ${_chunkQYDGIXQ5cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
3401
3401
|
);
|
|
3402
3402
|
}
|
|
3403
3403
|
const slotBoundaries = serverSlotPlans.filter(
|
|
@@ -3405,7 +3405,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3405
3405
|
).flatMap(({ plan: plan2 }) => plan2.isolatedBoundaries);
|
|
3406
3406
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
|
|
3407
3407
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
3408
|
-
const islandStrategy =
|
|
3408
|
+
const islandStrategy = _chunkP253SZJFcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3409
3409
|
route,
|
|
3410
3410
|
metadata,
|
|
3411
3411
|
clientLayouts2,
|
|
@@ -3424,7 +3424,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3424
3424
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
3425
3425
|
],
|
|
3426
3426
|
// The server renders a server tree only below a hydrating layout.
|
|
3427
|
-
...
|
|
3427
|
+
..._chunkQYDGIXQ5cjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
3428
3428
|
});
|
|
3429
3429
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
3430
3430
|
}
|
|
@@ -3461,7 +3461,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3461
3461
|
}
|
|
3462
3462
|
const clientRouteSlots2 = routeSlots.filter((slot) => {
|
|
3463
3463
|
try {
|
|
3464
|
-
const metadata =
|
|
3464
|
+
const metadata = _chunkQYDGIXQ5cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
|
|
3465
3465
|
return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
|
|
3466
3466
|
} catch (error) {
|
|
3467
3467
|
_chunk7U4XF76Rcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
@@ -3514,11 +3514,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3514
3514
|
config.trailingSlash,
|
|
3515
3515
|
_chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
3516
3516
|
config.basePath,
|
|
3517
|
-
|
|
3517
|
+
_chunkP253SZJFcjs.generateClientCachePersistenceCode.call(void 0, _chunkP253SZJFcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
3518
3518
|
adapterOwnsDocsRuntime ? _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
3519
|
-
|
|
3519
|
+
_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _117 => _117.experimental, 'optionalAccess', _118 => _118.serverComponents])) === "islands",
|
|
3520
3520
|
platform,
|
|
3521
|
-
islandsMode ?
|
|
3521
|
+
islandsMode ? _chunkQYDGIXQ5cjs.collectFarmServerStylesheets.call(void 0,
|
|
3522
3522
|
[
|
|
3523
3523
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
3524
3524
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -3542,7 +3542,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3542
3542
|
await fs5.writeFile(_path2.default.join(clientEntryDir, "farm-client-root.tsx"), clientEntry.root);
|
|
3543
3543
|
}
|
|
3544
3544
|
const clientInput = { [entryName]: clientEntryPath };
|
|
3545
|
-
if (platform === "web" &&
|
|
3545
|
+
if (platform === "web" && _chunkP253SZJFcjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
3546
3546
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
3547
3547
|
await fs5.writeFile(
|
|
3548
3548
|
clientBootPath,
|
|
@@ -3553,7 +3553,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3553
3553
|
const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
|
|
3554
3554
|
let postcssSearchPath;
|
|
3555
3555
|
let tailwindVitePlugin = void 0;
|
|
3556
|
-
const rendererVitePlugins = await
|
|
3556
|
+
const rendererVitePlugins = await _chunkT7UC2ORAcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
|
|
3557
3557
|
ssr: false,
|
|
3558
3558
|
buildLifetime: rendererBuildLifetime
|
|
3559
3559
|
});
|
|
@@ -3598,7 +3598,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3598
3598
|
entryFileNames: "[name]-h[hash].js",
|
|
3599
3599
|
chunkFileNames: "chunks/[name]-h[hash].js",
|
|
3600
3600
|
hashCharacters: "hex",
|
|
3601
|
-
...islandsMode &&
|
|
3601
|
+
...islandsMode && _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) && !configuresFarmClientChunks(config.vite) ? { codeSplitting: { groups: [createFarmIslandsReactChunkGroup()] } } : {},
|
|
3602
3602
|
// Use predictable name for CSS so we can reference it in SSR HTML
|
|
3603
3603
|
assetFileNames: (assetInfo) => {
|
|
3604
3604
|
if (_optionalChain([assetInfo, 'access', _130 => _130.name, 'optionalAccess', _131 => _131.endsWith, 'call', _132 => _132(".css")])) {
|
|
@@ -3618,7 +3618,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3618
3618
|
}
|
|
3619
3619
|
},
|
|
3620
3620
|
plugins: [
|
|
3621
|
-
|
|
3621
|
+
_chunkP253SZJFcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
3622
3622
|
createFarmPrivateClientSourcemapsPlugin({
|
|
3623
3623
|
outDir: _path2.default.join(
|
|
3624
3624
|
_path2.default.dirname(outputDir),
|
|
@@ -3639,7 +3639,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3639
3639
|
],
|
|
3640
3640
|
rootModules: [_path2.default.join(clientEntryDir, "farm-client-root.tsx")],
|
|
3641
3641
|
// What the islands entry loads with its first render or hydration (RFC 0010).
|
|
3642
|
-
...islandsMode &&
|
|
3642
|
+
...islandsMode && _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? {
|
|
3643
3643
|
rendererImports: [
|
|
3644
3644
|
"react",
|
|
3645
3645
|
"react-dom/client",
|
|
@@ -3670,7 +3670,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3670
3670
|
...config.vite.plugins || [],
|
|
3671
3671
|
farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
|
|
3672
3672
|
farmNavigationPlugin(config.renderer),
|
|
3673
|
-
|
|
3673
|
+
_chunkP253SZJFcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
3674
3674
|
adapterOwnsDocsRuntime ? _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
3675
3675
|
),
|
|
3676
3676
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -3703,7 +3703,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3703
3703
|
},
|
|
3704
3704
|
load: {
|
|
3705
3705
|
filter: {
|
|
3706
|
-
id:
|
|
3706
|
+
id: _chunkP253SZJFcjs.exactIdPattern.call(void 0, [
|
|
3707
3707
|
"\0empty-module",
|
|
3708
3708
|
"\0empty-api-route",
|
|
3709
3709
|
"\0farm-i18n-client-bridge",
|
|
@@ -3741,7 +3741,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3741
3741
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes, sourceSnapshot },
|
|
3742
3742
|
pluginManager
|
|
3743
3743
|
),
|
|
3744
|
-
|
|
3744
|
+
_chunkQYDGIXQ5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
3745
3745
|
],
|
|
3746
3746
|
mode: "production",
|
|
3747
3747
|
css: postcssSearchPath ? {
|
|
@@ -3749,7 +3749,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3749
3749
|
} : void 0,
|
|
3750
3750
|
// Ensure React is bundled for client
|
|
3751
3751
|
resolve: {
|
|
3752
|
-
alias:
|
|
3752
|
+
alias: _chunkP253SZJFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
3753
3753
|
dedupe: [...config.renderer.dedupe || []]
|
|
3754
3754
|
},
|
|
3755
3755
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -3763,7 +3763,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3763
3763
|
}
|
|
3764
3764
|
};
|
|
3765
3765
|
await viteBuild(
|
|
3766
|
-
|
|
3766
|
+
_chunkP253SZJFcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
|
|
3767
3767
|
);
|
|
3768
3768
|
if (platform === "mobile") {
|
|
3769
3769
|
await fs5.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
@@ -3857,9 +3857,9 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
3857
3857
|
return response;
|
|
3858
3858
|
}
|
|
3859
3859
|
|
|
3860
|
-
${streamNavigations ? `${
|
|
3860
|
+
${streamNavigations ? `${_chunkP253SZJFcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
3861
3861
|
|
|
3862
|
-
${
|
|
3862
|
+
${_chunkP253SZJFcjs.FARM_EARLY_NAVIGATION_SOURCE}` : ""}
|
|
3863
3863
|
|
|
3864
3864
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
3865
3865
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -5167,7 +5167,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
5167
5167
|
secure: false
|
|
5168
5168
|
},
|
|
5169
5169
|
direction: {}
|
|
5170
|
-
}, plugins = [], renderer =
|
|
5170
|
+
}, plugins = [], renderer = _chunkT7UC2ORAcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
|
|
5171
5171
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
5172
5172
|
const clientPluginEntry = _chunkDMSXZNQRcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
5173
5173
|
plugins,
|
|
@@ -5176,11 +5176,11 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
5176
5176
|
publicRuntimeConfig,
|
|
5177
5177
|
platform
|
|
5178
5178
|
);
|
|
5179
|
-
const appSetupPath =
|
|
5180
|
-
const lazyRenderer = islandValues && platform !== "mobile" &&
|
|
5179
|
+
const appSetupPath = _chunkT7UC2ORAcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
|
|
5180
|
+
const lazyRenderer = islandValues && platform !== "mobile" && _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) && clientRouteSlots.length === 0;
|
|
5181
5181
|
const lazyRoot = islandValues && platform !== "mobile";
|
|
5182
5182
|
const lazyMatcher = lazyRoot && clientPages.length > 0;
|
|
5183
|
-
const rendererClientImports = lazyRenderer ? `import { holdFarmIslandInteractions, restorePagePosition, watchFarmIslandTriggers } from "@farm.js/core/internal/client-runtime";` :
|
|
5183
|
+
const rendererClientImports = lazyRenderer ? `import { holdFarmIslandInteractions, restorePagePosition, watchFarmIslandTriggers } from "@farm.js/core/internal/client-runtime";` : _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
|
|
5184
5184
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
5185
5185
|
import { restorePagePosition } from "@farm.js/core/internal/client-runtime";` : (
|
|
5186
5186
|
// Named exports only, as the server entry and the development client read them. A copy
|
|
@@ -5193,8 +5193,8 @@ __farmConfigureApp(__farmAppSetup);` : `import * as __farmRendererClient from ${
|
|
|
5193
5193
|
import { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};
|
|
5194
5194
|
const React = { ...__farmRendererClient };`
|
|
5195
5195
|
);
|
|
5196
|
-
const hydrateFarmRouteCall =
|
|
5197
|
-
const providerClientCode =
|
|
5196
|
+
const hydrateFarmRouteCall = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);";
|
|
5197
|
+
const providerClientCode = _chunkP253SZJFcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
5198
5198
|
integrationProviders,
|
|
5199
5199
|
root,
|
|
5200
5200
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -5304,7 +5304,7 @@ function isFarmDocsPath() {
|
|
|
5304
5304
|
docsAdapterUI,
|
|
5305
5305
|
docsConfigModule,
|
|
5306
5306
|
// Config resolution keeps an adapter to its UI's renderer, so this is the UI's renderer too.
|
|
5307
|
-
|
|
5307
|
+
_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) ? void 0 : renderer.client
|
|
5308
5308
|
);
|
|
5309
5309
|
if (clientPages.length === 0 && clientRouteSlots.length === 0 && !providerClientCode.hasProviders) {
|
|
5310
5310
|
return `
|
|
@@ -5328,7 +5328,7 @@ mountFarmDocsSearch();
|
|
|
5328
5328
|
|
|
5329
5329
|
${generateUniversalRouterStateRuntime()}
|
|
5330
5330
|
|
|
5331
|
-
${
|
|
5331
|
+
${_chunkP253SZJFcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
5332
5332
|
|
|
5333
5333
|
// SPA Router for server-rendered pages (HTML swap)
|
|
5334
5334
|
const spaRouter = {
|
|
@@ -5631,7 +5631,7 @@ installFarmLinkPrefetch();
|
|
|
5631
5631
|
}
|
|
5632
5632
|
});
|
|
5633
5633
|
const isolatedHydrationEnabled = isolatedBoundaryModules.size > 0;
|
|
5634
|
-
const rendererIslands = isolatedHydrationEnabled && !islandValues && !
|
|
5634
|
+
const rendererIslands = isolatedHydrationEnabled && !islandValues && !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) && _chunkT7UC2ORAcjs.getFarmRendererCapabilities.call(void 0, renderer).islands;
|
|
5635
5635
|
const serverTreeEnabled = isolatedHydrationEnabled && clientPages.some((page) => page.serverTree);
|
|
5636
5636
|
const islandsRuntimeExports = [
|
|
5637
5637
|
"createFarmIsolatedHydrationRuntime",
|
|
@@ -5868,7 +5868,7 @@ ${layoutRegistrations.join(",\n")}
|
|
|
5868
5868
|
${generateFarmClientRouteMatchSource({ lazyMatcher })}
|
|
5869
5869
|
|
|
5870
5870
|
${layoutComponentsRuntime}/*farm-root-start*/
|
|
5871
|
-
${
|
|
5871
|
+
${_chunkP253SZJFcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5872
5872
|
// Wrap a page element with applicable layouts
|
|
5873
5873
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
5874
5874
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -5903,7 +5903,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
5903
5903
|
return React.createElement("div", props, pageElement);
|
|
5904
5904
|
}
|
|
5905
5905
|
let farmLastRouteState = null;
|
|
5906
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
5906
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkP253SZJFcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
5907
5907
|
function farmTreeLayoutsOf(pathname) {
|
|
5908
5908
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
5909
5909
|
return layout.serverTree === true;
|
|
@@ -6018,7 +6018,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, navi
|
|
|
6018
6018
|
|
|
6019
6019
|
if (!pageElement) return null;
|
|
6020
6020
|
if (!hydrateLayouts) {
|
|
6021
|
-
${
|
|
6021
|
+
${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) ? "if (hydrationContainer) pageElement = restorePagePosition(React, hydrationContainer, pageElement);" : ""}
|
|
6022
6022
|
return createFarmRouteState(pageElement, pathname, params, false);
|
|
6023
6023
|
}
|
|
6024
6024
|
if (matched.route.pageShouldHydrate) {
|
|
@@ -6047,7 +6047,7 @@ function createFarmRouteState(page, pathname, params, includeLayouts) {
|
|
|
6047
6047
|
|
|
6048
6048
|
function hydrateFarmRoute(container, route) {
|
|
6049
6049
|
farmLastRouteState = route;
|
|
6050
|
-
${
|
|
6050
|
+
${_chunkT7UC2ORAcjs.getFarmRendererCapabilities.call(void 0, renderer).hydrationFallback ? `try {
|
|
6051
6051
|
${hydrateFarmRouteCall}
|
|
6052
6052
|
} catch (error) {
|
|
6053
6053
|
// The renderer opted in with capabilities.hydrationFallback, as development always does. The
|
|
@@ -6537,7 +6537,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
|
6537
6537
|
return true;
|
|
6538
6538
|
}` : ""}
|
|
6539
6539
|
|
|
6540
|
-
${
|
|
6540
|
+
${_chunkP253SZJFcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
6541
6541
|
|
|
6542
6542
|
function activateNavigationScripts(root) {
|
|
6543
6543
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
@@ -6643,7 +6643,7 @@ function getLayoutShell(root, patterns, index) {
|
|
|
6643
6643
|
return shell.innerHTML;
|
|
6644
6644
|
}
|
|
6645
6645
|
|
|
6646
|
-
${islandValues ?
|
|
6646
|
+
${islandValues ? _chunkP253SZJFcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
6647
6647
|
// A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
|
|
6648
6648
|
if (refresh) revealFarmStreamedContent(nextRoot);
|
|
6649
6649
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
@@ -7333,7 +7333,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7333
7333
|
const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
|
|
7334
7334
|
let postcssConfigDir;
|
|
7335
7335
|
let tailwindVitePlugin = void 0;
|
|
7336
|
-
const rendererVitePlugins = await
|
|
7336
|
+
const rendererVitePlugins = await _chunkT7UC2ORAcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
|
|
7337
7337
|
ssr: true,
|
|
7338
7338
|
buildLifetime: rendererBuildLifetime
|
|
7339
7339
|
});
|
|
@@ -7450,7 +7450,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7450
7450
|
}))
|
|
7451
7451
|
);
|
|
7452
7452
|
const instrumentationPath = _chunk3BTN3NP7cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
7453
|
-
const notFoundPath =
|
|
7453
|
+
const notFoundPath = _chunkP253SZJFcjs.resolveFarmNotFoundComponentPath.call(void 0,
|
|
7454
7454
|
config,
|
|
7455
7455
|
appDirs,
|
|
7456
7456
|
routeManager.getRendererNotFoundPath()
|
|
@@ -7477,7 +7477,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7477
7477
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
7478
7478
|
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _136 => _136.mdx, 'optionalAccess', _137 => _137.components]));
|
|
7479
7479
|
const hasMiddlewareConfig = _chunk4B6YJ5DScjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
7480
|
-
const hasRouteContextConfig =
|
|
7480
|
+
const hasRouteContextConfig = _chunkFDU4Q4QPcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
7481
7481
|
const hasServerRuntimePlugins = _chunkDMSXZNQRcjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
|
|
7482
7482
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
7483
7483
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -7489,7 +7489,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7489
7489
|
);
|
|
7490
7490
|
if (_chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
7491
7491
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
7492
|
-
|
|
7492
|
+
_chunkBLZCAFGJcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
7493
7493
|
config.docs,
|
|
7494
7494
|
{ root, srcDir: config.srcDir },
|
|
7495
7495
|
(pathname) => adapterGuardedPaths.has(pathname),
|
|
@@ -7499,7 +7499,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7499
7499
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
7500
7500
|
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _138 => _138.docs, 'optionalAccess', _139 => _139.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunk2RSVYJT6cjs._runWithFarmCspNonce.call(void 0,
|
|
7501
7501
|
farmDocsCspNonceMarker,
|
|
7502
|
-
async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await
|
|
7502
|
+
async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await _chunkBLZCAFGJcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
7503
7503
|
root,
|
|
7504
7504
|
srcDir: config.srcDir,
|
|
7505
7505
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -7559,7 +7559,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7559
7559
|
(image) => image.sourceType === "module"
|
|
7560
7560
|
);
|
|
7561
7561
|
const externalMetadataImageRuntime = useExternalMetadataImageRuntime && !omitCoreMetadataImageRuntime ? ["@vercel/og"] : [];
|
|
7562
|
-
const rendererOptionalExternals =
|
|
7562
|
+
const rendererOptionalExternals = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
|
|
7563
7563
|
"react",
|
|
7564
7564
|
"react/jsx-runtime",
|
|
7565
7565
|
"react/jsx-dev-runtime",
|
|
@@ -7666,7 +7666,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7666
7666
|
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _148 => _148.env, 'optionalAccess', _149 => _149.public]) || {})
|
|
7667
7667
|
},
|
|
7668
7668
|
plugins: [
|
|
7669
|
-
|
|
7669
|
+
_chunkP253SZJFcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
7670
7670
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
7671
7671
|
...rendererVitePlugins,
|
|
7672
7672
|
...config.vite.plugins || [],
|
|
@@ -7698,7 +7698,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7698
7698
|
},
|
|
7699
7699
|
pluginManager
|
|
7700
7700
|
),
|
|
7701
|
-
|
|
7701
|
+
_chunkQYDGIXQ5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
7702
7702
|
...hasRuntimeConfigModule ? [
|
|
7703
7703
|
farmStripPlatformConfigPlugin(
|
|
7704
7704
|
[
|
|
@@ -7710,7 +7710,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7710
7710
|
{
|
|
7711
7711
|
name: "farm-virtual-ssr-entry",
|
|
7712
7712
|
resolveId: {
|
|
7713
|
-
filter: { id:
|
|
7713
|
+
filter: { id: _chunkP253SZJFcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
|
|
7714
7714
|
handler(id) {
|
|
7715
7715
|
if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
|
|
7716
7716
|
return virtualEntryId;
|
|
@@ -7719,7 +7719,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7719
7719
|
}
|
|
7720
7720
|
},
|
|
7721
7721
|
load: {
|
|
7722
|
-
filter: { id:
|
|
7722
|
+
filter: { id: _chunkP253SZJFcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
|
|
7723
7723
|
handler(id) {
|
|
7724
7724
|
if (id === virtualEntryId) {
|
|
7725
7725
|
return virtualEntryCode;
|
|
@@ -7751,7 +7751,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7751
7751
|
resolve: {
|
|
7752
7752
|
alias: [
|
|
7753
7753
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
7754
|
-
...Object.entries(
|
|
7754
|
+
...Object.entries(_chunkP253SZJFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
7755
7755
|
([find, replacement]) => ({ find, replacement })
|
|
7756
7756
|
)
|
|
7757
7757
|
],
|
|
@@ -7759,7 +7759,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7759
7759
|
dedupe: [...config.renderer.dedupe || []]
|
|
7760
7760
|
}
|
|
7761
7761
|
};
|
|
7762
|
-
await viteBuild(
|
|
7762
|
+
await viteBuild(_chunkP253SZJFcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
7763
7763
|
} finally {
|
|
7764
7764
|
if (postcssConfigDir) {
|
|
7765
7765
|
try {
|
|
@@ -8193,7 +8193,7 @@ async function applyFarmPreloadBudget(response, pathname, request) {
|
|
|
8193
8193
|
`.trim();
|
|
8194
8194
|
}
|
|
8195
8195
|
function generateFarmRendererAppSetupServerCode(config) {
|
|
8196
|
-
const appSetupPath =
|
|
8196
|
+
const appSetupPath = _chunkT7UC2ORAcjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
|
|
8197
8197
|
if (!appSetupPath) return "";
|
|
8198
8198
|
return `
|
|
8199
8199
|
import __farmAppSetup from ${JSON.stringify(_chunk7U4XF76Rcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
@@ -8203,14 +8203,14 @@ if (typeof ReactDOMServer.configureApp !== "function") {
|
|
|
8203
8203
|
ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
8204
8204
|
}
|
|
8205
8205
|
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
|
|
8206
|
-
const farmRendererDisabled =
|
|
8206
|
+
const farmRendererDisabled = _chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
8207
8207
|
const searchPreserveRoutes = pageRoutes.flatMap(
|
|
8208
8208
|
(route) => route.searchPreserve ? [route.searchPreserve] : []
|
|
8209
8209
|
);
|
|
8210
8210
|
const searchPreserveRoutesSource = searchPreserveRoutes.length > 0 ? JSON.stringify(searchPreserveRoutes) : "";
|
|
8211
|
-
const farmIslandsMode =
|
|
8212
|
-
const farmRendererActions =
|
|
8213
|
-
const farmClientBoot =
|
|
8211
|
+
const farmIslandsMode = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _166 => _166.experimental, 'optionalAccess', _167 => _167.serverComponents])) === "islands";
|
|
8212
|
+
const farmRendererActions = _chunkP253SZJFcjs.resolveFarmIslxActionsMode.call(void 0, config) === "renderer";
|
|
8213
|
+
const farmClientBoot = _chunkP253SZJFcjs.canBootFarmIslandsClient.call(void 0, config);
|
|
8214
8214
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
8215
8215
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
8216
8216
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "edge";
|
|
@@ -8224,7 +8224,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
8224
8224
|
const servesAiCatalog = _optionalChain([config, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.aiCatalog]) !== false;
|
|
8225
8225
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
8226
8226
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
8227
|
-
const reportsWebMCPCalls = hasInfraAnalyticsRuntime &&
|
|
8227
|
+
const reportsWebMCPCalls = hasInfraAnalyticsRuntime && _chunkBAD6T5NUcjs._farmWebMCPReportsEnabled.call(void 0, config.plugins);
|
|
8228
8228
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
8229
8229
|
const adapterOwnsDocsRuntime = _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs);
|
|
8230
8230
|
if (_optionalChain([config, 'access', _178 => _178.docs, 'optionalAccess', _179 => _179.enabled]) && _optionalChain([config, 'access', _180 => _180.docs, 'access', _181 => _181.roots, 'optionalAccess', _182 => _182.length]) && !adapterOwnsDocsRuntime) {
|
|
@@ -8234,14 +8234,14 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
8234
8234
|
}
|
|
8235
8235
|
const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
|
|
8236
8236
|
const adapterHandler = generateFarmDocsAdapterHandlerArguments(config.docs, docsConfigModulePath);
|
|
8237
|
-
const hasIsolatedClientGraphRuntime =
|
|
8238
|
-
const hasRendererIslandsGraph = isolatedClientBoundaryModules.size > 0 &&
|
|
8239
|
-
const rendererStreamingCapabilities =
|
|
8237
|
+
const hasIsolatedClientGraphRuntime = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
|
|
8238
|
+
const hasRendererIslandsGraph = isolatedClientBoundaryModules.size > 0 && _chunkCPSFDQKJcjs.usesFarmRendererIslands.call(void 0, config);
|
|
8239
|
+
const rendererStreamingCapabilities = _chunkT7UC2ORAcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
|
|
8240
8240
|
config.renderer,
|
|
8241
8241
|
_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset)
|
|
8242
8242
|
);
|
|
8243
|
-
const hasReactSyncRender =
|
|
8244
|
-
const rendererServerImports =
|
|
8243
|
+
const hasReactSyncRender = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer);
|
|
8244
|
+
const rendererServerImports = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
|
|
8245
8245
|
import * as ReactDOMServer from "react-dom/server";
|
|
8246
8246
|
import { markPagePosition, markLayoutPosition } from "@farm.js/core/internal/production-runtime";${hasIsolatedClientGraphRuntime ? farmIslandsMode ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph, renderFarmServerTreePage, renderFarmServerTreeLayout, withFarmIslandsRender } from "@farm.js/core/internal/islands-runtime";' : '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : (
|
|
8247
8247
|
// The renderer contract is the server module's named exports, which the development
|
|
@@ -8305,12 +8305,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8305
8305
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
8306
8306
|
(provider) => provider.component || provider.type === "clerk"
|
|
8307
8307
|
);
|
|
8308
|
-
if (renderedIntegrationProviders.length > 0 && !
|
|
8308
|
+
if (renderedIntegrationProviders.length > 0 && !_chunkT7UC2ORAcjs.getFarmRendererCapabilities.call(void 0, config.renderer).functionComponents) {
|
|
8309
8309
|
throw new Error(
|
|
8310
8310
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
8311
8311
|
);
|
|
8312
8312
|
}
|
|
8313
|
-
const providerServerModules =
|
|
8313
|
+
const providerServerModules = _chunkP253SZJFcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
8314
8314
|
renderedIntegrationProviders,
|
|
8315
8315
|
config.root,
|
|
8316
8316
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
@@ -8330,22 +8330,22 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8330
8330
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
8331
8331
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
8332
8332
|
);
|
|
8333
|
-
const isolatedHydrationMode =
|
|
8333
|
+
const isolatedHydrationMode = _chunkQYDGIXQ5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
8334
8334
|
_optionalChain([config, 'access', _187 => _187.experimental, 'optionalAccess', _188 => _188.isolatedClientHydration]),
|
|
8335
8335
|
{
|
|
8336
|
-
serverComponents:
|
|
8336
|
+
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _189 => _189.experimental, 'optionalAccess', _190 => _190.serverComponents])) === "rsc",
|
|
8337
8337
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
8338
8338
|
}
|
|
8339
8339
|
);
|
|
8340
|
-
const hydrationPlanOptions =
|
|
8340
|
+
const hydrationPlanOptions = _chunkQYDGIXQ5cjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
8341
8341
|
config.renderer,
|
|
8342
8342
|
Boolean(unsupportedIntegrationProvider)
|
|
8343
8343
|
);
|
|
8344
8344
|
const pageHydrationPlanOptions = {
|
|
8345
8345
|
...hydrationPlanOptions,
|
|
8346
|
-
serverOwners:
|
|
8346
|
+
serverOwners: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _191 => _191.experimental, 'optionalAccess', _192 => _192.serverComponents])) === "islands"
|
|
8347
8347
|
};
|
|
8348
|
-
const { layoutHydrationPlans, pageHydrationPlans } =
|
|
8348
|
+
const { layoutHydrationPlans, pageHydrationPlans } = _chunkQYDGIXQ5cjs.withFarmSourceSnapshot.call(void 0, () => {
|
|
8349
8349
|
const layoutHydrationPlans2 = layoutRoutes.map((layout) => ({
|
|
8350
8350
|
...layout,
|
|
8351
8351
|
hydration: getCachedClientModuleHydrationPlan(
|
|
@@ -8356,7 +8356,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8356
8356
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
8357
8357
|
)
|
|
8358
8358
|
}));
|
|
8359
|
-
const markdownPagePlan =
|
|
8359
|
+
const markdownPagePlan = _chunkQYDGIXQ5cjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
8360
8360
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
8361
8361
|
config.root,
|
|
8362
8362
|
isolatedHydrationMode,
|
|
@@ -8376,7 +8376,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8376
8376
|
);
|
|
8377
8377
|
return { layoutHydrationPlans: layoutHydrationPlans2, pageHydrationPlans: pageHydrationPlans2 };
|
|
8378
8378
|
});
|
|
8379
|
-
|
|
8379
|
+
_chunkQYDGIXQ5cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
8380
8380
|
layoutHydrationPlans.map((layout) => ({
|
|
8381
8381
|
pattern: layout.pattern,
|
|
8382
8382
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -8420,8 +8420,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8420
8420
|
orderedPageRoutes.forEach((route, index) => {
|
|
8421
8421
|
const varName = `pageRoute${index}`;
|
|
8422
8422
|
if (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
|
|
8423
|
-
const renderingDirective2 =
|
|
8424
|
-
const markdownServerTree = pageHydrationPlanOptions.serverOwners &&
|
|
8423
|
+
const renderingDirective2 = _chunkXMVZXZ32cjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8424
|
+
const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkQYDGIXQ5cjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
|
|
8425
8425
|
pageRegistrations.push(`
|
|
8426
8426
|
{
|
|
8427
8427
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8429,14 +8429,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8429
8429
|
rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
|
|
8430
8430
|
module: createFarmMarkdownRouteModule({
|
|
8431
8431
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8432
|
-
filePath: ${JSON.stringify(
|
|
8432
|
+
filePath: ${JSON.stringify(_chunkP253SZJFcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
|
|
8433
8433
|
components: farmMdxComponents,
|
|
8434
|
-
config: farmMdxConfig,${
|
|
8434
|
+
config: farmMdxConfig,${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: React,"}
|
|
8435
8435
|
}),
|
|
8436
8436
|
markdownSource: {
|
|
8437
8437
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8438
8438
|
filePath: ${JSON.stringify(
|
|
8439
|
-
|
|
8439
|
+
_chunkP253SZJFcjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
|
|
8440
8440
|
)},
|
|
8441
8441
|
},
|
|
8442
8442
|
}`);
|
|
@@ -8446,7 +8446,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8446
8446
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
8447
8447
|
);
|
|
8448
8448
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
8449
|
-
const renderingDirective =
|
|
8449
|
+
const renderingDirective = _chunkXMVZXZ32cjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8450
8450
|
pageRegistrations.push(`
|
|
8451
8451
|
{
|
|
8452
8452
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8454,8 +8454,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8454
8454
|
module: ${varName},
|
|
8455
8455
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
8456
8456
|
clientModule: ${JSON.stringify(_chunk7U4XF76Rcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
8457
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
8458
|
-
const rootStrategy =
|
|
8457
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkQYDGIXQ5cjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
|
|
8458
|
+
const rootStrategy = _chunkP253SZJFcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
8459
8459
|
route,
|
|
8460
8460
|
clientMetadata,
|
|
8461
8461
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -8468,7 +8468,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8468
8468
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
8469
8469
|
${route.source !== void 0 ? `markdownSource: {
|
|
8470
8470
|
source: ${JSON.stringify(route.source)},
|
|
8471
|
-
filePath: ${JSON.stringify(
|
|
8471
|
+
filePath: ${JSON.stringify(_chunkP253SZJFcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
|
|
8472
8472
|
},` : ""}
|
|
8473
8473
|
}`);
|
|
8474
8474
|
});
|
|
@@ -8492,7 +8492,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8492
8492
|
pattern: ${JSON.stringify(layout.pattern)},
|
|
8493
8493
|
module: ${varName},
|
|
8494
8494
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
|
|
8495
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode &&
|
|
8495
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunkP253SZJFcjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
|
|
8496
8496
|
// isolatedClientHydration, or an async layout): it wraps a docs page as an app page.
|
|
8497
8497
|
clientMetadata.hasIsolatedClientBoundaries ? "\n islands: true," : ""}
|
|
8498
8498
|
}`);
|
|
@@ -8520,7 +8520,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8520
8520
|
containerId: ${JSON.stringify(slot.containerId)},
|
|
8521
8521
|
interception: ${JSON.stringify(slot.interception)},
|
|
8522
8522
|
fallback: ${JSON.stringify(slot.fallback)},
|
|
8523
|
-
hydrates: ${!farmIslandsMode ||
|
|
8523
|
+
hydrates: ${!farmIslandsMode || _chunkQYDGIXQ5cjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
|
|
8524
8524
|
module: ${varName},
|
|
8525
8525
|
}`);
|
|
8526
8526
|
});
|
|
@@ -8566,7 +8566,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8566
8566
|
metadataImageImports.push(
|
|
8567
8567
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(image.modulePath)};`
|
|
8568
8568
|
);
|
|
8569
|
-
const component = !
|
|
8569
|
+
const component = !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) && _chunkP253SZJFcjs.isRendererCompiledComponent.call(void 0, image.modulePath, _nullishCoalesce(_optionalChain([config, 'access', _196 => _196.renderer, 'optionalAccess', _197 => _197.componentExtensions]), () => ( [])));
|
|
8570
8570
|
metadataImageRegistrations.push(`
|
|
8571
8571
|
{
|
|
8572
8572
|
pattern: ${JSON.stringify(image.pattern)},
|
|
@@ -8840,10 +8840,10 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
8840
8840
|
);
|
|
8841
8841
|
const nativeServerFns = (config.plugins || []).some(
|
|
8842
8842
|
(plugin) => _optionalChain([plugin, 'optionalAccess', _217 => _217.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
8843
|
-
) ?
|
|
8843
|
+
) ? _chunkUDWBTABTcjs.collectFarmNativeServerFns.call(void 0, {
|
|
8844
8844
|
root: config.root,
|
|
8845
8845
|
srcDir: config.srcDir,
|
|
8846
|
-
entries:
|
|
8846
|
+
entries: _chunkUDWBTABTcjs.findFarmNativeScreenFiles.call(void 0, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config))
|
|
8847
8847
|
}) : void 0;
|
|
8848
8848
|
const integrationImports = `
|
|
8849
8849
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -8858,7 +8858,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
8858
8858
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
8859
8859
|
});` : ""}
|
|
8860
8860
|
`;
|
|
8861
|
-
const imageRuntime =
|
|
8861
|
+
const imageRuntime = _chunkP253SZJFcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
8862
8862
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
8863
8863
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
8864
8864
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -9040,7 +9040,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
9040
9040
|
|
|
9041
9041
|
function renderFarmDefault404Page() {
|
|
9042
9042
|
return React.createElement(React.Fragment, null,
|
|
9043
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
9043
|
+
React.createElement("style", null, ${JSON.stringify(_chunkP253SZJFcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
9044
9044
|
React.createElement("main", {
|
|
9045
9045
|
className: "farm-default-not-found",
|
|
9046
9046
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -9136,7 +9136,7 @@ function wrapWithFarmIntegrationProviders(element) {
|
|
|
9136
9136
|
// providers, so the server renders them inside it too. React lines an island up with its tree
|
|
9137
9137
|
// position instead, and its providers render no markup.
|
|
9138
9138
|
function wrapFarmIslandIntegrationProviders(element) {
|
|
9139
|
-
return ${
|
|
9139
|
+
return ${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? "element" : "wrapWithFarmIntegrationProviders(element)"};
|
|
9140
9140
|
}
|
|
9141
9141
|
const serverRuntimeIntegrations = Object.fromEntries(
|
|
9142
9142
|
Object.entries(configuredIntegrations).filter(([, integration]) =>
|
|
@@ -9213,7 +9213,7 @@ ${_optionalChain([config, 'access', _227 => _227.agent, 'optionalAccess', _228 =
|
|
|
9213
9213
|
// to the build.
|
|
9214
9214
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
9215
9215
|
globalThis.process?.env,
|
|
9216
|
-
${JSON.stringify(
|
|
9216
|
+
${JSON.stringify(_chunkNXOZRI3Bcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
9217
9217
|
);` : ""}
|
|
9218
9218
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
9219
9219
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -9324,7 +9324,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
9324
9324
|
}
|
|
9325
9325
|
: undefined;
|
|
9326
9326
|
${adapterOwnsDocsRuntime && !hasPrecompiledDocs ? `// The renderer contract's server exports, for a docs UI that builds its pages with them.
|
|
9327
|
-
const farmDocsAppRenderer = ${
|
|
9327
|
+
const farmDocsAppRenderer = ${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? '{ name: "react", createElement: React.createElement, Fragment: React.Fragment, renderToString: ReactDOMServer.renderToString }' : "__farmRendererServer"};
|
|
9328
9328
|
` : ""}const farmDocsHandler = ${_optionalChain([config, 'access', _236 => _236.docs, 'optionalAccess', _237 => _237.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
|
|
9329
9329
|
rootDir: farmDocsRuntimeRoot,
|
|
9330
9330
|
// A production build's content cannot change, so the adapter reads its
|
|
@@ -9349,7 +9349,7 @@ const farmDocsAppRenderer = ${_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, con
|
|
|
9349
9349
|
registerMCPServer: registerFarmMCPServer,
|
|
9350
9350
|
// A page built with this keeps its HTML string, so the preload budget and the response
|
|
9351
9351
|
// writer use it instead of reading and re-encoding the body. Older adapters ignore it.
|
|
9352
|
-
createHtmlResponse: farmOwnedHtmlResponse,${
|
|
9352
|
+
createHtmlResponse: farmOwnedHtmlResponse,${_chunkBLZCAFGJcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
|
|
9353
9353
|
// The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
|
|
9354
9354
|
// asks about any path its own content lists, so the guards decide here, not a page list.
|
|
9355
9355
|
isPathGuarded: (pathname) =>
|
|
@@ -9410,12 +9410,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
|
|
|
9410
9410
|
// runtime request.
|
|
9411
9411
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
9412
9412
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
9413
|
-
${_optionalChain([config, 'access', _240 => _240.agent, 'optionalAccess', _241 => _241.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(
|
|
9413
|
+
${_optionalChain([config, 'access', _240 => _240.agent, 'optionalAccess', _241 => _241.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkTQJ35BBWcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
9414
9414
|
` : ""}${_optionalChain([config, 'access', _242 => _242.agent, 'optionalAccess', _243 => _243.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
9415
|
-
|
|
9415
|
+
_chunkTQJ35BBWcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
9416
9416
|
build: config.deploymentId,
|
|
9417
|
-
packages:
|
|
9418
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
9417
|
+
packages: _chunkP253SZJFcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
9418
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkP253SZJFcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
9419
9419
|
})
|
|
9420
9420
|
)};
|
|
9421
9421
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -10786,10 +10786,10 @@ async function handleMetadataImageRequest(request, routePathname) {
|
|
|
10786
10786
|
path: match.pagePath,
|
|
10787
10787
|
};
|
|
10788
10788
|
|
|
10789
|
-
${hasGeneratedMetadataImages ? `const value = await resolveFarmMetadataImageValue(imageModule, props${
|
|
10789
|
+
${hasGeneratedMetadataImages ? `const value = await resolveFarmMetadataImageValue(imageModule, props${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? "" : ", {\n renderer: ReactDOMServer,\n component: image.component === true,\n }"});
|
|
10790
10790
|
return createFarmMetadataImageResponse(value, imageModule, {
|
|
10791
10791
|
method,
|
|
10792
|
-
ifNoneMatch: request.headers.get("if-none-match"),${
|
|
10792
|
+
ifNoneMatch: request.headers.get("if-none-match"),${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: ReactDOMServer,"}
|
|
10793
10793
|
});` : 'throw new Error("Generated metadata image runtime is unavailable");'}
|
|
10794
10794
|
} catch (error) {
|
|
10795
10795
|
console.error("Metadata image render failed:", error);
|
|
@@ -10923,7 +10923,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
10923
10923
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
10924
10924
|
// registered at runtime, such as the docs engine's.
|
|
10925
10925
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
10926
|
-
_chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
10926
|
+
_chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunk2NKNP4AHcjs.FARM_VERSION)
|
|
10927
10927
|
)};
|
|
10928
10928
|
let farmDefaultMCPRouteFree;
|
|
10929
10929
|
function getFarmDefaultMCPServer() {
|
|
@@ -11117,7 +11117,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
|
|
|
11117
11117
|
// middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
|
|
11118
11118
|
const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
|
|
11119
11119
|
const farmPrerendering =
|
|
11120
|
-
typeof process !== "undefined" && process.env?.${
|
|
11120
|
+
typeof process !== "undefined" && process.env?.${_chunkBAD6T5NUcjs.FARM_PRERENDER_ENV} === "1";
|
|
11121
11121
|
` : ""}
|
|
11122
11122
|
const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
|
|
11123
11123
|
config: farmMiddlewareConfig,
|
|
@@ -11373,7 +11373,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
11373
11373
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
11374
11374
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
11375
11375
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
11376
|
-
|
|
11376
|
+
_chunkTQJ35BBWcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
11377
11377
|
agent: {
|
|
11378
11378
|
...config.agent,
|
|
11379
11379
|
aiCatalog: servesAiCatalog,
|
|
@@ -12150,7 +12150,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12150
12150
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
12151
12151
|
// public manifest, the same document for every request.
|
|
12152
12152
|
if (
|
|
12153
|
-
[${JSON.stringify(
|
|
12153
|
+
[${JSON.stringify(_chunkTQJ35BBWcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkTQJ35BBWcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
12154
12154
|
normalizeRuntimePath(routePathname),
|
|
12155
12155
|
)
|
|
12156
12156
|
) {
|
|
@@ -12162,7 +12162,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12162
12162
|
` : ""}
|
|
12163
12163
|
${_optionalChain([config, 'access', _274 => _274.agent, 'optionalAccess', _275 => _275.apiCatalog]) ? `
|
|
12164
12164
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
12165
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
12165
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkTQJ35BBWcjs.FARM_API_CATALOG_PATH)}) {
|
|
12166
12166
|
return applyProductionMiddlewareHeaders(
|
|
12167
12167
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
12168
12168
|
middlewareHeaders,
|
|
@@ -12722,7 +12722,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12722
12722
|
pageElement,
|
|
12723
12723
|
);
|
|
12724
12724
|
|
|
12725
|
-
${
|
|
12725
|
+
${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) pageElement = markPagePosition(React, pageElement);" : ""}
|
|
12726
12726
|
// Wrap with layouts (from innermost to outermost)
|
|
12727
12727
|
// Layouts are sorted by depth (root first), so we process in reverse
|
|
12728
12728
|
let wrappedElement = pageElement;
|
|
@@ -12796,7 +12796,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12796
12796
|
wrappedElement = wrapFarmRouteClientGraph(wrappedElement);
|
|
12797
12797
|
}
|
|
12798
12798
|
|
|
12799
|
-
${
|
|
12799
|
+
${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) wrappedElement = markLayoutPosition(React, wrappedElement);" : ""}
|
|
12800
12800
|
wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
|
|
12801
12801
|
return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern, farmFlushToken);
|
|
12802
12802
|
};
|
|
@@ -13994,7 +13994,7 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
13994
13994
|
}
|
|
13995
13995
|
if (_chunk4B6YJ5DScjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
13996
13996
|
if (_chunk4B6YJ5DScjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
13997
|
-
if (
|
|
13997
|
+
if (_chunkFDU4Q4QPcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
13998
13998
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
13999
13999
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
14000
14000
|
if (_optionalChain([manifestEntry, 'optionalAccess', _295 => _295.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
@@ -14030,7 +14030,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
14030
14030
|
}
|
|
14031
14031
|
return pages2;
|
|
14032
14032
|
}
|
|
14033
|
-
const pages = await
|
|
14033
|
+
const pages = await _chunkBLZCAFGJcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
14034
14034
|
if (!pages) {
|
|
14035
14035
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
14036
14036
|
`The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
|
|
@@ -14044,7 +14044,7 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
|
14044
14044
|
return [];
|
|
14045
14045
|
}
|
|
14046
14046
|
try {
|
|
14047
|
-
return await
|
|
14047
|
+
return await _chunkBLZCAFGJcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
|
|
14048
14048
|
root,
|
|
14049
14049
|
srcDir: config.srcDir,
|
|
14050
14050
|
adapter: _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
|
|
@@ -14073,10 +14073,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14073
14073
|
const nitroBuilder = nitroBuilderResult.value;
|
|
14074
14074
|
const isVercel = preset === "vercel";
|
|
14075
14075
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
14076
|
-
const outputDir =
|
|
14076
|
+
const outputDir = _chunkFDU4Q4QPcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
14077
14077
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
14078
14078
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
14079
|
-
const imageRuntime =
|
|
14079
|
+
const imageRuntime = _chunkP253SZJFcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
14080
14080
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
14081
14081
|
(image) => image.sourceType === "module"
|
|
14082
14082
|
);
|
|
@@ -14552,7 +14552,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14552
14552
|
varyFarmNitroCacheRules(_chunkIIHZ2BEEcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
|
|
14553
14553
|
...config.md.enabled ? ["accept"] : [],
|
|
14554
14554
|
...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : [],
|
|
14555
|
-
...
|
|
14555
|
+
..._chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _306 => _306.experimental, 'optionalAccess', _307 => _307.serverComponents])) === "islands" ? ["f-layouts"] : []
|
|
14556
14556
|
]),
|
|
14557
14557
|
config.basePath,
|
|
14558
14558
|
_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
|
|
@@ -14900,13 +14900,13 @@ function toFarmNodeResponse(request, response) {
|
|
|
14900
14900
|
}
|
|
14901
14901
|
if (prerenderRoutes.length > 0) {
|
|
14902
14902
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
14903
|
-
const previousPrerender = process.env[
|
|
14904
|
-
process.env[
|
|
14903
|
+
const previousPrerender = process.env[_chunkBAD6T5NUcjs.FARM_PRERENDER_ENV];
|
|
14904
|
+
process.env[_chunkBAD6T5NUcjs.FARM_PRERENDER_ENV] = "1";
|
|
14905
14905
|
try {
|
|
14906
14906
|
await nitroBuilder.prerender(nitroInstance);
|
|
14907
14907
|
} finally {
|
|
14908
|
-
if (previousPrerender === void 0) delete process.env[
|
|
14909
|
-
else process.env[
|
|
14908
|
+
if (previousPrerender === void 0) delete process.env[_chunkBAD6T5NUcjs.FARM_PRERENDER_ENV];
|
|
14909
|
+
else process.env[_chunkBAD6T5NUcjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
14910
14910
|
}
|
|
14911
14911
|
}
|
|
14912
14912
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs5, preset) : Promise.resolve(null);
|
|
@@ -15261,7 +15261,7 @@ async function stageSharpRuntime(config, root, distDir, fs5, preset) {
|
|
|
15261
15261
|
try {
|
|
15262
15262
|
await copyPackage("sharp", sharpRequire);
|
|
15263
15263
|
if (!copiedPackages.has("sharp")) {
|
|
15264
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
15264
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkP253SZJFcjs.SHARP_INSTALL_HINT}`);
|
|
15265
15265
|
}
|
|
15266
15266
|
} catch (error) {
|
|
15267
15267
|
await fs5.rm(stageDir, { recursive: true, force: true });
|
|
@@ -15494,7 +15494,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
15494
15494
|
// src/build/index.ts
|
|
15495
15495
|
async function build(config, options = {}) {
|
|
15496
15496
|
return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
|
|
15497
|
-
() =>
|
|
15497
|
+
() => _chunkQYDGIXQ5cjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
15498
15498
|
);
|
|
15499
15499
|
}
|
|
15500
15500
|
function createBuildTargetBaseline(config) {
|
|
@@ -15505,7 +15505,7 @@ function createBuildTargetBaseline(config) {
|
|
|
15505
15505
|
preset,
|
|
15506
15506
|
distDir,
|
|
15507
15507
|
outputDir,
|
|
15508
|
-
outputWasDerived: outputDir ===
|
|
15508
|
+
outputWasDerived: outputDir === _chunkFDU4Q4QPcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
15509
15509
|
};
|
|
15510
15510
|
}
|
|
15511
15511
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -15514,8 +15514,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
15514
15514
|
const distDir = config.distDir || ".farm";
|
|
15515
15515
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
15516
15516
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
15517
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
15518
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
15517
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkFDU4Q4QPcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
15518
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkFDU4Q4QPcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
15519
15519
|
return {
|
|
15520
15520
|
root,
|
|
15521
15521
|
preset,
|
|
@@ -15523,7 +15523,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
15523
15523
|
distDir,
|
|
15524
15524
|
deployTarget,
|
|
15525
15525
|
outputDir,
|
|
15526
|
-
deployOutputDir:
|
|
15526
|
+
deployOutputDir: _chunkFDU4Q4QPcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
15527
15527
|
};
|
|
15528
15528
|
}
|
|
15529
15529
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -15560,7 +15560,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15560
15560
|
};
|
|
15561
15561
|
config = {
|
|
15562
15562
|
...config,
|
|
15563
|
-
images:
|
|
15563
|
+
images: _chunkP253SZJFcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
15564
15564
|
root: targets.root,
|
|
15565
15565
|
preset: targets.preset
|
|
15566
15566
|
})
|
|
@@ -15568,7 +15568,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15568
15568
|
if (_optionalChain([config, 'access', _350 => _350.docs, 'optionalAccess', _351 => _351.enabled])) await _chunkNDOE76QCcjs.loadFarmDocsEngine.call(void 0, );
|
|
15569
15569
|
pluginManager.updateContext({ config });
|
|
15570
15570
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
15571
|
-
|
|
15571
|
+
_chunkQYDGIXQ5cjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkQYDGIXQ5cjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
|
|
15572
15572
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
15573
15573
|
await pluginManager.setupPlugins();
|
|
15574
15574
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
@@ -15589,12 +15589,12 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15589
15589
|
root,
|
|
15590
15590
|
rendererBuild.signal
|
|
15591
15591
|
);
|
|
15592
|
-
const farmApp =
|
|
15592
|
+
const farmApp = _chunkP253SZJFcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
15593
15593
|
if (options.universal !== false) farmApp.getRouteManager().keepBuildSourceSnapshot();
|
|
15594
15594
|
await farmApp.initialize();
|
|
15595
15595
|
const routeManager = farmApp.getRouteManager();
|
|
15596
15596
|
const serverRenderer = farmApp.getServerRenderer();
|
|
15597
|
-
const typeArtifacts =
|
|
15597
|
+
const typeArtifacts = _chunkXMVZXZ32cjs.generateFarmTypeArtifacts.call(void 0, {
|
|
15598
15598
|
root,
|
|
15599
15599
|
srcDir,
|
|
15600
15600
|
layers: config.layers,
|
|
@@ -15695,11 +15695,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15695
15695
|
}
|
|
15696
15696
|
async function createProjectModuleServer(createViteServer, config, root, buildLifetime) {
|
|
15697
15697
|
const { farmNavigationPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
15698
|
-
const rendererVitePlugins = await
|
|
15698
|
+
const rendererVitePlugins = await _chunkT7UC2ORAcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
|
|
15699
15699
|
ssr: true,
|
|
15700
15700
|
buildLifetime
|
|
15701
15701
|
});
|
|
15702
|
-
const viteConfig =
|
|
15702
|
+
const viteConfig = _chunkP253SZJFcjs.mergeFarmViteConfig.call(void 0,
|
|
15703
15703
|
{
|
|
15704
15704
|
root,
|
|
15705
15705
|
appType: "custom",
|
|
@@ -15711,12 +15711,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15711
15711
|
},
|
|
15712
15712
|
plugins: [
|
|
15713
15713
|
...rendererVitePlugins,
|
|
15714
|
-
|
|
15714
|
+
_chunkP253SZJFcjs.farmFontImportsPlugin.call(void 0, {
|
|
15715
15715
|
root,
|
|
15716
15716
|
basePath: config.basePath,
|
|
15717
15717
|
publicDir: config.publicDir
|
|
15718
15718
|
}),
|
|
15719
|
-
|
|
15719
|
+
_chunkQYDGIXQ5cjs.farmEnvironmentFunctionsPlugin.call(void 0, { renderer: config.renderer }),
|
|
15720
15720
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
15721
15721
|
// resolves as it does in the server build. Module-entry packages load pre-bundled, as in
|
|
15722
15722
|
// `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
|
|
@@ -15732,7 +15732,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15732
15732
|
hmr: false
|
|
15733
15733
|
},
|
|
15734
15734
|
resolve: {
|
|
15735
|
-
alias:
|
|
15735
|
+
alias: _chunkP253SZJFcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
15736
15736
|
dedupe: [...config.renderer.dedupe || []]
|
|
15737
15737
|
},
|
|
15738
15738
|
optimizeDeps: {
|
|
@@ -15810,7 +15810,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15810
15810
|
farmNavigationPlugin(config.renderer),
|
|
15811
15811
|
farmIslandContainersPlugin(config),
|
|
15812
15812
|
farmPlugin(config, pluginManager),
|
|
15813
|
-
|
|
15813
|
+
_chunkQYDGIXQ5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
15814
15814
|
],
|
|
15815
15815
|
mode: "production"
|
|
15816
15816
|
});
|
|
@@ -15844,14 +15844,14 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15844
15844
|
farmI18nClientBridgePlugin(),
|
|
15845
15845
|
farmIslandContainersPlugin(config),
|
|
15846
15846
|
farmPlugin(config, pluginManager),
|
|
15847
|
-
|
|
15847
|
+
_chunkQYDGIXQ5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
15848
15848
|
],
|
|
15849
15849
|
mode: "production"
|
|
15850
15850
|
});
|
|
15851
15851
|
}
|
|
15852
15852
|
function resolveLegacyPageEntry(config, root, srcDir) {
|
|
15853
15853
|
const appDir = _path2.default.join(root, srcDir, "app");
|
|
15854
|
-
for (const extension of
|
|
15854
|
+
for (const extension of _chunkT7UC2ORAcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer)) {
|
|
15855
15855
|
const candidate = _path2.default.join(appDir, `page${extension}`);
|
|
15856
15856
|
if (_fs.existsSync.call(void 0, candidate)) return candidate;
|
|
15857
15857
|
}
|
|
@@ -15872,7 +15872,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15872
15872
|
if (pluginManager) {
|
|
15873
15873
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
15874
15874
|
}
|
|
15875
|
-
const outputDir =
|
|
15875
|
+
const outputDir = _chunkFDU4Q4QPcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
15876
15876
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
15877
15877
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
15878
15878
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -15943,7 +15943,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15943
15943
|
root,
|
|
15944
15944
|
preset,
|
|
15945
15945
|
distDir,
|
|
15946
|
-
outputDir:
|
|
15946
|
+
outputDir: _chunkFDU4Q4QPcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
15947
15947
|
});
|
|
15948
15948
|
}
|
|
15949
15949
|
}
|