payload

The best way to build a modern backend + admin UI. No black magic, all TypeScript, and fully open-source, Payload is both an app framework and a headless CMS.

MIT License

Downloads
1.5M
Stars
19.2K
Committers
263

Bot releases are hidden (Show)

payload - v3.0.0-beta.95 Latest Release

Published by denolfe about 2 months ago

v3.0.0-beta.95 (2024-08-28)

🐛 Bug Fixes

  • ui: admin.dependencies components not added to client config (#7928) (ef818fd)
  • richtext-lexical: enabledCollections and disabledCollections props in RelationshipFeature (#7926) (0aaf3af)
  • db-postgres, db-sqlite: hasMany text, number, poly relationship, blocks, arrays within localized fields (#7900) (18b0806)
  • richtext-lexical: ensure html converter text is escaped (#7919) (c7e7dc7)
  • active nav item set incorrectly in child routes (#7918) (375671c)
  • depth not being respected by upload has many (#7897) (27d743e)

Contributors

  • Elliot DeNolf (@denolfe)
  • Alessio Gravili (@AlessioGr)
  • Germán Jabloñski (@GermanJablo)
  • James Mikrut (@jmikrut)
  • Jacob Fletcher (@jacobsfletch)
  • Jarrod Flesch (@JarrodMFlesch)
  • Paul (@paulpopus)
payload - v3.0.0-beta.94

Published by denolfe about 2 months ago

v3.0.0-beta.94 (2024-08-27)

🚀 Features

  • templates: add new slug component to the website (#7895) (5d97d57)

🐛 Bug Fixes

  • upload has many field updates (#7894) (a76be81)
  • richtext-lexical: html converters can populate relationships infinitely (#7890) (de7ff1f)
  • locale selector + autosave race condition (#7891) (3d714d3)

Contributors

  • Jarrod Flesch (@JarrodMFlesch)
  • Paul (@paulpopus)
  • Alessio Gravili (@AlessioGr)
  • James Mikrut (@jmikrut)
  • Elliot DeNolf (@denolfe)
payload - v3.0.0-beta.93

Published by denolfe about 2 months ago

v3.0.0-beta.93 (2024-08-27)

🐛 Bug Fixes

  • bugs in versions UI with perPage, pagination and diffs not showing for tabs. publish button no longer double saves when using keyboard (#7889) (23c5ef4)
  • richtext-lexical: dependency checker suggesting incorrect version (#7888) (f046a04)

Contributors

  • Paul (@paulpopus)
  • Alessio Gravili (@AlessioGr)
payload - v3.0.0-beta.92

Published by denolfe about 2 months ago

v3.0.0-beta.92 (2024-08-27)

🚀 Features

  • implement info command (#7882) (ea48cfb)
  • add nextjs and react version checks to dependency checker (#7868) (dfb4c8e)
  • richtext-lexical: more lenient url validation, URL-encode invalid urls on save (#7870) (ad7a387)

🐛 Bug Fixes

  • templates: website live preview and code block (#7881) (1aeb912)
  • plugin-seo: remove dependency on import from payload/next package (#7879) (ce2cb35)
  • error when closing the live preview popup window (#7878) (d3ec68a)
  • templates: website bug fixes for slug generation and form builder and adds support for strictNullChecks: true (#7877) (05bf52a)
  • sanitizes modifyResponseHeaders from client config (#7876) (fed7f2f)
  • exports richtext-slate useSlatePlugin (#7875) (686b086)

Contributors

  • Elliot DeNolf (@denolfe)
  • Paul (@paulpopus)
  • Jacob Fletcher (@jacobsfletch)
  • James Mikrut (@jmikrut)
  • Alessio Gravili (@AlessioGr)
payload -

Published by denolfe about 2 months ago

2.27.0 (2024-08-26)

Features

  • add support for custom image size file names (#7637) (f976270)
  • upgrade react-toastify dependency, and upgrade to pnpm v9 in our monorepo (#7667) (94d18e8)

Bug Fixes

  • update state of field if either valid status or errorMessage changes (#7632) (c624eea), closes #6413
payload - v3.0.0-beta.91

Published by denolfe about 2 months ago

v3.0.0-beta.91 (2024-08-23)

Features

  • templates: add vercel postgres template (#7841) (825d8b8)
  • enable react compiler for @payloadcms/next package (#7839) (83022f6)
  • richtext-lexical: improve upload and relationship node types (#7822) (6349cd4)
  • ui: add styling for no docs and clear all on hasmany upload (#7816) (95ebead)

Bug Fixes

  • next: properly 404s not found documents (#7833) (03440f5)
  • trim down accepted args of getPayloadHMR (#7834) (0fa6611)
  • collapsible toggle hover stacking issue (#7812) (49c0709)
  • weaken JsonObject type to allow types from payload-types being assigned to it (#7815) (c2b2f10)
  • ui: relationship field "add new" button styling (#7814) (3eed8b1)
  • richtext-lexical: slate => lexical migrator improvements (#7802) (1eefb12)

Contributors

  • Elliot DeNolf (@denolfe)
  • Alessio Gravili (@AlessioGr)
  • Jacob Fletcher (@jacobsfletch)
  • Tylan Davis (@tylandavis)
  • Jarrod Flesch (@JarrodMFlesch)
  • Paul (@paulpopus)
  • Dan Ribbens (@DanRibbens)
  • Ritsu (@r1tsuu)
payload - v3.0.0-beta.90

Published by denolfe about 2 months ago

v3.0.0-beta.90 (2024-08-22)

Features

Bug Fixes

Contributors

  • Elliot DeNolf (@denolfe)
  • Paul (@paulpopus)
payload - v3.0.0-beta.89

Published by denolfe about 2 months ago

v3.0.0-beta.89 (2024-08-22)

Features

Bug Fixes

  • richtext-lexical: ensure errors during slate => lexical migration are caught and do not halt migration progress (cf66341)
  • richtext-lexical: inaccurate detection of whether the editor is empty or not (5174c70)
  • richtext-lexical: migrate scripts not working due to migration hooks running during migrate script (d894ac7)
  • no longer handle disabling node deprecation warnings within bin script shebangs, as it errored on some systems (#7797) (af0105c)
  • ui, richtext-lexical: corrects clickable areas on block headers (#7791) (93e8131)
  • handles custom collection description components (#7789) (cb9b80a)

BREAKING CHANGES

  • handles custom collection description components (#7789) (cb9b80a)

    If you were previously defining a custom description component on a collection, simply move it into the correct position.

    Old:

    {
      admin: {
        components: {
          edit: {
            Description: ''
          }
        }
      }
    }
    

    New:

    {
      admin: {
        components: {
          Description: ''
        }
      }
    }
    

Contributors

  • Paul (@paulpopus)
  • Alessio Gravili (@AlessioGr)
  • Jarrod Flesch (@JarrodMFlesch)
  • Tylan Davis (@tylandavis)
  • Jacob Fletcher (@jacobsfletch)
payload - v3.0.0-beta.88

Published by denolfe 2 months ago

v3.0.0-beta.88 (2024-08-20)

Features

Bug Fixes

  • ui: on Table component crashing when looking for className on admin (#7776) (9c2ccbf)
  • plugin-search: not being able to override labels (#7775) (3ee0e84)
  • ui: text clipping on document header title with Segoe UI font (#7774) (6ec9820)

Contributors

  • Elliot DeNolf (@denolfe)
  • Paul (@paulpopus)
  • Tylan Davis (@tylandavis)
payload - v3.0.0-beta.87

Published by denolfe 2 months ago

v3.0.0-beta.87 (2024-08-20)

Features

  • threads field config through components and strictly types props (#7754) (3a91deb)

Contributors

  • Jacob Fletcher (@jacobsfletch)
payload - v3.0.0-beta.86

Published by denolfe 2 months ago

v3.0.0-beta.86 (2024-08-20)

Features

  • pre-compile ui and richtext-lexical with react compiler (#7688) (ebd43c7)

Bug Fixes

  • type generation for block fields with no blocks (#7765) (0c36cbd)
  • useField incorrect initialization of errorMessage on update (#7756) (adf2f31)
  • postgres migrate args (#7766) (17312d9)

Contributors

  • Paul (@paulpopus)
  • Alessio Gravili (@AlessioGr)
  • Jarrod Flesch (@JarrodMFlesch)
  • James Mikrut (@jmikrut)
payload - v3.0.0-beta.85

Published by denolfe 2 months ago

v3.0.0-beta.85 (2024-08-19)

Features

Bug Fixes

  • migrate error on windows (#7759) (bb09da0)
  • ui: tabs preferences not being saved (#7761) (ab09f2a)
  • richtext-lexical: richtext editor features overriding other editor features props if multiple editors in one document (#7758) (2f38290)
  • prevent vertical scrolling on tab fields (#7729) (b3b1cd2)
  • ui: relationship cells in table from list drawer not shown (#7730) (6eb4438)

Contributors

  • Dan Ribbens (@DanRibbens)
  • Paul (@paulpopus)
  • Alessio Gravili (@AlessioGr)
  • Jacob Fletcher (@jacobsfletch)
  • Elliot DeNolf (@denolfe)
  • Tylan Davis (@tylandavis)
payload - v3.0.0-beta.84

Published by denolfe 2 months ago

v3.0.0-beta.84 (2024-08-16)

Bug Fixes

Contributors

  • James Mikrut (@jmikrut)
  • Tylan Davis (@tylandavis)
payload - v3.0.0-beta.83

Published by denolfe 2 months ago

v3.0.0-beta.83 (2024-08-16)

Features

  • plugin-seo: pass req through to generate functions (#7711) (5eee49d)

Bug Fixes

  • type RelationshipFieldClient typed incorrectly (#7725) (b0a7601)
  • login with username server validations (#7719) (95569e4)
  • bin script error when running on linux (#7721) (1181608)
  • ui: ensure that aborting Autosave always has a valid reason for the controller - fixes uncaught error (#7723) (3a86822)
  • ensures users cannot be created without confirming pw (#7583) (6f8604e)

Contributors

  • Alessio Gravili (@AlessioGr)
  • Jarrod Flesch (@JarrodMFlesch)
  • Paul (@paulpopus)
  • Tylan Davis (@tylandavis)
payload - v3.0.0-beta.82

Published by denolfe 2 months ago

v3.0.0-beta.82 (2024-08-15)

Bug Fixes

Contributors

  • Jacob Fletcher (@jacobsfletch)
  • Dan Ribbens (@DanRibbens)
  • Alessio Gravili (@AlessioGr)
  • Elliot DeNolf (@denolfe)
payload - v3.0.0-beta.81

Published by denolfe 2 months ago

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

  • Alessio Gravili (@AlessioGr)
  • Jacob Fletcher (@jacobsfletch)
  • Paul (@paulpopus)
payload - v3.0.0-beta.80

Published by denolfe 2 months ago

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

Bug Fixes

  • next: properly closes leave-without-saving modal after navigating from Leave anyway button (#7661) (806c22e)
  • sidebar nav jumping around when loading page (#7574) (39d7b71)
  • ui: ensure field components safely access field.admin property (#7670) (c65f502)

Contributors

  • Patrik (@PatrikKozak)
  • Alessio Gravili (@AlessioGr)
  • Paul (@paulpopus)
payload - v3.0.0-beta.79

Published by denolfe 2 months ago

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

🚨 This release includes breaking changes 🚨

Follow along with the migration guide below for full details on each of the changes. Please reference this document as you migrate your own apps to this release.

So what's included in this release? By far the biggest change comes from this PR (migration guide below).

This PR made significant optimizations to the underlying codebase

  • The Payload Config is now 100% Node-safe
  • Compile times are 2x faster for some applications
  • Greatly increases type-safety throughout the codebase
  • Significant improvements for Custom Component types

For a complete list of all other bug fixes and features included in this release, scroll to the bottom of this document.

Migration Guide

To migrate from beta.78 to beta.79, you'll need to make a few changes to your Payload Config. Although this release is substantial, migration is relatively straightforward, with most of the changes only effecting the use of Custom Components.

The following changes are required of all projects:

1. The new "Import Map"

  • Add a blank "import map" to your project. Create a new file called importMap.js and add it to /app/(payload)/admin/importMap.js in your app with the following content:

    export const importMap = {}
    

    Payload will dynamically inject this file with imports at compile time. If you are using a custom admin route, change the path accordingly.

    It is recommended to run the payload generate:importMap command after you're done with the migration (make sure you follow all migration steps below first). Additionally, if the automatic import map generation fails, try running payload generate:importMap.

2. Using the Import Map in your NextJS app

  • Thread the "import map" file through your Root Layout, Root Page, and Not Found Pages:

    The Root Layout at /app/(payload)/layout.tsx:

    // ...
    import { importMap } from "./admin/importMap.js"
    
    //...
    
    const Layout = ({ children }: Args) => (
      <RootLayout config={configPromise} importMap={importMap}>
        {children}
      </RootLayout>
    )
    
    export default Layout
    

    The Root Page at /app/(payload)/admin/[[...segments]]/page.tsx:

    // ...
    import { importMap } from "../importMap.js"
    
    //...
    
    const Page = ({ params, searchParams }: Args) =>
      RootPage({ config, importMap, params, searchParams })
    
    export default Page
    

    The Not Found Page at /app/(payload)/admin/[[...segments]]/not-found.tsx:

    // ...
    import { importMap } from "../importMap.js"
    
    //...
    
    const NotFound = ({ params, searchParams }: Args) =>
      NotFoundPage({ config, importMap, params, searchParams })
    
    export default NotFound
    

3. Importing your Config file

  • If you are importing the Payload Config in a Node.js environment, there is no longer a need for a special loader to process it. Instead, you can simply import the Payload Config directly. To migrate, remove the importConfig and importWithoutClientFiles functions from your Node.js code:

    Old:

    import { importConfig, importWithoutClientFiles } from "payload"
    import { join } from "path"
    
    const config = importConfig(join(__dirname, "payload.config.js"))
    const configWithoutClientFiles = importWithoutClientFiles(
      join(__dirname, "payload.config.js")
    )
    

    New:

    import config from "./payload.config.js"
    

If you are not using Custom Components in your applications, then you are done! If you are using Custom Components, please continue reading.

Custom Components

If you are using Custom Components in your application, please follow these next steps. Not all of these changes will apply to every project. So first, review this list of changes, and if a change applies to yours, scroll down to that individual section for full details:

  1. Update component imports to component paths (required)
  2. Update useConfig hook usage (if applicable)
  3. Update useComponentMap hook usage (if applicable)
  4. Update Custom Field prop references (if applicable)
  5. Remove useFieldProps hook usage (if applicable)
  6. Update Custom Views and Tabs keys (if applicable)

Here's a full breakdown of each step:

1. Custom Component import changes

  • If you are using Custom Components in your Payload Config, the pattern for defining them has changed. You'll need to update your Custom Component definitions to use "component paths" instead of direct imports. To migrate, pass the path to the component's file:

    Old:

    import { MyCustomComponent } from './MyCustomComponent.js'
    
    // ...
    
    {
      // ...
      admin: {
        components: {
          Label: MyCustomComponent
        },
      },
    }
    

    New:

    {
      // ...
      admin: {
        components: {
          // NOTE: this path is relative to your `baseDir`, NOT the importing file
          // The `#` character is used to specify the export name, if necessary
          Label: '/collections/Posts/MyServerComponent.js#MyExportName',
        },
      },
    }
    

    Regarding the extension in the component path: you'd write it as if you were to write an import statement yourself. Few examples, assuming the imports are done from the base directory:

    If you'd previously write import { sth } from './file.js' the component path would be '/file.js#sth'

    if you'd previously write import { sth } from './file' the component path would be '/file#sth'

    if you'd previously write import file from './file.tsx' the component path would be '/file.tsx' or '/file.tsx#default'

    Alternatively, you can also define the custom component as a "PayloadComponent" in the Payload Config. This allows you to pass in client-side vs server-side props explicitly, which get automatically sanitized from the client. Previously, you'd have to use an HOC, or a utility such as withMergedProps in order to do that.

        {
          // ...
          admin: {
            components: {
              Label: {
                path: '/collections/Posts/MyServerComponent.js#MyExportName',
                // exportName: 'MyComponent2' // optional if you wish to omit the export name from the path
                clientProps: {
                  someClientProp: 'someValue'
                },
                serverProps: {
                  someServerProp: () => 'someValue'
                }
              }
            },
          },
        }
    

    More info regarding how the new component path imports work can be found in our custom component imports docs

2. useConfig hook changes

  • If you are using the useConfig React hook anywhere in your Custom Components, its return value has changed in shape. The config is now a property within the context object, rather than the return value itself. To migrate, simply destructure the config property from the return value of useConfig:

    Old:

    import { useConfig } from "@payloadcms/ui"
    // ...
    const config = useConfig()
    

    New:

    import { useConfig } from "@payloadcms/ui"
    // ...
    const { config } = useConfig()
    

3. useComponentMap hook was deprecated

  • If you were using the useComponentMap React hook anywhere in your Custom Components, it no longer exists. Instead, it has been merged into useConfig. To migrate, swap it out for the new hook:

    Old:

    import { useComponentMap } from "@payloadcms/ui"
    // ...
    const { componentMap, getComponentMap } = useComponentMap()
    const collectionComponentMap = getComponentMap({ collectionSlug: "pages" })
    

    New:

    import { useConfig } from "@payloadcms/ui"
    // ...
    const { config, getEntityConfig } = useConfig()
    const collectionClientConfig = getEntityConfig({ collectionSlug: "pages" })
    

4. Custom Component props have changed

  • If you were using Custom Fields anywhere in your code, their props have changed in shape. Previously, field props were spread in at the top-level of the component. Now, they are nested under the field key, which is a client-safe version of that field's config. To migrate, simply change your prop references to be nested under field:

    Old:

    import type { TextFieldProps } from "payload"
    
    const MyCustomField: : React.FC<TextFieldProps> = ({ name }) => {
      return <div>{name}</div>
    }
    

    New:

    import type { TextFieldProps } from "payload"
    
    const MyCustomField: : React.FC<TextFieldProps> = ({ field: { name } }) => {
      return <div>{name}</div>
    }
    

    This example demonstrates a simple text field, but this same thing applies to all field types. The type naming convention is consistent across all field types, so you can easily find the type definitions for your respective field type.

5. useFieldProps is not necessary anymore

  • If you were using the useFieldProps hook in your Custom Client Components, this is no longer needed. Now, client components are automatically detected and rendered client-side which direct props. To migrate your Custom Client Components, simply remove the useFieldProps hook from your component and read directly from props:

    Old:

    "use client"
    import type { TextFieldProps } from "payload"
    import { useFieldProps } from "@payloadcms/ui"
    
    const MyCustomClientComponent: React.FC<TextFieldProps> = () => {
      const { path } = useFieldProps()
      return <div>{path}</div>
    }
    

    New:

    "use client"
    import type { TextFieldProps } from "payload"
    
    const MyCustomClientComponent: React.FC<TextFieldProps> = ({
      field: { _path },
    }) => {
      return <div>{_path}</div>
    }
    

6. Custom views and tab config changes

  • The shape of Custom Views and Custom Tabs has changed. Previously, you could define Custom Views and Tabs top-level in the config object OR as a configuration object. Now, you can only define them as a configuration object. For this reason, the keys have changed in casing to reflect the new shape (CapitalCase denotes a React component, camelCase denotes a regular object). To migrate, simply change the casing of of these keys within your Payload Config:

    Old:

    {
      // ...
      admin: {
        components: {
          views: {
            Edit: {
              Default: {
                Tab: MyCustomTab
              },
              API: MyCustomAPIView
            }
          }
        }
      }
    }
    

    New:

    {
      // ...
      admin: {
        components: {
          views: {
            edit: {
              default: {
                tab: {
                  // ...
                }
              },
              api: {
                // ...
              }
            }
          }
        }
      }
    }
    

    This example demonstrates only a subset of the Custom Views that are available in the Payload Config. The same change applies to all Custom Views and Tabs, such as admin.views.account at the root-level, or admin.views.list on Collection Configs.

Other Updates

This release also includes other miscellaneous features and fixes, including:

FEATURES

  • richtext-lexical: move migration related features to /migrate subpath export in order to decrease module count when those are not used (#7660) (a192632)
  • filename compound index (#7651) (5fc9f76)

BUG FIXES

  • richtext-lexical: inline blocks and tables not functioning correctly if they are used in more than one editor on the same page (#7665) (fca4ee9)
  • live-preview: encode query string url (#7635) (9cb84c4)

BREAKING CHANGES

  • richtext-lexical: move migration related features to /migrate subpath export in order to decrease module count when those are not used (#7660) (a192632)

This lowers the module count by 31 modules

BREAKING: Migration-related lexical modules are now exported from
@payloadcms/richtext-lexical/migrate instead of
@payloadcms/richtext-lexical

Contributors

  • Alessio Gravili (@AlessioGr)
  • Jacob Fletcher (@jacobsfletch)
  • James Mikrut (@jmikrut)
  • Patrik (@PatrikKozak)
  • Paul (@paulpopus)
payload - v3.0.0-beta.78

Published by denolfe 2 months ago

v3.0.0-beta.78 (2024-08-13)

Features

  • add support for custom image size file names (#7634) (56aded8)
  • plugin-form-builder: pass beforeChange params into beforeEmail hook and add types to it (#7626) (78dd6a2)
  • plugin-redirects: added new option for redirect type in the redirects collection (#7625) (5dfcffa)
  • indent migration sql (#7475) (fa3d250)
  • adds classnames to list, edit views (#7596) (c1b0d93)

Bug Fixes

  • config deepmerge, fixes #7580 (#7639) (b33b5f4)
  • autoLogin not working if old, invalid token is present (#7456) (a063b81)
  • payload: filtering by polymorphic relationships with drafts enabled (#7570) (8d12037)
  • ui: render singular label for ArrayCell when length is 1 (#7586) (f88cef5)
  • ui: field permissions not being correctly updated when locale changes (#7611) (4b2a9f7)
  • ui: apiKey field not being customisable and field access control not being updated with correct data (#7591) (69ada97)
  • set correct step nav path to Account on account page (#7599) (81e7355)
  • add editDepth to account view so that it doesn't redirect from modals (#7597) (ce8b95f)
  • corrects local strategy user lookup when using loginWithUsername (#7587) (6227276)

Contributors

  • James Mikrut (@jmikrut)
  • Paul (@paulpopus)
  • Alessio Gravili (@AlessioGr)
  • Patrik (@PatrikKozak)
  • Elliot DeNolf (@denolfe)
  • Dan Ribbens (@DanRibbens)
  • Tylan Davis (@tylandavis)
  • Jarrod Flesch (@JarrodMFlesch)
payload -

Published by denolfe 2 months ago

2.26.0 (2024-08-09)

Features

Bug Fixes