TL;DR
Payload CMS v0.5.0 Release
What's new: This release introduces API improvements for global operations, better handling of nested arrays, consistent readOnly behavior, and enhanced rich text editing with cursor position preservation.
Why it matters: These changes improve developer experience with more intuitive APIs and fix several critical bugs related to data persistence and validation, making the CMS more reliable.
Who should care: Payload CMS developers working with global collections, nested arrays, rich text fields with relationships, and those who need consistent validation behavior across the admin interface.
Highlight of the Release
- Changed global operations API to use
slug instead of global as the key identifier
- Fixed critical bug with nested arrays not persisting row count when moved
- Added cursor position preservation when adding relationship elements to rich text fields
- Improved readOnly field behavior consistency across create and update operations
- Added support for absolute URLs in adminThumbnail configuration
Migration Guide
for v0.5.0
Global API Changes
If you're using Payload's Local API to interact with globals, you'll need to update your code:
Before:
// Finding a global
payload.findGlobal({ global: 'globalSlug' });
// Updating a global
payload.updateGlobal({ global: 'globalSlug', data: { ... } });
After:
// Finding a global
payload.findGlobal({ slug: 'globalSlug' });
// Updating a global
payload.updateGlobal({ slug: 'globalSlug', data: { ... } });
This change makes the API more consistent with how globals are referenced elsewhere in Payload.
Upgrade Recommendations
This release contains important bug fixes and API improvements that enhance the stability and usability of Payload CMS.
Recommendation: All users should upgrade to v0.5.0, especially if you:
- Work with nested arrays
- Use global collections
- Implement rich text fields with relationships
- Configure admin thumbnails with absolute URLs
The API change for global operations requires code updates, but the migration is straightforward and will result in more consistent code.
Bug Fixes
-
Nested Arrays: Fixed an issue where moving nested arrays wasn't properly persisting row count, ensuring data integrity when rearranging complex nested structures.
-
Array Field Data: Resolved issues with handling empty indices within array field data, preventing potential data loss or corruption.
-
Admin Validation: Improved validation consistency within the admin interface, providing more reliable feedback to users.
-
Admin Thumbnails: Fixed support for absolute URLs within adminThumbnail configuration, allowing for more flexible image sourcing options.
New Features
API Improvements
-
Global Operations API Change: The Payload API for global find and update operations now uses slug instead of global as the key to find/update with, creating a more consistent developer experience.
-
Rich Text Editor Enhancement: When adding relationship elements to rich text fields, the cursor position is now saved, improving the editing experience.
-
ReadOnly Field Consistency: The readOnly property is now applied consistently within create and update operations, providing more predictable behavior across the admin interface.
Security Updates
No security fixes were mentioned in this release.
Performance Improvements
No specific performance improvements were highlighted in this release. The changes were primarily focused on feature enhancements, API improvements, and bug fixes.
Impact Summary
Payload CMS v0.5.0 brings significant improvements to the developer and content editor experience through API refinements and bug fixes. The most notable change is the global operations API update, which now uses slug instead of global as the key identifier, creating a more consistent pattern across the system.
For content editors, the release addresses several pain points: nested arrays now maintain their row count when moved, rich text editing preserves cursor position when adding relationships, and validation is more consistent throughout the admin interface.
Developers will appreciate the more predictable behavior of readOnly fields and the ability to use absolute URLs in adminThumbnail configurations. While these changes may require small code updates, they contribute to a more robust and intuitive CMS.
Overall, this release focuses on quality-of-life improvements and bug fixes that enhance the reliability of Payload CMS without introducing major architectural changes.
Full Release Notes
0.5.0 (2021-03-29)
Bug Fixes
- allows absolute urls within adminThumbnail (51b46d4)
- handles empty indices within array field data (c4a66c2)
- handles empty indices within array field data (d47e2c5)
- moving nested arrays now properly persists row count (5f9a5c8)
- validation consistency within admin (50b9937)
Features
- changes global find and update payload api from global to slug as the key to find/update with (c71ba2b)
- saves cursor position when relationship element is added to richText (d24b3f7)