Skip to content

Commit 5482e7e

Browse files
authored
perf: removes i18n.supportedLanguages from client config (#9209)
Similar to #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.
1 parent 77c99c2 commit 5482e7e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/payload/src/config/client.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export type ClientConfig = {
4545
collections: ClientCollectionConfig[]
4646
custom?: Record<string, any>
4747
globals: ClientGlobalConfig[]
48-
} & Omit<SanitizedConfig, 'admin' | 'collections' | 'globals' | ServerOnlyRootProperties>
48+
i18n?: Omit<SanitizedConfig['i18n'], 'supportedLanguages'>
49+
} & Omit<SanitizedConfig, 'admin' | 'collections' | 'globals' | 'i18n' | ServerOnlyRootProperties>
4950

5051
export const serverOnlyAdminConfigProperties: readonly Partial<ServerOnlyRootAdminProperties>[] = []
5152

@@ -92,6 +93,14 @@ export const createClientConfig = ({
9293
}
9394
}
9495

96+
if (
97+
'i18n' in clientConfig &&
98+
'supportedLanguages' in clientConfig.i18n &&
99+
clientConfig.i18n.supportedLanguages
100+
) {
101+
delete clientConfig.i18n.supportedLanguages
102+
}
103+
95104
if (!clientConfig.admin) {
96105
clientConfig.admin = {} as ClientConfig['admin']
97106
}

0 commit comments

Comments
 (0)