Skip to content

Conversation

durran
Copy link
Member

@durran durran commented Oct 1, 2025

Description

Removes deprecated items or marks them internal where appropriate.

Summary of Changes

What is the motivation for this change?

NODE-5545

Release Highlight

Deprecated Types, Classes, and Options Have Been Removed

Includes:

GridFSFile.contentType
GridFSFile.aliases
GridFSBucketWriteStreamOptions.contentType
GridFSBucketWriteStreamOptions.aliases
CloseOptions
ResumeOptions
MongoClientOptions.useNewUrlParser
MongoClientOptions.useUnifiedTopology
CreateCollectionOptions.autoIndexId
FindOptions<TSchema> // Now no generic type.
ClientMetadataOptions
FindOneOptions.batchSize
FindOneOptions.limit
FindOneOptions.noCursorTimeout
ReadPreference.minWireVersion
ServerCapabilities
CommandOperationOptions.retryWrites // is a global option on the MongoClient
ClientSession.transaction
Transaction
CancellationToken // Use AbortSignal instead.

Double check the following

  • Lint is passing (npm run check:lint)
  • 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 October 1, 2025 17:40
@durran durran requested a review from a team as a code owner October 1, 2025 17:40
@baileympearson baileympearson self-assigned this Oct 1, 2025
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Oct 1, 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 minor comments!

Comment on lines 141 to 142
socketTimeoutMS?: number;
/** @internal */
cancellationToken?: CancellationToken;
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably fine because I don't expect users to actually be using this type. But want to confirm we're okay making this field internal, even though it isn't deprecated?

Copy link
Contributor

@dariakp dariakp Oct 3, 2025

Choose a reason for hiding this comment

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

it's kind of annoying that this is a public type at all - best I can tell it's all for the supported tls options list; I wonder if we could invert our types for the next major where this interface can be private, composed of the public options plus whatever else we need internally...

I think we should make a note of this so that we can consider releasing a minor version with the deprecation before the major, but I don't think we need to commit to actually doing it for just this one thing

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated this to deprecated now with a note on what to use instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant make a note outside this PR (e.g. a follow up ticket that we can consider doing or not when we get closer to release time)... we should remove it in this PR.

@durran
Copy link
Member Author

durran commented Oct 1, 2025

@baileympearson #4704 (comment)

I've updated the GridFS tests to latest and skipped the new ones.

Comment on lines 141 to 142
socketTimeoutMS?: number;
/** @internal */
cancellationToken?: CancellationToken;
Copy link
Contributor

@dariakp dariakp Oct 3, 2025

Choose a reason for hiding this comment

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

it's kind of annoying that this is a public type at all - best I can tell it's all for the supported tls options list; I wonder if we could invert our types for the next major where this interface can be private, composed of the public options plus whatever else we need internally...

I think we should make a note of this so that we can consider releasing a minor version with the deprecation before the major, but I don't think we need to commit to actually doing it for just this one thing

// This is a regression test that we don't remove the unused generic in FindOptions
const findOptions: FindOptions<{ a: number }> = {};
const findOptions: FindOptions = {};
expectType<FindOptions>(findOptions);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can just be deleted - the comment above says the intention is to make sure we don't remove the generic - we are now intentionally removing the generic

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed.

@dariakp dariakp added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Oct 6, 2025
@dariakp dariakp self-assigned this Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants