Home

>

Tools

>

Payload CMS

>

Releases

>

Release 0.10.0

Payload CMS Release: Release 0.10.0

Tag Name: v0.10.0

Release Date: 9/9/2021

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 v0.10.0 introduces two major features: a new Point field type for storing geographic coordinates and custom ID support for collections. This release also includes several bug fixes related to hooks, access control, and configuration validation. The Point field type enables storing and querying location data with GraphQL support, while custom IDs allow developers to define their own identifier types and formats beyond the default MongoDB ObjectIDs.

Highlight of the Release

    • New Point field type for storing geographic coordinates with full GraphQL support
    • Custom ID support for collections, allowing text or number IDs instead of MongoDB ObjectIDs
    • Improved hooks and transform execution order for more predictable behavior
    • Enhanced configuration validation for options and custom IDs

Migration Guide

Migrating to v0.10.0

Custom IDs

If you want to use custom IDs in your collections, you'll need to define an explicit ID field in your collection configuration:

const MyCollection = {
  slug: 'my-collection',
  fields: [
    {
      name: 'id',
      type: 'text', // or 'number'
      required: true,
    },
    // other fields...
  ]
}

Note that custom IDs are only recommended for new collections. Changing ID types on existing collections may cause data integrity issues.

Hooks and Transform Order

The execution order of hooks and transforms has been updated for more predictable behavior. If you were relying on a specific order of operations, you may need to review your custom hooks to ensure they still function as expected.

Point Field Type

The new Point field type is available for use in your collections. No migration is needed to start using this feature in new or existing collections.

Upgrade Recommendations

This release introduces valuable new features without breaking changes to existing functionality. We recommend all users upgrade to v0.10.0 to take advantage of the new Point field type and custom ID support.

For most users, the upgrade should be straightforward with no changes required to existing code. If you have custom hooks or are relying on specific transform behavior, you may want to test your application thoroughly after upgrading to ensure the improved hook execution order doesn't affect your application logic.

Bug Fixes

Fixed Issues

  • Corrected the order of data transformation for incoming and outgoing data
  • Ensured hooks run before access control checks
  • Fixed configuration validation to correctly prevent empty strings for option values
  • Resolved issues with saving collections containing undefined point values
  • Improved ID column sorting in the admin interface
  • Fixed sanitization of custom ID number types
  • Made collection ID required in admin UI
  • Removed media directory to improve test run consistency

New Features

Point Field Type

  • Added a new field type for storing geographic coordinates (latitude and longitude)
  • Includes full localization support for multilingual applications
  • GraphQL API support for querying point data
  • Frontend UI component for inputting coordinates
  • Documentation for Point field usage and near queries

Custom ID Support

  • Collections can now use custom ID fields instead of default MongoDB ObjectIDs
  • Supports both text and number ID types
  • Includes GraphQL support for custom ID types
  • Added configuration validation to ensure proper setup
  • Admin UI updated to handle custom ID fields appropriately

API Enhancements

  • Added ability to pass request objects through local findByID operations
  • Improved hooks execution order for more predictable behavior

Security Updates

No specific security fixes were mentioned in this release.

Performance Improvements

No specific performance improvements were highlighted in this release. The focus was on new features (Point field type and custom IDs) and bug fixes related to hooks, validation, and data transformation.

Impact Summary

Payload CMS v0.10.0 significantly enhances the platform's capabilities with the addition of the Point field type and custom ID support. The Point field enables developers to store and query geographic data, opening up location-based functionality in Payload applications. Custom ID support provides greater flexibility in how collections are structured and identified, allowing for more natural integration with external systems or migration of existing data.

The release also addresses several bugs related to hooks, access control, and configuration validation, resulting in more predictable and reliable behavior. These improvements enhance the developer experience and ensure more consistent data handling.

Overall, this release expands Payload's feature set while maintaining backward compatibility, making it a recommended upgrade for all users.

Full Release Notes

0.10.0 (2021-09-09)

Bug Fixes

  • admin UI collection id is required (dc96b90)
  • allow save of collection with an undefined point (f80646c)
  • config validation correctly prevents empty strings for option values (41e7feb)
  • ensures hooks run before access (96629f1)
  • ensures proper order while transforming incoming and outgoing data (c187da0)
  • improve id type semantic and restrict possible types to text and number (29529b2)
  • remove media directory to improve test run consistency (d42d8f7)
  • sanitize custom id number types (c7558d8)
  • sort id columns (114dc1b)

Features

  • add config validation for collections with custom id (fe1dc0b)
  • add config validation for collections with custom id (d0aaf4a)
  • add point field type (7504155)
  • allows user to pass req through local findByID (8675481)
  • frontend polish to point field (64ad6a3)
  • graphql support for custom id types (bc2a6e1)
  • point field localization and graphql (30f1750)
  • replace the collection idType option with an explicit id field (4b70a12)
  • support custom ids (3cc921a)

Statistics:

File Changed45
Line Additions1,257
Line Deletions89
Line Changes1,346
Total Commits29

User Affected:

  • Can now use Point field type to store geographic coordinates in their collections
  • Can define custom ID fields for collections instead of using default MongoDB ObjectIDs
  • Have access to improved hooks and transform execution order
  • Can pass request objects through local findByID operations

Contributors:

DanRibbensjmikrutjeanbmar