Home

>

Tools

>

Payload CMS

>

Releases

>

Release 2.0.2

Payload CMS Release: Release 2.0.2

Tag Name: v2.0.2

Release Date: 10/16/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 v2.0.2 Release

This minor release fixes a critical issue with beforeOperation hooks running multiple times instead of once as intended. It also includes several developer experience improvements including exported components from the rich text editor and consolidated admin view types. This update is important for maintaining data integrity in operations that rely on hooks.

Highlight of the Release

    • Fixed critical issue with beforeOperation hooks running multiple times
    • Exported rich text editor components for better extensibility
    • Consolidated admin view types for improved developer experience
    • Fixed website template error

Migration Guide

No migration is required for this release. The fixes are backward compatible and should work seamlessly with existing code.

Upgrade Recommendations

This release is recommended for all users, especially those who:

  • Use beforeOperation hooks in their code
  • Are experiencing unexpected behavior with hook execution
  • Need the newly exported rich text components
  • Are using the website template

To upgrade, run:

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

Bug Fixes

Hook Execution Fix

Fixed a critical issue where beforeOperation hooks were running multiple times instead of once as intended. This could cause unexpected behavior in operations that rely on these hooks, such as:

  • Duplicate processing of data
  • Multiple side effects when only one was intended
  • Potential performance issues due to redundant operations

Website Template Fix

Resolved an error in the website template that was preventing proper functionality.

New Features

Component Exports

The rich text editor now exports additional components that can be used for custom implementations:

  • ElementButton
  • LeafButton
  • toggleElement

Admin View Types

Admin view types have been consolidated to improve TypeScript support and developer experience when working with the admin panel.

Security Updates

No security fixes were mentioned in this release.

Performance Improvements

No specific performance improvements were mentioned in this release, though fixing the multiple hook executions may indirectly improve performance by preventing redundant operations.

Impact Summary

This release primarily addresses a bug with hook execution that could cause unexpected behavior in applications relying on beforeOperation hooks. By ensuring these hooks run only once as intended, the update improves the reliability and predictability of Payload CMS operations.

The exported rich text components (ElementButton, LeafButton, and toggleElement) provide developers with more flexibility when customizing the rich text editor experience. The consolidation of admin view types improves TypeScript support, making it easier to work with the admin panel in a type-safe manner.

While this is a minor release, the hook execution fix is significant for maintaining data integrity and preventing unexpected behavior in applications that rely heavily on operation hooks.

Full Release Notes

2.0.2 (2023-10-09)

Bug Fixes

  • beforeOperation hooks now correctly only run once (e5d6a75)

Statistics:

File Changed27
Line Additions51
Line Deletions191
Line Changes242
Total Commits9

User Affected:

  • Fixed issue with `beforeOperation` hooks running multiple times, ensuring more predictable behavior
  • Can now access exported `ElementButton`, `LeafButton`, and `toggleElement` components from the rich text editor
  • Benefit from consolidated admin view types for better TypeScript support
  • No longer encounter errors in the website template

Contributors:

AlessioGrjacobsfletchdenolfejessrynkarjmikrut