...

/

Semantic Versioning Explained

Semantic Versioning Explained

This lesson explains semantic versioning in detail with respect to the factor of having an API or not. Moreover, we also take a look at the problems faced due to custom versioning instead of semantic versioning.

Semantic versioning

Semantic versioning is easy to explain and leaves very little to interpretation. We have three numbers called major, minor, and patch. If we increment minor, a patch is reset to zero or one. Similarly, if major is incremented, both the minor and the patch are set to zero or one. The number that is incremented depends on the type of change we’re releasing.

Given a version number MAJOR.MINOR.PATCH, we will increment each of the segments using the rules that follow:

  • PATCH is incremented when we release bug fixes.
  • MINOR is incremented when new functionality is added in a backward-compatible manner.
  • MAJOR is incremented when changes are not backward compatible.

Versioning for an application having an API

If, for example, our application has an API, incrementing the major version would be a clear signal to our users that they would need to adapt or continue using the previous (older) major version (assuming we keep both, as we should). ...