Home

>

Tools

>

Payload CMS

>

Releases

>

Release v2.11.1

Payload CMS Release: Release v2.11.1

Tag Name: v2.11.1

Release Date: 2/16/2024

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.11.1 brings significant improvements to the rich text editor with Lexical updates, database enhancements for PostgreSQL and MongoDB, and fixes for transaction handling. The most notable change is the update of Lexical from v0.12.6 to v0.13.1, which is a breaking change requiring attention from developers using custom Lexical implementations.

Highlight of the Release

    • Lexical rich text editor updated from v0.12.6 to v0.13.1 with significant improvements
    • PostgreSQL database adapter now supports UUID as primary key type
    • Automatic reconnection for PostgreSQL database connections
    • Text justify alignment added to rich text editor
    • Improved transaction handling across multiple plugins

Migration Guide

Migrating to Lexical v0.13.1

  1. Update Package Versions: Ensure all installed Lexical packages match v0.13.1 to avoid React context errors:

    npm install @lexical/[email protected] [email protected]
    # or with yarn
    yarn add @lexical/[email protected] [email protected]
    # or with pnpm
    pnpm add @lexical/[email protected] [email protected]
    
  2. API Changes: Review your custom Lexical implementations for API changes:

    • The INTERNAL_isPointSelection method has been removed
    • Check the Lexical changelog for other API changes
  3. Testing: Thoroughly test your rich text editor implementations after upgrading to ensure compatibility

PostgreSQL UUID Support

If you want to use UUID as primary key type in PostgreSQL:

import { postgresAdapter } from '@payloadcms/db-postgres';

const payload = await buildPayload({
  db: postgresAdapter({
    pool: pgPool,
    idType: 'uuid' // Use 'uuid' instead of default 'serial'
  }),
  // other config
});

Upgrade Recommendations

Priority: Medium-High

This release is recommended for all Payload CMS users, especially those using:

  • Rich text editor with Lexical
  • PostgreSQL database adapter
  • Form builder or search plugins

For Lexical Users: This is a critical update due to the breaking change in Lexical version. You should plan to update all related Lexical packages to v0.13.1 as part of this upgrade.

For PostgreSQL Users: The reconnection feature and UUID support provide significant improvements that enhance reliability and flexibility.

Upgrade Steps:

  1. Update Payload CMS to v2.11.1
  2. Update any Lexical-related packages to v0.13.1
  3. Test your rich text editor implementations thoroughly
  4. Review any custom code that interacts with the database or transactions

Bug Fixes

Database Fixes

  • MongoDB: Fixed versions pagination in find operations
  • PostgreSQL: Fixed querying using blockType in block collections
  • Transactions: Fixed issue where filterOptions errors would cause transactions to abort
  • MongoDB: Fixed uncaught abortTransaction race condition

Rich Text Editor Fixes

  • Node Handling: Fixed issue where adjacent paragraph nodes were being removed when inserting certain nodes in an empty editor

Plugin and Core Fixes

  • Form Builder: Fixed hooks not respecting transactions
  • Uploads: Fixed external file retrieval to properly account for serverURL
  • Core: Removed collection findByID caching to prevent stale data issues

New Features

Rich Text Editor Enhancements

  • Lexical Update: Updated from v0.12.6 to v0.13.1 with improvements ported from the Lexical playground
  • Justify Alignment: Added text justify alignment option to the AlignFeature component
  • Block Handling: Improved AddBlock handle to work with all nodes, not just empty paragraphs

Database Improvements

  • PostgreSQL UUID Support: Added idType option to use UUID or serial ID columns in PostgreSQL
  • PostgreSQL Reconnection: Automatic reconnection after disconnection from PostgreSQL database
  • Transaction Support: Added req parameter to beforeSync args in search plugin for transaction support

Plugin Enhancements

  • Search Plugin: Improved transaction handling with req parameter in beforeSync hooks
  • Cloud Storage: Added testing support for LocalStack emulator

Security Updates

No specific security fixes were mentioned in this release.

Performance Improvements

Database Performance

  • Improved PostgreSQL connection handling with automatic reconnection capability, reducing downtime and connection errors
  • Optimized transaction handling across plugins to ensure data consistency

Rich Text Editor Performance

  • The update to Lexical v0.13.1 includes performance improvements from the Lexical core library
  • Better block handling improves editor responsiveness when working with different node types

Impact Summary

Payload CMS v2.11.1 delivers significant improvements to the rich text editor through the Lexical update, enhances database capabilities with PostgreSQL UUID support and automatic reconnection, and fixes several critical issues related to transaction handling.

The most impactful change is the update to Lexical v0.13.1, which brings improved editor functionality but requires attention from developers using custom Lexical implementations. This update is considered breaking for the rich text editor, requiring matching versions across all Lexical packages.

Database improvements make the system more robust with automatic PostgreSQL reconnection and better transaction handling across plugins. Content editors will appreciate the addition of text justify alignment and improved block handling in the rich text editor.

Overall, this release focuses on stability, feature enhancement, and developer experience improvements while maintaining backward compatibility except for the noted Lexical update.

Full Release Notes

2.11.1 (2024-02-16)

Features

  • db-postgres: adds idType to use uuid or serial id columns (#3864) (d6c2578)
  • db-postgres: reconnect after disconnection from database (#5086) (bf942fd)
  • plugin-search: add req to beforeSync args for transactions (#5068) (98b87e2)
  • richtext-lexical: add justify aligment to AlignFeature (#4035) (#4868) (6d6823c)
  • richtext-lexical: AddBlock handle for all nodes, even if they aren't empty paragraphs (#5063) (00fc034)
  • richtext-lexical: Update lexical from 0.12.6 to 0.13.1, port over all useful changes from playground (#5066) (0d18822)

Bug Fixes

  • db-mongodb: find versions pagination (#5091) (5d4022f)
  • db-postgres: query using blockType (#5044) (35c2a08)
  • filterOptions errors cause transaction to abort (#5079) (5f3d016)
  • plugin-form-builder: hooks do not respect transactions (#5069) (82e9d31)
  • remove collection findByID caching (#5034) (1ac943e)
  • richtext-lexical: do not remove adjacent paragraph node when inserting certain nodes in empty editor (#5061) (6323965)
  • uploads: account for serverURL when retrieving external file (#5102) (25cee8b)

⚠ BREAKING CHANGES: @payloadcms/richtext-lexical

  • richtext-lexical: Update lexical from 0.12.6 to 0.13.1, port over all useful changes from playground (#5066)
  • You HAVE to make sure that any versions of the lexical packages (IF you have any installed) match the lexical version which richtext-lexical uses: v0.13.1. If you do not do this, you may be plagued by React useContext / "cannot find active editor state" errors
  • Updates to lexical's API, e.g. the removal of INTERNAL_isPointSelection, could be breaking depending on your code. Please consult the lexical changelog.

Statistics:

File Changed62
Line Additions1,219
Line Deletions1,026
Line Changes2,245
Total Commits27

User Affected:

  • Need to ensure any installed Lexical packages match v0.13.1 to avoid React context errors
  • Benefit from improved PostgreSQL database options with new UUID support
  • Experience more reliable database connections with automatic reconnection for PostgreSQL
  • Need to review custom Lexical implementations for API changes

Contributors:

AlessioGrtallosimdenolfeDanRibbens