payloadcms/payload (payload)
### [`v2.4.0`](https://togithub.com/payloadcms/payload/blob/HEAD/CHANGELOG.md#240-2023-12-06)
[Compare Source](https://togithub.com/payloadcms/payload/compare/v2.3.1...v2.4.0)
##### Features
- add Chinese Traditional translation ([#4372](https://togithub.com/payloadcms/payload/issues/4372)) ([50253f6](https://togithub.com/payloadcms/payload/commit/50253f617c22d0d185bbac7f9d4304cddbc01f06))
- async live preview urls ([#4339](https://togithub.com/payloadcms/payload/issues/4339)) ([5f17324](https://togithub.com/payloadcms/payload/commit/5f173241df6dc316d498767b1c81718e9c2b9a51))
- pass path to FieldDescription ([#4364](https://togithub.com/payloadcms/payload/issues/4364)) ([3b8a27d](https://togithub.com/payloadcms/payload/commit/3b8a27d199b3969cbca6ca750450798cb70f21e8))
- **richtext-lexical:** lazy import React components to prevent client-only code from leaking into the server ([#4290](https://togithub.com/payloadcms/payload/issues/4290)) ([5de347f](https://togithub.com/payloadcms/payload/commit/5de347ffffca3bf38315d3d87d2ccc5c28cd2723))
- **richtext-lexical:** Link & Relationship Feature: field-level configurable allowed relationships ([#4182](https://togithub.com/payloadcms/payload/issues/4182)) ([7af8f29](https://togithub.com/payloadcms/payload/commit/7af8f29b4a8dddf389356e4db142f8d434cdc964))
##### Bug Fixes
- **db-postgres:** sorting on a not-configured field throws error ([#4382](https://togithub.com/payloadcms/payload/issues/4382)) ([dbaecda](https://togithub.com/payloadcms/payload/commit/dbaecda0e92fcb0fa67b4c5ac085e025f02de53a))
- defaultValues computed on new globals ([#4380](https://togithub.com/payloadcms/payload/issues/4380)) ([b6cffce](https://togithub.com/payloadcms/payload/commit/b6cffcea07b9fa21698b00b8bbed6f27197ded41))
- handles null upload field values ([#4397](https://togithub.com/payloadcms/payload/issues/4397)) ([cf9a370](https://togithub.com/payloadcms/payload/commit/cf9a3704df21ce8b32feb0680793cba804cd66f7))
- **live-preview:** populates rte uploads and relationships ([#4379](https://togithub.com/payloadcms/payload/issues/4379)) ([4090aeb](https://togithub.com/payloadcms/payload/commit/4090aebb0e94e776258f0c1c761044a4744a1857))
- **live-preview:** sends raw js objects through window.postMessage instead of json ([#4354](https://togithub.com/payloadcms/payload/issues/4354)) ([03a3872](https://togithub.com/payloadcms/payload/commit/03a387233d1b8876a2fcaa5f3b3fd5ed512c0bc4))
- simplifies query validation and fixes nested relationship fields ([#4391](https://togithub.com/payloadcms/payload/issues/4391)) ([4b5453e](https://togithub.com/payloadcms/payload/commit/4b5453e8e5484f7afcadbf5bccf8369b552969c6))
- upload editing error with plugin-cloud ([#4170](https://togithub.com/payloadcms/payload/issues/4170)) ([fcbe574](https://togithub.com/payloadcms/payload/commit/fcbe5744d945dc43642cdaa2007ddc252ecafafa))
- uploads files after validation ([#4218](https://togithub.com/payloadcms/payload/issues/4218)) ([65adfd2](https://togithub.com/payloadcms/payload/commit/65adfd21ed538b79628dc4f8ce9e1a5a1bba6aed))
##### β BREAKING CHANGES
- **richtext-lexical:** lazy import React components to prevent client-only code from leaking into the server ([#4290](https://togithub.com/payloadcms/payload/issues/4290))
##### β οΈ [@payloadcms/richtext-lexical](https://togithub.com/payloadcms/richtext-lexical)
Most important: If you are updating `@payloadcms/richtext-lexical` to v0.4.0 or higher, you will HAVE to update `payload` to the latest version as well. If you don't update it, payload likely won't start up due to validation errors. It's generally good practice to upgrade packages prefixed with `@payloadcms/` together with `payload` and keep the versions in sync.
`@payloadcms/richtext-slate` is not affected by this.
Every single property in the `Feature` interface which accepts a React component now no longer accepts a React component, but a function which imports a React component instead. This is done to ensure no unnecessary client-only code is leaked to the server when importing Features on a server.
Here's an example migration:
Old:
```ts
import { BlockIcon } from '../../lexical/ui/icons/Block'
...
Icon: BlockIcon,
```
New:
```ts
// import { BlockIcon } from '../../lexical/ui/icons/Block' // <= Remove this import
...
Icon: () =>
// @ts-expect-error
import('../../lexical/ui/icons/Block').then((module) => module.BlockIcon),
```
Or alternatively, if you're using default exports instead of named exports:
```ts
// import BlockIcon from '../../lexical/ui/icons/Block' // <= Remove this import
...
Icon: () =>
// @ts-expect-error
import('../../lexical/ui/icons/Block'),
```
The types for `SanitizedEditorConfig` and `EditorConfig` have changed. Their respective `lexical` property no longer expects the `LexicalEditorConfig`. It now expects a function returning the `LexicalEditorConfig`. You will have to adjust this if you adjusted that property anywhere, e.g. when initializing the lexical field editor property, or when initializing a new headless editor.
The following exports are now exported from the `@payloadcms/richtext-lexical/components` subpath exports instead of `@payloadcms/richtext-lexical`:
- ToolbarButton
- ToolbarDropdown
- RichTextCell
- RichTextField
- defaultEditorLexicalConfig
You will have to adjust your imports, only if you import any of those properties in your project.
Configuration
π Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Enabled.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
2.3.1
->2.4.0
Release Notes
payloadcms/payload (payload)
### [`v2.4.0`](https://togithub.com/payloadcms/payload/blob/HEAD/CHANGELOG.md#240-2023-12-06) [Compare Source](https://togithub.com/payloadcms/payload/compare/v2.3.1...v2.4.0) ##### Features - add Chinese Traditional translation ([#4372](https://togithub.com/payloadcms/payload/issues/4372)) ([50253f6](https://togithub.com/payloadcms/payload/commit/50253f617c22d0d185bbac7f9d4304cddbc01f06)) - async live preview urls ([#4339](https://togithub.com/payloadcms/payload/issues/4339)) ([5f17324](https://togithub.com/payloadcms/payload/commit/5f173241df6dc316d498767b1c81718e9c2b9a51)) - pass path to FieldDescription ([#4364](https://togithub.com/payloadcms/payload/issues/4364)) ([3b8a27d](https://togithub.com/payloadcms/payload/commit/3b8a27d199b3969cbca6ca750450798cb70f21e8)) - **richtext-lexical:** lazy import React components to prevent client-only code from leaking into the server ([#4290](https://togithub.com/payloadcms/payload/issues/4290)) ([5de347f](https://togithub.com/payloadcms/payload/commit/5de347ffffca3bf38315d3d87d2ccc5c28cd2723)) - **richtext-lexical:** Link & Relationship Feature: field-level configurable allowed relationships ([#4182](https://togithub.com/payloadcms/payload/issues/4182)) ([7af8f29](https://togithub.com/payloadcms/payload/commit/7af8f29b4a8dddf389356e4db142f8d434cdc964)) ##### Bug Fixes - **db-postgres:** sorting on a not-configured field throws error ([#4382](https://togithub.com/payloadcms/payload/issues/4382)) ([dbaecda](https://togithub.com/payloadcms/payload/commit/dbaecda0e92fcb0fa67b4c5ac085e025f02de53a)) - defaultValues computed on new globals ([#4380](https://togithub.com/payloadcms/payload/issues/4380)) ([b6cffce](https://togithub.com/payloadcms/payload/commit/b6cffcea07b9fa21698b00b8bbed6f27197ded41)) - handles null upload field values ([#4397](https://togithub.com/payloadcms/payload/issues/4397)) ([cf9a370](https://togithub.com/payloadcms/payload/commit/cf9a3704df21ce8b32feb0680793cba804cd66f7)) - **live-preview:** populates rte uploads and relationships ([#4379](https://togithub.com/payloadcms/payload/issues/4379)) ([4090aeb](https://togithub.com/payloadcms/payload/commit/4090aebb0e94e776258f0c1c761044a4744a1857)) - **live-preview:** sends raw js objects through window.postMessage instead of json ([#4354](https://togithub.com/payloadcms/payload/issues/4354)) ([03a3872](https://togithub.com/payloadcms/payload/commit/03a387233d1b8876a2fcaa5f3b3fd5ed512c0bc4)) - simplifies query validation and fixes nested relationship fields ([#4391](https://togithub.com/payloadcms/payload/issues/4391)) ([4b5453e](https://togithub.com/payloadcms/payload/commit/4b5453e8e5484f7afcadbf5bccf8369b552969c6)) - upload editing error with plugin-cloud ([#4170](https://togithub.com/payloadcms/payload/issues/4170)) ([fcbe574](https://togithub.com/payloadcms/payload/commit/fcbe5744d945dc43642cdaa2007ddc252ecafafa)) - uploads files after validation ([#4218](https://togithub.com/payloadcms/payload/issues/4218)) ([65adfd2](https://togithub.com/payloadcms/payload/commit/65adfd21ed538b79628dc4f8ce9e1a5a1bba6aed)) ##### β BREAKING CHANGES - **richtext-lexical:** lazy import React components to prevent client-only code from leaking into the server ([#4290](https://togithub.com/payloadcms/payload/issues/4290)) ##### β οΈ [@payloadcms/richtext-lexical](https://togithub.com/payloadcms/richtext-lexical) Most important: If you are updating `@payloadcms/richtext-lexical` to v0.4.0 or higher, you will HAVE to update `payload` to the latest version as well. If you don't update it, payload likely won't start up due to validation errors. It's generally good practice to upgrade packages prefixed with `@payloadcms/` together with `payload` and keep the versions in sync. `@payloadcms/richtext-slate` is not affected by this. Every single property in the `Feature` interface which accepts a React component now no longer accepts a React component, but a function which imports a React component instead. This is done to ensure no unnecessary client-only code is leaked to the server when importing Features on a server. Here's an example migration: Old: ```ts import { BlockIcon } from '../../lexical/ui/icons/Block' ... Icon: BlockIcon, ``` New: ```ts // import { BlockIcon } from '../../lexical/ui/icons/Block' // <= Remove this import ... Icon: () => // @ts-expect-error import('../../lexical/ui/icons/Block').then((module) => module.BlockIcon), ``` Or alternatively, if you're using default exports instead of named exports: ```ts // import BlockIcon from '../../lexical/ui/icons/Block' // <= Remove this import ... Icon: () => // @ts-expect-error import('../../lexical/ui/icons/Block'), ``` The types for `SanitizedEditorConfig` and `EditorConfig` have changed. Their respective `lexical` property no longer expects the `LexicalEditorConfig`. It now expects a function returning the `LexicalEditorConfig`. You will have to adjust this if you adjusted that property anywhere, e.g. when initializing the lexical field editor property, or when initializing a new headless editor. The following exports are now exported from the `@payloadcms/richtext-lexical/components` subpath exports instead of `@payloadcms/richtext-lexical`: - ToolbarButton - ToolbarDropdown - RichTextCell - RichTextField - defaultEditorLexicalConfig You will have to adjust your imports, only if you import any of those properties in your project.Configuration
π Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Enabled.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.