Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript versioning #1047

Closed
ehmicky opened this issue May 10, 2024 · 5 comments · Fixed by #1051
Closed

TypeScript versioning #1047

ehmicky opened this issue May 10, 2024 · 5 comments · Fixed by #1051

Comments

@ehmicky
Copy link
Collaborator

ehmicky commented May 10, 2024

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:

  1. Only the latest TypeScript version. That's simple, but might not be very user-friendly since only 26% of users use the latest version.
  2. 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)
  3. Use a specific user percentage threshold. For example: 4.9 would support 75.2% of users.
  4. 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?

@sindresorhus
Copy link
Owner

sindresorhus commented May 10, 2024

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).

@sindresorhus
Copy link
Owner

sindresorhus commented May 10, 2024

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.

@ehmicky
Copy link
Collaborator Author

ehmicky commented May 10, 2024

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?

@sindresorhus
Copy link
Owner

👍

@ehmicky
Copy link
Collaborator Author

ehmicky commented May 10, 2024

Did a..
Doing b. with #1050.
c. still pending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants