Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1860,17 +1860,6 @@ tasks:
- {key: NODE_LTS_VERSION, value: '22'}
- func: install dependencies
- func: run lint checks
- name: run-resource-management-async-dispose
tags:
- resource-management
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NODE_LTS_VERSION, value: '22'}
- func: install dependencies
- func: check resource management
- name: test-explicit-resource-management-feature-integration
tags:
- resource-management
Expand Down
11 changes: 0 additions & 11 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,17 +510,6 @@ SINGLETON_TASKS.push(
{ func: 'run lint checks' }
]
},
{
name: 'run-resource-management-async-dispose',
tags: ['resource-management'],
commands: [
updateExpansions({
NODE_LTS_VERSION: LATEST_LTS
}),
{ func: 'install dependencies' },
{ func: 'check resource management' }
]
},
{
name: 'test-explicit-resource-management-feature-integration',
tags: ['resource-management'],
Expand Down
5 changes: 0 additions & 5 deletions .evergreen/run-resource-management.sh

This file was deleted.

3 changes: 1 addition & 2 deletions api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "<projectFolder>/<unscopedPackageName>.d.ts",
"betaTrimmedFilePath": "<projectFolder>/lib/beta.d.ts"
"publicTrimmedFilePath": "<projectFolder>/<unscopedPackageName>.d.ts"
},
"tsdocMetadata": {
"enabled": false
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"scripts": {
"build:evergreen": "node .evergreen/generate_evergreen_tasks.js",
"build:ts": "node ./node_modules/typescript/bin/tsc",
"build:dts": "npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && ESLINT_USE_FLAT_CONFIG=false eslint --no-ignore --fix mongodb.d.ts lib/beta.d.ts",
"build:dts": "npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && ESLINT_USE_FLAT_CONFIG=false eslint --no-ignore --fix mongodb.d.ts",
"build:docs": "./etc/docs/build.ts",
"build:typedoc": "typedoc",
"build:nightly": "node ./.github/scripts/nightly.mjs",
Expand All @@ -143,7 +143,6 @@
"check:unit": "nyc mocha test/unit",
"check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit",
"check:atlas": "nyc mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts",
"check:resource-management": "nyc mocha --config test/manual/mocharc.js test/manual/resource_management.test.ts",
"check:drivers-atlas-testing": "nyc mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts",
"check:aws": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_aws.test.ts",
"check:oidc-auth": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts",
Expand Down
22 changes: 0 additions & 22 deletions src/beta.ts

This file was deleted.

8 changes: 1 addition & 7 deletions src/change_stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { MongoClient } from './mongo_client';
import { type InferIdType, TypedEventEmitter } from './mongo_types';
import type { AggregateOptions } from './operations/aggregate';
import type { OperationParent } from './operations/command';
import { type AsyncDisposable, configureResourceManagement } from './resource_management';
import type { ServerSessionId } from './sessions';
import { CSOTTimeoutContext, type TimeoutContext } from './timeout';
import { filterOptions, getTopology, type MongoDBNamespace, squashError } from './utils';
Expand Down Expand Up @@ -574,13 +573,10 @@ export class ChangeStream<
implements AsyncDisposable
{
/**
* @beta
* @experimental
* An alias for {@link ChangeStream.close|ChangeStream.close()}.
*/
declare [Symbol.asyncDispose]: () => Promise<void>;
/** @internal */
async asyncDispose() {
async [Symbol.asyncDispose]() {
await this.close();
}

Expand Down Expand Up @@ -1090,5 +1086,3 @@ export class ChangeStream<
}
}
}

configureResourceManagement(ChangeStream.prototype);
8 changes: 1 addition & 7 deletions src/cursor/abstract_cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { GetMoreOperation } from '../operations/get_more';
import { KillCursorsOperation } from '../operations/kill_cursors';
import { ReadConcern, type ReadConcernLike } from '../read_concern';
import { ReadPreference, type ReadPreferenceLike } from '../read_preference';
import { type AsyncDisposable, configureResourceManagement } from '../resource_management';
import type { Server } from '../sdam/server';
import { type ClientSession, maybeClearPinnedConnection } from '../sessions';
import { type CSOTTimeoutContext, type Timeout, TimeoutContext } from '../timeout';
Expand Down Expand Up @@ -437,13 +436,10 @@ export abstract class AbstractCursor<
}

