mobx-keystone 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/mobx-keystone.esm.js +282 -29
- package/dist/mobx-keystone.esm.mjs +282 -29
- package/dist/mobx-keystone.umd.js +285 -28
- package/dist/types/types/SnapshotTypeMismatchError.d.ts +3 -1
- package/dist/types/types/modelTypeMatching.d.ts +1 -0
- package/package.json +10 -10
- package/src/modelShared/modelDecorator.ts +2 -5
- package/src/modelShared/modelInfo.ts +75 -0
- package/src/types/SnapshotTypeMismatchError.ts +3 -1
- package/src/types/modelTypeMatching.ts +276 -0
- package/src/types/objectBased/typesModel.ts +23 -6
- package/src/types/objectBased/typesRef.ts +23 -4
- package/src/types/utility/typesCodecCore.ts +3 -1
- package/src/types/utility/typesCodecSupport.ts +13 -7
- package/src/types/utility/typesOr.ts +38 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
|
|
5
|
+
- Fixed typed `fromSnapshot(Type, snapshot)` silently creating an unrelated model when a model snapshot's `$modelType` names a model that is neither the expected one nor a subclass of it (#590). It now throws `SnapshotTypeMismatchError` (whatever `modelAutoTypeChecking` is set to), also for models nested in typed props/containers, `types.ref` snapshots and `applySnapshot` into typed props. With `modelAutoTypeChecking` on, such a mismatch in a typed prop now throws `SnapshotTypeMismatchError` instead of a `TypeCheckError`.
|
|
6
|
+
- Unions of model types now accept subclass snapshots for a base model branch, preferring the branch of the snapshot's own model when there is one.
|
|
7
|
+
- Fixed `types.model(...)` and `types.ref(...)` type checking rejecting valid instances after hot reloading re-registered a model.
|
|
8
|
+
|
|
3
9
|
## 2.2.0
|
|
4
10
|
|
|
5
11
|
- Now requires TypeScript 5.4 or newer (the types use the built-in `NoInfer`).
|