reroute-js 0.38.3 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/_/blog/src/client/routes/blog/[layout].tsx +3 -8
- package/cli/bin.d.ts +1 -1
- package/cli/bin.js +47 -22
- package/cli/bin.js.map +19 -18
- package/cli/index.d.ts +1 -1
- package/cli/index.js +4 -4
- package/cli/index.js.map +1 -1
- package/cli/src/cli.d.ts +1 -1
- package/cli/src/commands/analyze.d.ts +1 -1
- package/cli/src/commands/build.d.ts +1 -1
- package/cli/src/commands/dev.d.ts +1 -1
- package/cli/src/commands/gen.d.ts +1 -1
- package/cli/src/commands/index.d.ts +1 -1
- package/cli/src/commands/init.d.ts +1 -1
- package/cli/src/commands/lib/assets.d.ts +1 -1
- package/cli/src/commands/lib/bundler.d.ts +1 -1
- package/cli/src/commands/lib/command.d.ts +1 -1
- package/cli/src/commands/lib/env.d.ts +1 -1
- package/cli/src/commands/lib/index.d.ts +1 -1
- package/cli/src/commands/lib/log.d.ts +1 -1
- package/cli/src/commands/lib/markdown/availability.d.ts +1 -1
- package/cli/src/commands/lib/markdown/index.d.ts +1 -1
- package/cli/src/commands/lib/markdown/processor.d.ts +1 -1
- package/cli/src/commands/lib/production.d.ts +1 -1
- package/cli/src/commands/lib/server.d.ts +1 -1
- package/cli/src/commands/lib/streaming/analyzer.d.ts +1 -1
- package/cli/src/commands/lib/streaming/analyzer.d.ts.map +1 -1
- package/cli/src/commands/lib/streaming/suspense.d.ts +1 -1
- package/cli/src/commands/lib/tailwind.d.ts +1 -1
- package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/version.d.ts +1 -1
- package/cli/src/commands/og.d.ts +1 -1
- package/cli/src/commands/start.d.ts +1 -1
- package/cli/src/index.d.ts +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +41 -16
- package/core/index.js.map +18 -17
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +17 -8
- package/core/src/config.d.ts.map +1 -1
- package/core/src/content/discovery.d.ts +1 -1
- package/core/src/content/index.d.ts +1 -1
- package/core/src/content/metadata.d.ts +1 -1
- package/core/src/index.d.ts +1 -1
- package/core/src/llms/extractor.d.ts +1 -1
- package/core/src/llms/formatter.d.ts +1 -1
- package/core/src/llms/full-generator.d.ts +1 -1
- package/core/src/llms/index-generator.d.ts +1 -1
- package/core/src/llms/index-generator.d.ts.map +1 -1
- package/core/src/llms/index.d.ts +1 -1
- package/core/src/og/discovery.d.ts +1 -1
- package/core/src/og/index.d.ts +1 -1
- package/core/src/og/meta.d.ts +1 -1
- package/core/src/og/render.d.ts +1 -1
- package/core/src/og/types.d.ts +1 -1
- package/core/src/robots/discovery.d.ts +1 -1
- package/core/src/robots/generator.d.ts +1 -1
- package/core/src/robots/index.d.ts +1 -1
- package/core/src/robots/policies.d.ts +1 -1
- package/core/src/rss/discovery.d.ts +1 -1
- package/core/src/rss/discovery.d.ts.map +1 -1
- package/core/src/rss/generator.d.ts +1 -1
- package/core/src/rss/index.d.ts +1 -1
- package/core/src/sitemap/discovery.d.ts +1 -1
- package/core/src/sitemap/discovery.d.ts.map +1 -1
- package/core/src/sitemap/generator.d.ts +1 -1
- package/core/src/sitemap/index.d.ts +1 -1
- package/core/src/ssr/index.d.ts +1 -1
- package/core/src/ssr/lib/cache.d.ts +1 -1
- package/core/src/ssr/lib/collections.d.ts +1 -1
- package/core/src/ssr/lib/compression.d.ts +1 -1
- package/core/src/ssr/lib/compute/content.d.ts +1 -1
- package/core/src/ssr/lib/compute/content.d.ts.map +1 -1
- package/core/src/ssr/lib/compute/index.d.ts +1 -1
- package/core/src/ssr/lib/compute/layouts.d.ts +1 -1
- package/core/src/ssr/lib/compute/layouts.d.ts.map +1 -1
- package/core/src/ssr/lib/compute/routes.d.ts +1 -1
- package/core/src/ssr/lib/compute/routes.d.ts.map +1 -1
- package/core/src/ssr/lib/data.d.ts +1 -1
- package/core/src/ssr/lib/data.d.ts.map +1 -1
- package/core/src/ssr/lib/html.d.ts +1 -1
- package/core/src/ssr/lib/imports.d.ts +1 -1
- package/core/src/ssr/lib/index.d.ts +1 -1
- package/core/src/ssr/lib/layouts.d.ts +1 -1
- package/core/src/ssr/lib/metadata.d.ts +1 -1
- package/core/src/ssr/lib/metadata.d.ts.map +1 -1
- package/core/src/ssr/lib/mime.d.ts +1 -1
- package/core/src/ssr/lib/modules.d.ts +1 -1
- package/core/src/ssr/lib/path.d.ts +1 -1
- package/core/src/ssr/lib/preload.d.ts +1 -1
- package/core/src/ssr/lib/scripts/collections.d.ts +1 -1
- package/core/src/ssr/lib/scripts/data.d.ts +1 -1
- package/core/src/ssr/lib/scripts/escape.d.ts +1 -1
- package/core/src/ssr/lib/scripts/feeds.d.ts +1 -1
- package/core/src/ssr/lib/scripts/index.d.ts +1 -1
- package/core/src/ssr/lib/seed.d.ts +1 -1
- package/core/src/ssr/lib/serialize.d.ts +1 -1
- package/core/src/ssr/lib/setup.d.ts +3 -1
- package/core/src/ssr/lib/setup.d.ts.map +1 -1
- package/core/src/ssr/lib/styles.d.ts +1 -1
- package/core/src/ssr/lib/template.d.ts +1 -1
- package/core/src/ssr/lib/types.d.ts +126 -2
- package/core/src/ssr/lib/types.d.ts.map +1 -1
- package/core/src/ssr/render.d.ts +3 -1
- package/core/src/ssr/render.d.ts.map +1 -1
- package/core/src/ssr/stream.d.ts +5 -1
- package/core/src/ssr/stream.d.ts.map +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +83 -52
- package/elysia/index.js.map +20 -19
- package/elysia/src/index.d.ts +1 -1
- package/elysia/src/libs/assets.d.ts +1 -1
- package/elysia/src/libs/cache.d.ts +1 -1
- package/elysia/src/libs/caching.d.ts +1 -1
- package/elysia/src/libs/http.d.ts +1 -1
- package/elysia/src/libs/image.d.ts +1 -1
- package/elysia/src/libs/index.d.ts +1 -1
- package/elysia/src/libs/llms.d.ts +1 -1
- package/elysia/src/libs/response.d.ts +1 -1
- package/elysia/src/libs/serving.d.ts +1 -1
- package/elysia/src/plugin.d.ts +1 -1
- package/elysia/src/plugin.d.ts.map +1 -1
- package/elysia/src/routes/artifacts.d.ts +1 -1
- package/elysia/src/routes/content.d.ts +1 -1
- package/elysia/src/routes/image.d.ts +1 -1
- package/elysia/src/routes/index.d.ts +1 -1
- package/elysia/src/routes/internal.d.ts +1 -1
- package/elysia/src/routes/llms.d.ts +1 -1
- package/elysia/src/routes/og.d.ts +1 -1
- package/elysia/src/routes/redirects.d.ts +1 -1
- package/elysia/src/routes/robots.d.ts +1 -1
- package/elysia/src/routes/rss.d.ts +1 -1
- package/elysia/src/routes/search.d.ts +1 -1
- package/elysia/src/routes/sitemap.d.ts +1 -1
- package/elysia/src/routes/ssr.d.ts +2 -1
- package/elysia/src/routes/ssr.d.ts.map +1 -1
- package/elysia/src/routes/static.d.ts +1 -1
- package/elysia/src/types.d.ts +1 -1
- package/package.json +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js +2 -2
- package/react/index.js.map +1 -1
- package/react/src/components/ClientOnly.d.ts +1 -1
- package/react/src/components/ContentRoute.d.ts +1 -1
- package/react/src/components/Image.d.ts +1 -1
- package/react/src/components/LazyRoute.d.ts +1 -1
- package/react/src/components/Link.d.ts +1 -1
- package/react/src/components/Markdown.d.ts +1 -1
- package/react/src/components/Outlet.d.ts +1 -1
- package/react/src/components/index.d.ts +1 -1
- package/react/src/hooks/index.d.ts +1 -1
- package/react/src/hooks/useContent.d.ts +1 -1
- package/react/src/hooks/useData.d.ts +1 -1
- package/react/src/hooks/useFeed.d.ts +1 -1
- package/react/src/hooks/useLayoutData.d.ts +1 -1
- package/react/src/hooks/useLlms.d.ts +1 -1
- package/react/src/hooks/useNavigate.d.ts +1 -1
- package/react/src/hooks/useParams.d.ts +1 -1
- package/react/src/hooks/useRouter.d.ts +1 -1
- package/react/src/hooks/useSearch.d.ts +1 -1
- package/react/src/hooks/useSearchParams.d.ts +1 -1
- package/react/src/hooks/useToc.d.ts +1 -1
- package/react/src/index.d.ts +1 -1
- package/react/src/lib/collection.d.ts +1 -1
- package/react/src/lib/content.d.ts +1 -1
- package/react/src/lib/head.d.ts +1 -1
- package/react/src/lib/index.d.ts +1 -1
- package/react/src/lib/lazy-route.d.ts +1 -1
- package/react/src/lib/route-loader.d.ts +1 -1
- package/react/src/providers/ContentProvider.d.ts +1 -1
- package/react/src/providers/RerouteProvider.d.ts +1 -1
- package/react/src/providers/RouterProvider.d.ts +1 -1
- package/react/src/providers/index.d.ts +1 -1
- package/react/src/types/any.d.ts +1 -1
- package/react/src/types/index.d.ts +1 -1
- package/react/src/types/router.d.ts +1 -1
- package/telemetry/react.d.ts +1 -1
- package/telemetry/react.js +2 -2
- package/telemetry/react.js.map +1 -1
- package/telemetry/server.d.ts +1 -1
- package/telemetry/server.js +87 -25
- package/telemetry/server.js.map +18 -15
- package/telemetry/src/react/api.d.ts +1 -1
- package/telemetry/src/react/context.d.ts +1 -1
- package/telemetry/src/react/index.d.ts +1 -1
- package/telemetry/src/react/telemetry.d.ts +1 -1
- package/telemetry/src/server/context.d.ts +1 -1
- package/telemetry/src/server/headers/extractor.d.ts +32 -0
- package/telemetry/src/server/headers/extractor.d.ts.map +1 -0
- package/telemetry/src/server/headers/index.d.ts +12 -0
- package/telemetry/src/server/headers/index.d.ts.map +1 -0
- package/telemetry/src/server/headers/presets.d.ts +134 -0
- package/telemetry/src/server/headers/presets.d.ts.map +1 -0
- package/telemetry/src/server/index.d.ts +2 -1
- package/telemetry/src/server/index.d.ts.map +1 -1
- package/telemetry/src/server/instrumentation.d.ts +1 -1
- package/telemetry/src/server/plugin.d.ts +1 -1
- package/telemetry/src/server/plugin.d.ts.map +1 -1
- package/telemetry/src/server/sourcemap.d.ts +1 -1
package/README.md
CHANGED
|
@@ -1548,7 +1548,11 @@ export default defineConfig({
|
|
|
1548
1548
|
/\.(js|css|png|jpg|svg|ico)$/,
|
|
1549
1549
|
],
|
|
1550
1550
|
sampleRate: 1.0,
|
|
1551
|
-
|
|
1551
|
+
capture: [
|
|
1552
|
+
...RerouteHeaders.http(),
|
|
1553
|
+
...RerouteHeaders.request(),
|
|
1554
|
+
...CloudflareHeaders.geo(),
|
|
1555
|
+
],
|
|
1552
1556
|
|
|
1553
1557
|
// Browser telemetry proxy (avoids CORS and ad blockers)
|
|
1554
1558
|
proxy: {
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { Link, Outlet, useData } from 'reroute-js/react';
|
|
2
|
-
|
|
3
|
-
// SSR context type
|
|
4
|
-
type SSRContext = {
|
|
5
|
-
pathname: string;
|
|
6
|
-
params?: Record<string, string>;
|
|
7
|
-
};
|
|
2
|
+
import type { SSR } from 'reroute-js/core';
|
|
8
3
|
|
|
9
4
|
// Layout data type
|
|
10
5
|
type LayoutData = {
|
|
@@ -16,8 +11,8 @@ type LayoutData = {
|
|
|
16
11
|
};
|
|
17
12
|
|
|
18
13
|
// Layout SSR data - runs on every blog page!
|
|
19
|
-
export const ssr = {
|
|
20
|
-
async data({ pathname }
|
|
14
|
+
export const ssr: SSR<LayoutData> = {
|
|
15
|
+
async data({ pathname }) {
|
|
21
16
|
// Get last updated timestamp from package.json mtime
|
|
22
17
|
let lastUpdated: string | undefined;
|
|
23
18
|
try {
|
package/cli/bin.d.ts
CHANGED
package/cli/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
3
|
/**
|
|
4
|
-
* reroute-js v0.
|
|
4
|
+
* reroute-js v0.40.0
|
|
5
5
|
*
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2025 stewones <hi@stewan.io>
|
|
@@ -48,7 +48,7 @@ async function getVersionString() {
|
|
|
48
48
|
}
|
|
49
49
|
async function getVersion() {
|
|
50
50
|
if (true) {
|
|
51
|
-
return "0.
|
|
51
|
+
return "0.40.0";
|
|
52
52
|
}
|
|
53
53
|
const possiblePaths = [
|
|
54
54
|
path.join(import.meta.dir, "../../../../package.json"),
|
|
@@ -66,7 +66,7 @@ async function getVersion() {
|
|
|
66
66
|
}
|
|
67
67
|
async function getCommit() {
|
|
68
68
|
if (true) {
|
|
69
|
-
return "
|
|
69
|
+
return "f262c0b";
|
|
70
70
|
}
|
|
71
71
|
return "dev";
|
|
72
72
|
}
|
|
@@ -506,6 +506,13 @@ var contextStorage;
|
|
|
506
506
|
var init_context = __esm(() => {
|
|
507
507
|
contextStorage = new AsyncLocalStorage;
|
|
508
508
|
});
|
|
509
|
+
// packages/telemetry/src/server/headers/presets.ts
|
|
510
|
+
var init_presets = () => {};
|
|
511
|
+
|
|
512
|
+
// packages/telemetry/src/server/headers/index.ts
|
|
513
|
+
var init_headers = __esm(() => {
|
|
514
|
+
init_presets();
|
|
515
|
+
});
|
|
509
516
|
|
|
510
517
|
// packages/telemetry/src/server/instrumentation.ts
|
|
511
518
|
import { context, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -674,6 +681,7 @@ var init_plugin = __esm(() => {
|
|
|
674
681
|
// packages/telemetry/src/server/index.ts
|
|
675
682
|
var init_server = __esm(() => {
|
|
676
683
|
init_context();
|
|
684
|
+
init_headers();
|
|
677
685
|
init_instrumentation();
|
|
678
686
|
init_plugin();
|
|
679
687
|
init_sourcemap();
|
|
@@ -906,12 +914,13 @@ function checkDataCache(cacheKey, maxAgeMs) {
|
|
|
906
914
|
return;
|
|
907
915
|
return ssrCache.get(cacheKey);
|
|
908
916
|
}
|
|
909
|
-
function createDataTask(dataFn, pathname, parts, searchParams, set) {
|
|
917
|
+
function createDataTask(dataFn, pathname, parts, searchParams, set, headers2) {
|
|
910
918
|
return toPromise(dataFn({
|
|
911
919
|
pathname,
|
|
912
920
|
params: { name: parts[1] },
|
|
913
921
|
set,
|
|
914
|
-
searchParams
|
|
922
|
+
searchParams,
|
|
923
|
+
headers: headers2
|
|
915
924
|
})).catch((err) => {
|
|
916
925
|
const msg = err instanceof Error ? err.message : String(err);
|
|
917
926
|
const error = `SSR data() failed: ${msg}`;
|
|
@@ -978,7 +987,7 @@ async function computeContentData(pathname, options, searchParams, sharedSsrData
|
|
|
978
987
|
return { data: ssrData, statusOverride, pendingTasks };
|
|
979
988
|
}
|
|
980
989
|
const set = { status: 200 };
|
|
981
|
-
const task = createDataTask(dataFn, pathname, parts, searchParams, set);
|
|
990
|
+
const task = createDataTask(dataFn, pathname, parts, searchParams, set, options.headers);
|
|
982
991
|
if (streaming) {
|
|
983
992
|
handleStreamingMode(ssrData, pathname, task, set, cacheKey, statusCacheKey, maxAgeMs, pendingTasks);
|
|
984
993
|
if (set.status !== 200) {
|
|
@@ -1038,9 +1047,15 @@ function checkLayoutCache(cacheKey, statusCacheKey, maxAgeMs) {
|
|
|
1038
1047
|
const cachedData = maxAgeMs > 0 ? ssrCache.get(cacheKey) : undefined;
|
|
1039
1048
|
return { cachedData, cachedStatus };
|
|
1040
1049
|
}
|
|
1041
|
-
function createLayoutDataTask(dataFn, pathname, searchParams, layoutPattern) {
|
|
1050
|
+
function createLayoutDataTask(dataFn, pathname, searchParams, layoutPattern, headers2) {
|
|
1042
1051
|
const set = { status: 200 };
|
|
1043
|
-
return toPromise(dataFn({
|
|
1052
|
+
return toPromise(dataFn({
|
|
1053
|
+
pathname,
|
|
1054
|
+
params: {},
|
|
1055
|
+
set,
|
|
1056
|
+
searchParams,
|
|
1057
|
+
headers: headers2
|
|
1058
|
+
})).catch((err) => {
|
|
1044
1059
|
const msg = err instanceof Error ? err.message : String(err);
|
|
1045
1060
|
console.error(`[reroute] Layout SSR data() failed for ${layoutPattern}:`, msg);
|
|
1046
1061
|
throw err;
|
|
@@ -1048,6 +1063,9 @@ function createLayoutDataTask(dataFn, pathname, searchParams, layoutPattern) {
|
|
|
1048
1063
|
}
|
|
1049
1064
|
function handleLayoutStreamingMode(ssrData, layoutKey, task, set, cacheKey, statusCacheKey, maxAgeMs, pendingTasks) {
|
|
1050
1065
|
ssrData[layoutKey] = task;
|
|
1066
|
+
const g = globalThis;
|
|
1067
|
+
g.__REROUTE_DATA__ = g.__REROUTE_DATA__ || {};
|
|
1068
|
+
g.__REROUTE_DATA__[layoutKey] = task;
|
|
1051
1069
|
const storeTask = task.then((value) => {
|
|
1052
1070
|
if (maxAgeMs > 0) {
|
|
1053
1071
|
statusCache.set(statusCacheKey, set.status, maxAgeMs);
|
|
@@ -1059,6 +1077,9 @@ function handleLayoutStreamingMode(ssrData, layoutKey, task, set, cacheKey, stat
|
|
|
1059
1077
|
});
|
|
1060
1078
|
pendingTasks.push(storeTask.then((value) => {
|
|
1061
1079
|
ssrData[layoutKey] = value;
|
|
1080
|
+
if (g.__REROUTE_DATA__) {
|
|
1081
|
+
g.__REROUTE_DATA__[layoutKey] = value;
|
|
1082
|
+
}
|
|
1062
1083
|
}).catch(() => {}));
|
|
1063
1084
|
}
|
|
1064
1085
|
async function handleLayoutNonStreamingMode(ssrData, layoutKey, task, cacheKey, statusCacheKey, maxAgeMs) {
|
|
@@ -1072,7 +1093,7 @@ async function handleLayoutNonStreamingMode(ssrData, layoutKey, task, cacheKey,
|
|
|
1072
1093
|
}
|
|
1073
1094
|
return result;
|
|
1074
1095
|
}
|
|
1075
|
-
async function processLayout(layout, pathname, clientDir, isWatchMode, streaming, maxAgeMs, searchParams, ssrData, pendingTasks) {
|
|
1096
|
+
async function processLayout(layout, pathname, clientDir, isWatchMode, streaming, maxAgeMs, searchParams, ssrData, pendingTasks, headers2) {
|
|
1076
1097
|
if (typeof layout?.path !== "string")
|
|
1077
1098
|
return;
|
|
1078
1099
|
const ssrExport = await loadLayoutSSRExport(layout, clientDir, isWatchMode);
|
|
@@ -1092,7 +1113,7 @@ async function processLayout(layout, pathname, clientDir, isWatchMode, streaming
|
|
|
1092
1113
|
return;
|
|
1093
1114
|
}
|
|
1094
1115
|
const set = { status: 200 };
|
|
1095
|
-
const task = createLayoutDataTask(dataFn, pathname, searchParams, pattern);
|
|
1116
|
+
const task = createLayoutDataTask(dataFn, pathname, searchParams, pattern, headers2);
|
|
1096
1117
|
if (streaming) {
|
|
1097
1118
|
handleLayoutStreamingMode(ssrData, layoutKey, task, set, cacheKey, statusCacheKey, maxAgeMs, pendingTasks);
|
|
1098
1119
|
} else {
|
|
@@ -1112,7 +1133,7 @@ async function computeLayoutData(pathname, clientDir, _cwd, isWatchMode, options
|
|
|
1112
1133
|
const matchingLayouts = getMatchingLayouts(pathname, layouts);
|
|
1113
1134
|
for (const layout of matchingLayouts) {
|
|
1114
1135
|
try {
|
|
1115
|
-
const layoutStatus = await processLayout(layout, pathname, clientDir, isWatchMode, streaming, maxAgeMs, searchParams, ssrData, pendingTasks);
|
|
1136
|
+
const layoutStatus = await processLayout(layout, pathname, clientDir, isWatchMode, streaming, maxAgeMs, searchParams, ssrData, pendingTasks, options.headers);
|
|
1116
1137
|
if (layoutStatus && !statusOverride) {
|
|
1117
1138
|
statusOverride = layoutStatus;
|
|
1118
1139
|
}
|
|
@@ -1212,7 +1233,8 @@ async function computeRouteData(pathname, clientDir, _cwd, isWatchMode, options,
|
|
|
1212
1233
|
pathname,
|
|
1213
1234
|
params,
|
|
1214
1235
|
set,
|
|
1215
|
-
searchParams
|
|
1236
|
+
searchParams,
|
|
1237
|
+
headers: options.headers
|
|
1216
1238
|
});
|
|
1217
1239
|
const isPromise = rawResult instanceof Promise;
|
|
1218
1240
|
if (streaming) {
|
|
@@ -2803,7 +2825,7 @@ async function performSSRSetupInternal(options, streaming) {
|
|
|
2803
2825
|
const computeResult = await withSpan("ssr.compute.data", async (span) => {
|
|
2804
2826
|
span.setAttribute("pathname", pathname);
|
|
2805
2827
|
span.setAttribute("streaming", streaming);
|
|
2806
|
-
const result = await computeSSRData(pathname, clientDir, cwd, isWatchMode, { streaming, maxAge }, searchParams);
|
|
2828
|
+
const result = await computeSSRData(pathname, clientDir, cwd, isWatchMode, { streaming, maxAge, headers: options.headers }, searchParams);
|
|
2807
2829
|
span.setAttribute("has_error", !!result.error);
|
|
2808
2830
|
span.setAttribute("has_data", Object.keys(result.data).length > 0);
|
|
2809
2831
|
if (debug)
|
|
@@ -3011,7 +3033,8 @@ async function renderSSRDocument(options) {
|
|
|
3011
3033
|
baseUrl: options.baseUrl,
|
|
3012
3034
|
autoCanonical: options.autoCanonical,
|
|
3013
3035
|
cachedCollections: options.cachedCollections,
|
|
3014
|
-
cachedTailwindCSS: options.cachedTailwindCSS
|
|
3036
|
+
cachedTailwindCSS: options.cachedTailwindCSS,
|
|
3037
|
+
headers: options.headers
|
|
3015
3038
|
}, false);
|
|
3016
3039
|
const duplicatedData = duplicateQueryParamData(setup2.ssrData);
|
|
3017
3040
|
setGlobalSSRData(duplicatedData);
|
|
@@ -5121,7 +5144,8 @@ async function renderSSRDocumentStream(options) {
|
|
|
5121
5144
|
autoCanonical: options.autoCanonical,
|
|
5122
5145
|
cachedCollections: options.cachedCollections,
|
|
5123
5146
|
cachedTailwindCSS: options.cachedTailwindCSS,
|
|
5124
|
-
debug
|
|
5147
|
+
debug,
|
|
5148
|
+
headers: options.headers
|
|
5125
5149
|
}, true);
|
|
5126
5150
|
if (debug)
|
|
5127
5151
|
console.log(`[renderStream] ${pathname} - performSSRSetup: ${(performance.now() - t0).toFixed(2)}ms`);
|
|
@@ -5184,7 +5208,8 @@ async function renderSSRDocumentStream(options) {
|
|
|
5184
5208
|
preloadHydrationScript: setup2.preloadHydrationScript,
|
|
5185
5209
|
browserTelemetryConfig,
|
|
5186
5210
|
traceContext,
|
|
5187
|
-
parentSpan: options.parentSpan
|
|
5211
|
+
parentSpan: options.parentSpan,
|
|
5212
|
+
timeout: options.timeout
|
|
5188
5213
|
});
|
|
5189
5214
|
if (debug)
|
|
5190
5215
|
console.log(`[renderStream] ${pathname} - returning stream: ${(performance.now() - t0).toFixed(2)}ms`);
|
|
@@ -5193,7 +5218,7 @@ async function renderSSRDocumentStream(options) {
|
|
|
5193
5218
|
async function streamSSRContent(writer, encoder, ctx) {
|
|
5194
5219
|
return withParentSpan(ctx.parentSpan, async () => {
|
|
5195
5220
|
const t0 = ctx.debug ? performance.now() : 0;
|
|
5196
|
-
const STREAM_TIMEOUT_MS =
|
|
5221
|
+
const STREAM_TIMEOUT_MS = ctx.timeout ?? 120000;
|
|
5197
5222
|
let streamTimedOut = false;
|
|
5198
5223
|
let timeoutId = null;
|
|
5199
5224
|
const cleanup = () => {
|
|
@@ -6065,8 +6090,8 @@ function normalizeRelativePath(path3) {
|
|
|
6065
6090
|
}
|
|
6066
6091
|
var SSR_DATA_INLINE_EXPORT_REGEX, SSR_DATA_DECLARATION_REGEX, SSR_REEXPORT_REGEX;
|
|
6067
6092
|
var init_analyzer = __esm(() => {
|
|
6068
|
-
SSR_DATA_INLINE_EXPORT_REGEX = /export\s+const\s+ssr\s
|
|
6069
|
-
SSR_DATA_DECLARATION_REGEX = /const\s+ssr\s
|
|
6093
|
+
SSR_DATA_INLINE_EXPORT_REGEX = /export\s+const\s+ssr\s*(?::[\s\S]*?)?=\s*[\s\S]*?data\s*[:(]/i;
|
|
6094
|
+
SSR_DATA_DECLARATION_REGEX = /const\s+ssr\s*(?::[\s\S]*?)?=\s*[\s\S]*?data\s*[:(]/i;
|
|
6070
6095
|
SSR_REEXPORT_REGEX = /export\s*\{[^}]*\bssr\b/i;
|
|
6071
6096
|
});
|
|
6072
6097
|
|
|
@@ -105666,7 +105691,7 @@ async function getVersionString2() {
|
|
|
105666
105691
|
}
|
|
105667
105692
|
async function getVersion2() {
|
|
105668
105693
|
if (true) {
|
|
105669
|
-
return "0.
|
|
105694
|
+
return "0.40.0";
|
|
105670
105695
|
}
|
|
105671
105696
|
const possiblePaths = [
|
|
105672
105697
|
path3.join(import.meta.dir, "../../../package.json"),
|
|
@@ -105683,10 +105708,10 @@ async function getVersion2() {
|
|
|
105683
105708
|
}
|
|
105684
105709
|
async function getCommit2() {
|
|
105685
105710
|
if (true) {
|
|
105686
|
-
return "
|
|
105711
|
+
return "f262c0b";
|
|
105687
105712
|
}
|
|
105688
105713
|
return "dev";
|
|
105689
105714
|
}
|
|
105690
105715
|
main();
|
|
105691
105716
|
|
|
105692
|
-
//# debugId=
|
|
105717
|
+
//# debugId=5998D9F96883D01A64756E2164756E21
|