The trade-off for getting millions of dollars of engineering investment in the TypeScript project is that marketing gets to control version numbers to a certain extent.
It's not really an unalloyed good anyway. If we followed semver rules exactly, literally every single release would be a major version bump. Any time we produced the wrong type or emitted the wrong code or failed to issue a correct error, that's a breaking change, and we fix dozens of bugs like that in every release. The middle digit just isn't useful for TypeScript in a strict semver interpretation.
Certainly annoying, but no one would pay as much attention to TS releases if we were at v40 already. Given that TypeScript is a pretty central part of the ecosystem it's acceptable pain imo, but I really hope that no other, smaller package authors see that and decide to ignore semver because TS does.
Dunno, I always thought Semantic Versioning specially for projects with breaking changes regularly should be a thing.
I don't like their current system though, Major versions should be reserved for... well... major milestones like reaching the first full featured version or adding a major new feature or completely changing how the thing works. Kind of like a difference between breaking changes one could relatively easily migrate to and breaking changes would require significant work to migrate.
I guess simply leaving off the patch number of a semantic version would be pretty confusing but you get what I mean, a standardized, easily comparable way in the vein of semantic versioning but with only minor and major parts. It should probably have some kind of identifier so it's easy to differentiate from regular semantic versioning, especially since minor changes in semantic versioning shouldn't be breaking. maybe one could a a letter to the minor part or something like that. Like so: "1.b3.3". The "b" indicating a minor version that should be expected to contain breaking changes. Note that there is still a third part for non breaking patches but I would consider that optional.
I don't know if this goes completely against the idea behind semantic versioning, I also don't think it must be this, I'd just like a standard with similar adoption. Ubuntu's system is pretty robust too and if a standardized notation is set then it would be equally easy to compare versions with each other So maybe that can be the standard. In the end what I really want is a system that allows dependency management tools and programmers alike to see at a glance that minor versions may contain breaking changes, similar to how the semantic versioning standard tells us to expect breaking changes with major version. The form of this I don't really care about.
In the end, as long as the version keeps going up instead of down, I'm fine with it. It may be a bit inconvenient but it's like there's a risk to accidentally confuse a new release for an older one.
I wouldn’t say that fixing a bug should require a major version bump.
I don’t remember where but Rust has a document that outlines the kinds of changes that are considered breaking. It explicitly states that fixing soundness bugs isn’t considered a breaking change even though it might require users to change their code.
The situation of TS is very different to what Rust does though. Rust has very well-defined sound typing; for every piece of correct code, there is parts of the documentation explaining why it is correct. TypeScript is very different, it's not sound at all and the compiler letting code pass through doesn't mean it's actually correct. Instead, TypeScript helps you by catching as many errors as possible - and with any new release, it might help you find more errors. However, many of these things aren't documented at all, so deciding what's a breaking change is much harder.
For example, take Record<number, string> and Record<0 | 1 | 2, string>. The latter expects a value with ALL three keys (and they're all required): 0, 1, and 2, while the keys in the former are optional (the empty object would work). Special casing like that complicates typing rules by a lot - but it just so turned out to help catch the most errors for the wide variety of code written that uses Record.
Creating a precise specification for such a system while still giving the opportunity to extend it is nearly impossible.
For a type-checking compiler in particular, fixing bugs can very easily mean that code that used to compile (because it wasn't using the type system in quite the intended way) no longer works. So it's a breaking change in the sense that it alters publicly observable behavior that code relies on, requiring code changes to continue working.
269
u/StillNoNumb Aug 20 '20 edited Aug 20 '20
See here
Certainly annoying, but no one would pay as much attention to TS releases if we were at v40 already. Given that TypeScript is a pretty central part of the ecosystem it's acceptable pain imo, but I really hope that no other, smaller package authors see that and decide to ignore semver because TS does.