Skip to content

fix(vtex/plp): type productListingPage return as ProductListingPage#81

Open
guitavano wants to merge 1 commit into
mainfrom
fix/plp-loader-return-type
Open

fix(vtex/plp): type productListingPage return as ProductListingPage#81
guitavano wants to merge 1 commit into
mainfrom
fix/plp-loader-return-type

Conversation

@guitavano

@guitavano guitavano commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Change productListingPage return type from Promise<any | null> to Promise<ProductListingPage | null>
  • Add missing canonical field to pageTypesToSeo to satisfy the Seo interface
  • Enables the schema generator to resolve the PLP loader's output type, so section block-ref props (e.g. SearchResult.page) include it in their anyOf picker

Test plan

  • Ran generate-schema.ts locally — productListingPage now resolves as → ProductListingPage
  • SearchResult.page anyOf includes vtex/loaders/intelligentSearch/productListingPage.ts
  • TypeScript compiles without errors

🤖 Generated with Claude Code


Summary by cubic

Typed the VTEX PLP loader to return ProductListingPage | null and filled the missing SEO canonical. This lets the schema generator resolve the PLP output and surface it in pickers like SearchResult.page.

  • Bug Fixes
    • Changed productListingPage from Promise<any | null> to Promise<ProductListingPage | null>.
    • Typed pageTypesToSeo and added canonical to satisfy the Seo interface.

Written for commit 56e776e. Summary will update on new commits.

Review in cubic

The PLP inline loader returned `Promise<any | null>`, preventing the
schema generator from resolving its output type. Change to
`Promise<ProductListingPage | null>` and add the missing `canonical`
field to `pageTypesToSeo` so the return value satisfies the interface.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@guitavano guitavano requested a review from a team June 23, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant