workbox-precaching
Advanced tools
Comparing version 3.0.0-alpha.1 to 3.0.0-alpha.2
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self.workbox.v['workbox:precaching:3.0.0-alpha.1'] = 1; | ||
self.workbox.v['workbox:precaching:3.0.0-alpha.2'] = 1; | ||
} catch (e) {} // eslint-disable-line | ||
@@ -261,4 +261,3 @@ | ||
// TODO (gauntface) Before launch swap for d.g.c/web URL | ||
logger_mjs.logger.unprefixed.warn(`You can learn more about why this might be a ` + `problem here: https://docs.google.com/document/d/1i83D4x_1Jz2JT3BCRjO` + `18m-vdL9uG7ksscqZ_E0XjO0/edit?usp=sharing`); | ||
logger_mjs.logger.unprefixed.warn(`You can learn more about why this might be a ` + `problem here: https://developers.google.com/web/tools/workbox/modules/workbox-precaching`); | ||
@@ -265,0 +264,0 @@ logger_mjs.logger.groupEnd(); |
@@ -1,2 +0,2 @@ | ||
this.workbox=this.workbox||{},this.workbox.precaching=function(e,t,n,r,s){"use strict";try{self.workbox.v["workbox:precaching:3.0.0-alpha.1"]=1}catch(e){}class i{constructor(e,t,n,r){this.e=e,this.t=t,this.n=n;const s=new Request(t);this.r=s,this.s=r?this.i(s):s}i(e){let t=e.url;const n={};if("cache"in Request.prototype)n.cache="reload";else{const e=new URL(t,location),n=encodeURIComponent;e.search+=(e.search?"&":"")+n("_workbox-cache-bust")+"="+n(this.n),t=e.toString()}return new Request(t,n)}}const c="precached-details-models";class o{constructor(t){this.c=e.cacheNames.getPrecacheName(t),this.o=new s.DBWrapper("workbox-precaching",1,{onupgradeneeded:e=>{e.target.result.createObjectStore(c)}})}l(e){var t=this;return babelHelpers.asyncToGenerator(function*(){if((yield t.u(e.t))!==e.n)return!1;return!!(yield(yield caches.open(t.c)).match(e.r))})()}a(){var e=this;return babelHelpers.asyncToGenerator(function*(){return yield e.o.getAll(c)})()}u(e){var t=this;return babelHelpers.asyncToGenerator(function*(){const n=yield t.o.get(c,e);return n?n.revision:null})()}d(e){var t=this;return babelHelpers.asyncToGenerator(function*(){yield t.o.put(c,{revision:e.n,url:e.r.url},e.t)})()}h(e){var t=this;return babelHelpers.asyncToGenerator(function*(){yield t.o.delete(c,e)})()}}const l=(()=>{var e=babelHelpers.asyncToGenerator(function*(e){const t=e.clone(),n=yield"body"in t?Promise.resolve(t.body):t.blob();return new Response(n,["headers","status","statusText"].map(function(e){return t[e]}))});return function(t){return e.apply(this,arguments)}})();class u{constructor(t){this.c=e.cacheNames.getPrecacheName(t),this.f=new Map,this.y=new o(this.c)}addToCacheList(e){e.map(e=>{this.b(this.p(e))})}p(e){switch(typeof e){case"string":return new i(e,e,e);case"object":return new i(e,e.url,e.revision||e.url,!!e.revision);default:throw new t.WorkboxError("add-to-cache-list-unexpected-type",{entry:e})}}b(e){const n=this.f.get(e.t);if(n){if(n.n!==e.n)throw new t.WorkboxError("add-to-cache-list-conflicting-entries",{firstEntry:n.e,secondEntry:e.e})}else this.f.set(e.t,e)}install(e={}){var t=this;return babelHelpers.asyncToGenerator(function*(){const e=[],n=[];for(const r of t.f.values())(yield t.y.l(r))?n.push(r):e.push(r);return yield Promise.all(e.map(function(e){return t.w(e)})),{updatedEntries:e,notUpdatedEntries:n}})()}w(e){var t=this;return babelHelpers.asyncToGenerator(function*(){let s=yield n.fetchWrapper.fetch(e.s);return s.redirected&&(s=yield l(s)),yield r.cacheWrapper.put(t.c,e.r,s),yield t.y.d(e),!0})()}cleanup(){var e=this;return babelHelpers.asyncToGenerator(function*(){const t=[];e.f.forEach(function(e){const n=new URL(e.r.url,location).toString();t.push(n)});const[n,r]=yield Promise.all([e.R(t),e._(t)]);return{deletedCacheRequests:n,deletedRevisionDetails:r}})()}R(e){var t=this;return babelHelpers.asyncToGenerator(function*(){if(!(yield caches.has(t.c)))return[];const n=yield caches.open(t.c),r=(yield n.keys()).filter(function(t){return!e.includes(new URL(t.url,location).toString())});return yield Promise.all(r.map(function(e){return n.delete(e)})),r.map(function(e){return e.url})})()}_(e){var t=this;return babelHelpers.asyncToGenerator(function*(){const n=yield t.y.a(),r=Object.keys(n).filter(function(t){const r=n[t],s=new URL(r.url,location).toString();return!e.includes(s)});return yield Promise.all(r.map(function(e){return t.y.h(e)})),r.map(function(e){return n[e].url})})()}getCachedUrls(){return Array.from(this.f.keys()).map(e=>new URL(e,location).href)}}var a=Object.freeze({PrecacheController:u});let d=!1,h=!1,f=!1;const y=e.cacheNames.getPrecacheName(),b=new u(y),p={};p.precache=(e=>{b.addToCacheList(e),d||e.length<=0||(d=!0,self.addEventListener("install",e=>{e.waitUntil(b.install({suppressWarnings:f}))}),self.addEventListener("activate",e=>{e.waitUntil(b.cleanup())}))}),p.addRoute=(e=>{h||(h=!0,self.addEventListener("fetch",t=>{const n=((e,{ignoreUrlParametersMatching:t=[/^utm_/],directoryIndex:n="index.html"}={})=>{const r=new URL(e,location);r.hash="";const s=b.getCachedUrls();if(-1!==s.indexOf(r.href))return r.href;let i=((e,t)=>{const n=e.search.slice(1).split("&").map(e=>e.split("=")).filter(e=>t.every(t=>!t.test(e[0]))).map(e=>e.join("=")),r=new URL(e);return r.search=n.join("&"),r})(r,t);return-1!==s.indexOf(i.href)?i.href:n&&i.pathname.endsWith("/")&&(i.pathname+=n,-1!==s.indexOf(i.href))?i.href:null})(t.request.url,e);if(!n)return;let r=caches.open(y).then(e=>e.match(n));t.respondWith(r)}))}),p.precacheAndRoute=((e,t)=>{p.precache(e),p.addRoute(t)}),p.suppressWarnings=(e=>{f=e});return Object.assign(p,a)}(workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private); | ||
this.workbox=this.workbox||{},this.workbox.precaching=function(e,t,n,r,s){"use strict";try{self.workbox.v["workbox:precaching:3.0.0-alpha.2"]=1}catch(e){}class i{constructor(e,t,n,r){this.e=e,this.t=t,this.n=n;const s=new Request(t);this.r=s,this.s=r?this.i(s):s}i(e){let t=e.url;const n={};if("cache"in Request.prototype)n.cache="reload";else{const e=new URL(t,location),n=encodeURIComponent;e.search+=(e.search?"&":"")+n("_workbox-cache-bust")+"="+n(this.n),t=e.toString()}return new Request(t,n)}}const c="precached-details-models";class o{constructor(t){this.c=e.cacheNames.getPrecacheName(t),this.o=new s.DBWrapper("workbox-precaching",1,{onupgradeneeded:e=>{e.target.result.createObjectStore(c)}})}l(e){var t=this;return babelHelpers.asyncToGenerator(function*(){return(yield t.u(e.t))===e.n&&!!(yield(yield caches.open(t.c)).match(e.r))})()}a(){var e=this;return babelHelpers.asyncToGenerator(function*(){return yield e.o.getAll(c)})()}u(e){var t=this;return babelHelpers.asyncToGenerator(function*(){const n=yield t.o.get(c,e);return n?n.revision:null})()}d(e){var t=this;return babelHelpers.asyncToGenerator(function*(){yield t.o.put(c,{revision:e.n,url:e.r.url},e.t)})()}h(e){var t=this;return babelHelpers.asyncToGenerator(function*(){yield t.o.delete(c,e)})()}}const l=(()=>{var e=babelHelpers.asyncToGenerator(function*(e){const t=e.clone(),n=yield"body"in t?Promise.resolve(t.body):t.blob();return new Response(n,["headers","status","statusText"].map(function(e){return t[e]}))});return function(t){return e.apply(this,arguments)}})();class u{constructor(t){this.c=e.cacheNames.getPrecacheName(t),this.f=new Map,this.y=new o(this.c)}addToCacheList(e){e.map(e=>{this.b(this.p(e))})}p(e){switch(typeof e){case"string":return new i(e,e,e);case"object":return new i(e,e.url,e.revision||e.url,!!e.revision);default:throw new t.WorkboxError("add-to-cache-list-unexpected-type",{entry:e})}}b(e){const n=this.f.get(e.t);if(n){if(n.n!==e.n)throw new t.WorkboxError("add-to-cache-list-conflicting-entries",{firstEntry:n.e,secondEntry:e.e})}else this.f.set(e.t,e)}install(e={}){var t=this;return babelHelpers.asyncToGenerator(function*(){const e=[],n=[];for(const r of t.f.values())(yield t.y.l(r))?n.push(r):e.push(r);return yield Promise.all(e.map(function(e){return t.w(e)})),{updatedEntries:e,notUpdatedEntries:n}})()}w(e){var t=this;return babelHelpers.asyncToGenerator(function*(){let s=yield n.fetchWrapper.fetch(e.s);return s.redirected&&(s=yield l(s)),yield r.cacheWrapper.put(t.c,e.r,s),yield t.y.d(e),!0})()}cleanup(){var e=this;return babelHelpers.asyncToGenerator(function*(){const t=[];e.f.forEach(function(e){const n=new URL(e.r.url,location).toString();t.push(n)});const[n,r]=yield Promise.all([e.R(t),e._(t)]);return{deletedCacheRequests:n,deletedRevisionDetails:r}})()}R(e){var t=this;return babelHelpers.asyncToGenerator(function*(){if(!(yield caches.has(t.c)))return[];const n=yield caches.open(t.c),r=(yield n.keys()).filter(function(t){return!e.includes(new URL(t.url,location).toString())});return yield Promise.all(r.map(function(e){return n.delete(e)})),r.map(function(e){return e.url})})()}_(e){var t=this;return babelHelpers.asyncToGenerator(function*(){const n=yield t.y.a(),r=Object.keys(n).filter(function(t){const r=n[t],s=new URL(r.url,location).toString();return!e.includes(s)});return yield Promise.all(r.map(function(e){return t.y.h(e)})),r.map(function(e){return n[e].url})})()}getCachedUrls(){return Array.from(this.f.keys()).map(e=>new URL(e,location).href)}}var a=Object.freeze({PrecacheController:u});let d=!1,h=!1,f=!1;const y=e.cacheNames.getPrecacheName(),b=new u(y),p={};return p.precache=(e=>{b.addToCacheList(e),d||e.length<=0||(d=!0,self.addEventListener("install",e=>{e.waitUntil(b.install({suppressWarnings:f}))}),self.addEventListener("activate",e=>{e.waitUntil(b.cleanup())}))}),p.addRoute=(e=>{h||(h=!0,self.addEventListener("fetch",t=>{const n=((e,{ignoreUrlParametersMatching:t=[/^utm_/],directoryIndex:n="index.html"}={})=>{const r=new URL(e,location);r.hash="";const s=b.getCachedUrls();if(-1!==s.indexOf(r.href))return r.href;let i=((e,t)=>{const n=e.search.slice(1).split("&").map(e=>e.split("=")).filter(e=>t.every(t=>!t.test(e[0]))).map(e=>e.join("=")),r=new URL(e);return r.search=n.join("&"),r})(r,t);return-1!==s.indexOf(i.href)?i.href:n&&i.pathname.endsWith("/")&&(i.pathname+=n,-1!==s.indexOf(i.href))?i.href:null})(t.request.url,e);if(!n)return;let r=caches.open(y).then(e=>e.match(n));t.respondWith(r)}))}),p.precacheAndRoute=((e,t)=>{p.precache(e),p.addRoute(t)}),p.suppressWarnings=(e=>{f=e}),Object.assign(p,a)}(workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private); | ||
//# sourceMappingURL=workbox-precaching.prod.js.map |
{ | ||
"name": "workbox-precaching", | ||
"version": "3.0.0-alpha.1", | ||
"version": "3.0.0-alpha.2", | ||
"license": "Apache-2.0", | ||
@@ -28,4 +28,4 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-core": "^3.0.0-alpha.1" | ||
"workbox-core": "^3.0.0-alpha.2" | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
263428
1862
Updatedworkbox-core@^3.0.0-alpha.2