Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit af18bd6

Browse files
Add 'why did you rerender?' dev tooling
1 parent 99ad1df commit af18bd6

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

packages/builder/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"dependencies": {
1212
"@fortawesome/fontawesome-free": "^5.11.2",
1313
"@sentry/browser": "^5.15.4",
14+
"@welldone-software/why-did-you-render": "^4.2.7",
1415
"attr-accept": "^2.0.0",
1516
"bootstrap": "^4.4.1",
1617
"classnames": "^2.2.6",

packages/builder/src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React from 'react'
22
import ReactDOM from 'react-dom'
33

4+
// Why did you (re)render?
5+
import './wdyr.js'
6+
47
// React-redux integration
58
import { Provider as ReduxProvider } from 'react-redux'
69
import configureStore from './store'

packages/builder/src/wdyr.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react'
2+
3+
if (process.env.NODE_ENV === 'development') {
4+
const whyDidYouRender = require('@welldone-software/why-did-you-render')
5+
//const ReactRedux = require('react-redux')
6+
whyDidYouRender(React, {
7+
trackAllPureComponents: true,
8+
trackExtraHooks: [
9+
//[ReactRedux, "useSelector"],
10+
]
11+
})
12+
}

yarn.lock

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3363,6 +3363,13 @@
33633363
"@webassemblyjs/wast-parser" "1.8.5"
33643364
"@xtuc/long" "4.2.2"
33653365

3366+
"@welldone-software/why-did-you-render@^4.2.7":
3367+
version "4.2.7"
3368+
resolved "https://registry.yarnpkg.com/@welldone-software/why-did-you-render/-/why-did-you-render-4.2.7.tgz#7731bc42ef44e146be3c39f026bc4826dd4e5699"
3369+
integrity sha512-La1INHiFnHi9USYGAaRsPhMXMOt2x3qee8cXxRija0h3tQJY1/XmSSelyXDMQkVtDDa61DMfk3H59gxWDmnqsA==
3370+
dependencies:
3371+
lodash "^4"
3372+
33663373
"@xtuc/ieee754@^1.2.0":
33673374
version "1.2.0"
33683375
resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790"
@@ -11090,7 +11097,7 @@ [email protected]:
1109011097
version "4.17.11"
1109111098
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
1109211099

11093-
"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.13.1, lodash@^4.17.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.8.0, lodash@~4.17.10, lodash@~4.17.11:
11100+
"lodash@>=3.5 <5", lodash@^4, lodash@^4.0.0, lodash@^4.13.1, lodash@^4.17.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.8.0, lodash@~4.17.10, lodash@~4.17.11:
1109411101
version "4.17.19"
1109511102
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
1109611103
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
@@ -16630,12 +16637,7 @@ [email protected], ts-pnp@^1.1.6:
1663016637
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.1.6.tgz#389a24396d425a0d3162e96d2b4638900fdc289a"
1663116638
integrity sha512-CrG5GqAAzMT7144Cl+UIFP7mz/iIhiy+xQ6GGcnjTezhALT02uPMRw7tgDSESgB5MsfKt55+GPWw4ir1kVtMIQ==
1663216639

16633-
tslib@^1.10.0, tslib@^1.9.0:
16634-
version "1.11.0"
16635-
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.0.tgz#f1f3528301621a53220d58373ae510ff747a66bc"
16636-
integrity sha512-BmndXUtiTn/VDDrJzQE7Mm22Ix3PxgLltW9bSNLoeCY31gnG2OPx0QqJnuc9oMIKioYrz487i6K9o4Pdn0j+Kg==
16637-
16638-
tslib@^1.10.0:
16640+
tslib@^1.10.0, tslib@^1.9.3:
1663916641
version "1.11.1"
1664016642
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
1664116643
integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==
@@ -16644,10 +16646,10 @@ tslib@^1.8.1:
1664416646
version "1.9.3"
1664516647
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
1664616648

16647-
tslib@^1.9.3:
16648-
version "1.11.1"
16649-
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
16650-
integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==
16649+
tslib@^1.9.0:
16650+
version "1.11.0"
16651+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.0.tgz#f1f3528301621a53220d58373ae510ff747a66bc"
16652+
integrity sha512-BmndXUtiTn/VDDrJzQE7Mm22Ix3PxgLltW9bSNLoeCY31gnG2OPx0QqJnuc9oMIKioYrz487i6K9o4Pdn0j+Kg==
1665116653

1665216654
tsutils@^3.17.1:
1665316655
version "3.17.1"

0 commit comments

Comments
 (0)