Skip to content

Commit c4d1963

Browse files
changes!
1 parent cfbada6 commit c4d1963

File tree

12 files changed

+7
-216
lines changed

12 files changed

+7
-216
lines changed

.evergreen/generate_evergreen_tasks.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -510,17 +510,6 @@ SINGLETON_TASKS.push(
510510
{ func: 'run lint checks' }
511511
]
512512
},
513-
{
514-
name: 'run-resource-management-async-dispose',
515-
tags: ['resource-management'],
516-
commands: [
517-
updateExpansions({
518-
NODE_LTS_VERSION: LATEST_LTS
519-
}),
520-
{ func: 'install dependencies' },
521-
{ func: 'check resource management' }
522-
]
523-
},
524513
{
525514
name: 'test-explicit-resource-management-feature-integration',
526515
tags: ['resource-management'],

api-extractor.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"dtsRollup": {
1111
"enabled": true,
1212
"untrimmedFilePath": "",
13-
"publicTrimmedFilePath": "<projectFolder>/<unscopedPackageName>.d.ts",
14-
"betaTrimmedFilePath": "<projectFolder>/lib/beta.d.ts"
13+
"publicTrimmedFilePath": "<projectFolder>/<unscopedPackageName>.d.ts"
1514
},
1615
"tsdocMetadata": {
1716
"enabled": false

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"scripts": {
125125
"build:evergreen": "node .evergreen/generate_evergreen_tasks.js",
126126
"build:ts": "node ./node_modules/typescript/bin/tsc",
127-
"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",
127+
"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",
128128
"build:docs": "./etc/docs/build.ts",
129129
"build:typedoc": "typedoc",
130130
"build:nightly": "node ./.github/scripts/nightly.mjs",
@@ -143,7 +143,6 @@
143143
"check:unit": "nyc mocha test/unit",
144144
"check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit",
145145
"check:atlas": "nyc mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts",
146-
"check:resource-management": "nyc mocha --config test/manual/mocharc.js test/manual/resource_management.test.ts",
147146
"check:drivers-atlas-testing": "nyc mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts",
148147
"check:aws": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_aws.test.ts",
149148
"check:oidc-auth": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts",

src/change_stream.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { MongoClient } from './mongo_client';
1818
import { type InferIdType, TypedEventEmitter } from './mongo_types';
1919
import type { AggregateOptions } from './operations/aggregate';
2020
import type { OperationParent } from './operations/command';
21-
import { type AsyncDisposable, configureResourceManagement } from './resource_management';
2221
import type { ServerSessionId } from './sessions';
2322
import { CSOTTimeoutContext, type TimeoutContext } from './timeout';
2423
import { filterOptions, getTopology, type MongoDBNamespace, squashError } from './utils';
@@ -574,13 +573,10 @@ export class ChangeStream<
574573
implements AsyncDisposable
575574
{
576575
/**
577-
* @beta
578576
* @experimental
579577
* An alias for {@link ChangeStream.close|ChangeStream.close()}.
580578
*/
581-
declare [Symbol.asyncDispose]: () => Promise<void>;
582-
/** @internal */
583-
async asyncDispose() {
579+
async [Symbol.asyncDispose]() {
584580
await this.close();
585581
}
586582

@@ -1090,5 +1086,3 @@ export class ChangeStream<
10901086
}
10911087
}
10921088
}
1093-
1094-
configureResourceManagement(ChangeStream.prototype);

src/cursor/abstract_cursor.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { GetMoreOperation } from '../operations/get_more';
1818
import { KillCursorsOperation } from '../operations/kill_cursors';
1919
import { ReadConcern, type ReadConcernLike } from '../read_concern';
2020
import { ReadPreference, type ReadPreferenceLike } from '../read_preference';
21-
import { type AsyncDisposable, configureResourceManagement } from '../resource_management';
2221
import type { Server } from '../sdam/server';
2322
import { type ClientSession, maybeClearPinnedConnection } from '../sessions';
2423
import { type CSOTTimeoutContext, type Timeout, TimeoutContext } from '../timeout';
@@ -437,13 +436,10 @@ export abstract class AbstractCursor<
437436
}
438437

439438
/**
440-
* @beta
441439
* @experimental
442440
* An alias for {@link AbstractCursor.close|AbstractCursor.close()}.
443441
*/
444-
declare [Symbol.asyncDispose]: () => Promise<void>;
445-
/** @internal */
446-
async asyncDispose() {
442+
async [Symbol.asyncDispose]() {
447443
await this.close();
448444
}
449445

@@ -1223,8 +1219,6 @@ class ReadableCursorStream extends Readable {
12231219
}
12241220
}
12251221

1226-
configureResourceManagement(AbstractCursor.prototype);
1227-
12281222
/**
12291223
* @internal
12301224
* The cursor timeout context is a wrapper around a timeout context

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ export {
8787
MongoWriteConcernError,
8888
WriteConcernErrorResult
8989
} from './error';
90-
export { configureExplicitResourceManagement } from './resource_management';
9190
export {
9291
AbstractCursor,
9392
// Actual driver classes exported
@@ -564,7 +563,6 @@ export type {
564563
ReadPreferenceLikeOptions,
565564
ReadPreferenceOptions
566565
} from './read_preference';
567-
export type { AsyncDisposable } from './resource_management';
568566
export type { ClusterTime } from './sdam/common';
569567
export type {
570568
Monitor,

src/mongo_client.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import { executeOperation } from './operations/execute_operation';
4848
import { AbstractOperation } from './operations/operation';
4949
import type { ReadConcern, ReadConcernLevel, ReadConcernLike } from './read_concern';
5050
import { ReadPreference, type ReadPreferenceMode } from './read_preference';
51-
import { type AsyncDisposable, configureResourceManagement } from './resource_management';
5251
import type { ServerMonitoringMode } from './sdam/monitor';
5352
import type { TagSet } from './sdam/server_description';
5453
import { readPreferenceServerSelector } from './sdam/server_selection';
@@ -485,13 +484,10 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
485484
}
486485

487486
/**
488-
* @beta
489487
* @experimental
490488
* An alias for {@link MongoClient.close|MongoClient.close()}.
491489
*/
492-
declare [Symbol.asyncDispose]: () => Promise<void>;
493-
/** @internal */
494-
async asyncDispose() {
490+
async [Symbol.asyncDispose]() {
495491
await this.close();
496492
}
497493

@@ -1037,8 +1033,6 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
10371033
}
10381034
}
10391035

