Skip to content

Commit

Permalink
feat: remove why did you render from production build
Browse files Browse the repository at this point in the history
* chore: update @welldone-software/why-did-you-render package

* feat: include why did you render package only in dev build

* chore: add changeset file
  • Loading branch information
MieszkoTSH authored Apr 18, 2024
1 parent bac05e6 commit 837ede0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-mayflies-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-starter-boilerplate": patch
---

exclude whyDidYouRender from production bundle
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@typescript-eslint/parser": "6.6.0",
"@vitejs/plugin-react-swc": "3.3.2",
"@vitest/coverage-v8": "0.34.4",
"@welldone-software/why-did-you-render": "7.0.1",
"@welldone-software/why-did-you-render": "8.0.1",
"babelsheet2": "0.0.12",
"babelsheet2-json-writer": "0.0.4",
"babelsheet2-reader": "0.0.6",
Expand Down
3 changes: 2 additions & 1 deletion src/wdyr.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import whyDidYouRender from '@welldone-software/why-did-you-render';

if (import.meta.env.DEV) {
const { default: whyDidYouRender } = await import('@welldone-software/why-did-you-render');

whyDidYouRender(React, {
trackHooks: true,
trackAllPureComponents: true,
Expand Down

0 comments on commit 837ede0

Please sign in to comment.