← All tasks
javascriptsindresorhus/execa #1047Not a task: already works

TypeScript versioning

envgap__sindresorhus__execa-1047

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
de8e7daabefbc6f4af36ef9647b37b6a0dfca7fa
Manifest
package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

sindresorhus/execa #1047 · read the original issue
## 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?
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]