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

chore(deps): bump TypeScript to v4.9.5 #14028

Merged
merged 13 commits into from
Apr 5, 2023

Conversation

mrazauskas
Copy link
Contributor

Summary

Upgrading to TypeScript v5 is currently blocked by @microsoft/api-extractor, because it throws if the ignoreDeprecations compiler option is around. This makes it impossible to use the option with TypeScript 4.9.5 too.

ignoreDeprecations will also be a problem when testing types on older versions of TypeScript. This PR is changing tsconfig.json used for type testing. I think it makes sense to extend from node14 base instead on tsconfig.json which is used for build.

The compiler config for type testing was mostly unsetting some build options like composite. That was nice shortcut, but I think type testing shouldn’t be somehow too much related with build config. It has to work with older versions, so I am trying to reshape it here.

Test plan

Green CI

@mrazauskas
Copy link
Contributor Author

Hm.. Can’t understand why TS v5.0.2 is used for typechecks:

Screenshot 2023-03-25 at 17 40 26

api-extractor sees TS v4.9.4 during build:

Screenshot 2023-03-25 at 17 41 05

Actually tsc should complain about the importsNotUsedAsValues option as well if repo would be build using TS v5.0.2, but it does not.

@mrazauskas
Copy link
Contributor Author

mrazauskas commented Mar 25, 2023

Seems like I got through that glitch by moving typechecks to separate job. I was thinking to suggest this at some point, simply to make the TypeScript Compatibility job lighter. The build:ts step is needed, but perhaps that’s fine?

Note that in the new job I skipped ts:bundle, because it removes tsconfig.tsbuildinfo files. The typechecks run through tsc --build, which would rebuild packages if tsconfig.tsbuildinfo files are not found. Another approach could be to make the bundle step take some flag, e.g. ts:bundle --skip-cleanup.


I was playing locally a bit. tsconfig.json for tests has "skipLibCheck": true compiler option. If tsconfig.tsbuildinfo files are left in place, tsc assumes that production code is up to date. This means that tsc does not deep check production types even though production tsconfig.json has "skipLibCheck": false option.

This is one of the reasons why I think it is good idea to keep typechecks in a separate job. Here it would be just fine to leave the outdated tsconfig.tsbuildinfo files after bundling.


Hard to say where was TypeScript v5 coming from. Was it because of removed tsconfig.tsbuildinfo files? Or is something wrong with the verify-old-ts script? I have one idea how to rework testing on older version of TS, so leaving it for now.

@mrazauskas mrazauskas marked this pull request as ready for review March 25, 2023 16:32
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

Thanks! Very odd CI started failing, but I can't be bothered to dif into it 😅

@SimenB SimenB merged commit 8a9609d into jestjs:main Apr 5, 2023
@mrazauskas mrazauskas deleted the chore-bump-typescript branch April 5, 2023 08:06
@eps1lon
Copy link
Contributor

eps1lon commented Apr 5, 2023

#14055 fixes this without having to split jobs and should be landed regardless since it'll fix bugs when you run old compat tests locally.

DmitryMakhnev pushed a commit to DmitryMakhnev/jest that referenced this pull request May 5, 2023
@github-actions
Copy link

github-actions bot commented May 6, 2023

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants