Skip to content

fix: use typescript@4.8 as the minimal supported version#2251

Merged
kettanaito merged 3 commits intomswjs:mainfrom
THETCR:build/deps
Sep 4, 2024
Merged

fix: use typescript@4.8 as the minimal supported version#2251
kettanaito merged 3 commits intomswjs:mainfrom
THETCR:build/deps

Conversation

@THETCR
Copy link
Copy Markdown
Contributor

@THETCR THETCR commented Aug 29, 2024

To fix the discrepancy between the dev dependency and the version installed by end users

@THETCR
Copy link
Copy Markdown
Contributor Author

THETCR commented Aug 29, 2024

@kettanaito here is another PR to resolve a potential conflict between the used version of Typescript

@kettanaito
Copy link
Copy Markdown
Member

kettanaito commented Aug 29, 2024

This is incorrect. MSW still supports TS 4.7 and up. With your change, you are effectively removing that support.

There's no discrepancy possible because what we install for development is irrelevant as long as it's in the supported TS version range. That's why each build runs an extensive type test suite on every supported version of TS to let us know if we break anything up or down the line.

# As a general rule, when adding a new version, remove the oldest version
# Check if the oldest version is EOL or not first.
ts: ['4.8', '4.9', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5']

Give this a look. I will likely close this.

What this change did help to uncover is that we are okay with 4.7 in peer deps but have officially deprecated its support (it's EOL). That is a good find and would be a nice change : 4.7.x -> 4.8.x.

@THETCR
Copy link
Copy Markdown
Contributor Author

THETCR commented Aug 29, 2024

@kettanaito
So you have covered possible compatibility issues between major version 4 and 5, then this is indeed fine.

My advice would be though to set the SemVer range between 4.8.X and 5.X.X, because in the current setup it would also automatically resolve to higher major versions. Which can possibly break the package for end users.

@kettanaito
Copy link
Copy Markdown
Member

So you have covered possible compatibility issues between major version 4 and 5, then this is indeed fine.

Yep! Exactly my point, we have. There's been a dedicated effort for 5.x support, and we've adjusted the types so they work fine across 4.x and 5.x 👌 The automation I linked as the proof of that.

My advice would be though to set the SemVer range between 4.8.X and 5.X.X, because in the current setup it would also automatically resolve to higher major versions.

We discussed this previously as well (sorry, cannot find that discussion right now). TL;DR MSW supports all TS versions by default, if there's a bug, you report it. That's a better experience than throwing errors on install whenever you upgrade a TS to a version not listed in MSW's peer dependencies. There's no guarantee that the version will break.

Would you like to bump the minimal peer dependency version for TS to 4.8.x with this change? That is indeed an issue we have right now.

Copy link
Copy Markdown
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed the typescript peer dependency to correspond to the minimal supported version (4.8).

@kettanaito kettanaito changed the title build(deps): bump typescript from 4.7.x to 5.5.x in peerDependencies fix: use typescript@4.8 as the minimal supported version Sep 4, 2024
@kettanaito kettanaito merged commit 6b2a7e6 into mswjs:main Sep 4, 2024
@kettanaito
Copy link
Copy Markdown
Member

Released: v2.4.2 🎉

This has been released in v2.4.2!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

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 this pull request may close these issues.

2 participants