Skip to content

fix: allow_all_components for CMS - #3312

Merged
hellofanny merged 2 commits into
devfrom
fix/allow-all-cms-components
May 12, 2026
Merged

hellofanny merged 2 commits into
devfrom
fix/allow-all-cms-components

Conversation

@mateuspontes

@mateuspontes mateuspontes commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

Fix a bug where CMS content-types (Home, PDP, PLP, Search, Landing Page, Global Sections) had their sections field hardcoded to an explicit list of allowed components instead of using $ALLOW_ALL_COMPONENTS.

This prevented custom components from appearing in the CMS editor. Any store that created new sections would need to manually rewrite FastStore's schema, breaking the onboarding experience entirely.

Reported by Otavio and Caixeta. A patch was already shipped in v4.0.1 as a hotfix.

How it works?

FastStore's base.jsonc defines a $ALLOW_ALL_COMPONENTS sentinel in $defs. This sentinel is replaced at build time (before sending to Schema Registry) with the full dynamic list of all registered components, including user-defined ones.

Previously, the .jsonc files generated for each content type had the sections array expanded inline with a hardcoded anyOf list of known built-in components. This list was stale and excluded any custom component.

This PR removes the hardcoded anyOf blocks and replaces them with a reference to $ALLOW_ALL_COMPONENTS, consistent with how 404, 500, and login content types already work. Also removes the now-obsolete schema.json that duplicated this data.

How to test it?

Add a new custom component using the faststore@4 base. This new fixed version is already deployed in v4.0.1.

image

Checklist

You may erase this after checking them all 😉

PR Title and Commit Messages

  • PR title and commit messages follow the Conventional Commits specification
    • Available prefixes: feat, fix, chore, docs, style, refactor, ci and test

PR Description

  • Added a label according to the PR goal - breaking change, bug, contributing, performance, documentation..

Dependencies

  • Committed the pnpm-lock.yaml file when there were changes to the packages

Documentation

  • PR description
  • For documentation changes, ping @Mariana-Caetano to review and update (Or submit a doc request)

Summary by CodeRabbit

  • Chores
    • Optimized CMS page schemas to use a centralized component allowance system across all page types, replacing individual hardcoded component lists. This improves maintainability and simplifies future updates to available page section components.

Review Change Stack

@mateuspontes mateuspontes self-assigned this May 12, 2026
@mateuspontes
mateuspontes requested a review from a team as a code owner May 12, 2026 17:17
@mateuspontes
mateuspontes requested review from lariciamota and lemagnetic and removed request for a team May 12, 2026 17:17
@mateuspontes mateuspontes added the bug Something isn't working label May 12, 2026
@coderabbitai

coderabbitai Bot commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@mateuspontes has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 55 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5c3b22a0-af99-4ce5-b847-2c8da17290ca

📥 Commits

Reviewing files that changed from the base of the PR and between 4b19ab3 and b950e4d.

📒 Files selected for processing (1)
  • packages/core/cms/faststore/schema.json

Walkthrough

This PR centralizes the allowed section components across eight CMS page-type schemas. Rather than maintaining separate anyOf enumerations in each file, all schemas now reference a single shared definition (#/$defs/$ALLOW_ALL_COMPONENTS), reducing duplication and simplifying component management.

Changes

CMS Page Schema Consolidation

Layer / File(s) Summary
Centralize allowed section components across page schemas
packages/core/cms/faststore/pages/cms_content_type__globalfootersections.jsonc, cms_content_type__globalheadersections.jsonc, cms_content_type__globalsections.jsonc, cms_content_type__home.jsonc, cms_content_type__landingpage.jsonc, cms_content_type__pdp.jsonc, cms_content_type__plp.jsonc, cms_content_type__search.jsonc
Each file's sections array schema transitions from explicit items.anyOf component-ref enumerations to a single $ref pointing to the shared #/$defs/$ALLOW_ALL_COMPONENTS definition, centralizing component allowance rules.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • vtex/faststore#3248: Introduced the $ALLOW_ALL_COMPONENTS schema definition that this PR now references across all page types.
  • vtex/faststore#3304: Also modifies the same CMS page schemas' section component allowlists; this PR centralizes the definition, while that PR may expand it.
  • vtex/faststore#3212: Updates the component registry and schema definitions that these page templates now reference.

Suggested labels

refactor

Suggested reviewers

  • lemagnetic
  • lariciamota
  • hellofanny

Poem

🎯 Eight schemas align,
Hardcoded lists now unified,
Components flow free—
Duplication dies, maintainability shines ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: allow_all_components for CMS' clearly and specifically describes the main change: updating CMS content-type schemas to use the $ALLOW_ALL_COMPONENTS reference instead of hardcoded component lists.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/allow-all-cms-components

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codesandbox-ci

codesandbox-ci Bot commented May 12, 2026 •

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.

@pkg-pr-new

pkg-pr-new Bot commented May 12, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@faststore/api

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/cli

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/components

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/core

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/diagnostics

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/lighthouse

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/sdk

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

@faststore/ui

yarn add https://pkg.pr.new/vtex/faststore/@faststore/[email protected]

commit: b950e4d

mateuspontes added a commit that referenced this pull request May 12, 2026
## What's the purpose of this pull request?

ℹ️ The same was done for vtex.faststore@4 via
#3312

Fix a bug where CMS content-types (Home, PDP, PLP, Search, Landing Page,
Global Sections) had their sections field hardcoded to an explicit list
of allowed components instead of using `$ALLOW_ALL_COMPONENTS`.

This prevented custom components from appearing in the CMS editor. Any
store that created new sections would need to manually rewrite
FastStore's schema, breaking the onboarding experience entirely.

Reported by Otavio and Caixeta. A patch was already shipped in v4.0.1 as
a hotfix.


## How it works?

FastStore's base.jsonc defines a `$ALLOW_ALL_COMPONENTS` sentinel in
**$defs**. This sentinel is replaced at build time (before sending to
Schema Registry) with the full dynamic list of all registered
components, including user-defined ones.

Previously, the .jsonc files generated for each content type had the
sections array expanded inline with a hardcoded anyOf list of known
built-in components. This list was stale and excluded any custom
component.

This PR removes the hardcoded anyOf blocks and replaces them with a
reference to `$ALLOW_ALL_COMPONENTS`, consistent with how 404, 500, and
login content types already work. Also removes the **now-obsolete**
`schema.json` that duplicated this data.


## How to test it?

Add a new custom component using the faststore@3 base. This new fixed
version is already deployed in v3.99.1.

<img width="275" height="87" alt="image"
src="https://github.com/user-attachments/assets/1e4a7398-4e5b-4b9c-827f-c7ac66ac6e2f"
/>


## Checklist

<em>You may erase this after checking them all 😉</em>

**PR Title and Commit Messages**

- [x] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [x] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [x] PR description
- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)
@mateuspontes
mateuspontes changed the base branch from dev to main May 12, 2026 18:02
@mateuspontes
mateuspontes changed the base branch from main to dev May 12, 2026 18:03
@hellofanny
hellofanny merged commit eadeaa3 into dev May 12, 2026
7 checks passed
@hellofanny
hellofanny deleted the fix/allow-all-cms-components branch May 12, 2026 19:04
@eduardoformiga eduardoformiga mentioned this pull request May 15, 2026
1 of 3 tasks
eduardoformiga added a commit that referenced this pull request May 15, 2026
## Summary

Graduation PR from `dev` to `main`. Promotes the `4.1.0-dev.10`
prerelease cycle to the next stable, expected `4.1.1` (only `fix:` and
`chore:` commits since `4.1.0`).

### Notable changes since 4.1.0

- fix: region slider section render (#3318)
- fix: allow_all_components for CMS (#3312)
- chore: test coverage sonarqube (#3319)
- chore: bump next.js to 16.2.6 (#3327)
- chore: phase 4 — split AGENTS.md, add MCP config and spec-kit check
(#3320)
- chore: Update repo read me files (#3314)
- Dark Kitchen Catalog Setup (#3317)

### Back-merge

`main` was back-merged into `dev` (`3d4d24081`) before this PR to bring
in the `4.1.0` release commit and avoid silent overwrites. Conflicts
were resolved in favor of `dev` for code/CMS/version files, with
`CHANGELOG` entries merged from both sides.

## Test plan

- [x] dev CD published `4.1.0-dev.10` on the `dev` dist-tag for all 8
packages
- [ ] After merge, main CD graduates to `4.1.1` on the `latest` dist-tag
- [ ] All 8 packages publish (api, cli, components, core, diagnostics,
lighthouse, sdk, ui)


Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Larícia Mota <[email protected]>
Co-authored-by: Matheus P. Silva <[email protected]>
Co-authored-by: Leandro Rodrigues <[email protected]>
Co-authored-by: vtexgithubbot <[email protected]>
Co-authored-by: Lucas Feijó <[email protected]>
Co-authored-by: Luiz Falcão <[email protected]>
Co-authored-by: Artur Santiago <[email protected]>
Co-authored-by: Sahan Jayawardana <[email protected]>
Co-authored-by: Mateus Pontes <[email protected]>
Co-authored-by: Matheus Martins <[email protected]>
Co-authored-by: renatomaurovtex <[email protected]>
Co-authored-by: Leandro Rodrigues <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Thiago Pereira <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Giuliana Rigaud <[email protected]>
Co-authored-by: renato <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>
Co-authored-by: Ícaro Oliveira <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Everton Ataide <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Otavio Moreira Meirelles <[email protected]>
Co-authored-by: Marco Cardoso <[email protected]>
Co-authored-by: Gabriel Paladino <[email protected]>
Co-authored-by: CodeRabbit <[email protected]>
Co-authored-by: dk-portal[bot] <134092483+dk-portal[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants