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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ report.xml

wf-glsp-server-node.js
wf-glsp-server-node.js.map
wf-glsp-server-webworker.js
wf-glsp-server-webworker.js.map
2 changes: 1 addition & 1 deletion examples/workflow-server-bundled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"wf-glsp-server-node.js.map"
],
"scripts": {
"clean": "rimraf wf-glsp-server-node.js wf-glsp-server-node.js.map",
"clean": "rimraf wf-glsp-server-node.js wf-glsp-server-node.js.map wf-glsp-server-webworker.js wf-glsp-server-webworker.js.map",
"start": "node --enable-source-maps ./wf-glsp-server-node.js --port 5007",
"start:websocket": "node --enable-source-maps ./wf-glsp-server-node.js -w --port 8081",
"watch": "tsc -w"
Expand Down
6 changes: 5 additions & 1 deletion packages/layout-elk/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ export function configureELKLayoutModule(options: ElkModuleOptions): ContainerMo
const elkFactory: ElkFactory = () =>
new ElkConstructor({
algorithms: options.algorithms,
defaultLayoutOptions: options.defaultLayoutOptions
defaultLayoutOptions: options.defaultLayoutOptions,
// The node implementation relied on elkjs' `FakeWorker` to set the `workerFactory`.
// However, since the required file is dynamically loaded and not available in a web-worker context,
// it needs to be mocked manually.
workerFactory: () => ({ postMessage: () => {} }) as unknown as Worker
});

bind(ElkFactory).toConstantValue(elkFactory);
Expand Down
Loading