Browse Source

Add whyDidYouRender lib

develop
Apostolos Fanakis 4 years ago
parent
commit
cd20a7eefa
  1. 1
      packages/concordia-app/package.json
  2. 1
      packages/concordia-app/src/index.jsx
  3. 13
      packages/concordia-app/src/utils/wdyr.js
  4. 9
      yarn.lock

1
packages/concordia-app/package.json

@ -27,6 +27,7 @@
"@ezerous/breeze": "~0.3.0",
"@ezerous/drizzle": "~0.4.0",
"@reduxjs/toolkit": "~1.4.0",
"@welldone-software/why-did-you-render": "^6.0.0-rc.1",
"concordia-contracts": "~0.1.0",
"i18next": "^19.8.3",
"i18next-browser-languagedetector": "^6.0.1",

1
packages/concordia-app/src/index.jsx

@ -1,3 +1,4 @@
import './utils/wdyr';
import React, { Suspense } from 'react';
import { render } from 'react-dom';
import { Drizzle } from '@ezerous/drizzle';

13
packages/concordia-app/src/utils/wdyr.js

@ -0,0 +1,13 @@
import React from 'react';
import whyDidYouRender from '@welldone-software/why-did-you-render';
import * as ReactRedux from 'react-redux/lib';
if (process.env.NODE_ENV === 'development') {
whyDidYouRender(React, {
trackHooks: true,
trackExtraHooks: [
[ReactRedux, 'useSelector'],
],
trackAllPureComponents: true,
});
}

9
yarn.lock

@ -2685,6 +2685,13 @@
"@webassemblyjs/wast-parser" "1.8.5"
"@xtuc/long" "4.2.2"
"@welldone-software/why-did-you-render@^6.0.0-rc.1":
version "6.0.0-rc.1"
resolved "https://registry.yarnpkg.com/@welldone-software/why-did-you-render/-/why-did-you-render-6.0.0-rc.1.tgz#b0e92edb2e34e7af695cca1822844f02018d9814"
integrity sha512-qQe5w89tYnYtwRqlhdF33ivWjsQlGXkan5lFzNwpAoMEUFIbDuwvFiBUAbE76Lfz63GabSaf1vyuCusgJ7Rtqg==
dependencies:
lodash "^4"
"@xtuc/ieee754@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790"
@ -11378,7 +11385,7 @@ lodash.uniq@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
"lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.5:
"lodash@>=3.5 <5", lodash@^4, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.5:
version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==

Loading…
Cancel
Save