1040-
configureResourceManagement(MongoClient.prototype);
1041-
10421036
/**
10431037
* Parsed Mongo Client Options.
10441038
*

src/resource_management.ts

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/sessions.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { executeOperation } from './operations/execute_operation';
2626
import { RunCommandOperation } from './operations/run_command';
2727
import { ReadConcernLevel } from './read_concern';
2828
import { ReadPreference } from './read_preference';
29-
import { type AsyncDisposable, configureResourceManagement } from './resource_management';
3029
import { _advanceClusterTime, type ClusterTime, TopologyType } from './sdam/common';
3130
import { TimeoutContext } from './timeout';
3231
import {
@@ -289,13 +288,10 @@ export class ClientSession
289288
}
290289
}
291290
/**
292-
* @beta
293291
* @experimental
294292
* An alias for {@link ClientSession.endSession|ClientSession.endSession()}.
295293
*/
296-
declare [Symbol.asyncDispose]: () => Promise<void>;
297-
/** @internal */
298-
async asyncDispose() {
294+
async [Symbol.asyncDispose]() {
299295
await this.endSession({ force: true });
300296
}
301297

@@ -823,8 +819,6 @@ export class ClientSession
823819
}
824820
}
825821

826-
configureResourceManagement(ClientSession.prototype);
827-
828822
const NON_DETERMINISTIC_WRITE_CONCERN_ERRORS = new Set([
829823
'CannotSatisfyWriteConcern',
830824
'UnknownReplWriteConcern',

test/explicit-resource-management/main.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { expect } from 'chai';
22
import { describe, it } from 'mocha';
3-
import {
4-
AbstractCursor,
5-
ChangeStream,
6-
ClientSession,
7-
GridFSBucket,
8-
MongoClient
9-
} from 'mongodb/lib/beta';
3+
import { AbstractCursor, ChangeStream, ClientSession, GridFSBucket, MongoClient } from 'mongodb';
104
import * as sinon from 'sinon';
115
import { Readable } from 'stream';
126
import { pipeline } from 'stream/promises';

0 commit comments

Comments
 (0)