Download Latest Version v7.0.2 source code.tar.gz (790.0 kB)
Email in envelope

Get an email when there's a new version of mobx-state-tree

Home / v7.0.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2024-11-19 2.5 kB
v7.0.0 source code.tar.gz 2024-11-19 784.6 kB
v7.0.0 source code.zip 2024-11-19 887.9 kB
Totals: 3 Items   1.7 MB 0

Breaking Changes

Features

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 https://github.com/mobxjs/mobx-state-tree/pull/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 https://github.com/mobxjs/mobx-state-tree/pull/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: https://github.com/mobxjs/mobx-state-tree/compare/v6.0.1...v7.0.0

Source: README.md, updated 2024-11-19