Home

>

Tools

>

Payload CMS

>

Releases

>

3.0.0-beta.81

Payload CMS Release: 3.0.0-beta.81

Pre Release

Tag Name: v3.0.0-beta.81

Release Date: 8/14/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

PayloadCMS v3.0.0-beta.81 brings important improvements to component rendering flexibility, fixes critical issues with Next.js integration, and enhances developer experience. Key updates include the ability to pass false to prevent component rendering, restored support for root document view overrides, and fixes for bin script transpilation on Windows. This release focuses on improving compatibility and fixing regressions from previous versions.

Highlight of the Release

    • Added ability to pass false to PayloadComponent to prevent rendering completely
    • Restored support for root document view overrides in Next.js integration
    • Fixed bin script transpilation on Windows by using tsx instead of swc
    • Fixed issue with undefined JSON checking when autosave and validate are enabled

Migration Guide

Root Document View Override Migration

If you were previously overriding document views at the root level using:

import { MyComponent } from './MyComponent.js'

export const MyCollection = {
  // ...
  admin: {
    views: {
      Edit: MyComponent
    }
  }
}

You should update your code to use the new syntax:

export const MyCollection = {
  // ...
  admin: {
    views: {
      edit: {
        root: {
          Component: './path-to-my-component.js'
        }
      }
    }
  }
}

Empty Component Usage

If you were previously importing an empty component from @payloadcms/ui to prevent rendering, you can now simply pass false instead:

// Before
import { EmptyComponent } from '@payloadcms/ui'

// ...
Component: EmptyComponent

// After
// ...
Component: false

This eliminates the need for the @payloadcms/ui dependency in some cases.

Upgrade Recommendations

This beta release contains important bug fixes and compatibility improvements, particularly for Next.js developers and Windows users. If you're using PayloadCMS with Next.js or experiencing issues with bin scripts on Windows, upgrading is recommended.

For developers who have implemented custom document view overrides, review the migration guide to ensure your code follows the new syntax for root document view overrides.

As this is still a beta release, thoroughly test your application after upgrading to ensure compatibility with your specific implementation.

Bug Fixes

Next.js Root Document View Overrides

Fixed a regression that removed the ability to override document views at the root level. This feature allows developers to override the entire document routing/view structure, including document headers/tabs and all nested routes. The regression was introduced when types were simplified to better support "component paths" in PR #7620.

The fix adds a new root key to the views config to support both stricter types and root view overrides. The updated syntax is:

export const MyCollection = {
  // ...
  admin: {
    views: {
      edit: {
        root: {
          Component: './path-to-my-component.js'
        }
      }
    }
  }
}

Bin Script Transpilation Fix

Fixed an issue where Payload bin scripts were not properly working on Windows. The fix replaces swc with tsx as the default bin script transpiler, as swc was erroring when encountering 'next/cache' imports without the .js extension. This change improves compatibility across different operating systems.

For users who prefer other node runtimes, a new --disable-transpile flag has been added.

UI JSON Validation Fix

Fixed an issue with checking for undefined JSON when both autosave and validate features are enabled. This resolves potential errors and improves the stability of forms using these features.

New Features

Component Rendering Control

You can now pass false as a PayloadComponent which explicitly signals that the component should not be rendered. This provides more granular control over component rendering:

  • If undefined/null is passed → A Fallback Component may be rendered
  • If false is passed → No component will be rendered (as if an empty component was passed)

This enhancement eliminates the need to install @payloadcms/ui just to use an empty component in component paths, simplifying dependencies and improving developer experience.

Security Updates

No security fixes were mentioned in this release.

Performance Improvements

No specific performance improvements were mentioned in this release.

Impact Summary

This release focuses on fixing regressions and improving compatibility across different environments. The restoration of root document view overrides is particularly important for developers who need complete control over document UI structure in Next.js applications.

The bin script transpilation fix addresses a critical issue for Windows users, ensuring cross-platform compatibility. The new ability to pass false to prevent component rendering provides more flexibility and can reduce dependencies in some projects.

Overall, this release improves developer experience and fixes issues that could block certain workflows, particularly in Next.js environments and on Windows platforms. The changes are mostly non-breaking and focused on restoring expected functionality.

Full Release Notes

v3.0.0-beta.81 (2024-08-14)

Features

  • allow passing false as PayloadComponent which signals that the component should not be rendered (#7682) (49a2d70)

Bug Fixes

  • use tsx instead of swc as default bin script transpiler, as swc errors when it encounters 'next/cache' (#7681) (cb7fa00)
  • next: supports root document view overrides as separate from default edit view (#7673) (a212cde)
  • ui: issue with checking for undefined json when autosave and validate is enabled (#7678) (4f323a3)

Contributors

Statistics:

File Changed59
Line Additions480
Line Deletions366
Line Changes846
Total Commits6

User Affected:

  • Can now properly override root document views separately from default edit views
  • Benefit from fixed bin script transpilation when using 'next/cache'

Contributors:

paulpopusjacobsfletchAlessioGrdenolfe