why-did-you-render

why-did-you-render by Welldone Software monkey patches React to notify you about potentially avoidable re-renders. (Works with React Native as well.)

MIT License

Downloads
1.8M
Stars
10.8K
Committers
37

Bot releases are hidden (Show)

why-did-you-render - Minor update Latest Release

Published by vzaidman 4 months ago

  • Updated all packages, besides eslint (8->9) because it was a pretty big update. I might do it later.
  • Fix #286 - set defaultProps to undefined when it's not present in the original to not have the warning "Support for defaultProps will be removed from function components in a future major release" by @Hypnosphi. Thank you!
  • Readme updates by myself @vzaidman and @sergeylaptev. Thank you!
why-did-you-render -

Published by vzaidman 10 months ago

Breaking changes

  • Now only support React 18 since it differs quite a lot from previous versions when monkey patching. by @vzaidman
    • For older versions use @^7
  • Renamed the internal property that checks if React is monkey patched from React.isWDYR to React.__IS_WDYR__ by @vzaidman

Non-breaking changes

Docs updates

New Contributors

why-did-you-render - v8.0.0

Published by vzaidman 10 months ago

oops! please use v8.0.1 and above :)

why-did-you-render -

Published by vzaidman over 2 years ago

  • fixed the reference to React 18 in peerDependencies in package.json. Thank you @jussikinnula!
why-did-you-render - React 18

Published by vzaidman over 2 years ago

  • Added support to React 18! Thank you @jussikinnula!
  • Upgraded all packages
  • Improved race conditions in E2E tests that caused them to fail in the latest Chrome versions
    • It also made the tests clearer and faster
why-did-you-render - maintenance

Published by vzaidman almost 3 years ago

  • Update all packages
  • Fixed tests for new versions
  • Fixed eslint for new versions
  • Added some TS types. Thank you @bduff9.
  • Improved the readme
why-did-you-render -

Published by vzaidman about 3 years ago

  • Updated all packages
  • Adjusted nollup setup files to work with the latest version
  • Fixed TypeScript types for JSX runtime files. Thank you for pointing this one out @jafin!
why-did-you-render -

Published by vzaidman over 3 years ago

  • updated all packages
  • #203 - Add delegate parameter to allow for harvesting additional data from react element- an advanced feature by @ereddrex. Thank you!
why-did-you-render -

Published by vzaidman over 3 years ago

  • fixed #196 - added jsx-runtime types (Thank you @hrazmsft)
why-did-you-render -

Published by vzaidman over 3 years ago

why-did-you-render -

Published by vzaidman over 3 years ago

why-did-you-render -

Published by vzaidman over 3 years ago

  • Ignoring object getters because accessing them often errors and/or has side effects (fixing #184)
  • Updated all packages and improved the vscode development environment
why-did-you-render -

Published by vzaidman over 3 years ago

Now also tracks non-plain objects (like new User()).

Thank you @barakyosi!!

PR: https://github.com/welldone-software/why-did-you-render/pull/179
CLOSED ISSUE: https://github.com/welldone-software/why-did-you-render/issues/74

why-did-you-render -

Published by vzaidman almost 4 years ago

fixed the bug "RangeError: Maximum call stack size exceeded" (#168) by making sure WDYR is not applied more than once under any circumstances.

why-did-you-render -

Published by vzaidman almost 4 years ago

  • updated all packages, including security fixes
  • improved the code quality
    • updated test file imports
    • improved eslint rules
  • updated vscode settings files
    • added jest extension settings
    • added eslint autofix
  • improved the readme
why-did-you-render - React 17, Automatic JSX runtime transform

Published by vzaidman almost 4 years ago

Breaking Changes

  • No longer minimizes the library.
    • The minimization created too many inconveniences.
    • It should only be used in dev, and it's small anyway.

Other Changes

  • Added support to React 17.
  • Added support to the new jsx-runtime transform from babel.
    • By the way, this might be a very useful thing for the library in the future.
  • Added a mechanism to test both React 16 and React 17
why-did-you-render -

Published by vzaidman almost 4 years ago

why-did-you-render -

Published by vzaidman almost 4 years ago

why-did-you-render -

Published by vzaidman almost 4 years ago

Notice:

  • Support for React@17 is on it's way.

Breaking changes:

  • No longer tracks deep equals results in useMemo.
    • Added tests to children re-rendered as a result of useMemo or useCallback results:
      • logs if the different result got generated because of deep equals deps changes
        image
      • ignores the prop change if deps were different
  • No longer tracks re-renders as a result of useCallback invalidation due to deps changes (fixes #46)
    • This fix was brought to you by the one and only @Hypnosphi :)
  • Made logOwnerReasons true by default
  • Only build a minimized UMD version now and won't commit the built files to git anymore
  • Removed babel-plugin-lodash because lodash optimizations better are done by the user of the library
  • Removed building in babel-plugin-transform-classes because we build with a newer babel where it is not needed anymore

Enhancements:

  • Added a feature where upon request you can get a detailed diff between props.
    For example for the following:
        const sameObj = {a: {b: 'c'}}
        ReactDom.render(<Main containerProps={{style: {height: '100%'}, className: 'default-highchart', sameObj}} />, domElement)
        ReactDom.render(<Main containerProps={{style: {height: '100%'}, className: 'default-highchart', sameObj}} />, domElement)
    
    Since props are equal by value, you will see the following option that allows for the generation of a detailed diff report:
    image

Fixes

  • Only track hooks if they are supported

Readme

  • improved readme in general, including the installation tips

Dev

  • Added Travis pipelines that run lint, test, audit, and e2e tests for each PR.
  • Added a full e2e coverage using cypress that runs in the pipelines.
  • updated all dev packages
why-did-you-render -

Published by vzaidman about 4 years ago