respec icon indicating copy to clipboard operation
respec copied to clipboard

Convert respec-worker as an ES module

Open saschanaz opened this issue 7 years ago • 4 comments

As part of #1640:

A worker script can be a module if we construct it by new Worker(url, { type: "module" }). I think this will ultimately benefit #1469 where we can load it as a module that can also work in Node.js.

  • [x] Wait until browsers support it

saschanaz avatar May 12 '18 17:05 saschanaz

That be very cool. Do you have any details about {type: "module"} support?

marcoscaceres avatar May 14 '18 04:05 marcoscaceres

MDN: https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker Spec: https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=680046 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1247687 Safari: https://bugs.webkit.org/show_bug.cgi?id=164860

An interesting support indicator: https://aremodulesready.com/

It seems it currently lacks any browser support.

saschanaz avatar May 14 '18 05:05 saschanaz

Seems it’s now supported across all browsers. So, might be time 😎

marcoscaceres avatar Dec 21 '21 22:12 marcoscaceres

Oh wait… firefox not done yet.

marcoscaceres avatar Dec 21 '21 22:12 marcoscaceres