Re: [w3c/ServiceWorker] Top-level await integration for ServiceWorkers running modules (#1407)

I don't see any technical problems adding top-level await. Just a couple of adjustments like you mentioned. However, service workers that use top-level await would be considered bad practice.

When we boot up an active service worker, it's for an event. Sometimes the event is performance sensitive, such as `"fetch"`. Awaiting on anything that isn't needed for TTFB is pretty bad.

So we either:

1. Allow it since it's part of JavaScript, but provide guidance against it, and maybe warn on the console.
1. Disable it. Although it kinda feels odd to disable JavaScript features in a particular context like this.

I'm leaning towards 2. What do you think @slightlyoff?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1407#issuecomment-493903701

Received on Monday, 20 May 2019 09:13:18 UTC