perf: list view table should not send duplicative client CollectionConfig to client (#10664)

Previously, we were unnecessarily passing the `ClientCollectionConfig`
down from the Table to the Client, even though the client cell
components could simply access it via the `useConfig` hook. This
resulted in redundant data being sent to the client for every single
table cell. Additionally, we were performing a deep copy of the
`ClientCollectionConfig`, which wasted both memory and CPU resources on
the server.

---------

Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
This commit is contained in:
Alessio Gravili
2025-01-20 14:55:52 -07:00
committed by GitHub
parent 711febcc90
commit 823e223786
10 changed files with 68 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
import type { DefaultCellComponentProps, Payload } from 'payload'
import type { DefaultServerCellComponentProps, Payload } from 'payload'
import { getTranslation, type I18nClient } from '@payloadcms/translations'
import { formatAdminURL } from '@payloadcms/ui/shared'
@@ -11,7 +11,7 @@ export const RscEntrySlateCell: React.FC<
{
i18n: I18nClient
payload: Payload
} & DefaultCellComponentProps
} & DefaultServerCellComponentProps
> = (props) => {
const {
cellData,