v7.0.0-pre.2 #2202
v7.0.0-pre.2
#2202
Replies: 1 comment
-
Just published |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Breaking Changes
SnapshotProcessor.is
override by @airhorns in Validate state tree instances instead of snapshots in theSnapshotProcessor.is
override #2182Features
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 itsis
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 validSnapshotIn
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: v6.0.1...v7.0.0-pre.2
This discussion was created from the release v7.0.0-pre.2.
Beta Was this translation helpful? Give feedback.
All reactions