Skip to content

Commit 74a1476

Browse files
committed
removing devtools-connect indirection
1 parent 79d4fec commit 74a1476

File tree

6 files changed

+9
-64
lines changed

6 files changed

+9
-64
lines changed

packages/compass-web/polyfills/@mongodb-js/devtools-connect/devtools-connect-original.d.ts

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

packages/compass-web/polyfills/@mongodb-js/devtools-connect/index.ts

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

packages/compass-web/polyfills/@mongodb-js/devtools-proxy-support/index.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ export function hookLogger(): void {
1111
// no-op
1212
}
1313
export function createFetch(): typeof fetch {
14-
// eslint-disable-next-line @typescript-eslint/require-await
15-
return async () => {
16-
throw new Error('node-fetch not available in compass web');
17-
};
14+
return async () =>
15+
Promise.reject(new Error('node-fetch not available in compass web'));
1816
}
19-
// eslint-disable-next-line @typescript-eslint/require-await
20-
export async function systemCA(): Promise<never> {
21-
const error = new Error('system CA access not available in compass-web');
22-
(error as unknown as { code: 'OUT_OF_MEM' }).code = 'OUT_OF_MEM'; // This is a "tls" error code that makes devtools-connect not use the systemCA
23-
throw error;
17+
export async function systemCA() {
18+
await Promise.reject(
19+
new Error('system CA access not available in compass-web')
20+
);
2421
}
2522
export function resetSystemCACache(): never {
2623
throw new Error('reset system CA access not available in compass-web');

packages/compass-web/src/connection-storage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export class AtlasCloudConnectionStorage
130130
...connectionInfo,
131131
connectionOptions: {
132132
...connectionInfo.connectionOptions,
133+
useSystemCA: false,
133134
lookup: () => {
134135
return {
135136
wsURL: this.atlasService.driverProxyEndpoint(

packages/compass-web/webpack.config.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,6 @@ module.exports = (env, args) => {
5757
}
5858
: {}),
5959

60-
// We replace the direct import without own the sanitizes unsupported options
61-
// from the web env that are never relevant to connecting on web.
62-
'@mongodb-js/devtools-connect': localPolyfill(
63-
'@mongodb-js/devtools-connect'
64-
),
65-
66-
// Then we call into the real devtools-connect package
67-
'devtools-connect-original': require.resolve(
68-
'@mongodb-js/devtools-connect'
69-
),
70-
7160
// TODO(COMPASS-7407): compass-logging
7261
// hard to disable the whole thing while there are direct dependencies
7362
// on log-writer

packages/data-service/src/connection-options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export type OIDCOptions = Omit<
1919
>[];
2020
};
2121

22-
export interface ConnectionOptions {
22+
export interface ConnectionOptions
23+
extends Pick<DevtoolsConnectOptions, 'useSystemCA'> {
2324
/**
2425
* The connection string to connect to the MongoDB instance including all options set by the user.
2526
*/

0 commit comments

Comments
 (0)