Unverified Commit 2958e3e8 authored by Chris Barna's avatar Chris Barna Committed by GitHub

Upgrades `web-vitals` to v1.1.2. (#25272)

I'm not sure if this is something that y'all want but it `web-vitals` has been integrating more browser support. The major release is because they removed the [`isFinal` flag on the Metric type](https://github.com/GoogleChrome/web-vitals/commit/d233b7b8c33b8e1746ec5202ed865b48f53b7619).
parent 655eb5cb
{"name":"web-vitals","main":"web-vitals.es5.umd.min.js","author":{"name":"Philip Walton","email":"philip@philipwalton.com","url":"http://philipwalton.com"},"license":"Apache-2.0"} {"name":"web-vitals","main":"web-vitals.umd.js","author":{"name":"Philip Walton","email":"philip@philipwalton.com","url":"http://philipwalton.com"},"license":"Apache-2.0"}
module.exports=function(){var t={599:function(t,e){!function(t,n){true?n(e):0}(this,function(t){"use strict";var e,n,i=function(){return"".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)},a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return{name:t,value:e,delta:0,entries:[],id:i(),isFinal:!1}},r=function(t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver(function(t){return t.getEntries().map(e)});return n.observe({type:t,buffered:!0}),n}}catch(t){}},o=!1,u=!1,s=function(t){o=!t.persisted},c=function(){addEventListener("pagehide",s),addEventListener("beforeunload",function(){})},p=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u||(c(),u=!0),addEventListener("visibilitychange",function(e){var n=e.timeStamp;"hidden"===document.visibilityState&&t({timeStamp:n,isUnloading:o})},{capture:!0,once:e})},l=function(t,e,n,i){var a;return function(){n&&e.isFinal&&n.disconnect(),e.value>=0&&(i||e.isFinal||"hidden"===document.visibilityState)&&(e.delta=e.value-(a||0),(e.delta||e.isFinal||void 0===a)&&(t(e),a=e.value))}},f=function(){return void 0===e&&(e="hidden"===document.visibilityState?0:1/0,p(function(t){var n=t.timeStamp;return e=n},!0)),{get timeStamp(){return e}}},d=function(){return n||(n=new Promise(function(t){return["scroll","keydown","pointerdown"].map(function(e){addEventListener(e,t,{once:!0,passive:!0,capture:!0})})})),n};t.getCLS=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=a("CLS",0),o=function(t){t.hadRecentInput||(i.value+=t.value,i.entries.push(t),e())},u=r("layout-shift",o);u&&(e=l(t,i,u,n),p(function(t){var n=t.isUnloading;u.takeRecords().map(o),n&&(i.isFinal=!0),e()}))},t.getFCP=function(t){var e,n=a("FCP"),i=f(),o=r("paint",function(t){"first-contentful-paint"===t.name&&t.startTime<i.timeStamp&&(n.value=t.startTime,n.isFinal=!0,n.entries.push(t),e())});o&&(e=l(t,n,o))},t.getFID=function(t){var e=a("FID"),n=f(),i=function(t){t.startTime<n.timeStamp&&(e.value=t.processingStart-t.startTime,e.entries.push(t),e.isFinal=!0,u())},o=r("first-input",i),u=l(t,e,o);o?p(function(){o.takeRecords().map(i),o.disconnect()},!0):window.perfMetrics&&window.perfMetrics.onFirstInputDelay&&window.perfMetrics.onFirstInputDelay(function(t,i){i.timeStamp<n.timeStamp&&(e.value=t,e.isFinal=!0,e.entries=[{entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+t}],u())})},t.getLCP=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=a("LCP"),o=f(),u=function(t){var n=t.startTime;n<o.timeStamp?(i.value=n,i.entries.push(t)):i.isFinal=!0,e()},s=r("largest-contentful-paint",u);if(s){e=l(t,i,s,n);var c=function(){i.isFinal||(s.takeRecords().map(u),i.isFinal=!0,e())};d().then(c),p(c,!0)}},t.getTTFB=function(t){var e,n=a("TTFB");e=function(){try{var e=performance.getEntriesByType("navigation")[0]||function(){var t=performance.timing,e={entryType:"navigation",startTime:0};for(var n in t)"navigationStart"!==n&&"toJSON"!==n&&(e[n]=Math.max(t[n]-t.navigationStart,0));return e}();n.value=n.delta=e.responseStart,n.entries=[e],n.isFinal=!0,t(n)}catch(t){}},"complete"===document.readyState?setTimeout(e,0):addEventListener("pageshow",e)},Object.defineProperty(t,"__esModule",{value:!0})})}};var e={};function __nccwpck_require__(n){if(e[n]){return e[n].exports}var i=e[n]={exports:{}};var a=true;try{t[n].call(i.exports,i,i.exports,__nccwpck_require__);a=false}finally{if(a)delete e[n]}return i.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(599)}();
\ No newline at end of file
module.exports=function(){var e={770:function(e,t){!function(e,n){true?n(t):0}(this,function(e){"use strict";var t,n,i,r,a=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},o=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){if("first-input"===e&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver(function(e){return e.getEntries().map(t)});return n.observe({type:e,buffered:!0}),n}}catch(e){}},u=function(e,t){var i=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",i,!0),addEventListener("pagehide",i,!0)},c=function(e){addEventListener("pageshow",function(t){t.persisted&&e(t)},!0)},s=function(e,t,n){var i;return function(r){t.value>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},f=-1,v=function(){return"hidden"===document.visibilityState?0:1/0},m=function(){u(function(e){var t=e.timeStamp;f=t},!0)},p=function(){return f<0&&(f=v(),m(),c(function(){setTimeout(function(){f=v(),m()},0)})),{get firstHiddenTime(){return f}}},d=function(e,t){var n,i=p(),r=a("FCP"),u=function(e){"first-contentful-paint"===e.name&&(v&&v.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=e.startTime,r.entries.push(e),n(!0)))},f=performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],v=f?null:o("paint",u);(f||v)&&(n=s(e,r,t),f&&u(f),c(function(i){r=a("FCP"),n=s(e,r,t),requestAnimationFrame(function(){requestAnimationFrame(function(){r.value=performance.now()-i.timeStamp,n(!0)})})}))},l=!1,g=-1,h={passive:!0,capture:!0},y=new Date,T=function(e,r){t||(t=r,n=e,i=new Date,w(removeEventListener),_())},_=function(){if(n>=0&&n<i-y){var e={entryType:"first-input",name:t.type,target:t.target,cancelable:t.cancelable,startTime:t.timeStamp,processingStart:t.timeStamp+n};r.forEach(function(t){t(e)}),r=[]}},E=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){T(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,h),removeEventListener("pointercancel",i,h)};addEventListener("pointerup",n,h),addEventListener("pointercancel",i,h)}(t,e):T(t,e)}},w=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,E,h)})},S=new Set;e.getCLS=function(e,t){l||(d(function(e){g=e.value}),l=!0);var n,i=function(t){g>-1&&e(t)},r=a("CLS",0),f=0,v=[],m=function(e){if(!e.hadRecentInput){var t=v[0],i=v[v.length-1];f&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(f+=e.value,v.push(e)):(f=e.value,v=[e]),f>r.value&&(r.value=f,r.entries=v,n())}},p=o("layout-shift",m);p&&(n=s(i,r,t),u(function(){p.takeRecords().map(m),n(!0)}),c(function(){f=0,g=-1,r=a("CLS",0),n=s(i,r,t)}))},e.getFCP=d,e.getFID=function(e,i){var f,v=p(),m=a("FID"),d=function(e){e.startTime<v.firstHiddenTime&&(m.value=e.processingStart-e.startTime,m.entries.push(e),f(!0))},l=o("first-input",d);f=s(e,m,i),l&&u(function(){l.takeRecords().map(d),l.disconnect()},!0),l&&c(function(){var o;m=a("FID"),f=s(e,m,i),r=[],n=-1,t=null,w(addEventListener),o=d,r.push(o),_()})},e.getLCP=function(e,t){var n,i=p(),r=a("LCP"),f=function(e){var t=e.startTime;t<i.firstHiddenTime&&(r.value=t,r.entries.push(e)),n()},v=o("largest-contentful-paint",f);if(v){n=s(e,r,t);var m=function(){S.has(r.id)||(v.takeRecords().map(f),v.disconnect(),S.add(r.id),n(!0))};["keydown","click"].forEach(function(e){addEventListener(e,m,{once:!0,capture:!0})}),u(m,!0),c(function(i){r=a("LCP"),n=s(e,r,t),requestAnimationFrame(function(){requestAnimationFrame(function(){r.value=performance.now()-i.timeStamp,S.add(r.id),n(!0)})})})}},e.getTTFB=function(e){var t,n=a("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();if(n.value=n.delta=t.responseStart,n.value<0)return;n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("pageshow",t)},Object.defineProperty(e,"__esModule",{value:!0})})}};var t={};function __nccwpck_require__(n){if(t[n]){return t[n].exports}var i=t[n]={exports:{}};var r=true;try{e[n].call(i.exports,i,i.exports,__nccwpck_require__);r=false}finally{if(r)delete t[n]}return i.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(770)}();
\ No newline at end of file
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
"text-table": "0.2.0", "text-table": "0.2.0",
"typescript": "4.3.4", "typescript": "4.3.4",
"unistore": "3.4.1", "unistore": "3.4.1",
"web-vitals": "0.2.4", "web-vitals": "2.1.0",
"webpack": "4.44.1", "webpack": "4.44.1",
"webpack-sources": "1.4.3" "webpack-sources": "1.4.3"
}, },
......
...@@ -19070,10 +19070,10 @@ web-streams-polyfill@2.1.1: ...@@ -19070,10 +19070,10 @@ web-streams-polyfill@2.1.1:
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-2.1.1.tgz#2c82b6193849ccb9efaa267772c28260ef68d6d2" resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-2.1.1.tgz#2c82b6193849ccb9efaa267772c28260ef68d6d2"
integrity sha512-dlNpL2aab3g8CKfGz6rl8FNmGaRWLLn2g/DtSc9IjB30mEdE6XxzPfPSig5BwGSzI+oLxHyETrQGKjrVVhbLCg== integrity sha512-dlNpL2aab3g8CKfGz6rl8FNmGaRWLLn2g/DtSc9IjB30mEdE6XxzPfPSig5BwGSzI+oLxHyETrQGKjrVVhbLCg==
web-vitals@0.2.4: web-vitals@2.1.0:
version "0.2.4" version "2.1.0"
resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-0.2.4.tgz#ec3df43c834a207fd7cdefd732b2987896e08511" resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-2.1.0.tgz#ebf5428875ab5bfc1056c2e80cd177001287de7b"
integrity sha512-6BjspCO9VriYy12z356nL6JBS0GYeEcA457YyRzD+dD6XYCQ75NKhcOHUMHentOE7OcVCIXXDvOm0jKFfQG2Gg== integrity sha512-npEyJP8jHf3J71t1tRTEtz9FeKp8H2udWJUUq5ykfPhhstr//TUxiYhIEzLNwk4zv2ybAilMn7v7N6Mxmuitmg==
webidl-conversions@^4.0.2: webidl-conversions@^4.0.2:
version "4.0.2" version "4.0.2"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment