Skip to content

chore(NODE-6939): update typescript to 5.8.3 #4526

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

chore(NODE-6939): update typescript to 5.8.3 #4526

wants to merge 5 commits into from

Conversation

durran
Copy link
Member

@durran durran commented Apr 30, 2025

Description

Updates typescript to 5.8.3

What is changing?

  • Update typescript.
  • Updates dependencies that were out of date with the TS update.
  • Enable erasableSyntaxOnly option.
  • Fixes all errors due to the new TS option.
  • Fixes all issues arising from the eslint related updates.
Is there new documentation needed for these changes?

None

What is the motivation for this change?

NODE-6939

Release Highlight

Fill in title or leave empty for no highlight

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@durran durran marked this pull request as ready for review April 30, 2025 15:06
@durran durran requested a review from a team as a code owner April 30, 2025 15:06
@baileympearson baileympearson self-assigned this Apr 30, 2025
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Apr 30, 2025
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

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

Just a few small changes

@@ -60,7 +60,7 @@
"source-map-support": "^0.5.21",
"ts-node": "^10.9.2",
"tsd": "^0.31.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

The AC says to update tsd as well

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated and issues fixed. I needed to remove some tests from the slow model tests (since we cannot use namespaced types anymore) but don't think that impacts what that was actually testing.

@durran durran requested a review from baileympearson May 4, 2025 21:04
@durran durran force-pushed the NODE-6939 branch 2 times, most recently from d7b78f0 to beb0929 Compare May 6, 2025 19:51
},

[Symbol.asyncDispose]: function (): PromiseLike<void> {
return closeHandler().then(() => undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return closeHandler().then(() => undefined);
async [Symbol.asyncDispose]() {
await closeHandler();

a suggestion: nothing wrong with async syntax here I think, just a bit simpler to drop the return value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also probably worth leaving a comment about how this shouldn't be used (I don't think it will but in case).

On older Node versions this is going to be:

{
    throw() {/*...*/} // ...
    async undefined() {

    }
}

But typescript isn't going to let you know, ideally a test would fail on node 16 but might as well leave a paper trail.

@@ -730,10 +731,19 @@ const COMPRESSION_DETAILS_SIZE = 9; // originalOpcode + uncompressedSize, compre
* An OP_COMPRESSED request wraps either an OP_QUERY or OP_MSG message.
*/
export class OpCompressedRequest {
private command: WriteProtocolMessageType;
private options: { zLibCompressionLevel: number; agreedCompressor: CompressorName };
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private options: { zLibCompressionLevel: number; agreedCompressor: CompressorName };
private options: { zlibCompressionLevel: number; agreedCompressor: CompressorName };

) {
this.command = command;
this.options = {
zLibCompressionLevel: options.zlibCompressionLevel,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
zLibCompressionLevel: options.zlibCompressionLevel,
zlibCompressionLevel: options.zlibCompressionLevel,

Copy link
Contributor

Choose a reason for hiding this comment

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

should there be some sort of test that catches this?

agreedCompressor: this.options.agreedCompressor
},
messageToBeCompressed
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
);
const compressedMessage = await compress(this.options, messageToBeCompressed);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants