Payload CMS Release: 3.0.2

Tag Name: v3.0.2

Release Date: 11/20/2024

Payload CMS LogoPayload CMS

Payload CMS is a modern, self-hosted headless content management system built with TypeScript, Node.js, and MongoDB. It's designed specifically for developers who want full control over their content management system while maintaining a powerful admin interface for content editors.

TL;DR

Payload CMS v3.0.2 is a maintenance release focused on bug fixes across multiple areas of the platform. It addresses critical issues with relationships, PostgreSQL support, autosave functionality, UI permissions, and rich text editing. This release improves stability for developers using Payload with Next.js and PostgreSQL databases, while also enhancing the admin UI experience.

Highlight of the Release

    • Fixed self-referencing relationships when dynamically adding collections to config
    • Resolved PostgreSQL document ID type handling issues affecting related features
    • Fixed autosave document rendering in drawers to prevent multiple draft creation
    • Improved rich text editor performance by optimizing Lexical markdown dependencies
    • Enhanced UI permissions handling for group and named tab sub-fields
    • Fixed bulk operations to properly respect search queries

Migration Guide

No breaking changes were introduced in this release, so no migration is required. This is a drop-in replacement for v3.0.1 that fixes several bugs and improves performance.

If you were experiencing any of the specific issues addressed in this release (PostgreSQL document ID handling, autosave in drawers, self-referencing relationships, etc.), upgrading to v3.0.2 should resolve these problems without requiring any code changes.

Upgrade Recommendations

This release is recommended for all Payload CMS users, especially those:

  • Using PostgreSQL as their database
  • Working with autosave-enabled documents in drawers
  • Dynamically adding collections with self-referencing relationships
  • Experiencing issues with bulk operations not respecting search queries
  • Having problems with permissions in group and named tab fields

To upgrade, run:

npm install [email protected]
# or
yarn add [email protected]
# or
pnpm add [email protected]

This is a maintenance release with no breaking changes, so upgrading should be straightforward and low-risk.

Bug Fixes

Self-referencing Relationships

  • Fixed an issue that prevented adding collections to the config dynamically if they referenced their own collection in a relationship field
  • This was particularly important for the folder view feature which dynamically adds collections to the config

Next.js Integration

  • Fixed document ID type handling when using PostgreSQL, where IDs were being treated as strings instead of numbers in the admin panel
  • This resolved issues with features relying on the docID from context, such as join fields not properly populating initial data
  • Fixed autosave-enabled documents rendering within drawers, preventing multiple draft documents from being created upon opening

Rich Text Editor

  • Fixed an issue with @lexical/markdown imports that couldn't be reliably dynamically imported by Node.js
  • Implemented a custom copy of @lexical/markdown that does not install @lexical/code, reducing bundle size and improving compilation speed

UI Improvements

  • Fixed Actions not being re-rendered when router.refresh was called, as they were stored in state and persisting
  • Corrected invalid permissions being passed to group and named tab sub-fields, which caused fields to be either hidden or incorrectly set to readOnly
  • Fixed bulk update and delete operations that were ignoring search queries

New Features

No new features were added in this release as it focuses entirely on bug fixes and documentation improvements.

Security Updates

No specific security fixes were included in this release.

Performance Improvements

Rich Text Editor Performance

  • Improved performance of the rich text editor by using a custom copy of @lexical/markdown that does not install @lexical/code
  • This optimization reduces bundle size and improves compilation speed of the richtext-lexical component
  • Fixed an issue where Node.js would exit before dynamic imports were completed, improving overall stability

UI Rendering Optimizations

  • Enhanced the ActionsProvider to prioritize server-rendered Actions, improving the refresh behavior
  • Fixed permission handling for nested fields, reducing unnecessary re-renders and improving form performance

Impact Summary

Payload CMS v3.0.2 is a maintenance release that addresses several important bugs across the platform. The fixes span multiple areas including relationship handling, PostgreSQL support, autosave functionality, UI permissions, and rich text editing.

For developers, this release resolves critical issues with self-referencing relationships when dynamically adding collections, fixes PostgreSQL document ID type handling, and improves the stability of the rich text editor by optimizing dependencies.

Content editors will benefit from fixes to bulk operations, improved permissions handling for nested fields, and resolved issues with autosave creating multiple drafts when working with documents in drawers.

The documentation has also been enhanced with clearer explanations and fixed links for custom components in the admin UI.

Overall, this release improves stability and user experience without introducing breaking changes, making it a recommended upgrade for all Payload CMS users.

Full Release Notes

v3.0.2 (2024-11-20)

🐛 Bug Fixes

  • allow self referencing relationships when adding new collections to config (#9360) (4030e21)
  • next: properly sets doc id types when using postgres (#9381) (07a9125)
  • next: autosave document rendering (#9364) (9e85be0)
  • richtext-lexical: use copy of @lexical/markdown that does not install @lexical/code (#9382) (5db7e1e)
  • ui: prioritize server rendered Actions in ActionsProvider (#9379) (439dcd4)
  • ui: invalid permissions passed to group and named tab sub-fields (#9366) (c67291d)
  • ui: bulk update and delete ignoring search query (#9377) (ef37483)

🤝 Contributors

Statistics:

File Changed137
Line Additions4,650
Line Deletions498
Line Changes5,148
Total Commits12

User Affected:

  • Fixed issues with self-referencing relationships when dynamically adding collections to config
  • Resolved PostgreSQL document ID type handling that was causing issues with related features
  • Fixed autosave document rendering in drawers
  • Improved rich text editor performance by removing unnecessary dependencies

Contributors:

PatrikKozakcusackeJarrodMFleschjacobsfletchakhrarovsaiddenolfeAlessioGr