npm payload 3.0.0-beta.32

latest releases: 3.0.0-canary.926cbeb, 3.0.0-canary.7660f90, 3.0.0-beta.58...
one month ago

3.0.0-beta.32 (2024-05-14)

Features

  • richtext-lexical: add rootFeatures prop to lexicalEditor (#6360) (c8a1cca)
  • add missing server-only props to custom RSCs, improve req.user type, clean-up ui imports (#6355) (79f4907)
  • consolidates admin.logoutRoute and admin.inactivityRoute into admin.routes (#6354) (6a0fffe)

Bug Fixes

  • graphql: threads through correct draft value for upload relations (#6235) (6e116a7)

BREAKING CHANGES

  • add missing server-only props to custom RSCs, improve req.user type, clean-up ui imports (#6355) (79f4907)

Previously, we were only passing payload to RSCs. Now, we are passing the following props for component rendered outside buildComponentMap:

  • i18n,
  • locale,
  • params,
  • payload,
  • permissions,
  • searchParams,
  • user

And the following props for components rendered within buildComponentMap:

  • i18n,
  • payload,

Breaking:

if you use the following components in your own project, these now require aforementioned additional, server-only props, instead of just the payload prop:

  • Account view
  • Default Dashboard view
  • DefaultTemplate
  • WithServerSideProps
  • RenderCustomComponent (optional)
  • Logo

Additionally, if you were using an HOC as a custom component, and the HOC passed props to the client component, you now have to filter out the additional server-only props we provide. You can use our withMergedProps helper, which filters them automatically, >or mark your HOC with 'use client'.

  • consolidates admin.logoutRoute and admin.inactivityRoute into admin.routes (#6354) (6a0fffe)

The admin.logoutRoute and admin.inactivityRoute properties have been consolidated into a single admin.routes property. To migrate, simply move those two keys as follows:

Old way:

// payload.config.ts
{ 
  // ...
  admin: {
    logoutRoute: '/custom-logout',
    inactivityRoute: '/custom-inactivity'
  }
}

New way:

// payload.config.ts
{
  // ...
  admin: {
    routes: {
      logout: '/custom-logout',
      inactivity: '/custom-inactivity'
    }
  }
}

Contributors

Don't miss a new payload release

NewReleases is sending notifications on new releases.