diff --git a/dist/cjs/whyDidYouRender.js b/dist/cjs/whyDidYouRender.js index 5a9106f..3d611c9 100644 --- a/dist/cjs/whyDidYouRender.js +++ b/dist/cjs/whyDidYouRender.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 4.3.0 + * @welldone-software/why-did-you-render 4.3.1 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ 'use strict'; diff --git a/dist/cjs/whyDidYouRender.min.js b/dist/cjs/whyDidYouRender.min.js index 2394257..05eb750 100644 --- a/dist/cjs/whyDidYouRender.min.js +++ b/dist/cjs/whyDidYouRender.min.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 4.3.0 + * @welldone-software/why-did-you-render 4.3.1 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var r=e(require("lodash/get")),t=e(require("lodash/isString")),n=e(require("lodash/reduce")),o=e(require("lodash/has")),a=e(require("lodash/keys")),i=e(require("lodash/isSet")),c=e(require("lodash/isFunction")),s=e(require("lodash/isRegExp")),u=e(require("lodash/isDate")),f=e(require("lodash/isPlainObject")),p=e(require("lodash/isArray")),l=e(require("lodash/defaults"));function d(e,r){for(var t=0;te.length)&&(r=e.length);for(var t=0,n=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(c)throw a}}}}var S,j="different",x="deepEquals",C="date",T="regex",P="reactElement",Y="function",H="function"==typeof Symbol&&Symbol.for,I=H?Symbol.for("react.memo"):60115,L=H?Symbol.for("react.forward_ref"):60112,A=(y(S={},j,"different objects."),y(S,x,"different objects that are equal by value."),y(S,C,"different date objects with the same value."),y(S,T,"different regular expressions with the same value."),y(S,P,"different React elements (remember that the syntax always produces a *NEW* immutable React element so a component that receives as props always re-renders.)."),y(S,Y,"different functions with the same name."),S),M=!1;function W(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prefixMessage,a=e.diffObjType,i=e.differences,c=e.values,s=e.options;i&&i.length>0?(s.consoleLog(y({},t,r),"".concat(o," of ").concat(a," changes:")),i.forEach((function(e){var r=e.pathString,t=e.diffType,o=e.prevValue,i=e.nextValue;s.consoleGroup("%c".concat("hook"===a?"[hook ".concat(n," result]"):"".concat(a,"."),"%c").concat(r,"%c"),"color:".concat(s.diffNameColor,";"),"color:".concat(s.diffPathColor,";"),"color:default;"),s.consoleLog("".concat(A[t]," (more info at ").concat(n?"http://bit.ly/wdyr3":"http://bit.ly/wdyr02",")")),s.consoleLog(y({},"prev ".concat(r),o),"!==",y({},"next ".concat(r),i)),s.consoleGroupEnd()}))):i&&(s.consoleLog(y({},t,r),"".concat(o," the ").concat(a," object itself changed but its values are all equal."),"props"===a?"This could have been avoided by making the component pure, or by preventing its father from re-rendering.":"This usually means this component called setState when no changes in its state actually occurred.","More info at ".concat("http://bit.ly/wdyr02")),s.consoleLog("prev ".concat(a,":"),c.prev," !== ",c.next,":next ".concat(a)))}function F(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,c=e.nextProps,s=e.nextState,u=e.nextHook,f=e.reason,p=e.options,l=e.ownerDataMap;if(function(e,r,t){return!M&&(!!t.logOnDifferentValues||(!(!r.whyDidYouRender||!r.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some((function(e){return e.diffType===j}))||e.stateDifferences&&e.stateDifferences.some((function(e){return e.diffType===j}))||e.hookDifferences&&e.hookDifferences.some((function(e){return e.diffType===j})))))}(f,r,p)){p.consoleGroup("%c".concat(t),"color: ".concat(p.titleColor,";"));var d="Re-rendered because";if(f.propsDifferences&&(W({Component:r,displayName:t,prefixMessage:d,diffObjType:"props",differences:f.propsDifferences,values:{prev:o,next:c},options:p}),d="And because"),f.stateDifferences&&W({Component:r,displayName:t,prefixMessage:d,diffObjType:"state",differences:f.stateDifferences,values:{prev:a,next:s},options:p}),f.hookDifferences&&W({Component:r,displayName:t,prefixMessage:d,diffObjType:"hook",differences:f.hookDifferences,values:{prev:i,next:u},hookName:n,options:p}),f.propsDifferences&&f.ownerDifferences){var h=l.get(o),m=l.get(c);p.consoleGroup("Rendered by ".concat(m.displayName));var v="Re-rendered because";f.ownerDifferences.propsDifferences&&(W({Component:m.Component,displayName:m.displayName,prefixMessage:v,diffObjType:"props",differences:f.ownerDifferences.propsDifferences,values:{prev:h.props,next:m.props},options:p}),v="And because"),f.ownerDifferences.stateDifferences&&W({Component:m.Component,displayName:m.displayName,prefixMessage:v,diffObjType:"state",differences:f.ownerDifferences.stateDifferences,values:{prev:h.state,next:m.state},options:p}),f.ownerDifferences.hookDifferences&&f.ownerDifferences.hookDifferences.forEach((function(e,r){var t=e.hookName,n=e.differences;return W({Component:m.Component,displayName:m.displayName,prefixMessage:v,diffObjType:"hook",differences:n,values:{prev:h.hooks[r].result,next:m.hooks[r].result},hookName:t,options:p})})),p.consoleGroupEnd()}f.propsDifferences||f.stateDifferences||f.hookDifferences||p.consoleLog(y({},t,r),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat("http://bit.ly/wdyr02")),p.consoleGroupEnd()}}function q(e){return e&&"undefined"!=typeof module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler((function(r){"idle"===r&&(M=!0,setTimeout((function(){M=!1}),e))})),F}var U=function(){};function G(e){return e.displayName||e.name||e.type&&G(e.type)||e.render&&G(e.render)||(t(e)?e:void 0)}var V="undefined"!=typeof Element,B="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,$=function(e){return e.$$typeof===B};function z(e,r,t,n,o){return t.push({diffType:o,pathString:n,prevValue:e,nextValue:r}),o!==j}function J(e,r,t){try{var n=[];return function e(r,t,n){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(r===t)return!0;if(!r||!t)return z(r,t,n,l,j);if(p(r)&&p(t)){var d=r.length;if(d!==t.length)return z(R(r),R(t),n,l,j);for(var y=[],h=0,v=d;v--;v>0){var b=e(r[v],t[v],y,"".concat(l,"[").concat(v,"]"));b&&h++}return h===d?z(R(r),R(t),n,l,x):(n.push.apply(n,y),z(R(r),R(t),n,l,j))}if(i(r)&&i(t)){if(r.size!==t.size)return z(new Set(r),new Set(t),n,l,j);var g,D=N(r);try{for(D.s();!(g=D.n()).done;){var w=g.value;if(!t.has(w))return z(new Set(r),new Set(t),n,l,j)}}catch(e){D.e(e)}finally{D.f()}return z(new Set(r),new Set(t),n,l,x)}if(u(r)&&u(t))return r.getTime()===t.getTime()?z(new Date(r),new Date(t),n,l,C):z(new Date(r),new Date(t),n,l,j);if(s(r)&&s(t))return r.toString()===t.toString()?z(r,t,n,l,T):z(r,t,n,l,j);if(V&&r instanceof Element&&t instanceof Element)return z(r,t,n,l,j);if($(r)&&$(t)){if(r.type!==t.type)return z(r,t,n,l,j);var _=e(r.props,t.props,[],"".concat(l,".props"));return z(r,t,n,l,_?P:j)}if(c(r)&&c(t))return r.name===t.name?z(r,t,n,l,Y):z(r,t,n,l,j);if(f(r)&&f(t)){var O=a(r),k=O.length;if(k!==a(t).length)return z(m({},r),m({},t),n,l,j);for(var E=k;E--;E>0)if(!o(t,O[E]))return z(m({},r),m({},t),n,l,j);for(var S=[],H=0,I=k;I--;I>0){var L=O[I],A=e(r[L],t[L],S,"".concat(l,".").concat(L));A&&H++}return H===k?z(m({},r),m({},t),n,l,x):(n.push.apply(n,S),z(m({},r),m({},t),n,l,j))}return z(r,t,n,l,j)}(e,r,n,t),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var K={};function Q(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.shallow,a=void 0===o||o;if(e===r)return!1;if(!a)return J(e,r);var i=e||K,c=r||K,s=Object.keys(m(m({},i),c));return n(s,(function(e,r){var t=J(i[r],c[r],r);return t&&(e=[].concat(R(e),R(t))),e}),[])}function X(e){var r=e.prevOwnerData,t=e.nextOwnerData;if(!r||!t)return!1;var n=r.hooks.map((function(e,r){return{hookName:e.hookName,differences:Q(e.result,t.hooks[r].result,{shallow:!1})}}));return{propsDifferences:Q(r.props,t.props),stateDifferences:Q(r.state,t.state),hookDifferences:n.length>0&&n}}function Z(e,r,t,n,o,a,i){var c=i.get(e),s=i.get(n);return{propsDifferences:Q(e,n),stateDifferences:Q(r,o),hookDifferences:Q(t,a,{shallow:!1}),ownerDifferences:X({prevOwnerData:c,nextOwnerData:s})}}function ee(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,c=e.nextProps,s=e.nextState,u=e.nextHook,f=e.options,p=e.ownerDataMap;return{Component:r,displayName:t,hookName:n,prevProps:o,prevState:a,prevHook:i,nextProps:c,nextState:s,nextHook:u,options:f,ownerDataMap:p,reason:Z(o,a,i,c,s,u,p)}}function re(e){return e.prototype&&!!e.prototype.isReactComponent}function te(e){return e.$$typeof===I}function ne(e){return e.$$typeof===L}function oe(e){var r=e.Component,t=e.displayName,n=e.options,o=e.React,a=e.isHookChange;return!function(e,r){return r.exclude&&r.exclude.length>0&&r.exclude.some((function(r){return r.test(e)}))}(t,n)&&(!1!==r.whyDidYouRender&&((!a||!r.whyDidYouRender||!1!==r.whyDidYouRender.trackHooks)&&!!(r.whyDidYouRender||n.trackAllPureComponents&&(r&&r.prototype instanceof o.PureComponent||te(r))||function(e,r){return r.include&&r.include.length>0&&r.include.some((function(r){return r.test(e)}))}(t,n))))}function ae(e,r,t,n,o){var a=function(t){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&b(e,r)}(u,t);var a,i,c,s=w(u);function u(r,t){var n,o;!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,u),(o=s.call(this,r,t))._WDYR={renderNumber:0};var a=_((n=g(o),v(u.prototype)),"render",n)||o.render;return a!==e.prototype.render&&(o.render=function(){return u.prototype.render.apply(g(o)),a()}),o}return a=u,(i=[{key:"render",value:function(){if(this._WDYR.renderNumber++,"isStrictMode"in this._WDYR||(this._WDYR.isStrictMode=function(e){for(var r=e&&e._reactInternalFiber;r;){if(1&r.mode)return!0;r=r.return}return!1}(this)),!this._WDYR.isStrictMode||this._WDYR.renderNumber%2!=1){if(this._WDYR.prevProps){var t=ee({Component:e,displayName:r,prevProps:this._WDYR.prevProps,prevState:this._WDYR.prevState,nextProps:this.props,nextState:this.state,options:n,ownerDataMap:o});n.notifier(t)}this._WDYR.prevProps=this.props,this._WDYR.prevState=this.state}return _(v(u.prototype),"render",this)?_(v(u.prototype),"render",this).call(this):null}}])&&d(a.prototype,i),c&&d(a,c),u}(e);try{a.displayName=r}catch(e){}return l(a,e),a}function ie(e,r,t,n,o,a){var i="string"==typeof e?function(e,r){return function(t){return r.createElement(e,t)}}(e,n):e;function c(){var e=arguments[0],c=n.useRef(),s=c.current;if(c.current=e,s){var u=ee({Component:i,displayName:t,prevProps:s,nextProps:e,options:o,ownerDataMap:a}),f=!u.reason.propsDifferences||r&&0===u.reason.propsDifferences.length;f||o.notifier(u)}return i.apply(void 0,arguments)}try{c.displayName=t}catch(e){}return c.ComponentForHooksTracking=i,l(c,i),c}var ce=Symbol("initial-hook-value");function se(e,t,n,o,a,i,c){var s=t.path,u=s?r(n,s):n,f=o.useRef(1);null!=c.current[0]&&f.current!==c.current[0].renderNumber&&(c.current=[]),c.current.push({hookName:e,result:u,renderNumber:f.current}),f.current++;var p=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current,l=o.useRef(ce);if(!p)return n;var d=p.type.ComponentForHooksTracking||p.type,y=G(d);if(!oe({Component:d,displayName:y,options:a,React:o,isHookChange:!0}))return n;var h=l.current;if(l.current=n,h!==ce){var m=ee({Component:d,displayName:y,hookName:e,prevHook:s?r(h,s):h,nextHook:u,options:a,ownerDataMap:i});m.reason.hookDifferences&&a.notifier(m)}return n}function ue(e,r,t,n,o,a){return te(r)?function e(r,t,n,o,a){var i=r.type,c=re(i),s=ne(i),u=te(i),f=s?i.render:i,p=c?ae(f,t,0,o,a):u?e(f,t,n,o,a):ie(f,!0,t,n,o,a);try{p.displayName=G(f)}catch(e){}p.ComponentForHooksTracking=r,l(p,f);var d=n.memo(s?n.forwardRef(p):p,r.compare);try{d.displayName=t}catch(e){}return l(d,r),d}(r,t,n,o,a):ne(r)?function(e,r,t,n,o){var a=e.render,i=te(a),c=i?a.type:a,s=ie(c,i,r,t,n,o);s.displayName=G(c),s.ComponentForHooksTracking=c,l(s,c);var u=t.forwardRef(i?t.memo(s,a.compare):s);try{u.displayName=r}catch(e){}return l(u,e),u}(r,t,n,o,a):re(r)?ae(r,t,0,o,a):ie(r,!1,t,n,o,a)}function fe(e,r,t,n,o,a){if(e.has(r))return e.get(r);var i=ue(0,r,t,n,o,a);return e.set(r,i),i}function pe(e){return!!e&&(te(e)?pe(e.type):ne(e)?pe(e.render):"function"==typeof e||void 0)}var le={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};function de(e,r){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=console.group,t=console.groupEnd;e.collapseGroups?r=console.groupCollapsed:e.onlyLogs&&(r=console.log,t=U);var n=e.notifier||q("hotReloadBufferMs"in e?e.hotReloadBufferMs:500);return m({include:null,exclude:null,notifier:n,onlyLogs:!1,consoleLog:console.log,consoleGroup:r,consoleGroupEnd:t,logOnDifferentValues:!1,logOwnerReasons:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red",trackExtraHooks:[],trackAllPureComponents:!1},e)}(r),n=e.createElement,o=e.createFactory,a=e.cloneElement,i=new WeakMap,c=new WeakMap,s={current:[]};function u(r){var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current;if(t){var n=t.type.ComponentForHooksTracking||t.type,o=G(n);c.set(r.props,{Component:n,displayName:o,props:t.pendingProps,state:null!=t.stateNode?t.stateNode.state:null,hooks:s.current})}}var f=null;if(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&Object.defineProperty(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,"current",{get:function(){return f},set:function(e){f=e,s.current=[]}}),e.createElement=function(r){for(var o=null,a=null,s=null,f=arguments.length,p=new Array(f>1?f-1:0),l=1;l (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ import _get$1 from 'lodash/get'; diff --git a/dist/esm/whyDidYouRender.min.js b/dist/esm/whyDidYouRender.min.js index 1945873..17f269b 100644 --- a/dist/esm/whyDidYouRender.min.js +++ b/dist/esm/whyDidYouRender.min.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 4.3.0 + * @welldone-software/why-did-you-render 4.3.1 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ import e from"lodash/get";import r from"lodash/isString";import t from"lodash/reduce";import n from"lodash/has";import o from"lodash/keys";import a from"lodash/isSet";import i from"lodash/isFunction";import c from"lodash/isRegExp";import s from"lodash/isDate";import f from"lodash/isPlainObject";import u from"lodash/isArray";import p from"lodash/defaults";function l(e,r){for(var t=0;te.length)&&(r=e.length);for(var t=0,n=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(c)throw a}}}}var N,S="different",j="deepEquals",x="date",C="regex",T="reactElement",P="function",Y="function"==typeof Symbol&&Symbol.for,H=Y?Symbol.for("react.memo"):60115,I=Y?Symbol.for("react.forward_ref"):60112,L=(d(N={},S,"different objects."),d(N,j,"different objects that are equal by value."),d(N,x,"different date objects with the same value."),d(N,C,"different regular expressions with the same value."),d(N,T,"different React elements (remember that the syntax always produces a *NEW* immutable React element so a component that receives as props always re-renders.)."),d(N,P,"different functions with the same name."),N),A=!1;function M(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prefixMessage,a=e.diffObjType,i=e.differences,c=e.values,s=e.options;i&&i.length>0?(s.consoleLog(d({},t,r),"".concat(o," of ").concat(a," changes:")),i.forEach((function(e){var r=e.pathString,t=e.diffType,o=e.prevValue,i=e.nextValue;s.consoleGroup("%c".concat("hook"===a?"[hook ".concat(n," result]"):"".concat(a,"."),"%c").concat(r,"%c"),"color:".concat(s.diffNameColor,";"),"color:".concat(s.diffPathColor,";"),"color:default;"),s.consoleLog("".concat(L[t]," (more info at ").concat(n?"http://bit.ly/wdyr3":"http://bit.ly/wdyr02",")")),s.consoleLog(d({},"prev ".concat(r),o),"!==",d({},"next ".concat(r),i)),s.consoleGroupEnd()}))):i&&(s.consoleLog(d({},t,r),"".concat(o," the ").concat(a," object itself changed but its values are all equal."),"props"===a?"This could have been avoided by making the component pure, or by preventing its father from re-rendering.":"This usually means this component called setState when no changes in its state actually occurred.","More info at ".concat("http://bit.ly/wdyr02")),s.consoleLog("prev ".concat(a,":"),c.prev," !== ",c.next,":next ".concat(a)))}function W(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,c=e.nextProps,s=e.nextState,f=e.nextHook,u=e.reason,p=e.options,l=e.ownerDataMap;if(function(e,r,t){return!A&&(!!t.logOnDifferentValues||(!(!r.whyDidYouRender||!r.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some((function(e){return e.diffType===S}))||e.stateDifferences&&e.stateDifferences.some((function(e){return e.diffType===S}))||e.hookDifferences&&e.hookDifferences.some((function(e){return e.diffType===S})))))}(u,r,p)){p.consoleGroup("%c".concat(t),"color: ".concat(p.titleColor,";"));var m="Re-rendered because";if(u.propsDifferences&&(M({Component:r,displayName:t,prefixMessage:m,diffObjType:"props",differences:u.propsDifferences,values:{prev:o,next:c},options:p}),m="And because"),u.stateDifferences&&M({Component:r,displayName:t,prefixMessage:m,diffObjType:"state",differences:u.stateDifferences,values:{prev:a,next:s},options:p}),u.hookDifferences&&M({Component:r,displayName:t,prefixMessage:m,diffObjType:"hook",differences:u.hookDifferences,values:{prev:i,next:f},hookName:n,options:p}),u.propsDifferences&&u.ownerDifferences){var y=l.get(o),h=l.get(c);p.consoleGroup("Rendered by ".concat(h.displayName));var v="Re-rendered because";u.ownerDifferences.propsDifferences&&(M({Component:h.Component,displayName:h.displayName,prefixMessage:v,diffObjType:"props",differences:u.ownerDifferences.propsDifferences,values:{prev:y.props,next:h.props},options:p}),v="And because"),u.ownerDifferences.stateDifferences&&M({Component:h.Component,displayName:h.displayName,prefixMessage:v,diffObjType:"state",differences:u.ownerDifferences.stateDifferences,values:{prev:y.state,next:h.state},options:p}),u.ownerDifferences.hookDifferences&&u.ownerDifferences.hookDifferences.forEach((function(e,r){var t=e.hookName,n=e.differences;return M({Component:h.Component,displayName:h.displayName,prefixMessage:v,diffObjType:"hook",differences:n,values:{prev:y.hooks[r].result,next:h.hooks[r].result},hookName:t,options:p})})),p.consoleGroupEnd()}u.propsDifferences||u.stateDifferences||u.hookDifferences||p.consoleLog(d({},t,r),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat("http://bit.ly/wdyr02")),p.consoleGroupEnd()}}function F(e){return e&&"undefined"!=typeof module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler((function(r){"idle"===r&&(A=!0,setTimeout((function(){A=!1}),e))})),W}var U=function(){};function G(e){return e.displayName||e.name||e.type&&G(e.type)||e.render&&G(e.render)||(r(e)?e:void 0)}var V="undefined"!=typeof Element,B="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,$=function(e){return e.$$typeof===B};function q(e,r,t,n,o){return t.push({diffType:o,pathString:n,prevValue:e,nextValue:r}),o!==S}function z(e,r,t){try{var p=[];return function e(r,t,p){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(r===t)return!0;if(!r||!t)return q(r,t,p,l,S);if(u(r)&&u(t)){var d=r.length;if(d!==t.length)return q(O(r),O(t),p,l,S);for(var m=[],h=0,v=d;v--;v>0){var b=e(r[v],t[v],m,"".concat(l,"[").concat(v,"]"));b&&h++}return h===d?q(O(r),O(t),p,l,j):(p.push.apply(p,m),q(O(r),O(t),p,l,S))}if(a(r)&&a(t)){if(r.size!==t.size)return q(new Set(r),new Set(t),p,l,S);var g,D=E(r);try{for(D.s();!(g=D.n()).done;){var w=g.value;if(!t.has(w))return q(new Set(r),new Set(t),p,l,S)}}catch(e){D.e(e)}finally{D.f()}return q(new Set(r),new Set(t),p,l,j)}if(s(r)&&s(t))return r.getTime()===t.getTime()?q(new Date(r),new Date(t),p,l,x):q(new Date(r),new Date(t),p,l,S);if(c(r)&&c(t))return r.toString()===t.toString()?q(r,t,p,l,C):q(r,t,p,l,S);if(V&&r instanceof Element&&t instanceof Element)return q(r,t,p,l,S);if($(r)&&$(t)){if(r.type!==t.type)return q(r,t,p,l,S);var _=e(r.props,t.props,[],"".concat(l,".props"));return q(r,t,p,l,_?T:S)}if(i(r)&&i(t))return r.name===t.name?q(r,t,p,l,P):q(r,t,p,l,S);if(f(r)&&f(t)){var R=o(r),k=R.length;if(k!==o(t).length)return q(y({},r),y({},t),p,l,S);for(var N=k;N--;N>0)if(!n(t,R[N]))return q(y({},r),y({},t),p,l,S);for(var Y=[],H=0,I=k;I--;I>0){var L=R[I],A=e(r[L],t[L],Y,"".concat(l,".").concat(L));A&&H++}return H===k?q(y({},r),y({},t),p,l,j):(p.push.apply(p,Y),q(y({},r),y({},t),p,l,S))}return q(r,t,p,l,S)}(e,r,p,t),p}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var J={};function K(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.shallow,a=void 0===o||o;if(e===r)return!1;if(!a)return z(e,r);var i=e||J,c=r||J,s=Object.keys(y(y({},i),c));return t(s,(function(e,r){var t=z(i[r],c[r],r);return t&&(e=[].concat(O(e),O(t))),e}),[])}function Q(e){var r=e.prevOwnerData,t=e.nextOwnerData;if(!r||!t)return!1;var n=r.hooks.map((function(e,r){return{hookName:e.hookName,differences:K(e.result,t.hooks[r].result,{shallow:!1})}}));return{propsDifferences:K(r.props,t.props),stateDifferences:K(r.state,t.state),hookDifferences:n.length>0&&n}}function X(e,r,t,n,o,a,i){var c=i.get(e),s=i.get(n);return{propsDifferences:K(e,n),stateDifferences:K(r,o),hookDifferences:K(t,a,{shallow:!1}),ownerDifferences:Q({prevOwnerData:c,nextOwnerData:s})}}function Z(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,c=e.nextProps,s=e.nextState,f=e.nextHook,u=e.options,p=e.ownerDataMap;return{Component:r,displayName:t,hookName:n,prevProps:o,prevState:a,prevHook:i,nextProps:c,nextState:s,nextHook:f,options:u,ownerDataMap:p,reason:X(o,a,i,c,s,f,p)}}function ee(e){return e.prototype&&!!e.prototype.isReactComponent}function re(e){return e.$$typeof===H}function te(e){return e.$$typeof===I}function ne(e){var r=e.Component,t=e.displayName,n=e.options,o=e.React,a=e.isHookChange;return!function(e,r){return r.exclude&&r.exclude.length>0&&r.exclude.some((function(r){return r.test(e)}))}(t,n)&&(!1!==r.whyDidYouRender&&((!a||!r.whyDidYouRender||!1!==r.whyDidYouRender.trackHooks)&&!!(r.whyDidYouRender||n.trackAllPureComponents&&(r&&r.prototype instanceof o.PureComponent||re(r))||function(e,r){return r.include&&r.include.length>0&&r.include.some((function(r){return r.test(e)}))}(t,n))))}function oe(e,r,t,n,o){var a=function(t){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&v(e,r)}(f,t);var a,i,c,s=D(f);function f(r,t){var n,o;!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,f),(o=s.call(this,r,t))._WDYR={renderNumber:0};var a=w((n=b(o),h(f.prototype)),"render",n)||o.render;return a!==e.prototype.render&&(o.render=function(){return f.prototype.render.apply(b(o)),a()}),o}return a=f,(i=[{key:"render",value:function(){if(this._WDYR.renderNumber++,"isStrictMode"in this._WDYR||(this._WDYR.isStrictMode=function(e){for(var r=e&&e._reactInternalFiber;r;){if(1&r.mode)return!0;r=r.return}return!1}(this)),!this._WDYR.isStrictMode||this._WDYR.renderNumber%2!=1){if(this._WDYR.prevProps){var t=Z({Component:e,displayName:r,prevProps:this._WDYR.prevProps,prevState:this._WDYR.prevState,nextProps:this.props,nextState:this.state,options:n,ownerDataMap:o});n.notifier(t)}this._WDYR.prevProps=this.props,this._WDYR.prevState=this.state}return w(h(f.prototype),"render",this)?w(h(f.prototype),"render",this).call(this):null}}])&&l(a.prototype,i),c&&l(a,c),f}(e);try{a.displayName=r}catch(e){}return p(a,e),a}function ae(e,r,t,n,o,a){var i="string"==typeof e?function(e,r){return function(t){return r.createElement(e,t)}}(e,n):e;function c(){var e=arguments[0],c=n.useRef(),s=c.current;if(c.current=e,s){var f=Z({Component:i,displayName:t,prevProps:s,nextProps:e,options:o,ownerDataMap:a}),u=!f.reason.propsDifferences||r&&0===f.reason.propsDifferences.length;u||o.notifier(f)}return i.apply(void 0,arguments)}try{c.displayName=t}catch(e){}return c.ComponentForHooksTracking=i,p(c,i),c}var ie=Symbol("initial-hook-value");function ce(r,t,n,o,a,i,c){var s=t.path,f=s?e(n,s):n,u=o.useRef(1);null!=c.current[0]&&u.current!==c.current[0].renderNumber&&(c.current=[]),c.current.push({hookName:r,result:f,renderNumber:u.current}),u.current++;var p=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current,l=o.useRef(ie);if(!p)return n;var d=p.type.ComponentForHooksTracking||p.type,m=G(d);if(!ne({Component:d,displayName:m,options:a,React:o,isHookChange:!0}))return n;var y=l.current;if(l.current=n,y!==ie){var h=Z({Component:d,displayName:m,hookName:r,prevHook:s?e(y,s):y,nextHook:f,options:a,ownerDataMap:i});h.reason.hookDifferences&&a.notifier(h)}return n}function se(e,r,t,n,o,a){return re(r)?function e(r,t,n,o,a){var i=r.type,c=ee(i),s=te(i),f=re(i),u=s?i.render:i,l=c?oe(u,t,0,o,a):f?e(u,t,n,o,a):ae(u,!0,t,n,o,a);try{l.displayName=G(u)}catch(e){}l.ComponentForHooksTracking=r,p(l,u);var d=n.memo(s?n.forwardRef(l):l,r.compare);try{d.displayName=t}catch(e){}return p(d,r),d}(r,t,n,o,a):te(r)?function(e,r,t,n,o){var a=e.render,i=re(a),c=i?a.type:a,s=ae(c,i,r,t,n,o);s.displayName=G(c),s.ComponentForHooksTracking=c,p(s,c);var f=t.forwardRef(i?t.memo(s,a.compare):s);try{f.displayName=r}catch(e){}return p(f,e),f}(r,t,n,o,a):ee(r)?oe(r,t,0,o,a):ae(r,!1,t,n,o,a)}function fe(e,r,t,n,o,a){if(e.has(r))return e.get(r);var i=se(0,r,t,n,o,a);return e.set(r,i),i}function ue(e){return!!e&&(re(e)?ue(e.type):te(e)?ue(e.render):"function"==typeof e||void 0)}var pe={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};function le(e,r){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=console.group,t=console.groupEnd;e.collapseGroups?r=console.groupCollapsed:e.onlyLogs&&(r=console.log,t=U);var n=e.notifier||F("hotReloadBufferMs"in e?e.hotReloadBufferMs:500);return y({include:null,exclude:null,notifier:n,onlyLogs:!1,consoleLog:console.log,consoleGroup:r,consoleGroupEnd:t,logOnDifferentValues:!1,logOwnerReasons:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red",trackExtraHooks:[],trackAllPureComponents:!1},e)}(r),n=e.createElement,o=e.createFactory,a=e.cloneElement,i=new WeakMap,c=new WeakMap,s={current:[]};function f(r){var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current;if(t){var n=t.type.ComponentForHooksTracking||t.type,o=G(n);c.set(r.props,{Component:n,displayName:o,props:t.pendingProps,state:null!=t.stateNode?t.stateNode.state:null,hooks:s.current})}}var u=null;if(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&Object.defineProperty(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,"current",{get:function(){return u},set:function(e){u=e,s.current=[]}}),e.createElement=function(r){for(var o=null,a=null,s=null,u=arguments.length,p=new Array(u>1?u-1:0),l=1;l (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ 'use strict'; diff --git a/dist/no-classes-transpile/cjs/whyDidYouRender.min.js b/dist/no-classes-transpile/cjs/whyDidYouRender.min.js index 2e45d01..5d7b5e3 100644 --- a/dist/no-classes-transpile/cjs/whyDidYouRender.min.js +++ b/dist/no-classes-transpile/cjs/whyDidYouRender.min.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 4.3.0 + * @welldone-software/why-did-you-render 4.3.1 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var r=e(require("lodash/get")),t=e(require("lodash/isString")),n=e(require("lodash/reduce")),o=e(require("lodash/has")),a=e(require("lodash/keys")),i=e(require("lodash/isSet")),s=e(require("lodash/isFunction")),c=e(require("lodash/isRegExp")),u=e(require("lodash/isDate")),f=e(require("lodash/isPlainObject")),p=e(require("lodash/isArray")),l=e(require("lodash/defaults"));function d(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function y(e){for(var r=1;re.length)&&(r=e.length);for(var t=0,n=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(s)throw a}}}}var w,_="different",k="deepEquals",O="date",R="regex",E="reactElement",N="function",S="function"==typeof Symbol&&Symbol.for,x=S?Symbol.for("react.memo"):60115,C=S?Symbol.for("react.forward_ref"):60112,j=(d(w={},_,"different objects."),d(w,k,"different objects that are equal by value."),d(w,O,"different date objects with the same value."),d(w,R,"different regular expressions with the same value."),d(w,E,"different React elements (remember that the syntax always produces a *NEW* immutable React element so a component that receives as props always re-renders.)."),d(w,N,"different functions with the same name."),w),T=!1;function P(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prefixMessage,a=e.diffObjType,i=e.differences,s=e.values,c=e.options;i&&i.length>0?(c.consoleLog(d({},t,r),"".concat(o," of ").concat(a," changes:")),i.forEach((function(e){var r=e.pathString,t=e.diffType,o=e.prevValue,i=e.nextValue;c.consoleGroup("%c".concat("hook"===a?"[hook ".concat(n," result]"):"".concat(a,"."),"%c").concat(r,"%c"),"color:".concat(c.diffNameColor,";"),"color:".concat(c.diffPathColor,";"),"color:default;"),c.consoleLog("".concat(j[t]," (more info at ").concat(n?"http://bit.ly/wdyr3":"http://bit.ly/wdyr02",")")),c.consoleLog(d({},"prev ".concat(r),o),"!==",d({},"next ".concat(r),i)),c.consoleGroupEnd()}))):i&&(c.consoleLog(d({},t,r),"".concat(o," the ").concat(a," object itself changed but its values are all equal."),"props"===a?"This could have been avoided by making the component pure, or by preventing its father from re-rendering.":"This usually means this component called setState when no changes in its state actually occurred.","More info at ".concat("http://bit.ly/wdyr02")),c.consoleLog("prev ".concat(a,":"),s.prev," !== ",s.next,":next ".concat(a)))}function Y(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,s=e.nextProps,c=e.nextState,u=e.nextHook,f=e.reason,p=e.options,l=e.ownerDataMap;if(function(e,r,t){return!T&&(!!t.logOnDifferentValues||(!(!r.whyDidYouRender||!r.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some((function(e){return e.diffType===_}))||e.stateDifferences&&e.stateDifferences.some((function(e){return e.diffType===_}))||e.hookDifferences&&e.hookDifferences.some((function(e){return e.diffType===_})))))}(f,r,p)){p.consoleGroup("%c".concat(t),"color: ".concat(p.titleColor,";"));var m="Re-rendered because";if(f.propsDifferences&&(P({Component:r,displayName:t,prefixMessage:m,diffObjType:"props",differences:f.propsDifferences,values:{prev:o,next:s},options:p}),m="And because"),f.stateDifferences&&P({Component:r,displayName:t,prefixMessage:m,diffObjType:"state",differences:f.stateDifferences,values:{prev:a,next:c},options:p}),f.hookDifferences&&P({Component:r,displayName:t,prefixMessage:m,diffObjType:"hook",differences:f.hookDifferences,values:{prev:i,next:u},hookName:n,options:p}),f.propsDifferences&&f.ownerDifferences){var y=l.get(o),h=l.get(s);p.consoleGroup("Rendered by ".concat(h.displayName));var v="Re-rendered because";f.ownerDifferences.propsDifferences&&(P({Component:h.Component,displayName:h.displayName,prefixMessage:v,diffObjType:"props",differences:f.ownerDifferences.propsDifferences,values:{prev:y.props,next:h.props},options:p}),v="And because"),f.ownerDifferences.stateDifferences&&P({Component:h.Component,displayName:h.displayName,prefixMessage:v,diffObjType:"state",differences:f.ownerDifferences.stateDifferences,values:{prev:y.state,next:h.state},options:p}),f.ownerDifferences.hookDifferences&&f.ownerDifferences.hookDifferences.forEach((function(e,r){var t=e.hookName,n=e.differences;return P({Component:h.Component,displayName:h.displayName,prefixMessage:v,diffObjType:"hook",differences:n,values:{prev:y.hooks[r].result,next:h.hooks[r].result},hookName:t,options:p})})),p.consoleGroupEnd()}f.propsDifferences||f.stateDifferences||f.hookDifferences||p.consoleLog(d({},t,r),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat("http://bit.ly/wdyr02")),p.consoleGroupEnd()}}function H(e){return e&&"undefined"!=typeof module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler((function(r){"idle"===r&&(T=!0,setTimeout((function(){T=!1}),e))})),Y}var I=function(){};function L(e){return e.displayName||e.name||e.type&&L(e.type)||e.render&&L(e.render)||(t(e)?e:void 0)}var A="undefined"!=typeof Element,M="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,W=function(e){return e.$$typeof===M};function F(e,r,t,n,o){return t.push({diffType:o,pathString:n,prevValue:e,nextValue:r}),o!==_}function q(e,r,t){try{var n=[];return function e(r,t,n){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(r===t)return!0;if(!r||!t)return F(r,t,n,l,_);if(p(r)&&p(t)){var d=r.length;if(d!==t.length)return F(v(r),v(t),n,l,_);for(var m=[],h=0,b=d;b--;b>0){var g=e(r[b],t[b],m,"".concat(l,"[").concat(b,"]"));g&&h++}return h===d?F(v(r),v(t),n,l,k):(n.push.apply(n,m),F(v(r),v(t),n,l,_))}if(i(r)&&i(t)){if(r.size!==t.size)return F(new Set(r),new Set(t),n,l,_);var w,S=D(r);try{for(S.s();!(w=S.n()).done;){var x=w.value;if(!t.has(x))return F(new Set(r),new Set(t),n,l,_)}}catch(e){S.e(e)}finally{S.f()}return F(new Set(r),new Set(t),n,l,k)}if(u(r)&&u(t))return r.getTime()===t.getTime()?F(new Date(r),new Date(t),n,l,O):F(new Date(r),new Date(t),n,l,_);if(c(r)&&c(t))return r.toString()===t.toString()?F(r,t,n,l,R):F(r,t,n,l,_);if(A&&r instanceof Element&&t instanceof Element)return F(r,t,n,l,_);if(W(r)&&W(t)){if(r.type!==t.type)return F(r,t,n,l,_);var C=e(r.props,t.props,[],"".concat(l,".props"));return F(r,t,n,l,C?E:_)}if(s(r)&&s(t))return r.name===t.name?F(r,t,n,l,N):F(r,t,n,l,_);if(f(r)&&f(t)){var j=a(r),T=j.length;if(T!==a(t).length)return F(y({},r),y({},t),n,l,_);for(var P=T;P--;P>0)if(!o(t,j[P]))return F(y({},r),y({},t),n,l,_);for(var Y=[],H=0,I=T;I--;I>0){var L=j[I],M=e(r[L],t[L],Y,"".concat(l,".").concat(L));M&&H++}return H===T?F(y({},r),y({},t),n,l,k):(n.push.apply(n,Y),F(y({},r),y({},t),n,l,_))}return F(r,t,n,l,_)}(e,r,n,t),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var U={};function G(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.shallow,a=void 0===o||o;if(e===r)return!1;if(!a)return q(e,r);var i=e||U,s=r||U,c=Object.keys(y(y({},i),s));return n(c,(function(e,r){var t=q(i[r],s[r],r);return t&&(e=[].concat(v(e),v(t))),e}),[])}function V(e){var r=e.prevOwnerData,t=e.nextOwnerData;if(!r||!t)return!1;var n=r.hooks.map((function(e,r){return{hookName:e.hookName,differences:G(e.result,t.hooks[r].result,{shallow:!1})}}));return{propsDifferences:G(r.props,t.props),stateDifferences:G(r.state,t.state),hookDifferences:n.length>0&&n}}function B(e,r,t,n,o,a,i){var s=i.get(e),c=i.get(n);return{propsDifferences:G(e,n),stateDifferences:G(r,o),hookDifferences:G(t,a,{shallow:!1}),ownerDifferences:V({prevOwnerData:s,nextOwnerData:c})}}function $(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,s=e.nextProps,c=e.nextState,u=e.nextHook,f=e.options,p=e.ownerDataMap;return{Component:r,displayName:t,hookName:n,prevProps:o,prevState:a,prevHook:i,nextProps:s,nextState:c,nextHook:u,options:f,ownerDataMap:p,reason:B(o,a,i,s,c,u,p)}}function z(e){return e.prototype&&!!e.prototype.isReactComponent}function J(e){return e.$$typeof===x}function K(e){return e.$$typeof===C}function Q(e){var r=e.Component,t=e.displayName,n=e.options,o=e.React,a=e.isHookChange;return!function(e,r){return r.exclude&&r.exclude.length>0&&r.exclude.some((function(r){return r.test(e)}))}(t,n)&&(!1!==r.whyDidYouRender&&((!a||!r.whyDidYouRender||!1!==r.whyDidYouRender.trackHooks)&&!!(r.whyDidYouRender||n.trackAllPureComponents&&(r&&r.prototype instanceof o.PureComponent||J(r))||function(e,r){return r.include&&r.include.length>0&&r.include.some((function(r){return r.test(e)}))}(t,n))))}function X(e,r,t,n,o){class a extends e{constructor(r,t){var n;super(r,t),n=this,this._WDYR={renderNumber:0};var o=super.render||this.render;o!==e.prototype.render&&(this.render=function(){return a.prototype.render.apply(n),o()})}render(){if(this._WDYR.renderNumber++,"isStrictMode"in this._WDYR||(this._WDYR.isStrictMode=function(e){for(var r=e&&e._reactInternalFiber;r;){if(1&r.mode)return!0;r=r.return}return!1}(this)),!this._WDYR.isStrictMode||this._WDYR.renderNumber%2!=1){if(this._WDYR.prevProps){var t=$({Component:e,displayName:r,prevProps:this._WDYR.prevProps,prevState:this._WDYR.prevState,nextProps:this.props,nextState:this.state,options:n,ownerDataMap:o});n.notifier(t)}this._WDYR.prevProps=this.props,this._WDYR.prevState=this.state}return super.render?super.render():null}}try{a.displayName=r}catch(e){}return l(a,e),a}function Z(e,r,t,n,o,a){var i="string"==typeof e?function(e,r){return function(t){return r.createElement(e,t)}}(e,n):e;function s(){var e=arguments[0],s=n.useRef(),c=s.current;if(s.current=e,c){var u=$({Component:i,displayName:t,prevProps:c,nextProps:e,options:o,ownerDataMap:a}),f=!u.reason.propsDifferences||r&&0===u.reason.propsDifferences.length;f||o.notifier(u)}return i.apply(void 0,arguments)}try{s.displayName=t}catch(e){}return s.ComponentForHooksTracking=i,l(s,i),s}var ee=Symbol("initial-hook-value");function re(e,t,n,o,a,i,s){var c=t.path,u=c?r(n,c):n,f=o.useRef(1);null!=s.current[0]&&f.current!==s.current[0].renderNumber&&(s.current=[]),s.current.push({hookName:e,result:u,renderNumber:f.current}),f.current++;var p=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current,l=o.useRef(ee);if(!p)return n;var d=p.type.ComponentForHooksTracking||p.type,m=L(d);if(!Q({Component:d,displayName:m,options:a,React:o,isHookChange:!0}))return n;var y=l.current;if(l.current=n,y!==ee){var h=$({Component:d,displayName:m,hookName:e,prevHook:c?r(y,c):y,nextHook:u,options:a,ownerDataMap:i});h.reason.hookDifferences&&a.notifier(h)}return n}function te(e,r,t,n,o,a){return J(r)?function e(r,t,n,o,a){var i=r.type,s=z(i),c=K(i),u=J(i),f=c?i.render:i,p=s?X(f,t,0,o,a):u?e(f,t,n,o,a):Z(f,!0,t,n,o,a);try{p.displayName=L(f)}catch(e){}p.ComponentForHooksTracking=r,l(p,f);var d=n.memo(c?n.forwardRef(p):p,r.compare);try{d.displayName=t}catch(e){}return l(d,r),d}(r,t,n,o,a):K(r)?function(e,r,t,n,o){var a=e.render,i=J(a),s=i?a.type:a,c=Z(s,i,r,t,n,o);c.displayName=L(s),c.ComponentForHooksTracking=s,l(c,s);var u=t.forwardRef(i?t.memo(c,a.compare):c);try{u.displayName=r}catch(e){}return l(u,e),u}(r,t,n,o,a):z(r)?X(r,t,0,o,a):Z(r,!1,t,n,o,a)}function ne(e,r,t,n,o,a){if(e.has(r))return e.get(r);var i=te(0,r,t,n,o,a);return e.set(r,i),i}function oe(e){return!!e&&(J(e)?oe(e.type):K(e)?oe(e.render):"function"==typeof e||void 0)}var ae={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};function ie(e,r){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=console.group,t=console.groupEnd;e.collapseGroups?r=console.groupCollapsed:e.onlyLogs&&(r=console.log,t=I);var n=e.notifier||H("hotReloadBufferMs"in e?e.hotReloadBufferMs:500);return y({include:null,exclude:null,notifier:n,onlyLogs:!1,consoleLog:console.log,consoleGroup:r,consoleGroupEnd:t,logOnDifferentValues:!1,logOwnerReasons:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red",trackExtraHooks:[],trackAllPureComponents:!1},e)}(r),n=e.createElement,o=e.createFactory,a=e.cloneElement,i=new WeakMap,s=new WeakMap,c={current:[]};function u(r){var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current;if(t){var n=t.type.ComponentForHooksTracking||t.type,o=L(n);s.set(r.props,{Component:n,displayName:o,props:t.pendingProps,state:null!=t.stateNode?t.stateNode.state:null,hooks:c.current})}}var f=null;if(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&Object.defineProperty(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,"current",{get:function(){return f},set:function(e){f=e,c.current=[]}}),e.createElement=function(r){for(var o=null,a=null,c=null,f=arguments.length,p=new Array(f>1?f-1:0),l=1;l (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ import _get from 'lodash/get'; diff --git a/dist/no-classes-transpile/esm/whyDidYouRender.min.js b/dist/no-classes-transpile/esm/whyDidYouRender.min.js index df668d7..5e9008a 100644 --- a/dist/no-classes-transpile/esm/whyDidYouRender.min.js +++ b/dist/no-classes-transpile/esm/whyDidYouRender.min.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 4.3.0 + * @welldone-software/why-did-you-render 4.3.1 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ import e from"lodash/get";import r from"lodash/isString";import t from"lodash/reduce";import n from"lodash/has";import o from"lodash/keys";import a from"lodash/isSet";import i from"lodash/isFunction";import s from"lodash/isRegExp";import c from"lodash/isDate";import f from"lodash/isPlainObject";import u from"lodash/isArray";import p from"lodash/defaults";function l(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function m(e){for(var r=1;re.length)&&(r=e.length);for(var t=0,n=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(s)throw a}}}}var D,w="different",_="deepEquals",k="date",O="regex",R="reactElement",E="function",N="function"==typeof Symbol&&Symbol.for,S=N?Symbol.for("react.memo"):60115,x=N?Symbol.for("react.forward_ref"):60112,C=(l(D={},w,"different objects."),l(D,_,"different objects that are equal by value."),l(D,k,"different date objects with the same value."),l(D,O,"different regular expressions with the same value."),l(D,R,"different React elements (remember that the syntax always produces a *NEW* immutable React element so a component that receives as props always re-renders.)."),l(D,E,"different functions with the same name."),D),j=!1;function T(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prefixMessage,a=e.diffObjType,i=e.differences,s=e.values,c=e.options;i&&i.length>0?(c.consoleLog(l({},t,r),"".concat(o," of ").concat(a," changes:")),i.forEach((function(e){var r=e.pathString,t=e.diffType,o=e.prevValue,i=e.nextValue;c.consoleGroup("%c".concat("hook"===a?"[hook ".concat(n," result]"):"".concat(a,"."),"%c").concat(r,"%c"),"color:".concat(c.diffNameColor,";"),"color:".concat(c.diffPathColor,";"),"color:default;"),c.consoleLog("".concat(C[t]," (more info at ").concat(n?"http://bit.ly/wdyr3":"http://bit.ly/wdyr02",")")),c.consoleLog(l({},"prev ".concat(r),o),"!==",l({},"next ".concat(r),i)),c.consoleGroupEnd()}))):i&&(c.consoleLog(l({},t,r),"".concat(o," the ").concat(a," object itself changed but its values are all equal."),"props"===a?"This could have been avoided by making the component pure, or by preventing its father from re-rendering.":"This usually means this component called setState when no changes in its state actually occurred.","More info at ".concat("http://bit.ly/wdyr02")),c.consoleLog("prev ".concat(a,":"),s.prev," !== ",s.next,":next ".concat(a)))}function P(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,s=e.nextProps,c=e.nextState,f=e.nextHook,u=e.reason,p=e.options,d=e.ownerDataMap;if(function(e,r,t){return!j&&(!!t.logOnDifferentValues||(!(!r.whyDidYouRender||!r.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some((function(e){return e.diffType===w}))||e.stateDifferences&&e.stateDifferences.some((function(e){return e.diffType===w}))||e.hookDifferences&&e.hookDifferences.some((function(e){return e.diffType===w})))))}(u,r,p)){p.consoleGroup("%c".concat(t),"color: ".concat(p.titleColor,";"));var m="Re-rendered because";if(u.propsDifferences&&(T({Component:r,displayName:t,prefixMessage:m,diffObjType:"props",differences:u.propsDifferences,values:{prev:o,next:s},options:p}),m="And because"),u.stateDifferences&&T({Component:r,displayName:t,prefixMessage:m,diffObjType:"state",differences:u.stateDifferences,values:{prev:a,next:c},options:p}),u.hookDifferences&&T({Component:r,displayName:t,prefixMessage:m,diffObjType:"hook",differences:u.hookDifferences,values:{prev:i,next:f},hookName:n,options:p}),u.propsDifferences&&u.ownerDifferences){var y=d.get(o),h=d.get(s);p.consoleGroup("Rendered by ".concat(h.displayName));var v="Re-rendered because";u.ownerDifferences.propsDifferences&&(T({Component:h.Component,displayName:h.displayName,prefixMessage:v,diffObjType:"props",differences:u.ownerDifferences.propsDifferences,values:{prev:y.props,next:h.props},options:p}),v="And because"),u.ownerDifferences.stateDifferences&&T({Component:h.Component,displayName:h.displayName,prefixMessage:v,diffObjType:"state",differences:u.ownerDifferences.stateDifferences,values:{prev:y.state,next:h.state},options:p}),u.ownerDifferences.hookDifferences&&u.ownerDifferences.hookDifferences.forEach((function(e,r){var t=e.hookName,n=e.differences;return T({Component:h.Component,displayName:h.displayName,prefixMessage:v,diffObjType:"hook",differences:n,values:{prev:y.hooks[r].result,next:h.hooks[r].result},hookName:t,options:p})})),p.consoleGroupEnd()}u.propsDifferences||u.stateDifferences||u.hookDifferences||p.consoleLog(l({},t,r),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat("http://bit.ly/wdyr02")),p.consoleGroupEnd()}}function Y(e){return e&&"undefined"!=typeof module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler((function(r){"idle"===r&&(j=!0,setTimeout((function(){j=!1}),e))})),P}var H=function(){};function I(e){return e.displayName||e.name||e.type&&I(e.type)||e.render&&I(e.render)||(r(e)?e:void 0)}var L="undefined"!=typeof Element,A="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,M=function(e){return e.$$typeof===A};function W(e,r,t,n,o){return t.push({diffType:o,pathString:n,prevValue:e,nextValue:r}),o!==w}function F(e,r,t){try{var p=[];return function e(r,t,p){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(r===t)return!0;if(!r||!t)return W(r,t,p,l,w);if(u(r)&&u(t)){var d=r.length;if(d!==t.length)return W(h(r),h(t),p,l,w);for(var y=[],v=0,g=d;g--;g>0){var D=e(r[g],t[g],y,"".concat(l,"[").concat(g,"]"));D&&v++}return v===d?W(h(r),h(t),p,l,_):(p.push.apply(p,y),W(h(r),h(t),p,l,w))}if(a(r)&&a(t)){if(r.size!==t.size)return W(new Set(r),new Set(t),p,l,w);var N,S=b(r);try{for(S.s();!(N=S.n()).done;){var x=N.value;if(!t.has(x))return W(new Set(r),new Set(t),p,l,w)}}catch(e){S.e(e)}finally{S.f()}return W(new Set(r),new Set(t),p,l,_)}if(c(r)&&c(t))return r.getTime()===t.getTime()?W(new Date(r),new Date(t),p,l,k):W(new Date(r),new Date(t),p,l,w);if(s(r)&&s(t))return r.toString()===t.toString()?W(r,t,p,l,O):W(r,t,p,l,w);if(L&&r instanceof Element&&t instanceof Element)return W(r,t,p,l,w);if(M(r)&&M(t)){if(r.type!==t.type)return W(r,t,p,l,w);var C=e(r.props,t.props,[],"".concat(l,".props"));return W(r,t,p,l,C?R:w)}if(i(r)&&i(t))return r.name===t.name?W(r,t,p,l,E):W(r,t,p,l,w);if(f(r)&&f(t)){var j=o(r),T=j.length;if(T!==o(t).length)return W(m({},r),m({},t),p,l,w);for(var P=T;P--;P>0)if(!n(t,j[P]))return W(m({},r),m({},t),p,l,w);for(var Y=[],H=0,I=T;I--;I>0){var A=j[I],F=e(r[A],t[A],Y,"".concat(l,".").concat(A));F&&H++}return H===T?W(m({},r),m({},t),p,l,_):(p.push.apply(p,Y),W(m({},r),m({},t),p,l,w))}return W(r,t,p,l,w)}(e,r,p,t),p}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var U={};function G(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.shallow,a=void 0===o||o;if(e===r)return!1;if(!a)return F(e,r);var i=e||U,s=r||U,c=Object.keys(m(m({},i),s));return t(c,(function(e,r){var t=F(i[r],s[r],r);return t&&(e=[].concat(h(e),h(t))),e}),[])}function V(e){var r=e.prevOwnerData,t=e.nextOwnerData;if(!r||!t)return!1;var n=r.hooks.map((function(e,r){return{hookName:e.hookName,differences:G(e.result,t.hooks[r].result,{shallow:!1})}}));return{propsDifferences:G(r.props,t.props),stateDifferences:G(r.state,t.state),hookDifferences:n.length>0&&n}}function B(e,r,t,n,o,a,i){var s=i.get(e),c=i.get(n);return{propsDifferences:G(e,n),stateDifferences:G(r,o),hookDifferences:G(t,a,{shallow:!1}),ownerDifferences:V({prevOwnerData:s,nextOwnerData:c})}}function $(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,s=e.nextProps,c=e.nextState,f=e.nextHook,u=e.options,p=e.ownerDataMap;return{Component:r,displayName:t,hookName:n,prevProps:o,prevState:a,prevHook:i,nextProps:s,nextState:c,nextHook:f,options:u,ownerDataMap:p,reason:B(o,a,i,s,c,f,p)}}function q(e){return e.prototype&&!!e.prototype.isReactComponent}function z(e){return e.$$typeof===S}function J(e){return e.$$typeof===x}function K(e){var r=e.Component,t=e.displayName,n=e.options,o=e.React,a=e.isHookChange;return!function(e,r){return r.exclude&&r.exclude.length>0&&r.exclude.some((function(r){return r.test(e)}))}(t,n)&&(!1!==r.whyDidYouRender&&((!a||!r.whyDidYouRender||!1!==r.whyDidYouRender.trackHooks)&&!!(r.whyDidYouRender||n.trackAllPureComponents&&(r&&r.prototype instanceof o.PureComponent||z(r))||function(e,r){return r.include&&r.include.length>0&&r.include.some((function(r){return r.test(e)}))}(t,n))))}function Q(e,r,t,n,o){class a extends e{constructor(r,t){var n;super(r,t),n=this,this._WDYR={renderNumber:0};var o=super.render||this.render;o!==e.prototype.render&&(this.render=function(){return a.prototype.render.apply(n),o()})}render(){if(this._WDYR.renderNumber++,"isStrictMode"in this._WDYR||(this._WDYR.isStrictMode=function(e){for(var r=e&&e._reactInternalFiber;r;){if(1&r.mode)return!0;r=r.return}return!1}(this)),!this._WDYR.isStrictMode||this._WDYR.renderNumber%2!=1){if(this._WDYR.prevProps){var t=$({Component:e,displayName:r,prevProps:this._WDYR.prevProps,prevState:this._WDYR.prevState,nextProps:this.props,nextState:this.state,options:n,ownerDataMap:o});n.notifier(t)}this._WDYR.prevProps=this.props,this._WDYR.prevState=this.state}return super.render?super.render():null}}try{a.displayName=r}catch(e){}return p(a,e),a}function X(e,r,t,n,o,a){var i="string"==typeof e?function(e,r){return function(t){return r.createElement(e,t)}}(e,n):e;function s(){var e=arguments[0],s=n.useRef(),c=s.current;if(s.current=e,c){var f=$({Component:i,displayName:t,prevProps:c,nextProps:e,options:o,ownerDataMap:a}),u=!f.reason.propsDifferences||r&&0===f.reason.propsDifferences.length;u||o.notifier(f)}return i.apply(void 0,arguments)}try{s.displayName=t}catch(e){}return s.ComponentForHooksTracking=i,p(s,i),s}var Z=Symbol("initial-hook-value");function ee(r,t,n,o,a,i,s){var c=t.path,f=c?e(n,c):n,u=o.useRef(1);null!=s.current[0]&&u.current!==s.current[0].renderNumber&&(s.current=[]),s.current.push({hookName:r,result:f,renderNumber:u.current}),u.current++;var p=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current,l=o.useRef(Z);if(!p)return n;var d=p.type.ComponentForHooksTracking||p.type,m=I(d);if(!K({Component:d,displayName:m,options:a,React:o,isHookChange:!0}))return n;var y=l.current;if(l.current=n,y!==Z){var h=$({Component:d,displayName:m,hookName:r,prevHook:c?e(y,c):y,nextHook:f,options:a,ownerDataMap:i});h.reason.hookDifferences&&a.notifier(h)}return n}function re(e,r,t,n,o,a){return z(r)?function e(r,t,n,o,a){var i=r.type,s=q(i),c=J(i),f=z(i),u=c?i.render:i,l=s?Q(u,t,0,o,a):f?e(u,t,n,o,a):X(u,!0,t,n,o,a);try{l.displayName=I(u)}catch(e){}l.ComponentForHooksTracking=r,p(l,u);var d=n.memo(c?n.forwardRef(l):l,r.compare);try{d.displayName=t}catch(e){}return p(d,r),d}(r,t,n,o,a):J(r)?function(e,r,t,n,o){var a=e.render,i=z(a),s=i?a.type:a,c=X(s,i,r,t,n,o);c.displayName=I(s),c.ComponentForHooksTracking=s,p(c,s);var f=t.forwardRef(i?t.memo(c,a.compare):c);try{f.displayName=r}catch(e){}return p(f,e),f}(r,t,n,o,a):q(r)?Q(r,t,0,o,a):X(r,!1,t,n,o,a)}function te(e,r,t,n,o,a){if(e.has(r))return e.get(r);var i=re(0,r,t,n,o,a);return e.set(r,i),i}function ne(e){return!!e&&(z(e)?ne(e.type):J(e)?ne(e.render):"function"==typeof e||void 0)}var oe={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};function ae(e,r){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=console.group,t=console.groupEnd;e.collapseGroups?r=console.groupCollapsed:e.onlyLogs&&(r=console.log,t=H);var n=e.notifier||Y("hotReloadBufferMs"in e?e.hotReloadBufferMs:500);return m({include:null,exclude:null,notifier:n,onlyLogs:!1,consoleLog:console.log,consoleGroup:r,consoleGroupEnd:t,logOnDifferentValues:!1,logOwnerReasons:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red",trackExtraHooks:[],trackAllPureComponents:!1},e)}(r),n=e.createElement,o=e.createFactory,a=e.cloneElement,i=new WeakMap,s=new WeakMap,c={current:[]};function f(r){var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current;if(t){var n=t.type.ComponentForHooksTracking||t.type,o=I(n);s.set(r.props,{Component:n,displayName:o,props:t.pendingProps,state:null!=t.stateNode?t.stateNode.state:null,hooks:c.current})}}var u=null;if(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&Object.defineProperty(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,"current",{get:function(){return u},set:function(e){u=e,c.current=[]}}),e.createElement=function(r){for(var o=null,a=null,c=null,u=arguments.length,p=new Array(u>1?u-1:0),l=1;l (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ (function (global, factory) { diff --git a/dist/no-classes-transpile/umd/whyDidYouRender.min.js b/dist/no-classes-transpile/umd/whyDidYouRender.min.js index 68ef1ae..1be3e6b 100644 --- a/dist/no-classes-transpile/umd/whyDidYouRender.min.js +++ b/dist/no-classes-transpile/umd/whyDidYouRender.min.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 4.3.0 + * @welldone-software/why-did-you-render 4.3.1 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("lodash/get"),require("lodash/isString"),require("lodash/reduce"),require("lodash/has"),require("lodash/keys"),require("lodash/isSet"),require("lodash/isFunction"),require("lodash/isRegExp"),require("lodash/isDate"),require("lodash/isPlainObject"),require("lodash/isArray"),require("lodash/defaults")):"function"==typeof define&&define.amd?define(["lodash/get","lodash/isString","lodash/reduce","lodash/has","lodash/keys","lodash/isSet","lodash/isFunction","lodash/isRegExp","lodash/isDate","lodash/isPlainObject","lodash/isArray","lodash/defaults"],r):(e="undefined"!=typeof globalThis?globalThis:e||self).whyDidYouRender=r(e.lodash.get,e.lodash.isString,e.lodash.reduce,e.lodash.has,e.lodash.keys,e.lodash.isSet,e.lodash.isFunction,e.lodash.isRegExp,e.lodash.isDate,e.lodash.isPlainObject,e.lodash.isArray,e.lodash.defaults)}(this,(function(e,r,t,n,o,a,s,i,c,u,f,l){"use strict";function p(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function h(e){for(var r=1;re.length)&&(r=e.length);for(var t=0,n=new Array(r);t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,i=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return s=e.done,e},e:function(e){i=!0,a=e},f:function(){try{s||null==t.return||t.return()}finally{if(i)throw a}}}}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r,t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a,s=s&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s,i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u,f=f&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f,l=l&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l;var w,O="different",D="deepEquals",_="date",k="regex",R="reactElement",E="function",S="function"==typeof Symbol&&Symbol.for,N=S?Symbol.for("react.memo"):60115,j=S?Symbol.for("react.forward_ref"):60112,x=(p(w={},O,"different objects."),p(w,D,"different objects that are equal by value."),p(w,_,"different date objects with the same value."),p(w,k,"different regular expressions with the same value."),p(w,R,"different React elements (remember that the syntax always produces a *NEW* immutable React element so a component that receives as props always re-renders.)."),p(w,E,"different functions with the same name."),w),C=!1;function P(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prefixMessage,a=e.diffObjType,s=e.differences,i=e.values,c=e.options;s&&s.length>0?(c.consoleLog(p({},t,r),"".concat(o," of ").concat(a," changes:")),s.forEach((function(e){var r=e.pathString,t=e.diffType,o=e.prevValue,s=e.nextValue;c.consoleGroup("%c".concat("hook"===a?"[hook ".concat(n," result]"):"".concat(a,"."),"%c").concat(r,"%c"),"color:".concat(c.diffNameColor,";"),"color:".concat(c.diffPathColor,";"),"color:default;"),c.consoleLog("".concat(x[t]," (more info at ").concat(n?"http://bit.ly/wdyr3":"http://bit.ly/wdyr02",")")),c.consoleLog(p({},"prev ".concat(r),o),"!==",p({},"next ".concat(r),s)),c.consoleGroupEnd()}))):s&&(c.consoleLog(p({},t,r),"".concat(o," the ").concat(a," object itself changed but its values are all equal."),"props"===a?"This could have been avoided by making the component pure, or by preventing its father from re-rendering.":"This usually means this component called setState when no changes in its state actually occurred.","More info at ".concat("http://bit.ly/wdyr02")),c.consoleLog("prev ".concat(a,":"),i.prev," !== ",i.next,":next ".concat(a)))}function T(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,s=e.prevHook,i=e.nextProps,c=e.nextState,u=e.nextHook,f=e.reason,l=e.options,d=e.ownerDataMap;if(function(e,r,t){return!C&&(!!t.logOnDifferentValues||(!(!r.whyDidYouRender||!r.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some((function(e){return e.diffType===O}))||e.stateDifferences&&e.stateDifferences.some((function(e){return e.diffType===O}))||e.hookDifferences&&e.hookDifferences.some((function(e){return e.diffType===O})))))}(f,r,l)){l.consoleGroup("%c".concat(t),"color: ".concat(l.titleColor,";"));var h="Re-rendered because";if(f.propsDifferences&&(P({Component:r,displayName:t,prefixMessage:h,diffObjType:"props",differences:f.propsDifferences,values:{prev:o,next:i},options:l}),h="And because"),f.stateDifferences&&P({Component:r,displayName:t,prefixMessage:h,diffObjType:"state",differences:f.stateDifferences,values:{prev:a,next:c},options:l}),f.hookDifferences&&P({Component:r,displayName:t,prefixMessage:h,diffObjType:"hook",differences:f.hookDifferences,values:{prev:s,next:u},hookName:n,options:l}),f.propsDifferences&&f.ownerDifferences){var y=d.get(o),m=d.get(i);l.consoleGroup("Rendered by ".concat(m.displayName));var v="Re-rendered because";f.ownerDifferences.propsDifferences&&(P({Component:m.Component,displayName:m.displayName,prefixMessage:v,diffObjType:"props",differences:f.ownerDifferences.propsDifferences,values:{prev:y.props,next:m.props},options:l}),v="And because"),f.ownerDifferences.stateDifferences&&P({Component:m.Component,displayName:m.displayName,prefixMessage:v,diffObjType:"state",differences:f.ownerDifferences.stateDifferences,values:{prev:y.state,next:m.state},options:l}),f.ownerDifferences.hookDifferences&&f.ownerDifferences.hookDifferences.forEach((function(e,r){var t=e.hookName,n=e.differences;return P({Component:m.Component,displayName:m.displayName,prefixMessage:v,diffObjType:"hook",differences:n,values:{prev:y.hooks[r].result,next:m.hooks[r].result},hookName:t,options:l})})),l.consoleGroupEnd()}f.propsDifferences||f.stateDifferences||f.hookDifferences||l.consoleLog(p({},t,r),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat("http://bit.ly/wdyr02")),l.consoleGroupEnd()}}function Y(e){return e&&"undefined"!=typeof module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler((function(r){"idle"===r&&(C=!0,setTimeout((function(){C=!1}),e))})),T}var H=function(){};function A(e){return e.displayName||e.name||e.type&&A(e.type)||e.render&&A(e.render)||(r(e)?e:void 0)}var I="undefined"!=typeof Element,L="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,M=function(e){return e.$$typeof===L};function W(e,r,t,n,o){return t.push({diffType:o,pathString:n,prevValue:e,nextValue:r}),o!==O}function F(e,r,t){try{var l=[];return function e(r,t,l){var p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(r===t)return!0;if(!r||!t)return W(r,t,l,p,O);if(f(r)&&f(t)){var d=r.length;if(d!==t.length)return W(m(r),m(t),l,p,O);for(var y=[],v=0,b=d;b--;b>0){var w=e(r[b],t[b],y,"".concat(p,"[").concat(b,"]"));w&&v++}return v===d?W(m(r),m(t),l,p,D):(l.push.apply(l,y),W(m(r),m(t),l,p,O))}if(a(r)&&a(t)){if(r.size!==t.size)return W(new Set(r),new Set(t),l,p,O);var S,N=g(r);try{for(N.s();!(S=N.n()).done;){var j=S.value;if(!t.has(j))return W(new Set(r),new Set(t),l,p,O)}}catch(e){N.e(e)}finally{N.f()}return W(new Set(r),new Set(t),l,p,D)}if(c(r)&&c(t))return r.getTime()===t.getTime()?W(new Date(r),new Date(t),l,p,_):W(new Date(r),new Date(t),l,p,O);if(i(r)&&i(t))return r.toString()===t.toString()?W(r,t,l,p,k):W(r,t,l,p,O);if(I&&r instanceof Element&&t instanceof Element)return W(r,t,l,p,O);if(M(r)&&M(t)){if(r.type!==t.type)return W(r,t,l,p,O);var x=e(r.props,t.props,[],"".concat(p,".props"));return W(r,t,l,p,x?R:O)}if(s(r)&&s(t))return r.name===t.name?W(r,t,l,p,E):W(r,t,l,p,O);if(u(r)&&u(t)){var C=o(r),P=C.length;if(P!==o(t).length)return W(h({},r),h({},t),l,p,O);for(var T=P;T--;T>0)if(!n(t,C[T]))return W(h({},r),h({},t),l,p,O);for(var Y=[],H=0,A=P;A--;A>0){var L=C[A],F=e(r[L],t[L],Y,"".concat(p,".").concat(L));F&&H++}return H===P?W(h({},r),h({},t),l,p,D):(l.push.apply(l,Y),W(h({},r),h({},t),l,p,O))}return W(r,t,l,p,O)}(e,r,l,t),l}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var q={};function U(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.shallow,a=void 0===o||o;if(e===r)return!1;if(!a)return F(e,r);var s=e||q,i=r||q,c=Object.keys(h(h({},s),i));return t(c,(function(e,r){var t=F(s[r],i[r],r);return t&&(e=[].concat(m(e),m(t))),e}),[])}function G(e){var r=e.prevOwnerData,t=e.nextOwnerData;if(!r||!t)return!1;var n=r.hooks.map((function(e,r){return{hookName:e.hookName,differences:U(e.result,t.hooks[r].result,{shallow:!1})}}));return{propsDifferences:U(r.props,t.props),stateDifferences:U(r.state,t.state),hookDifferences:n.length>0&&n}}function V(e,r,t,n,o,a,s){var i=s.get(e),c=s.get(n);return{propsDifferences:U(e,n),stateDifferences:U(r,o),hookDifferences:U(t,a,{shallow:!1}),ownerDifferences:G({prevOwnerData:i,nextOwnerData:c})}}function B(e){var r=e.Component,t=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,s=e.prevHook,i=e.nextProps,c=e.nextState,u=e.nextHook,f=e.options,l=e.ownerDataMap;return{Component:r,displayName:t,hookName:n,prevProps:o,prevState:a,prevHook:s,nextProps:i,nextState:c,nextHook:u,options:f,ownerDataMap:l,reason:V(o,a,s,i,c,u,l)}}function $(e){return e.prototype&&!!e.prototype.isReactComponent}function z(e){return e.$$typeof===N}function J(e){return e.$$typeof===j}function K(e){var r=e.Component,t=e.displayName,n=e.options,o=e.React,a=e.isHookChange;return!function(e,r){return r.exclude&&r.exclude.length>0&&r.exclude.some((function(r){return r.test(e)}))}(t,n)&&(!1!==r.whyDidYouRender&&((!a||!r.whyDidYouRender||!1!==r.whyDidYouRender.trackHooks)&&!!(r.whyDidYouRender||n.trackAllPureComponents&&(r&&r.prototype instanceof o.PureComponent||z(r))||function(e,r){return r.include&&r.include.length>0&&r.include.some((function(r){return r.test(e)}))}(t,n))))}function Q(e,r,t,n,o){class a extends e{constructor(r,t){var n;super(r,t),n=this,this._WDYR={renderNumber:0};var o=super.render||this.render;o!==e.prototype.render&&(this.render=function(){return a.prototype.render.apply(n),o()})}render(){if(this._WDYR.renderNumber++,"isStrictMode"in this._WDYR||(this._WDYR.isStrictMode=function(e){for(var r=e&&e._reactInternalFiber;r;){if(1&r.mode)return!0;r=r.return}return!1}(this)),!this._WDYR.isStrictMode||this._WDYR.renderNumber%2!=1){if(this._WDYR.prevProps){var t=B({Component:e,displayName:r,prevProps:this._WDYR.prevProps,prevState:this._WDYR.prevState,nextProps:this.props,nextState:this.state,options:n,ownerDataMap:o});n.notifier(t)}this._WDYR.prevProps=this.props,this._WDYR.prevState=this.state}return super.render?super.render():null}}try{a.displayName=r}catch(e){}return l(a,e),a}function X(e,r,t,n,o,a){var s="string"==typeof e?function(e,r){return function(t){return r.createElement(e,t)}}(e,n):e;function i(){var e=arguments[0],i=n.useRef(),c=i.current;if(i.current=e,c){var u=B({Component:s,displayName:t,prevProps:c,nextProps:e,options:o,ownerDataMap:a}),f=!u.reason.propsDifferences||r&&0===u.reason.propsDifferences.length;f||o.notifier(u)}return s.apply(void 0,arguments)}try{i.displayName=t}catch(e){}return i.ComponentForHooksTracking=s,l(i,s),i}var Z=Symbol("initial-hook-value");function ee(r,t,n,o,a,s,i){var c=t.path,u=c?e(n,c):n,f=o.useRef(1);null!=i.current[0]&&f.current!==i.current[0].renderNumber&&(i.current=[]),i.current.push({hookName:r,result:u,renderNumber:f.current}),f.current++;var l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current,p=o.useRef(Z);if(!l)return n;var d=l.type.ComponentForHooksTracking||l.type,h=A(d);if(!K({Component:d,displayName:h,options:a,React:o,isHookChange:!0}))return n;var y=p.current;if(p.current=n,y!==Z){var m=B({Component:d,displayName:h,hookName:r,prevHook:c?e(y,c):y,nextHook:u,options:a,ownerDataMap:s});m.reason.hookDifferences&&a.notifier(m)}return n}function re(e,r,t,n,o,a){return z(r)?function e(r,t,n,o,a){var s=r.type,i=$(s),c=J(s),u=z(s),f=c?s.render:s,p=i?Q(f,t,0,o,a):u?e(f,t,n,o,a):X(f,!0,t,n,o,a);try{p.displayName=A(f)}catch(e){}p.ComponentForHooksTracking=r,l(p,f);var d=n.memo(c?n.forwardRef(p):p,r.compare);try{d.displayName=t}catch(e){}return l(d,r),d}(r,t,n,o,a):J(r)?function(e,r,t,n,o){var a=e.render,s=z(a),i=s?a.type:a,c=X(i,s,r,t,n,o);c.displayName=A(i),c.ComponentForHooksTracking=i,l(c,i);var u=t.forwardRef(s?t.memo(c,a.compare):c);try{u.displayName=r}catch(e){}return l(u,e),u}(r,t,n,o,a):$(r)?Q(r,t,0,o,a):X(r,!1,t,n,o,a)}function te(e,r,t,n,o,a){if(e.has(r))return e.get(r);var s=re(0,r,t,n,o,a);return e.set(r,s),s}function ne(e){return!!e&&(z(e)?ne(e.type):J(e)?ne(e.render):"function"==typeof e||void 0)}var oe={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};function ae(e,r){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=console.group,t=console.groupEnd;e.collapseGroups?r=console.groupCollapsed:e.onlyLogs&&(r=console.log,t=H);var n=e.notifier||Y("hotReloadBufferMs"in e?e.hotReloadBufferMs:500);return h({include:null,exclude:null,notifier:n,onlyLogs:!1,consoleLog:console.log,consoleGroup:r,consoleGroupEnd:t,logOnDifferentValues:!1,logOwnerReasons:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red",trackExtraHooks:[],trackAllPureComponents:!1},e)}(r),n=e.createElement,o=e.createFactory,a=e.cloneElement,s=new WeakMap,i=new WeakMap,c={current:[]};function u(r){var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current;if(t){var n=t.type.ComponentForHooksTracking||t.type,o=A(n);i.set(r.props,{Component:n,displayName:o,props:t.pendingProps,state:null!=t.stateNode?t.stateNode.state:null,hooks:c.current})}}var f=null;if(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&Object.defineProperty(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,"current",{get:function(){return f},set:function(e){f=e,c.current=[]}}),e.createElement=function(r){for(var o=null,a=null,c=null,f=arguments.length,l=new Array(f>1?f-1:0),p=1;p (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ (function (global, factory) { diff --git a/dist/umd/whyDidYouRender.min.js b/dist/umd/whyDidYouRender.min.js index f055eef..583c1e4 100644 --- a/dist/umd/whyDidYouRender.min.js +++ b/dist/umd/whyDidYouRender.min.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 4.3.0 + * @welldone-software/why-did-you-render 4.3.1 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2020-08-08 + * Generated at 2020-08-14 */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("lodash/get"),require("lodash/isString"),require("lodash/reduce"),require("lodash/has"),require("lodash/keys"),require("lodash/isSet"),require("lodash/isFunction"),require("lodash/isRegExp"),require("lodash/isDate"),require("lodash/isPlainObject"),require("lodash/isArray"),require("lodash/defaults")):"function"==typeof define&&define.amd?define(["lodash/get","lodash/isString","lodash/reduce","lodash/has","lodash/keys","lodash/isSet","lodash/isFunction","lodash/isRegExp","lodash/isDate","lodash/isPlainObject","lodash/isArray","lodash/defaults"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).whyDidYouRender=t(e.lodash.get,e.lodash.isString,e.lodash.reduce,e.lodash.has,e.lodash.keys,e.lodash.isSet,e.lodash.isFunction,e.lodash.isRegExp,e.lodash.isDate,e.lodash.isPlainObject,e.lodash.isArray,e.lodash.defaults)}(this,(function(e,t,r,n,o,a,i,s,c,u,f,l){"use strict";function p(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a,i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,s=s&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s,c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u,f=f&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f,l=l&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l;var S,N="different",j="deepEquals",x="date",P="regex",C="reactElement",T="function",Y="function"==typeof Symbol&&Symbol.for,H=Y?Symbol.for("react.memo"):60115,A=Y?Symbol.for("react.forward_ref"):60112,I=(d(S={},N,"different objects."),d(S,j,"different objects that are equal by value."),d(S,x,"different date objects with the same value."),d(S,P,"different regular expressions with the same value."),d(S,C,"different React elements (remember that the syntax always produces a *NEW* immutable React element so a component that receives as props always re-renders.)."),d(S,T,"different functions with the same name."),S),L=!1;function M(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prefixMessage,a=e.diffObjType,i=e.differences,s=e.values,c=e.options;i&&i.length>0?(c.consoleLog(d({},r,t),"".concat(o," of ").concat(a," changes:")),i.forEach((function(e){var t=e.pathString,r=e.diffType,o=e.prevValue,i=e.nextValue;c.consoleGroup("%c".concat("hook"===a?"[hook ".concat(n," result]"):"".concat(a,"."),"%c").concat(t,"%c"),"color:".concat(c.diffNameColor,";"),"color:".concat(c.diffPathColor,";"),"color:default;"),c.consoleLog("".concat(I[r]," (more info at ").concat(n?"http://bit.ly/wdyr3":"http://bit.ly/wdyr02",")")),c.consoleLog(d({},"prev ".concat(t),o),"!==",d({},"next ".concat(t),i)),c.consoleGroupEnd()}))):i&&(c.consoleLog(d({},r,t),"".concat(o," the ").concat(a," object itself changed but its values are all equal."),"props"===a?"This could have been avoided by making the component pure, or by preventing its father from re-rendering.":"This usually means this component called setState when no changes in its state actually occurred.","More info at ".concat("http://bit.ly/wdyr02")),c.consoleLog("prev ".concat(a,":"),s.prev," !== ",s.next,":next ".concat(a)))}function W(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,s=e.nextProps,c=e.nextState,u=e.nextHook,f=e.reason,l=e.options,p=e.ownerDataMap;if(function(e,t,r){return!L&&(!!r.logOnDifferentValues||(!(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some((function(e){return e.diffType===N}))||e.stateDifferences&&e.stateDifferences.some((function(e){return e.diffType===N}))||e.hookDifferences&&e.hookDifferences.some((function(e){return e.diffType===N})))))}(f,t,l)){l.consoleGroup("%c".concat(r),"color: ".concat(l.titleColor,";"));var y="Re-rendered because";if(f.propsDifferences&&(M({Component:t,displayName:r,prefixMessage:y,diffObjType:"props",differences:f.propsDifferences,values:{prev:o,next:s},options:l}),y="And because"),f.stateDifferences&&M({Component:t,displayName:r,prefixMessage:y,diffObjType:"state",differences:f.stateDifferences,values:{prev:a,next:c},options:l}),f.hookDifferences&&M({Component:t,displayName:r,prefixMessage:y,diffObjType:"hook",differences:f.hookDifferences,values:{prev:i,next:u},hookName:n,options:l}),f.propsDifferences&&f.ownerDifferences){var h=p.get(o),m=p.get(s);l.consoleGroup("Rendered by ".concat(m.displayName));var v="Re-rendered because";f.ownerDifferences.propsDifferences&&(M({Component:m.Component,displayName:m.displayName,prefixMessage:v,diffObjType:"props",differences:f.ownerDifferences.propsDifferences,values:{prev:h.props,next:m.props},options:l}),v="And because"),f.ownerDifferences.stateDifferences&&M({Component:m.Component,displayName:m.displayName,prefixMessage:v,diffObjType:"state",differences:f.ownerDifferences.stateDifferences,values:{prev:h.state,next:m.state},options:l}),f.ownerDifferences.hookDifferences&&f.ownerDifferences.hookDifferences.forEach((function(e,t){var r=e.hookName,n=e.differences;return M({Component:m.Component,displayName:m.displayName,prefixMessage:v,diffObjType:"hook",differences:n,values:{prev:h.hooks[t].result,next:m.hooks[t].result},hookName:r,options:l})})),l.consoleGroupEnd()}f.propsDifferences||f.stateDifferences||f.hookDifferences||l.consoleLog(d({},r,t),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat("http://bit.ly/wdyr02")),l.consoleGroupEnd()}}function F(e){return e&&"undefined"!=typeof module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler((function(t){"idle"===t&&(L=!0,setTimeout((function(){L=!1}),e))})),W}var q=function(){};function U(e){return e.displayName||e.name||e.type&&U(e.type)||e.render&&U(e.render)||(t(e)?e:void 0)}var G="undefined"!=typeof Element,V="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,B=function(e){return e.$$typeof===V};function $(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==N}function z(e,t,r){try{var l=[];return function e(t,r,l){var p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(t===r)return!0;if(!t||!r)return $(t,r,l,p,N);if(f(t)&&f(r)){var d=t.length;if(d!==r.length)return $(_(t),_(r),l,p,N);for(var y=[],m=0,v=d;v--;v>0){var b=e(t[v],r[v],y,"".concat(p,"[").concat(v,"]"));b&&m++}return m===d?$(_(t),_(r),l,p,j):(l.push.apply(l,y),$(_(t),_(r),l,p,N))}if(a(t)&&a(r)){if(t.size!==r.size)return $(new Set(t),new Set(r),l,p,N);var g,O=E(t);try{for(O.s();!(g=O.n()).done;){var w=g.value;if(!r.has(w))return $(new Set(t),new Set(r),l,p,N)}}catch(e){O.e(e)}finally{O.f()}return $(new Set(t),new Set(r),l,p,j)}if(c(t)&&c(r))return t.getTime()===r.getTime()?$(new Date(t),new Date(r),l,p,x):$(new Date(t),new Date(r),l,p,N);if(s(t)&&s(r))return t.toString()===r.toString()?$(t,r,l,p,P):$(t,r,l,p,N);if(G&&t instanceof Element&&r instanceof Element)return $(t,r,l,p,N);if(B(t)&&B(r)){if(t.type!==r.type)return $(t,r,l,p,N);var D=e(t.props,r.props,[],"".concat(p,".props"));return $(t,r,l,p,D?C:N)}if(i(t)&&i(r))return t.name===r.name?$(t,r,l,p,T):$(t,r,l,p,N);if(u(t)&&u(r)){var R=o(t),k=R.length;if(k!==o(r).length)return $(h({},t),h({},r),l,p,N);for(var S=k;S--;S>0)if(!n(r,R[S]))return $(h({},t),h({},r),l,p,N);for(var Y=[],H=0,A=k;A--;A>0){var I=R[A],L=e(t[I],r[I],Y,"".concat(p,".").concat(I));L&&H++}return H===k?$(h({},t),h({},r),l,p,j):(l.push.apply(l,Y),$(h({},t),h({},r),l,p,N))}return $(t,r,l,p,N)}(e,t,l,r),l}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var J={};function K(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.shallow,a=void 0===o||o;if(e===t)return!1;if(!a)return z(e,t);var i=e||J,s=t||J,c=Object.keys(h(h({},i),s));return r(c,(function(e,t){var r=z(i[t],s[t],t);return r&&(e=[].concat(_(e),_(r))),e}),[])}function Q(e){var t=e.prevOwnerData,r=e.nextOwnerData;if(!t||!r)return!1;var n=t.hooks.map((function(e,t){return{hookName:e.hookName,differences:K(e.result,r.hooks[t].result,{shallow:!1})}}));return{propsDifferences:K(t.props,r.props),stateDifferences:K(t.state,r.state),hookDifferences:n.length>0&&n}}function X(e,t,r,n,o,a,i){var s=i.get(e),c=i.get(n);return{propsDifferences:K(e,n),stateDifferences:K(t,o),hookDifferences:K(r,a,{shallow:!1}),ownerDifferences:Q({prevOwnerData:s,nextOwnerData:c})}}function Z(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,s=e.nextProps,c=e.nextState,u=e.nextHook,f=e.options,l=e.ownerDataMap;return{Component:t,displayName:r,hookName:n,prevProps:o,prevState:a,prevHook:i,nextProps:s,nextState:c,nextHook:u,options:f,ownerDataMap:l,reason:X(o,a,i,s,c,u,l)}}function ee(e){return e.prototype&&!!e.prototype.isReactComponent}function te(e){return e.$$typeof===H}function re(e){return e.$$typeof===A}function ne(e){var t=e.Component,r=e.displayName,n=e.options,o=e.React,a=e.isHookChange;return!function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some((function(t){return t.test(e)}))}(r,n)&&(!1!==t.whyDidYouRender&&((!a||!t.whyDidYouRender||!1!==t.whyDidYouRender.trackHooks)&&!!(t.whyDidYouRender||n.trackAllPureComponents&&(t&&t.prototype instanceof o.PureComponent||te(t))||function(e,t){return t.include&&t.include.length>0&&t.include.some((function(t){return t.test(e)}))}(r,n))))}function oe(e,t,r,n,o){var a=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(u,r);var a,i,s,c=O(u);function u(t,r){var n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(o=c.call(this,t,r))._WDYR={renderNumber:0};var a=w((n=b(o),m(u.prototype)),"render",n)||o.render;return a!==e.prototype.render&&(o.render=function(){return u.prototype.render.apply(b(o)),a()}),o}return a=u,(i=[{key:"render",value:function(){if(this._WDYR.renderNumber++,"isStrictMode"in this._WDYR||(this._WDYR.isStrictMode=function(e){for(var t=e&&e._reactInternalFiber;t;){if(1&t.mode)return!0;t=t.return}return!1}(this)),!this._WDYR.isStrictMode||this._WDYR.renderNumber%2!=1){if(this._WDYR.prevProps){var r=Z({Component:e,displayName:t,prevProps:this._WDYR.prevProps,prevState:this._WDYR.prevState,nextProps:this.props,nextState:this.state,options:n,ownerDataMap:o});n.notifier(r)}this._WDYR.prevProps=this.props,this._WDYR.prevState=this.state}return w(m(u.prototype),"render",this)?w(m(u.prototype),"render",this).call(this):null}}])&&p(a.prototype,i),s&&p(a,s),u}(e);try{a.displayName=t}catch(e){}return l(a,e),a}function ae(e,t,r,n,o,a){var i="string"==typeof e?function(e,t){return function(r){return t.createElement(e,r)}}(e,n):e;function s(){var e=arguments[0],s=n.useRef(),c=s.current;if(s.current=e,c){var u=Z({Component:i,displayName:r,prevProps:c,nextProps:e,options:o,ownerDataMap:a}),f=!u.reason.propsDifferences||t&&0===u.reason.propsDifferences.length;f||o.notifier(u)}return i.apply(void 0,arguments)}try{s.displayName=r}catch(e){}return s.ComponentForHooksTracking=i,l(s,i),s}var ie=Symbol("initial-hook-value");function se(t,r,n,o,a,i,s){var c=r.path,u=c?e(n,c):n,f=o.useRef(1);null!=s.current[0]&&f.current!==s.current[0].renderNumber&&(s.current=[]),s.current.push({hookName:t,result:u,renderNumber:f.current}),f.current++;var l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current,p=o.useRef(ie);if(!l)return n;var d=l.type.ComponentForHooksTracking||l.type,y=U(d);if(!ne({Component:d,displayName:y,options:a,React:o,isHookChange:!0}))return n;var h=p.current;if(p.current=n,h!==ie){var m=Z({Component:d,displayName:y,hookName:t,prevHook:c?e(h,c):h,nextHook:u,options:a,ownerDataMap:i});m.reason.hookDifferences&&a.notifier(m)}return n}function ce(e,t,r,n,o,a){return te(t)?function e(t,r,n,o,a){var i=t.type,s=ee(i),c=re(i),u=te(i),f=c?i.render:i,p=s?oe(f,r,0,o,a):u?e(f,r,n,o,a):ae(f,!0,r,n,o,a);try{p.displayName=U(f)}catch(e){}p.ComponentForHooksTracking=t,l(p,f);var d=n.memo(c?n.forwardRef(p):p,t.compare);try{d.displayName=r}catch(e){}return l(d,t),d}(t,r,n,o,a):re(t)?function(e,t,r,n,o){var a=e.render,i=te(a),s=i?a.type:a,c=ae(s,i,t,r,n,o);c.displayName=U(s),c.ComponentForHooksTracking=s,l(c,s);var u=r.forwardRef(i?r.memo(c,a.compare):c);try{u.displayName=t}catch(e){}return l(u,e),u}(t,r,n,o,a):ee(t)?oe(t,r,0,o,a):ae(t,!1,r,n,o,a)}function ue(e,t,r,n,o,a){if(e.has(t))return e.get(t);var i=ce(0,t,r,n,o,a);return e.set(t,i),i}function fe(e){return!!e&&(te(e)?fe(e.type):re(e)?fe(e.render):"function"==typeof e||void 0)}var le={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};function pe(e,t){var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=console.group,r=console.groupEnd;e.collapseGroups?t=console.groupCollapsed:e.onlyLogs&&(t=console.log,r=q);var n=e.notifier||F("hotReloadBufferMs"in e?e.hotReloadBufferMs:500);return h({include:null,exclude:null,notifier:n,onlyLogs:!1,consoleLog:console.log,consoleGroup:t,consoleGroupEnd:r,logOnDifferentValues:!1,logOwnerReasons:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red",trackExtraHooks:[],trackAllPureComponents:!1},e)}(t),n=e.createElement,o=e.createFactory,a=e.cloneElement,i=new WeakMap,s=new WeakMap,c={current:[]};function u(t){var r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current;if(r){var n=r.type.ComponentForHooksTracking||r.type,o=U(n);s.set(t.props,{Component:n,displayName:o,props:r.pendingProps,state:null!=r.stateNode?r.stateNode.state:null,hooks:c.current})}}var f=null;if(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&Object.defineProperty(e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,"current",{get:function(){return f},set:function(e){f=e,c.current=[]}}),e.createElement=function(t){for(var o=null,a=null,c=null,f=arguments.length,l=new Array(f>1?f-1:0),p=1;p