Skip to content

feat(core, ui-react)!: field inputs and cells move out of the config into the renderers module (R2 fields) - #32

Merged
jherr merged 1 commit into
mainfrom
cursor/field-renderers-d21e
Nov 6, 2026
Merged

jherr merged 1 commit into
mainfrom
cursor/field-renderers-d21e

Conversation

@jherr

@jherr jherr commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Implements cms-refactor-plan.md § Track R2 (item 9) for fields. This is decided question 22: Field.input leaves the config through the same binding channel as block renderers. It's in its own PR because admin custom inputs break. It also applies item 10's props-over-providers rule.

Merge chain: step 8 of 24. Base: main. Merge it right after #31. The branch is main 3b4a112, then one commit for each PR before this one in the merge order, then this PR's own commit 8c41fab (tree 4999fff).

What

  • Fields and field types are data only in @tanstack/cms-core.

    • Field.input is now a string naming an input in the app's renderers.
    • FieldTypeDefinition drops input and cell.
    • defineCollection, defineBlock, defineFieldType and defineCms reject the old forms. Each error gives the field's path and names the replacement.
  • CmsRenderers gains inputs and fieldTypes. fieldTypes covers custom types only; a built-in name throws.

  • Resolution order:

    1. the field's named input, from the prop and then the bound module;
    2. the custom type's input and cell, from the prop and then the module;
    3. the built-in control, or the JSON editor.

    A named input that isn't bound logs one warning and falls back.

  • Props. FieldInput, CollectionSection and columnFields(collection, session, renderers?) take renderers. The admin routes already import app-renderers, so the module named in createRoutes reaches the edit and content routes.

  • Docs. collections-and-fields.md gains a "Custom inputs and cells" section, and the cms-ui-react and cms-core references are updated. The upgrade guide gains §23, and the migration docs and the Payload skill now point at defineRenderers.

  • Changeset: field-renderers-module.md, minor and breaking in pre-mode, for cms-core and cms-ui-react.

No app, starter, example, template, CLI or cms-skills file sets a field input, so no app code changes.

Breaking changes

  • Field.input changes from a component to a string name. Move the component into defineRenderers({ inputs: { <name>: Component } }) and set input: '<name>'.
  • defineFieldType({ input, cell }) is removed. Move those to defineRenderers({ fieldTypes: { <type>: { input, cell } } }).
  • Bespoke admin screens pass renderers to FieldInput, CollectionSection and columnFields.

There's no codemod; upgrading §23 shows before and after.

Assumptions (tasks 8–12 defaults)

  • Field.input stays, as a string name, so the override stays per-field and serializable.
  • fieldTypes takes custom types only.
  • An unbound named input warns and falls back instead of throwing.
  • columnFields takes renderers as an optional third argument.
  • FieldInputProps and FieldCellProps stay exported from core.

Divergence from plan

  • This is a separate PR, following Q22.
  • defineCmsDefinition doesn't run the field check, because the definition file has to keep type-only imports. defineCollection and defineCms catch the old forms.

How verified

CI is down because GitHub Actions is out of billing, so I ran everything locally. I rebased this head, together with #25, #28 and R2 blocks, onto #24's main-based head 2850c54.

  • pnpm test:ci: passes except the cms-api:test:oxlint failure that main already has.
  • test:dts, test:dialects: clean.
  • test:scripts: 93/93.
  • test:definitions: 26/26.
  • E2E: blog 29/29, base 12/12.

The worker also ran the ui-react unit tests (111/111) and core (595 passed, 30 skipped).

Merge chain (local verification, CI down)

This PR's commits are squashed into one commit on the linear merge chain. That commit holds this PR's own changes, resolved against every PR before it, with the integration rehearsal's fixes for this PR applied. No conflicts.

The chain tip's tree is exactly the integration rehearsal plus #46 (c4e6d7c), and the tip passes the full local suite. I simulated merging every PR in order, with a merge commit or a fast-forward at each step, and every step is clean. A plain squash of the next PR would conflict, because the squash commit isn't an ancestor of the next branch. To squash instead, first rebase the branch's one commit onto the new main; that rebase is always clean.

Open in Web Open in Cursor 

@changeset-bot

changeset-bot Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 654a6db

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@tanstack/cms-core Minor
@tanstack/cms-ui-react Minor
@tanstack/cms-api Minor
@tanstack/cms-cli Minor
@tanstack/cms-client Minor
@tanstack/cms-connect-atproto Patch
@tanstack/cms-migrate-wp Patch
@tanstack/cms-skills Patch
@tanstack/cms-media-s3 Minor
@tanstack/search-cms Patch
@tanstack/cms-store-libsql Minor
@tanstack/cms-store-postgres Patch
@tanstack/cms-ui-dom Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: TanStack/cms
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 935c82e
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Free
  • Run ID: 88b852ed-b90f-4795-b38e-8f4165197465
Commits

Reviewing files that changed from the base of the PR and between 935c82e and 654a6db.

Files selected for processing: 21

  • .changeset/field-renderers-module.md
  • .claude/skills/payload-to-tanstack-cms/SKILL.md
  • docs/api/cms-core.md
  • docs/api/cms-ui-react.md
  • docs/deployment/upgrading.md
  • docs/migration/from-payload.md
  • docs/migration/overview.md
  • docs/schema/collections-and-fields.md
  • packages/core/src/config.ts
  • packages/core/src/lib/authoring.ts
  • packages/core/src/schema.ts
  • packages/core/tests/field-types.test.ts
  • packages/ui-react/src/components/blocks-view.tsx
  • packages/ui-react/src/components/content-list.tsx
  • packages/ui-react/src/components/editor/field-input.tsx
  • packages/ui-react/src/index.ts
  • packages/ui-react/src/lib/renderers.ts
  • packages/ui-react/src/primitives.ts
  • packages/ui-react/src/site.ts
  • packages/ui-react/tests/field-renderers.test.tsx
  • packages/ui-react/tests/renderers.test.tsx

TanStack is on CodeRabbit Free, which includes PR summaries. Ask your admin to upgrade for code reviews.

  • Ask an admin to upgrade

Open in CodeRabbit

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…into the renderers module (R2 fields) (#32)

Chain step 8 of the linear merge chain onto main 3b4a112: this PR's own changes, resolved against the PRs before it in the merge order.

Co-authored-by: jherr <jherr@pobox.com>
@jherr
jherr force-pushed the cursor/field-renderers-d21e branch from 8c41fab to 654a6db Compare November 6, 2026 15:07
@jherr
jherr merged commit 87b29ae into main Nov 6, 2026
@jherr
jherr deleted the cursor/field-renderers-d21e branch November 8, 2026 01:55
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.

2 participants