Skip to content

cli(feat): Payload v4 (canary) compatibility spike - #601

Merged
Ducksss merged 4 commits into
mainfrom
claude/payload-v4-canary-spike
Oct 4, 2026
Merged

Ducksss merged 4 commits into
mainfrom
claude/payload-v4-canary-spike

Conversation

@Ducksss

@Ducksss Ducksss commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Draft spike: what Payload 4 breaks, and the smallest changes that make the catalog install into it. Payload 4 is in canary (4.0.0-canary.37). Without this branch, payload-components add refuses every v4 project, and on v4 GA day the nightly smoke (which follows latest) would go red.

What broke, and the fix

Stage Symptom on 4.0.0-canary.37 Root cause Fix here
add (detect) Unsupported project shape allowedPayloadMajors: [3] in both targets; the major mismatch fell through to the file-shape error Allow [3, 4]; detectProject now names an unsupported Payload or Next.js major
add (manifest) would throw does not support Payload major version 4 every manifest declares payloadMajors: [3] [3, 4] in all 82 manifests, the component template and the new scaffold
add (peer check) 4.0.0-canary.37 never satisfies ^3.0.0 || ^4.0.0-0 semver.intersects without includePrerelease checks <5.0.0-0 on its own and rejects every prerelease Peer ranges ^3.0.0 || ^4.0.0-0 plus includePrerelease (the -0 bounds keep prereleases inside their major)
smoke: create pinned canary silently ignored create-payload-app 4 renamed --version to --payload-version; its arg parser is permissive Pass the flag each major reads, both for a dist-tag
smoke: tsc next/seed/route.ts: 'payload' does not exist in type 'Args' (template code) create-payload-app 4 downloads templates from payloadcms/payload main, which renamed createLocalReq (#18287) after canary.37 shipped Pin a v4 template to its release tag via --branch when the tag exists
runtime (base bundle) visitors can GET /api/pages/versions (confirmed on canary.37) v4 inherits collection read for versions (#17634) Explicit readVersions on the base Pages; a no-op on v3, where versions already need a user

No component source changed. All 82 shipped components compile, build and render on v4 unmodified.

Verification (local, Node 22.22 with engine warnings; Payload 4 asks for 24.15+)

  • SMOKE_PAYLOAD_VERSION=4.0.0-canary.37 pnpm test:fresh -- --scenario bare: passes (blank template, init --scaffold, two blocks, tsc on TypeScript 6.0.3).
  • Website shard 0: passes end to end (20 blocks, generators, demo seed via payload run, payload build, next start, 20/20 rendered).
  • Full catalog in one v4 website project: all 82 components installed, tsc clean, payload build clean, 79/79 page blocks rendered in Chromium with no page or console errors, doctor all ok, diff 82 clean, remove and re-add clean.
  • pnpm run test:int (810 passed), pnpm lint, pnpm format:check, pnpm exec tsc --noEmit. v3 behaviour is unchanged; the PR smoke still pins 3.88.0.

Optional CI commit

payload-canary-smoke runs the bare and four website scenarios nightly against npm view payload@canary version. It runs on Node 24 with Postgres like the gating smoke, is schedule-only with continue-on-error, and sits outside pr-gate. Drop the last commit if you would rather not carry it.

Not in this PR

  • Docs still say "Payload v3" in about 15 places. Component requirement tables now read "Payload v3 / v4", "Next.js 15 / 16", but Payload 4 requires Next.js 16.2.6+, and the support matrix is a cross product. Sweep both at beta or RC.
  • canary.37 predates the authorship default (createdBy/updatedBy, #17247) and the request-API rename, so expect churn on the next canary. That is what the nightly job is for.
  • TanStack Start (new in v4): blocks import next/link, next/image and next/headers, so it would need its own target.
  • localize refuses the single-locale localization block every v4 blank project now ships unless --force is passed.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 4, 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 4, 2026 10:05am UTC
payload-components-97bf Ready Ready Preview Oct 4, 2026 10:05am UTC

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: Ducksss/payload-components/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56986c90-3e18-4c0b-97e1-16fa5cb4d8ff
📥 Commits

Reviewing files that changed from the base of the PR and between a728944 and 4c94489.

📒 Files selected for processing (94)
  • .github/workflows/registry-verification.yml
  • payload-components/component-template/manifest.json
  • payload-components/manifests/author-card.json
  • payload-components/manifests/call-to-action-boxed.json
  • payload-components/manifests/call-to-action-centered.json
  • payload-components/manifests/call-to-action-signup.json
  • payload-components/manifests/call-to-action-split.json
  • payload-components/manifests/collection-query.json
  • payload-components/manifests/comparator-grid.json
  • payload-components/manifests/comparator-stack.json
  • payload-components/manifests/comparator-table.json
  • payload-components/manifests/contact-channels.json
  • payload-components/manifests/contact-form-basic.json
  • payload-components/manifests/contact-routing-form.json
  • payload-components/manifests/content-columns.json
  • payload-components/manifests/content-community.json
  • payload-components/manifests/content-feature-media.json
  • payload-components/manifests/content-feature-split.json
  • payload-components/manifests/content-image-frame.json
  • payload-components/manifests/content-image-lead.json
  • payload-components/manifests/content-list-columns.json
  • payload-components/manifests/content-list-icons.json
  • payload-components/manifests/content-list.json
  • payload-components/manifests/content-quote.json
  • payload-components/manifests/content-rows.json
  • payload-components/manifests/content-showcase.json
  • payload-components/manifests/content-split-rows.json
  • payload-components/manifests/content-stats.json
  • payload-components/manifests/embed-basic.json
  • payload-components/manifests/faq-accordion.json
  • payload-components/manifests/faq-card.json
  • payload-components/manifests/faq-grid.json
  • payload-components/manifests/faq-grouped.json
  • payload-components/manifests/faq-icons.json
  • payload-components/manifests/faq-split.json
  • payload-components/manifests/feature-accordion.json
  • payload-components/manifests/feature-bento.json
  • payload-components/manifests/feature-cards-media.json
  • payload-components/manifests/feature-grid-basic.json
  • payload-components/manifests/feature-icon-grid.json
  • payload-components/manifests/feature-split.json
  • payload-components/manifests/feature-steps.json
  • payload-components/manifests/footer-centered.json
  • payload-components/manifests/footer-columns.json
  • payload-components/manifests/footer-simple.json
  • payload-components/manifests/hero-aurora.json
  • payload-components/manifests/hero-basic.json
  • payload-components/manifests/hero-kinetic.json
  • payload-components/manifests/hero-product-tilt.json
  • payload-components/manifests/hero-split.json
  • payload-components/manifests/hero-video.json
  • payload-components/manifests/integration-cluster.json
  • payload-components/manifests/integration-connect.json
  • payload-components/manifests/integration-grid.json
  • payload-components/manifests/integration-list.json
  • payload-components/manifests/integration-marquee.json
  • payload-components/manifests/integration-orbit.json
  • payload-components/manifests/integration-split.json
  • payload-components/manifests/integration-testimonial.json
  • payload-components/manifests/logo-cloud-grid.json
  • payload-components/manifests/logo-cloud-hover.json
  • payload-components/manifests/logo-cloud-inline-wrap.json
  • payload-components/manifests/logo-cloud-inline.json
  • payload-components/manifests/logo-cloud-marquee.json
  • payload-components/manifests/newsletter-callout.json
  • payload-components/manifests/post-hero.json
  • payload-components/manifests/pricing-cards-cta.json
  • payload-components/manifests/pricing-cards-muted.json
  • payload-components/manifests/pricing-cards.json
  • payload-components/manifests/pricing-enterprise.json
  • payload-components/manifests/pricing-split.json
  • payload-components/manifests/related-posts.json
  • payload-components/manifests/stats-card.json
  • payload-components/manifests/stats-grid.json
  • payload-components/manifests/stats-inline.json
  • payload-components/manifests/stats-proof.json
  • payload-components/manifests/team-bios.json
  • payload-components/manifests/team-grid.json
  • payload-components/manifests/team-roster.json
  • payload-components/manifests/testimonials-bento.json
  • payload-components/manifests/testimonials-grid.json
  • payload-components/manifests/testimonials-quote.json
  • payload-components/manifests/testimonials-rating.json
  • payload-components/manifests/testimonials-spotlight.json
  • payload-components/manifests/testimonials-wall.json
  • payload-components/source/base/collections/Pages/index.ts
  • payload-components/support-matrix.json
  • tests/int/fresh-payload-smoke.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/new.ts
  • tools/payload-components/dependencies.ts
  • tools/payload-components/project.ts
  • tools/payload-components/smoke/fresh-payload-repo.ts
 _____________________________________________________________________________________
< All idioms must be learned. Good idioms only need to be learned once. - Alan Cooper >
 -------------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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 and others added 4 commits October 4, 2026 17:57
Payload 4 is in canary (4.0.0-canary.37) and every install into a v4
project was refused. Allow major 4 in both support-matrix targets and in
every manifest (payloadMajors [3, 4], payload peer "^3.0.0 || ^4.0.0-0"),
the component template, and the `new` scaffold.

Widening the ranges alone was not enough: semver.intersects without
includePrerelease tests each comparator on its own, so "<5.0.0-0" rejects
4.0.0-canary.37 and a pinned prerelease never intersects "^4.0.0-0". The
"-0" bounds on every required range keep prereleases inside their major.

detectProject now names an unsupported Payload or Next.js major instead of
reporting "Unsupported project shape", which is what a v4 project got.

The base Pages collection gains an explicit readVersions (signed-in only).
Payload 4 inherits read access for versions (payloadcms/payload#17634), so
visitors could list every previously published version. Payload 3 already
requires a user here, so this is a no-op on v3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…resh smoke

create-payload-app 4 renamed --version to --payload-version. Its argument
parser is permissive, so the old flag was silently dropped and a smoke
pinned to 4.0.0-canary.37 scaffolded whatever the `canary` dist-tag
resolved to. Pass the flag each major reads, and both for a dist-tag.

create-payload-app 4 also downloads its template from the payloadcms/payload
main branch instead of the release it installs. Main had already renamed
createLocalReq (payloadcms/payload#18287, after canary.37 shipped), so the
pinned scaffold failed tsc in the template's own seed route. Pin a v4
template to the release tag with --branch when that tag exists; v3 keeps
its CLI's 3.x branch and needs no network check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The nightly fresh smoke follows Payload `latest`, so nothing exercised the
next major before it ships. Run the same bare and website scenarios against
`npm view payload@canary version` on Node.js 24 (Payload 4 requires 24.15+),
schedule-only and with continue-on-error, outside pr-gate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…support matrix

related-posts (#600) landed declaring Payload 3 only, so once Payload 4 is
allowed it would be the one component refusing v4 projects. Give it the
same supports and peer range as every other manifest; manifest-only, so the
versioned-source contract needs no version bump.

payload-components-support-matrix.int.spec.ts makes this class of drift
fail: every manifest, the component template and the `new` scaffold must
declare exactly the Payload and Next.js majors their targets allow, with peer
ranges that cover each major's stable line and the newest Payload major's
prereleases. A v3-only fixture keeps the guard from passing vacuously.
buildManifest is exported so the scaffold's output can be checked directly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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.

@Ducksss
Ducksss merged commit 3b91688 into main Oct 4, 2026
17 of 18 checks passed
@Ducksss
Ducksss deleted the claude/payload-v4-canary-spike branch October 4, 2026 14:17
@Ducksss Ducksss mentioned this pull request Oct 9, 2026
Ducksss added a commit that referenced this pull request Oct 10, 2026
New minor. The related-posts article component (#600) and experimental
Payload 4 support (#601) have landed on main since v1.6.1, while npm still
serves 1.6.1. The site already documents
`npx payload-components add related-posts`, but the 1.6.1 CLI doesn't know the
component, so the command fails for npm users until this ships.

Runtime dependencies are unchanged (ajv, semver).

Co-authored-by: Claude Opus 5.5 <[email protected]>
Ducksss added a commit that referenced this pull request Oct 10, 2026
hero-aurora, hero-kinetic, hero-video, integration-marquee and
logo-cloud-marquee pinned `motion: ^12.0.0`, so `payload-components add`
installed motion 12 even though direct shadcn installs, whose registry lists
plain `motion`, already get 13. Widen the range to `^12.0.0 || ^13.0.0`.

Motion 13's only breaking change drops the optional @emotion/is-prop-valid
prop filter, which these components never relied on. The APIs they use from
motion/react (motion, animate, useInView, useMotionValue, useReducedMotion,
useSpring, useTransform, useScroll) are unchanged. 13.5 only moves useScroll
offsets onto the main thread. Dependabot's #611, which moves the site to
motion 13.5, already rendered all five green, including the visual specs.

Manifest-only change, so no version bump, as with the #601 range sweep.
Existing installs keep working and need no update.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Ducksss added a commit that referenced this pull request Oct 11, 2026
#611 merged as motion 14.0.0. Dependabot updated the PR from 13.5 after #617
was written, so the site now runs motion 14 while the five motion components
still declared `^12.0.0 || ^13.0.0`. Widen them to
`^12.0.0 || ^13.0.0 || ^14.0.0` so `payload-components add` installs what the
site renders and tests.

Motion 14.0.0's only breaking change removes internal APIs that 13.5.1 had
restored for framer-motion compatibility. The public motion/react APIs these
components use are unchanged in 14.0 and 14.1. #611's CI passed on 14.0.0,
and the full int suite here compiles the shipped source against it.

Manifest-only, so no version bump, as with #601 and #617.

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

2 active deployments
Preview – payload-components — 4c944897 Deployed Oct 4, 2026 by vercel[bot]
Preview – payload-components-97bf — 4c944897 Deployed Oct 4, 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