You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When debugging, I look at sw.js to understand what's going on
});workbox.routing.registerRoute(newRegExp('{/items/.*$}'),cache_1_0);constcache_1_1=newworkbox.strategies.NetworkOnly({plugins: [newworkbox.backgroundSync.BackgroundSyncPlugin('add',{"maxRetentionTime": 1440,"forceSyncFallback": false,"onSync": async({queue})=>{try{awaitqueue.replayRequests();}catch(error){// Failed to replay one or more requests}finally{remainingRequests=awaitqueue.getAll();constbc=newBroadcastChannel('add-item');bc.postMessage({name: 'add',remaining: remainingRequests.length});bc.close();}}})]});workbox.routing.registerRoute(newRegExp('|/add|'),cache_1_1);constcache_2_0=newworkbox.strategies.CacheFirst({cacheName: 'fonts',plugins: [newworkbox.expiration.ExpirationPlugin({"maxEntries": 75,"maxAgeSeconds": 31536000}),newworkbox.cacheableResponse.CacheableResponsePlugin({"statuses": [0,200]})]
Example
What I'd like to see is more comments in the sw.js that show why the code was generated.
// pwa.yaml service_worker/workbox/background_sync: {queue_name: 'items', match_callback: "'regex: {/items/.*$}'", broadcast_channel: 'items-sync'"workbox.routing.registerRoute(newRegExp('{/items/.*$}'),cache_1_0);constcache_1_1=newworkbox.strategies.NetworkOnly({plugins: [newworkbox.backgroundSync.BackgroundSyncPlugin('add',{"maxRetentionTime": 1440,"forceSyncFallback": false,"onSync": async({queue})=>{try{awaitqueue.replayRequests();}catch(error){// Failed to replay one or more requests}finally{remainingRequests=awaitqueue.getAll();constbc=newBroadcastChannel('add-item');bc.postMessage({name: 'add',remaining: remainingRequests.length});bc.close();}}})]});// another comment that describes where the comes fromworkbox.routing.registerRoute(newRegExp('|/add|'),cache_1_1);constcache_2_0=newworkbox.strategies.CacheFirst({cacheName: 'fonts',plugins: [newworkbox.expiration.ExpirationPlugin({"maxEntries": 75,"maxAgeSeconds": 31536000}),newworkbox.cacheableResponse.CacheableResponsePlugin({"statuses": [0,200]})]
I think I can do this, as I'm poking around that section of the code to understand RegExp(). WDYT?
The text was updated successfully, but these errors were encountered:
Description
When debugging, I look at sw.js to understand what's going on
Example
What I'd like to see is more comments in the sw.js that show why the code was generated.
I think I can do this, as I'm poking around that section of the code to understand RegExp(). WDYT?
The text was updated successfully, but these errors were encountered: