Payload CMS Release: Release 1.6.30
Tag Name: v1.6.30
Release Date: 4/3/2023
Payload CMSPayload 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 v1.6.30 fixes two important bugs: one preventing mutation of the original document in beforeChange field hooks and another correcting type definitions for the local API when using delete with where conditions. These fixes improve data integrity and TypeScript type safety for developers using Payload.
Highlight of the Release
- Fixed issue with
originalDocbeing mutated inbeforeChangefield hooks - Corrected TypeScript type definitions for local API's delete operation with
whereconditions
Migration Guide
No migration is required for this release. The fixes are backward compatible and should not break existing functionality.
Upgrade Recommendations
This release contains important bug fixes that improve data integrity and type safety. It is recommended for all users to upgrade to v1.6.30, especially if you:
- Use
beforeChangefield hooks in your Payload configuration - Use the local API's
deleteoperation withwhereconditions in TypeScript projects
The upgrade should be straightforward with no breaking changes.
Bug Fixes
Fixed mutation of originalDoc in beforeChange field hooks
This release fixes an issue where the originalDoc was being unintentionally mutated in beforeChange field hooks. This could lead to unexpected behavior when multiple hooks were relying on the original document state. The fix ensures that the original document remains immutable throughout the hook execution chain, maintaining data integrity during document updates.
Corrected TypeScript type definitions for local API delete operations
Fixed incorrect TypeScript type definitions when using the local API's delete operation with where conditions. This improves type safety and developer experience when working with TypeScript in Payload projects.
New Features
No new features were added in this release.
Security Updates
No security fixes were included in this release.
Performance Improvements
No specific performance improvements were included in this release.
Impact Summary
This maintenance release addresses two specific bugs that could affect developers working with Payload CMS:
-
The fix for
originalDocmutation inbeforeChangefield hooks ensures that hooks can reliably access the original document state without unexpected changes, improving the predictability and reliability of hook behavior. -
The correction to TypeScript type definitions for the local API's
deleteoperation withwhereconditions improves the developer experience when using TypeScript, providing better type safety and reducing potential runtime errors.
While these changes are relatively minor in scope, they address important edge cases that could lead to subtle bugs in applications built with Payload CMS.
Full Release Notes
Statistics:
User Affected:
- Fixed issue with `originalDoc` being mutated in `beforeChange` field hooks, ensuring data integrity during document updates
- Corrected TypeScript type definitions for local API when using `delete` with `where` conditions, improving type safety
