fix(react-headless-components-preview): publish context readers from the button and link subpaths and context providers from avatar and avatar-group - #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
|
|
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!
…ort context files and trim comments
|
Copilot resolve the merge conflicts in this pull request |
…ath-context-readers-36652 # Conflicts: # packages/react-components/react-headless-components-preview/library/src/avatar.ts # packages/react-components/react-headless-components-preview/library/src/components/Avatar/index.ts
…verging on microsoft#36659's readers Avatar/AvatarGroup context readers now come from upstream microsoft#36659; this PR's remaining unique contribution there is the provider re-exports (AvatarContextProvider, AvatarGroupProvider), which microsoft#36659 does not add. Button and Link still gain both readers and providers.
|
Conflicts resolved by converging on #36659's Avatar/AvatarGroup context reader location ( |
Dmytro Kirpa (dmytrokirpa)
left a comment
There was a problem hiding this comment.
lets clean up a few comments, and it will be ready to go.
Thanks for your contribution!
…omments Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013wmpBCYJpDJCLXcScCWz1i
|
Copilot resolve the merge conflicts in this pull request |
|
Resolved the conflict with current master in 89473e3. The regenerated Avatar API report retains upstream's Validation: headless build and its dependencies pass; all 79 headless test suites / 1,083 tests pass. I regenerated all 56 API entry points using the Windows path normalization from #36672 temporarily for local verification; that unrelated tooling fix is not included in this PR. GitHub now reports this branch as mergeable. |
There was a problem hiding this comment.
🟢 Approval recommended
The additive exports use the original context instances, expose them through the intended subpaths, and have matching API reports and release metadata.
Pull request overview
Publishes the existing Fluent context instances through the relevant headless component subpaths, enabling custom compositions to consume provided context values.
Changes:
- Re-exports Button and Link context readers/providers.
- Re-exports Avatar and AvatarGroup context providers.
- Updates API reports and adds a patch change file.
Merge confidence: 100/100.
File summaries
| File | Description |
|---|---|
library/src/link.ts |
Publishes Link context APIs. |
library/src/components/Link/linkContext.ts |
Re-exports Link context symbols. |
library/src/components/Link/index.ts |
Adds context barrel exports. |
library/src/components/Button/index.ts |
Adds Button context exports. |
library/src/components/Button/buttonContext.ts |
Re-exports Button context symbols. |
library/src/components/AvatarGroup/index.ts |
Exports the group provider. |
library/src/components/AvatarGroup/avatarGroupContext.ts |
Re-exports the group provider. |
library/src/components/Avatar/index.ts |
Adds Avatar context exports. |
library/src/components/Avatar/avatarContext.ts |
Re-exports Avatar context symbols. |
library/src/button.ts |
Publishes Button context APIs. |
library/src/avatar.ts |
Publishes Avatar context APIs. |
library/src/avatar-group.ts |
Publishes the AvatarGroup provider. |
library/etc/link.api.md |
Updates the Link API report. |
library/etc/button.api.md |
Updates the Button API report. |
library/etc/avatar.api.md |
Updates the Avatar API report. |
library/etc/avatar-group.api.md |
Updates the AvatarGroup API report. |
change/@fluentui-react-headless-components-preview-1ad24eb7-8982-4492-96e7-879d01f0de2b.json |
Records the patch release. |
Review details
- Files reviewed: 17/17 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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 Button and Link (reader + provider) and for Avatar and AvatarGroup (provider only — their readers landed upstream in #36659 while this PR was open, and this branch has been rebased to converge on that location rather than duplicate it) — 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.