Skip to content

cli(feat): Payload 4 beta follow-ups — per-major Next.js pairing, localize by meaning, doctor runtime checks - #621

Merged
Ducksss merged 3 commits into
mainfrom
claude/payload4-beta-follow-ups
Oct 11, 2026
Merged

Ducksss merged 3 commits into
mainfrom
claude/payload4-beta-follow-ups

Conversation

@Ducksss

@Ducksss Ducksss commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Summary

These are the Payload 4 beta follow-ups from the #601 spike, which shipped in CLI 1.7.0. Payload 4 support stays experimental, and Payload 3 stays fully supported.

1. Next.js support per Payload major

Until now, support-matrix.json read as a cross product, so component pages said "Payload v3 / v4 · Next.js 15 / 16". Payload 4 dropped Next.js 15.

  • Shape (backward compatible). Each target gains an optional payloadMajorSupport map, keyed by Payload major:

    • "3": { nextMajors: [15, 16] }
    • "4": { experimental: true, minimumVersions: { next: "16.2.6", node: "24.15.0" }, nextMajors: [16] }

    allowedPayloadMajors and allowedNextMajors stay as the unions, so a reader of the old shape keeps working. A Payload major without an entry pairs with every allowed Next.js major, which is what a v2 matrix already meant. version stays 2, because the change only adds a field. Manifests still declare the unions, so none of the 83 manifests changed.

  • One reader. The new tools/payload-components/support-matrix.ts holds pairedNextMajors, targetSupportsPair and describeSupportedPairs. All the CLI checks below use it.

  • Detection. detectProject matches targets on the pair. When both majors are supported but not together, it names the pairing instead of falling through to the file-shape error: Unsupported Next.js major version 15 for Payload v4 in … This version of payload-components supports Payload v3 with Next.js 15, 16; Payload v4 with Next.js 16.

  • assertManifestSupport also checks the pair against the detected target.

  • Docs and catalog. The component Requirements section (ComponentRequirements), the per-page markdown and /llms-full.txt (src/lib/source.ts) now list Next.js per Payload major, through getPayloadCompatibility in src/lib/component-manifest.ts. That file keeps type-only imports from the CLI. Example output: "Payload v3 with Next.js 15 / 16; Payload v4 (experimental) with Next.js 16 (16.2.6 or newer) and Node.js 24.15 or newer". The JSON-LD softwareRequirements says the same.

  • Guard. payload-components-support-matrix.int.spec.ts now also checks:

    • Pairings only name majors their target allows.
    • Every allowed Next.js major pairs with some Payload major.
    • Each minimum version is valid and falls inside a paired major.
    • Every manifest's peerDependencies.next admits each Payload major's minimum Next.js version.
    • The concrete pairing is pinned: v3 → 15 and 16, v4 → 16 only, with v4 experimental and its minimums set.
    • A fixture keeps the guard from passing vacuously, and a test covers v2-shape (no map) compatibility.

2. Docs sweep

Pages that meant "v3, and now experimental v4" were updated:

  • the installation requirements, now a pair table with a note on the doctor minimums
  • the docs home, CLI reference (create-payload-app@beta, doctor runtime scope, localize by meaning), registry (a payloadMajorSupport section), localization, architecture, the what-is page, the walkthrough, payload-blocks, the npm, UI-components, configuration and types guides
  • README (with a support table), CONTRIBUTING, AGENTS.md (pairing and localize notes)
  • the package.json description, the "Which projects are supported" FAQ answer, and /llms.txt (summary line plus a matrix-checked experimentalStackItem stack line)

Pins I checked first and left alone, because the copy is still accurate and v3-specific:

  • the installation lead sentence (geo.e2e)
  • the first-block guide's title, SEO title and description (fumadocs-site.int, frontend.e2e)
  • the Payload 3 types-guide title
  • the blog "Practical Payload CMS v3 guides" copy
  • SEO descriptions such as siteDescription

No count pins were affected. I also left out dated blog posts and the shadcn directory listing copy in payload-components/README.md, which is a verbatim upstream entry.

3. localize compares configs by meaning

