blocks: bot-aware SEO should cover seo=true SECTIONS, not just page.seo
Repo: decocms/blocks (@decocms/blocks)
Problem
setAsyncRenderingConfig({ botAwareSeo: true }) strips commerce-loader props for
human requests ONLY in resolvePageSeoBlock (the page.seo field). Sites
migrated from deco-cx (Fresh) emit JSON-LD via sections marked
export const seo = true (e.g. PageSEO.tsx, CustomSEOPLP.tsx), placed in the
sections array — NOT via page.seo. For those sites botAwareSeo does nothing,
so every human still gets the full schema.org JSON-LD serialized into the
hydration payload.
Reference: src/cms/resolve.ts — resolvePageSeoBlock / stripCommerceLoaderProps
apply only to page.seo (line ~1213); isSeoSection / registerSeoSections
handle section-level SEO but without any bot-aware strip.
Impact
On miess-01-tanstack the seo=true SEO section serialized the full
ProductListingPage/Product JSON-LD (~900 KB–1.2 MB) for every human. Worked
around at site level by gating the JSON-LD build on isEagerRequest(...) inside
each SEO section's loader.
Proposed fix
Either (a) extend the bot-aware strip to seo=true sections whose props resolve
to a commerce loader, honoring the same botAwareSeo flag; or (b) document
isEagerRequest as the supported pattern for section-level SEO gating (it is
already exported from @decocms/blocks/cms).
Opt-in requirement
Same as page.seo bot-aware: default off, opt-in per site, so no site regresses to
a generic <title> / missing structured data on a framework bump.
blocks: bot-aware SEO should cover
seo=trueSECTIONS, not justpage.seoRepo: decocms/blocks (
@decocms/blocks)Problem
setAsyncRenderingConfig({ botAwareSeo: true })strips commerce-loader props forhuman requests ONLY in
resolvePageSeoBlock(thepage.seofield). Sitesmigrated from deco-cx (Fresh) emit JSON-LD via sections marked
export const seo = true(e.g.PageSEO.tsx,CustomSEOPLP.tsx), placed in thesections array — NOT via
page.seo. For those sitesbotAwareSeodoes nothing,so every human still gets the full schema.org JSON-LD serialized into the
hydration payload.
Reference:
src/cms/resolve.ts—resolvePageSeoBlock/stripCommerceLoaderPropsapply only to
page.seo(line ~1213);isSeoSection/registerSeoSectionshandle section-level SEO but without any bot-aware strip.
Impact
On miess-01-tanstack the
seo=trueSEO section serialized the fullProductListingPage/Product JSON-LD (~900 KB–1.2 MB) for every human. Worked
around at site level by gating the JSON-LD build on
isEagerRequest(...)insideeach SEO section's loader.
Proposed fix
Either (a) extend the bot-aware strip to
seo=truesections whose props resolveto a commerce loader, honoring the same
botAwareSeoflag; or (b) documentisEagerRequestas the supported pattern for section-level SEO gating (it isalready exported from
@decocms/blocks/cms).Opt-in requirement
Same as page.seo bot-aware: default off, opt-in per site, so no site regresses to
a generic
<title>/ missing structured data on a framework bump.