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

[api-extractor] Upgrade bundled TypeScript to 5.7 #4815

Merged
merged 9 commits into from
Jan 7, 2025

Conversation

colinaaa
Copy link
Contributor

Summary

Fixes #4805

Details

TypeScript release notes:
https://devblogs.microsoft.com/typescript/announcing-typescript-5-5

  1. Upgrade TypeScript to 5.5.2
  2. Upgrade @typescript-eslint/parser to 7.14.1
  3. Adopt breaking changes of typescript-eslint

How it was tested

Impacted documentation

1. Upgrade TypeScript to `5.5.2`
2. Upgrade @typescript-eslint/parser to `7.14.1`
3. Adopt breaking changes of typescript-eslint
@colinaaa
Copy link
Contributor Author

@microsoft-github-policy-service agree

@colinaaa
Copy link
Contributor Author

colinaaa commented Jul 2, 2024

Hi @iclanton, I failed to solve the lint and build error of this change. Would you please help me with it? Thanks

@iclanton
Copy link
Member

iclanton commented Jul 2, 2024

@colinaaa sure

@iclanton
Copy link
Member

iclanton commented Jul 3, 2024

The issue is that the decoupled copies of the @rushstack/eslint-* packages are getting an old version of the @typescript-eslint/* packages. You should be able to fix this by patching those with the pnpm-config.json file or pnpmfile.

@FezVrasta
Copy link

Is there any plan to get this through?

octogonz and others added 7 commits January 6, 2025 16:03
NOTE: This is a type signature change that didn't affect the runtime contract; it should be fully backwards compatible
…out resolve() signatures being inconsistent between @types/node/module.d.ts and lib.dom.d.ts:

Warning: C:/Git/rushstack/common/temp/default/node_modules/.pnpm/@types+node@18.17.15/node_modules/@types/node/module.d.ts:210:13 - (TS2386) Overload signatures must all be optional or required.
…tible with @types/node@14.0.1:

Warning: C:\Git\rushstack\common\temp\default\node_modules\.pnpm\@types+node@14.0.1\node_modules\@types\node\ts3.2\globals.d.ts:10:11 - (TS2320) Interface 'Buffer' cannot simultaneously extend types 'Uint8Array<ArrayBuffer>' and 'Uint8Array<ArrayBufferLike>'.
Named property 'buffer' of types 'Uint8Array<ArrayBuffer>' and 'Uint8Array<ArrayBufferLike>' are not identical.
@octogonz octogonz marked this pull request as ready for review January 7, 2025 00:07
@octogonz
Copy link
Collaborator

octogonz commented Jan 7, 2025

Fixes #5052

@octogonz
Copy link
Collaborator

octogonz commented Jan 7, 2025

The issue is that the decoupled copies of the @rushstack/eslint-* packages are getting an old version of the @typescript-eslint/* packages. You should be able to fix this by patching those with the pnpm-config.json file or pnpmfile.

@iclanton I have temporarily postponed these issues by upgrading API Extractor's TypeScript version to 5.7.2. while rollingback the other projects across the repo to version 5.4.2. In this way, the API Extractor work can be merged separately from the repo upgrade work.

The test projects are all building without errors, although there were warnings for the Heft's TypeScript 2.9.x test project. I didn't dig too deeply into that one -- since @types/node today only supports 3.2+, I think it's probably time to drop support for 2.9.x and make 3.2.x our oldest supported version. But we can do that in a separate PR as well.

@octogonz octogonz changed the title WIP: [api-extractor] Upgrade bundled TypeScript to 5.5 [api-extractor] Upgrade bundled TypeScript to 5.7 Jan 7, 2025
@@ -8,7 +8,7 @@
"declarationMap": true,
"experimentalDecorators": true,
"strictNullChecks": true,
"lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

These projects were failing with a TypeScript 5.7.2 strict checks warning about resolve() signatures being inconsistent between @types/node/module.d.ts versus the compiler's lib.dom.d.ts:

Warning: C:/Git/rushstack/common/temp/default/node_modules/.pnpm/https://github.com/types+node@18.17.15/node_modules/@types/node/module.d.ts:210:13 - (TS2386) Overload signatures must all be optional or required.

The problem does not repro in @types/node@20 because the require() API is no longer experimental, however it does repro in the latest version of @types/node@18. This seems like an actual bug for @types/node@18 that will only repro for people who are (1) combining dom and node runtime targets (e.g. a web app with Jest), and also (2) are not shamefully setting skipLibCheck: true in their tsconfig.json.

@octogonz octogonz merged commit 62825ff into microsoft:main Jan 7, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

[api-extractor] Support Typescript 5.5
4 participants