github payloadcms/payload v2.5.0
Release v2.5.0

latest releases: v3.0.0-beta.108, v3.0.0-beta.107, v3.0.0-beta.106...
9 months ago

2.5.0 (2023-12-19)

Features

  • add Chinese Traditional translation (#4372) (50253f6)
  • add context to auth and globals local API (#4449) (168d629)
  • adds new actions property to admin customization (#4468) (9e8f14a)
  • async live preview urls (#4339) (5f17324)
  • pass path to FieldDescription (#4364) (3b8a27d)
  • plugin-form-builder: Lexical support (#4487) (c6c5cab)
  • prevent querying relationship when filterOptions returns false (#4392) (c1bd338)
  • richtext-lexical: improve floating select menu Dropdown classNames (#4444) (9331204)
  • richtext-lexical: improve link URL validation (#4442) (9babf68)
  • richtext-lexical: lazy import React components to prevent client-only code from leaking into the server (#4290) (5de347f)
  • richtext-lexical: Link & Relationship Feature: field-level configurable allowed relationships (#4182) (7af8f29)
  • richtext-lexical: link node: change doc data format to be consistent with relationship field (#4504) (cc0ba89)
  • richtext-lexical: rename TreeviewFeature into TreeViewFeature (#4520) (c49fd66)
  • richtext-lexical: Slate to Lexical converter: add blockquote conversion, convert custom link fields (#4486) (31f8f3c)
  • richtext-lexical: Upload html serializer: Output picture element if the image has multiple sizes, improve absolute URL creation (e558894)

Bug Fixes

  • adds bg color for year/month select options in datepicker (#4508) (07371b9)
  • correctly fetches externally stored files when passing uploadEdits (#4505) (228d45c)
  • cursor jumping around inside json field (#4453) (6300037)
  • db-mongodb: documentDB unique constraint throws incorrect error (#4513) (05e8914)
  • db-postgres: findOne correctly querying with where queries (#4550) (8bc31cd)
  • db-postgres: querying nested blocks fields (#4404) (6e9ae65)
  • db-postgres: sorting on a not-configured field throws error (#4382) (dbaecda)
  • defaultValues computed on new globals (#4380) (b6cffce)
  • disallow duplicate fieldNames to be used on the same level in the config (#4381) (a1d66b8)
  • ensure ui fields do not make it into gql schemas (#4457) (3a20ddc)
  • format fields within tab for list controls (#4516) (2650c70)
  • formats locales with multiple labels for versions locale selector (#4495) (8257661)
  • graphql schema generation for fields without queryable subfields (#4463) (13e3e06)
  • handles null upload field values (#4397) (cf9a370)
  • live-preview: populates rte uploads and relationships (#4379) (4090aeb)
  • live-preview: sends raw js objects through window.postMessage instead of json (#4354) (03a3872)
  • make admin navigation transition smoother (#4217) (eb6572e)
  • omit field default value if read access returns false (#4518) (3e9ef84)
  • pin ts-node versions which are causing swc errors (#4447) (b9c0248)
  • properly spreads collection fields into non-tabbed configs #50 (#51) (7e88159)
  • plugin-form-builder: removes use of slate in rich-text serializer (#4451) (3df52a8)
  • plugin-nested-docs: properly exports field utilities (#4462) (1cc87bd)
  • richtext-*: loosen RichTextAdapter types due to re-occuring ts strict mode errors (#4416) (48f1299)
  • richtext-lexical: Blocks field: should not prompt for unsaved changes due to value comparison between null and non-existent props (#4450) (548e78c)
  • richtext-lexical: do not add unnecessary paragraph before upload, relationship and blocks nodes (#4441) (5c2739e)
  • richtext-lexical: lexicalHTML field not working when used inside of Blocks field (128f9c4)
  • richtext-lexical: lexicalHTML field now works when used inside of row fields (#4440) (0421173)
  • richtext-lexical: not all types of URLs are validated correctly (ac7f980)
  • searching by id sends undefined in where query param (#4464) (46e8c01)
  • simplifies query validation and fixes nested relationship fields (#4391) (4b5453e)
  • updates return value of empty arrays in getDataByPath (#4553) (f3748a1)
  • upload editing error with plugin-cloud (#4170) (fcbe574)
  • upload related issues, cropping, fetching local file, external preview image (#4461) (45c472d)
  • uploads files after validation (#4218) (65adfd2)

⚠ BREAKING CHANGES: @payloadcms/richtext-lexical

  • richtext-lexical: rename TreeviewFeature into TreeViewFeature (#4520)

If you import TreeviewFeature, you have to rename the import to use TreeViewFeature (capitalized "V")

  • richtext-lexical: link node: change doc data format to be consistent with relationship field (#4504)

An unpopulated, internal link node no longer saves the doc id under fields.doc.value.id. Now, it saves it under fields.doc.value.
Migration inside of payload is automatic. If you are reading from the link node inside of your frontend though, you will have to adjust it.

  • richtext-lexical: improve floating select menu Dropdown classNames (#4444)

Dropdown component has a new mandatory sectionKey prop

  • richtext-lexical: lazy import React components to prevent client-only code from leaking into the server (#4290)
  1. 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.

  2. @payloadcms/richtext-slate is not affected by this.

  3. 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:

import { BlockIcon } from '../../lexical/ui/icons/Block'
...
Icon: BlockIcon,

New:

// 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:

// import BlockIcon from '../../lexical/ui/icons/Block' // <= Remove this import
...
Icon: () =>
  // @ts-expect-error
  import('../../lexical/ui/icons/Block'),
  1. 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.

  2. 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.

Don't miss a new payload release

NewReleases is sending notifications on new releases.