Skip to content

Commit 866444a

Browse files
committed
fix(ui): route VersionsPill through client exports bundle
The relocated `tabs/index.tsx` server module was importing the `'use client'` VersionsPill via a relative path. In production bundles that splits the DocumentInfo context across server and client chunks, so useDocumentInfo() returns the default empty object, versionCount is undefined, and the pill renders null — causing version-count e2e tests to time out waiting for `.pill-version-count` to appear. Routes this server→client edge through `@payloadcms/ui`'s `exports/client` barrel (matching the pattern from fd020ea) so the bundler treats the client module as the same instance the DocumentInfoProvider populates.
1 parent be7a642 commit 866444a

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

packages/ui/src/elements/DocumentHeader/Tabs/tabs/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { DocumentTabConfig, SanitizedCollectionConfig, SanitizedGlobalConfig } from 'payload'
22

3-
import { VersionsPill } from './VersionsPill/index.js'
3+
// eslint-disable-next-line payload/no-imports-from-exports-dir -- Server component must reference exports dir for proper client boundary
4+
import { VersionsPill } from '../../../../exports/client/index.js'
45

56
export const documentViewKeys = ['api', 'default', 'livePreview', 'versions']
67

packages/ui/src/exports/client/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export type {
173173
export { TabError } from '../../elements/Nav/SidebarTabs/TabError/index.js'
174174
export { ShouldRenderTabs } from '../../elements/DocumentHeader/Tabs/ShouldRenderTabs.js'
175175
export { DocumentTabLink } from '../../elements/DocumentHeader/Tabs/Tab/TabLink.js'
176+
export { VersionsPill } from '../../elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js'
176177
export { Wrapper as DefaultTemplateWrapper } from '../../templates/Default/Wrapper/index.js'
177178
export { FormHeader } from '../../elements/FormHeader/index.js'
178179
export { HierarchyTypeField } from '../../elements/HierarchyTypeField/index.js'

0 commit comments

Comments
 (0)