Skip to content

Commit

Permalink
chore: trying why did you render
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Burtey committed Feb 15, 2023
1 parent 58d710a commit 883e4f6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/graphql/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -443,4 +443,5 @@ const LanguageSync = () => {
return <></>
}

GaloyClient.whyDidYouRender = true
export { GaloyClient }
12 changes: 12 additions & 0 deletions app/wdyr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// importing why-did-you-render types
// eslint-disable-next-line
/// <reference types="@welldone-software/why-did-you-render" />

import React from "react"

if (process.env.NODE_ENV === "development") {
const whyDidYouRender = require("@welldone-software/why-did-you-render")
whyDidYouRender(React, {
trackAllPureComponents: false,
})
}
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
//
// It's easier just to leave it here.

import "./app/wdyr.ts"

import { AppRegistry } from "react-native"
import { App } from "./app/app.tsx"
import * as React from "react"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
"@wdio/local-runner": "^7.19.7",
"@wdio/mocha-framework": "^7.19.7",
"@wdio/spec-reporter": "^7.25.1",
"@welldone-software/why-did-you-render": "^7.0.1",
"babel-jest": "^29.4.1",
"babel-loader": "^9.1.2",
"babel-plugin-module-resolver": "^5.0.0",
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5391,6 +5391,13 @@
"@webassemblyjs/wast-parser" "1.9.0"
"@xtuc/long" "4.2.2"

"@welldone-software/why-did-you-render@^7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@welldone-software/why-did-you-render/-/why-did-you-render-7.0.1.tgz#09f487d84844bd8e66435843c2e0305702e61efb"
integrity sha512-Qe/8Xxa2G+LMdI6VoazescPzjjkHYduCDa8aHOJR50e9Bgs8ihkfMBY+ev7B4oc3N59Zm547Sgjf8h5y0FOyoA==
dependencies:
lodash "^4"

"@whatwg-node/events@0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@whatwg-node/events/-/events-0.0.2.tgz#7b7107268d2982fc7b7aff5ee6803c64018f84dd"
Expand Down Expand Up @@ -13637,7 +13644,7 @@ lodash.zip@^4.2.0:
resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020"
integrity sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==

lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@~4.17.0:
lodash@^4, lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@~4.17.0:
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 883e4f6

Please sign in to comment.