github payloadcms/payload v3.65.0

6 hours ago

v3.65.0 (2025-11-25)

๐Ÿš€ Features

  • add augmentable interfaces for collection and global custom properties (#14729) (850c252)
  • allow to specify payload instance cache key in handleEndpoints (#14675) (efa2fd2)
  • db-mongodb: add afterCreateConnection and afterOpenConnection hooks (#14649) (af6ba86)
  • plugin-mcp: add localization support to MCP resource operations (#14334) (a3f490b)
  • plugin-mcp: adds a PayloadRequest to custom tool, prompt, and resource handlers (#14644) (0d14b06)
  • ui: extract block selector from blocks drawer (#14697) (b9b11f0)

Type-Safe Custom Properties - Add augmentable interfaces for collection and global custom properties: CollectionCustom, CollectionAdminCustom, GlobalCustom, and GlobalAdminCustom. Enables type-safe plugin configuration at the collection/global level with full autocomplete support, matching the existing FieldCustom pattern. #14729

// Augment interfaces in your plugin or project
declare module 'payload' {
  export interface CollectionAdminCustom {
    disabledFields?: string[]
  }

  export interface CollectionCustom {
    myPluginConfig?: {
      enabled: boolean
      settings: Record<string, any>
    }
  }
}

// Now get full type safety in collections
export const Posts: CollectionConfig = {
  slug: 'posts',
  admin: {
    custom: {
      disabledFields: ['status'] // โœ… Type-safe!
    }
  },
  custom: {
    myPluginConfig: {
      enabled: true,
      settings: {}
    }
  }
}

Payload Instance Cache Key - Specify payloadInstanceCacheKey in handleEndpoints and createPayloadRequest to control which cached Payload instance is used for custom endpoints. Useful for multi-tenant scenarios or when managing multiple Payload instances. #14675

MongoDB Connection Lifecycle Hooks (db-mongodb) - Add afterCreateConnection and afterOpenConnection hooks to the MongoDB adapter for performing setup logic after connection/pool initialization. Enables use cases like connection pooling in serverless environments. #14649

export const databaseAdapter = mongooseAdapter({
  // ...
  afterOpenConnection: async (adapter) => {
    const client = adapter.connection.getClient()
    attachDatabasePool(client);
  },
})

MCP Localization Support (plugin-mcp) - Add full localization support to MCP resource operations (create, update, find, delete). All MCP tools now accept locale and fallbackLocale parameters, bringing feature parity with Payload's REST API for multilingual content management. #14334

// Create content in English
{ "name": "createPosts", "arguments": { "title": "Hello", "locale": "en" }}

// Add Spanish translation
{ "name": "updatePosts", "arguments": { "id": "123", "title": "Hola", "locale": "es" }}

// Retrieve all translations
{ "name": "findPosts", "arguments": { "id": "123", "locale": "all" }}

PayloadRequest in MCP Handlers (plugin-mcp) - Custom tool, prompt, and resource handlers now receive a PayloadRequest object, enabling access to the Payload instance and consistent access control patterns without additional lookups. #14644

// Previously
handler: async (args: Record<string, unknown>) => {}

// Now with req parameter
handler: async (args: Record<string, unknown>, req: PayloadRequest, _extra) => {
  // Access payload instance, user, locale, etc.
  const { payload, user, locale } = req
}

Reusable Block Selector Component (ui) - Extract BlockSelector component from BlocksDrawer and export for external use. Includes new onSelect callback for custom side effects when blocks are selected. #14697

๐Ÿ› Bug Fixes

  • trigger login hooks after reset password (#14711) (32560e9)
  • ensure restoreAsDraft only updates the published doc when draft is false (#14658) (3f3f5db)
  • remove init of transaction for global doc access (#14693) (c455f58)
  • count versions should allow querying on localized fields (#14695) (e1168a0)
  • prevent upload mimeType error when useTempFiles is true (#14689) (fe8a3e8)
  • autoRefresh not working due to stale closure and missing in client config (#14612) (8a3c6dc)
  • type TypeWithVersion missing latest property (#14676) (9b6e1a3)
  • graphql version error in production (#14622) (cd5b344)
  • corrects outgoing localized data from afterRead (#14603) (87137fe)
  • relationships should not fallback if fallbackLocale is false (#14641) (9f55254)
  • hide turbopack warnings (#14640) (03f19bc)
  • logout-inactivity route gets stuck on loading indicator when inactivity and isLoggedIn are true (#14596) (7a31c02)
  • tighten up error visibility handling (#14606) (c74a40f)
  • claude: properly structure claude plugin (#14432) (3198bbe)
  • db-*: do not exit process on error during connect (#14647) (ab03163)
  • db-mongodb,drizzle: prevent race condition in transaction session cleanup (#14651) (a7cf30d)
  • drizzle: postgres 18 support (#14700) (294ebf5)
  • next: remove turbopack build support to fix bundle size regression (#14696) (c484a05)
  • next: prevent transaction race condition in renderDocument parallel operations (#14652) (802a21a)
  • plugin-multi-tenant: fix infinite sync tenant network calls (#14604) (8901c7b)
  • richtext-lexical: block names were not loaded (#14698) (c7a87c0)
  • ui: ensures modal closes on route change (#14718) (a044a08)
  • ui: query preset crash with empty filters in postgres/sqlite (#14722) (42a4384)
  • ui: app header overflow on mobile (#14704) (91d3e04)
  • ui: shows minRowsProp instead of minRows (#14681) (e40a4b7)
  • ui: publish label regression from 14690 (#14692) (ba5834b)
  • ui: publish button shows locale-specific text without localized fields (#14690) (caf68e4)
  • ui: equals filter shows no results when value is cleared (#14673) (220a18f)
  • ui: select/relationship field values have no tooltip on hover (#14662) (bc23084)
  • ui: bulk uploads silently skips files without filenames (#14621) (8f14359)
  • ui: relationship field label not updated when document is updated from other drawer (#14609) (0cc06a1)
  • ui: duplicate should duplicate as draft by default (#14619) (fb05840)

โšก Performance

๐Ÿ›  Refactors

  • db-mongodb,drizzle: reduce race condition window between retrieving and using a session (#14653) (bd9f15f)
  • ui: strongly type render-list server action (#14611) (337409b)

๐Ÿ“š Documentation

๐Ÿงช Tests

๐Ÿก Chores

โš ๏ธ BREAKING CHANGES

  • plugin-mcp: removes 'override' config (#14598) (89ab526)

    • Removes override from the plugin config
    • Updates documentation

๐Ÿค Contributors

Don't miss a new payload release

NewReleases is sending notifications on new releases.