MyGit

v7.0.0-pre.2

mobxjs/mobx-state-tree

版本发布时间: 2024-08-02 01:56:53

mobxjs/mobx-state-tree最新发布版本:v7.0.0-pre.2(2024-08-02 01:56:53)

Breaking Changes

Features

Fixes

Migration Path

For most users, migrating from v6 -> v7 will be straightforward and require no work. However, we have made a breaking change in the assumption for types.snapshoProcessor and its is method.

In v6, we validated processed snapshots in this method. But now we will only validate instances. If you upgrade to v7 and all of your TypeScript types and runtime tests are passing, no additional work necessary on your end.

If this change has broken you, it may in fact be surfacing subtle bugs or gaps in your type modeling where your codebase is considering two different types to be "the same" because they have matching SnapshotOut shapes. If you need to preserve that behavior in your codebase, you might consider writing custom logic to check for this type of equality. MST is specifically taking a stance to check against Instances and valid SnapshotIn types.

The snapshot processor typings have also changed, which may break during upgrade, but for the most part we have relaxed them to be more correct. If you relied on old workarounds, you may be able to remove custom type assertions.

Full Changelog: https://github.com/mobxjs/mobx-state-tree/compare/v6.0.1...v7.0.0-pre.2

相关地址:原始地址 下载(tar) 下载(zip)

查看:2024-08-02发行的版本