Skip to content

feat: add dedupePeers option to reduce peer dependency duplication#11079

Merged
zkochan merged 1 commit into
v10from
v10-dedupe-peers
Mar 24, 2026
Merged

feat: add dedupePeers option to reduce peer dependency duplication#11079
zkochan merged 1 commit into
v10from
v10-dedupe-peers

Conversation

@zkochan

@zkochan zkochan commented Mar 24, 2026

Copy link
Copy Markdown
Member

Summary

Backport of #11071 to v10.

  • Adds a new opt-in dedupePeers setting that reduces peer dependency duplication
  • Uses version-only peer identifiers (name@version) instead of full dep paths when building peer suffixes
  • Eliminates nested suffixes like (@emotion/react@11(react@18))(@emotion/react@11.0.0)
  • Transitive peers are still tracked (per-project isolation preserved), just identified by version instead of full dep path

Closes #11070

Test plan

  • Unit tests: version-only suffixes, transitive peers with version-only IDs, multi-project isolation (3 new tests in resolvePeers.ts)
  • Integration tests: single project + workspace with different peer versions (2 new tests in peerDependencies.ts)
  • All existing resolvePeers tests pass (14/14)

When enabled, peer dependency suffixes use version-only identifiers
(name@version) instead of full dep paths, eliminating nested suffixes
like (foo@1.0.0(bar@2.0.0)). Transitive peers are still tracked but
identified by version instead of full dep path.

Backport of #11071 to v10.

Closes #11070
@zkochan zkochan merged commit 28204a4 into v10 Mar 24, 2026
7 of 13 checks passed
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.

1 participant