Skip to content

v7.0.0

Latest
Compare
Choose a tag to compare
@coolsoftwaretyler coolsoftwaretyler released this 19 Nov 02:08
· 1 commit to master since this release
3c03bbb

Breaking Changes

  • Validate state tree instances instead of snapshots in the SnapshotProcessor.is override by @airhorns in #2182
  • Fix typings for snapshot processor by @thegedge in #2198
  • Improve typing of the union dispatcher function by @thegedge in #2203
  • Ensure actions/volatile state also throw when overriding props. by @thegedge in #2207
  • Fix tsconfig and typechecking by @thegedge in #2200

Features

  • Type create/validate to accept an instance type by @thegedge in #2199

Fixes

Tests

Migration

TypeScript

Most of the breaking changes in this release have to do with changes in TypeScript. So you may find that you have to make adjustments to how you're typing your models, although we hope most of these changes improve your TypeScript experience overall.

Validating Tree Instances instead of Snapshots

Introduced in #2182, when comparing for equality on whether a model .is something, we now look at the actual instance, rather than the snapshot itself. In the past, if you were expecting snapshot processors to make two different sides of an .is operation inequal, you may need to find a new way to emulate that behavior, or otherwise change your logic. We are going to take a stronger, more defined stance for when .is should evaluate to true.

This is a somewhat advanced use case, and most users should not have to make any changes.

New Error Behavior when Overriding Props

Introduced in #2207, we will now throw errors when actions and volatile state override prop names. This probably would have been a bug in your application code before, but MST will now explicitly throw when it detects this pattern. You can migrate by choosing distinct names for props, volatile state, and actions.

Full Changelog: v6.0.1...v7.0.0