Skip to content

Webworker bundling issue prevents proper rendering in dev mode #79

@eacaps

Description

@eacaps

Hi! Awesome work you all are doing here on a solid graph library. I've stumbled upon a few issues integrating this into a Vue 3.0 project where we are using the memgraph backend. We're using vite to build our application and when running in dev mode it does not handle the webworker bundling correctly from WebWorkerSimulator:

        this.worker = new Worker(new URL(
        /* webpackChunkName: 'process.worker' */
        './process.worker', import.meta.url), { type: 'module' });

Unfortunately it fails in a way that is not caught by the SimulatorFactory, so it does not fall back to the MainThreadSimulator properly and the graph does not end up rendering properly. vite support for webworkers in dev mode is spotty at best, so i ended up just creating a by-pass so that SimullatorFactory would return a MainThreadSimulator in dev mode. I browsed around and found this related issue: #43 but that is running the vite preview command which works around the dev mode issues.

Like I said, I've coded up a hack for now, but looking through the issues and Pull requests I was wondering what the best approach would be to resolve this issue. I was considering adding an optional SimulatorFactory in the options to provide library consumers with the ability to handle the Simulation creation if they'd like and I can submit an external Pull request from a fork, but I also see there is potentially a lot changing in Release 1.0.0. Is this still being considered as a release or what are your thoughts on outside contributions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions