Skip to content

fix(core): drop 'use client' from the package root and the component barrels - #11106

Merged
imdreamrunner merged 5 commits into
mainfrom
xinzi/root-entry-server-module
Nov 11, 2026
Merged

imdreamrunner merged 5 commits into
mainfrom
xinzi/root-entry-server-module

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Apps that render Astryx from React Server Components and import from the package root, as the docs show (import {Card} from '@astryxdesign/core'):

  • Next.js with webpack: the build fails with It's currently unsupported to use "export *" in a client boundary. The root entry is a 'use client' module made of export * lines.
  • Next.js with Turbopack: every component imported from the root is a client reference, including the ones that ship without 'use client' (Card, Stack, Section, Badge, Code, …). Their code ships to the browser and hydrates. Family subpaths do the same: @astryxdesign/core/Layout pins VStack and HStack, and the CodeBlock barrel pins Code.

After this change, each module's own directive decides. Components that need no client code render on the server, and components that need the client stay client references. Client code resolves the same modules as before.

Problem and solution fit

Expected behavior and authority

  • No current record owns React module boundaries yet: architecture:component-style-authoring routes "directive placement, mixed/server-safe barrels" to a separate owner. The proposed owner, spec:AST-113 (draft, spec: React Server Components render presentational paths on the server #11050), lists this as an FR4 gap ("the package root entry is a 'use client' module, so a root import inside a Server Component resolves every component as a client reference") and states in FR5 that a server module must not carry 'use client'.
  • serverSafeComponents.test.ts already holds directive-free components to be server modules. A barrel directive undoes that for every caller who imports through the barrel.

Smallest restoration

  • Remove 'use client' from 86 pass-through index.ts barrels under packages/core/src, the root entry included. Each one holds only imports, re-exports, and type declarations. The only module with runtime code that changes is SelectorOption.tsx, which gains its own directive (below).
  • Add 'use client' to Selector/SelectorOption.tsx. It calls useSelectorRowLayout() and renderIconSlot() from client modules while it renders, and only the Selector barrel's directive made it a client module.
  • Keep it on Markdown/plugin-renderer/index.ts: spec:AST-064 (DEC-6, FR3) makes that subpath a client-only entry, and it re-exports only a client module, so the directive changes nothing there.
  • Dropping it from the root entry alone is not enough. In the Turbopack A/B below, Code stayed a client reference because the 'use client' CodeBlock barrel re-exports it, and the Layout barrel re-exports Card, Stack and Section, which the root also exports directly.
  • Three tests in serverSafeComponents.test.ts (a pass-through barrel carries 'use client' only when every module it re-exports is a client module; the root entry is a server module; the root's server graph reaches client-only React APIs only through 'use client' modules, and no server module calls, constructs or reads a property of a value from a 'use client' module while it renders or evaluates), and a patch changeset.

Release class

Patch [fix], non-breaking. No exported name, prop, type or default changes, and client code resolves the same modules. The one pattern that behaves differently is a Server Component that passes a directive-free component itself into a Client Component prop (for example <Markdown components={{inlineCode: Code}}>): it worked only because the barrel turned every component into a client reference. The changeset says to make that call from a 'use client' module.

Evidence

Next.js 16.4.6 App Router app. A Server Component page imports Section, VStack, Card, HStack, Badge, Code, Heading, Text, Divider, Button from @astryxdesign/core, and a client Providers wraps the page in Theme and LinkProvider. The "before" build uses the published 0.7.13-canary.9b5fdf5 dist. The "after" build uses the same dist with the directive removed from exactly the barrels this PR changes.

Before After
webpack build fails: "export *" in a client boundary builds
Turbopack: Astryx client references on the page 10 (all ten components) 4 (Heading, Text, Divider, Button: each needs client code today)
Turbopack: page client JS 2,630,744 B raw / 839,171 B gzip 894,484 B raw / 283,565 B gzip (−66 %)
webpack: page client JS — (build fails) 868,345 B gzip; 342,006 B gzip with experimental.optimizePackageImports: ['@astryxdesign/core'] (webpack follows every root re-export unless the import is optimized)
  • Every server module evaluates on the server: a second page does import * as Astryx from '@astryxdesign/core' and renders Object.keys(Astryx).length (530). It builds and renders with both bundlers.
  • Root only (intermediate): Code stays a client reference under Turbopack (CodeBlock barrel), so the barrels must change too.
  • Related: perf(core): render Text and Heading in React Server Components #11105 makes Text and Heading server modules; root imports get that only once this PR lands.
  • Representative unchanged path: the client Providers (Theme, LinkProvider) and the client Button render and hydrate the same. Client imports resolve the same modules.
  • Client consumers: a client page importing the same ten components from the root ships byte-identical JS under webpack before and after (268,661 B gzip), and 2,641 B gzip less under Turbopack (the shared layout chunk shrinks by the same amount on a page with no Astryx). CI's size report: 182 of 184 components unchanged; ChartTooltip −3 B and ChartLegend −7 B (the removed directive strings); package −186 B packed.
  • Mutation-sensitive proof: putting 'use client' back on index.ts and Layout/index.ts fails keeps "use client" off every pass-through barrel that re-exports a server module and runs the package root as a server module. reaches client-only React APIs only through "use client" modules fails when a directive-free module the root reaches imports a client-only React API, and when SelectorOption.tsx loses its directive (it calls useSelectorRowLayout() and renderIconSlot() during render).

Scope

Components: package root entry, all component and family barrels (packages/core/src/**/index.ts)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • npx vitest run packages/core/src/serverSafeComponents.test.ts packages/core/src/Markdown/parser.public.test.ts: 26 passed
  • node scripts/check-use-client.mjs: 376 client-API files checked
  • pnpm check:changesets, npx eslint and npx prettier --check on the changed files
  • Next.js 16.4.6 next build (Turbopack and --webpack) + next start for both pages above

@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 11, 2026 12:15am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 10, 2026
@astracat-bot

astracat-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 11, 2026, 12:31 AM UTC

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 98fd6fc

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
charts/Chart 206.2 kB (0) · 494 B CSS (0) — — · — · —
AlertDialog · Storybook 106.7 kB (0) · 14.6 kB CSS (0) 210 (−1) — · — · —
AppShell · Storybook 92.9 kB (0) · 13.5 kB CSS (0) 1,152 (−1) — · — · —
181 more components
Component Size LoC Visual · A11y · RTL
Avatar 44.2 kB (0) · 5.6 kB CSS (0) — — · — · —
AvatarGroup 47.0 kB (0) · 5.7 kB CSS (0) — — · — · —
AvatarGroupOverflow 49.9 kB (0) · 5.7 kB CSS (0) — — · — · —
AvatarStatusDot 7.6 kB (0) · 3.5 kB CSS (0) — — · — · —
Banner · Storybook 63.3 kB (0) · 10.5 kB CSS (0) 512 (−1) — · — · —
BaseTypeahead 73.0 kB (0) · 10.9 kB CSS (0) — — · — · —
BottomSheet 69.0 kB (0) · 7.7 kB CSS (0) — — · — · —
BottomSheetSwitcher 18.5 kB (0) · 3.4 kB CSS (0) — — · — · —
BreadcrumbItem 85.9 kB (0) · 12.1 kB CSS (0) — — · — · —
Breadcrumbs 16.5 kB (0) · 3.4 kB CSS (0) — — · — · —
Button · Storybook 61.3 kB (0) · 10.0 kB CSS (0) 689 (−1) — · — · —
ButtonGroup · Storybook 41.9 kB (0) · 3.7 kB CSS (0) 155 (−1) — · — · —
Calendar · Storybook 72.3 kB (0) · 10.6 kB CSS (0) 1,748 (−1) — · — · —
Carousel · Storybook 71.1 kB (0) · 10.9 kB CSS (0) 628 (−1) — · — · —
ChatComposer 79.6 kB (0) · 12.0 kB CSS (0) — — · — · —
ChatComposerDrawer 18.0 kB (0) · 4.7 kB CSS (0) — — · — · —
ChatComposerInput 77.3 kB (0) · 11.3 kB CSS (0) — — · — · —
ChatComposerTokenElement 77.3 kB (0) · 11.3 kB CSS (0) — — · — · —
ChatDictationButton 61.8 kB (0) · 10.1 kB CSS (0) — — · — · —
ChatLayout 84.0 kB (0) · 10.5 kB CSS (0) — — · — · —
ChatLayoutScrollButton 61.8 kB (0) · 10.2 kB CSS (0) — — · — · —
ChatMessage 17.2 kB (0) · 3.7 kB CSS (0) — — · — · —
ChatMessageBubble 7.6 kB (0) · 3.7 kB CSS (0) — — · — · —
ChatMessageList 29.8 kB (0) · 7.0 kB CSS (0) — — · — · —
ChatMessageMetadata 20.3 kB (0) · 4.1 kB CSS (0) — — · — · —
ChatSendButton 61.7 kB (0) · 10.0 kB CSS (0) — — · — · —
ChatSystemMessage 7.1 kB (0) · 3.8 kB CSS (0) — — · — · —
ChatTokenizedText 7.3 kB (0) · 4.0 kB CSS (0) — — · — · —
ChatToolCalls 33.7 kB (0) · 8.3 kB CSS (0) — — · — · —
CheckboxInput · Storybook 65.4 kB (0) · 9.2 kB CSS (0) 441 (−4) — · — · —
CheckboxList 69.7 kB (0) · 7.7 kB CSS (0) — — · — · —
CheckboxListItem 72.4 kB (0) · 11.4 kB CSS (0) — — · — · —
Citation · Storybook 20.6 kB (0) · 4.4 kB CSS (0) 233 (−1) — · — · —
ClickableCard · Storybook 18.1 kB (0) · 7.3 kB CSS (0) 292 (−1) — · — · —
CodeBlock · Storybook 76.4 kB (0) · 11.3 kB CSS (0) 2,245 (−1) — · — · —
Collapsible 28.4 kB (0) · 4.5 kB CSS (0) — — · — · —
CollapsibleGroup 6.9 kB (0) · 3.3 kB CSS (0) — — · — · —
CommandPalette 74.4 kB (0) · 12.7 kB CSS (0) — — · — · —
CommandPaletteEmpty 6.5 kB (0) · 3.5 kB CSS (0) — — · — · —
CommandPaletteFooter 17.5 kB (0) · 3.7 kB CSS (0) — — · — · —
CommandPaletteGroup 3.7 kB (0) · 3.4 kB CSS (0) — — · — · —
CommandPaletteInput 33.4 kB (0) · 7.5 kB CSS (0) — — · — · —
CommandPaletteItem 13.1 kB (0) · 3.6 kB CSS (0) — — · — · —
CommandPaletteList 16.4 kB (0) · 3.4 kB CSS (0) — — · — · —
ComplexSelector · Storybook 72.2 kB (0) · 11.8 kB CSS (0) 702 (−1) — · — · —
ContextMenu · Storybook 110.2 kB (0) · 17.4 kB CSS (0) 703 (−1) — · — · —
ContextMenuItem 32.7 kB (0) · 6.3 kB CSS (0) — — · — · —
DateInput · Storybook 188.6 kB (0) · 17.0 kB CSS (0) 5,764 (−1) — · — · —
DateRangeInput · Storybook 94.2 kB (0) · 12.5 kB CSS (0) 687 (−1) — · — · —
DateTimeInput · Storybook 210.3 kB (0) · 18.7 kB CSS (0) 3,612 (−1) — · — · —
Dialog 24.8 kB (0) · 6.9 kB CSS (0) — — · — · —
DialogHeader 64.1 kB (0) · 11.5 kB CSS (0) — — · — · —
Divider · Storybook 5.2 kB (0) · 535 B CSS (0) 153 (−1) — · — · —
Drawer 51.8 kB (0) · 8.3 kB CSS (0) — — · — · —
DrawerHeader 64.3 kB (0) · 12.9 kB CSS (0) — — · — · —
DropdownMenu 98.4 kB (0) · 17.6 kB CSS (0) — — · — · —
DropdownMenuCheckboxItem 23.2 kB (0) · 6.6 kB CSS (0) — — · — · —
DropdownMenuDivider 5.3 kB (0) · 548 B CSS (0) — — · — · —
DropdownMenuGroup 6.4 kB (0) · 3.4 kB CSS (0) — — · — · —
DropdownMenuItem 22.4 kB (0) · 6.3 kB CSS (0) — — · — · —
DropdownMenuRadioGroup 6.6 kB (0) · 3.3 kB CSS (0) — — · — · —
DropdownMenuRadioItem 23.3 kB (0) · 6.6 kB CSS (0) — — · — · —
DropdownMenuSubMenu 71.3 kB (0) · 9.7 kB CSS (0) — — · — · —
Field 56.0 kB (0) · 7.2 kB CSS (0) — — · — · —
FieldLabel 52.1 kB (0) · 5.7 kB CSS (0) — — · — · —
FieldStatus · Storybook 10.0 kB (0) · 3.6 kB CSS (0) 163 (−1) — · — · —
FileInput · Storybook 70.2 kB (0) · 10.9 kB CSS (0) 786 (−1) — · — · —
FormLayout · Storybook 6.9 kB (0) · 3.5 kB CSS (0) 93 (−1) — · — · —
HoverCard · Storybook 28.7 kB (0) · 4.4 kB CSS (0) 836 (−1) — · — · —
Icon · Storybook 8.1 kB (0) · 681 B CSS (0) 929 (−1) — · — · —
IconButton · Storybook 61.3 kB (0) · 10.0 kB CSS (0) 16 (−1) — · — · —
InfoTip · Storybook 47.6 kB (0) · 5.4 kB CSS (0) 147 (−1) — · — · —
InputGroup 57.6 kB (0) · 7.8 kB CSS (0) — — · — · —
InputGroupText 6.7 kB (0) · 3.9 kB CSS (0) — — · — · —
Item · Storybook 17.6 kB (0) · 5.5 kB CSS (0) 1,747 (−1) — · — · —
LayerProvider 4.4 kB (0) · 20 B CSS (0) — — · — · —
Layout 7.1 kB (0) · 2.3 kB CSS (0) — — · — · —
LayoutContent 17.8 kB (0) · 1.7 kB CSS (0) — — · — · —
LayoutFooter 6.3 kB (0) · 1.6 kB CSS (0) — — · — · —
LayoutHeader 6.3 kB (0) · 1.6 kB CSS (0) — — · — · —
LayoutPanel 21.7 kB (0) · 4.9 kB CSS (0) — — · — · —
Lightbox · Storybook 123.8 kB (0) · 10.6 kB CSS (0) 3,404 (−8) — · — · —
Link 54.1 kB (0) · 7.0 kB CSS (0) — — · — · —
LinkProvider 3.8 kB (0) · 20 B CSS (0) — — · — · —
List 18.9 kB (0) · 790 B CSS (0) — — · — · —
ListItem 71.4 kB (0) · 11.4 kB CSS (0) — — · — · —
Markdown · Storybook 190.0 kB (0) · 20.7 kB CSS (0) 8,865 (−1) — · — · —
MetadataList 17.3 kB (0) · 3.7 kB CSS (0) — — · — · —
MetadataListItem 7.1 kB (0) · 3.5 kB CSS (0) — — · — · —
MobileNav 71.8 kB (0) · 10.6 kB CSS (0) — — · — · —
MobileNavToggle 61.6 kB (0) · 10.0 kB CSS (0) — — · — · —
MoreMenu · Storybook 98.6 kB (0) · 17.6 kB CSS (0) 91 (−1) — · — · —
MultiSelector · Storybook 96.3 kB (0) · 16.8 kB CSS (0) 2,708 (−1) — · — · —
NavHeadingMenu 16.8 kB (0) · 3.5 kB CSS (0) — — · — · —
NumberInput · Storybook 72.8 kB (0) · 11.4 kB CSS (0) 1,339 (−1) — · — · —
Outline · Storybook 24.9 kB (0) · 4.1 kB CSS (0) 1,193 (−1) — · — · —
OverflowList · Storybook 10.7 kB (0) · 3.6 kB CSS (0) 233 (−1) — · — · —
Overlay · Storybook 22.5 kB (0) · 3.9 kB CSS (0) 456 (−1) — · — · —
Pagination · Storybook 111.6 kB (0) · 17.8 kB CSS (0) 660 (−1) — · — · —
Popover · Storybook 92.2 kB (0) · 14.2 kB CSS (0) 1,548 (−1) — · — · —
PowerSearch · Storybook 291.8 kB (0) · 24.2 kB CSS (0) 7,140 (−1) — · — · —
ProgressBar · Storybook 11.9 kB (0) · 6.3 kB CSS (0) 567 (−1) — · — · —
RadioList 57.4 kB (0) · 7.3 kB CSS (0) — — · — · —
RadioListItem 68.5 kB (0) · 10.1 kB CSS (0) — — · — · —
ResizeHandle 22.0 kB (0) · 4.3 kB CSS (0) — — · — · —
SegmentedControl 97.2 kB (0) · 6.9 kB CSS (0) — — · — · —
SegmentedControlItem 17.5 kB (0) · 4.3 kB CSS (0) — — · — · —
Selector 101.5 kB (0) · 17.4 kB CSS (0) — — · — · —
SelectorOption 21.1 kB (0) · 6.1 kB CSS (0) — — · — · —
SideNav 116.0 kB (0) · 11.4 kB CSS (0) — — · — · —
SideNavCollapseButton 62.1 kB (0) · 10.0 kB CSS (0) — — · — · —
SideNavHeading 76.8 kB (0) · 11.3 kB CSS (0) — — · — · —
SideNavItem 71.6 kB (0) · 11.1 kB CSS (0) — — · — · —
SideNavSection 7.1 kB (0) · 3.7 kB CSS (0) — — · — · —
Slider · Storybook 110.2 kB (0) · 8.8 kB CSS (0) 2,449 (−1) — · — · —
Spinner · Storybook 26.4 kB (0) · 6.2 kB CSS (0) 357 (−1) — · — · —
StatusDot · Storybook 32.2 kB (0) · 5.3 kB CSS (0) 150 (−1) — · — · —
Step 31.1 kB (0) · 5.6 kB CSS (0) — — · — · —
Stepper 62.9 kB (0) · 10.1 kB CSS (0) — — · — · —
Switch · Storybook 104.8 kB (0) · 9.9 kB CSS (0) 1,733 (−1) — · — · —
Tab 14.5 kB (0) · 4.2 kB CSS (0) — — · — · —
Table 127.1 kB (0) · 18.4 kB CSS (0) — — · — · —
TableCell 111.5 kB (0) · 17.9 kB CSS (0) — — · — · —
TableHeaderCell 111.1 kB (0) · 17.6 kB CSS (0) — — · — · —
TableSelectionToolbar 71.5 kB (0) · 13.2 kB CSS (0) — — · — · —
TabList 44.7 kB (0) · 6.5 kB CSS (0) — — · — · —
TabMenu 73.0 kB (0) · 11.1 kB CSS (0) — — · — · —
Text · Storybook 13.4 kB (0) · 5.4 kB CSS (0) 716 (−1) — · — · —
TextArea · Storybook 63.4 kB (0) · 9.3 kB CSS (0) 491 (−1) — · — · —
TextInput · Storybook 68.9 kB (0) · 11.2 kB CSS (0) 416 (−1) — · — · —
Thumbnail · Storybook 65.6 kB (0) · 11.6 kB CSS (0) 370 (−1) — · — · —
TimeInput · Storybook 163.8 kB (0) · 16.0 kB CSS (0) 1,608 (−1) — · — · —
Timer 15.6 kB (0) · 6.0 kB CSS (0) — — · — · —
Timestamp · Storybook 34.6 kB (0) · 10.2 kB CSS (0) 914 (−1) — · — · —
Toast · Storybook 99.2 kB (0) · 10.3 kB CSS (0) 1,653 (−1) — · — · —
ToggleButton 87.8 kB (0) · 10.1 kB CSS (0) — — · — · —
ToggleButtonGroup 39.3 kB (0) · 3.7 kB CSS (0) — — · — · —
Token · Storybook 28.6 kB (0) · 4.7 kB CSS (0) 584 (−1) — · — · —
Tokenizer · Storybook 93.7 kB (0) · 18.8 kB CSS (0) 2,339 (−1) — · — · —
Toolbar · Storybook 44.6 kB (0) · 8.1 kB CSS (0) 325 (−1) — · — · —
Tooltip · Storybook 30.5 kB (0) · 4.4 kB CSS (0) 869 (−1) — · — · —
TopNav 73.5 kB (0) · 10.9 kB CSS (0) — — · — · —
TopNavHeading 76.4 kB (0) · 11.2 kB CSS (0) — — · — · —
TopNavItem 14.1 kB (0) · 4.0 kB CSS (0) — — · — · —
TopNavMegaMenu 70.9 kB (0) · 11.8 kB CSS (0) — — · — · —
TopNavMegaMenuFeaturedCard 7.4 kB (0) · 3.6 kB CSS (0) — — · — · —
TopNavMegaMenuItem 13.8 kB (0) · 4.2 kB CSS (0) — — · — · —
TopNavMenu 75.8 kB (0) · 11.2 kB CSS (0) — — · — · —
TreeList · Storybook 45.5 kB (0) · 5.6 kB CSS (0) 1,219 (−1) — · — · —
Typeahead 81.9 kB (0) · 12.4 kB CSS (0) — — · — · —
TypeaheadItem 6.6 kB (0) · 3.6 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 107.5 kB (0) · 773 B CSS (0) — — · — · —
lab/ChatReactionBar 108.6 kB (0) · 1.1 kB CSS (0) — — · — · —
lab/ChatTypingIndicator 25.9 kB (0) · 612 B CSS (0) — — · — · —
lab/ChatVirtualizer 55.5 kB (0) · 144 B CSS (0) — — · — · —
lab/CodeEditor 14.5 kB (0) · 743 B CSS (0) — — · — · —
lab/CommentComposer 153.6 kB (0) · 1.9 kB CSS (0) — — · — · —
lab/CommentPin 58.2 kB (0) · 1.2 kB CSS (0) — — · — · —
lab/Comments 354.4 kB (0) · 2.5 kB CSS (0) — — · — · —
lab/CommentThread 347.4 kB (0) · 2.4 kB CSS (0) — — · — · —
lab/DialogHeroHeader 84.3 kB (0) · 372 B CSS (0) — — · — · —
lab/DiffViewer 88.4 kB (0) · 2.1 kB CSS (0) — — · — · —
lab/EmojiPicker 88.0 kB (0) · 751 B CSS (0) — — · — · —
lab/LineClamp 15.6 kB (0) · 168 B CSS (0) — — · — · —
lab/ListInput 89.3 kB (0) · 922 B CSS (0) — — · — · —
lab/NavigationScreen 83.2 kB (0) · 1.5 kB CSS (0) — — · — · —
lab/NavigationStack 83.2 kB (0) · 1.5 kB CSS (0) — — · — · —
lab/Schedule 107.3 kB (0) · 3.9 kB CSS (0) — — · — · —
lab/SelectableCardGroup 65.4 kB (0) · 162 B CSS (0) — — · — · —
lab/TabBar 81.2 kB (0) · 1.8 kB CSS (0) — — · — · —
lab/TabBarItem 3.9 kB (0) · 1.8 kB CSS (0) — — · — · —
lab/TabBarMoreList 93.6 kB (0) · 1.8 kB CSS (0) — — · — · —
lab/ThreeDChart 5.1 kB (0) · 20 B CSS (0) — — · — · —
lab/TourStep 98.5 kB (0) · 590 B CSS (0) — — · — · —
lab/TransferList 103.4 kB (0) · 1.2 kB CSS (0) — — · — · —
lab/TransferListSelector 111.1 kB (0) · 1.4 kB CSS (0) — — · — · —
richtext/RichTextEditor 299.6 kB (0) · 2.6 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 280.2 kB (0) · 454 B CSS (0) — — · — · —
richtext/RichTextView 277.7 kB (0) · 2.3 kB CSS (0) — — · — · —
charts/ChartTooltip 183.4 kB (−3 B) · 422 B CSS (0) — — · — · —
charts/ChartLegend 53.4 kB (−7 B) · 224 B CSS (0) — — · — · —

Package size: @astryxdesign/core 7.29 MB packed (−187 B); no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 57 rows, core 36 rows; run pnpm api:report.

Wide change (shared styles: packages/core/src/theme/index.ts): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about Core's React Server Component module boundary: no current record owns it, since architecture:component-style-authoring leaves client entry points, directive placement and server-safe barrels to a separate module-boundary record and the proposed one (spec:AST-113) is still a draft.

An engineering owner needs to provide or identify that governing record and settle the release class, because a Server Component that passes a directive-free component by reference into a Client Component prop, such as <Markdown components={{inlineCode: Code, blockquote: Blockquote}}>, builds on main and fails at this head under Next.js 16.3.6 with Turbopack ("Functions cannot be passed directly to Client Components"); the owners decide whether this ships as the patch [fix] the changeset declares or as [breaking] in a declared minor with a migration note. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request or approving at this head, and the author may do so as an engineering owner.

The fix itself reproduces: the webpack "export *" in a client boundary failure and the Turbopack client reference on main are gone here, the new barrel and root tests fail on main and pass here, and the failing test-node (3/4) check fails the same way on main.

[Automated review]

Comment thread .changeset/root-entry-server-module.md Resolved
…barrels

A barrel runs no code, so its directive only turns every module it
re-exports into a client reference. Inside a React Server Component, a
root import therefore rendered every component as a client reference,
including the ones that ship without the directive. Each module now
carries its own directive. A test keeps every pass-through barrel free of
it and checks that the root's server graph reaches client-only React APIs
only through 'use client' modules.
The plugin renderer subpath is a client-only entry by contract, and it
re-exports nothing but a client module, so its directive changes nothing.
The barrel test now allows the directive on a pass-through barrel only when
every module the barrel re-exports is a client module, and fails for any
barrel that would turn a server module into a client reference.
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 70d7c80

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about Core's React Server Component module boundary, and one fix is needed either way.

No current record owns client entry points, directive placement or server-safe barrels (architecture:component-style-authoring leaves them to a separate module-boundary record, and spec:AST-113 is still a draft), and a Server Component that passes a directive-free component into a Client Component prop, such as <Markdown components={{inlineCode: Code}}>, builds on main and fails at this head with Next.js 16.3.6; an engineering owner decides whether that ships as the patch [fix] the changeset declares or as [breaking] in a declared minor, and records it by commenting /approve-spec <full head SHA> or approving at this head (the author may do so as an engineering owner).

  • Miss: Selector/SelectorOption.tsx calls useSelectorRowLayout() and renderIconSlot() from client modules but has no 'use client' of its own, so once the Selector and root barrels lose their directive a Server Component that renders <SelectorOption label="Apple" /> builds on main and fails at this head with "Attempted to call useSelectorRowLayout() from the server"; add the directive to SelectorOption.tsx and make the root server-graph test fail when a directive-free module calls a value imported from a 'use client' module.

The webpack "export *" in a client boundary failure and the Turbopack root client reference on main are gone at this head, and the new barrel and root tests fail on main and pass here.

[Automated review]

Comment thread packages/core/src/Selector/index.ts Resolved
SelectorOption calls useSelectorRowLayout() and renderIconSlot() while it
renders, and both come from 'use client' modules. Only the Selector barrel's
directive made it a client module, so a Server Component that rendered it
would fail once the barrel lost the directive. The server-graph test now also
fails when a server module calls, constructs or reads a property of a value
from a 'use client' module while it renders or evaluates.
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 98fd6fc

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: CI passed on this head.

An engineering owner's /approve-spec for this head settles the open question about making the package root and the family barrels server modules, and about shipping the change to how Server Components pass components into Client Component props as a patch [fix]. The earlier SelectorOption finding is fixed: it now keeps its own 'use client', and the server-graph test fails if a server module calls a client-module value during render. No blocking findings remain.

One small optional follow-up: the description still says no module with runtime code changes, but SelectorOption.tsx now gains a directive.

Automated review (maintainer link)

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

Thanks @rhagigi! Your server-component work in #8443, and the measurements behind it, are what showed that the package root's 'use client' was turning every Astryx component into a client reference inside Server Components. This PR builds directly on that.

(agent-assisted)

@imdreamrunner
imdreamrunner merged commit 108f354 into main Nov 11, 2026
78 checks passed
@github-actions
github-actions Bot deleted the xinzi/root-entry-server-module branch November 11, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 98fd6fc2 Deployed Nov 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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