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

Fixed webworker startup bc elkjs hidden dependency #78

Merged

Conversation

Sakrafux
Copy link
Contributor

@Sakrafux Sakrafux commented Apr 6, 2024

As described in the comment, but elkjs wants to instantiate workers. If no workerFactory is given, it tries to resolve this using a fake worker from elk-worker.min.js, which is seemingly available when started through node, but not in a web-worker context. Since it is a dynamic import unknown to webpack, it is not bundled.

Therefore, I simply assigned a simple stub, since the worker functionality of elkjs is not needed. This enables the server to start in a worker as expected.

Copy link
Contributor

@tortmayr tortmayr left a comment

Choose a reason for hiding this comment

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

Good catch!
Changes look good to me. Thanks! 👍🏼
This also fixes eclipse-glsp/glsp#1018

@tortmayr tortmayr merged commit 9634f64 into eclipse-glsp:main Apr 15, 2024
6 checks passed
@tortmayr
Copy link
Contributor

@Sakrafux This change seems to break the elk-layout-engine when used in a node context. When executing a layout action the elk.layout promise never resolves, hence the operation is never completed and blocks the entire action queue. I guess we have to restrict this changes to the browser-only context.

For now, I'm going to revert this change. Please feel free to open a new PR that fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants