Home

>

Tools

>

Payload CMS

>

Releases

>

Release v2.0.14

Payload CMS Release: Release v2.0.14

Tag Name: v2.0.14

Release Date: 10/30/2023

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 2.0.14 brings significant improvements to performance, error handling, and fixes for various bugs. Key updates include better MongoDB query performance, enhanced nested AND/OR queries, improved error handling for document duplication and unique fields, and fixes for relationship field values in versions view. The release also addresses issues with image resizing, focal point manipulation, and date field handling.

Highlight of the Release

    • Improved MongoDB query performance with optimized find operations
    • Fixed document duplication across locales
    • Enhanced nested AND/OR query support
    • Better error handling for unique fields and document duplication
    • Fixed relationship field values display in versions view
    • Improved image resizing and focal point manipulation

Migration Guide

No major migration steps are required for this release. This is primarily a bug fix and performance improvement release that should be backward compatible with existing Payload CMS 2.x implementations.

However, if you're experiencing any of the specific issues addressed in this release, you should update to version 2.0.14 to benefit from the fixes. After updating, test your application thoroughly, especially if you rely heavily on:

  1. Complex MongoDB queries
  2. Document duplication across locales
  3. Relationship fields in versions view
  4. Image resizing functionality
  5. Rich text editors with TypeScript strict mode

Upgrade Recommendations

This release is recommended for all users as it contains significant performance improvements and bug fixes that will benefit most Payload CMS implementations.

Priority: Medium

The update addresses several important issues but doesn't contain critical security fixes, so immediate updating is not mandatory but is advised, especially if you're experiencing any of the specific issues mentioned in the release notes.

How to Upgrade

Update your Payload CMS dependency to version 2.0.14:

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

After updating, run your application in a development environment to ensure everything works as expected before deploying to production.

Bug Fixes

Database and Query Fixes

  • MongoDB Performance: Significantly improved find query performance in MongoDB operations.
  • Versions Pagination: Fixed pagination issues with MongoDB versions.
  • Transaction Race Condition: Resolved GraphQL query errors related to transaction race conditions.

Document Management Fixes

  • Locale Duplication: Fixed an issue where duplicate documents were copying to incorrect locales.
  • Block IDs: Now generating new block IDs on document creation to prevent conflicts.
  • Relationship Fields: Fixed handling of null and undefined relationship field values in versions view.
  • Data Duplication: Corrected issues with incorrect duplication of data in the admin UI.

Media and Upload Fixes

  • Image Resizing: Fixed image resizing when no aspect ratio change is needed.
  • Focal Point Manipulation: Now only applying focal manipulation when necessary.
  • File Storage: Improved handling of resized images on request or temporary file paths.

Form and Field Fixes

  • Unique Field Errors: Enhanced error handling for unique fields.
  • Date Fields: Set date to 12UTC for default, dayOnly, and monthOnly fields for consistent behavior.
  • Version Compare: Ensured compare-version select field cannot be cleared.
  • Server URL: Fixed to ensure serverURL has string value for getBaseUploadFields function.

Rich Text Editor Fixes

  • TypeScript Support: Fixed type issues with TypeScript strict mode enabled.
  • Client Module Marking: Corrected Blocks node incorrectly marked as client module.
  • Dependencies: Removed unnecessary dependencies from the Lexical rich text editor.

New Features

Enhanced Query Capabilities

  • Nested AND/OR Queries: The system now properly supports nested AND/OR queries, allowing for more complex and powerful data filtering operations.

Improved Form Builder Plugin

  • Added CC Field to Email: The form builder plugin now includes a CC field for emails, providing more flexibility in email notifications.
  • Better Form Field Overrides: Form fields can now be properly overridden, and incoming config arrays within field overrides are handled correctly.

Security Updates

No specific security fixes were mentioned in this release.

Performance Improvements

