Skip to content

Preserve bounds when updating dependency ranges - #2297

Merged
Andarist merged 3 commits into
mainfrom
preserve-bounded-dependency-ranges
Sep 14, 2026
Merged

Andarist merged 3 commits into
mainfrom
preserve-bounded-dependency-ranges

Conversation

@Andarist

@Andarist Andarist commented Sep 10, 2026

Copy link
Copy Markdown
Member

fixes #2271

I agree the other ranges are more idiomatic, but we should try to respect the authored ranges as much as we can to avoid surprising results

@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1256f95

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

This PR includes changesets to release 2 packages
Name Type
@changesets/apply-release-plan Patch
@changesets/cli 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

@netlify

netlify Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploy Preview for changesets ready!

Name Link
🔨 Latest commit 1256f95
🔍 Latest deploy log https://app.netlify.com/projects/changesets/deploys/6aa6cbc76cc42400088ef9e3
😎 Deploy Preview https://deploy-preview-2297--changesets.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Andarist
Andarist requested review from beeequeue and bluwy September 10, 2026 09:51
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.77%. Comparing base (5e54cd9) to head (1256f95).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2297      +/-   ##
==========================================
+ Coverage   84.57%   86.77%   +2.19%     
==========================================
  Files          80       78       -2     
  Lines        3177     2956     -221     
  Branches      896      841      -55     
==========================================
- Hits         2687     2565     -122     
+ Misses        433      347      -86     
+ Partials       57       44      -13     

☔ 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.

@Andarist
Andarist force-pushed the preserve-bounded-dependency-ranges branch from 57b5cd5 to 675466f Compare September 10, 2026 10:04
@beeequeue

Copy link
Copy Markdown
Member

while i do agree that we shouldn't break the ranges, i'm not sure updating them is the best solution...

i think that when somone defines a complex range like this it is for a specific reason, e.g. supporting all except the latest major versions, so it getting changed would probably not be desired

maybe we should just warn that we saw a complex version range and that they should review and update it themselves? if it would be too invisible in the version command we could show it somewhere in changeset add

@Andarist

Copy link
Copy Markdown
Member Author

I think it's OK to infer probable intent for simple ranges like this one here. But the general problem ofc stays unsolved by this PR - so I agree that further warnings etc for more complex scenarios would be good to add

The baseline is that we establish a dependency between a package and its dependent - so it's implied the current package should be in its range (lower bound should really accept it). The upper bound is usually just forward-looking in some sense. Because u can't really know what you are going to release in a few months. But we need to preserve the intention and not drop it. It gets iffy when we end up having to change that upper bound... but then we just infer a sensible behavior

Such ranges make way more sense for packages outside of the user's control - and especially for already published versions of packages (and not for versions that might get released in the future)

Comment thread .changeset/calm-ranges-stay.md Outdated
@beeequeue

Copy link
Copy Markdown
Member

Such ranges make way more sense for packages outside of the user's control

that makes sense, this is internal packages only. 😄

@Andarist
Andarist added this pull request to the merge queue Sep 14, 2026
Merged via the queue into main with commit 3f163da Sep 14, 2026
19 checks passed
@Andarist
Andarist deleted the preserve-bounded-dependency-ranges branch September 14, 2026 13:13
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.

changeset version drops the upper bound of a compound (>=x <y) dependency range, silently

3 participants