v7.0.0 #2224
Unanswered
coolsoftwaretyler
asked this question in
General
v7.0.0
#2224
Replies: 1 comment 3 replies
-
Something seems to be messing with type checking on .create... import { types } from "mobx-state-tree";
const Model = types.model({ a: types.number });
Model.create({ a: "hello world", b: 12323123 }); This doesn't complain in VS Code or
It is very possible the error is mine, but this is literally a brand new |
Beta Was this translation helpful? Give feedback.
3 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
Tests
bun test
working locally by @thegedge in Getbun test
working locally #2204Migration
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 totrue
.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
Beta Was this translation helpful? Give feedback.
All reactions