Skip to content

change peer dependent bump type to patch - #2090

Merged
beeequeue merged 8 commits into
mainfrom
peer-bumps
Jun 24, 2026
Merged

change peer dependent bump type to patch#2090
beeequeue merged 8 commits into
mainfrom
peer-bumps

Conversation

@beeequeue

@beeequeue beeequeue commented Jun 12, 2026

Copy link
Copy Markdown
Member

this PR changes the bump type for peer dependents from major to patch.

i think this is the best default behavior. the previous major bump is motivated due to Changesets not being able to know whether the changes in the peerDep are passed through the dependent, therefore we assume all changes are.

with this new bump strategy, we hand over the responsibility for knowing how the dependent should be bumped to the maintainers, rather than forcing major onto them.

if the change is not surfaced in the dependent, they can keep the patch bump.

if the change does require action from the users, this is a breaking change for the dependent (no matter how Changesets bumps it automatically), and the maintainer should add a changeset describing it (like always).

closes #524
closes #822
closes #827 (bring for v3.1 or v4: updatePeerDependentsAs)
closes #963
closes #1011
closes #1126
closes #1132 (bring for v3.1 or v4 discussion)
closes #1228
closes #1279
closes #1600 (bring for v3.1 or v4 discussion)
closes #1759
closes #1887

@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b532e10

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@changesets/assemble-release-plan Major
@changesets/cli Major
@changesets/get-release-plan Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@beeequeue
beeequeue requested review from Andarist and bluwy June 12, 2026 07:39
@beeequeue
beeequeue force-pushed the peer-bumps branch 2 times, most recently from 5bd02dc to 2112841 Compare June 23, 2026 06:58
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.34%. Comparing base (813bbf3) to head (b532e10).

Files with missing lines Patch % Lines
packages/assemble-release-plan/src/test-utils.ts 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2090      +/-   ##
==========================================
- Coverage   85.47%   85.34%   -0.13%     
==========================================
  Files          66       66              
  Lines        2547     2545       -2     
  Branches      704      697       -7     
==========================================
- Hits         2177     2172       -5     
- Misses        340      343       +3     
  Partials       30       30              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@beeequeue beeequeue changed the title change peer dependent bump type change peer dependent bump type to patch Jun 23, 2026
@beeequeue
beeequeue marked this pull request as ready for review June 23, 2026 07:38
"packages/pkg-b/package.json": JSON.stringify({
name: "pkg-b",
version: "1.0.0",
peerDependencies: { "pkg-a": "workspace:^" },

@beeequeue beeequeue Jun 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this test was wrong for a long time 😄

@bluwy bluwy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like we can also remove the onlyUpdatePeerDependentsWhenOutOfRange option now but we can do that later.

@beeequeue

Copy link
Copy Markdown
Member Author

we can also remove the onlyUpdatePeerDependentsWhenOutOfRange option

me trying to do that is part of why this took so long, we actually can't because it technically has a different effect than this.

it really is just a duplication (+inversion) of the updateInternalDependencies option, specifically for peer dependencies.
it's not really about how the peer dependents should be bumped alongside their dependency, but rather whether the version ranges should be updated to match the new versions.

so we need to keep it for now, and maybe hopefully merge it into updateInternalDependencies or some other new option

@beeequeue
beeequeue added this pull request to the merge queue Jun 24, 2026
Merged via the queue into main with commit 3aae903 Jun 24, 2026
11 of 12 checks passed
@beeequeue
beeequeue deleted the peer-bumps branch June 24, 2026 21:30
@theoephraim

theoephraim commented Jun 25, 2026

Copy link
Copy Markdown

Nice to see this finally land! The always major behavior was easily the most-cited papercut.

Sharing some prior art in case it's useful for a future iteration: I've been building a changesets successor (bumpy) and this exact problem was the first thing I dug into. Landed somewhere a bit different and figured the reasoning might be worth a data point.

Two axes turned out to matter independently:

1. When to bump the peer dependent. bumpy only bumps it when the new version actually falls out of the dependent's declared range. A caret range absorbing an in-range minor bump produces no release at all -- which kills a lot of the churn people complain about, before you even get to "what level."

2. What level to bump it to. Instead of a fixed constant, the default matches the triggering bump (major→major, minor→minor, patch→patch) and only fires when the new version actually leaves the dependent's declared range. The thinking: the out-of-range case is precisely when the dependent's contract genuinely changed -- if core goes 1→2, a consumer can no longer pair the dependent with core 1.x, which is breaking for the dependent too. A flat patch there leans on the maintainer to remember to hand-write a major changeset; if they forget, you publish a patch that silently requires a new major peer.

That said patch-by-default is a totally reasonable call, and I don't think there's a single correct constant. match is still a heuristic and can over-bump (core can go major for reasons that never touch what the dependent re-exposes). Which is really the bigger point: rather than hardcode any constant, bumpy makes both the trigger threshold and the resulting level configurable per-package or globally:

{
  // proactive mode — opt-in; default is range-gated "match"
  "updateInternalDependencies": "patch",
  "dependencyBumpRules": {
    "peerDependencies": { "trigger": "patch", "bumpAs": "patch" }, // equivalent to this PR
  }
}

So a team that wants the old always-major, the new always-patch, or proportional can all get it, and override it for the one package that's special. That configurability is what a bunch of the closed issues here were actually asking for (#827, #1228), beyond just "stop defaulting to major."

Writeup with the full propagation algorithm is here if it's useful. Not trying to pitch, just figured the design space exploration might save you some cycles. Happy to go deeper on any of it.

@beeequeue

Copy link
Copy Markdown
Member Author

thank you for the thoughtful comment!

you're right that this doesn't properly address some of the closed issues, but this change acts as temporary improvement for v3 as we don't want to delay its release any more than necessary.

we will discuss how to improve this further for v3.1 or v4 in a new issue, and will make sure to bring the feedback from the closed ones into it

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