Skip to content

fix: add 'use client' to barrel index.ts files for dist path - #816

Merged
cixzhang merged 1 commit into
mainfrom
navi/fix/barrel-use-client
Mar 22, 2026
Merged

cixzhang merged 1 commit into
mainfrom
navi/fix/barrel-use-client

Conversation

@cixzhang

@cixzhang cixzhang commented Mar 22, 2026 •

Copy link
Copy Markdown
Contributor

With splitting: false (#815), tsup inlines all code into each entry point. The 'use client' directive must be on the barrel index.ts (the entry point) — tsup doesn't propagate directives from inlined modules.

Adds 'use client' to 56 barrel files. Fixes the sandbox build failure in #806.


@cixzhang cixzhang added the bug Something isn't working label Mar 22, 2026
@cixzhang
cixzhang requested a review from josephfarina as a code owner March 22, 2026 07:56
@cixzhang cixzhang added the bug Something isn't working label Mar 22, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 22, 2026
With splitting: false, tsup inlines all code into each entry point.
Two fixes needed:

1. Barrel index.ts files need 'use client' since they're the entry points
2. Post-build script (fix-use-client-dist.mjs) moves the directive to
   line 1 in dist files — tsup/babel may insert helpers before it

Fixes sandbox build failure in #806.
@cixzhang
cixzhang force-pushed the navi/fix/barrel-use-client branch from b435a8f to a85144c Compare March 22, 2026 08:02
@github-actions

github-actions Bot commented Mar 22, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

AppShell · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 68.6KB N/A
Lines of Code N/A 552 -
Complexity N/A Very High (88) -
AspectRatio · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 9.3KB N/A
Lines of Code N/A 54 -
Complexity N/A Low (1) -
Avatar · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 16.5KB N/A
Lines of Code N/A 331 -
Complexity N/A High (29) -
Badge · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 9.9KB N/A
Lines of Code N/A 144 -
Complexity N/A Low (3) -
Banner · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 50.8KB N/A
Lines of Code N/A 288 -
Complexity N/A High (21) -
Breadcrumbs · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 13.2KB N/A
Lines of Code N/A 284 -
Complexity N/A Medium (13) -
Button · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 32.2KB N/A
Lines of Code N/A 301 -
Complexity N/A High (22) -
Calendar · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 70.3KB N/A
Lines of Code N/A 938 -
Complexity N/A Very High (128) -
Card · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 21.1KB N/A
Lines of Code N/A 115 -
Complexity N/A Medium (10) -
Center · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 9.9KB N/A
Lines of Code N/A 73 -
Complexity N/A Medium (8) -
CheckboxInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 46.0KB N/A
Lines of Code N/A 369 -
Complexity N/A Very High (34) -
Collapsible · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 17.5KB N/A
Lines of Code N/A 245 -
Complexity N/A High (18) -
DateInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 92.1KB N/A
Lines of Code N/A 389 -
Complexity N/A Very High (47) -
Dialog · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 63.1KB N/A
Lines of Code N/A 324 -
Complexity N/A Very High (38) -
Divider · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 10.6KB N/A
Lines of Code N/A 148 -
Complexity N/A Medium (9) -
DropdownMenu · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 61.5KB N/A
Lines of Code N/A 512 -
Complexity N/A Very High (63) -
Field · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 35.8KB N/A
Lines of Code N/A 511 -
Complexity N/A High (19) -
FormLayout · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 10.0KB N/A
Lines of Code N/A 89 -
Complexity N/A Low (3) -
Grid · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 13.5KB N/A
Lines of Code N/A 317 -
Complexity N/A High (22) -
HoverCard · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 21.9KB N/A
Lines of Code N/A 441 -
Complexity N/A Very High (44) -
Icon · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 16.1KB N/A
Lines of Code N/A 305 -
Complexity N/A Low (4) -
Layer · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 42.4KB N/A
Lines of Code N/A 274 -
Complexity N/A High (30) -
Layout · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 42.0KB N/A
Lines of Code N/A 902 -
Complexity N/A Very High (66) -
Link · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 40.9KB N/A
Lines of Code N/A 229 -
Complexity N/A Medium (11) -
List · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 15.2KB N/A
Lines of Code N/A 392 -
Complexity N/A Very High (35) -
MobileNav · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 55.1KB N/A
Lines of Code N/A 323 -
Complexity N/A Very High (32) -
MoreMenu · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 60.1KB N/A
Lines of Code N/A 375 -
Complexity N/A Very High (49) -
NumberInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 41.8KB N/A
Lines of Code N/A 358 -
Complexity N/A Very High (52) -
OverflowList · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 15.0KB N/A
Lines of Code N/A 164 -
Complexity N/A High (19) -
Pagination · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 85.8KB N/A
Lines of Code N/A 393 -
Complexity N/A Very High (50) -
Popover · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 25.1KB N/A
Lines of Code N/A 474 -
Complexity N/A Very High (42) -
PowerSearch · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 250.8KB N/A
Lines of Code N/A 3046 -
Complexity N/A Very High (296) -
ProgressBar · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 12.4KB N/A
Lines of Code N/A 225 -
Complexity N/A Medium (13) -
RadioList · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 41.5KB N/A
Lines of Code N/A 419 -
Complexity N/A High (30) -
Section · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 21.8KB N/A
Lines of Code N/A 164 -
Complexity N/A High (16) -
SegmentedControl · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 14.6KB N/A
Lines of Code N/A 304 -
Complexity N/A High (27) -
Selector · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 72.1KB N/A
Lines of Code N/A 929 -
Complexity N/A Very High (47) -
SideNav · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 99.7KB N/A
Lines of Code N/A 1492 -
Complexity N/A Very High (146) -
Skeleton · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 10.7KB N/A
Lines of Code N/A 106 -
Complexity N/A Low (3) -
Slider · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 48.4KB N/A
Lines of Code N/A 627 -
Complexity N/A Very High (75) -
Spinner · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 15.1KB N/A
Lines of Code N/A 111 -
Complexity N/A Medium (8) -
Switch · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 46.4KB N/A
Lines of Code N/A 329 -
Complexity N/A Very High (33) -
TabList · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 35.4KB N/A
Lines of Code N/A 560 -
Complexity N/A High (26) -
Table · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 61.6KB N/A
Lines of Code N/A 820 -
Complexity N/A Very High (54) -
Text · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 33.1KB N/A
Lines of Code N/A 488 -
Complexity N/A Very High (44) -
TextArea · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 45.9KB N/A
Lines of Code N/A 236 -
Complexity N/A High (27) -
TextInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 45.7KB N/A
Lines of Code N/A 223 -
Complexity N/A High (25) -
TimeInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 54.7KB N/A
Lines of Code N/A 385 -
Complexity N/A Very High (54) -
Tokenizer · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 59.2KB N/A
Lines of Code N/A 373 -
Complexity N/A Very High (50) -
Tooltip · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 20.9KB N/A
Lines of Code N/A 416 -
Complexity N/A Very High (47) -
TopNav · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 99.1KB N/A
Lines of Code N/A 1513 -
Complexity N/A Very High (92) -
TreeList · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 25.7KB N/A
Lines of Code N/A 686 -
Complexity N/A Very High (62) -
Typeahead · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 58.5KB N/A
Lines of Code N/A 889 -
Complexity N/A Very High (121) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 602.8KB 636.1KB 117.7KB

Accessibility Audit

Status: 11 accessibility violation(s) found — 1 critical, 8 serious, 2 moderate.

XDSBanner - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/15 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
XDSCalendar - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 10/11 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
XDSCheckboxInput - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 2/16 stories · Learn more
    • WCAG: 4.1.2 (Level A)
XDSIcon - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/16 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
XDSLayout - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 4/10 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
XDSList - 1 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/10 stories · Learn more
    • WCAG: 4.1.2 (Level A)
XDSPagination - 1 issue(s)
  • 🟡 moderate: Ensure landmarks are unique
    • Rule: landmark-unique · Affects 1/14 stories · Learn more
XDSSideNav - 1 issue(s)
  • 🟠 serious: Ensure links have discernible text
    • Rule: link-name · Affects 1/8 stories · Learn more
    • WCAG: 2.4.4, 4.1.2 (Level A)
XDSTabList - 1 issue(s)
  • 🟡 moderate: Ensure landmarks are unique
    • Rule: landmark-unique · Affects 1/5 stories · Learn more
Selection - 1 issue(s)
  • 🟠 serious: Ensure ARIA attributes are used as described in the specification of the element's role
    • Rule: aria-conditional-attr · Affects 1/7 stories · Learn more
    • WCAG: 4.1.2 (Level A)
XDSText - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/22 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang merged commit 22589dd into main Mar 22, 2026
13 checks passed
@cixzhang
cixzhang deleted the navi/fix/barrel-use-client branch April 9, 2026 14:32
cixzhang added a commit that referenced this pull request Apr 26, 2026
With splitting: false, tsup inlines all code into each entry point.
Two fixes needed:

1. Barrel index.ts files need 'use client' since they're the entry points
2. Post-build script (fix-use-client-dist.mjs) moves the directive to
   line 1 in dist files — tsup/babel may insert helpers before it

Fixes sandbox build failure in #806.

Co-authored-by: Navi <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
With splitting: false, tsup inlines all code into each entry point.
Two fixes needed:

1. Barrel index.ts files need 'use client' since they're the entry points
2. Post-build script (fix-use-client-dist.mjs) moves the directive to
   line 1 in dist files — tsup/babel may insert helpers before it

Fixes sandbox build failure in #806.

Co-authored-by: Navi <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
With splitting: false, tsup inlines all code into each entry point.
Two fixes needed:

1. Barrel index.ts files need 'use client' since they're the entry points
2. Post-build script (fix-use-client-dist.mjs) moves the directive to
   line 1 in dist files — tsup/babel may insert helpers before it

Fixes sandbox build failure in #806.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant