developit / developit/workerize

Handling no Worker support

Offen
#15 2 Kommentare 7 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
4.4k
Forks
87
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

🤔 Based on my first few seconds with `workerize` and `workerize-loader`:

In the situations where Workers aren't supported (IE9, Chrome w/ file:/// protocol, etc), the Worker construction fails and throws. This would force the user to try/catch the worker construction and then implement code to run in the main thread in that case (if necessary).

Rather that try/catching that and having to write that fall-back code, it could be handy if `workerize` could fail gracefully and just proxy through the original functions (wrapped in Promises to preserve the expected API).

Thoughts? I don't have a lot of experience with Workers / `workerize`, but it came to my mind so I thought I'd bring it up.

Edit: Forgot to mention that `workerize` and the loader look super cool so far, so great work! 👍

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start by reproducing Worker construction failures in workerize and workerize-loader for the environments named in the issue, then inspect where Worker initialization occurs. Done means unsupported environments avoid throwing and proxy the original functions through Promises while preserving the expected API.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
frontend, web-dev
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.