openmct icon indicating copy to clipboard operation
openmct copied to clipboard

Bundle the web workers

Open ozyx opened this issue 10 months ago • 7 comments

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

ozyx avatar Apr 17 '24 20:04 ozyx

@evenstensberg any interest in taking this on?

ozyx avatar Apr 17 '24 20:04 ozyx

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.

evenstensberg avatar Apr 17 '24 20:04 evenstensberg

Can i take this

hussainu6 avatar Apr 29 '24 23:04 hussainu6

@hussainu6 sure 👍🏽

evenstensberg avatar Apr 30 '24 09:04 evenstensberg

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 avatar Apr 30 '24 16:04 ozyx

@ozyx How do you plan to initiate the workers and where?

evenstensberg avatar May 07 '24 17:05 evenstensberg

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

evenstensberg avatar May 08 '24 19:05 evenstensberg