@farm.js/plugin 0.1.27 → 0.1.28
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/rsc/entries/client.js +1 -1
- package/dist/rsc/entries/rsc.d.ts.map +1 -1
- package/dist/rsc/entries/rsc.js +44 -1
- package/dist/rsc/index.d.ts +7 -0
- package/dist/rsc/index.d.ts.map +1 -1
- package/dist/rsc/index.js +56 -281
- package/dist/rsc/types.d.ts +3 -0
- package/dist/rsc/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
`;
|
|
64
64
|
if (ctx.actionsEnabled) {
|
|
65
65
|
imports += `import { setServerCallback, encodeReply, createTemporaryReferenceSet } from '@vitejs/plugin-rsc/browser';
|
|
66
|
-
import { applyFarmCacheInvalidations } from '@farm.js/core/
|
|
66
|
+
import { applyFarmCacheInvalidations } from '@farm.js/core/internal/client-runtime';
|
|
67
67
|
import {
|
|
68
68
|
beginFarmServerQueryAction,
|
|
69
69
|
completeFarmServerQueryAction,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../../../src/rsc/entries/rsc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,CAe5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../../../src/rsc/entries/rsc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,CAe5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAohC1D"}
|
package/dist/rsc/entries/rsc.js
CHANGED
|
@@ -92,8 +92,17 @@ import {
|
|
|
92
92
|
getRoutePatternSpecificity,
|
|
93
93
|
} from '@farm.js/core/internal/production-runtime';
|
|
94
94
|
|
|
95
|
+
import {
|
|
96
|
+
FARM_MARKDOWN_CONTENT_TYPE,
|
|
97
|
+
applyMarkdownNegotiationHeaders,
|
|
98
|
+
createFarmMarkdownErrorBody,
|
|
99
|
+
createMarkdownMirrorResponse,
|
|
100
|
+
farmRequestWantsMarkdown,
|
|
101
|
+
} from '@farm.js/core/markdown';
|
|
102
|
+
|
|
95
103
|
const farmDeploymentId = ${JSON.stringify(ctx.deploymentId)};
|
|
96
104
|
const farmApiBasePath = ${JSON.stringify(ctx.apiBasePath ?? "/api")};
|
|
105
|
+
const farmMarkdownConfig = ${JSON.stringify(ctx.markdown ?? { enabled: false, expose: [], cache: false, includeMetadata: true })};
|
|
97
106
|
`;
|
|
98
107
|
if (ctx.actionsEnabled) {
|
|
99
108
|
code += `import {
|
|
@@ -731,6 +740,17 @@ async function handleFarmRequest(request, context) {
|
|
|
731
740
|
|
|
732
741
|
if (!matched) {
|
|
733
742
|
debug('404 - No route found for:', url.pathname);
|
|
743
|
+
// Agents that read in Markdown get a Markdown 404, as in core's server.
|
|
744
|
+
if (farmMarkdownConfig.enabled && farmRequestWantsMarkdown(url.pathname, request.headers.get('accept'))) {
|
|
745
|
+
return new Response(createFarmMarkdownErrorBody(404, url.pathname), {
|
|
746
|
+
status: 404,
|
|
747
|
+
headers: {
|
|
748
|
+
'Content-Type': FARM_MARKDOWN_CONTENT_TYPE,
|
|
749
|
+
'X-Farm-Markdown-Error': '404',
|
|
750
|
+
'Cache-Control': 'no-store',
|
|
751
|
+
},
|
|
752
|
+
});
|
|
753
|
+
}
|
|
734
754
|
return new Response('Not Found', { status: 404 });
|
|
735
755
|
}
|
|
736
756
|
|
|
@@ -980,13 +1000,36 @@ async function handleFarmRequest(request, context) {
|
|
|
980
1000
|
}
|
|
981
1001
|
}
|
|
982
1002
|
|
|
1003
|
+
/**
|
|
1004
|
+
* Serves a page's Markdown mirror (\`/page.md\` or \`Accept: text/markdown\`) by
|
|
1005
|
+
* rendering the page through the normal request path, so middleware and sign-in
|
|
1006
|
+
* gates apply; every other request renders as usual, and HTML pages advertise
|
|
1007
|
+
* their mirror with a Link header.
|
|
1008
|
+
*/
|
|
1009
|
+
async function handleFarmPageOrMarkdown(request, context) {
|
|
1010
|
+
if (!farmMarkdownConfig.enabled) return handleFarmRequest(request, context);
|
|
1011
|
+
const markdown = await createMarkdownMirrorResponse({
|
|
1012
|
+
request,
|
|
1013
|
+
config: farmMarkdownConfig,
|
|
1014
|
+
routeExists: (pathname) => Boolean(matchRoute(pathname)),
|
|
1015
|
+
renderPage: (pageRequest) => handleFarmRequest(pageRequest, context),
|
|
1016
|
+
apiServerBasePath: farmApiBasePath,
|
|
1017
|
+
});
|
|
1018
|
+
if (markdown) return markdown;
|
|
1019
|
+
const response = await handleFarmRequest(request, context);
|
|
1020
|
+
return applyMarkdownNegotiationHeaders(response, {
|
|
1021
|
+
config: farmMarkdownConfig,
|
|
1022
|
+
pathname: new URL(request.url).pathname,
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
|
|
983
1026
|
async function handler(request, context) {
|
|
984
1027
|
return _runWithAPIRequestRuntime({
|
|
985
1028
|
basePath: farmApiBasePath,
|
|
986
1029
|
dispatch: async (localRequest) =>
|
|
987
1030
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: 'Not Found' }, { status: 404 }),
|
|
988
1031
|
}, () => _runWithCurrentRequest(request, () =>
|
|
989
|
-
_runWithAfterRequest(request, () =>
|
|
1032
|
+
_runWithAfterRequest(request, () => handleFarmPageOrMarkdown(request, context), context)
|
|
990
1033
|
));
|
|
991
1034
|
}
|
|
992
1035
|
|
package/dist/rsc/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import type { FarmAPIConfig } from "@farm.js/core/api";
|
|
|
28
28
|
import type { FarmMiddlewareConfig } from "@farm.js/core/middleware";
|
|
29
29
|
import type { FarmServerConfig } from "@farm.js/core/internal/production-runtime";
|
|
30
30
|
import type { FarmLayerEntry, ResolvedFarmLayer } from "@farm.js/core/server";
|
|
31
|
+
import { type FarmMarkdownUserConfig } from "@farm.js/core/markdown";
|
|
31
32
|
export type { FarmRscPluginOptions, EntryContext };
|
|
32
33
|
export { buildRscNitro, waitForRscManifest, waitForRscOutputs } from "./nitro-build.js";
|
|
33
34
|
export type { BuildRscNitroOptions } from "./nitro-build.js";
|
|
@@ -77,6 +78,12 @@ export interface FarmRscConfig {
|
|
|
77
78
|
};
|
|
78
79
|
/** Extra Vite plugins (e.g. rsc() with entries so client build resolves virtual:vite-rsc/client-references). */
|
|
79
80
|
plugins?: any[];
|
|
81
|
+
/**
|
|
82
|
+
* Markdown mirrors for agents: `/page.md` and `Accept: text/markdown`, with
|
|
83
|
+
* `?outline`, `?section`, `?max_tokens`, and `?actions`. Same options as core's `md`.
|
|
84
|
+
* @default true
|
|
85
|
+
*/
|
|
86
|
+
md?: FarmMarkdownUserConfig | boolean;
|
|
80
87
|
}
|
|
81
88
|
/**
|
|
82
89
|
* Define a Farm.js RSC configuration
|
package/dist/rsc/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rsc/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAIL,KAAK,MAAM,EACX,KAAK,UAAU,EAChB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,KAAK,EA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
@@ -27,6 +27,7 @@ import { init as initModuleLexer, parse as parseModuleImports } from "es-module-
|
|
|
27
27
|
import { farmEnvironmentFunctionsPlugin } from "@farm.js/core/environment/vite";
|
|
28
28
|
import { generateClientCachePersistenceCode, resolveFarmClientCacheAdapterEntry, } from "@farm.js/core/vite";
|
|
29
29
|
import { generateRscEntry } from "./entries/rsc.js";
|
|
30
|
+
import { resolveMarkdownConfig } from "@farm.js/core/markdown";
|
|
30
31
|
import { generateSsrEntry } from "./entries/ssr.js";
|
|
31
32
|
import { generateErrorFallbackEntry } from "./entries/error-fallback.js";
|
|
32
33
|
import { generateClientEntry, serverFnTransportErrorClientRuntime } from "./entries/client.js";
|
|
@@ -46,11 +47,12 @@ import { createRequire } from "node:module";
|
|
|
46
47
|
// Use API and middleware plugins from @farm.js/core (require so CJS build resolves when ESM .mjs is missing)
|
|
47
48
|
const require_ = createRequire(import.meta.url);
|
|
48
49
|
const { farmApiPlugin } = require_("@farm.js/core");
|
|
50
|
+
const { FARM_VERSION } = require_("@farm.js/core/version");
|
|
49
51
|
const { farmMiddlewarePlugin } = require_("@farm.js/core/middleware");
|
|
50
52
|
const { resolveServerActionsConfig, validateServerActionRequest, createServerActionRequestErrorResponse, } = require_("@farm.js/core/server-action-security");
|
|
51
53
|
const { normalizeFarmDeploymentId } = require_("@farm.js/core/deployment");
|
|
52
54
|
const { getFarmLayerAliases, getFarmSourceRoots, resolveFarmLayers } = require_("@farm.js/core/server");
|
|
53
|
-
const {
|
|
55
|
+
const { readNodeRequestBody, resolveFarmServerConfig, resolveFarmI18nConfig, createFarmRequestBodyErrorResponse, createDefaultErrorMarkup, } = require_("@farm.js/core/internal/production-runtime");
|
|
54
56
|
const { isFarmAPIPathname } = require_("@farm.js/core/api/runtime");
|
|
55
57
|
const { resolveFarmAPIConfig, resolveFarmAPIServerBasePath } = require_("@farm.js/core/api");
|
|
56
58
|
const { getResolvedEnv } = require_("@farm.js/core/env");
|
|
@@ -80,6 +82,7 @@ export function defineConfig(config = {}) {
|
|
|
80
82
|
serverActions: config.serverActions,
|
|
81
83
|
deploymentId: config.deploymentId,
|
|
82
84
|
generateBuildId: config.generateBuildId,
|
|
85
|
+
md: config.md,
|
|
83
86
|
// Vite server configuration
|
|
84
87
|
server: {
|
|
85
88
|
...config.server,
|
|
@@ -88,11 +91,6 @@ export function defineConfig(config = {}) {
|
|
|
88
91
|
},
|
|
89
92
|
// Custom logger to hide Vite's default startup banner
|
|
90
93
|
customLogger: createFarmLogger(port, debug),
|
|
91
|
-
// Configure esbuild for JSX transformation
|
|
92
|
-
esbuild: {
|
|
93
|
-
jsx: "automatic",
|
|
94
|
-
jsxImportSource: "react",
|
|
95
|
-
},
|
|
96
94
|
plugins: [
|
|
97
95
|
farmMiddlewarePlugin({
|
|
98
96
|
srcDir: config.srcDir ?? "src",
|
|
@@ -240,6 +238,23 @@ function isOptimizedBoundaryModule(id) {
|
|
|
240
238
|
id === STRATA_PACKAGE ||
|
|
241
239
|
id.startsWith(`${STRATA_PACKAGE}/`));
|
|
242
240
|
}
|
|
241
|
+
/** The development error page for a failed RSC render: core's error page, with the real error. */
|
|
242
|
+
function createRscDevErrorDocument(error, method, pathname) {
|
|
243
|
+
const failure = error instanceof Error ? error : new Error(String(error));
|
|
244
|
+
const markup = createDefaultErrorMarkup({
|
|
245
|
+
statusCode: 500,
|
|
246
|
+
requestPath: pathname,
|
|
247
|
+
method,
|
|
248
|
+
message: failure.message,
|
|
249
|
+
errorName: failure.name,
|
|
250
|
+
stack: failure.stack,
|
|
251
|
+
development: true,
|
|
252
|
+
mode: "development",
|
|
253
|
+
farmVersion: FARM_VERSION,
|
|
254
|
+
nodeVersion: process.version,
|
|
255
|
+
});
|
|
256
|
+
return `<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>500 · Farm.js</title></head><body>${markup}</body></html>`;
|
|
257
|
+
}
|
|
243
258
|
function resolveOptimizedBoundaryRuntimeRoot() {
|
|
244
259
|
try {
|
|
245
260
|
return path.dirname(require_.resolve(`${STRATA_PACKAGE}/package.json`));
|
|
@@ -693,6 +708,7 @@ export default function farmRsc(options = {}) {
|
|
|
693
708
|
allowedOrigins: options.serverActions?.allowedOrigins ?? c.serverActions?.allowedOrigins,
|
|
694
709
|
}),
|
|
695
710
|
deploymentId,
|
|
711
|
+
markdown: resolveMarkdownConfig(c.md),
|
|
696
712
|
// Resolved the same way core resolves it for the config, so RSC and
|
|
697
713
|
// non-RSC apps match middleware against the same pathname.
|
|
698
714
|
i18n: resolveFarmI18nConfig(c.i18n, {
|
|
@@ -809,10 +825,11 @@ export default function farmRsc(options = {}) {
|
|
|
809
825
|
: []),
|
|
810
826
|
],
|
|
811
827
|
},
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
828
|
+
// Vite 8 compiles with oxc, which already uses the automatic runtime;
|
|
829
|
+
// setting esbuild there only prints a "both options were set" warning.
|
|
830
|
+
...(this?.meta?.rolldownVersion
|
|
831
|
+
? {}
|
|
832
|
+
: { esbuild: { jsx: "automatic", jsxImportSource: "react" } }),
|
|
816
833
|
...(c.layers?.length
|
|
817
834
|
? {
|
|
818
835
|
server: {
|
|
@@ -829,7 +846,14 @@ export default function farmRsc(options = {}) {
|
|
|
829
846
|
copyPublicDir: false,
|
|
830
847
|
rollupOptions: { input: { index: entryRsc } },
|
|
831
848
|
},
|
|
832
|
-
resolve: {
|
|
849
|
+
resolve: {
|
|
850
|
+
conditions: ["react-server", "node", "import"],
|
|
851
|
+
// Strata is a native CommonJS loader: Node must load it, not Vite's
|
|
852
|
+
// module runner. ssr.external does not reach this environment.
|
|
853
|
+
...(optimizedBoundaryEnabled
|
|
854
|
+
? { external: [STRATA_PACKAGE, `${STRATA_PACKAGE}/react-server`] }
|
|
855
|
+
: {}),
|
|
856
|
+
},
|
|
833
857
|
},
|
|
834
858
|
ssr: {
|
|
835
859
|
build: {
|
|
@@ -845,6 +869,19 @@ export default function farmRsc(options = {}) {
|
|
|
845
869
|
rollupOptions: { input: { index: entryClient } },
|
|
846
870
|
},
|
|
847
871
|
resolve: { conditions: ["browser", "import"] },
|
|
872
|
+
// Optimize what the browser entry needs up front. A dependency first
|
|
873
|
+
// found on page load makes Vite re-optimize and reload, and until the
|
|
874
|
+
// reload client components can see two React copies ("Invalid hook call").
|
|
875
|
+
optimizeDeps: {
|
|
876
|
+
include: [
|
|
877
|
+
"react",
|
|
878
|
+
"react/jsx-runtime",
|
|
879
|
+
"react/jsx-dev-runtime",
|
|
880
|
+
"react-dom",
|
|
881
|
+
"react-dom/client",
|
|
882
|
+
"rsc-html-stream/client",
|
|
883
|
+
],
|
|
884
|
+
},
|
|
848
885
|
},
|
|
849
886
|
},
|
|
850
887
|
};
|
|
@@ -1109,7 +1146,6 @@ if (document.readyState === 'loading') {
|
|
|
1109
1146
|
logInfo("Dev server middleware ready");
|
|
1110
1147
|
const serverStartTime = Date.now();
|
|
1111
1148
|
let bannerPrinted = false;
|
|
1112
|
-
const pageCache = new Map();
|
|
1113
1149
|
server.httpServer?.once("listening", () => {
|
|
1114
1150
|
if (bannerPrinted)
|
|
1115
1151
|
return;
|
|
@@ -1119,7 +1155,7 @@ if (document.readyState === 'loading') {
|
|
|
1119
1155
|
const port = typeof address === "object" && address ? address.port : 3000;
|
|
1120
1156
|
const colors = getColors();
|
|
1121
1157
|
console.log("");
|
|
1122
|
-
console.log(` ${colors.bold(colors.green("Farm.js"))} ${colors.dim(
|
|
1158
|
+
console.log(` ${colors.bold(colors.green("Farm.js"))} ${colors.dim(`v${FARM_VERSION}`)} ${colors.dim(`ready in ${elapsed}ms`)}`);
|
|
1123
1159
|
console.log("");
|
|
1124
1160
|
console.log(` ${colors.dim("➜")} ${colors.bold("Local:")} ${colors.cyan(`http://localhost:${port}/`)}`);
|
|
1125
1161
|
console.log(` ${colors.dim("➜")} ${colors.bold("Network:")} ${colors.dim("use --host to expose")}`);
|
|
@@ -1229,276 +1265,15 @@ if (document.readyState === 'loading') {
|
|
|
1229
1265
|
res.destroy(rscError instanceof Error ? rscError : new Error(String(rscError)));
|
|
1230
1266
|
return;
|
|
1231
1267
|
}
|
|
1232
|
-
//
|
|
1233
|
-
|
|
1234
|
-
const duration = Date.now() - startTime;
|
|
1235
|
-
logResponse(method, pathname, 500, duration);
|
|
1236
|
-
console.error("[Farm.js] RSC dev handler error:", rscError);
|
|
1237
|
-
res.statusCode = 500;
|
|
1238
|
-
res.setHeader("Content-Type", "text/html");
|
|
1239
|
-
res.end(`<!DOCTYPE html><html><head><title>Error</title></head><body><pre>${rscError.message}</pre></body></html>`);
|
|
1240
|
-
return;
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
try {
|
|
1244
|
-
if (method !== "GET")
|
|
1245
|
-
return next();
|
|
1246
|
-
// Get middleware data from standalone middleware plugin
|
|
1247
|
-
const middlewareData = req.__FARM_MIDDLEWARE_DATA__ || {};
|
|
1248
|
-
// Build the glob pattern for discovering routes (Farm convention: src/app when routesDir unset)
|
|
1249
|
-
const srcDir = entryContext.srcDir;
|
|
1250
|
-
const appSegment = entryContext.routesDir === undefined ? "app" : entryContext.routesDir.trim();
|
|
1251
|
-
const glob = appSegment ? `/${srcDir}/${appSegment}` : `/${srcDir}`;
|
|
1252
|
-
// Find matching page file
|
|
1253
|
-
const normalized = pathname.replace(/\/$/, "") || "/";
|
|
1254
|
-
// Common page file patterns
|
|
1255
|
-
const possiblePaths = [
|
|
1256
|
-
`${glob}${normalized === "/" ? "" : normalized}/page.tsx`,
|
|
1257
|
-
`${glob}${normalized === "/" ? "" : normalized}/page.jsx`,
|
|
1258
|
-
`${glob}/page.tsx`,
|
|
1259
|
-
`${glob}/page.jsx`,
|
|
1260
|
-
];
|
|
1261
|
-
// Also check for dynamic routes by walking up the path
|
|
1262
|
-
const parts = normalized.split("/").filter(Boolean);
|
|
1263
|
-
for (let i = parts.length; i >= 0; i--) {
|
|
1264
|
-
const base = parts.slice(0, i).join("/");
|
|
1265
|
-
possiblePaths.push(base ? `${glob}/${base}/page.tsx` : `${glob}/page.tsx`);
|
|
1266
|
-
possiblePaths.push(base ? `${glob}/${base}/page.jsx` : `${glob}/page.jsx`);
|
|
1267
|
-
}
|
|
1268
|
-
let pageModule = null;
|
|
1269
|
-
let matchedPath = "";
|
|
1270
|
-
let layoutModule = null;
|
|
1271
|
-
// Try to find and load the page
|
|
1272
|
-
for (const pagePath of possiblePaths) {
|
|
1273
|
-
try {
|
|
1274
|
-
// Convert glob path to actual file path
|
|
1275
|
-
const actualPath = pagePath.startsWith("/") ? `.${pagePath}` : pagePath;
|
|
1276
|
-
if (pageCache.has(pagePath)) {
|
|
1277
|
-
pageModule = pageCache.get(pagePath);
|
|
1278
|
-
matchedPath = pagePath;
|
|
1279
|
-
break;
|
|
1280
|
-
}
|
|
1281
|
-
pageModule = await loadFarmDevModule(server, actualPath);
|
|
1282
|
-
if (pageModule?.default) {
|
|
1283
|
-
pageCache.set(pagePath, pageModule);
|
|
1284
|
-
matchedPath = pagePath;
|
|
1285
|
-
// Page loaded successfully
|
|
1286
|
-
break;
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
catch (e) {
|
|
1290
|
-
// Page not found at this path, continue
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
if (!pageModule?.default) {
|
|
1294
|
-
return next();
|
|
1295
|
-
}
|
|
1296
|
-
try {
|
|
1297
|
-
const layoutPath = `./${srcDir}${appSegment ? `/${appSegment}` : ""}/layout.tsx`;
|
|
1298
|
-
layoutModule = await loadFarmDevModule(server, layoutPath);
|
|
1299
|
-
}
|
|
1300
|
-
catch { }
|
|
1301
|
-
const React = await import("react");
|
|
1302
|
-
const ReactDOMServer = await import("react-dom/server");
|
|
1303
|
-
const Page = pageModule.default;
|
|
1304
|
-
const metadata = {
|
|
1305
|
-
title: typeof pageModule.metadata?.title === "string"
|
|
1306
|
-
? pageModule.metadata.title
|
|
1307
|
-
: layoutModule?.metadata?.title,
|
|
1308
|
-
description: typeof pageModule.metadata?.description === "string"
|
|
1309
|
-
? pageModule.metadata.description
|
|
1310
|
-
: layoutModule?.metadata?.description,
|
|
1311
|
-
};
|
|
1312
|
-
const Layout = layoutModule?.default;
|
|
1313
|
-
// Parse URL params (basic dynamic route support)
|
|
1314
|
-
const params = {};
|
|
1315
|
-
const searchParams = searchParamsToObject(resolveDevRequestURL(req).searchParams);
|
|
1316
|
-
// Render the page with middleware data
|
|
1317
|
-
const pageProps = {
|
|
1318
|
-
params,
|
|
1319
|
-
searchParams,
|
|
1320
|
-
// Middleware shared data is available to pages
|
|
1321
|
-
middlewareData,
|
|
1322
|
-
};
|
|
1323
|
-
// Helper to check if a function is async or returns a Promise
|
|
1324
|
-
// We need to actually call the function to detect this reliably
|
|
1325
|
-
// since transpiled async functions may not be detectable by constructor
|
|
1326
|
-
const isAsyncFunction = (fn) => {
|
|
1327
|
-
if (!fn)
|
|
1328
|
-
return false;
|
|
1329
|
-
// Check if it's an AsyncFunction
|
|
1330
|
-
if (fn.constructor?.name === "AsyncFunction")
|
|
1331
|
-
return true;
|
|
1332
|
-
// Check if function.toString() contains async
|
|
1333
|
-
try {
|
|
1334
|
-
const str = fn.toString();
|
|
1335
|
-
// Check for "async function" or "async (" patterns
|
|
1336
|
-
if (/^async\s/.test(str) || /^async\s*\(/.test(str))
|
|
1337
|
-
return true;
|
|
1338
|
-
}
|
|
1339
|
-
catch { }
|
|
1340
|
-
return false;
|
|
1341
|
-
};
|
|
1342
|
-
// Try to render the page - if it returns a Promise, it's async
|
|
1343
|
-
let pageContent;
|
|
1344
|
-
let isAsyncPage = isAsyncFunction(Page);
|
|
1345
|
-
try {
|
|
1346
|
-
const result = Page(pageProps);
|
|
1347
|
-
// Check if result is a Promise (thenable)
|
|
1348
|
-
if (result && typeof result.then === "function") {
|
|
1349
|
-
isAsyncPage = true;
|
|
1350
|
-
pageContent = await result;
|
|
1351
|
-
}
|
|
1352
|
-
else {
|
|
1353
|
-
// If it's not a Promise, it's a React element or we need to use createElement
|
|
1354
|
-
if (React.default.isValidElement(result)) {
|
|
1355
|
-
pageContent = result;
|
|
1356
|
-
}
|
|
1357
|
-
else {
|
|
1358
|
-
pageContent = React.default.createElement(Page, pageProps);
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
catch (e) {
|
|
1363
|
-
// If calling directly failed, use createElement
|
|
1364
|
-
pageContent = React.default.createElement(Page, pageProps);
|
|
1365
|
-
}
|
|
1366
|
-
// Check if Layout is async
|
|
1367
|
-
let isAsyncLayout = isAsyncFunction(Layout);
|
|
1368
|
-
// Wrap in layout if available
|
|
1369
|
-
let content = pageContent;
|
|
1370
|
-
if (Layout) {
|
|
1371
|
-
try {
|
|
1372
|
-
const layoutResult = Layout({ children: pageContent });
|
|
1373
|
-
if (layoutResult && typeof layoutResult.then === "function") {
|
|
1374
|
-
isAsyncLayout = true;
|
|
1375
|
-
content = await layoutResult;
|
|
1376
|
-
}
|
|
1377
|
-
else if (React.default.isValidElement(layoutResult)) {
|
|
1378
|
-
content = layoutResult;
|
|
1379
|
-
}
|
|
1380
|
-
else {
|
|
1381
|
-
content = React.default.createElement(Layout, null, pageContent);
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
catch (e) {
|
|
1385
|
-
content = React.default.createElement(Layout, null, pageContent);
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
// Create full HTML page
|
|
1389
|
-
const h = React.default.createElement;
|
|
1390
|
-
const isSyncPage = !isAsyncPage && !isAsyncLayout;
|
|
1391
|
-
// For sync pages we load preamble + vite client + hydrate in one script below; do not load vite-client in head so order is guaranteed.
|
|
1392
|
-
const routesDir = entryContext.routesDir === undefined ? "app" : entryContext.routesDir.trim();
|
|
1393
|
-
const routesPath = routesDir ? `/${routesDir}` : "";
|
|
1394
|
-
const headElements = [
|
|
1395
|
-
h("meta", { key: "charset", charSet: "utf-8" }),
|
|
1396
|
-
h("meta", {
|
|
1397
|
-
key: "viewport",
|
|
1398
|
-
name: "viewport",
|
|
1399
|
-
content: "width=device-width, initial-scale=1",
|
|
1400
|
-
}),
|
|
1401
|
-
metadata.title
|
|
1402
|
-
? h("title", { key: "title" }, metadata.title)
|
|
1403
|
-
: h("title", { key: "title" }, "Farm.js"),
|
|
1404
|
-
metadata.description
|
|
1405
|
-
? h("meta", {
|
|
1406
|
-
key: "description",
|
|
1407
|
-
name: "description",
|
|
1408
|
-
content: metadata.description,
|
|
1409
|
-
})
|
|
1410
|
-
: null,
|
|
1411
|
-
h("link", {
|
|
1412
|
-
key: "globals-css",
|
|
1413
|
-
rel: "stylesheet",
|
|
1414
|
-
href: `/${srcDir}${routesPath}/globals.css`,
|
|
1415
|
-
}),
|
|
1416
|
-
...(isSyncPage
|
|
1417
|
-
? []
|
|
1418
|
-
: [
|
|
1419
|
-
h("script", {
|
|
1420
|
-
key: "vite-client",
|
|
1421
|
-
type: "module",
|
|
1422
|
-
src: "/@vite/client",
|
|
1423
|
-
}),
|
|
1424
|
-
]),
|
|
1425
|
-
].filter(Boolean);
|
|
1426
|
-
// Create body elements
|
|
1427
|
-
// For async (server) pages, we don't hydrate the page itself - only client components within
|
|
1428
|
-
// For sync pages, we can hydrate the whole thing
|
|
1429
|
-
const bodyElements = [h("div", { key: "root", id: "root" }, content)];
|
|
1430
|
-
// Only add hydration script for sync pages (non-async)
|
|
1431
|
-
// When server actions are enabled, set __viteRscCallServer first so form submission works.
|
|
1432
|
-
if (actionsEnabled) {
|
|
1433
|
-
bodyElements.push(h("script", {
|
|
1434
|
-
key: "rsc-call-server",
|
|
1435
|
-
dangerouslySetInnerHTML: {
|
|
1436
|
-
__html: `(function(){if(typeof globalThis.__viteRscCallServer!=='function'){globalThis.__viteRscCallServer=function(){return Promise.reject(new Error('Farm.js: server actions not ready'));}}})();`,
|
|
1437
|
-
},
|
|
1438
|
-
}));
|
|
1439
|
-
}
|
|
1440
|
-
// Set React refresh preamble synchronously first so "use client" components don't throw when they load.
|
|
1441
|
-
if (!isAsyncPage && !isAsyncLayout) {
|
|
1442
|
-
bodyElements.push(h("script", {
|
|
1443
|
-
key: "preamble-sync",
|
|
1444
|
-
dangerouslySetInnerHTML: {
|
|
1445
|
-
__html: `window.__vite_plugin_react_preamble_installed__=true;window.$RefreshReg$=function(){};window.$RefreshSig$=function(){return function(t){return t;}};`,
|
|
1446
|
-
},
|
|
1447
|
-
}), h("script", {
|
|
1448
|
-
key: "page-props",
|
|
1449
|
-
dangerouslySetInnerHTML: {
|
|
1450
|
-
__html: `window.__PAGE_PROPS__ = ${JSON.stringify(pageProps)};`,
|
|
1451
|
-
},
|
|
1452
|
-
}), h("script", {
|
|
1453
|
-
key: "hydrate",
|
|
1454
|
-
type: "module",
|
|
1455
|
-
dangerouslySetInnerHTML: {
|
|
1456
|
-
__html: `import("/@react-refresh").then(m=>{m.default.injectIntoGlobalHook(window);return import("/@vite/client");}).then(()=>import(${JSON.stringify(`/@rsc-hydrate${normalized}`)}));`,
|
|
1457
|
-
},
|
|
1458
|
-
}));
|
|
1459
|
-
}
|
|
1460
|
-
else {
|
|
1461
|
-
// For async pages, we need to hydrate client component islands
|
|
1462
|
-
// Load a minimal script that finds and hydrates "use client" components
|
|
1463
|
-
bodyElements.push(h("script", {
|
|
1464
|
-
key: "client-islands",
|
|
1465
|
-
type: "module",
|
|
1466
|
-
dangerouslySetInnerHTML: {
|
|
1467
|
-
__html: `
|
|
1468
|
-
// Hydrate client component islands
|
|
1469
|
-
import '/@vite/client';
|
|
1470
|
-
|
|
1471
|
-
// Find all client components and hydrate them
|
|
1472
|
-
// The actual hydration is handled by @vitejs/plugin-rsc transforms
|
|
1473
|
-
`,
|
|
1474
|
-
},
|
|
1475
|
-
}));
|
|
1476
|
-
}
|
|
1477
|
-
const fullPage = h("html", { lang: "en" }, h("head", null, ...headElements), h("body", null, ...bodyElements));
|
|
1478
|
-
const html = "<!DOCTYPE html>" + ReactDOMServer.renderToString(fullPage);
|
|
1479
|
-
res.statusCode = 200;
|
|
1480
|
-
res.setHeader("Content-Type", "text/html");
|
|
1481
|
-
res.end(html);
|
|
1482
|
-
const duration = Date.now() - startTime;
|
|
1483
|
-
logResponse("GET", pathname, 200, duration);
|
|
1484
|
-
}
|
|
1485
|
-
catch (error) {
|
|
1268
|
+
// Show the failure. Rendering another page instead (the old legacy
|
|
1269
|
+
// SSR fallback) served the wrong page and hid the error.
|
|
1486
1270
|
const duration = Date.now() - startTime;
|
|
1487
|
-
logResponse(
|
|
1488
|
-
console.error(
|
|
1489
|
-
// Return error page
|
|
1271
|
+
logResponse(method, pathname, 500, duration);
|
|
1272
|
+
console.error(`[Farm.js] RSC render failed for ${method} ${pathname}:`, rscError);
|
|
1490
1273
|
res.statusCode = 500;
|
|
1491
|
-
res.setHeader("Content-Type", "text/html");
|
|
1492
|
-
res.
|
|
1493
|
-
|
|
1494
|
-
<html>
|
|
1495
|
-
<head><title>Error</title></head>
|
|
1496
|
-
<body style="font-family: system-ui; padding: 2rem; background: #1a1a2e; color: #eee;">
|
|
1497
|
-
<h1 style="color: #ff6b6b;">Error</h1>
|
|
1498
|
-
<pre style="background: #16213e; padding: 1rem; border-radius: 8px; overflow: auto;">${error.stack || error.message}</pre>
|
|
1499
|
-
</body>
|
|
1500
|
-
</html>
|
|
1501
|
-
`);
|
|
1274
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
1275
|
+
res.setHeader("Cache-Control", "no-store");
|
|
1276
|
+
res.end(createRscDevErrorDocument(rscError, method, pathname));
|
|
1502
1277
|
}
|
|
1503
1278
|
});
|
|
1504
1279
|
};
|
package/dist/rsc/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FarmMarkdownResolvedConfig } from "@farm.js/core/markdown";
|
|
1
2
|
import type { ResolvedFarmI18nConfig } from "@farm.js/core/i18n";
|
|
2
3
|
import type { FarmServerActionsConfig, ResolvedFarmServerActionsConfig } from "@farm.js/core/server-action-security";
|
|
3
4
|
/**
|
|
@@ -92,6 +93,8 @@ export interface EntryContext {
|
|
|
92
93
|
* Farm's normal config merge order.
|
|
93
94
|
*/
|
|
94
95
|
middlewareConfigPaths?: string[];
|
|
96
|
+
/** Resolved Markdown mirror settings (core's `md`): `.md` pages and `Accept: text/markdown`. */
|
|
97
|
+
markdown?: FarmMarkdownResolvedConfig;
|
|
95
98
|
/** Whether debug mode is enabled */
|
|
96
99
|
debug: boolean;
|
|
97
100
|
/** True only for the Vite serve command, never for a production build. */
|
package/dist/rsc/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/rsc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EACV,uBAAuB,EACvB,+BAA+B,EAChC,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,aAAa,CAAC,EAAE,uBAAuB,CAAC;IAExC,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,OAAO,CAAC,EAAE;QACR,wCAAwC;QACxC,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,wCAAwC;QACxC,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,2CAA2C;QAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IAEf,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IAEf,8BAA8B;I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E,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;SAC5D,CAAC;KACH;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm.js/plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
4
4
|
"description": "Official plugins for Farm.js framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Farm.js Team",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"nitro": "3.0.260903-beta",
|
|
63
63
|
"picocolors": "^1.0.0",
|
|
64
64
|
"rsc-html-stream": "^0.0.4",
|
|
65
|
-
"@farm.js/core": "0.1.
|
|
65
|
+
"@farm.js/core": "0.1.28"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/node": "^22.20.5",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"react-dom": "19.2.8",
|
|
84
84
|
"react-server-dom-webpack": "19.2.8",
|
|
85
85
|
"vite": ">=6.0.0",
|
|
86
|
-
"@farm.js/core": "0.1.
|
|
86
|
+
"@farm.js/core": "0.1.28"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|
|
89
89
|
"@vitejs/plugin-rsc": {
|