-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix: disallow typescript@4.8 peer dep #8443
Conversation
.github/workflows/ci.yml
Outdated
@@ -15,7 +15,7 @@ jobs: | |||
- uses: Swatinem/rust-cache@v1 | |||
# use `--frozen-lockfile` to fail immediately if the committed yarn.lock needs updates | |||
# https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-frozen-lockfile | |||
- run: yarn --frozen-lockfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary. yarn
recognizes ci environments and freezes the lockfile by itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com.'
We are using Yarn 1 here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know that yarn@1
behaves so poorly. Thanks for the update. I removed this part of the PR. However I recommend using yarn@3
soonish, it is much better than yarn@1
.
@@ -50,6 +50,6 @@ | |||
"@typescript-eslint/parser": "^4.14.1", | |||
"eslint": "^7.19.0", | |||
"glob": "^7.1.6", | |||
"typescript": "^4.6.4" | |||
"typescript": "~4.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be pinned too. If not they would use typescript@4.8 and having two ts versions installed will only cause problems. I would even recommend installing typescript
as a dev dependency only in the root package.json
and not in any of the packages. Would make things easier.
}, | ||
"peerDependencies": { | ||
"typescript": ">=3.0.0" | ||
"typescript": "3.0.0 - 4.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally would immediately discontinue support for typesscript@3
. Iheavily doubt that typescript@3
is really compatible with current parcel
. There are no tests run with typescript@3
so I would say: Nobody knows for sure. Instead of creating a test matrix with older typescript versions, I would rather just discontinue support for typescript@3
.
remove typescript@4.8 from the peer dependency range since typescript@4.8 is incompatible with parcel at this time. make sure we use typescript 4.7 for development everywhere.
I don't think this will work. The dependency is a
We could potentially error at runtime if the version is greater than expected, but this would not scale since breaking changes are somewhat rare and TS releases new versions all the time. We wouldn't want to have to manually bump the maximum version each time before it would work. I think the only solution is to actually fix whatever is broken. We might have to add some forked codepath depending on what version is loaded, for example. |
No. If someone uses say
No. I just set the
That is not necessary and dangerous. Runtime checks of this kind always back fire. Manually changing the
That is a next step. Of course the incompatibility issues have to be resolved. But in their own time, not under stress and with the awful reality, that until then everybody using |
Say someone installs typescript 4.8 in their project. With yarn, they'll get a warning that parcel is not compatible but it doesn't prevent install from succeeding. Many projects have lots of these warnings so it might get lost. When running the build, it'll load 4.8 and the user will see the same error as today. Doesn't really solve the problem. With npm, both 4.7 and 4.8 will be installed. Parcel will then load 4.7, but building against a project using 4.8. Might work, but also might break in different ways. But no obvious error about why. I don't want to have to manually bump and test every new version of typescript before anyone can use them with parcel. Users should have control over this in their projects. Right now if they bump to 4.8 and it doesn't work, they can just downgrade, and report the issue to us to fix. But if we limit the dep to 4.7, then they can't upgrade at all until we release a new version. They aren't in control. Since actual breaking changes in typescript that affect parcel are rare, I think this is generally a better system because it doesn't block projects from upgrading. |
I do not use
I did not make up the system with the peer dependencies. It makes sense and should be used exactly how I described it above. Ignoring the warnings that you have unmet peer dependencies during a |
As of npm 7, npm will again automatically install peer dependencies just like normal dependencies. I really don't think it's as bad as you are making it out to be. These days, most people use lock files, so there won't be upgrades unless users opt-in. And if it doesn't work, it's easy to roll back. To be completely honest, this is 100% TypeScript's fault. They don't follow semantic versioning, but yet that's how all package managers work so they don't really have a choice. When they release breaking changes, they should bump the major version. Anything else just leaves projects using the typescript compiler like parcel in a very tight spot where there really isn't a good solution. I would recommend expressing your displeasure with TypeScript instead. |
FWIW, Rollup also has a loose dependency on >= 3.7: https://github.com/rollup/plugins/blob/master/packages/typescript/package.json#L50 |
The question is: Do And you are right that typescript is sloppy with the versioning. However it seems to me that this is known to many people. Also to a certain degree it makes sense, because if they would do it "correctly", we would maybe have typescript version 243 or something. Also I see no point in talking with typescript about release management, because this really would be a change in their methodology. Here at And for the "resolutions": {
"typescript": "~4.7",
"typescript:comment": "see https://github.com/parcel-bundler/parcel/issues/8419"
}, in our root "dependencies": {
"typescript": "~4.7"
}, I admit that a lot of maintainers regularly publish breaking changes as minor bumps. That is a sad reality with npmjs.org. But one can quickly pin point these bad apples and put them all in the But whatever. We agree to disagree. I respect your opinion and I really like |
BTW: What you say here would only be true iff you had "peerDependencies": {
"typescript": "3 - 4"
} in your |
Yeah but the problem is 4.8 might be breaking or it might not be - the version number is meaningless. I don't have the time to manually bump and test typescript and release a new parcel version every time they do a release. 99% of the time there are no breaking changes, so this is a waste of my time mostly. If typescript followed semantic versioning, then I'd know which ones were important to test and which ones projects could upgrade on their own. |
remove typescript@4.8 from the peer dependency range
since typescript@4.8 is incompatible with parcel at this time.
make sure we use typescript 4.7 for development everywhere.
See #8419 (comment)