Most projects in the JavaScript/TypeScript ecosystem release new versions with numbers respecting semantic versioning, or semver for short. Semver is a specification that describes how to predictably increase a package's version numbers upon each new release. TypeScript is notable for not following a strict interpretation of semver for its releases. This article will dig into:
- What semver is and why it's useful for many packages
- Why following a strict interpretation of semver would be impractical for TypeScript
- How TypeScript's releases are versioned to an interpretation of semver that makes sense for it
While TypeScript's diverging from a common community specification can be irksome for developers, there are real reasons why it chose to diverge.
The reasoning can be summarized as:
- Nuances of TypeScript's type checking change in virtually every release
- It would be impractical to increase TypeScript's major version for every type checking change
- If we consider those type checking nuances as details rather than the public API, TypeScript actually has quite good adherance to semantic versioning
This article will also more deeply explain each of those points.