TL;DR
PayloadCMS v3.0.0-beta.99 brings significant performance improvements to relationship fields, fixes PostgreSQL database queries for hasMany relationships, and corrects UI behavior for version restoration. This release focuses on enhancing user experience through optimized rendering and reduced API requests.
Highlight of the Release
- Significant performance optimization for relationship fields reducing unnecessary re-renders and API requests
- Fixed PostgreSQL database queries for hasMany relationships with text/number in arrays/blocks
- Improved version comparison UI to only show 'Restore as draft' option when drafts are enabled
Migration Guide
No migration is required for this release. The changes are non-breaking and should work seamlessly when upgrading from v3.0.0-beta.98.
Upgrade Recommendations
This release is recommended for all users of PayloadCMS v3.0.0-beta.98, especially those:
- Using relationship fields extensively in their admin UI
- Working with PostgreSQL as their database
- Using version control with drafts functionality
The performance improvements and bug fixes provide a better experience without introducing breaking changes.
Bug Fixes
Fixed PostgreSQL Database Queries
Fixed an issue with PostgreSQL database queries for hasMany relationships containing text or number fields within arrays or blocks. This resolves issue #7671 where certain query patterns were not working correctly.
Improved Version Restoration UI
Fixed the version comparison view to only display the "Restore as draft" button when the versions.drafts option is set to true. Previously, this button would appear regardless of whether drafts were enabled for the collection.
Optimized Relationship Field
Fixed performance issues with the relationship field component by:
- Reducing the number of client-side requests made by the component
- Eliminating the visual "blink" of field values on initial load
- Implementing a new
useIgnoredEffect hook to precisely control when effects are triggered
- Optimizing re-renders to prevent unnecessary API calls
New Features
No new features were added in this release. This beta update focuses on bug fixes and performance improvements to existing functionality.
Security Updates
No security fixes were included in this release.
Performance Improvements
Relationship Field Optimization
The relationship field component has been significantly optimized to reduce unnecessary re-renders and API requests:
- Implemented a new
useIgnoredEffect hook that allows effects to be triggered based on specific dependency changes while ignoring others
- Reduced the overall number of re-renders in the relationship field component
- Eliminated duplicative API requests by preventing unnecessary effect executions
- Fixed visual "blink" issues during initial loading of relationship field values
This optimization results in a smoother user experience and reduced server load, especially in forms with multiple relationship fields or complex data structures.
Impact Summary
This release focuses on improving performance and fixing bugs in PayloadCMS. The most significant impact comes from the relationship field optimization, which reduces unnecessary API requests and improves rendering performance. This change will be particularly noticeable for users working with forms containing multiple relationship fields.
The PostgreSQL query fix ensures more reliable database operations when working with hasMany relationships containing text or number fields in arrays or blocks, addressing a known issue that affected query results.
The version comparison UI improvement ensures that the "Restore as draft" option only appears when drafts are actually enabled for a collection, providing a more consistent user experience.
Overall, this release enhances stability and performance without introducing breaking changes, making it a recommended upgrade for all users of the beta version.
Full Release Notes
🐛 Bug Fixes
- ui: significantly optimizes relationship field (#8063) (308fad8)
- only show restore as draft option when drafts enabled (#8066) (6427b7e)
- db-postgres: query hasMany text/number in array/blocks (#8003) (3a65784)
🤝 Contributors