fix(react-headless-components-preview): publish context readers from the avatar-group, button, link and avatar subpaths - #36670
Conversation
…the avatar-group, button, link and avatar subpaths Several headless subpaths publish a context's values hook and types but not its reader, so a consumer composing their own parts cannot read what the subpath's own render functions already provide. The providers in the tree are Griffel's own context instances (the headless renderers are verbatim re-exports), so a locally-declared context can never receive the values — a re-export is the only fix available to a consumer. Adds dedicated context re-export modules for AvatarGroup, Button, Link and Avatar (mirroring the shape Toolbar/useToolbar.ts already uses), plus the matching barrel and subpath entries, and regenerates the affected etc/*.api.md reports. Additive only. Extracted from windmod branch commits 5a89364 and 9612d54 (headless hunks only). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aj9uA3rCVgosnh2zNn8qkc
📊 Bundle size report
Unchanged fixtures
|
|
Pull request demo site: URL |
Dmytro Kirpa (dmytrokirpa)
left a comment
There was a problem hiding this comment.
lets remove the unnecessary use client directives and comments. Otherwise, it looks ready to go. Thanks for the contribution!
| @@ -0,0 +1,7 @@ | |||
| { | |||
| "type": "patch", | |||
| "comment": "fix: publish context readers (and providers where the package owns them) from the avatar-group, button, link and avatar subpaths so consumers can read the look context the package's own renderers provide", | |||
There was a problem hiding this comment.
nit: could we simlpify/shorten this a bit?
There was a problem hiding this comment.
Done — shortened the change-file description to one sentence in 28f58bc.
| @@ -0,0 +1,17 @@ | |||
| 'use client'; | |||
There was a problem hiding this comment.
we might not need the use client directive here is it's just a re-export, not an actual hook
There was a problem hiding this comment.
Done — removed use client from buttonContext.ts and the other three same-shape re-export files (avatarContext, avatarGroupContext, linkContext) in 28f58bc.
| @@ -0,0 +1,17 @@ | |||
| 'use client'; | |||
|
|
|||
| /** | |||
There was a problem hiding this comment.
lets cleanup the comment as it too verbose and probably unnecessary
There was a problem hiding this comment.
Done — trimmed the comment to one line, and the same-shape comments in the other three context files, in 28f58bc.
…ort context files and trim comments

Several headless subpaths publish a context's values hook and its types but not the reader — so a consumer composing their own parts cannot read what the subpath's own render functions already provide. For Button/Link/Avatar the provider side was already correct: the headless renderers are verbatim re-exports of Griffel's and already wrap subtrees in Griffel's
ButtonContextProvider/LinkContextProvider/AvatarContextProvider. Because those are Griffel's own context instances, a locally-declared context can never receive the values — a re-export is the only fix available to a consumer. One measured symptom: a composed Button inside a headlessMessageBarActionsrendered medium where the@fluentui/react-componentsequivalent renders small, because the size the provider was already publishing was unreachable.This adds dedicated context re-export modules for AvatarGroup (reader + provider), Button, Link and Avatar — the shape
Toolbar/useToolbar.tsalready uses — plus the matching barrel and subpath entries, and regenerates the affectedetc/*.api.mdreports. Additive only; nothing that exists today changes meaning.The issue also inventories three further sites with the same gap (TagGroup, InteractionTag, Accordion) that are not part of this PR, so the audit trail stays in one place.
Fixes #36652.
Extracted from #36656 per maintainer request — each in-tree fix from that PR as an isolated change.