reroute-js 0.46.0 → 1.0.0-alpha.1
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 +2 -4
- package/_/store/package.json +1 -3
- package/_/store/src/client/components/Header.tsx +8 -20
- package/_/store/src/client/components/ProductCard.tsx +9 -16
- package/_/store/src/client/index.css +1118 -0
- package/_/store/src/client/routes/[404].tsx +20 -31
- package/_/store/src/client/routes/categories/[category].tsx +23 -28
- package/_/store/src/client/routes/categories/index.tsx +19 -27
- package/_/store/src/client/routes/index.tsx +27 -37
- package/_/store/src/client/routes/products/[id].tsx +35 -48
- package/_/store/src/client/routes/products/index.tsx +20 -50
- package/cli/bin.d.ts +1 -1
- package/cli/bin.js +87 -185
- package/cli/bin.js.map +11 -11
- package/cli/index.d.ts +1 -1
- package/cli/index.js +19 -114
- package/cli/index.js.map +5 -5
- 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/gen.d.ts.map +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 +2 -2
- package/cli/src/commands/lib/index.d.ts.map +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/suspense.d.ts +1 -1
- package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/theme.d.ts +20 -0
- package/cli/src/commands/lib/theme.d.ts.map +1 -0
- 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 +16 -16
- package/core/index.js.map +6 -6
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +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/i18n/catalog.d.ts +1 -1
- package/core/src/i18n/discover.d.ts +1 -1
- package/core/src/i18n/index.d.ts +1 -1
- package/core/src/i18n/messages.d.ts +1 -1
- package/core/src/i18n/negotiate.d.ts +1 -1
- package/core/src/i18n/pathname.d.ts +1 -1
- package/core/src/i18n/resolve.d.ts +1 -1
- package/core/src/i18n/types.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.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/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/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/cleanup.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/index.d.ts +1 -1
- package/core/src/ssr/lib/compute/layouts.d.ts +1 -1
- package/core/src/ssr/lib/compute/routes.d.ts +1 -1
- package/core/src/ssr/lib/content-path.d.ts +1 -1
- package/core/src/ssr/lib/data.d.ts +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/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/route-match.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 +2 -2
- package/core/src/ssr/lib/setup.d.ts.map +1 -1
- package/core/src/ssr/lib/styles.d.ts +3 -3
- package/core/src/ssr/lib/styles.d.ts.map +1 -1
- package/core/src/ssr/lib/template.d.ts +1 -1
- package/core/src/ssr/lib/types.d.ts +1 -1
- package/core/src/ssr/render.d.ts +2 -2
- package/core/src/ssr/render.d.ts.map +1 -1
- package/core/src/ssr/stream.d.ts +2 -2
- package/core/src/ssr/stream.d.ts.map +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +27 -27
- package/elysia/index.js.map +9 -9
- 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/i18n.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/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 -2
- 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 +2 -5
- 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/i18n/LocaleProvider.d.ts +1 -1
- package/react/src/i18n/helpers.d.ts +1 -1
- package/react/src/i18n/index.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 +2 -2
- package/telemetry/server.js.map +4 -4
- 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 +1 -1
- package/telemetry/src/server/headers/index.d.ts +1 -1
- package/telemetry/src/server/headers/presets.d.ts +1 -1
- package/telemetry/src/server/index.d.ts +1 -1
- package/telemetry/src/server/instrumentation.d.ts +1 -1
- package/telemetry/src/server/plugin.d.ts +1 -1
- package/telemetry/src/server/sourcemap.d.ts +1 -1
- package/_/store/src/client/theme.css +0 -306
- package/cli/src/commands/lib/tailwind.d.ts +0 -20
- package/cli/src/commands/lib/tailwind.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/ssr/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAOxD,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAmB5E,KAAK,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,YAAY,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9C,
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/ssr/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAOxD,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAmB5E,KAAK,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,YAAY,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACzB,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,iBAAe,uBAAuB,CACrC,OAAO,EAAE,mBAAmB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAkL7B;AAibD,OAAO,EAAE,uBAAuB,EAAE,CAAC;AACnC,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC"}
|
package/elysia/index.d.ts
CHANGED
package/elysia/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js
|
|
2
|
+
* reroute-js v1.0.0-alpha.1
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -3388,22 +3388,22 @@ var init_scripts = __esm(() => {
|
|
|
3388
3388
|
});
|
|
3389
3389
|
|
|
3390
3390
|
// packages/core/src/ssr/lib/styles.ts
|
|
3391
|
-
async function
|
|
3391
|
+
async function inlineThemeCSS(clientDir, minify = false, isWatchMode = false) {
|
|
3392
3392
|
try {
|
|
3393
3393
|
const bundledCss = globalThis.__REROUTE_THEME_CSS__;
|
|
3394
3394
|
if (bundledCss) {
|
|
3395
3395
|
const css2 = minify ? minifyCSS(bundledCss) : bundledCss;
|
|
3396
|
-
return `<style data-reroute="
|
|
3396
|
+
return `<style data-reroute="theme">${css2}</style>`;
|
|
3397
3397
|
}
|
|
3398
3398
|
if (isWatchMode) {
|
|
3399
3399
|
const timestamp = Date.now();
|
|
3400
|
-
return `<link rel="stylesheet" href="/.reroute/
|
|
3400
|
+
return `<link rel="stylesheet" href="/.reroute/index.css?t=${timestamp}" data-reroute="theme">`;
|
|
3401
3401
|
}
|
|
3402
3402
|
const candidates = [
|
|
3403
|
-
join(clientDir, "..", ".reroute", "
|
|
3404
|
-
join(clientDir, "..", "..", ".reroute", "
|
|
3405
|
-
join(clientDir, "..", "..", "..", ".reroute", "
|
|
3406
|
-
join(clientDir, "..", "..", "..", "..", ".reroute", "
|
|
3403
|
+
join(clientDir, "..", ".reroute", "index.css"),
|
|
3404
|
+
join(clientDir, "..", "..", ".reroute", "index.css"),
|
|
3405
|
+
join(clientDir, "..", "..", "..", ".reroute", "index.css"),
|
|
3406
|
+
join(clientDir, "..", "..", "..", "..", ".reroute", "index.css")
|
|
3407
3407
|
];
|
|
3408
3408
|
let cssPath = "";
|
|
3409
3409
|
for (const p of candidates) {
|
|
@@ -3416,7 +3416,7 @@ async function inlineTailwindCSS(clientDir, minify = false, isWatchMode = false)
|
|
|
3416
3416
|
return "";
|
|
3417
3417
|
const { readFileSync } = await import("node:fs");
|
|
3418
3418
|
const css = readFileSync(cssPath, "utf-8");
|
|
3419
|
-
return `<style data-reroute="
|
|
3419
|
+
return `<style data-reroute="theme">${minifyCSS(css)}</style>`;
|
|
3420
3420
|
} catch {
|
|
3421
3421
|
return "";
|
|
3422
3422
|
}
|
|
@@ -3527,15 +3527,15 @@ async function performSSRSetupInternal(options, streaming, timeoutState) {
|
|
|
3527
3527
|
});
|
|
3528
3528
|
assertNotTimedOut();
|
|
3529
3529
|
setGlobalCollections(byCollectionForSSR);
|
|
3530
|
-
const usingCachedCSS = !!options.
|
|
3530
|
+
const usingCachedCSS = !!options.cachedThemeCSS;
|
|
3531
3531
|
const inlineStyleTag = await withSpan("ssr.inline.css", async (span) => {
|
|
3532
|
-
const css = options.
|
|
3532
|
+
const css = options.cachedThemeCSS ? options.cachedThemeCSS : await inlineThemeCSS(clientDir, !streaming, isWatchMode);
|
|
3533
3533
|
span.setAttributes({
|
|
3534
3534
|
"reroute.cached": usingCachedCSS,
|
|
3535
3535
|
"reroute.css.size": css.length
|
|
3536
3536
|
});
|
|
3537
3537
|
if (debug)
|
|
3538
|
-
console.log(`[Setup] ${pathname} -
|
|
3538
|
+
console.log(`[Setup] ${pathname} - inlineThemeCSS (cached: ${usingCachedCSS}): ${(performance.now() - t0).toFixed(2)}ms`);
|
|
3539
3539
|
return css;
|
|
3540
3540
|
});
|
|
3541
3541
|
assertNotTimedOut();
|
|
@@ -3719,7 +3719,7 @@ async function renderSSRDocument(options) {
|
|
|
3719
3719
|
baseUrl: options.baseUrl,
|
|
3720
3720
|
autoCanonical: options.autoCanonical,
|
|
3721
3721
|
cachedCollections: options.cachedCollections,
|
|
3722
|
-
|
|
3722
|
+
cachedThemeCSS: options.cachedThemeCSS,
|
|
3723
3723
|
headers: options.headers,
|
|
3724
3724
|
titleSuffix: options.titleSuffix
|
|
3725
3725
|
}, false);
|
|
@@ -5856,7 +5856,7 @@ async function renderSSRDocumentStream(options) {
|
|
|
5856
5856
|
baseUrl: options.baseUrl,
|
|
5857
5857
|
autoCanonical: options.autoCanonical,
|
|
5858
5858
|
cachedCollections: options.cachedCollections,
|
|
5859
|
-
|
|
5859
|
+
cachedThemeCSS: options.cachedThemeCSS,
|
|
5860
5860
|
debug,
|
|
5861
5861
|
headers: options.headers,
|
|
5862
5862
|
titleSuffix: options.titleSuffix,
|
|
@@ -6232,7 +6232,7 @@ __export(exports_core, {
|
|
|
6232
6232
|
join: () => join,
|
|
6233
6233
|
isThenable: () => isThenable,
|
|
6234
6234
|
isCompressible: () => isCompressible,
|
|
6235
|
-
|
|
6235
|
+
inlineThemeCSS: () => inlineThemeCSS,
|
|
6236
6236
|
importContentModuleForPath: () => importContentModuleForPath,
|
|
6237
6237
|
htmlToMarkdown: () => htmlToMarkdown,
|
|
6238
6238
|
hreflangTags: () => hreflangTags,
|
|
@@ -6678,8 +6678,8 @@ function getAssetCacheControl(filePath, contentType, maxAge, directive, isWatchM
|
|
|
6678
6678
|
// packages/elysia/src/routes/artifacts.ts
|
|
6679
6679
|
function registerArtifactsRoutes(app, cwd, fileCache, options) {
|
|
6680
6680
|
const { bundleMaxAge, directive, isWatchMode = false } = options;
|
|
6681
|
-
app.get("/.reroute/
|
|
6682
|
-
const filePath = join(cwd, ".reroute", "
|
|
6681
|
+
app.get("/.reroute/index.css", async ({ headers: headers2 }) => {
|
|
6682
|
+
const filePath = join(cwd, ".reroute", "index.css");
|
|
6683
6683
|
const acceptEncoding = headers2["accept-encoding"] ?? "";
|
|
6684
6684
|
try {
|
|
6685
6685
|
const cacheControl = isWatchMode ? "no-cache, no-store, must-revalidate" : `${directive}, max-age=${bundleMaxAge}`;
|
|
@@ -8884,7 +8884,7 @@ function registerSSRRoutes(app, options) {
|
|
|
8884
8884
|
isWatchMode,
|
|
8885
8885
|
getBundleUrl,
|
|
8886
8886
|
getCollections,
|
|
8887
|
-
|
|
8887
|
+
getThemeCSS,
|
|
8888
8888
|
getIndexHtml,
|
|
8889
8889
|
debug = false,
|
|
8890
8890
|
head = "",
|
|
@@ -8989,9 +8989,9 @@ function registerSSRRoutes(app, options) {
|
|
|
8989
8989
|
console.log(`[SSR] ${pathname} - bundleUrl: ${(performance.now() - t0).toFixed(2)}ms`);
|
|
8990
8990
|
return url2;
|
|
8991
8991
|
});
|
|
8992
|
-
const { cachedCollections,
|
|
8992
|
+
const { cachedCollections, cachedThemeCSS, cachedIndexHtml } = await withSpan("ssr.load.cache", async (span) => {
|
|
8993
8993
|
const collections2 = await getCollections();
|
|
8994
|
-
const
|
|
8994
|
+
const themeCSS = await getThemeCSS();
|
|
8995
8995
|
const indexHtml = await getIndexHtml();
|
|
8996
8996
|
span.setAttributes({
|
|
8997
8997
|
"reroute.pathname": pathname,
|
|
@@ -9002,7 +9002,7 @@ function registerSSRRoutes(app, options) {
|
|
|
9002
9002
|
console.log(`[SSR] ${pathname} - cached setup: ${(performance.now() - t0).toFixed(2)}ms`);
|
|
9003
9003
|
return {
|
|
9004
9004
|
cachedCollections: collections2,
|
|
9005
|
-
|
|
9005
|
+
cachedThemeCSS: themeCSS,
|
|
9006
9006
|
cachedIndexHtml: indexHtml
|
|
9007
9007
|
};
|
|
9008
9008
|
});
|
|
@@ -9032,7 +9032,7 @@ function registerSSRRoutes(app, options) {
|
|
|
9032
9032
|
isWatchMode,
|
|
9033
9033
|
bundleUrl,
|
|
9034
9034
|
cachedCollections,
|
|
9035
|
-
|
|
9035
|
+
cachedThemeCSS,
|
|
9036
9036
|
cachedIndexHtml,
|
|
9037
9037
|
debug,
|
|
9038
9038
|
head,
|
|
@@ -9598,9 +9598,9 @@ var reroute = () => async (app) => {
|
|
|
9598
9598
|
const initialBundleUrl = await readBundleUrl();
|
|
9599
9599
|
console.log(`[reroute] Using pre-built bundle: ${initialBundleUrl}`);
|
|
9600
9600
|
const getBundleUrl = isWatchMode ? readBundleUrl : async () => initialBundleUrl;
|
|
9601
|
-
const { loadCollections: loadCollections2,
|
|
9601
|
+
const { loadCollections: loadCollections2, inlineThemeCSS: inlineThemeCSS2, loadIndexHtml: loadIndexHtml2 } = await Promise.resolve().then(() => (init_core(), exports_core));
|
|
9602
9602
|
const startupCollections = await loadCollections2(cwd, isWatchMode);
|
|
9603
|
-
const
|
|
9603
|
+
const startupThemeCSS = await inlineThemeCSS2(clientDir, false, isWatchMode);
|
|
9604
9604
|
const startupIndexHtml = await loadIndexHtml2(clientDir);
|
|
9605
9605
|
const collectionsTtlMs = serverMaxAge * 1000;
|
|
9606
9606
|
let collectionsCache = serverCacheEnabled ? { data: startupCollections, exp: Date.now() + collectionsTtlMs } : null;
|
|
@@ -9618,7 +9618,7 @@ var reroute = () => async (app) => {
|
|
|
9618
9618
|
};
|
|
9619
9619
|
return fresh;
|
|
9620
9620
|
};
|
|
9621
|
-
const
|
|
9621
|
+
const getThemeCSS = isWatchMode ? () => inlineThemeCSS2(clientDir, false, isWatchMode) : async () => startupThemeCSS;
|
|
9622
9622
|
const getIndexHtml = isWatchMode ? () => loadIndexHtml2(clientDir) : async () => startupIndexHtml;
|
|
9623
9623
|
if (globalConfig.redirects && globalConfig.redirects.length > 0) {
|
|
9624
9624
|
registerRedirectRoutes(app, globalConfig.redirects);
|
|
@@ -9768,7 +9768,7 @@ var reroute = () => async (app) => {
|
|
|
9768
9768
|
isWatchMode,
|
|
9769
9769
|
getBundleUrl,
|
|
9770
9770
|
getCollections,
|
|
9771
|
-
|
|
9771
|
+
getThemeCSS,
|
|
9772
9772
|
getIndexHtml,
|
|
9773
9773
|
debug,
|
|
9774
9774
|
head: ssrHead,
|
|
@@ -9808,4 +9808,4 @@ export {
|
|
|
9808
9808
|
reroute
|
|
9809
9809
|
};
|
|
9810
9810
|
|
|
9811
|
-
//# debugId=
|
|
9811
|
+
//# debugId=B9AA346B0D48548264756E2164756E21
|