TL;DR
Payload CMS v3.0.0-beta.72 brings significant improvements to database handling, UI enhancements, and bug fixes. Key updates include better transaction management, default values in database schemas, version restoration as drafts, and improved error handling. This release also fixes critical issues with PostgreSQL database adapters, authentication flows, and UI components.
Highlight of the Release
- Added ability to restore versions as drafts
- Improved database transaction handling across adapters
- Added default values support in database schemas
- Fixed critical PostgreSQL adapter issues
- Enhanced error handling in the UI
Migration Guide
Upgrading from v3.0.0-beta.71
This beta release doesn't introduce breaking changes that require complex migration steps. However, developers should be aware of the following changes:
-
Database Schema Changes: If you're using PostgreSQL or SQLite adapters, the handling of enums and default values has been updated. Review your database schemas if you're using these features.
-
Transaction Handling: If you're directly using transaction methods from the database adapters, note that the API for beginTransaction() now properly passes through options.
-
Validation Functions: The types for validation functions have been updated to allow reuse of internal validation functions. If you were working around type issues with validation functions, you may be able to simplify your code.
To upgrade:
npm install [email protected]
# or
yarn add [email protected]
After upgrading, test your application thoroughly, especially if you're using PostgreSQL with localized arrays inside block fields or enum schemas.
Upgrade Recommendations
This release is recommended for all users of Payload v3 beta, especially those using PostgreSQL or SQLite database adapters, as it contains important fixes for database schema handling and migrations.
Priority: Medium-High
Who should upgrade immediately:
- Users experiencing issues with PostgreSQL localized arrays or enum schemas
- Developers who need to add default values to database columns
- Anyone encountering infinite loops when logging into root admin in Next.js
- Users who need the ability to restore versions as drafts
Testing Recommendation:
Before upgrading production environments, thoroughly test your application with this version in a development or staging environment, paying special attention to database operations, authentication flows, and version management if you use those features.
Bug Fixes
Database Fixes
- Fixed PostgreSQL schema type issues on adapter
- Corrected enum schema handling in PostgreSQL and SQLite
- Fixed localized array handling inside blocks field in PostgreSQL
- Improved migrations table detection query in PostgreSQL
Authentication & Security
- Server-side validation for password and confirm password fields
- Fixed infinite loop when logging into root admin in Next.js applications
- Properly incorporated
basePath into logout component link
UI & UX Improvements
- Fixed layout preferences for array/blocks being saved twice in development mode
- Corrected locale formatting in version comparison view
- Improved permission handling for the force unlock button
- Fixed page parameter not resetting when applying filters
- Ensured search updates are unique to collection in the search plugin
Type System & API
- Fixed types for the 'validate' property across fields to allow reuse of internal validation functions
- Corrected GraphQL export default issue
New Features
Restore Versions as Drafts
Users can now restore previous versions as drafts, providing more flexibility in content management workflows. This feature allows editors to review and refine content before publishing.
Default Values in Database Schemas
Database schemas now support default values, which is especially helpful when adding new columns to PostgreSQL with existing data. This eliminates the need for complex migrations and works with MongoDB's Mongoose model when using payload.db.create() directly.
Better Transaction Management
Improved transaction handling across database adapters, with removal of unnecessary transaction calls from read operations. Transaction configuration options are now properly passed through to the database.
Custom Error Messages in DeleteMany
The DeleteMany component now exposes custom errors, allowing for more descriptive error messages when bulk deleting items.
Unsupported Next.js Version Warning
Added improved messaging when running Payload with an unsupported version of Next.js, helping developers identify compatibility issues early.
Security Updates
Improved Password Validation
Enhanced security by moving password and confirm-password field validation to the server side, ensuring that password validation rules are consistently enforced regardless of client-side implementation.
Permission Handling Improvements
Fixed permission handling for the force unlock button, ensuring that only users with appropriate permissions can interact with document locking functionality.
Performance Improvements
Transaction Optimization
Removed unnecessary transaction calls from read operations, which reduces database overhead and improves performance for read-heavy applications.
TypeScript Upgrade
Upgraded TypeScript from 5.5.3 to 5.5.4, which includes significant improvements to linting speed according to the TypeScript team.
Database Schema Improvements
The addition of default values at the database schema level reduces the need for application-level transformations, potentially improving performance when creating new records.
Impact Summary
Payload CMS v3.0.0-beta.72 delivers significant improvements to database handling, particularly for PostgreSQL and SQLite adapters. The addition of default values in database schemas simplifies migrations and data management, while the ability to restore versions as drafts enhances content workflow flexibility.
This release addresses several critical bugs, including fixes for PostgreSQL schema issues, authentication flows, and UI components. The improved transaction handling and removal of unnecessary transaction calls from read operations should result in better performance.
For developers, the fixed type issues for validation functions and better error messages for unsupported Next.js versions improve the development experience. Content editors will appreciate the more descriptive error messages and the ability to restore versions as drafts.
Overall, this is a solid beta release that brings Payload v3 closer to stability with important feature additions and bug fixes that benefit all types of users.
Full Release Notes
Features
Bug Fixes
- db-postgres: incorrect schema type on adapter (#7459) (449c16d)
- db-postgres, db-sqlite: enum schema (#7453) (0758199)
- db-postgres: localized array inside blocks field (#7457) (1ec78a1)
- validates password and confirm password on the server (#7410) (290ffd3)
- ui: reincorporate
basePath into logout component link (#7451) (3d89508)
- db-postgres: proper migrations table detection query (#7436) (b5b2bb1)
- formats locales for version comparison view (#7433) (5ef2951)
- hide force unlock button if the user has no permissions to interact with it (#7418) (a943487)
- page param not getting reset when applying filters (#7243) (ada9978)
- next: infinite loop when logging into root admin (#7412) (874279c)
- types for the 'validate' property across fields so internal validation functions can be reused (#7394) (7ed6634)
- export default was not found in graphql (#6975) (09a0ee3)
- plugin-search: ensure search updates are unique to collection (#6363) (67acab2)
- layout preferences for array/blocks were being saved twice in dev mode (#7396) (5cd0c7e)
Contributors