Skip to content

Commit

Permalink
feat: added why did you render
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaquinBattilana committed Dec 16, 2024
1 parent 94c61a6 commit f94bc1c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"@types/react": "latest",
"@types/react-infinite-scroller": "^1.2.3",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@welldone-software/why-did-you-render": "^8.0.3",
"axios": "^1.6.2",
"babel-plugin-macros": "^3.1.0",
"cypress": "10.9.0",
Expand Down
18 changes: 17 additions & 1 deletion pages/_app.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { NextPage } from 'next';
import { AppProps } from 'next/app';
import dynamic from 'next/dynamic';
import Head from 'next/head';
import { ReactNode, useEffect, useState } from 'react';
import React, { ReactNode, useEffect, useState } from 'react';
import { AddressBlocked } from 'src/components/AddressBlocked';
import { Meta } from 'src/components/Meta';
import { TransactionEventHandler } from 'src/components/TransactionEventHandler';
Expand All @@ -27,6 +27,22 @@ import createEmotionCache from '../src/createEmotionCache';
import { AppGlobalStyles } from '../src/layouts/AppGlobalStyles';
import { LanguageProvider } from '../src/libs/LanguageProvider';

if (process.env.NODE_ENV === 'development') {
if (typeof window !== 'undefined') {
// eslint-disable-next-line @typescript-eslint/no-var-requires
//const whyDidYouRender = require('@welldone-software/why-did-you-render');
import('@welldone-software/why-did-you-render').then((module) => {
module.default(React, {
trackAllPureComponents: true,
});
});
// console.log(whyDidYouRender);
// whyDidYouRender(React, {
// trackAllPureComponents: true
// });
}
}

const SwitchModal = dynamic(() =>
import('src/components/transactions/Switch/SwitchModal').then((module) => module.SwitchModal)
);
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en/messages.js

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1051,10 +1051,6 @@ msgstr "Enter a valid address"
msgid "Enter an amount"
msgstr "Enter an amount"

#: src/components/WalletConnection/ReadOnlyModal.tsx
msgid "Error connecting. Try refreshing the page."
msgstr "Error connecting. Try refreshing the page."

#: src/components/incentives/GhoIncentivesCard.tsx
msgid "Estimated compounding interest, including discount for Staking {0}AAVE in Safety Module."
msgstr "Estimated compounding interest, including discount for Staking {0}AAVE in Safety Module."
Expand Down Expand Up @@ -1635,10 +1631,6 @@ msgstr "Net APY is the combined effect of all supply and borrow positions on net
msgid "Net worth"
msgstr "Net worth"

#: src/components/WalletConnection/ReadOnlyModal.tsx
msgid "Network not supported for this wallet"
msgstr "Network not supported for this wallet"

#: src/modules/migration/MigrationBottomPanel.tsx
msgid "No assets selected to migrate."
msgstr "No assets selected to migrate."
Expand Down Expand Up @@ -1922,10 +1914,6 @@ msgstr "Recent Transactions"
msgid "Recipient address"
msgstr "Recipient address"

#: src/components/WalletConnection/ReadOnlyModal.tsx
msgid "Rejected connection request"
msgstr "Rejected connection request"

#: src/modules/reserve-overview/graphs/ApyGraphContainer.tsx
msgid "Reload"
msgstr "Reload"
Expand Down Expand Up @@ -2979,10 +2967,6 @@ msgstr "Wallet Balance"
msgid "Wallet balance"
msgstr "Wallet balance"

#: src/components/WalletConnection/ReadOnlyModal.tsx
msgid "Wallet not detected. Connect or install wallet and retry"
msgstr "Wallet not detected. Connect or install wallet and retry"

#: src/components/WalletConnection/ReadOnlyModal.tsx
msgid "Watch a wallet balance in read-only mode"
msgstr "Watch a wallet balance in read-only mode"
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4299,6 +4299,13 @@
"@walletconnect/window-getters" "^1.0.1"
tslib "1.14.1"

"@welldone-software/why-did-you-render@^8.0.3":
version "8.0.3"
resolved "https://registry.yarnpkg.com/@welldone-software/why-did-you-render/-/why-did-you-render-8.0.3.tgz#3a90c12a2236834478a8a48900110fc9166dc903"
integrity sha512-bb5bKPMStYnocyTBVBu4UTegZdBqzV1mPhxc0UIV/S43KFUSRflux9gvzJfu2aM4EWLJ3egTvdjOi+viK+LKGA==
dependencies:
lodash "^4"

"@xstate/fsm@^1.4.0":
version "1.6.5"
resolved "https://registry.yarnpkg.com/@xstate/fsm/-/fsm-1.6.5.tgz#f599e301997ad7e3c572a0b1ff0696898081bea5"
Expand Down Expand Up @@ -8949,7 +8956,7 @@ lodash.upperfirst@^4.3.1:
resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce"
integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==

lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21:
lodash@^4, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down

0 comments on commit f94bc1c

Please sign in to comment.