Skip to content

Conversation

@exacs
Copy link
Contributor

@exacs exacs commented Nov 4, 2025

This PR allows developers to define a component to a ContentType:tag combination without requiring to have the mapping ContentType (without tag)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables support for component registrations that define only tagged variants without a default component. This allows more flexible component organization where a content type may only need tag-specific components.

Key changes:

  • Made the default property optional in ComponentWithVariants type
  • Updated type guard and helper functions to support optional default components
  • Reorganized component lookup logic to handle missing base entries when tags are specified

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/optimizely-cms-sdk/src/render/componentRegistry.ts Made default component optional in variant definitions and updated lookup logic to support tag-only component registrations
test/test-website/src/components/with-display-templates.tsx Added test components ct6/ct7 and Component6/Component7 to demonstrate tag-only component registration
test/test-website/src/app/en/layout.tsx Registered test components with tag-only configurations for ct6 and ct7

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@exacs exacs merged commit 0749fcc into main Nov 5, 2025
4 checks passed
@exacs exacs deleted the bugfix/CMS-46517-loose-tuples branch November 5, 2025 12:14
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.

3 participants