-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(compass-web): stub out devtools-connect entirely COMPASS-7552 (#…
…5305) devtools-connect mostly just contains logic that applies to desktop application scenarios, and not so much the web use case. Instead of manually stubbing out the transitive dependencies that come with it, stub out the entire devtools-connect dependency with one that connects to the driver fairly directly.
- Loading branch information
Showing
9 changed files
with
38 additions
and
289 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/compass-web/polyfills/@mongodb-js/devtools-connect/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export function hookLogger() { | ||
/* no-op */ | ||
} | ||
export async function connectMongoClient( | ||
url: string, | ||
options: any, | ||
logger: any, | ||
MongoClient: any | ||
): Promise<any> { | ||
// Remove options not understood by the plain Node.js driver | ||
delete options.useSystemCA; | ||
delete options.productDocsLink; | ||
delete options.productName; | ||
delete options.oidc; | ||
delete options.parentState; | ||
delete options.parentHandle; | ||
const client = new MongoClient(url, options); | ||
await client.connect(); | ||
return { | ||
client, | ||
state: { | ||
getStateShareServer() { | ||
return Promise.resolve('Not Available'); | ||
}, | ||
oidcPlugin: { logger }, | ||
}, | ||
}; | ||
} |
21 changes: 0 additions & 21 deletions
21
packages/compass-web/polyfills/@mongodb-js/oidc-plugin/index.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.