diff --git a/dist/cjs/whyDidYouRender.js b/dist/cjs/whyDidYouRender.js index da2588c..880ffa4 100644 --- a/dist/cjs/whyDidYouRender.js +++ b/dist/cjs/whyDidYouRender.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 3.0.0-beta.5 + * @welldone-software/why-did-you-render 3.0.0 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ 'use strict'; diff --git a/dist/cjs/whyDidYouRender.min.js b/dist/cjs/whyDidYouRender.min.js index 77d59c9..6edf924 100644 --- a/dist/cjs/whyDidYouRender.min.js +++ b/dist/cjs/whyDidYouRender.min.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 3.0.0-beta.5 + * @welldone-software/why-did-you-render 3.0.0 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ "use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _get$1=_interopDefault(require("lodash/get")),_omit=_interopDefault(require("lodash/omit")),_defaults=_interopDefault(require("lodash/defaults")),_isString=_interopDefault(require("lodash/isString")),_reduce=_interopDefault(require("lodash/reduce")),_has=_interopDefault(require("lodash/has")),_keys=_interopDefault(require("lodash/keys")),_isFunction=_interopDefault(require("lodash/isFunction")),_isRegExp=_interopDefault(require("lodash/isRegExp")),_isDate=_interopDefault(require("lodash/isDate")),_isPlainObject=_interopDefault(require("lodash/isPlainObject")),_isArray=_interopDefault(require("lodash/isArray"));function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r0?(s.consoleLog(_defineProperty({},r,t),"".concat(o," of ").concat(i," changes:")),a.forEach(function(e){var t=e.pathString,r=e.diffType,o=e.prevValue,a=e.nextValue;s.consoleGroup("%c".concat("hook"===i?"hook ".concat(n," "):"".concat(i,"."),"%c").concat(t,"%c"),"color:".concat(s.diffNameColor,";"),"color:".concat(s.diffPathColor,";"),"color:default;"),s.consoleLog("".concat(diffTypesDescriptions[r]," (more info at ").concat(n?moreInfoHooksUrl:moreInfoUrl,")")),s.consoleLog(_defineProperty({},"prev ".concat(t),o),"!==",_defineProperty({},"next ".concat(t),a)),s.consoleGroupEnd()})):a&&(s.consoleLog(_defineProperty({},r,t),"".concat(o," the ").concat(i," object itself changed but it's values are all equal."),"props"===i?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(moreInfoUrl)),s.consoleLog("prev ".concat(i,":"),f.prev," !== ",f.next,":next ".concat(i)))}function defaultNotifier(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,i=e.prevState,a=e.prevHook,f=e.nextProps,s=e.nextState,c=e.nextHook,p=e.reason,u=e.options;if(shouldLog(p,t,u)){u.consoleGroup("%c".concat(r),"color: ".concat(u.titleColor,";"));var l="Re-rendered because";p.propsDifferences&&(logDifference({Component:t,displayName:r,prefixMessage:l,diffObjType:"props",differences:p.propsDifferences,values:{prev:o,next:f},options:u}),l="And because"),p.stateDifferences&&logDifference({Component:t,displayName:r,prefixMessage:l,diffObjType:"state",differences:p.stateDifferences,values:{prev:i,next:s},options:u}),p.hookDifferences&&logDifference({Component:t,displayName:r,prefixMessage:l,diffObjType:"hook",differences:p.hookDifferences,values:{prev:a,next:c},hookName:n,options:u}),p.propsDifferences||p.stateDifferences||p.hookDifferences||u.consoleLog(_defineProperty({},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(moreInfoUrl)),u.consoleGroupEnd()}}function createDefaultNotifier(e){return e&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(inHotReload=!0,setTimeout(function(){inHotReload=!1},e))}),defaultNotifier}var emptyFn=function(){};function normalizeOptions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=console.group,r=console.groupEnd;return e.collapseGroups?t=console.groupCollapsed:e.onlyLogs&&(t=console.log,r=emptyFn),_objectSpread({include:null,exclude:null,notifier:e.notifier||createDefaultNotifier(e.hasOwnProperty("hotReloadBufferMs")?e.hotReloadBufferMs:500),onlyLogs:!1,consoleLog:console.log,consoleGroup:t,consoleGroupEnd:r,logOnDifferentValues:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red"},e)}function getDisplayName(e){return e.displayName||e.name||e.type&&getDisplayName(e.type)||(_isString(e)?e:void 0)}var hasElementType="undefined"!=typeof Element,hasSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE=hasSymbol?Symbol.for("react.element"):60103,isReactElement=function(e){return e.$$typeof===REACT_ELEMENT_TYPE};function trackDiff(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==diffTypes.different}function accumulateDeepEqualDiffs(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(e===t)return!0;if(!e||!t)return trackDiff(e,t,r,n,diffTypes.different);if(_isArray(e)&&_isArray(t)){var o=e.length;if(o!==t.length)return trackDiff(e,t,r,n,diffTypes.different);for(var i=!0,a=o;0!=a--;)accumulateDeepEqualDiffs(e[a],t[a],r,"".concat(n,"[").concat(a,"]"))||(i=!1);return trackDiff(e,t,r,n,i?diffTypes.deepEquals:diffTypes.different)}if(_isDate(e)&&_isDate(t))return e.getTime()===t.getTime()?trackDiff(e,t,r,n,diffTypes.date):trackDiff(e,t,r,n,diffTypes.different);if(_isRegExp(e)&&_isRegExp(t))return e.toString()===t.toString()?trackDiff(e,t,r,n,diffTypes.regex):trackDiff(e,t,r,n,diffTypes.different);if(hasElementType&&e instanceof Element&&t instanceof Element)return trackDiff(e,t,r,n,diffTypes.different);if(isReactElement(e)&&isReactElement(t))return e.type===t.type?trackDiff(e,t,r,n,diffTypes.reactElement):trackDiff(e,t,r,n,diffTypes.different);if(_isFunction(e)&&_isFunction(t))return e.name===t.name?trackDiff(e,t,r,n,diffTypes.function):trackDiff(e,t,r,n,diffTypes.different);if(_isPlainObject(e)&&_isPlainObject(t)){var f=_keys(e),s=f.length;if(s!==_keys(t).length)return trackDiff(e,t,r,n,diffTypes.different);for(var c=s;0!=c--;)if(!_has(t,f[c]))return trackDiff(e,t,r,n,diffTypes.different);for(var p=!0,u=s;0!=u--;){var l=f[u];accumulateDeepEqualDiffs(e[l],t[l],r,"".concat(n,".").concat(l))||(p=!1)}return trackDiff(e,t,r,n,p?diffTypes.deepEquals:diffTypes.different)}return trackDiff(e,t,r,n,diffTypes.different)}function calculateDeepEqualDiffs(e,t,r){try{var n=[];return accumulateDeepEqualDiffs(e,t,n,r),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 emptyObject={};function findObjectsDifferences(e,t){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).shallow;if(e===t)return!1;if(!(void 0===r||r))return calculateDeepEqualDiffs(e,t);var n=e||emptyObject,o=t||emptyObject,i=Object.keys(_objectSpread({},n,o));return _reduce(i,function(e,t){var r=calculateDeepEqualDiffs(n[t],o[t],t);return r&&(e=[].concat(_toConsumableArray(e),_toConsumableArray(r))),e},[])}function getUpdateReason(e,t,r,n,o,i){return{propsDifferences:findObjectsDifferences(e,n),stateDifferences:findObjectsDifferences(t,o),hookDifferences:findObjectsDifferences(r,i,{shallow:!1})}}function getUpdateInfo(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,i=e.prevState,a=e.prevHook,f=e.nextProps,s=e.nextState,c=e.nextHook;return{Component:t,displayName:r,hookName:n,prevProps:o,prevState:i,prevHook:a,nextProps:f,nextState:s,nextHook:c,options:e.options,reason:getUpdateReason(o,i,a,f,s,c)}}function shouldInclude(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}function shouldExclude(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}function shouldTrack(e,t,r){return!shouldExclude(t,r)&&!(!e.whyDidYouRender&&!shouldInclude(t,r))}var hasSymbol$1="function"==typeof Symbol&&Symbol.for,REACT_MEMO_TYPE=hasSymbol$1?Symbol.for("react.memo"):60115;function patchClassComponent(e,t,r,n){var o=function(r){function o(t,r){var n;if(_classCallCheck(this,o),(n=_possibleConstructorReturn(this,_getPrototypeOf(o).call(this,t,r))).render&&!e.prototype.render){var i=n.render;n.render=function(){return o.prototype.render.apply(_assertThisInitialized(n)),i()}}return n}return _inherits(o,e),_createClass(o,[{key:"render",value:function(){return this._prevProps&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:n})),this._prevProps=this.props,this._prevState=this.state,_get(_getPrototypeOf(o.prototype),"render",this)&&_get(_getPrototypeOf(o.prototype),"render",this).call(this)}}]),o}();return o.displayName=t,_defaults(o,e),o}function patchFunctionalComponent(e,t,r,n){function o(o){var i=r.useRef(),a=i.current;if(i.current=o,a){var f=getUpdateInfo({Component:e,displayName:t,prevProps:a,nextProps:o,options:n});f.reason.propsDifferences&&n.notifier(f)}return e(o)}return o.displayName=t,_defaults(o,e),o}function patchMemoComponent(e,t,r,n){function o(o){var i=r.useRef(),a=i.current;if(i.current=o,a){var f=getUpdateInfo({Component:e,displayName:t,prevProps:a,nextProps:o,options:n});f.reason.propsDifferences&&f.reason.propsDifferences.length>0&&n.notifier(f)}return e.type(o)}var i=r.memo(o),a=_omit(e,Object.keys(i));return o.displayName=t,_defaults(o,a),i.displayName=t,_defaults(i,e),i}function trackHookChanges(e,t,r,n,o){var i=t.path,a=r,f=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current.type,s=getDisplayName(f);if(!shouldTrack(f,s,o))return a;var c=n.useRef(),p=c.current;if(c.current=a,p){var u=getUpdateInfo({Component:f,displayName:s,hookName:e,prevHook:i?_get$1(p,i):p,nextHook:i?_get$1(a,i):a,options:o});u.reason.hookDifferences&&o.notifier(u)}return c.current}function createPatchedComponent(e,t,r,n,o){return t.$$typeof===REACT_MEMO_TYPE?patchMemoComponent(t,r,n,o):t.prototype&&t.prototype.isReactComponent?patchClassComponent(t,r,n,o):patchFunctionalComponent(t,r,n,o)}function getPatchedComponent(e,t,r,n,o){if(e.has(t))return e.get(t);var i=createPatchedComponent(e,t,r,n,o);return e.set(t,i),i}var hooksConfig={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};function whyDidYouRender(e,t){var r,n=normalizeOptions(t),o=e.createElement,i=e.createFactory,a=new WeakMap;(e.createElement=function(t){for(var r=("function"==typeof t||t.$$typeof===REACT_MEMO_TYPE)&&shouldTrack(t,getDisplayName(t),n),i=arguments.length,f=new Array(i>1?i-1:0),s=1;s (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ import _get$1 from 'lodash/get'; diff --git a/dist/esm/whyDidYouRender.min.js b/dist/esm/whyDidYouRender.min.js index 77782b6..03cdd2f 100644 --- a/dist/esm/whyDidYouRender.min.js +++ b/dist/esm/whyDidYouRender.min.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 3.0.0-beta.5 + * @welldone-software/why-did-you-render 3.0.0 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ import e from"lodash/get";import t from"lodash/omit";import r from"lodash/defaults";import n from"lodash/isString";import o from"lodash/reduce";import a from"lodash/has";import i from"lodash/keys";import f from"lodash/isFunction";import c from"lodash/isRegExp";import s from"lodash/isDate";import u from"lodash/isPlainObject";import p from"lodash/isArray";function l(e,t){for(var r=0;r0?(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," "):"".concat(a,"."),"%c").concat(t,"%c"),"color:".concat(c.diffNameColor,";"),"color:".concat(c.diffPathColor,";"),"color:default;"),c.consoleLog("".concat(R[r]," (more info at ").concat(n?w:D,")")),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 it's values are all equal."),"props"===a?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(D)),c.consoleLog("prev ".concat(a,":"),f.prev," !== ",f.next,":next ".concat(a)))}function k(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,f=e.nextProps,c=e.nextState,s=e.nextHook,u=e.reason,p=e.options;if(function(e,t,r){return!(x||!r.logOnDifferentValues&&(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)&&(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===E.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===E.different})||e.hookDifferences&&e.hookDifferences.some(function(e){return e.diffType===E.different})))}(u,t,p)){p.consoleGroup("%c".concat(r),"color: ".concat(p.titleColor,";"));var l="Re-rendered because";u.propsDifferences&&(S({Component:t,displayName:r,prefixMessage:l,diffObjType:"props",differences:u.propsDifferences,values:{prev:o,next:f},options:p}),l="And because"),u.stateDifferences&&S({Component:t,displayName:r,prefixMessage:l,diffObjType:"state",differences:u.stateDifferences,values:{prev:a,next:c},options:p}),u.hookDifferences&&S({Component:t,displayName:r,prefixMessage:l,diffObjType:"hook",differences:u.hookDifferences,values:{prev:i,next:s},hookName:n,options:p}),u.propsDifferences||u.stateDifferences||u.hookDifferences||p.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(D)),p.consoleGroupEnd()}}var N=function(){};function j(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=console.group,n=console.groupEnd;return t.collapseGroups?r=console.groupCollapsed:t.onlyLogs&&(r=console.log,n=N),m({include:null,exclude:null,notifier:t.notifier||((e=t.hasOwnProperty("hotReloadBufferMs")?t.hotReloadBufferMs:500)&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(x=!0,setTimeout(function(){x=!1},e))}),k),onlyLogs:!1,consoleLog:console.log,consoleGroup:r,consoleGroupEnd:n,logOnDifferentValues:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red"},t)}function P(e){return e.displayName||e.name||e.type&&P(e.type)||(n(e)?e:void 0)}var T="undefined"!=typeof Element,C="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,L=function(e){return e.$$typeof===C};function H(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==E.different}function A(e,t,r){try{var n=[];return function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(t===r)return!0;if(!t||!r)return H(t,r,n,o,E.different);if(p(t)&&p(r)){var l=t.length;if(l!==r.length)return H(t,r,n,o,E.different);for(var d=!0,m=l;0!=m--;)e(t[m],r[m],n,"".concat(o,"[").concat(m,"]"))||(d=!1);return H(t,r,n,o,d?E.deepEquals:E.different)}if(s(t)&&s(r))return t.getTime()===r.getTime()?H(t,r,n,o,E.date):H(t,r,n,o,E.different);if(c(t)&&c(r))return t.toString()===r.toString()?H(t,r,n,o,E.regex):H(t,r,n,o,E.different);if(T&&t instanceof Element&&r instanceof Element)return H(t,r,n,o,E.different);if(L(t)&&L(r))return t.type===r.type?H(t,r,n,o,E.reactElement):H(t,r,n,o,E.different);if(f(t)&&f(r))return t.name===r.name?H(t,r,n,o,E.function):H(t,r,n,o,E.different);if(u(t)&&u(r)){var h=i(t),y=h.length;if(y!==i(r).length)return H(t,r,n,o,E.different);for(var v=y;0!=v--;)if(!a(r,h[v]))return H(t,r,n,o,E.different);for(var g=!0,b=y;0!=b--;){var _=h[b];e(t[_],r[_],n,"".concat(o,".").concat(_))||(g=!1)}return H(t,r,n,o,g?E.deepEquals:E.different)}return H(t,r,n,o,E.different)}(e,t,n,r),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 I={};function Y(e,t){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).shallow;if(e===t)return!1;if(!(void 0===r||r))return A(e,t);var n=e||I,a=t||I,i=Object.keys(m({},n,a));return o(i,function(e,t){var r=A(n[t],a[t],t);return r&&(e=[].concat(_(e),_(r))),e},[])}function U(e,t,r,n,o,a){return{propsDifferences:Y(e,n),stateDifferences:Y(t,o),hookDifferences:Y(r,a,{shallow:!1})}}function V(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,f=e.nextProps,c=e.nextState,s=e.nextHook;return{Component:t,displayName:r,hookName:n,prevProps:o,prevState:a,prevHook:i,nextProps:f,nextState:c,nextHook:s,options:e.options,reason:U(o,a,i,f,c,s)}}function F(e,t,r){return!function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}(t,r)&&!(!e.whyDidYouRender&&!function(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}(t,r))}var M="function"==typeof Symbol&&Symbol.for?Symbol.for("react.memo"):60115;function q(e,t,n,o){var a=function(r){function n(t,r){var o,a,i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),a=this,i=h(n).call(this,t,r),(o=!i||"object"!=typeof i&&"function"!=typeof i?v(a):i).render&&!e.prototype.render){var f=o.render;o.render=function(){return n.prototype.render.apply(v(o)),f()}}return o}var a,i,f;return 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&&y(e,t)}(n,e),a=n,(i=[{key:"render",value:function(){return this._prevProps&&o.notifier(V({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:o})),this._prevProps=this.props,this._prevState=this.state,g(h(n.prototype),"render",this)&&g(h(n.prototype),"render",this).call(this)}}])&&l(a.prototype,i),f&&l(a,f),n}();return a.displayName=t,r(a,e),a}function G(e,n,o,a,i){return n.$$typeof===M?function(e,n,o,a){function i(t){var r=o.useRef(),i=r.current;if(r.current=t,i){var f=V({Component:e,displayName:n,prevProps:i,nextProps:t,options:a});f.reason.propsDifferences&&f.reason.propsDifferences.length>0&&a.notifier(f)}return e.type(t)}var f=o.memo(i),c=t(e,Object.keys(f));return i.displayName=n,r(i,c),f.displayName=n,r(f,e),f}(n,o,a,i):n.prototype&&n.prototype.isReactComponent?q(n,o,0,i):function(e,t,n,o){function a(r){var a=n.useRef(),i=a.current;if(a.current=r,i){var f=V({Component:e,displayName:t,prevProps:i,nextProps:r,options:o});f.reason.propsDifferences&&o.notifier(f)}return e(r)}return a.displayName=t,r(a,e),a}(n,o,a,i)}var W={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};export default function(t,r){var n,o=j(r),a=t.createElement,i=t.createFactory,f=new WeakMap;return t.createElement=function(e){for(var r=("function"==typeof e||e.$$typeof===M)&&F(e,P(e),o),n=arguments.length,i=new Array(n>1?n-1:0),c=1;c (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ 'use strict'; diff --git a/dist/no-classes-transpile/cjs/whyDidYouRender.min.js b/dist/no-classes-transpile/cjs/whyDidYouRender.min.js index 3b138a5..689b5f9 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 3.0.0-beta.5 + * @welldone-software/why-did-you-render 3.0.0 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ "use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _get=_interopDefault(require("lodash/get")),_omit=_interopDefault(require("lodash/omit")),_defaults=_interopDefault(require("lodash/defaults")),_isString=_interopDefault(require("lodash/isString")),_reduce=_interopDefault(require("lodash/reduce")),_has=_interopDefault(require("lodash/has")),_keys=_interopDefault(require("lodash/keys")),_isFunction=_interopDefault(require("lodash/isFunction")),_isRegExp=_interopDefault(require("lodash/isRegExp")),_isDate=_interopDefault(require("lodash/isDate")),_isPlainObject=_interopDefault(require("lodash/isPlainObject")),_isArray=_interopDefault(require("lodash/isArray"));function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _objectSpread(e){for(var t=1;t0?(s.consoleLog(_defineProperty({},r,t),"".concat(o," of ").concat(i," changes:")),a.forEach(function(e){var t=e.pathString,r=e.diffType,o=e.prevValue,a=e.nextValue;s.consoleGroup("%c".concat("hook"===i?"hook ".concat(n," "):"".concat(i,"."),"%c").concat(t,"%c"),"color:".concat(s.diffNameColor,";"),"color:".concat(s.diffPathColor,";"),"color:default;"),s.consoleLog("".concat(diffTypesDescriptions[r]," (more info at ").concat(n?moreInfoHooksUrl:moreInfoUrl,")")),s.consoleLog(_defineProperty({},"prev ".concat(t),o),"!==",_defineProperty({},"next ".concat(t),a)),s.consoleGroupEnd()})):a&&(s.consoleLog(_defineProperty({},r,t),"".concat(o," the ").concat(i," object itself changed but it's values are all equal."),"props"===i?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(moreInfoUrl)),s.consoleLog("prev ".concat(i,":"),f.prev," !== ",f.next,":next ".concat(i)))}function defaultNotifier(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,i=e.prevState,a=e.prevHook,f=e.nextProps,s=e.nextState,c=e.nextHook,p=e.reason,u=e.options;if(shouldLog(p,t,u)){u.consoleGroup("%c".concat(r),"color: ".concat(u.titleColor,";"));var l="Re-rendered because";p.propsDifferences&&(logDifference({Component:t,displayName:r,prefixMessage:l,diffObjType:"props",differences:p.propsDifferences,values:{prev:o,next:f},options:u}),l="And because"),p.stateDifferences&&logDifference({Component:t,displayName:r,prefixMessage:l,diffObjType:"state",differences:p.stateDifferences,values:{prev:i,next:s},options:u}),p.hookDifferences&&logDifference({Component:t,displayName:r,prefixMessage:l,diffObjType:"hook",differences:p.hookDifferences,values:{prev:a,next:c},hookName:n,options:u}),p.propsDifferences||p.stateDifferences||p.hookDifferences||u.consoleLog(_defineProperty({},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(moreInfoUrl)),u.consoleGroupEnd()}}function createDefaultNotifier(e){return e&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(inHotReload=!0,setTimeout(function(){inHotReload=!1},e))}),defaultNotifier}var emptyFn=function(){};function normalizeOptions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=console.group,r=console.groupEnd;return e.collapseGroups?t=console.groupCollapsed:e.onlyLogs&&(t=console.log,r=emptyFn),_objectSpread({include:null,exclude:null,notifier:e.notifier||createDefaultNotifier(e.hasOwnProperty("hotReloadBufferMs")?e.hotReloadBufferMs:500),onlyLogs:!1,consoleLog:console.log,consoleGroup:t,consoleGroupEnd:r,logOnDifferentValues:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red"},e)}function getDisplayName(e){return e.displayName||e.name||e.type&&getDisplayName(e.type)||(_isString(e)?e:void 0)}var hasElementType="undefined"!=typeof Element,hasSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE=hasSymbol?Symbol.for("react.element"):60103,isReactElement=function(e){return e.$$typeof===REACT_ELEMENT_TYPE};function trackDiff(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==diffTypes.different}function accumulateDeepEqualDiffs(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(e===t)return!0;if(!e||!t)return trackDiff(e,t,r,n,diffTypes.different);if(_isArray(e)&&_isArray(t)){var o=e.length;if(o!==t.length)return trackDiff(e,t,r,n,diffTypes.different);for(var i=!0,a=o;0!=a--;)accumulateDeepEqualDiffs(e[a],t[a],r,"".concat(n,"[").concat(a,"]"))||(i=!1);return trackDiff(e,t,r,n,i?diffTypes.deepEquals:diffTypes.different)}if(_isDate(e)&&_isDate(t))return e.getTime()===t.getTime()?trackDiff(e,t,r,n,diffTypes.date):trackDiff(e,t,r,n,diffTypes.different);if(_isRegExp(e)&&_isRegExp(t))return e.toString()===t.toString()?trackDiff(e,t,r,n,diffTypes.regex):trackDiff(e,t,r,n,diffTypes.different);if(hasElementType&&e instanceof Element&&t instanceof Element)return trackDiff(e,t,r,n,diffTypes.different);if(isReactElement(e)&&isReactElement(t))return e.type===t.type?trackDiff(e,t,r,n,diffTypes.reactElement):trackDiff(e,t,r,n,diffTypes.different);if(_isFunction(e)&&_isFunction(t))return e.name===t.name?trackDiff(e,t,r,n,diffTypes.function):trackDiff(e,t,r,n,diffTypes.different);if(_isPlainObject(e)&&_isPlainObject(t)){var f=_keys(e),s=f.length;if(s!==_keys(t).length)return trackDiff(e,t,r,n,diffTypes.different);for(var c=s;0!=c--;)if(!_has(t,f[c]))return trackDiff(e,t,r,n,diffTypes.different);for(var p=!0,u=s;0!=u--;){var l=f[u];accumulateDeepEqualDiffs(e[l],t[l],r,"".concat(n,".").concat(l))||(p=!1)}return trackDiff(e,t,r,n,p?diffTypes.deepEquals:diffTypes.different)}return trackDiff(e,t,r,n,diffTypes.different)}function calculateDeepEqualDiffs(e,t,r){try{var n=[];return accumulateDeepEqualDiffs(e,t,n,r),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 emptyObject={};function findObjectsDifferences(e,t){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).shallow;if(e===t)return!1;if(!(void 0===r||r))return calculateDeepEqualDiffs(e,t);var n=e||emptyObject,o=t||emptyObject,i=Object.keys(_objectSpread({},n,o));return _reduce(i,function(e,t){var r=calculateDeepEqualDiffs(n[t],o[t],t);return r&&(e=[].concat(_toConsumableArray(e),_toConsumableArray(r))),e},[])}function getUpdateReason(e,t,r,n,o,i){return{propsDifferences:findObjectsDifferences(e,n),stateDifferences:findObjectsDifferences(t,o),hookDifferences:findObjectsDifferences(r,i,{shallow:!1})}}function getUpdateInfo(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,i=e.prevState,a=e.prevHook,f=e.nextProps,s=e.nextState,c=e.nextHook;return{Component:t,displayName:r,hookName:n,prevProps:o,prevState:i,prevHook:a,nextProps:f,nextState:s,nextHook:c,options:e.options,reason:getUpdateReason(o,i,a,f,s,c)}}function shouldInclude(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}function shouldExclude(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}function shouldTrack(e,t,r){return!shouldExclude(t,r)&&!(!e.whyDidYouRender&&!shouldInclude(t,r))}var hasSymbol$1="function"==typeof Symbol&&Symbol.for,REACT_MEMO_TYPE=hasSymbol$1?Symbol.for("react.memo"):60115;function patchClassComponent(e,t,r,n){class o extends e{constructor(t,r){var n;if(super(t,r),n=this,this.render&&!e.prototype.render){var i=this.render;this.render=function(){return o.prototype.render.apply(n),i()}}}render(){return this._prevProps&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:n})),this._prevProps=this.props,this._prevState=this.state,super.render&&super.render()}}return o.displayName=t,_defaults(o,e),o}function patchFunctionalComponent(e,t,r,n){function o(o){var i=r.useRef(),a=i.current;if(i.current=o,a){var f=getUpdateInfo({Component:e,displayName:t,prevProps:a,nextProps:o,options:n});f.reason.propsDifferences&&n.notifier(f)}return e(o)}return o.displayName=t,_defaults(o,e),o}function patchMemoComponent(e,t,r,n){function o(o){var i=r.useRef(),a=i.current;if(i.current=o,a){var f=getUpdateInfo({Component:e,displayName:t,prevProps:a,nextProps:o,options:n});f.reason.propsDifferences&&f.reason.propsDifferences.length>0&&n.notifier(f)}return e.type(o)}var i=r.memo(o),a=_omit(e,Object.keys(i));return o.displayName=t,_defaults(o,a),i.displayName=t,_defaults(i,e),i}function trackHookChanges(e,t,r,n,o){var i=t.path,a=r,f=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current.type,s=getDisplayName(f);if(!shouldTrack(f,s,o))return a;var c=n.useRef(),p=c.current;if(c.current=a,p){var u=getUpdateInfo({Component:f,displayName:s,hookName:e,prevHook:i?_get(p,i):p,nextHook:i?_get(a,i):a,options:o});u.reason.hookDifferences&&o.notifier(u)}return c.current}function createPatchedComponent(e,t,r,n,o){return t.$$typeof===REACT_MEMO_TYPE?patchMemoComponent(t,r,n,o):t.prototype&&t.prototype.isReactComponent?patchClassComponent(t,r,n,o):patchFunctionalComponent(t,r,n,o)}function getPatchedComponent(e,t,r,n,o){if(e.has(t))return e.get(t);var i=createPatchedComponent(e,t,r,n,o);return e.set(t,i),i}var hooksConfig={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};function whyDidYouRender(e,t){var r,n=normalizeOptions(t),o=e.createElement,i=e.createFactory,a=new WeakMap;(e.createElement=function(t){for(var r=("function"==typeof t||t.$$typeof===REACT_MEMO_TYPE)&&shouldTrack(t,getDisplayName(t),n),i=arguments.length,f=new Array(i>1?i-1:0),s=1;s (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ 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 62d2ef5..715f70f 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 3.0.0-beta.5 + * @welldone-software/why-did-you-render 3.0.0 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ import e from"lodash/get";import t from"lodash/omit";import r from"lodash/defaults";import n from"lodash/isString";import o from"lodash/reduce";import a from"lodash/has";import i from"lodash/keys";import f from"lodash/isFunction";import c from"lodash/isRegExp";import s from"lodash/isDate";import u from"lodash/isPlainObject";import p from"lodash/isArray";function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){for(var t=1;t0?(c.consoleLog(l({},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," "):"".concat(a,"."),"%c").concat(t,"%c"),"color:".concat(c.diffNameColor,";"),"color:".concat(c.diffPathColor,";"),"color:default;"),c.consoleLog("".concat(_[r]," (more info at ").concat(n?b:g,")")),c.consoleLog(l({},"prev ".concat(t),o),"!==",l({},"next ".concat(t),i)),c.consoleGroupEnd()})):i&&(c.consoleLog(l({},r,t),"".concat(o," the ").concat(a," object itself changed but it's values are all equal."),"props"===a?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(g)),c.consoleLog("prev ".concat(a,":"),f.prev," !== ",f.next,":next ".concat(a)))}function O(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,f=e.nextProps,c=e.nextState,s=e.nextHook,u=e.reason,p=e.options;if(function(e,t,r){return!(E||!r.logOnDifferentValues&&(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)&&(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===v.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===v.different})||e.hookDifferences&&e.hookDifferences.some(function(e){return e.diffType===v.different})))}(u,t,p)){p.consoleGroup("%c".concat(r),"color: ".concat(p.titleColor,";"));var d="Re-rendered because";u.propsDifferences&&(D({Component:t,displayName:r,prefixMessage:d,diffObjType:"props",differences:u.propsDifferences,values:{prev:o,next:f},options:p}),d="And because"),u.stateDifferences&&D({Component:t,displayName:r,prefixMessage:d,diffObjType:"state",differences:u.stateDifferences,values:{prev:a,next:c},options:p}),u.hookDifferences&&D({Component:t,displayName:r,prefixMessage:d,diffObjType:"hook",differences:u.hookDifferences,values:{prev:i,next:s},hookName:n,options:p}),u.propsDifferences||u.stateDifferences||u.hookDifferences||p.consoleLog(l({},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(g)),p.consoleGroupEnd()}}var x=function(){};function R(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=console.group,n=console.groupEnd;return t.collapseGroups?r=console.groupCollapsed:t.onlyLogs&&(r=console.log,n=x),d({include:null,exclude:null,notifier:t.notifier||((e=t.hasOwnProperty("hotReloadBufferMs")?t.hotReloadBufferMs:500)&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(E=!0,setTimeout(function(){E=!1},e))}),O),onlyLogs:!1,consoleLog:console.log,consoleGroup:r,consoleGroupEnd:n,logOnDifferentValues:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red"},t)}function S(e){return e.displayName||e.name||e.type&&S(e.type)||(n(e)?e:void 0)}var N="undefined"!=typeof Element,k="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,w=function(e){return e.$$typeof===k};function T(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==v.different}function j(e,t,r){try{var n=[];return function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(t===r)return!0;if(!t||!r)return T(t,r,n,o,v.different);if(p(t)&&p(r)){var l=t.length;if(l!==r.length)return T(t,r,n,o,v.different);for(var d=!0,m=l;0!=m--;)e(t[m],r[m],n,"".concat(o,"[").concat(m,"]"))||(d=!1);return T(t,r,n,o,d?v.deepEquals:v.different)}if(s(t)&&s(r))return t.getTime()===r.getTime()?T(t,r,n,o,v.date):T(t,r,n,o,v.different);if(c(t)&&c(r))return t.toString()===r.toString()?T(t,r,n,o,v.regex):T(t,r,n,o,v.different);if(N&&t instanceof Element&&r instanceof Element)return T(t,r,n,o,v.different);if(w(t)&&w(r))return t.type===r.type?T(t,r,n,o,v.reactElement):T(t,r,n,o,v.different);if(f(t)&&f(r))return t.name===r.name?T(t,r,n,o,v.function):T(t,r,n,o,v.different);if(u(t)&&u(r)){var h=i(t),y=h.length;if(y!==i(r).length)return T(t,r,n,o,v.different);for(var g=y;0!=g--;)if(!a(r,h[g]))return T(t,r,n,o,v.different);for(var b=!0,_=y;0!=_--;){var E=h[_];e(t[E],r[E],n,"".concat(o,".").concat(E))||(b=!1)}return T(t,r,n,o,b?v.deepEquals:v.different)}return T(t,r,n,o,v.different)}(e,t,n,r),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 C={};function P(e,t){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).shallow;if(e===t)return!1;if(!(void 0===r||r))return j(e,t);var n=e||C,a=t||C,i=Object.keys(d({},n,a));return o(i,function(e,t){var r=j(n[t],a[t],t);return r&&(e=[].concat(h(e),h(r))),e},[])}function L(e,t,r,n,o,a){return{propsDifferences:P(e,n),stateDifferences:P(t,o),hookDifferences:P(r,a,{shallow:!1})}}function H(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,f=e.nextProps,c=e.nextState,s=e.nextHook;return{Component:t,displayName:r,hookName:n,prevProps:o,prevState:a,prevHook:i,nextProps:f,nextState:c,nextHook:s,options:e.options,reason:L(o,a,i,f,c,s)}}function A(e,t,r){return!function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}(t,r)&&!(!e.whyDidYouRender&&!function(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}(t,r))}var I="function"==typeof Symbol&&Symbol.for?Symbol.for("react.memo"):60115;function Y(e,n,o,a,i){return n.$$typeof===I?function(e,n,o,a){function i(t){var r=o.useRef(),i=r.current;if(r.current=t,i){var f=H({Component:e,displayName:n,prevProps:i,nextProps:t,options:a});f.reason.propsDifferences&&f.reason.propsDifferences.length>0&&a.notifier(f)}return e.type(t)}var f=o.memo(i),c=t(e,Object.keys(f));return i.displayName=n,r(i,c),f.displayName=n,r(f,e),f}(n,o,a,i):n.prototype&&n.prototype.isReactComponent?function(e,t,n,o){class a extends e{constructor(t,r){var n;if(super(t,r),n=this,this.render&&!e.prototype.render){var o=this.render;this.render=function(){return a.prototype.render.apply(n),o()}}}render(){return this._prevProps&&o.notifier(H({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:o})),this._prevProps=this.props,this._prevState=this.state,super.render&&super.render()}}return a.displayName=t,r(a,e),a}(n,o,0,i):function(e,t,n,o){function a(r){var a=n.useRef(),i=a.current;if(a.current=r,i){var f=H({Component:e,displayName:t,prevProps:i,nextProps:r,options:o});f.reason.propsDifferences&&o.notifier(f)}return e(r)}return a.displayName=t,r(a,e),a}(n,o,a,i)}var U={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};export default function(t,r){var n,o=R(r),a=t.createElement,i=t.createFactory,f=new WeakMap;return t.createElement=function(e){for(var r=("function"==typeof e||e.$$typeof===I)&&A(e,S(e),o),n=arguments.length,i=new Array(n>1?n-1:0),c=1;c (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ (function (global, factory) { diff --git a/dist/no-classes-transpile/umd/whyDidYouRender.min.js b/dist/no-classes-transpile/umd/whyDidYouRender.min.js index 74871db..4f7d95a 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 3.0.0-beta.5 + * @welldone-software/why-did-you-render 3.0.0 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).whyDidYouRender=t()}(this,function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(t){for(var r=1;r-1};var ye=function(e,t){var r=this.__data__,n=fe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function de(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=bt},jt={};jt["[object Float32Array]"]=jt["[object Float64Array]"]=jt["[object Int8Array]"]=jt["[object Int16Array]"]=jt["[object Int32Array]"]=jt["[object Uint8Array]"]=jt["[object Uint8ClampedArray]"]=jt["[object Uint16Array]"]=jt["[object Uint32Array]"]=!0,jt["[object Arguments]"]=jt["[object Array]"]=jt["[object ArrayBuffer]"]=jt["[object Boolean]"]=jt["[object DataView]"]=jt["[object Date]"]=jt["[object Error]"]=jt["[object Function]"]=jt["[object Map]"]=jt["[object Number]"]=jt["[object Object]"]=jt["[object RegExp]"]=jt["[object Set]"]=jt["[object String]"]=jt["[object WeakMap]"]=!1;var _t=function(e){return O(e)&>(e.length)&&!!jt[m(e)]};var mt=function(e){return function(t){return e(t)}},Ot=i(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&c.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}),wt=Ot&&Ot.isTypedArray,St=wt?mt(wt):_t,Et=Object.prototype.hasOwnProperty;var xt=function(e,t){var r=o(e),n=!r&<(e),a=!r&&!n&&vt(e),i=!r&&!n&&!a&&St(e),c=r||n||a||i,u=c?at(e.length,String):[],f=u.length;for(var s in e)!t&&!Et.call(e,s)||c&&("length"==s||a&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ht(s,f))||u.push(s);return u},At=Object.prototype;var Dt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||At)};var kt=function(e,t){return function(r){return e(t(r))}},Pt=kt(Object.keys,Object),Rt=Object.prototype.hasOwnProperty;var Nt=function(e){if(!Dt(e))return Pt(e);var t=[];for(var r in Object(e))Rt.call(e,r)&&"constructor"!=r&&t.push(r);return t};var Tt=function(e){return null!=e&>(e.length)&&!C(e)};var Ct=function(e){return Tt(e)?xt(e):Nt(e)};var It=function(e,t){return e&&ot(t,Ct(t),e)};var zt=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},Lt=Object.prototype.hasOwnProperty;var Ut=function(e){if(!D(e))return zt(e);var t=Dt(e),r=[];for(var n in e)("constructor"!=n||!t&&Lt.call(e,n))&&r.push(n);return r};var Ft=function(e){return Tt(e)?xt(e,!0):Ut(e)};var Mt=function(e,t){return e&&ot(t,Ft(t),e)},Bt=i(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?f.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}});var $t=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++ro?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++n0&&n(u)?r>1?e(u,r-1,n,o,a):Jt(a,u):o||(a[a.length]=u)}return a};var xn=function(e){return null!=e&&e.length?En(e,1):[]};var An=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},Dn=Math.max;var kn=function(e,t,r){return t=Dn(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=Dn(n.length-t,0),i=Array(a);++o0){if(++t>=Tn)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Nn);var Ln=function(e){return zn(kn(e,void 0,xn),e+"")}(function(e,t){var r={};if(null==e)return r;var n=!1;t=Ce(t,function(t){return t=Me(t,e),n||(n=t.length>1),t}),ot(e,tr(e),r),n&&(r=sn(r,7,On));for(var o=t.length;o--;)yn(r,t[o]);return r});var Un=function(e,t){return zn(kn(e,t,Rn),e+"")};var Fn,Mn=function(e,t,r){if(!D(r))return!1;var n=typeof t;return!!("number"==n?Tt(r)&&ht(t,r.length):"string"==n&&t in r)&&ue(r[t],e)},Bn=Object.prototype,$n=Bn.hasOwnProperty,Vn=Un(function(e,t){e=Object(e);var r=-1,n=t.length,o=n>2?t[2]:void 0;for(o&&Mn(t[0],t[1],o)&&(n=1);++r0?(f.consoleLog(e({},n,r),"".concat(a," of ").concat(i," changes:")),c.forEach(function(t){var r=t.pathString,n=t.diffType,a=t.prevValue,c=t.nextValue;f.consoleGroup("%c".concat("hook"===i?"hook ".concat(o," "):"".concat(i,"."),"%c").concat(r,"%c"),"color:".concat(f.diffNameColor,";"),"color:".concat(f.diffPathColor,";"),"color:default;"),f.consoleLog("".concat(qn[n]," (more info at ").concat(o?Wn:Yn,")")),f.consoleLog(e({},"prev ".concat(r),a),"!==",e({},"next ".concat(r),c)),f.consoleGroupEnd()})):c&&(f.consoleLog(e({},n,r),"".concat(a," the ").concat(i," object itself changed but it's values are all equal."),"props"===i?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(Yn)),f.consoleLog("prev ".concat(i,":"),u.prev," !== ",u.next,":next ".concat(i)))}function Kn(t){var r=t.Component,n=t.displayName,o=t.hookName,a=t.prevProps,i=t.prevState,c=t.prevHook,u=t.nextProps,f=t.nextState,s=t.nextHook,l=t.reason,p=t.options;if(function(e,t,r){return!(Gn||!r.logOnDifferentValues&&(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)&&(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===Hn.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===Hn.different})||e.hookDifferences&&e.hookDifferences.some(function(e){return e.diffType===Hn.different})))}(l,r,p)){p.consoleGroup("%c".concat(n),"color: ".concat(p.titleColor,";"));var v="Re-rendered because";l.propsDifferences&&(Jn({Component:r,displayName:n,prefixMessage:v,diffObjType:"props",differences:l.propsDifferences,values:{prev:a,next:u},options:p}),v="And because"),l.stateDifferences&&Jn({Component:r,displayName:n,prefixMessage:v,diffObjType:"state",differences:l.stateDifferences,values:{prev:i,next:f},options:p}),l.hookDifferences&&Jn({Component:r,displayName:n,prefixMessage:v,diffObjType:"hook",differences:l.hookDifferences,values:{prev:c,next:s},hookName:o,options:p}),l.propsDifferences||l.stateDifferences||l.hookDifferences||p.consoleLog(e({},n,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(Yn)),p.consoleGroupEnd()}}var Qn=function(){};function Xn(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=console.group,o=console.groupEnd;return r.collapseGroups?n=console.groupCollapsed:r.onlyLogs&&(n=console.log,o=Qn),t({include:null,exclude:null,notifier:r.notifier||((e=r.hasOwnProperty("hotReloadBufferMs")?r.hotReloadBufferMs:500)&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(Gn=!0,setTimeout(function(){Gn=!1},e))}),Kn),onlyLogs:!1,consoleLog:console.log,consoleGroup:n,consoleGroupEnd:o,logOnDifferentValues:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red"},r)}var Zn="[object String]";var eo=function(e){return"string"==typeof e||!o(e)&&O(e)&&m(e)==Zn};function to(e){return e.displayName||e.name||e.type&&to(e.type)||(eo(e)?e:void 0)}var ro=function(e,t,r,n){var o=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++o]);++oc))return!1;var f=a.get(e);if(f&&a.get(t))return f==t;var s=-1,l=!0,p=r&vo?new fo:void 0;for(a.set(e,t),a.set(t,e);++s3&&void 0!==arguments[3]?arguments[3]:"";if(t===r)return!0;if(!t||!r)return wa(t,r,n,a,Hn.different);if(o(t)&&o(r)){var i=t.length;if(i!==r.length)return wa(t,r,n,a,Hn.different);for(var c=!0,u=i;0!=u--;)e(t[u],r[u],n,"".concat(a,"[").concat(u,"]"))||(c=!1);return wa(t,r,n,a,c?Hn.deepEquals:Hn.different)}if(ja(t)&&ja(r))return t.getTime()===r.getTime()?wa(t,r,n,a,Hn.date):wa(t,r,n,a,Hn.different);if(da(t)&&da(r))return t.toString()===r.toString()?wa(t,r,n,a,Hn.regex):wa(t,r,n,a,Hn.different);if(_a&&t instanceof Element&&r instanceof Element)return wa(t,r,n,a,Hn.different);if(Oa(t)&&Oa(r))return t.type===r.type?wa(t,r,n,a,Hn.reactElement):wa(t,r,n,a,Hn.different);if(C(t)&&C(r))return t.name===r.name?wa(t,r,n,a,Hn.function):wa(t,r,n,a,Hn.different);if(mn(t)&&mn(r)){var f=Ct(t),s=f.length;if(s!==Ct(r).length)return wa(t,r,n,a,Hn.different);for(var l=s;0!=l--;)if(!la(r,f[l]))return wa(t,r,n,a,Hn.different);for(var p=!0,v=s;0!=v--;){var y=f[v];e(t[y],r[y],n,"".concat(a,".").concat(y))||(p=!1)}return wa(t,r,n,a,p?Hn.deepEquals:Hn.different)}return wa(t,r,n,a,Hn.different)}(e,t,n,r),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 Ea={};function xa(e,r){var o=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).shallow;if(e===r)return!1;if(!(void 0===o||o))return Sa(e,r);var a=e||Ea,i=r||Ea,c=Object.keys(t({},a,i));return ua(c,function(e,t){var r=Sa(a[t],i[t],t);return r&&(e=[].concat(n(e),n(r))),e},[])}function Aa(e,t,r,n,o,a){return{propsDifferences:xa(e,n),stateDifferences:xa(t,o),hookDifferences:xa(r,a,{shallow:!1})}}function Da(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,i=e.prevHook,c=e.nextProps,u=e.nextState,f=e.nextHook;return{Component:t,displayName:r,hookName:n,prevProps:o,prevState:a,prevHook:i,nextProps:c,nextState:u,nextHook:f,options:e.options,reason:Aa(o,a,i,c,u,f)}}function ka(e,t,r){return!function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}(t,r)&&!(!e.whyDidYouRender&&!function(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}(t,r))}var Pa="function"==typeof Symbol&&Symbol.for?Symbol.for("react.memo"):60115;function Ra(e,t,r,n,o){return t.$$typeof===Pa?function(e,t,r,n){function o(o){var a=r.useRef(),i=a.current;if(a.current=o,i){var c=Da({Component:e,displayName:t,prevProps:i,nextProps:o,options:n});c.reason.propsDifferences&&c.reason.propsDifferences.length>0&&n.notifier(c)}return e.type(o)}var a=r.memo(o),i=Ln(e,Object.keys(a));return o.displayName=t,Vn(o,i),a.displayName=t,Vn(a,e),a}(t,r,n,o):t.prototype&&t.prototype.isReactComponent?function(e,t,r,n){class o extends e{constructor(t,r){var n;if(super(t,r),n=this,this.render&&!e.prototype.render){var a=this.render;this.render=function(){return o.prototype.render.apply(n),a()}}}render(){return this._prevProps&&n.notifier(Da({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:n})),this._prevProps=this.props,this._prevState=this.state,super.render&&super.render()}}return o.displayName=t,Vn(o,e),o}(t,r,0,o):function(e,t,r,n){function o(o){var a=r.useRef(),i=a.current;if(a.current=o,i){var c=Da({Component:e,displayName:t,prevProps:i,nextProps:o,options:n});c.reason.propsDifferences&&n.notifier(c)}return e(o)}return o.displayName=t,Vn(o,e),o}(t,r,n,o)}var Na={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};return function(e,n){var o,a=Xn(n),i=e.createElement,c=e.createFactory,u=new WeakMap;return e.createElement=function(t){for(var r=("function"==typeof t||t.$$typeof===Pa)&&ka(t,to(t),a),n=arguments.length,o=new Array(n>1?n-1:0),c=1;c (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ (function (global, factory) { diff --git a/dist/umd/whyDidYouRender.min.js b/dist/umd/whyDidYouRender.min.js index af8a683..67bda81 100644 --- a/dist/umd/whyDidYouRender.min.js +++ b/dist/umd/whyDidYouRender.min.js @@ -1,8 +1,8 @@ /** - * @welldone-software/why-did-you-render 3.0.0-beta.5 + * @welldone-software/why-did-you-render 3.0.0 * MIT Licensed * Generated by Vitali Zaidman (https://github.com/vzaidman) - * Generated at 2019-04-02 + * Generated at 2019-04-05 */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).whyDidYouRender=t()}(this,function(){"use strict";function e(e,t){for(var r=0;r-1};var je=function(e,t){var r=this.__data__,n=ye(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function _e(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=Ot},Et={};Et["[object Float32Array]"]=Et["[object Float64Array]"]=Et["[object Int8Array]"]=Et["[object Int16Array]"]=Et["[object Int32Array]"]=Et["[object Uint8Array]"]=Et["[object Uint8ClampedArray]"]=Et["[object Uint16Array]"]=Et["[object Uint32Array]"]=!0,Et["[object Arguments]"]=Et["[object Array]"]=Et["[object ArrayBuffer]"]=Et["[object Boolean]"]=Et["[object DataView]"]=Et["[object Date]"]=Et["[object Error]"]=Et["[object Function]"]=Et["[object Map]"]=Et["[object Number]"]=Et["[object Object]"]=Et["[object RegExp]"]=Et["[object Set]"]=Et["[object String]"]=Et["[object WeakMap]"]=!1;var St=function(e){return A(e)&&wt(e.length)&&!!Et[x(e)]};var xt=function(e){return function(t){return e(t)}},At=l(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&p.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}),Dt=At&&At.isTypedArray,Pt=Dt?xt(Dt):St,kt=Object.prototype.hasOwnProperty;var Rt=function(e,t){var r=f(e),n=!r&&dt(e),o=!r&&!n&>(e),a=!r&&!n&&!o&&Pt(e),c=r||n||o||a,i=c?st(e.length,String):[],u=i.length;for(var s in e)!t&&!kt.call(e,s)||c&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||mt(s,u))||i.push(s);return i},Nt=Object.prototype;var Tt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Nt)};var Ct=function(e,t){return function(r){return e(t(r))}},It=Ct(Object.keys,Object),zt=Object.prototype.hasOwnProperty;var Lt=function(e){if(!Tt(e))return It(e);var t=[];for(var r in Object(e))zt.call(e,r)&&"constructor"!=r&&t.push(r);return t};var Ut=function(e){return null!=e&&wt(e.length)&&!F(e)};var Ft=function(e){return Ut(e)?Rt(e):Lt(e)};var Mt=function(e,t){return e&&ft(t,Ft(t),e)};var Bt=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},$t=Object.prototype.hasOwnProperty;var Vt=function(e){if(!T(e))return Bt(e);var t=Tt(e),r=[];for(var n in e)("constructor"!=n||!t&&$t.call(e,n))&&r.push(n);return r};var Ht=function(e){return Ut(e)?Rt(e,!0):Vt(e)};var Yt=function(e,t){return e&&ft(t,Ht(t),e)},Wt=l(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?y.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}});var qt=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++ro?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++n0&&n(u)?r>1?e(u,r-1,n,o,a):er(a,u):o||(a[a.length]=u)}return a};var Rn=function(e){return null!=e&&e.length?kn(e,1):[]};var Nn=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},Tn=Math.max;var Cn=function(e,t,r){return t=Tn(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=Tn(n.length-t,0),c=Array(a);++o0){if(++t>=Un)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Ln);var $n=function(e){return Bn(Cn(e,void 0,Rn),e+"")}(function(e,t){var r={};if(null==e)return r;var n=!1;t=Fe(t,function(t){return t=Ye(t,e),n||(n=t.length>1),t}),ft(e,cr(e),r),n&&(r=hn(r,7,An));for(var o=t.length;o--;)jn(r,t[o]);return r});var Vn=function(e,t){return Bn(Cn(e,t,zn),e+"")};var Hn,Yn=function(e,t,r){if(!T(r))return!1;var n=typeof t;return!!("number"==n?Ut(r)&&mt(t,r.length):"string"==n&&t in r)&&ve(r[t],e)},Wn=Object.prototype,qn=Wn.hasOwnProperty,Gn=Vn(function(e,t){e=Object(e);var r=-1,n=t.length,o=n>2?t[2]:void 0;for(o&&Yn(t[0],t[1],o)&&(n=1);++r0?(f.consoleLog(t({},n,r),"".concat(a," of ").concat(c," changes:")),i.forEach(function(e){var r=e.pathString,n=e.diffType,a=e.prevValue,i=e.nextValue;f.consoleGroup("%c".concat("hook"===c?"hook ".concat(o," "):"".concat(c,"."),"%c").concat(r,"%c"),"color:".concat(f.diffNameColor,";"),"color:".concat(f.diffPathColor,";"),"color:default;"),f.consoleLog("".concat(Xn[n]," (more info at ").concat(o?Qn:Kn,")")),f.consoleLog(t({},"prev ".concat(r),a),"!==",t({},"next ".concat(r),i)),f.consoleGroupEnd()})):i&&(f.consoleLog(t({},n,r),"".concat(a," the ").concat(c," object itself changed but it's values are all equal."),"props"===c?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(Kn)),f.consoleLog("prev ".concat(c,":"),u.prev," !== ",u.next,":next ".concat(c)))}function to(e){var r=e.Component,n=e.displayName,o=e.hookName,a=e.prevProps,c=e.prevState,i=e.prevHook,u=e.nextProps,f=e.nextState,s=e.nextHook,l=e.reason,p=e.options;if(function(e,t,r){return!(Zn||!r.logOnDifferentValues&&(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)&&(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===Jn.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===Jn.different})||e.hookDifferences&&e.hookDifferences.some(function(e){return e.diffType===Jn.different})))}(l,r,p)){p.consoleGroup("%c".concat(n),"color: ".concat(p.titleColor,";"));var v="Re-rendered because";l.propsDifferences&&(eo({Component:r,displayName:n,prefixMessage:v,diffObjType:"props",differences:l.propsDifferences,values:{prev:a,next:u},options:p}),v="And because"),l.stateDifferences&&eo({Component:r,displayName:n,prefixMessage:v,diffObjType:"state",differences:l.stateDifferences,values:{prev:c,next:f},options:p}),l.hookDifferences&&eo({Component:r,displayName:n,prefixMessage:v,diffObjType:"hook",differences:l.hookDifferences,values:{prev:i,next:s},hookName:o,options:p}),l.propsDifferences||l.stateDifferences||l.hookDifferences||p.consoleLog(t({},n,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(Kn)),p.consoleGroupEnd()}}var ro=function(){};function no(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=console.group,o=console.groupEnd;return t.collapseGroups?n=console.groupCollapsed:t.onlyLogs&&(n=console.log,o=ro),r({include:null,exclude:null,notifier:t.notifier||((e=t.hasOwnProperty("hotReloadBufferMs")?t.hotReloadBufferMs:500)&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(Zn=!0,setTimeout(function(){Zn=!1},e))}),to),onlyLogs:!1,consoleLog:console.log,consoleGroup:n,consoleGroupEnd:o,logOnDifferentValues:!1,trackHooks:!0,titleColor:"#058",diffNameColor:"blue",diffPathColor:"red"},t)}var oo="[object String]";var ao=function(e){return"string"==typeof e||!f(e)&&A(e)&&x(e)==oo};function co(e){return e.displayName||e.name||e.type&&co(e.type)||(ao(e)?e:void 0)}var io=function(e,t,r,n){var o=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++o]);++oi))return!1;var f=a.get(e);if(f&&a.get(t))return f==t;var s=-1,l=!0,p=r&jo?new yo:void 0;for(a.set(e,t),a.set(t,e);++s3&&void 0!==arguments[3]?arguments[3]:"";if(t===r)return!0;if(!t||!r)return Da(t,r,n,o,Jn.different);if(f(t)&&f(r)){var a=t.length;if(a!==r.length)return Da(t,r,n,o,Jn.different);for(var c=!0,i=a;0!=i--;)e(t[i],r[i],n,"".concat(o,"[").concat(i,"]"))||(c=!1);return Da(t,r,n,o,c?Jn.deepEquals:Jn.different)}if(Ea(t)&&Ea(r))return t.getTime()===r.getTime()?Da(t,r,n,o,Jn.date):Da(t,r,n,o,Jn.different);if(_a(t)&&_a(r))return t.toString()===r.toString()?Da(t,r,n,o,Jn.regex):Da(t,r,n,o,Jn.different);if(Sa&&t instanceof Element&&r instanceof Element)return Da(t,r,n,o,Jn.different);if(Aa(t)&&Aa(r))return t.type===r.type?Da(t,r,n,o,Jn.reactElement):Da(t,r,n,o,Jn.different);if(F(t)&&F(r))return t.name===r.name?Da(t,r,n,o,Jn.function):Da(t,r,n,o,Jn.different);if(xn(t)&&xn(r)){var u=Ft(t),s=u.length;if(s!==Ft(r).length)return Da(t,r,n,o,Jn.different);for(var l=s;0!=l--;)if(!da(r,u[l]))return Da(t,r,n,o,Jn.different);for(var p=!0,v=s;0!=v--;){var y=u[v];e(t[y],r[y],n,"".concat(o,".").concat(y))||(p=!1)}return Da(t,r,n,o,p?Jn.deepEquals:Jn.different)}return Da(t,r,n,o,Jn.different)}(e,t,n,r),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 ka={};function Ra(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).shallow;if(e===t)return!1;if(!(void 0===n||n))return Pa(e,t);var o=e||ka,a=t||ka,c=Object.keys(r({},o,a));return va(c,function(e,t){var r=Pa(o[t],a[t],t);return r&&(e=[].concat(u(e),u(r))),e},[])}function Na(e,t,r,n,o,a){return{propsDifferences:Ra(e,n),stateDifferences:Ra(t,o),hookDifferences:Ra(r,a,{shallow:!1})}}function Ta(e){var t=e.Component,r=e.displayName,n=e.hookName,o=e.prevProps,a=e.prevState,c=e.prevHook,i=e.nextProps,u=e.nextState,f=e.nextHook;return{Component:t,displayName:r,hookName:n,prevProps:o,prevState:a,prevHook:c,nextProps:i,nextState:u,nextHook:f,options:e.options,reason:Na(o,a,c,i,u,f)}}function Ca(e,t,r){return!function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}(t,r)&&!(!e.whyDidYouRender&&!function(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}(t,r))}var Ia="function"==typeof Symbol&&Symbol.for?Symbol.for("react.memo"):60115;function za(t,r,i,u){var f=function(i){function f(e,r){var o,c,i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),c=this,i=n(f).call(this,e,r),(o=!i||"object"!=typeof i&&"function"!=typeof i?a(c):i).render&&!t.prototype.render){var u=o.render;o.render=function(){return f.prototype.render.apply(a(o)),u()}}return o}var s,l,p;return 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&&o(e,t)}(f,t),s=f,(l=[{key:"render",value:function(){return this._prevProps&&u.notifier(Ta({Component:t,displayName:r,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:u})),this._prevProps=this.props,this._prevState=this.state,c(n(f.prototype),"render",this)&&c(n(f.prototype),"render",this).call(this)}}])&&e(s.prototype,l),p&&e(s,p),f}();return f.displayName=r,Gn(f,t),f}function La(e,t,r,n,o){return t.$$typeof===Ia?function(e,t,r,n){function o(o){var a=r.useRef(),c=a.current;if(a.current=o,c){var i=Ta({Component:e,displayName:t,prevProps:c,nextProps:o,options:n});i.reason.propsDifferences&&i.reason.propsDifferences.length>0&&n.notifier(i)}return e.type(o)}var a=r.memo(o),c=$n(e,Object.keys(a));return o.displayName=t,Gn(o,c),a.displayName=t,Gn(a,e),a}(t,r,n,o):t.prototype&&t.prototype.isReactComponent?za(t,r,0,o):function(e,t,r,n){function o(o){var a=r.useRef(),c=a.current;if(a.current=o,c){var i=Ta({Component:e,displayName:t,prevProps:c,nextProps:o,options:n});i.reason.propsDifferences&&n.notifier(i)}return e(o)}return o.displayName=t,Gn(o,e),o}(t,r,n,o)}var Ua={useState:{path:"0"},useReducer:{path:"0"},useContext:!0,useMemo:!0};return function(e,t){var n,o=no(t),a=e.createElement,c=e.createFactory,u=new WeakMap;return e.createElement=function(t){for(var r=("function"==typeof t||t.$$typeof===Ia)&&Ca(t,co(t),o),n=arguments.length,c=new Array(n>1?n-1:0),i=1;i