mirror of
https://github.com/semver/semver.git
synced 2026-07-11 03:53:53 -05:00
[GH-ISSUE #1175] Question: how does pre-release compare to the previous version? #6687
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @peter-jerry-ye on GitHub (Nov 11, 2025).
Original GitHub issue: https://github.com/semver/semver/issues/1175
Per implementation like semver in Rust and Deno (ported from node I assume), they all think that,
1.1.0-predoes not satisfies>= 1.0.0.Per the spec, however, it only says
Based on which the first difference would be minor in the case of
1.0.0and1.1.0-alpha.So, my question is, should
1.1.0-preconsidered to be>= 1.0.0? (Both case makes sense for me but I just want a clarification)@steveklabnik commented on GitHub (Nov 11, 2025):
The Rust and Deno interpretations are generally what people do. A pre-release is not a released version, and so doesn't compare with regular versions, the only way you get a pre-release is if you ask for one.
@peter-jerry-ye commented on GitHub (Nov 11, 2025):
I understand that they do compare with regular version, but only defined when comparing with their associated regular version
Or put it in other words. The 'precedence` defined in the spec is not really what we expect when people define 'range' or 'VersionReq'
@ljharb commented on GitHub (Nov 11, 2025):
Semver doesn't currently have ranges, but if it matches #584, prereleases would never be included by default, nor should they be.
@peter-jerry-ye commented on GitHub (Nov 11, 2025):
I see there's a duplicated issue #631 so I'm closing this one.
In reality, I understand that there are cases where we don't want to search for a pre-release version, but the opposite cases exist. I think I would agree with https://github.com/semver/semver/issues/631#issuecomment-1123068190 : the precedence operators should work with precedence. If prereleases were not included, their precedence should not be defined along with the others, which is sadly the case now.