An existing localization block is a no-op when it means what --locales asks for. That means the same locale codes and writing direction (rtl; a bare string is rtl: false), the same defaultLocale, and the same fallback (absent means true, as in Payload 3 and 4's sanitize.ts). Property order, locale order, quote style, comments, labels, and options the CLI never writes (filterAvailableLocales, a locale's fallbackLocale) don't count.

The comparison reuses the masking scanner. readPayloadLocalization now projects an internal inspectPayloadLocalization, and the rendered request block is read back through the same parser. These cases are never treated as equivalent:

  • a duplicated code
  • bare strings mixed with locale objects (Payload reads every entry the way it reads the first)
  • a missing or out-of-list default
  • computed locales, fallback or rtl
  • a value that only starts with a literal (fallback: true && x)

Different blocks still refuse without --force, and the message now says so: …; --force replaces it. An unreadable block (as const, a spread, a reference) is still refused even with --force.

The Payload 4 blank template (locales: [{ code: 'en', label: 'English' }], fallback: true, defaultLocale: 'en') followed by localize --locales en is now a clean no-op. Running --locales en,zh on it still refuses without --force.

4. doctor runtime warnings

checkRuntimeRequirements reads minimumVersions from the matrix. On a Payload 4 project it warns, in a new runtime scope, when:

  • the Node.js running doctor is below 24.15.0
  • the installed or exactly pinned next is below 16.2.6

A range with nothing installed can't be pinned, so it isn't reported. These are warnings, so exit codes don't change. A Payload 4 project on Next.js 15 is refused by detection, and doctor reports that as a project error (exit 2), so it needs no separate warning.

5. Local Payload 4 smoke — not run

This machine has Node 20.20, 22.22 and 24.13.1, and Payload 4 needs Node 24.15 or newer, so a local SMOKE_PAYLOAD_VERSION=4.0.0-beta.0 bare smoke would only measure the wrong runtime. The nightly payload-canary-smoke job, which runs on Node 24.15, stays the Payload 4 evidence. CI config is untouched.

Tests

New or extended int specs:

  • payload-components-support-matrix.int.spec.ts: the pairing guard (5 tests)
  • payload-components-target-detection.int.spec.ts: the v4 + Next 15 refusal naming the pairs, v3 + Next 15 still detected, assertManifestSupport pairing
  • payload-components-doctor-command.int.spec.ts:
    • Node below/at the minimum, Next below the minimum, and a range skipped (unit)
    • Payload 3 reports nothing
    • a subprocess doctor --json on a Payload 4 fixture (the runtime findings, exit 0)
    • a Payload 4 + Next 15 fixture (exit 2)
  • payload-components-localize-command.int.spec.ts:
    • the v4 blank block counts as equivalent (with and without --force)
    • formatting, order, quotes, labels and extra options are ignored
    • different blocks are refused, then replaced with --force
    • rtl is compared
    • malformed or computed blocks are refused, including one that is unreadable even with --force
    • an end-to-end localizeCommand run on the v4 blank config
  • fumadocs-site.int.spec.ts: per-major Requirements markdown, getPayloadCompatibility and its formatters, and experimentalStackItem held to the matrix

Validation

Every exit code was captured to a file:

