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
Web workers support #1334
Comments
Don't think its possible. |
Running code in web workers should be handled at an application level. iMHO, a library should offer a set of features and than its up to the consumer if these features should be run in a web worker or the not. |
@alan-agius4, if I am creating a libray with a service that is doing an intensive work. the issue here is that I won't be able to pack it cuz the worker specification worker must be seperate file. |
Some things to consider when using web-workers in a library.
From an ng-packagr perspective it is currently not possible to include web-workers, the main reason is that web workers need a separate compilation from the library itself which is currently not possible. |
@alan-agius4 well now as work around, I wraped the worker code as string and then exported it as an objectUrl with javascript as mime. we can think to laverage webpack's worker-loader for the worker bundling. |
Type of Issue
Description
I need to use web worker for image processing library, and I am wondering if it is possible to generate a web worker inside the library and make it work out of the box for consumers?
Currently, my workaround is to add an inline script as a blob url and create a worker with it.
However the downside of this workaround is that you won't be able to use
{type: 'module}
. and it is not possible to use 3rd party libraries such as rxjs.A feature: please describe your use case and motivation
It would be very useful if we can generate web workers and integrate them in the library without
requiring users to manually configure them.
Expected Behaviour
A feature: do you have a first draft or an idea how to implement?
Not sure if it is possible.
The text was updated successfully, but these errors were encountered: