TypeScript versioning
ehmicky opened this issue · 5 comments
Documenting
Should we document the minimum TypeScript version supported by Execa?
Testing
If we do, we could run tsd
and tsc
on that older TypeScript version too, for testing.
Current support
Right now, it appears that every minor version from 4.7
to 5.4
works.
In Execa 8.0.1
, 4.5
and 4.6
were supported too. So that was a breaking change actually for those users, which we might want to add to the release notes, if we were to document the minimum TypeScript version.
I did a quick check on the usage of TypeScript versions in the last 7 days. It's a little approximate, but here it is:
Version Absolute Cumulative
5.4 26.0% 26.0%
5.3 11.6% 37.6%
5.2 6.6% 44.2%
5.1 6.2% 50.4%
5.0 3.4% 53.8%
4.9 21.4% 75.2%
4.8 3.4% 78.6%
4.7 3.8% 82.4%
4.6 2.2% 84.6%
4.5 1.8% 86.4%
4.4 1.2% 87.6%
4.3 1.8% 89.4%
4.2 1.0% 90.4%
4.1 1.2% 91.6%
4.0 0.4% 92.0%
3.9 5.8% 97.8%
3.8 1.0% 98.8%
Determining the minimum version
Each major release would optionally increase the minimum TypeScript minor version (since TypeScript does not quite respect semver and minor versions are usually kindof breaking). There are several strategies we could use to pick the minimum version:
- Only the latest TypeScript version. That's simple, but might not be very user-friendly since only 26% of users use the latest version.
- Use a specific time period. For example:
- Last 12 months would be 5.1 (50.4% of users)
- Last 24 months (which is close to Node.js version support) would be 4.9 (75.2% of users)
- Use a specific user percentage threshold. For example: 4.9 would support 75.2% of users.
- Use the oldest version that currently works, without making writing tests hard. For example: 4.7 currently works and would support 82.4% of users.
I personally think:
- Documenting the minimum TypeScript version might be helpful.
- Strategy 3 above might be the most user-friendly and decrease the amount of issues, without hindering development too much. Right now, this would mean supporting 4.9 onward.
That being said, you probably already have a strategy for this problem with your other packages, so being consistent with them is important too.
What are your thoughts on this @sindresorhus?
I did a quick check on the usage of TypeScript versions in the last 7 days. It's a little approximate, but here it is:
I assume these stats are global usage and not TS usage for execa? That is not representative of Execa users, and we only care about Execa users on recent Execa versions (the ones that would actually use v9).
4.9 would be the absolute minimum. I would personally do at least 5+. You will be stuck with this version until the next major Execa version, which is probably not until next year. Even in type-fest
, I target 5.1.
I computed those stats from the npm versions page for typescript
, so it not only for Execa users.
You have a good point that this only concerns users who upgrade to v9, so they are most likely to have more up-to-date dependencies.
I think it should be consistent with how you're doing this in your other packages. 5.1 sounds good to me, if this sounds good to you.
I would suggest the following actions:
a. Editing the 9.0.0
release notes to indicate that the minimum TypeScript version is now 5.1.
b. Add the minimum TypeScript version to our documentation.
c. Run tsd
and tsc
on both the latest TypeScript version and on the minimum TypeScript version we support.
What do you think?
👍