Repository navigation
fix: comprehensive 'use client' directives + dist check - #815
Merged
Merged
Conversation
Add 'use client' to all 95 source files using React client APIs. This ensures tsup shared chunks can preserve the directive (tsup only propagates it when ALL files in a chunk have it). Also adds scripts/check-use-client.mjs — a CI check that verifies all source files using client APIs have the directive. Files from original list (87): 85 needed the directive, 2 already had it from PR #812. Found 10 additional files that were also missing it (SegmentedControl, TreeList, SideNav, Selector/hooks, AppShell/MobileContext, hooks/useOverflow). Note: CI workflow integration deferred — requires workflow scope token. Run 'node scripts/check-use-client.mjs' after build.
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsAppShell · View in Storybook
AspectRatio · View in Storybook
Avatar · View in Storybook
Badge · View in Storybook
Banner · View in Storybook
Breadcrumbs · View in Storybook
Button · View in Storybook
Calendar · View in Storybook
Card · View in Storybook
Center · View in Storybook
CheckboxInput · View in Storybook
Collapsible · View in Storybook
DateInput · View in Storybook
Dialog · View in Storybook
Divider · View in Storybook
DropdownMenu · View in Storybook
Field · View in Storybook
FormLayout · View in Storybook
Grid · View in Storybook
HoverCard · View in Storybook
Icon · View in Storybook
Layer · View in Storybook
Layout · View in Storybook
Link · View in Storybook
List · View in Storybook
MobileNav · View in Storybook
MoreMenu · View in Storybook
NumberInput · View in Storybook
OverflowList · View in Storybook
Pagination · View in Storybook
Popover · View in Storybook
PowerSearch · View in Storybook
ProgressBar · View in Storybook
RadioList · View in Storybook
Section · View in Storybook
SegmentedControl · View in Storybook
Selector · View in Storybook
SideNav · View in Storybook
Skeleton · View in Storybook
Slider · View in Storybook
Spinner · View in Storybook
Switch · View in Storybook
TabList · View in Storybook
Table · View in Storybook
Text · View in Storybook
TextArea · View in Storybook
TextInput · View in Storybook
TimeInput · View in Storybook
Tokenizer · View in Storybook
Tooltip · View in Storybook
TopNav · View in Storybook
TreeList · View in Storybook
Typeahead · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 11 accessibility violation(s) found — 1 critical, 8 serious, 2 moderate. XDSBanner - 1 issue(s)
XDSCalendar - 1 issue(s)
XDSCheckboxInput - 1 issue(s)
XDSIcon - 1 issue(s)
XDSLayout - 1 issue(s)
XDSList - 1 issue(s)
XDSPagination - 1 issue(s)
XDSSideNav - 1 issue(s)
XDSTabList - 1 issue(s)
Selection - 1 issue(s)
XDSText - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
* fix: comprehensive 'use client' directives + source check Add 'use client' to all 95 source files using React client APIs. This ensures tsup shared chunks can preserve the directive (tsup only propagates it when ALL files in a chunk have it). Also adds scripts/check-use-client.mjs — a CI check that verifies all source files using client APIs have the directive. Files from original list (87): 85 needed the directive, 2 already had it from PR #812. Found 10 additional files that were also missing it (SegmentedControl, TreeList, SideNav, Selector/hooks, AppShell/MobileContext, hooks/useOverflow). Note: CI workflow integration deferred — requires workflow scope token. Run 'node scripts/check-use-client.mjs' after build. * fix: splitting: false + clean up duplicate use client directives * fix: restore XDSAppShell.tsx (accidentally emptied during cleanup) --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
* fix: comprehensive 'use client' directives + source check Add 'use client' to all 95 source files using React client APIs. This ensures tsup shared chunks can preserve the directive (tsup only propagates it when ALL files in a chunk have it). Also adds scripts/check-use-client.mjs — a CI check that verifies all source files using client APIs have the directive. Files from original list (87): 85 needed the directive, 2 already had it from PR #812. Found 10 additional files that were also missing it (SegmentedControl, TreeList, SideNav, Selector/hooks, AppShell/MobileContext, hooks/useOverflow). Note: CI workflow integration deferred — requires workflow scope token. Run 'node scripts/check-use-client.mjs' after build. * fix: splitting: false + clean up duplicate use client directives * fix: restore XDSAppShell.tsx (accidentally emptied during cleanup) --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
* fix: comprehensive 'use client' directives + source check Add 'use client' to all 95 source files using React client APIs. This ensures tsup shared chunks can preserve the directive (tsup only propagates it when ALL files in a chunk have it). Also adds scripts/check-use-client.mjs — a CI check that verifies all source files using client APIs have the directive. Files from original list (87): 85 needed the directive, 2 already had it from PR #812. Found 10 additional files that were also missing it (SegmentedControl, TreeList, SideNav, Selector/hooks, AppShell/MobileContext, hooks/useOverflow). Note: CI workflow integration deferred — requires workflow scope token. Run 'node scripts/check-use-client.mjs' after build. * fix: splitting: false + clean up duplicate use client directives * fix: restore XDSAppShell.tsx (accidentally emptied during cleanup) ---------
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
'use client'to all 95 source files using React client APIs. This ensures tsup shared chunks preserve the directive (tsup only propagates it when ALL files in a chunk have it).Also adds
scripts/check-use-client.mjs— a source-level check that verifies all source files using client APIs have the directive. Run withnode scripts/check-use-client.mjs.Why not tsup
banner?banner: { js: '"use client";' }would force ALL output files to be client-only, including pure server-compatible modules like theme tokens. The correct fix is ensuring source files have the directive so tsup can propagate it naturally.Root cause
PR #812 added the directive to 10 files but missed the rest. When a shared chunk contained a mix of files with and without the directive, tsup dropped it — causing Next.js to error on
createContext.What changed
scripts/check-use-client.mjschecks all source filesworkflowscope token) — addnode scripts/check-use-client.mjsstep after buildTests
All 1850 tests pass. Check script validates clean: ✅ 247 source files checked.
Fixes sandbox build failure in #806.