Skip to content

feat(react-components): move react-alert, react-infobutton, and react-virtualizer to optional peerDependencies#35217

Closed
dmytrokirpa wants to merge 5 commits intomasterfrom
react-19
Closed

feat(react-components): move react-alert, react-infobutton, and react-virtualizer to optional peerDependencies#35217
dmytrokirpa wants to merge 5 commits intomasterfrom
react-19

Conversation

@dmytrokirpa
Copy link
Copy Markdown
Contributor

@dmytrokirpa dmytrokirpa commented Sep 22, 2025

This PR resolves React 19 peer dependency conflicts by moving @fluentui/react-alert,
@fluentui/react-infobutton, and @fluentui/react-virtualizer from direct dependencies to optional peer dependencies in the @fluentui/react-components package.

Problem

The deprecated packages exported through /unstable were causing peer dependency issues when
installing @fluentui/react-components with React 19:

WARN Issues with peer dependencies found

.
└─┬ @fluentui/react-components 9.70.0
  ├─┬ @fluentui/react-alert 9.0.0-beta.124
  │ ├── ✕ unmet peer react@">=16.14.0 <19.0.0": found 19.1.0
  │ ├── ✕ unmet peer react-dom@">=16.14.0 <19.0.0": found 19.1.0
  ├─┬ @fluentui/react-infobutton 9.0.0-beta.102
  │ ├── ✕ unmet peer react@">=16.14.0 <19.0.0": found 19.1.0
  │ ├── ✕ unmet peer react-dom@">=16.14.0 <19.0.0": found 19.1.0
  └─┬ @fluentui/react-virtualizer 9.0.0-alpha.102
    ├── ✕ unmet peer react@">=16.14.0 <19.0.0": found 19.1.0
    ├── ✕ unmet peer react-dom@">=16.14.0 <19.0.0": found 19.1.9

These packages:

  • Are already deprecated and shouldn't be used in new projects
  • Have been removed from the monorepo but remain as dependencies
  • Don't support React 19 in their peer dependency ranges
  • Are only kept for backward compatibility until the next major release

Solution

  • Move the three problematic packages to optionalPeerDependencies
  • This maintains backward compatibility for existing users who rely on /unstable exports
  • Prevents installation issues for new users adopting React 19
  • Aligns with the deprecation strategy - these packages are optional and discouraged

What Users Need to Do

  • If you are not yet on React 19 and still use /unstable components:
    • You must manually install the relevant packages (@fluentui/react-alert, @fluentui/react-infobutton, or @fluentui/react-virtualizer) in your project.
  • If you are migrating to React 19:
    • You should migrate away from /unstable exports, as these packages will not resolve peer dependencies with React 19 and manual installs will fail.

Benefits

  • ✅ Enables smooth React 19 adoption without peer dependency conflicts
  • ✅ Maintains backward compatibility for existing /unstable users
  • ✅ Follows semantic versioning - no breaking changes
  • ✅ Prepares for eventual removal in next major version

Testing

  • Verified installation works with React 19 without peer dependency warnings
  • Existing functionality remains unchanged for current users

This change supports the transition strategy for deprecated unstable components while enabling React 19 compatibility.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants