workbox-broadcast-update
Advanced tools
Comparing version 6.0.0-alpha.3 to 6.0.0-rc.0
"use strict"; | ||
// @ts-ignore | ||
try { | ||
self['workbox:broadcast-update:6.0.0-alpha.2'] && _(); | ||
self['workbox:broadcast-update:6.0.0-alpha.3'] && _(); | ||
} | ||
catch (e) { } |
@@ -23,3 +23,3 @@ import { CacheDidUpdateCallbackParam } from 'workbox-core/types.js'; | ||
* | ||
* @param {Object} options | ||
* @param {Object} [options] | ||
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']] | ||
@@ -26,0 +26,0 @@ * A list of headers that will be used to determine whether the responses |
@@ -46,3 +46,3 @@ /* | ||
* | ||
* @param {Object} options | ||
* @param {Object} [options] | ||
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']] | ||
@@ -49,0 +49,0 @@ * A list of headers that will be used to determine whether the responses |
@@ -17,3 +17,3 @@ import { WorkboxPlugin } from 'workbox-core/types.js'; | ||
* | ||
* @param {Object} options | ||
* @param {Object} [options] | ||
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']] | ||
@@ -26,3 +26,3 @@ * A list of headers that will be used to determine whether the responses | ||
*/ | ||
constructor(options: BroadcastCacheUpdateOptions); | ||
constructor(options?: BroadcastCacheUpdateOptions); | ||
/** | ||
@@ -29,0 +29,0 @@ * A "lifecycle" callback that will be triggered automatically by the |
@@ -23,3 +23,3 @@ /* | ||
* | ||
* @param {Object} options | ||
* @param {Object} [options] | ||
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']] | ||
@@ -26,0 +26,0 @@ * A list of headers that will be used to determine whether the responses |
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self['workbox:broadcast-update:6.0.0-alpha.2'] && _(); | ||
self['workbox:broadcast-update:6.0.0-alpha.3'] && _(); | ||
} catch (e) {} | ||
@@ -110,3 +110,3 @@ | ||
* | ||
* @param {Object} options | ||
* @param {Object} [options] | ||
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']] | ||
@@ -252,3 +252,3 @@ * A list of headers that will be used to determine whether the responses | ||
* | ||
* @param {Object} options | ||
* @param {Object} [options] | ||
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']] | ||
@@ -255,0 +255,0 @@ * A list of headers that will be used to determine whether the responses |
@@ -1,2 +0,2 @@ | ||
this.workbox=this.workbox||{},this.workbox.broadcastUpdate=function(t,a,o,s){"use strict";try{self["workbox:broadcast-update:6.0.0-alpha.2"]&&_()}catch(t){}const e=(t,a,o)=>!o.some((o=>t.headers.has(o)&&a.headers.has(o)))||o.every((o=>{const s=t.headers.has(o)===a.headers.has(o),e=t.headers.get(o)===a.headers.get(o);return s&&e})),n=["content-length","etag","last-modified"],i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function c(t){return{cacheName:t.cacheName,updatedURL:t.request.url}}class r{constructor({headersToCheck:t,generatePayload:a}={}){this.t=t||n,this.o=a||c}async notifyIfUpdated(t){if(t.oldResponse&&!e(t.oldResponse,t.newResponse,this.t)){const s={type:"CACHE_UPDATED",meta:"workbox-broadcast-update",payload:this.o(t)};if("navigate"===t.request.mode){let s;t.event instanceof FetchEvent&&(s=t.event.resultingClientId);await o.resultingClientExists(s)&&!i||await a.timeout(3500)}const e=await self.clients.matchAll({type:"window"});for(const t of e)t.postMessage(s)}}}return t.BroadcastCacheUpdate=r,t.BroadcastUpdatePlugin=class{constructor(t){this.cacheDidUpdate=async t=>{s.dontWaitFor(this.i.notifyIfUpdated(t))},this.i=new r(t)}},t.responsesAreSame=e,t}({},workbox.core._private,workbox.core._private,workbox.core._private); | ||
this.workbox=this.workbox||{},this.workbox.broadcastUpdate=function(t,a,o,s){"use strict";try{self["workbox:broadcast-update:6.0.0-alpha.3"]&&_()}catch(t){}const e=(t,a,o)=>!o.some((o=>t.headers.has(o)&&a.headers.has(o)))||o.every((o=>{const s=t.headers.has(o)===a.headers.has(o),e=t.headers.get(o)===a.headers.get(o);return s&&e})),n=["content-length","etag","last-modified"],i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function c(t){return{cacheName:t.cacheName,updatedURL:t.request.url}}class r{constructor({headersToCheck:t,generatePayload:a}={}){this.t=t||n,this.o=a||c}async notifyIfUpdated(t){if(t.oldResponse&&!e(t.oldResponse,t.newResponse,this.t)){const s={type:"CACHE_UPDATED",meta:"workbox-broadcast-update",payload:this.o(t)};if("navigate"===t.request.mode){let s;t.event instanceof FetchEvent&&(s=t.event.resultingClientId);await o.resultingClientExists(s)&&!i||await a.timeout(3500)}const e=await self.clients.matchAll({type:"window"});for(const t of e)t.postMessage(s)}}}return t.BroadcastCacheUpdate=r,t.BroadcastUpdatePlugin=class{constructor(t){this.cacheDidUpdate=async t=>{s.dontWaitFor(this.i.notifyIfUpdated(t))},this.i=new r(t)}},t.responsesAreSame=e,t}({},workbox.core._private,workbox.core._private,workbox.core._private); | ||
//# sourceMappingURL=workbox-broadcast-update.prod.js.map |
{ | ||
"name": "workbox-broadcast-update", | ||
"version": "6.0.0-alpha.3", | ||
"version": "6.0.0-rc.0", | ||
"license": "MIT", | ||
@@ -25,5 +25,5 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-core": "^6.0.0-alpha.3" | ||
"workbox-core": "^6.0.0-rc.0" | ||
}, | ||
"gitHead": "00ba07467b253751e874f53f424f2adb1c06e176" | ||
"gitHead": "43c375f60c986a23a25a1c04ad83ed94783c39d1" | ||
} |
// @ts-ignore | ||
try{self['workbox:broadcast-update:6.0.0-alpha.2']&&_()}catch(e){} | ||
try{self['workbox:broadcast-update:6.0.0-alpha.3']&&_()}catch(e){} |
@@ -65,3 +65,3 @@ /* | ||
* | ||
* @param {Object} options | ||
* @param {Object} [options] | ||
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']] | ||
@@ -68,0 +68,0 @@ * A list of headers that will be used to determine whether the responses |
@@ -30,3 +30,3 @@ /* | ||
* | ||
* @param {Object} options | ||
* @param {Object} [options] | ||
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']] | ||
@@ -39,3 +39,3 @@ * A list of headers that will be used to determine whether the responses | ||
*/ | ||
constructor(options: BroadcastCacheUpdateOptions) { | ||
constructor(options?: BroadcastCacheUpdateOptions) { | ||
this._broadcastUpdate = new BroadcastCacheUpdate(options); | ||
@@ -42,0 +42,0 @@ } |
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
147454
Updatedworkbox-core@^6.0.0-rc.0