From 5482e7ea15640b3dcd27669d6e905c0d2c447249 Mon Sep 17 00:00:00 2001 From: Jacob Fletcher Date: Thu, 14 Nov 2024 12:48:00 -0500 Subject: [PATCH] perf: removes i18n.supportedLanguages from client config (#9209) Similar to https://github.com/payloadcms/payload/pull/9195 but specifically removing `i18n.supportedLanguages` from the client config. This is a potentially large object that does not need to be sent through the network when making RSC requests. --- packages/payload/src/config/client.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/payload/src/config/client.ts b/packages/payload/src/config/client.ts index 79632242d..b91374bd7 100644 --- a/packages/payload/src/config/client.ts +++ b/packages/payload/src/config/client.ts @@ -45,7 +45,8 @@ export type ClientConfig = { collections: ClientCollectionConfig[] custom?: Record globals: ClientGlobalConfig[] -} & Omit + i18n?: Omit +} & Omit export const serverOnlyAdminConfigProperties: readonly Partial[] = [] @@ -92,6 +93,14 @@ export const createClientConfig = ({ } } + if ( + 'i18n' in clientConfig && + 'supportedLanguages' in clientConfig.i18n && + clientConfig.i18n.supportedLanguages + ) { + delete clientConfig.i18n.supportedLanguages + } + if (!clientConfig.admin) { clientConfig.admin = {} as ClientConfig['admin'] }