Home

>

Tools

>

Payload CMS

>

Releases

>

3.0.0-beta.53

Payload CMS Release: 3.0.0-beta.53

Pre Release

Tag Name: v3.0.0-beta.53

Release Date: 6/19/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

PayloadCMS v3.0.0-beta.53 introduces a breaking change by renaming @payloadcms/ui/client to @payloadcms/ui to improve IDE auto-completions. It also enhances rich text functionality by making request objects available to HTML converters and using data loaders for better performance. Several bug fixes address issues with unflattening JSON objects, empty string default values in text fields, and UI imports across plugins.

Highlight of the Release

    • Breaking change: @payloadcms/ui/client exports renamed to @payloadcms/ui
    • Rich text improvements with request object availability to HTML converters
    • Performance optimization using data loaders for upload node population
    • Fixed issue with unflattening JSON objects containing keys with periods
    • Added support for empty strings as default values in text-like fields

Migration Guide

Migrating from @payloadcms/ui/client to @payloadcms/ui

To migrate from the previous version, you'll need to update all imports that use @payloadcms/ui/client to use @payloadcms/ui instead.

You can do this with a simple find and replace across your entire project:

  1. Find: @payloadcms/ui/client
  2. Replace with: @payloadcms/ui

This change affects all UI component imports from the PayloadCMS UI package.

Upgrade Recommendations

This release contains a breaking change related to UI imports, but the migration is straightforward.

Recommended for:

  • Developers who want to benefit from improved IDE auto-completions
  • Projects that need the bug fixes for text field default values and JSON unflattening
  • Applications that would benefit from the performance improvements in rich text handling

When to upgrade:

  • If you're already using the beta version, upgrading is recommended as the breaking change is minimal and easy to implement
  • Plan for a small amount of time to update your imports from @payloadcms/ui/client to @payloadcms/ui
  • Test your application thoroughly after upgrading, especially if you rely heavily on rich text fields with uploads

Bug Fixes

Fixed JSON Unflattening with Period-Containing Keys

Fixed an issue where the unflatten function would incorrectly process JSON objects when they contained keys with periods (.). This ensures proper handling of complex object structures with special characters in key names.

Support for Empty String Default Values

Resolved a bug that prevented using empty strings ('') as default values for text-like fields including:

  • Text fields
  • Textarea fields
  • Email fields
  • Code fields

This improvement allows developers to ensure values are always strings instead of null/undefined when needed.

UI Import Fixes

Fixed UI imports across all plugins and removed UI subpath exports within the monorepo, ensuring consistent import patterns throughout the codebase.

New Features

Renamed UI Package Path for Better Developer Experience

The path to UI components has been renamed from @payloadcms/ui/client to simply @payloadcms/ui. This change significantly improves import auto-completions in IDEs like WebStorm that don't fully support package.json exports.

Enhanced Rich Text Functionality

The rich text Lexical editor now makes the request object (req) available to HTML converters. Additionally, it now uses req.dataLoader instead of payload.findByID for upload node population, which improves performance and efficiency when converting rich text content that contains uploads.

Performance Improvements

Rich Text Performance Optimization

The rich text Lexical editor now uses req.dataLoader instead of payload.findByID for upload node population. This change leverages data loaders to batch and cache database queries, resulting in more efficient data fetching when converting rich text content that contains multiple uploads or references.

Impact Summary

This release introduces a breaking change by renaming the UI package path, but provides a straightforward migration path. The change significantly improves developer experience with better IDE auto-completions.

Performance improvements in rich text handling will benefit both developers and content editors, especially for content with multiple uploads or references. The bug fixes address important issues with JSON handling and default values in text fields.

The package structure has been simplified and refactored, particularly in the richtext-lexical package, making the codebase more maintainable and easier to work with.

Overall, this beta release continues to refine the v3 experience with quality-of-life improvements for developers while maintaining stability for existing functionality.

Full Release Notes

v3.0.0-beta.53 (2024-06-19)

Features

  • richtext-lexical: make req available to html converters, use req.dataLoader instead of payload.findByID for upload node population (#6858) (285835f)
  • rename @payloadcms/ui/client to @payloadcms/ui, and other auto-suggestion & exports improvements (#6848) (bc98567)

Bug Fixes

  • fix all ui imports in our plugins, and get rid of ui subpath exports within monorepo (#6854) (aef2a52)
  • cannot use empty strings defaultValue in text-like fields (#6847) (317bc07)
  • ui: unflattening json objects containing keys with periods (#6839) (3ddc2a0)

BREAKING CHANGES

  • rename @payloadcms/ui/client to @payloadcms/ui, and other auto-suggestion & exports improvements (#6848) (bc98567)

BREAKING: All @payloadcms/ui/client exports have been renamed to
@payloadcms/ui. A simple find & replace across your entire project
will be enough to migrate. This change greatly improves import
auto-completions in IDEs which lack proper support for package.json
exports, like Webstorm.

Contributors

Statistics:

File Changed300
Line Additions590
Line Deletions505
Line Changes1,095
Total Commits8

User Affected:

  • Need to update imports from `@payloadcms/ui/client` to `@payloadcms/ui`
  • Can now use empty strings as default values in text-like fields
  • Will benefit from improved IDE auto-completions for imports
  • Will experience better performance with rich text HTML conversion

Contributors:

PatrikKozakdenolfeDanRibbensAlessioGr