Glossary Development

Semantic Versioning (SemVer)

Semantic versioning is a numbering scheme, MAJOR.MINOR.PATCH, in which each number tells users whether an update can break their code.

Last reviewed:

AdSense Placeholder
Slot: header_reference_page

In more detail

A version is written MAJOR.MINOR.PATCH, for example 2.4.1. Increase MAJOR for incompatible changes to the public interface, MINOR for new features that keep working code working, and PATCH for backward-compatible bug fixes. A hyphen adds a prerelease label (2.5.0-beta.1, which sorts before 2.5.0) and a plus sign adds build metadata (2.5.0+20261028) that is ignored when comparing. Versions below 1.0.0 are treated as unstable, where any change may break compatibility.

Why it matters

Package managers use the numbers to pick updates automatically. A range such as ^2.4.1 accepts any 2.x release from 2.4.1 upward but not 3.0.0, which is only safe if authors follow the rules. Breaking the contract, for instance changing behaviour in a patch release, is a frequent cause of "it worked yesterday" builds. Test ranges with the Semver Range Checker.

Example

Starting from 1.4.2: a bug fix gives 1.4.3; a new backward-compatible feature gives 1.5.0 (patch resets to 0); removing a function gives 2.0.0 (minor and patch reset). The range ~1.4.2 accepts 1.4.9 but not 1.5.0.

AdSense Placeholder
Slot: footer_leaderboard