workbox-recipes
Advanced tools
Comparing version 6.5.1 to 6.5.2
"use strict"; | ||
// @ts-ignore | ||
try { | ||
self['workbox:recipes:6.5.0'] && _(); | ||
self['workbox:recipes:6.5.1'] && _(); | ||
} | ||
catch (e) { } |
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self['workbox:recipes:6.5.0'] && _(); | ||
self['workbox:recipes:6.5.1'] && _(); | ||
} catch (e) {} | ||
@@ -9,0 +9,0 @@ |
@@ -1,2 +0,2 @@ | ||
this.workbox=this.workbox||{},this.workbox.recipes=function(e,s,t,n,o,a,c,r,i){"use strict";try{self["workbox:recipes:6.5.0"]&&_()}catch(e){}function u(e){self.addEventListener("install",(s=>{const t=e.urls.map((t=>e.strategy.handleAll({event:s,request:new Request(t)})[1]));s.waitUntil(Promise.all(t))}))}return e.googleFontsCache=function(e={}){const c=(e.cachePrefix||"google-fonts")+"-stylesheets",r=(e.cachePrefix||"google-fonts")+"-webfonts",i=e.maxAgeSeconds||31536e3,u=e.maxEntries||30;s.registerRoute((({url:e})=>"https://fonts.googleapis.com"===e.origin),new t.StaleWhileRevalidate({cacheName:c})),s.registerRoute((({url:e})=>"https://fonts.gstatic.com"===e.origin),new n.CacheFirst({cacheName:r,plugins:[new o.CacheableResponsePlugin({statuses:[0,200]}),new a.ExpirationPlugin({maxAgeSeconds:i,maxEntries:u})]}))},e.imageCache=function(e={}){const t=e.cacheName||"images",c=e.matchCallback||(({request:e})=>"image"===e.destination),r=e.maxAgeSeconds||2592e3,i=e.maxEntries||60,w=e.plugins||[];w.push(new o.CacheableResponsePlugin({statuses:[0,200]})),w.push(new a.ExpirationPlugin({maxEntries:i,maxAgeSeconds:r}));const l=new n.CacheFirst({cacheName:t,plugins:w});s.registerRoute(c,l),e.warmCache&&u({urls:e.warmCache,strategy:l})},e.offlineFallback=function(e={}){const s=e.pageFallback||"offline.html",t=e.imageFallback||!1,n=e.fontFallback||!1;self.addEventListener("install",(e=>{const o=[s];t&&o.push(t),n&&o.push(n),e.waitUntil(self.caches.open("workbox-offline-fallbacks").then((e=>e.addAll(o))))})),r.setCatchHandler((async e=>{const o=e.request.destination,a=await self.caches.open("workbox-offline-fallbacks");if("document"===o){return await i.matchPrecache(s)||await a.match(s)||Response.error()}if("image"===o&&!1!==t){return await i.matchPrecache(t)||await a.match(t)||Response.error()}if("font"===o&&!1!==n){return await i.matchPrecache(n)||await a.match(n)||Response.error()}return Response.error()}))},e.pageCache=function(e={}){const t=e.cacheName||"pages",n=e.matchCallback||(({request:e})=>"navigate"===e.mode),a=e.networkTimeoutSeconds||3,r=e.plugins||[];r.push(new o.CacheableResponsePlugin({statuses:[0,200]}));const i=new c.NetworkFirst({networkTimeoutSeconds:a,cacheName:t,plugins:r});s.registerRoute(n,i),e.warmCache&&u({urls:e.warmCache,strategy:i})},e.staticResourceCache=function(e={}){const n=e.cacheName||"static-resources",a=e.matchCallback||(({request:e})=>"style"===e.destination||"script"===e.destination||"worker"===e.destination),c=e.plugins||[];c.push(new o.CacheableResponsePlugin({statuses:[0,200]}));const r=new t.StaleWhileRevalidate({cacheName:n,plugins:c});s.registerRoute(a,r),e.warmCache&&u({urls:e.warmCache,strategy:r})},e.warmStrategyCache=u,e}({},workbox.routing,workbox.strategies,workbox.strategies,workbox.cacheableResponse,workbox.expiration,workbox.strategies,workbox.routing,workbox.precaching); | ||
this.workbox=this.workbox||{},this.workbox.recipes=function(e,s,t,n,o,a,c,r,i){"use strict";try{self["workbox:recipes:6.5.1"]&&_()}catch(e){}function u(e){self.addEventListener("install",(s=>{const t=e.urls.map((t=>e.strategy.handleAll({event:s,request:new Request(t)})[1]));s.waitUntil(Promise.all(t))}))}return e.googleFontsCache=function(e={}){const c=(e.cachePrefix||"google-fonts")+"-stylesheets",r=(e.cachePrefix||"google-fonts")+"-webfonts",i=e.maxAgeSeconds||31536e3,u=e.maxEntries||30;s.registerRoute((({url:e})=>"https://fonts.googleapis.com"===e.origin),new t.StaleWhileRevalidate({cacheName:c})),s.registerRoute((({url:e})=>"https://fonts.gstatic.com"===e.origin),new n.CacheFirst({cacheName:r,plugins:[new o.CacheableResponsePlugin({statuses:[0,200]}),new a.ExpirationPlugin({maxAgeSeconds:i,maxEntries:u})]}))},e.imageCache=function(e={}){const t=e.cacheName||"images",c=e.matchCallback||(({request:e})=>"image"===e.destination),r=e.maxAgeSeconds||2592e3,i=e.maxEntries||60,w=e.plugins||[];w.push(new o.CacheableResponsePlugin({statuses:[0,200]})),w.push(new a.ExpirationPlugin({maxEntries:i,maxAgeSeconds:r}));const l=new n.CacheFirst({cacheName:t,plugins:w});s.registerRoute(c,l),e.warmCache&&u({urls:e.warmCache,strategy:l})},e.offlineFallback=function(e={}){const s=e.pageFallback||"offline.html",t=e.imageFallback||!1,n=e.fontFallback||!1;self.addEventListener("install",(e=>{const o=[s];t&&o.push(t),n&&o.push(n),e.waitUntil(self.caches.open("workbox-offline-fallbacks").then((e=>e.addAll(o))))})),r.setCatchHandler((async e=>{const o=e.request.destination,a=await self.caches.open("workbox-offline-fallbacks");if("document"===o){return await i.matchPrecache(s)||await a.match(s)||Response.error()}if("image"===o&&!1!==t){return await i.matchPrecache(t)||await a.match(t)||Response.error()}if("font"===o&&!1!==n){return await i.matchPrecache(n)||await a.match(n)||Response.error()}return Response.error()}))},e.pageCache=function(e={}){const t=e.cacheName||"pages",n=e.matchCallback||(({request:e})=>"navigate"===e.mode),a=e.networkTimeoutSeconds||3,r=e.plugins||[];r.push(new o.CacheableResponsePlugin({statuses:[0,200]}));const i=new c.NetworkFirst({networkTimeoutSeconds:a,cacheName:t,plugins:r});s.registerRoute(n,i),e.warmCache&&u({urls:e.warmCache,strategy:i})},e.staticResourceCache=function(e={}){const n=e.cacheName||"static-resources",a=e.matchCallback||(({request:e})=>"style"===e.destination||"script"===e.destination||"worker"===e.destination),c=e.plugins||[];c.push(new o.CacheableResponsePlugin({statuses:[0,200]}));const r=new t.StaleWhileRevalidate({cacheName:n,plugins:c});s.registerRoute(a,r),e.warmCache&&u({urls:e.warmCache,strategy:r})},e.warmStrategyCache=u,e}({},workbox.routing,workbox.strategies,workbox.strategies,workbox.cacheableResponse,workbox.expiration,workbox.strategies,workbox.routing,workbox.precaching); | ||
//# sourceMappingURL=workbox-recipes.prod.js.map |
@@ -1,7 +0,7 @@ | ||
import { googleFontsCache } from './googleFontsCache'; | ||
import { imageCache } from './imageCache'; | ||
import { staticResourceCache } from './staticResourceCache'; | ||
import { pageCache } from './pageCache'; | ||
import { offlineFallback } from './offlineFallback'; | ||
import { warmStrategyCache } from './warmStrategyCache'; | ||
import { googleFontsCache, GoogleFontCacheOptions } from './googleFontsCache'; | ||
import { imageCache, ImageCacheOptions } from './imageCache'; | ||
import { staticResourceCache, StaticResourceOptions } from './staticResourceCache'; | ||
import { pageCache, PageCacheOptions } from './pageCache'; | ||
import { offlineFallback, OfflineFallbackOptions } from './offlineFallback'; | ||
import { warmStrategyCache, WarmStrategyCacheOptions } from './warmStrategyCache'; | ||
import './_version.js'; | ||
@@ -11,2 +11,2 @@ /** | ||
*/ | ||
export { googleFontsCache, imageCache, staticResourceCache, pageCache, offlineFallback, warmStrategyCache, }; | ||
export { GoogleFontCacheOptions, googleFontsCache, imageCache, ImageCacheOptions, offlineFallback, OfflineFallbackOptions, pageCache, PageCacheOptions, staticResourceCache, StaticResourceOptions, warmStrategyCache, WarmStrategyCacheOptions, }; |
@@ -10,3 +10,3 @@ /* | ||
import { imageCache } from './imageCache'; | ||
import { staticResourceCache } from './staticResourceCache'; | ||
import { staticResourceCache, } from './staticResourceCache'; | ||
import { pageCache } from './pageCache'; | ||
@@ -19,2 +19,2 @@ import { offlineFallback } from './offlineFallback'; | ||
*/ | ||
export { googleFontsCache, imageCache, staticResourceCache, pageCache, offlineFallback, warmStrategyCache, }; | ||
export { googleFontsCache, imageCache, offlineFallback, pageCache, staticResourceCache, warmStrategyCache, }; |
{ | ||
"name": "workbox-recipes", | ||
"version": "6.5.1", | ||
"version": "6.5.2", | ||
"license": "MIT", | ||
@@ -26,10 +26,10 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-cacheable-response": "6.5.1", | ||
"workbox-core": "6.5.1", | ||
"workbox-expiration": "6.5.1", | ||
"workbox-precaching": "6.5.1", | ||
"workbox-routing": "6.5.1", | ||
"workbox-strategies": "6.5.1" | ||
"workbox-cacheable-response": "6.5.2", | ||
"workbox-core": "6.5.2", | ||
"workbox-expiration": "6.5.2", | ||
"workbox-precaching": "6.5.2", | ||
"workbox-routing": "6.5.2", | ||
"workbox-strategies": "6.5.2" | ||
}, | ||
"gitHead": "7c095b4f981976d11a29ac934a16c6a0fbd0c0c1" | ||
"gitHead": "85bdecd24ded38c215b4e8943ee9b3eb0e2c3ee9" | ||
} |
import { RouteMatchCallback, WorkboxPlugin } from 'workbox-core/types.js'; | ||
import './_version.js'; | ||
export interface ImageCacheOptions { | ||
export interface PageCacheOptions { | ||
cacheName?: string; | ||
@@ -22,3 +22,3 @@ matchCallback?: RouteMatchCallback; | ||
*/ | ||
declare function pageCache(options?: ImageCacheOptions): void; | ||
declare function pageCache(options?: PageCacheOptions): void; | ||
export { pageCache }; |
// @ts-ignore | ||
try{self['workbox:recipes:6.5.1']&&_()}catch(e){} | ||
try{self['workbox:recipes:6.5.2']&&_()}catch(e){} |
@@ -9,8 +9,11 @@ /* | ||
import {googleFontsCache} from './googleFontsCache'; | ||
import {imageCache} from './imageCache'; | ||
import {staticResourceCache} from './staticResourceCache'; | ||
import {pageCache} from './pageCache'; | ||
import {offlineFallback} from './offlineFallback'; | ||
import {warmStrategyCache} from './warmStrategyCache'; | ||
import {googleFontsCache, GoogleFontCacheOptions} from './googleFontsCache'; | ||
import {imageCache, ImageCacheOptions} from './imageCache'; | ||
import { | ||
staticResourceCache, | ||
StaticResourceOptions, | ||
} from './staticResourceCache'; | ||
import {pageCache, PageCacheOptions} from './pageCache'; | ||
import {offlineFallback, OfflineFallbackOptions} from './offlineFallback'; | ||
import {warmStrategyCache, WarmStrategyCacheOptions} from './warmStrategyCache'; | ||
@@ -24,8 +27,14 @@ import './_version.js'; | ||
export { | ||
GoogleFontCacheOptions, | ||
googleFontsCache, | ||
imageCache, | ||
ImageCacheOptions, | ||
offlineFallback, | ||
OfflineFallbackOptions, | ||
pageCache, | ||
PageCacheOptions, | ||
staticResourceCache, | ||
pageCache, | ||
offlineFallback, | ||
StaticResourceOptions, | ||
warmStrategyCache, | ||
WarmStrategyCacheOptions, | ||
}; |
@@ -20,3 +20,3 @@ /* | ||
export interface ImageCacheOptions { | ||
export interface PageCacheOptions { | ||
cacheName?: string; | ||
@@ -41,3 +41,3 @@ matchCallback?: RouteMatchCallback; | ||
*/ | ||
function pageCache(options: ImageCacheOptions = {}): void { | ||
function pageCache(options: PageCacheOptions = {}): void { | ||
const defaultMatchCallback = ({request}: RouteMatchCallbackOptions) => | ||
@@ -44,0 +44,0 @@ request.mode === 'navigate'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107043
1063
+ Addedworkbox-cacheable-response@6.5.2(transitive)
+ Addedworkbox-core@6.5.2(transitive)
+ Addedworkbox-expiration@6.5.2(transitive)
+ Addedworkbox-precaching@6.5.2(transitive)
+ Addedworkbox-routing@6.5.2(transitive)
+ Addedworkbox-strategies@6.5.2(transitive)
- Removedworkbox-cacheable-response@6.5.1(transitive)
- Removedworkbox-core@6.5.1(transitive)
- Removedworkbox-expiration@6.5.1(transitive)
- Removedworkbox-precaching@6.5.1(transitive)
- Removedworkbox-routing@6.5.1(transitive)
- Removedworkbox-strategies@6.5.1(transitive)
Updatedworkbox-core@6.5.2
Updatedworkbox-expiration@6.5.2
Updatedworkbox-precaching@6.5.2
Updatedworkbox-routing@6.5.2
Updatedworkbox-strategies@6.5.2