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 into
masterfrom
react-19
Closed

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

Conversation

@dmytrokirpa

@dmytrokirpa dmytrokirpa commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

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.

@dmytrokirpa dmytrokirpa self-assigned this Sep 22, 2025
@@ -0,0 +1,7 @@
{

@github-actions github-actions Bot Sep 22, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 182 Changed
vr-tests-react-components/Positioning.Positioning end.chromium.png 892 Changed

@github-actions

github-actions Bot commented Sep 22, 2025

Copy link
Copy Markdown

📊 Bundle size report

✅ No changes found

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

Comment thread packages/react-components/react-components/package.json Outdated
@Hotell

Hotell commented Sep 23, 2025

Copy link
Copy Markdown
Contributor

changes LGTM, needs PR description tweaks ( discussed offline )

@dmytrokirpa
dmytrokirpa marked this pull request as ready for review September 24, 2025 14:42
@dmytrokirpa
dmytrokirpa requested a review from a team as a code owner September 24, 2025 14:42
@dmytrokirpa
dmytrokirpa requested a review from Hotell September 24, 2025 14:42
@dmytrokirpa

Copy link
Copy Markdown
Contributor Author

Closing this in favor of #35285

@dmytrokirpa dmytrokirpa closed this Oct 9, 2025
@dmytrokirpa
dmytrokirpa deleted the react-19 branch December 4, 2025 09:47
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