Skip to content

v2.0.0

Compare
Choose a tag to compare
@Oblosys Oblosys released this 20 Jun 16:56
· 110 commits to master since this release

Instead of modifying the traced component and magically adding new properties to it, the traced component is now more conventionally wrapped by a TracingComponent, and trace and LifecyclePanel are passed as props (underwater the component still needs to be modified to intercept the lifecycle methods though). This gives more control over the constructor, and makes for a more consistent interface. It also makes it much easier to type traceLifecycle, and TypeScript definitions are now included with the package.

Changes

  • Traced components are wrapped by a TracingComponent, which removes the requirement of passing context to super when using an explicit constructor (issue #1)
  • trace and LifecyclePanel are passed as props
  • TypeScript type definitions are included with the package
  • Layout is a little prettier, especially on Windows
  • Enzyme tests have been added

Breaking change

  • Because trace can now be accessed as nextProps.trace in the static getDerivedStateFromProps, it is no longer added to the prevState parameter

Deprecated

  • this.trace (replaced by this.props.trace)
  • this.LifecyclePanel (replaced by this.props.LifecyclePanel)
  • clearInstanceIdCounters (replaced by more appropriately named resetInstanceIdCounters)

The deprecated versions will continue to work in version 2.x, but generate a warning on the console.