Skip to content

feat(data-modeling): integrate diagramming package COMPASS-9357 #6979

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

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions configs/webpack-config-compass/.depcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ ignores:
- 'mongodb-compass'
# used as a resolve alias
- 'jose'
- 'react'
29 changes: 29 additions & 0 deletions configs/webpack-config-compass/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ const sharedResolveOptions = (
// Some lg test helpers that are getting bundled due to re-exporting from
// the actual component packages, never needed in the webpack bundles
'@lg-tools/test-harnesses': false,

// The react/jsx-runtime can fail the import when imported from an esm
// module because React 17 doesn't have ./jsx-runtime specified in the
// package.json `exports` field. This issue will go away if we can update
// to React 18, but for the time being we will just resolve react to
// actual files ourselves to work around that
'react/jsx-runtime': require.resolve('react/jsx-runtime'),
react: require.resolve('react'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably should add this to ignore in depcheckrc file, we do this already for another package that we just need to resolve

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in bba2841

},
};
};
Expand Down Expand Up @@ -147,6 +155,17 @@ export function createElectronMainConfig(
sharedObjectLoader(opts),
sourceLoader(opts),
],
parser: {
javascript: {
// Webpack compile time check for imports matching exports is too strict
// in cases where the code expects some name export to be optional
// (webpack will break the build if it fails to statically see the
// matching export) this is why we switch the check to just warn. If
// this ever hides a real case where a missing import is being used, it
// will definitely break in runtime anyway
importExportsPresence: 'warn' as const,
},
},
},
node: false as const,
externals: toCommonJsExternal(sharedExternals),
Expand Down Expand Up @@ -218,6 +237,11 @@ export function createElectronRendererConfig(
sharedObjectLoader(opts),
sourceLoader(opts),
],
parser: {
javascript: {
importExportsPresence: 'warn' as const,
},
},
},
plugins: [
...entriesToHtml(entries),
Expand Down Expand Up @@ -338,6 +362,11 @@ export function createWebConfig(args: Partial<ConfigArgs>): WebpackConfig {
assetsLoader(opts),
sourceLoader(opts),
],
parser: {
javascript: {
importExportsPresence: 'warn' as const,
},
},
},
// This follows current Compass plugin behavior and is here more or less to
// keep compat for the external plugin users
Expand Down
Loading
Loading