mobx-keystone 1.14.0 → 1.16.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 +12 -1
- package/dist/mobx-keystone.esm.js +819 -125
- package/dist/mobx-keystone.esm.mjs +819 -125
- package/dist/mobx-keystone.umd.js +819 -125
- package/dist/types/model/utils.d.ts +10 -0
- package/dist/types/modelShared/modelInfo.d.ts +7 -0
- package/dist/types/types/TypeChecker.d.ts +5 -0
- package/dist/types/types/arrayBased/typesArray.d.ts +2 -0
- package/dist/types/types/arrayBased/typesTuple.d.ts +2 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/objectBased/typesArraySet.d.ts +2 -0
- package/dist/types/types/objectBased/typesDataModelData.d.ts +5 -0
- package/dist/types/types/objectBased/typesModel.d.ts +5 -0
- package/dist/types/types/objectBased/typesObject.d.ts +6 -0
- package/dist/types/types/objectBased/typesObjectMap.d.ts +2 -0
- package/dist/types/types/objectBased/typesRecord.d.ts +2 -0
- package/dist/types/types/objectBased/typesRef.d.ts +1 -0
- package/dist/types/types/primitiveBased/typesPrimitive.d.ts +4 -0
- package/dist/types/types/typeCheckErrorUtils.d.ts +1 -0
- package/dist/types/types/typeCheckScope.d.ts +18 -0
- package/dist/types/types/utility/typesOr.d.ts +2 -0
- package/dist/types/types/utility/typesRefinement.d.ts +2 -0
- package/dist/types/types/utility/typesTag.d.ts +2 -0
- package/dist/types/types/utility/typesUnchecked.d.ts +1 -0
- package/package.json +2 -2
- package/src/dataModel/BaseDataModel.ts +9 -9
- package/src/model/utils.ts +31 -2
- package/src/modelShared/modelInfo.ts +17 -0
- package/src/parent/path.ts +381 -370
- package/src/snapshot/applySnapshot.ts +6 -2
- package/src/snapshot/fromModelSnapshot.ts +2 -2
- package/src/snapshot/reconcileModelSnapshot.ts +2 -2
- package/src/tweaker/tweakPlainObject.ts +2 -2
- package/src/tweaker/typeChecking.ts +242 -71
- package/src/types/TypeChecker.ts +134 -28
- package/src/types/arrayBased/typesArray.ts +68 -4
- package/src/types/arrayBased/typesTuple.ts +73 -4
- package/src/types/index.ts +1 -1
- package/src/types/objectBased/typesArraySet.ts +9 -2
- package/src/types/objectBased/typesDataModelData.ts +31 -2
- package/src/types/objectBased/typesModel.ts +36 -2
- package/src/types/objectBased/typesObject.ts +204 -26
- package/src/types/objectBased/typesObjectMap.ts +9 -2
- package/src/types/objectBased/typesRecord.ts +63 -4
- package/src/types/objectBased/typesRef.ts +11 -4
- package/src/types/primitiveBased/typesPrimitive.ts +15 -3
- package/src/types/typeCheck.ts +52 -21
- package/src/types/typeCheckErrorUtils.ts +23 -0
- package/src/types/typeCheckScope.ts +109 -0
- package/src/types/utility/typesOr.ts +80 -15
- package/src/types/utility/typesRefinement.ts +12 -2
- package/src/types/utility/typesTag.ts +93 -80
- package/src/types/utility/typesUnchecked.ts +41 -38
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.16.0
|
|
4
|
+
|
|
5
|
+
- Fixed a long-standing bug: model auto type-checking now enforces ancestor property refinements (for example refinements on `a.b`) when mutating nested child model data (for example `a.b.x`), while still avoiding unnecessary ancestor checks when no refinement is present on the path.
|
|
6
|
+
- Performance: reduced runtime type-check overhead by caching object prop checker resolution, avoiding success-path child path allocations in object/array/tuple/record checks, and narrowing `types.or` branch checks by base type.
|
|
7
|
+
|
|
8
|
+
## 1.15.0
|
|
9
|
+
|
|
10
|
+
- Added `registerModels(...)` to explicitly keep model/data-model class references at runtime (useful in snapshot-heavy apps where imports may be elided).
|
|
11
|
+
- Improved unknown model registry errors to include actionable guidance (`registerModels`, side-effect/runtime imports, and typed/runtime model references).
|
|
12
|
+
- Performance: model auto type-checking is now significantly faster by validating only changed branches and invalidating caches more selectively (including arrays, tuples, records, and wrapper types such as `or`/`refinement`). Before these changes setting a single type-checked property had a penalty of a 95% vs the non type-checked version. After changes this penalty is reduced to a 25% instead.
|
|
13
|
+
|
|
14
|
+
## 1.14.0
|
|
4
15
|
|
|
5
16
|
- `TypeCheckError` now supports a single object parameter and still accepts positional constructor arguments for backward compatibility.
|
|
6
17
|
- `TypeCheckError.throw()` now throws `TypeCheckErrorFailure` (which extends `MobxKeystoneError`), and union snapshot mismatches now throw `SnapshotTypeMismatchError` (also extending `MobxKeystoneError`) with structured metadata.
|