Skip to content

Payload 3 migration - #79

Open
Han2-Ro wants to merge 16 commits into
mainfrom
payload-3-migration
Open

Han2-Ro wants to merge 16 commits into
mainfrom
payload-3-migration

Conversation

@Han2-Ro

@Han2-Ro Han2-Ro commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

- payload 2.23.1 -> 3.92.1, all @payloadcms packages synced at 3.92.1
- add next 16, react 19, sharp, graphql
- replace @payloadcms/plugin-cloud with @payloadcms/payload-cloud
- remove express, @payloadcms/bundler-webpack, @payloadcms/richtext-slate,
  nodemon, ts-node, copyfiles and @types/express
- add pnpm-workspace.yaml with allowBuilds (pnpm 12 no longer reads the
  pnpm field in package.json)
Payload 3 serves the admin panel and APIs through a Next.js app router
structure under src/app/(payload) instead of a custom express server.
Scaffolding follows the official blank template (create-payload-app).

- add next.config.ts with withPayload, standalone output for docker and
  the / -> /admin redirect (previously in server.ts)
- replace tsconfig with next-compatible settings
- gitignore next.js build artifacts
- import buildConfig and types from 'payload' instead of
  'payload/config' and 'payload/types'
- remove admin.bundler (admin is bundled by next.js now)
- move secret from payload.init() into the config
- default editor: lexical instead of the removed slate editor (the only
  richText field already used lexical, so no data migration needed)
- swap @payloadcms/plugin-cloud for @payloadcms/payload-cloud
- move seeding from server.ts onInit into config onInit
- port health endpoint to the web Response api
- media upload: drop removed staticURL and relative staticDir (v3
  defaults to ./media); files are now served at /api/media/file/*
- slug field: dynamic description function was removed in v3, replace
  with a custom Description client component
- import Payload as a type from 'payload'
- use proper lexical json instead of a plain string for the richText
  content field
- fix typo 'amdin' so the seeded admin user actually becomes admin
- fix all_collections_empty checking the events count twice instead of
  the users count
Payload 3 is served by next.js (next dev / next start), the custom
express server is no longer needed. The / -> /admin redirect moved to
next.config.ts, the payload secret and onInit hook moved to
payload.config.ts.
The multi-stage Dockerfile now builds with 'next build' and runs the
standalone server.js as a non-root user instead of the compiled express
server. Uploaded media now lives in /app/media (payload 3 default
staticDir), so the compose volume mount moved accordingly.
Payload 3 requires node ^22.23.4 or >=24.22.1.
In v3 date fields receive Date values and validate args are strictly
typed, loosen the validate signatures to match the project's
non-strict tsconfig.
__dirname no longer points at the real source files once the config is
bundled by next.js, so resolve the seed images from process.cwd()
instead and copy src/seed into the docker runtime image.
next 16 generates these on every dev run; committing keeps the tree
clean. Set agentRules: false in next.config.ts to disable.
Existing databases need this once after upgrading (pnpm payload
migrate): relationship ids are stored as ObjectId instead of strings
since payload 3 (see v3.0.0-beta.131 release notes).
The generated payload-types.ts and generated-schema.graphql were never
tracked before; ignore them like the other generated artifacts.
The mongodb adapter's prodMigrations option runs pending migrations
during the initial connection when NODE_ENV=production, which also
works inside the standalone docker image that has no payload CLI.
Development is unaffected (use 'pnpm payload migrate' manually there).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant