question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Web workers support

See original GitHub issue

Type of Issue

[ ] Bug Report
[X] Feature Request

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.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
alan-agius4commented, Jul 14, 2019

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.

1reaction
dhergescommented, Jul 6, 2019

Don’t think its possible. new Worker() requires a URL and that can only be done by the app.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web Workers | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
Worker - Web APIs - MDN Web Docs
Chrome Edge Worker Full support. Chrome4. Toggle history Full support. Edge... Worker() constructor Full support. Chrome4. Toggle history Full support. Edge... Support for ECMAScript modules Full...
Read more >
The State Of Web Workers In 2021 - Smashing Magazine
A table taken from caniuse.com, showing that every browser supports Workers. Web Workers are fully supported in every browser since IE10.
Read more >
Browser Compatibility Testing of Web Workers - LambdaTest
BROWSER SUPPORT FOR Web Workers · Google Chrome · Mozilla Firefox · Internet Explorer · Safari · Microsoft Edge · Opera.
Read more >
Browser versions that support web workers? - Stack Overflow
Internet Explorer 10, Firefox, Chrome, Safari and Opera support Web workers. But it is a bit vague for me. It does not state...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found