Skip to content

fix(deps): sync react-dom peer dependency version with react#10195

Merged
GiladShoham merged 1 commit intomasterfrom
fix/sync-react-dom-peer-version
Feb 12, 2026
Merged

fix(deps): sync react-dom peer dependency version with react#10195
GiladShoham merged 1 commit intomasterfrom
fix/sync-react-dom-peer-version

Conversation

@GiladShoham
Copy link
Copy Markdown
Member

When the env has both react and react-dom as peer dependencies, but a component only imports react (not react-dom), the workspace install could pull an incompatible react-dom version. This ensures react-dom version stays in sync with react from the env's default peers.

Copilot AI review requested due to automatic review settings February 12, 2026 09:49
@GiladShoham GiladShoham enabled auto-merge (squash) February 12, 2026 09:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Ensures workspace installs don’t end up with an incompatible react-dom when an env defines both react and react-dom as peers but a component only directly imports react.

Changes:

  • When a component uses react as an env-provided peer, also inject react-dom (from the env’s default peer versions) into the component’s install manifest to keep versions aligned.

Comment on lines +222 to +231
// In case the env has peer dependencies on both react and react-dom, we want to make sure to keep the versions
// in sync with each other, otherwise it may cause issues in the workspace
// This is a special case for react and react-dom, as most component do import from react, making it a peer dependency,
// but not necessarily import from react-dom, which from env.jsonc peers in that case not added to the peers of the component.
// and if the versions are not in sync, it may cause issues in the workspace
// an example:
// my-comp depend on react, and using @testing-library/react which depend on react-dom (as peer),
// the component don't have react-dom as peer dependency, but when we install the dependencies in the workspace,
// it will install the latest version of react-dom which may not be compatible with the version of react that my-comp
// is using, and it may cause issues in the workspace.
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

This block comment is very long and repeats the same point several times, which makes the surrounding logic harder to read. Consider shortening it to a brief rationale + a compact example, and fix the grammar (e.g., “most components import”, “depends”, “doesn’t”).

Copilot uses AI. Check for mistakes.
@GiladShoham GiladShoham merged commit ab9ddbd into master Feb 12, 2026
18 checks passed
@GiladShoham GiladShoham deleted the fix/sync-react-dom-peer-version branch February 12, 2026 10:28
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.

3 participants