Re: [w3c/ServiceWorker] How should import() work in service workers? (#1585)

Small bikeshed:  I think `modulepreload` would confuse people with preload semantics in the main thread where something is just preloaded for the currently load.  This is more caching than preloading, right?  Maybe `cacheModule(foo)`?

Also, should we make this work for importScripts as well?  I mean, why should importScripts have to parse/compile/execute for offline caching?

Another strawperson:

```javascript
self.addEventListener('install', evt => {
  evt.waitUntil(async function() {
    await evt.installScript('foo.js', 'classic');
    await evt.installScript('bar.js', 'module');
  }());
});
```

-- 
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/1585#issuecomment-825853982

Received on Friday, 23 April 2021 18:52:04 UTC