Repository navigation
cli(feat): Payload 4 beta follow-ups — per-major Next.js pairing, localize by meaning, doctor runtime checks - #621
Merged
Conversation
…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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou'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. View limit details
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. Comment |
Merged
This branch was successfully deployed
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.
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.jsonread 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
payloadMajorSupportmap, keyed by Payload major:"3": { nextMajors: [15, 16] }"4": { experimental: true, minimumVersions: { next: "16.2.6", node: "24.15.0" }, nextMajors: [16] }allowedPayloadMajorsandallowedNextMajorsstay 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.versionstays2, 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.tsholdspairedNextMajors,targetSupportsPairanddescribeSupportedPairs. All the CLI checks below use it.Detection.
detectProjectmatches 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.assertManifestSupportalso 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, throughgetPayloadCompatibilityinsrc/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-LDsoftwareRequirementssays the same.Guard.
payload-components-support-matrix.int.spec.tsnow also checks:peerDependencies.nextadmits each Payload major's minimum Next.js version.2. Docs sweep
Pages that meant "v3, and now experimental v4" were updated:
create-payload-app@beta, doctorruntimescope, localize by meaning), registry (apayloadMajorSupportsection), localization, architecture, the what-is page, the walkthrough, payload-blocks, the npm, UI-components, configuration and types guidespackage.jsondescription, the "Which projects are supported" FAQ answer, and/llms.txt(summary line plus a matrix-checkedexperimentalStackItemstack line)Pins I checked first and left alone, because the copy is still accurate and v3-specific:
siteDescriptionNo 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.
localizecompares configs by meaningAn existing
localizationblock is a no-op when it means what--localesasks for. That means the same locale codes and writing direction (rtl; a bare string isrtl: false), the samedefaultLocale, and the samefallback(absent meanstrue, as in Payload 3 and 4'ssanitize.ts). Property order, locale order, quote style, comments, labels, and options the CLI never writes (filterAvailableLocales, a locale'sfallbackLocale) don't count.The comparison reuses the masking scanner.
readPayloadLocalizationnow projects an internalinspectPayloadLocalization, and the rendered request block is read back through the same parser. These cases are never treated as equivalent:rtlfallback: 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 bylocalize --locales enis now a clean no-op. Running--locales en,zhon it still refuses without--force.4.
doctorruntime warningscheckRuntimeRequirementsreadsminimumVersionsfrom the matrix. On a Payload 4 project it warns, in a newruntimescope, when:doctoris below 24.15.0nextis below 16.2.6A 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
projecterror (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.0bare smoke would only measure the wrong runtime. The nightlypayload-canary-smokejob, 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,assertManifestSupportpairingpayload-components-doctor-command.int.spec.ts:--jsonon a Payload 4 fixture (theruntimefindings, exit 0)payload-components-localize-command.int.spec.ts:--force)--forcertlis compared--forcelocalizeCommandrun on the v4 blank configfumadocs-site.int.spec.ts: per-major Requirements markdown,getPayloadCompatibilityand its formatters, andexperimentalStackItemheld to the matrixValidation
Every exit code was captured to a file:
pnpm install --frozen-lockfilepnpm source:buildpnpm lintpnpm format:checkpnpm exec tsc --noEmitpnpm test:registrypnpm run test:int(before the rebase onto #620)pnpm run test:int(after the rebase, which only changedpnpm-lock.yaml)E2E_PORT=3311 pnpm build:e2efrontend.e2e+geo.e2eon 3311install,tscandregistrywere also rerun after the rebase, all with exit 0. I spot-checked the built/docs/components/hero-basicHTML: 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