BBV logo

Part 2 - Semantic versioning. Releases at a glance.

Matias Mendoza

27 April, 2020 - 2 min read

Most of modern software applications has dependency on many packages, each one with its own development flow in different stages. You may have heard about "dependency hell", which is where you are when you can't upgrade your project without the huge risk of breaking the dependency tree.

Semantic Versioning (SemVer)

With the idea of defining a standard way of naming each version and tracking when there are new breaking changes, Semantic Versioning was created as a simple set of rules and requirements that dictate how version numbers are assigned and incremented.

This is how it looks like:

And this is how you should upgrade:

  • Major: This number is incremented when changes on the code makes the exposed API incompatible with backwards versions.
  • Minor: This number is incremented when there are new features without breaking API backwards compatibility. It returns to 0 when major is incremented.
  • Patch: This number is incremented when there are just bug fixes a no new features. It returns to 0 when major or minor is incremented.
  • Pre-release: It's an optional identifier which indicates a non official version (yet). (E.g. if version 8.6.2 is not ready yet, the pre-relase should be 8.6.2-beta)
  • Build: This final section is only in order to track build metadata version.

Referencing

When using a package manager, you can reference a fixed dependence version or a dynamic one (E.g. give me always the latest package version). In the second case, you can do it with the following rules:

  • To reference a group of versions, you can use x, X or *. For example, 1.x.x (it's equivalent to >= 1.0.0, < 2.0.0) or 1.2.x Β (it's equivalent to >= 1.2.0, < 1.3.0).
  • You can reference an explicit group of versions allowed as 1.2.3 - 4.5.6 (it's equivalent to >= 1.2.3, <= 4.5.6).
  • To keep only major version, you can use ^ symbol. For example, ^1.2.3 is referencing all 1.x.x versions above 1.2.3 (it's equivalent to >= 1.2.3, < 2.0.0).
  • To keep major and minor versions, you can use ~ symbol. Β For example, ~1.2.3 is referencing all 1.2.x versions above 1.2.3 (it's equivalent to >= 1.2.3, < 1.3.0).

Other versioning systems πŸ€·πŸ»β€β™‚οΈ

Apple

  • Iphone: 3 β€”> 4 β€”> 5 β€”> 6 β€”> 7 β€”> 8 β€”> X (?)

Samsung

  • Galaxy Note: 2 β€”> 3 β€”> 4 β€”> 5 β€”> 7 (?) β€”> 8 β€”> 9 β€”> 10

Microsoft

  • Windows: Β 7 β€”> 8 β€”> 10 (?)

😁😁

Thanks a lot for reading! Remember this post is part of β€œFrom Zero to Hero: Painless way of building a great Javascript library” series.
See you next time at: β€œπŸΉ Part 3 - Making your Javascript library in less than five minutes with Pika.” !

Matias Mendoza

Co-Founder & COO

Subscribe for latest updates

Sign Up for our newsletter and get notified when we publish new articles for free!

Maybe you could be interested to read