Releases: payloadcms/payload
v3.0.0-beta.135
v3.0.0-beta.135 (2024-11-19)
🚀 Features
⚡ Performance
🐛 Bug Fixes
- queues types with
strict: true
(#9281) (e40141b) - nav jumping around if no nav preferences are set (#9301) (0a6f530)
- sanitize sub block field permissions correctly (#9296) (5503afd)
- getPayload node exits on webpack-hmr websocket failure (#9279) (488c28c)
- db-mongodb: potential errors in
sanitizeRelationshipIDs
withref
being a non object (#9292) (665b353) - graphql: loading of polymorphic hasMany relationships (#9175) (0075b99)
- next: passes doc through edit view handler (#9302) (ec95ce8)
- next: passes locale through requests in live preview edit view (#9298) (54ac8b9)
- next: initialize payload with importMap (#9297) (58ac784)
- templates: remove req from seed script (ecbafbf)
- templates: seed from url (#9306) (333da1b)
- ui: safely accesses field in default filter component (#9276) (1a31e63)
⚠️ BREAKING CHANGES
-
removes unnecessary field styles from initial page response (#9286) (30947d2)
This only effects those who are importing Payload's field components
into your own Custom Components or front-end application. Thewidth
prop no longer exists. It has been consolidated into the existing
style
prop. To migrate, simply move this prop as follows:import { TextInput } from '@payloadcms/ui export const MyCustomComponent = () => { return ( <TextInput - width="60%" style={{ + width: "60%, }} /> ) }
🤝 Contributors
- Said Akhrarov (@akhrarovsaid)
- Dan Ribbens (@DanRibbens)
- Elliot DeNolf (@denolfe)
- Germán Jabloñski (@GermanJablo)
- James Mikrut (@jmikrut)
- Sophia Michelle Andren (@sandren)
- Jarrod Flesch (@JarrodMFlesch)
- Patrik (@PatrikKozak)
- Nate (@ncaminata)
- mattddean (@mattddean)
- Sasha (@r1tsuu)
- Jacob Fletcher (@jacobsfletch)
- Mikkel Wied Frederiksen (@mikkelwf)
- Alessio Gravili (@AlessioGr)
v3.0.0-beta.134
v3.0.0-beta.134 (2024-11-17)
🚀 Features
- support relationship writes using objects instead of IDs (#9253) (d21fca9)
- deprecates getPayloadHMR in favor of simpler getPayload (#9249) (31b32ef)
- richtext-lexical: allow replacing entire blocks with custom components (#9234) (63cc966)
⚡ Performance
- richtext-lexical: significantly reduce lexical rerendering and amount of network requests from blocks (#9255) (35917c6)
🐛 Bug Fixes
- proper casing for default root views (#9248) (ed21c1c)
- next: custom default root views (#9247) (c4269d2)
- ui: avoid calling
getTableState
from join field on create (#9256) (ef2475d)
⚠️ BREAKING CHANGES
-
proper casing for default root views (#9248) (ed21c1c)
Custom
account
anddashboard
views now defined as lowercase in the
config.import { buildConfig } from 'payload' const config = buildConfig({ // ... admin: { components: { // ... views: { // ... - Account: ... - Dashboard: ... + account: ... + dashboard: ... }, }, }, })
-
richtext-lexical: significantly reduce lexical rerendering and amount of network requests from blocks (#9255) (35917c6)
The field RSC now provides an initial state for all lexical blocks. This
completely obliterates any flashes and lexical block loading states when
loading or saving a document.This removes the
feature.hooks.load
andfeature.hooks.save
interfaces from custom lexical features, as they weren't used internally
and added unnecessary, additional overhead.If you have custom features that use those, you can migrate to using
normal payload hooks that run on the server instead of the client.
🤝 Contributors
- Sasha (@r1tsuu)
- Alessio Gravili (@AlessioGr)
- Jacob Fletcher (@jacobsfletch)
- Elliot DeNolf (@denolfe)
- James Mikrut (@jmikrut)
v3.0.0-beta.133
v3.0.0-beta.132
v3.0.0-beta.131
v3.0.0-beta.131 (2024-11-15)
🚀 Features
- sanitise access endpoint (#7335) (26ffbca)
- bumps
date-fns
to4.1.0
(#9221) (6845878) - re-order DefaultCellComponentProps generics (#9207) (77c99c2)
- db-mongodb: update mongoose to 8.8.1 (#9115) (7c6f419)
- db-mongodb: support query options in db update operations (#9191) (2d2d020)
- richtext-lexical: add tooltips to toolbar dropdown items (#9218) (7294880)
- richtext-lexical, ui: add icon if link opens in new tab (#9211) (82e72fa)
- storage-uploadthing: upgrade to v7 (#8346) (4690cd8)
⚡ Performance
- removes undefined props from rsc requests (#9195) (2d7626c)
- removes i18n.supportedLanguages from client config (#9209) (5482e7e)
🐛 Bug Fixes
- improve collection / global slugs type-safety in various places (#8311) (810c29b)
- duplicate list preferences stored (#9185) (a5cae07)
- wires up abort controller logic for list columns (#9180) (129fadf)
- ui: jumping hasmany uploads when form is submitting or in readonly mode (#9198) (315b4e5)
- ui: fixes layout shift when form is submitted (#9184) (e6d0443)
⚠️ BREAKING CHANGES
-
db-mongodb: update mongoose to 8.8.1 (#9115) (7c6f419)
MongoDB projects need to run a migration after updating to this beta version, because all relationship IDs are now stored as ObjectID (as they should have always been saved) and we need to migrate your existing relationship data from string-based IDs to ObjectIDs.
To create this migration, run:
pnpm payload migrate:create --file @payloadcms/db-mongodb/relationships-v2-v3
And then run your migrations using:
pnpm payload migrate
In addition, if your project is heavily relying on using the Mongoose models directly, you may want to review the upgrade guides from v6 to v7 and v7 to v8, making
adjustments as needed. -
improve collection / global slugs type-safety in various places (#8311) (810c29b)
Improves type-safety of collection / global slugs by using
CollectionSlug
/UploadCollectionSlug
andGlobalSlug
types instead ofstring
in these places:
AddsUploadCollectionSlug
andTypedUploadCollection
utility typesThis also changes how we suggest to add an upload collection to a cloud-storage adapter:
Before:azureStorage({ collections: { [Media.slug]: true, }, })
After:
azureStorage({ collections: { media: true, }, })
-
re-order DefaultCellComponentProps generics (#9207) (77c99c2)
Changes the order of the
DefaultCellComponentProps
generic type,
allowing us to infer the type of cellData when a ClientField type is
passed as the first generic argument. You can override the cellData type
by passing the second generic.Previously:
type DefaultCellComponentProps<TCellData = any, TField extends ClientField = ClientField>
New:
type DefaultCellComponentProps<TField extends ClientField = ClientField, TCellData = undefined>
You can override the cellData type by passing in the second argument
to the generic. ie if you know the shape of your data differs than the
inferred type then you can do something like:DefaultCellComponentProps<RelationshipFieldClient, { myShape: string, here: string }>
-
storage-uploadthing: upgrade to v7 (#8346) (4690cd8)
Upgrade uploadthing to v7
The
options
that can be passed to the plugin now mirror the
UTApiOptions
of v7.The most notable change is to pass
token
with
process.env.UPLOADTHING_TOKEN
instead ofapiKey
with
process.env.UPLOADTHING_SECRET
.options: { - apiKey: process.env.UPLOADTHING_SECRET, + token: process.env.UPLOADTHING_TOKEN, acl: 'public-read', },
v3.0.0-beta.130
v3.0.0-beta.130 (2024-11-13)
🚀 Features
- adds ability to define base filter for list view (#9177) (9da8543)
- customize log levels and downgrade common errors to info (#9156) (d628222)
- next: initializes nav group prefs on the server and consolidates records (#9145) (f6bdc0a)
- templates: update config structure in website template to be more clear (#9161) (5ac4e73)
🐛 Bug Fixes
- add inline <style> to ensure the order of declared css layers as much as possible (#9123) (cd95daf)
- fallbackLocale not respecting default settings, locale specific fallbacks and not respecting 'none' or false (#8591) (f4d526d)
- expose server and client props to custom list slot components (#9159) (a8e3095)
- db-postgres: create relationship-v2-v3 migration (#9178) (5b9cee6)
- next: safely check for
state
when creating first user (#9168) (3b55458)
🤝 Contributors
- Sasha (@r1tsuu)
- Jarrod Flesch (@JarrodMFlesch)
- Paul (@paulpopus)
- James Mikrut (@jmikrut)
- Patrik (@PatrikKozak)
- Dan Ribbens (@DanRibbens)
- Elliot DeNolf (@denolfe)
- Jacob Fletcher (@jacobsfletch)
v3.0.0-beta.129
v3.0.0-beta.129 (2024-11-12)
🐛 Bug Fixes
- richtext-lexical: inline blocks drawer not rendering any fields due to incorrect schemapath suffix (#9158) (a1c99c8)
🤝 Contributors
- Patrik (@PatrikKozak)
- Alessio Gravili (@AlessioGr)
v3.0.0-beta.128
v3.0.0-beta.128 (2024-11-12)
This is a significant release which overhauls the way that we render, and provide, custom React components to the Payload Admin UI. Now, custom server components receive contextual props, like data
and value
, so you can do considerably more with them on the server.
It also ships with a variety of performance improvements to the server-side rendering done for the admin panel.
There are a few relatively simple breaking changes outlined below.
🚀 Features
- adds option to mongoose to ensure indexes (#9155) (6bb4067)
- on demand rsc (#8364) (c96fa61)
- db-postgres: deep querying on json and rich text fields (#9102) (b878daf)
- docs: add example for customising the filename of an upload via hooks (#9124) (d839138)
- richtext-lexical: add
useAsTitle
to the popup links label (#8718) (23907e4) - richtext-lexical: backport relevant from lexical playground between 0.18.0 and 0.20.0 (#9129) (a30eeaf)
- richtext-lexical: upgrade lexical from 0.18.0 to 0.20.0 (#9126) (7767c94)
- templates: add with-vercel-website (#9144) (def595e)
⚡ Performance
- upgrade pino-pretty. This reduces bundle size and total amount of dependencies from 94 => 85 (#9127) (7261faa)
🐛 Bug Fixes
- allow specifying queue (#9151) (e0309a1)
- incorrectly looking for schema paths when upload is not enabled (#9146) (a3ebf51)
- empty publish dropdown when localization is false (#9106) (3e954f4)
- custom id field not shown depending on field and db types (#9091) (9a970d2)
- update README with new asset, image URL (#9099) (d7fc944)
- cpa: use proper branch tag (#9141) (7cd805a)
- db-mongodb: use dbName for mongodb model (#9107) (09c41d5)
- db-mongodb: destructuring error when trying to filter date fields by string query (#9116) (6899a3c)
- next: disable turbopack serverExternalPackages warnings (#9147) (64967e4)
- next, ui: respect access of
user
for document locking (#9139) (48d0fae) - ui: pass correct
relationTo
to locked documents creation (#9137) (3298113) - ui: error in filtered relationship field component while scrolling, if the select option label is a number (#9117) (2ad9917)
⚠️ BREAKING CHANGES
-
on-demand rsc (#8364) (c96fa61)
-
Add the following to your root layout file, typically located at
(app)/(payload)/layout.tsx
:/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ + import type { ServerFunctionClient } from 'payload' import config from '@payload-config' - import { RootLayout } from '@payloadcms/next/layouts' + import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts' import React from 'react' import { importMap } from './admin/importMap.js' import './custom.scss' type Args = { children: React.ReactNode } + const serverFunction: ServerFunctionClient = async function (args) { + 'use server' + return handleServerFunctions({ + ...args, + config, + importMap, + }) + } const Layout = ({ children }: Args) => ( <RootLayout config={config} importMap={importMap} + serverFunction={serverFunction} > {children} </RootLayout> ) export default Layout
-
If you were previously posting to the
/api/form-state
endpoint, it
no longer exists. Instead, you'll need to invoke theform-state
Server
Function, which can be done through the newgetFormState
utility:- import { getFormState } from '@payloadcms/ui' - const { state } = await getFormState({ - apiRoute: '', - body: { - // ... - }, - serverURL: '' - }) + const { getFormState } = useServerFunctions() + + const { state } = await getFormState({ + // ... + })
-
Multiple layer of React Context were removed in favor of direct props. As a result, the following React hooks were removed:
- useFieldProps() - useTableCell()
If you were previously using any of these hooks, for example to access field
path
orcellData
, you can now access that directly from theprops
object.- const { path } = useFieldProps(); + const { path } = props; - const { cellData } = useTableCell(); + const { cellData } = props;
The
field
prop also no longer contains a_schemaPath
property. Instead, this is now also accessed directly through props:- const { _schemaPath } = props.field + const { schemaPath } = props
-
-
db-mongodb: use dbName for mongodb model (#9107) (09c41d5)
If a
dbName
was previously provided, it will now be used as the
MongoDB collection name instead of the collectionslug
.
autoPluralization
will not be applied todbName
. -
richtext-lexical: upgrade lexical from 0.18.0 to 0.20.0 (#9126) (7767c94)
This upgrades our lexical dependencies from 0.18.0 to 0.20.0. If you
have lexical dependencies installed in your project, you will have to
upgrade those.Additionally, the lexical team may introduce breaking changes in this
upgrade. If you use lexical APIs directly, please consult their
changelog for more information:
https://github.com/facebook/lexical/releases
🤝 Contributors
- Sasha (@r1tsuu)
- James Mikrut (@jmikrut)
- Jarrod Flesch (@JarrodMFlesch)
- Elliot DeNolf (@denolfe)
- Tobias Odendahl (@tak-amboss)
- Nate (@ncaminata)
- Patrik (@PatrikKozak)
- Alessio Gravili (@AlessioGr)
- Germán Jabloñski (@GermanJablo)
- Jacob Fletcher (@jacobsfletch)
- Paul (@paulpopus)
- Jessica Chowdhury (@JessChowdhury)
v3.0.0-beta.127
v3.0.0-beta.127 (2024-11-11)
🚀 Features
- db-postgres: add point field support (#9078) (0a15388)
- templates: add adminThumbnail to media in website template (#9059) (015580a)
⚡ Performance
🐛 Bug Fixes
- migrateRefresh migrates without previously ran migrations (#9073) (e3172f1)
- handle custom id logic in mongodb adapter (#9069) (ee117bb)
- incorrect form changed state after doc drawer edit (#9025) (dc11104)
- login redirect missing route (#8990) (010ac2a)
populate
with find operation (#9087) (721ae79)- corrected translation emailOrPasswordIncorrect for Danish (da) (#9063) (57e535e)
- db-mongodb:
totalDocs
with joins (#9056) (f67761f) - db-mongodb: write migrations index file (#9071) (d20445b)
- docs: auth page email broken link (#9089) (1584c41)
- templates: use direct blocks props instead of drilling them out of pages (#9074) (b32c4de)
- templates: fix website template's missing paragraph feature allowing you to change text from headings (#9072) (1d5d303)
- translations: improves Bulgarian translations (#9031) (a6e7305)
⚠️ BREAKING CHANGES
-
handle custom id logic in mongodb adapter (#9069) (ee117bb)
When using custom ID fields, if you have any collection hooks for
beforeValidate, beforeChange thendata._id
will no longer be assigned
as this happens now in the database adapter. Usedata.id
instead.
🤝 Contributors
- Sasha (@r1tsuu)
- Ruy Monteiro (@ruymon)
- Nathan Clevenger (@nathanclevenger)
- Dan Ribbens (@DanRibbens)
- Jessica Chowdhury (@JessChowdhury)
- Kendell Joseph (@kendelljoseph)
- Paul (@paulpopus)
- Steve (@steventsvetkov)
- Alessio Gravili (@AlessioGr)
- Elliot DeNolf (@denolfe)
- Mikkel Madsen (@miguel2650)
- Tylan Davis (@tylandavis)
- Patrik (@PatrikKozak)
v2.30.4
2.30.4 (2024-11-11)
Features
Bug Fixes
- db-postgres: sort by localized fields (#9016) (9c25754)
- edit many modal draft action button order and style (#9046) (a907480), closes #9045
- error saving after duplicating blocks with nested items (#8814) (eba777c)
- list drawer relationship not displaying (#9011) (169da5c)
- querying relationships by
id
path with REST (#9014) (a0bd706)