Discussion on: What is backwards compatible?

eruizdechavez profile image
Erick Ruiz de Chavez

@adam_cyclones it does not really matter whether your code is going to be a public API or just a web app, using Semver can be really useful for your own code so you know when a change is a major breaking change, a new feature or just a small bug fix. @dansilcox 's response is pretty clear about what those main numbers mean, but there are other pieces defined by Semver that could be useful (like labels and metadata).

The way I use it currently in my work while working on several internal WordPress themes and plugins is mainly like this:

  • Am I just doing bug fixes or small tweaks? This is a patch release, so just bump (increase) the patch version by one.
  • Am I adding a new feature? This is a minor release, so bump the minor number (and reset patch to 0).
  • Am I introducing some changes that could break other sites (hence breaking changes)? Am I completely rewriting something? Does anyone else (other plugins, other themes, something else) need to update their code because of my changes? This is definitely a major release, so bump the major version (and reset minor and patch to 0).

Understanding Semver should not require hours (or days) of study, and it will pay forward to understand it.