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

I like option 1.  In https://github.com/w3c/ServiceWorker/issues/1331 and related issues like https://github.com/w3c/ServiceWorker/issues/1157 and requests for exposure of localStorage to ServiceWorkers (!) the issue of data available synchronously-ish at SW startup has come up several times.  I know I've at least suggested that async APIs should still be used in this case and we will work on making the async APIs more performant.

To me, this means that:
- Yes, top-level async awaits should be possible so async storage can be used.  (And this is preferable to exposing localStorage, etc.)
- We have a better chance of creating accurate and useful data-preload hints if we are able to know these storage uses are part of top-level evaluation and there's no chance for contamination from "fetch" events interleaving with the top-level evaluation.

Also, option 3 seems hard to reason about and explain to humans.

-- 
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-531585195

Received on Sunday, 15 September 2019 17:46:48 UTC