openmct
openmct copied to clipboard
Bundle the web workers
Summary
On build, Open MCT creates its bundle openmct.js
along with a bunch of other files, many of which are WebWorkers that are conditionally instantiated by different plugins:
generatorWorker: './example/generator/generatorWorker.js',
couchDBChangesFeed: './src/plugins/persistence/couch/CouchChangesFeed.js',
inMemorySearchWorker: './src/api/objects/InMemorySearchWorker.js',
We should bundle these into openmct.js
using webpack.
- [ ] Remove the
entry
points for each web/shared worker in webpack config - [ ] Add the workers to the bundle using webpack
- [ ] Ensure that breakpoints can be hit in the workers
@evenstensberg any interest in taking this on?
Yep, this would be cool to implement!
@ozyx I've sent you an invite to the webpack internal slack. If you have any problems/feedback about webpack, you can give that there.
Can i take this
@hussainu6 sure 👍🏽
Can i take this
Hi @hussainu6 , thanks for your interest!
We're currently addressing this issue as part of our ongoing sprint, so we're not seeking additional contributions on it at the moment. However, I encourage you to check out our help wanted issues for other areas where your contributions would be greatly appreciated.
Also, please ensure you have submitted a Contributor License Agreement (CLA) if you haven't done so already. We require this before we can merge any contributions you make. Thank you!
@ozyx How do you plan to initiate the workers and where?
I guess we can declare the workers in the global scope in openmct.js
Edit: We can import the workers where they are initiated, instead of a public url to the workers after bundled, we can import them directly using import.meta