/**
* @beta
* @experimental
* An alias for {@link AbstractCursor.close|AbstractCursor.close()}.
*/
declare [Symbol.asyncDispose]: () => Promise<void>;
/** @internal */
async asyncDispose() {
async [Symbol.asyncDispose]() {
await this.close();
}

Expand Down Expand Up @@ -1223,8 +1219,6 @@ class ReadableCursorStream extends Readable {
}
}

configureResourceManagement(AbstractCursor.prototype);

/**
* @internal
* The cursor timeout context is a wrapper around a timeout context
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export {
MongoWriteConcernError,
WriteConcernErrorResult
} from './error';
export { configureExplicitResourceManagement } from './resource_management';
export {
AbstractCursor,
// Actual driver classes exported
Expand Down Expand Up @@ -564,7 +563,6 @@ export type {
ReadPreferenceLikeOptions,
ReadPreferenceOptions
} from './read_preference';
export type { AsyncDisposable } from './resource_management';
export type { ClusterTime } from './sdam/common';
export type {
Monitor,
Expand Down
8 changes: 1 addition & 7 deletions src/mongo_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import { executeOperation } from './operations/execute_operation';
import { AbstractOperation } from './operations/operation';
import type { ReadConcern, ReadConcernLevel, ReadConcernLike } from './read_concern';
import { ReadPreference, type ReadPreferenceMode } from './read_preference';
import { type AsyncDisposable, configureResourceManagement } from './resource_management';
import type { ServerMonitoringMode } from './sdam/monitor';
import type { TagSet } from './sdam/server_description';
import { readPreferenceServerSelector } from './sdam/server_selection';
Expand Down Expand Up @@ -485,13 +484,10 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
}

/**
* @beta
* @experimental
* An alias for {@link MongoClient.close|MongoClient.close()}.
*/
declare [Symbol.asyncDispose]: () => Promise<void>;
/** @internal */
async asyncDispose() {
async [Symbol.asyncDispose]() {
await this.close();
}

Expand Down Expand Up @@ -1037,8 +1033,6 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
}
}

configureResourceManagement(MongoClient.prototype);

/**
* Parsed Mongo Client Options.
*
Expand Down
74 changes: 0 additions & 74 deletions src/resource_management.ts

This file was deleted.

8 changes: 1 addition & 7 deletions src/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { executeOperation } from './operations/execute_operation';
import { RunCommandOperation } from './operations/run_command';
import { ReadConcernLevel } from './read_concern';
import { ReadPreference } from './read_preference';
import { type AsyncDisposable, configureResourceManagement } from './resource_management';
import { _advanceClusterTime, type ClusterTime, TopologyType } from './sdam/common';
import { TimeoutContext } from './timeout';
import {
Expand Down Expand Up @@ -289,13 +288,10 @@ export class ClientSession
}
}
/**
* @beta
* @experimental
* An alias for {@link ClientSession.endSession|ClientSession.endSession()}.
*/
declare [Symbol.asyncDispose]: () => Promise<void>;
/** @internal */
async asyncDispose() {
async [Symbol.asyncDispose]() {
await this.endSession({ force: true });
}

Expand Down Expand Up @@ -823,8 +819,6 @@ export class ClientSession
}
}

configureResourceManagement(ClientSession.prototype);

const NON_DETERMINISTIC_WRITE_CONCERN_ERRORS = new Set([
'CannotSatisfyWriteConcern',
'UnknownReplWriteConcern',
Expand Down
8 changes: 1 addition & 7 deletions test/explicit-resource-management/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import {
AbstractCursor,
ChangeStream,
ClientSession,
GridFSBucket,
MongoClient
} from 'mongodb/lib/beta';
import { AbstractCursor, ChangeStream, ClientSession, GridFSBucket, MongoClient } from 'mongodb';
import * as sinon from 'sinon';
import { Readable } from 'stream';
import { pipeline } from 'stream/promises';
Expand Down
Loading