Database Performance

  • MongoDB Query Optimization: Significantly improved find query performance in MongoDB operations, which will result in faster data retrieval, especially for large datasets.
  • Index Optimization: Added default indexing for the createdAt field to improve query performance.

Build and Runtime Performance

  • Webpack Hot Reload: Disabled webpack hot reload in production environments to reduce unnecessary overhead.
  • Image Processing: Optimized image resizing process to only perform operations when necessary, reducing CPU usage during image uploads.

Memory Usage

  • Rich Text Editor: Removed unnecessary dependencies from the Lexical rich text editor, reducing the overall bundle size and memory footprint.

Impact Summary

Payload CMS 2.0.14 delivers a substantial set of improvements focused on performance and reliability. The MongoDB query optimizations will have a significant positive impact on applications with large datasets, resulting in faster data retrieval operations. Content editors will benefit from more reliable document duplication, especially in multi-locale environments, and improved handling of relationship fields in the versions view.

The fixes for image processing, including resizing and focal point manipulation, ensure more consistent behavior when working with media assets. Developers will appreciate the enhanced nested AND/OR query support, allowing for more complex data filtering operations, as well as the improved error handling for unique fields and document duplication.

Overall, this release enhances the stability and performance of Payload CMS without introducing breaking changes, making it a recommended update for all users. The improvements to core functionality like database operations, document management, and media handling will result in a better experience for both developers and content editors.

Full Release Notes

2.0.14 (2023-10-30)

Bug Fixes

  • adds null to non-required field unions (#3870) (7e919aa)
  • checks for user before accessing properties in preferences update operation(#3844) (24eab3a)
  • db-mongodb: improve find query performance (#3836) (56e58e9), closes #3904
  • db-mongodb: versions pagination (#3875) (4f2b080)
  • disable webpack hot reload on production (#3891) (422c803)
  • duplicate document copying to incorrect locale (#3874) (89f273b)
  • enables nested AND/OR queries (#3834) (237eebd)
  • ensure serverURL has string value for getBaseUploadFields function (#3900) (c564a83)
  • ensures compare-version select field cannot be cleared (#3901) (42d8d11)
  • error handling when duplicating documents fails (#3873) (435eb62)
  • generate new block ids on create (#3871) (3404bab)
  • global permissions for live preview (#3854) (3032e0b)
  • handles null & undefined relationship field values in versions view (#3609) (115e592)
  • incorrect duplication of data in admin ui (#3907) (46fc41c)
  • only apply focal manipulation when necessary (#3902) (a4f36aa)
  • graphql query errors transaction race condition (#3795) (dc13b10)
  • removes conditional return of formattedEmails in sendEmail hook #26 (#28) (e8458f8)
  • resize image if no aspect ratio change (#3859) (f53b713)
  • richtext-*: type issues with typescript strict mode enabled (dac9514)
  • richtext-lexical: Blocks node incorrectly marked as client module (35f00fa)
  • richtext-lexical: remove unnecessary dependencies (fixes #3889) (760565f)
  • set date to 12UTC for default, dayOnly and monthOnly fields (#3887) (d393225)
  • store resized image on req or tempFilePath (#3883) (6c5d525)
  • unique field error handling (#3888) (4d8d4c2)

New Contributors

Statistics:

File Changed247
Line Additions19,629
Line Deletions7,388
Line Changes27,017
Total Commits250

User Affected:

  • Benefit from improved MongoDB query performance
  • Experience better error handling for document duplication and unique fields
  • Can now use nested AND/OR queries for more complex data filtering
  • Will see fixes for TypeScript strict mode issues in rich text editors

Contributors:

jmikrutjessrynkarjacobsfletchKalmarvdenolfeafzaalahmadechocrowDanRibbensalamitAlexPagnottaJarrodMFleschyageeandr-ecbencunssoronidfinkinfridomDireWolf707vvvctrssybergTomDo1234lucyawreydkirchhofAlessioGrdependabot[bot]GeorgeHulpoiPatrikKozakhdodovnathanclevenger