@decocms/tanstack 7.26.3 → 7.28.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/package.json +4 -4
- package/src/routes/cmsRoute.ts +19 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/tanstack",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.28.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Deco framework binding for TanStack Start + Cloudflare Workers",
|
|
6
6
|
"repository": {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"lint:unused": "knip"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@decocms/blocks": "7.
|
|
28
|
-
"@decocms/blocks-admin": "7.
|
|
29
|
-
"@decocms/blocks-cli": "7.
|
|
27
|
+
"@decocms/blocks": "7.28.0",
|
|
28
|
+
"@decocms/blocks-admin": "7.28.0",
|
|
29
|
+
"@decocms/blocks-cli": "7.28.0",
|
|
30
30
|
"@deco-cx/warp-node": "^0.3.16",
|
|
31
31
|
"fast-json-patch": "^3.1.0",
|
|
32
32
|
"ws": "^8.18.0"
|
package/src/routes/cmsRoute.ts
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
getDeferredRawProps,
|
|
34
34
|
getDegradedSections,
|
|
35
35
|
getSiteSeo,
|
|
36
|
+
isEagerRequest,
|
|
36
37
|
preloadSectionComponents,
|
|
37
38
|
reExtractRawProps,
|
|
38
39
|
resolveDecoPage,
|
|
@@ -222,7 +223,12 @@ async function loadCmsPageInternal(fullPath: string, resolveGlobals: boolean) {
|
|
|
222
223
|
const device = detectDevice(ua);
|
|
223
224
|
|
|
224
225
|
// Build SEO: merge page-level seo block (primary) with section-contributed SEO (secondary)
|
|
225
|
-
const seo = buildPageSeo(
|
|
226
|
+
const seo = buildPageSeo(
|
|
227
|
+
page.seoSection,
|
|
228
|
+
enrichedSeoSection,
|
|
229
|
+
mergedSections,
|
|
230
|
+
isEagerRequest(matcherCtx),
|
|
231
|
+
);
|
|
226
232
|
|
|
227
233
|
// Destructure seoSection out — it's an internal artifact, not serialized to client
|
|
228
234
|
const { seoSection: _seo, ...pageData } = page;
|
|
@@ -338,7 +344,12 @@ export const loadCmsHomePage = createServerFn({ method: "GET" })
|
|
|
338
344
|
await preloadSectionComponents(eagerKeys);
|
|
339
345
|
|
|
340
346
|
const device = detectDevice(ua);
|
|
341
|
-
const seo = buildPageSeo(
|
|
347
|
+
const seo = buildPageSeo(
|
|
348
|
+
page.seoSection,
|
|
349
|
+
enrichedSeoSection,
|
|
350
|
+
mergedSections,
|
|
351
|
+
isEagerRequest(matcherCtx),
|
|
352
|
+
);
|
|
342
353
|
|
|
343
354
|
const { seoSection: _seo, ...pageData } = page;
|
|
344
355
|
|
|
@@ -610,9 +621,12 @@ function buildPageSeo(
|
|
|
610
621
|
seoSection: ResolvedSection | null | undefined,
|
|
611
622
|
enrichedSeoSection: ResolvedSection | null | undefined,
|
|
612
623
|
enrichedSections: ResolvedSection[],
|
|
624
|
+
isEager: boolean,
|
|
613
625
|
): PageSeo {
|
|
614
|
-
// Secondary source: SEO sections embedded in the sections array
|
|
615
|
-
|
|
626
|
+
// Secondary source: SEO sections embedded in the sections array.
|
|
627
|
+
// `isEager` keeps structured-data suppression bot-aware: humans skip the
|
|
628
|
+
// JSON-LD when `ignoreStructuredData` is on; crawlers still get it.
|
|
629
|
+
const sectionSeo = extractSeoFromSections(enrichedSections, { isEager });
|
|
616
630
|
|
|
617
631
|
// Site-wide SEO config from the "Site" app block — mirrors ctx.seo in
|
|
618
632
|
// the original deco-cx/deco framework. Provides fallback title,
|
|
@@ -647,7 +661,7 @@ function buildPageSeo(
|
|
|
647
661
|
// somehow dropped it — same "use the raw resolved props" resilience the
|
|
648
662
|
// old inline try/catch had around the loader call.
|
|
649
663
|
const enrichedProps = (enrichedSeoSection ?? seoSection).props;
|
|
650
|
-
const pageSeo = extractSeoFromProps(enrichedProps);
|
|
664
|
+
const pageSeo = extractSeoFromProps(enrichedProps, { isEager });
|
|
651
665
|
|
|
652
666
|
// Replicate original SeoV2 loader logic: `_title ?? appTitle`
|
|
653
667
|
// When the page's seo block doesn't have a title/description,
|