Step Exit
pnpm install --frozen-lockfile 0
pnpm source:build 0
pnpm lint 0
pnpm format:check 0
pnpm exec tsc --noEmit 0
pnpm test:registry 0
pnpm run test:int (before the rebase onto #620) 0 (866 passed, 1 skipped)
pnpm run test:int (after the rebase, which only changed pnpm-lock.yaml) 1: three default 5s timeouts at load ~27, from other sessions' jobs (template-seed, public-registry metadata, site-i18n pathname)
↳ those three files rerun alone 0 (23 passed)
E2E_PORT=3311 pnpm build:e2e 0
production e2e, frontend.e2e + geo.e2e on 3311 1: 171 passed, 2 skipped, 1 failed (the catalog "debounces shareable URL state" test at load ~42; this branch doesn't touch it)
↳ that test rerun alone (production, 3311) 0 (1 passed)

install, tsc and registry were also rerun after the rebase, all with exit 0. I spot-checked the built /docs/components/hero-basic HTML: the Payload cell reads "v3 / v4 (experimental)", Next.js is listed per Payload major, and the experimental note renders.

darwin visual comparisons are skipped by design. The landing stack band ("Payload CMS v3", "Next.js 15 / 16"), the footer stack line and the "Payload 3 · Next 15 / 16" receipt are unchanged on purpose: they are still accurate, and changing them would need a Linux visual-baseline re-mint.

🤖 Generated with Claude Code

Ducksss and others added 3 commits October 11, 2026 15:03
…tion by meaning

support-matrix.json gains an optional per-target payloadMajorSupport map:
Payload 3 keeps Next.js 15 and 16, experimental Payload 4 pairs with
Next.js 16 only and records its Node.js 24.15 / Next.js 16.2.6 minimums.
allowedPayloadMajors and allowedNextMajors stay the unions, so a reader of
the old shape still works and a target without the map keeps its
cross-product meaning.

Detection, assertManifestSupport and the component docs read the pairing;
doctor warns below the Payload 4 minimums. localize treats an existing
block with the same locales, default and fallback as a no-op however it is
written, and still refuses different or unreadable blocks without --force.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Docs, README, AGENTS.md, the FAQ answer, /llms.txt and the JSON-LD
software requirements now say Payload v3 pairs with Next.js 15 or 16
and Payload v4 is experimental on Next.js 16.2.6+ with Node.js 24.15+.
The installation requirements table lists the pairs, the CLI and
registry references describe payloadMajorSupport, doctor's runtime
warnings and localize's by-meaning comparison.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 11, 2026 07:13
@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
payload-components Ready Ready Preview Oct 11, 2026 7:14am UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 10 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
  • Configuration used: Repository: Ducksss/payload-components/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be060ce8-9810-4e08-be2e-16f94d7996a2

📥 Commits

Reviewing files that changed from the base of the PR and between 71cf56d and 670e1ee.


📒 Files selected for processing (37)
  • AGENTS.md
  • CONTRIBUTING.md
  • README.md
  • content/docs/architecture.mdx
  • content/docs/cli.mdx
  • content/docs/index.mdx
  • content/docs/install-walkthrough.mdx
  • content/docs/installation.mdx
  • content/docs/localization.mdx
  • content/docs/payload-blocks.mdx
  • content/docs/payload-cms-npm.mdx
  • content/docs/payload-cms-ui-components.mdx
  • content/docs/payload-configuration.mdx
  • content/docs/payload-types-errors.mdx
  • content/docs/registry.mdx
  • content/docs/what-is-a-payload-component.mdx
  • messages/en.json
  • package.json
  • payload-components/support-matrix.json
  • src/app/llms.txt/route.ts
  • src/components/site/ComponentRequirements.tsx
  • src/lib/component-manifest.ts
  • src/lib/site.ts
  • src/lib/source.ts
  • src/lib/structured-data.ts
  • tests/int/fumadocs-site.int.spec.ts
  • tests/int/payload-components-doctor-command.int.spec.ts
  • tests/int/payload-components-localize-command.int.spec.ts
  • tests/int/payload-components-support-matrix.int.spec.ts
  • tests/int/payload-components-target-detection.int.spec.ts
  • tools/payload-components/commands/doctor.ts
  • tools/payload-components/commands/localize.ts
  • tools/payload-components/dependencies.ts
  • tools/payload-components/payload-localization.ts
  • tools/payload-components/project.ts
  • tools/payload-components/support-matrix.ts
  • tools/payload-components/types.ts

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

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.

@Ducksss
Ducksss merged commit b900495 into main Oct 11, 2026
17 checks passed
@Ducksss
Ducksss deleted the claude/payload4-beta-follow-ups branch October 11, 2026 14:19
@Ducksss Ducksss mentioned this pull request Oct 29, 2026

This branch was successfully deployed

1 active deployment
Preview — 670e1ee4 Deployed Oct 11, 2026 by vercel[bot]
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