Repository navigation
perf: drop native props allow-list from Link, Text, Spinner, ProgressBar, Provider, InfoButton, Rating, Breadcrumb, AvatarGroup, Toolbar and Card hooks - #37193
Open
Dmytro Kirpa (dmytrokirpa) wants to merge 15 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the Link prop-forwarding changes.
No open issues 🎉
What changed in this PR
This PR continues the native-props allow-list removal started in #37188. The reviewed changes cover Link, reducing its dependency on filtering utilities while forwarding remaining props directly to the root slot.
Changes:
- Replace Link’s native-props filtering with direct spreading, excluding
disabledanddisabledFocusable. - Add tests checking that component-only props and anchor
disableddo not reach the DOM. - Add a patch change file for
@fluentui/react-link.
| File | Description |
|---|---|
packages/react-components/react-link/library/src/components/Link/useLink.ts |
Forward root props without the native-props allow-list. |
packages/react-components/react-link/library/src/components/Link/Link.test.tsx |
Add DOM-attribute and React-warning assertions. |
change/@fluentui-react-link-no-native-props-filter.json |
Record the Link bundle-size optimization for release. |
Review effort: Balanced
📊 Bundle size reportUnchanged fixtures
|
Dmytro Kirpa (dmytrokirpa)
requested a review
from Paul Mardling (PaulGMardling)
November 23, 2026 12:34
Paul Mardling (PaulGMardling)
approved these changes
Nov 23, 2026
Paul Mardling (PaulGMardling)
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. Nice bundle-size reduction, and the prop-forwarding changes are consistent across the components.
Just need to sort out the renderHook import issue
This branch has not been deployed
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.


Batch 3 of the
getIntrinsicElementPropsremoval, follow-up to #37188.Previous Behavior
The state hooks of Link, Text, Spinner, ProgressBar, FluentProvider, InfoButton (react-infolabel and the headless copy), Rating, RatingDisplay, RatingItem, Breadcrumb, BreadcrumbItem, BreadcrumbDivider, AvatarGroup, Toolbar, ToolbarGroup, Card, CardHeader, CardFooter and CardPreview passed root props through the per-tag native props allow-list (
getIntrinsicElementPropsfrom@fluentui/react-utilities). That allow-list costs ~2.9 kB minified in every headless entry that imports it.New Behavior
Each hook now destructures its own non-DOM props and spreads the rest onto the root, the same way
useButtonBase_unstableand the #37188 hooks do:disabled,disabledFocusable(disabledis still set on<button>roots byuseLinkState_unstable, as before).align,block,font,italic,size,strikethrough,truncate,underline,weight,wrap.delay,labelPosition,label,spinner,spinnerTail.value,max,bar.applyStylesToPortals,customStyleHooks_unstable,dir,targetDocument,theme,overrides_unstable.diris still rendered on the root.size,inline,popover,info. Only the filter call is gone.value,defaultValue,max,name,onChange,step,itemLabel,iconFilled,iconOutline. RatingDisplay:value,max,count,compact,icon,valueText,countText. RatingItem:valueand its four slots.focusMode,list(unchanged).BreadcrumbItemnow dropssizein the styled hook. Size comes from context, and before this change the allow-list removed it.layout. (AvatarGroupItem never used the filter.)vertical,checkedValues,defaultCheckedValues,onCheckedValueChange. The styled hook now dropssizebefore calling the base hook. ToolbarGroup: no own props.disabled,focusMode,selected,defaultSelected,onSelectionChange,shouldRestrictTriggerAction,floatingAction,checkbox. CardHeader/CardFooter/CardPreview: their slots.Behavior changes (accepted for the whole series):
dangerouslySetInnerHTMLare intentionally not excluded.Tests: each component has a "DOM attributes" test. It renders with every non-DOM prop, expects no
console.error, and checks the root's attribute names. Base hooks that headless calls directly (Link, Spinner, ProgressBar, Rating, RatingDisplay, AvatarGroup, Toolbar, Card) anduseFluentProvider_unstablealso getrenderHooktests that check those props do not reach the root slot.