Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add per-connection proxy settings COMPASS-8142 #6133

Merged
merged 18 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ Is there anything else you’d like to see in Compass? Let us know by submitting
- [**@mongodb-js/databases-collections-list**](packages/databases-collections-list): List view for the databases and collections
- [**@mongodb-js/explain-plan-helper**](packages/explain-plan-helper): Explain plan utility methods for MongoDB Compass
- [**@mongodb-js/my-queries-storage**](packages/my-queries-storage): Saved aggregations and queries storage
- [**@mongodb-js/ssh-tunnel**](packages/ssh-tunnel): Yet another ssh tunnel based on ssh2
- [**bson-transpilers**](packages/bson-transpilers): Source to source compilers using ANTLR
- [**compass-e2e-tests**](packages/compass-e2e-tests): E2E test suite for Compass app that follows smoke tests / feature testing matrix
- [**compass-preferences-model**](packages/compass-preferences-model): Compass preferences model
Expand Down
23 changes: 16 additions & 7 deletions configs/webpack-config-compass/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type {
ResolveOptions,
WebpackPluginInstance,
Configuration,
import {
type ResolveOptions,
type WebpackPluginInstance,
type Configuration,
ProvidePlugin,
} from 'webpack';
import { merge } from 'webpack-merge';
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
Expand Down Expand Up @@ -110,6 +111,11 @@ const sharedResolveOptions = (
};
};

const providePlugin = new ProvidePlugin({
URL: ['whatwg-url', 'URL'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

It worked! 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It did! 🙂

URLSearchParams: ['whatwg-url', 'URLSearchParams'],
});

export function createElectronMainConfig(
args: Partial<ConfigArgs>
): WebpackConfig {
Expand Down Expand Up @@ -212,6 +218,7 @@ export function createElectronRendererConfig(
plugins: [
...entriesToHtml(entries),
new WebpackPluginMulticompilerProgress(),
providePlugin,
],
node: false as const,
externals: toCommonJsExternal(sharedExternals),
Expand Down Expand Up @@ -339,8 +346,9 @@ export function createWebConfig(args: Partial<ConfigArgs>): WebpackConfig {
...sharedResolveOptions(opts.target),
},
ignoreWarnings: sharedIgnoreWarnings,
plugins:
isServe(opts) && opts.hot
plugins: [
providePlugin,
...(isServe(opts) && opts.hot
? [
// Plugin types are not matching Webpack 5, but they work
new ReactRefreshWebpackPlugin() as unknown as WebpackPluginInstance,
Expand All @@ -355,7 +363,8 @@ export function createWebConfig(args: Partial<ConfigArgs>): WebpackConfig {

new DuplicatePackageCheckerPlugin(),
]
: [],
: []),
],
};
}

Expand Down
Loading
Loading