Skip to content

Commit 3da9be0

Browse files
authored
fix: do not send admin dependencies to client (#9583)
We were sending unrendered `PayloadComponent`s to the client, which is a remnant of old betas where those were actually rendered. There is no point sending them to the client as they are useless there and cannot be rendered without the server-only importMap. Additionally, this could have potentially caused server-only modules to be sent to the client (e.g. if serverProps was used), which would have lead to a webpack error. The types were also incorrect, as admin.dependencies on the ClientConfig did not contain the React nodes.
1 parent 4b302f2 commit 3da9be0

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

packages/payload/src/config/client.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export type ServerOnlyRootAdminProperties = keyof Pick<SanitizedConfig['admin'],
3939

4040
export type ClientConfig = {
4141
admin: {
42-
dependencies?: Record<string, React.ReactNode>
4342
livePreview?: Omit<LivePreviewConfig, ServerOnlyLivePreviewProperties>
4443
} & Omit<SanitizedConfig['admin'], 'components' | 'dependencies' | 'livePreview'>
4544
collections: ClientCollectionConfig[]
@@ -93,7 +92,6 @@ export const createClientConfig = ({
9392
avatar: config.admin.avatar,
9493
custom: config.admin.custom,
9594
dateFormat: config.admin.dateFormat,
96-
dependencies: config.admin.dependencies,
9795
disable: config.admin.disable,
9896
importMap: config.admin.importMap,
9997
meta: config.admin.meta,

0 commit comments

Comments
 (0)