Repository navigation
feat: [CP-407] Add support for rendering components based on their $componentKey - #2915
Merged
Merged
Conversation
|
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
marked this pull request as ready for review
June 23, 2025 18:40
victorhmp
requested review from
lariciamota,
ommeirelles and
renatomaurovtex
and removed request for
a team
June 23, 2025 18:40
lariciamota
reviewed
Jul 29, 2025
victorhmp
force-pushed
the
feat/componentKey-support-2
branch
from
July 30, 2025 15:19
5244969 to
8ec102c
Compare
lariciamota
approved these changes
Jul 30, 2025
lariciamota
left a comment
Contributor
There was a problem hiding this comment.
Great! I've tested the hCMS using the core locally and also using the playground store (has customizations) - everything look fine!
lucasfp13
approved these changes
Aug 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
$componentKeyproperty in a section's data. Also, for each component that renders a section, the$componentKeyproperty 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/corelocally also should look normal.You can also test this by using this branch alongside the new CP client being used in #2807.