Skip to content

feat: [CP-407] Add support for rendering components based on their $componentKey - #2915

Merged
lariciamota merged 7 commits into
mainfrom
feat/componentKey-support-2
Aug 1, 2025
Merged

lariciamota merged 7 commits into
mainfrom
feat/componentKey-support-2

Conversation

@victorhmp

@victorhmp victorhmp commented Jun 23, 2025 •

Copy link
Copy Markdown
Member

What's the purpose of this pull request?

This PR makes it so FastStore Core is capable of rendering components based on data from the CMS, using $componentKeys to identity each component. It also adds the $componentKeys to each component, based on their new schemas (for Content Platform) added in this PR.

How it works?

The implementation here is backwards compatible, so during the existing rendering flow a new check was added to look for the $componentKey property in a section's data. Also, for each component that renders a section, the $componentKey property was added, then, when indexing all available components, the new property will now be used if its present. To keep backwards compatibility, the $componentKeys are matching the names of the components.

How to test it?

Since this change should be totally backwards compatible, if you're testing this branch with any current store, fetching data from hCMS, you should see no change in behaviour and everything should still render normally. Running @faststore/core locally also should look normal.

You can also test this by using this branch alongside the new CP client being used in #2807.

@victorhmp victorhmp self-assigned this Jun 23, 2025
@codesandbox-ci

codesandbox-ci Bot commented Jun 23, 2025 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@victorhmp victorhmp changed the title Feat/component key support 2 feat: [CP-407] Add support for rendering components based on their $componentKey Jun 23, 2025
@victorhmp victorhmp added the enhancement New feature or request label Jun 23, 2025
@victorhmp
victorhmp marked this pull request as ready for review June 23, 2025 18:40
@victorhmp
victorhmp requested a review from a team as a code owner June 23, 2025 18:40
@victorhmp
victorhmp requested review from lariciamota, ommeirelles and renatomaurovtex and removed request for a team June 23, 2025 18:40
@victorhmp
victorhmp requested review from lariciamota and removed request for lariciamota July 30, 2025 13:52
@victorhmp
victorhmp force-pushed the feat/componentKey-support-2 branch from 5244969 to 8ec102c Compare July 30, 2025 15:19
@victorhmp
victorhmp requested a review from lariciamota July 30, 2025 17:07

@lariciamota lariciamota left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great! I've tested the hCMS using the core locally and also using the playground store (has customizations) - everything look fine!

@lariciamota
lariciamota merged commit 7e679c4 into main Aug 1, 2025
@lariciamota
lariciamota deleted the feat/componentKey-support-2 branch August 1, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants