3.41.0

Tag Name: v3.41.0

Release Date: 6/5/2025

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 v3.41.0 brings significant improvements to the user experience with new features like customizable edit menu items, improved folder management, and better Turbopack compatibility. This release enhances polymorphic relationships, fixes numerous UI issues, and improves documentation. Notable additions include the ability to exclude collection documents from browse-by-folder views and better support for unnamed group fields.

Highlight of the Release

    • New editMenuItems custom component for adding actions to document control menus
    • Improved folder management with document drawer UI for editing and creating folders
    • Enhanced polymorphic join querying by fields that don't exist in every collection
    • Better Turbopack compatibility for modern development workflows
    • Option to exclude collection documents from appearing in browse-by-folder views

Migration Guide

TypeScript Strict Mode Migration

This release continues the migration to TypeScript strict mode by enabling strictNullChecks. If you're extending Payload types or building plugins, you may need to update your code to handle potential null or undefined values more explicitly.

Turbopack Compatibility

If you're using Turbopack with Payload, this release improves compatibility. You may need to update your SCSS imports to match the new pattern of importing directly rather than duplicating rules.

Browse-by-Folder Configuration

If you're using the browse-by-folder feature and want to exclude certain collections, you can now use the new configuration options:

{
  folders: {
    collections: {
      'my-collection': {
        browseByFolder: false
      }
    }
  }
}

No database migrations are required for this release.

Upgrade Recommendations

This release contains several important bug fixes and performance improvements, making it a recommended upgrade for all Payload CMS users. The new features for folder management, polymorphic querying, and UI customization provide significant value without introducing breaking changes.

If you're using TypeScript with Payload, the continued migration to strict mode may require some adjustments to your code, but these changes will improve type safety and help catch potential errors.

For users of the SEO plugin or those working with file uploads, this release fixes several important issues that improve the overall experience.

Upgrade steps:

  1. Update your Payload CMS dependency to v3.41.0
  2. If you're using TypeScript, check for any new type errors related to null checks
  3. Test your application thoroughly, especially if you're using features that received fixes in this release

Bug Fixes

UI Improvements

  • Fixed upload action button styles that had extra margin causing container size issues
  • Fixed reset columns state in table views that was throwing errors
  • Corrected thread-through of autoComplete attribute from admin config to text inputs
  • Fixed millisecond handling in date fields to ensure consistent behavior
  • Improved relationship field option loading reliability using queues
  • Fixed keyboard shortcuts (ctrl+a/cmd+a) in rich text editor inputs

Database and Query Fixes

  • Fixed in query with null values in PostgreSQL to match MongoDB behavior
  • Ensured proper deletion of numbers and texts in upsertRow for PostgreSQL
  • Fixed type inference issues in live-preview functionality

File Upload Enhancements

  • Correctly detect GLB & GLTF mimetypes during upload instead of generic application/octet-stream
  • Fixed SEO plugin meta image component to properly thread allowCreate to the underlying upload input

Next.js Integration

  • Fixed issue where overriding tabs of default views wasn't working properly
  • Improved Turbopack compatibility with correct sideEffects configuration

Create Payload App

  • Fixed .env generation when using the --example flag in create-payload-app

New Features

Custom Edit Menu Items

Added a new editMenuItems custom component that allows developers to inject their own components into the document control dropdown menu (three-dot menu). This provides a clean way to add additional actions without overriding existing UI logic.

Enhanced Folder Management

Folders now use document drawers for editing and creating, providing a consistent experience with document editing. This allows for easily rendering document fields added inside collectionOverrides on folder configurations.

Polymorphic Join Querying Improvements

You can now query polymorphic relationships by fields that don't exist in all collections specified in field.collection. This enables more flexible and powerful querying across different collection types.

Browse-by-Folder Configuration Options

Added configuration options to optionally exclude collection documents from appearing in browse-by-folder views. This can be controlled globally or on a per-collection basis:

// Disable browse-by-folder globally
{
  folders: {
    browseByFolder: false
  }
}

// Disable browse-by-folder for specific collections
{
  folders: {
    collections: {
      'my-collection': {
        browseByFolder: false
      }
    }
  }
}

Unnamed Group Fields

Added support for creating unnamed group fields by allowing label: undefined. This removes the label while still visually grouping the fields:

{
  type: 'group',
  fields: [
    {
      type: 'text',
      name: 'insideGroupWithNoLabel',
    },
  ],
}

Security Updates

No significant security fixes were included in this release.

Performance Improvements

UI Performance

  • Prevented unnecessary client config sanitization in the ConfigProvider component, which was causing redundant re-renders
  • Memoized context values to prevent accidental re-renders of consumers

Relationship Field Loading

  • Improved relationship field option loading reliability using queues
  • Reduced unnecessary parallel requests by discarding outdated requests from the queue
  • Ensured that the most recently triggered options loading request won't have its result overwritten by previous, delayed requests

Turbopack Compatibility

  • Improved build performance with proper sideEffects configuration
  • Fixed SCSS rules that weren't supported by Turbopack
  • Optimized imports to directly use SCSS instead of duplicating rules

Impact Summary

Payload CMS v3.41.0 delivers a substantial update focused on enhancing the developer and content editor experience. The release introduces several new features that improve customization options, such as the ability to add custom menu items to document controls and exclude specific collections from browse-by-folder views.

For developers, the continued migration to TypeScript strict mode improves type safety, while better Turbopack compatibility enhances the development workflow. The enhanced polymorphic join querying capabilities provide more flexibility when working with complex data relationships.

Content editors will benefit from improved folder management with a consistent document drawer UI, better upload handling with fixed action button styles, and enhanced date field handling. The fixes for keyboard shortcuts in rich text editor inputs also improve the editing experience.

Performance improvements include preventing unnecessary re-renders in the UI and optimizing relationship field option loading. The release also includes numerous bug fixes across various areas of the CMS, from UI components to database queries.

Overall, this release represents a solid improvement to Payload CMS with no breaking changes, making it a recommended upgrade for all users.

Full Release Notes

v3.41.0 (2025-06-05)

🚀 Features

  • optionally exclude collection documents from appearing in browse-by-folder (#12654) (337f618)
  • improve turbopack compatibility (#11376) (319d335)
  • polymorphic join querying by fields that don't exist in every collection (#12648) (2b40e0f)
  • ui: use document drawers for folder edit/create (#12676) (9581092)
  • ui: adds new editMenuItems custom component (#12649) (625d8d9)

🐛 Bug Fixes

  • correctly detect glb & gltf mimetypes during upload (#12623) (05eeddb)
  • allow unnamed group fields to not set a label at all (#12580) (d561195)
  • cpa: generate .env when using the --example flag (#12572) (836fd86)
  • db-postgres: ensure deletion of numbers and texts in upsertRow (#11787) (bd512f1)
  • db-postgres: in query with null (#12661) (c08cdff)
  • live-preview: correct type inference (#12619) (c83e791)
  • next: cannot override tab of default views (#11789) (c639c5f)
  • plugin-seo: thread allowCreate to meta image component (#12624) (ede5c67)
  • richtext-lexical: export defaultColors for use in client components (#12627) (8199a7d)
  • richtext-lexical: enable select inputs with ctrl+a or cmd+a (#12453) (89ced5e)
  • translations: add missing import for lv locale from date-fns (#12577) (cbc37d8)
  • ui: adjusts margin spacing on upload actions (#12692) (1dd4a12)
  • ui: safely extract text from React nodes (#12419) (48e5ee6)
  • ui: formatDate and formatTimeToNow utility type error on i18n arg to support I18nClient too (#12576) (76bf459)
  • ui: correctly thread through the autoComplete attribute from admin config to the text input (#12473) (08ec837)
  • ui: clear miliseconds in date fields unless theyre explicitly provided in the display format (#12650) (a9ff375)
  • ui: reset columns state throwing errors (#11903) (08a6f88)
  • ui: upload action button styles (#12592) (6119d89)

⚡ Performance

  • ui: prevent unnecessary client config sanitization (#12665) (2bd098c)

🛠 Refactors

  • translations: correct i18n translation for Mandarin (#12561) (6f8cff7)
  • ui: improve relationship field option loading reliability using queues (#12653) (30dd9a2)

📚 Documentation

  • add Content-Type header for JWT authentication (#12513) (3f7debd)
  • fix import statements for plugin-nested-docs (#12494) (5635ec5)
  • improve rich-text documentation with hasText usage tip (#12645) (53de775)
  • fix beforeHook documentation to reflect actual behaviour (#12651) (fd5cd1a)
  • improve module augmentation docs for request context (#12681) (0c3ff88)
  • update seo plugin tabbedUI docs to mention potential pitfalls with the config option (#12549) (505eaa2)
  • missing dash (#12644) (684c436)
  • building without a db connection (#12607) (7c094dc)

📝 Templates

⚙️ CI

🏡 Chores

  • fix various e2e test setup issues (#12670) (545d870)
  • fix lint warnings for default exports, unused imports, unused err in catch (#12666) (48218bc)
  • migrate to TypeScript strict in Payload package (enable strictNullChecks) - #3 (#12586) (6ec21a5)
  • update CONTRIBUTING.md (#12511) (5e3a94b)

🤝 Contributors

Statistics:

File Changed300
Line Additions2,341
Line Deletions2,548
Line Changes4,889
Total Commits43

User Affected:

  • Improved TypeScript support with strict null checks migration
  • Better Turbopack compatibility for modern development workflows
  • Enhanced polymorphic join querying capabilities
  • Fixed type inference issues in live-preview functionality

Contributors:

GermanJablodenolfepaulpopusPatrikKozakjacobsfletchr1tsuuanyujakhrarovsaidtak-ambosschmieluluAlessioGrjessrynkarJarrodMFleschiamacupRot4tioncodefloristkamiloox