[COMPASS-5048] Change internal Compass plugin loading logic from using package.json configuration to explicitly requiring plugins and passing them to hadron-plugin-manager Created: 26/Aug/21  Updated: 29/Oct/23  Resolved: 14/Oct/21

Status: Closed
Project: Compass
Component/s: Plugins
Affects Version/s: None
Fix Version/s: 1.29.4

Type: Task Priority: Major - P3
Reporter: Sergey Petushkov Assignee: Sergey Petushkov
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: COMPASS-4764
Story Points: 3
Documentation Changes: Not Needed
Sprint: Iteration Kampala, Iteration Lutz, Iteration Minsk, Iteration Novokuybyshevsk

 Description   

We want to explicitly require and activate internal Compass plugins in main compass application (either by changing hadron-plugin-manager to support this or by explicitly calling activate on every plugin so they are registered in the app registry). This is a prerequisite to make webpack aware of plugins existence. At the same time we should remove internal plugin loading from config/source logic from hadron-plugin-manager to avoid keeping the unused code around



 Comments   
Comment by Githook User [ 05/Oct/21 ]

Author:

{'name': 'Sergey', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: build: Pass all Compass monorepo dependencies through a single build when bundling the application COMPASS-5048 (#2465)

  • chore(mongodb-compass): Explicitly import plugins in compass main so that they are bundled by webpack
  • chore: Align async version everywhere
  • feat(webpack-config-compass): More shared features for webpack config
  • Add progress logging for builds
  • Do not externalize peer deps by default
  • Add support for loading libraries from source
  • Exclude node_modules from the babel processing to speed up things a bit
  • Add support for bundle analyzer + duplicate modules analysis
  • chore: Chance module.hot import paths from absolute aliased ones to relatives
  • chore(mongodb-compass): Update compass webpack config to allow hmr and externalize shell runtime
  • chore: Provide a exports.webpack condition for every monorepo workspace

That way Compass build process can pick up pacakge source when bundling
instead of using the dist

  • chore(data-service, compass-logging): Do not use `export =` syntax in typescript

We use babel for processing ts in webpack as it's more convenient than using ts-loader,
but this comes with a few caveats, one of them is that `export =` syntax is not supported

  • chore(mongodb-compass): Fix non-supported import

This worked before we added exports field to the package.json of the library
but is not supported when exports field is present

  • chore(compass-shell): Asyncify loading of the shell component so that it's not in the apps critical path an initial bundle
  • chore(compass-metrics): Asyncify loading of azure ip ranges so that it's not in the apps critical path an initial bundle
  • feat(scripts): Allow to skip package json update; Add convenience method for inserting key at particular position in the object
  • chore: Update package-lock
  • chore(mongodb-compass): Add interruptor as a direct dependency; Fix typo in the externals list
  • fix: Resolve depalign issues
  • fix(compass-connect, compass-logging): Provide named export from the library for the easier interop with commonjs
  • fix: More depcheck fixes
  • fix(hadron-plugin-manager): Update tests to match new API
  • fix(mongodb-data-service): Correctly return constructor from reRequire call
  • fix(compass-shell): Wait for component before asserting as it is async now
  • chore(mongodb-compass, hadron-build): Clean-up build steps that are not needed anymore
  • fix(hadron-build): Fix depcheck issues
  • fix(webpack-config-compass): Stop process bars when they are done
  • fix: Update ampersand to the same version; Don't return null as successfull fetch from local-backend
  • fix: Fix eslint error
  • chore(compass-e2e-test, ci): Do not run compass-e2e-tests in check and test step; Always use progress logger
  • chore: Update package-lock
  • fix(mongodb-compass): Use named exports for logger for commonjs compat
  • build(mongodb-compass): Use fs cache for webpack builds to speed up subsequent builds; Extract runtime chunks for renderers
  • fix(mongodb-compass): Fix depcheck
Comment by Githook User [ 28/Sep/21 ]

Author:

{'name': 'Sergey', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: build: Pass all Compass monorepo dependencies through a single build when bundling the application COMPASS-5048 (#2465)

  • chore(mongodb-compass): Explicitly import plugins in compass main so that they are bundled by webpack
  • chore: Align async version everywhere
  • feat(webpack-config-compass): More shared features for webpack config
  • Add progress logging for builds
  • Do not externalize peer deps by default
  • Add support for loading libraries from source
  • Exclude node_modules from the babel processing to speed up things a bit
  • Add support for bundle analyzer + duplicate modules analysis
  • chore: Chance module.hot import paths from absolute aliased ones to relatives
  • chore(mongodb-compass): Update compass webpack config to allow hmr and externalize shell runtime
  • chore: Provide a exports.webpack condition for every monorepo workspace

That way Compass build process can pick up pacakge source when bundling
instead of using the dist

  • chore(data-service, compass-logging): Do not use `export =` syntax in typescript

We use babel for processing ts in webpack as it's more convenient than using ts-loader,
but this comes with a few caveats, one of them is that `export =` syntax is not supported

  • chore(mongodb-compass): Fix non-supported import

This worked before we added exports field to the package.json of the library
but is not supported when exports field is present

  • chore(compass-shell): Asyncify loading of the shell component so that it's not in the apps critical path an initial bundle
  • chore(compass-metrics): Asyncify loading of azure ip ranges so that it's not in the apps critical path an initial bundle
  • feat(scripts): Allow to skip package json update; Add convenience method for inserting key at particular position in the object
  • chore: Update package-lock
  • chore(mongodb-compass): Add interruptor as a direct dependency; Fix typo in the externals list
  • fix: Resolve depalign issues
  • fix(compass-connect, compass-logging): Provide named export from the library for the easier interop with commonjs
  • fix: More depcheck fixes
  • fix(hadron-plugin-manager): Update tests to match new API
  • fix(mongodb-data-service): Correctly return constructor from reRequire call
  • fix(compass-shell): Wait for component before asserting as it is async now
  • chore(mongodb-compass, hadron-build): Clean-up build steps that are not needed anymore
  • fix(hadron-build): Fix depcheck issues
  • fix(webpack-config-compass): Stop process bars when they are done
  • fix: Update ampersand to the same version; Don't return null as successfull fetch from local-backend
  • fix: Fix eslint error
  • chore(compass-e2e-test, ci): Do not run compass-e2e-tests in check and test step; Always use progress logger
  • chore: Update package-lock
  • fix(mongodb-compass): Use named exports for logger for commonjs compat
  • build(mongodb-compass): Use fs cache for webpack builds to speed up subsequent builds; Extract runtime chunks for renderers
  • fix(mongodb-compass): Fix depcheck
Comment by Githook User [ 28/Sep/21 ]

Author:

{'name': 'Sergey Petushkov', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: Merge remote-tracking branch 'origin/main' into compass-5048-bundle-compass-plugins-with-webpack

Conflicts:
.github/workflows/check-test.yaml
configs/webpack-config-compass/src/index.ts
package-lock.json
packages/app-migrations/package.json
packages/compass/package.json
packages/compass/webpack.config.js
Branch: compass-5048-bundle-compass-plugins-with-webpack
https://github.com/mongodb-js/compass/commit/357a406e714dfababe873cac3eb460e92f1b6f8c

Comment by Githook User [ 24/Sep/21 ]

Author:

{'name': 'Sergey Petushkov', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: Merge remote-tracking branch 'origin/main' into compass-5048-bundle-compass-plugins-with-webpack
Branch: compass-5048-bundle-compass-plugins-with-webpack
https://github.com/mongodb-js/compass/commit/d8c444e8dc20cc477081cf0b360dd371975650b4

Comment by Githook User [ 23/Sep/21 ]

Author:

{'name': 'Sergey Petushkov', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: Merge remote-tracking branch 'origin/main' into compass-5048-bundle-compass-plugins-with-webpack
Branch: compass-5048-bundle-compass-plugins-with-webpack
https://github.com/mongodb-js/compass/commit/ea64137ad802d0593582651c2864885473622eb0

Generated at Wed Feb 07 22:38:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.