v3.0.0-beta.128
Version v3.0.0-beta.128Major ReleasePre-release
Release Notes
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
useAsTitleto 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
userfor document locking (#9139) (48d0fae) - ui: pass correct
relationToto 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
- Add the following to your root layout file, typically located at
(app)/(payload)/layout.tsx:
```diff
/* 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
```
- import type { ServerFunctionClient } from 'payload'
- If you were previously posting to the
/api/form-stateendpoint, it
no longer exists. Instead, you'll need to invoke theform-stateServer
Function, which can be done through the newgetFormStateutility:
```diff
- 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:
```diff
- useFieldProps()
- useTableCell()
```
If you were previously using any of these hooks, for example to access fieldpathorcellData, you can now access that directly from thepropsobject.
```diff - const { path } = useFieldProps();
- const { path } = props;
- const { cellData } = useTableCell();
- const { cellData } = props;
```
Thefieldprop also no longer contains a_schemaPathproperty. Instead, this is now also accessed directly through props:
```diff - const { _schemaPath } = props.field
- const { schemaPath } = props
```
- db-mongodb: use dbName for mongodb model (#9107) (09c41d5)
If adbNamewas previously provided, it will now be used as the
MongoDB collection name instead of the collectionslug.
autoPluralizationwill 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)