Home

>

Tools

>

Payload CMS

>

Releases

>

Release 1.6.31

Payload CMS Release: Release 1.6.31

Tag Name: v1.6.31

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

PayloadCMS v1.6.31 brings improved TypeScript type accuracy for required fields and fixes a critical bug where select fields with hasMany option were being mutated during PATCH operations. This release enhances developer experience with better type safety while ensuring data integrity during updates.

Highlight of the Release

    • Improved TypeScript type accuracy for required fields
    • Fixed bug where select fields with hasMany option were being mutated during PATCH operations

Migration Guide

No migration is required for this release. The improvements to TypeScript type accuracy and the fix for select fields with hasMany option are backward compatible and should not break existing implementations.

Upgrade Recommendations

We recommend all PayloadCMS users upgrade to v1.6.31, especially if you:

  • Use TypeScript in your project and would benefit from improved type accuracy
  • Work with select fields that have the hasMany option enabled
  • Perform PATCH operations on documents with select fields

This is a minor release with no breaking changes, making it a safe upgrade that improves both developer experience and data integrity.

Bug Fixes

Fixed Select Field Mutation During PATCH Operations

This release resolves an issue where select fields with the hasMany option were being unintentionally mutated during PATCH operations. This fix:

  • Prevents data corruption when updating documents with select fields that have multiple values
  • Ensures that partial updates maintain the integrity of select field data
  • Addresses edge cases where array values in select fields could be incorrectly modified
  • Maintains expected behavior when performing PATCH operations on documents with complex select fields

New Features

Improved TypeScript Type Accuracy

This release enhances the TypeScript type definitions for required fields in PayloadCMS. The improved type accuracy helps developers by:

  • Providing better intellisense and autocompletion in code editors
  • Catching potential type errors at compile time rather than runtime
  • Making the codebase more maintainable with clearer type constraints
  • Improving overall developer experience when working with required fields in PayloadCMS

Security Updates

No specific security fixes were mentioned in this release.

Performance Improvements

Performance Optimizations

While not explicitly mentioned in the commit messages, the fix for select fields with hasMany option likely improves performance in scenarios involving PATCH operations by:

  • Reducing unnecessary data mutations
  • Optimizing how select field arrays are handled during updates
  • Preventing potential cascading issues that could occur from improper data handling

Impact Summary

PayloadCMS v1.6.31 is a quality-focused release that improves developer experience through better TypeScript type definitions and fixes a data integrity issue with select fields during PATCH operations. The improved type accuracy for required fields will help catch potential errors earlier in the development process, while the fix for select fields with hasMany option ensures that your data remains consistent when performing partial updates. These changes particularly benefit developers working with TypeScript and content editors who work with multi-select fields in the CMS.

Full Release Notes

1.6.31 (2023-04-04)

Bug Fixes

  • ensures select hasMany does not get mutated on patch operations (3a6acf3)

Features

  • improves required type accuracy (a9cd23a)

Statistics:

File Changed5
Line Additions55
Line Deletions7
Line Changes62
Total Commits3

User Affected:

  • Better TypeScript type accuracy for required fields, improving code reliability and developer experience
  • Fixed issue with select fields using hasMany option being mutated during PATCH operations

Contributors:

jmikrut