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

Bundle the web workers #7700

Open
3 tasks
ozyx opened this issue Apr 17, 2024 · 7 comments
Open
3 tasks

Bundle the web workers #7700

ozyx opened this issue Apr 17, 2024 · 7 comments
Assignees
Labels
type:maintenance tests, chores, or project maintenance

Comments

@ozyx
Copy link
Member

ozyx commented Apr 17, 2024

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 ozyx added the type:maintenance tests, chores, or project maintenance label Apr 17, 2024
@ozyx
Copy link
Member Author

ozyx commented Apr 17, 2024

@evenstensberg any interest in taking this on?

@evenstensberg
Copy link
Contributor

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.

@hussainu6
Copy link

Can i take this

@evenstensberg
Copy link
Contributor

@hussainu6 sure 👍🏽

@ozyx ozyx self-assigned this Apr 30, 2024
@ozyx
Copy link
Member Author

ozyx commented Apr 30, 2024

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!

@evenstensberg
Copy link
Contributor

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

@evenstensberg
Copy link
Contributor

evenstensberg commented May 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants