mobx-keystone 1.16.0 → 1.18.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +16 -6
  2. package/dist/mobx-keystone.esm.js +443 -881
  3. package/dist/mobx-keystone.esm.mjs +443 -881
  4. package/dist/mobx-keystone.umd.js +448 -886
  5. package/dist/types/model/index.d.ts +2 -1
  6. package/dist/types/model/mixins.d.ts +164 -0
  7. package/dist/types/types/TypeChecker.d.ts +0 -4
  8. package/dist/types/types/arrayBased/typesArray.d.ts +0 -1
  9. package/dist/types/types/arrayBased/typesTuple.d.ts +0 -1
  10. package/dist/types/types/createPerEntryCachedCheck.d.ts +1 -0
  11. package/dist/types/types/objectBased/typesArraySet.d.ts +0 -1
  12. package/dist/types/types/objectBased/typesDataModelData.d.ts +1 -5
  13. package/dist/types/types/objectBased/typesModel.d.ts +0 -4
  14. package/dist/types/types/objectBased/typesObject.d.ts +0 -4
  15. package/dist/types/types/objectBased/typesObjectMap.d.ts +0 -1
  16. package/dist/types/types/objectBased/typesRecord.d.ts +0 -1
  17. package/dist/types/types/utility/typesOr.d.ts +0 -1
  18. package/dist/types/types/utility/typesRefinement.d.ts +0 -1
  19. package/dist/types/types/utility/typesTag.d.ts +0 -1
  20. package/package.json +1 -1
  21. package/src/dataModel/BaseDataModel.ts +14 -9
  22. package/src/dataModel/newDataModel.ts +11 -12
  23. package/src/model/BaseModel.ts +270 -270
  24. package/src/model/index.ts +6 -5
  25. package/src/model/mixins.ts +288 -0
  26. package/src/model/newModel.ts +301 -301
  27. package/src/modelShared/sharedInternalModel.ts +7 -4
  28. package/src/tweaker/tweakArray.ts +2 -1
  29. package/src/tweaker/typeChecking.ts +64 -205
  30. package/src/types/TypeChecker.ts +6 -187
  31. package/src/types/arrayBased/typesArray.ts +21 -67
  32. package/src/types/arrayBased/typesTuple.ts +21 -74
  33. package/src/types/createPerEntryCachedCheck.ts +160 -0
  34. package/src/types/objectBased/typesArraySet.ts +2 -7
  35. package/src/types/objectBased/typesDataModelData.ts +6 -33
  36. package/src/types/objectBased/typesModel.ts +2 -34
  37. package/src/types/objectBased/typesObject.ts +42 -142
  38. package/src/types/objectBased/typesObjectMap.ts +2 -7
  39. package/src/types/objectBased/typesRecord.ts +26 -64
  40. package/src/types/objectBased/typesRef.ts +3 -8
  41. package/src/types/primitiveBased/typesPrimitive.ts +1 -5
  42. package/src/types/typeCheck.ts +2 -33
  43. package/src/types/utility/typesOr.ts +5 -18
  44. package/src/types/utility/typesRefinement.ts +2 -7
  45. package/src/types/utility/typesTag.ts +2 -13
  46. package/src/types/utility/typesUnchecked.ts +0 -1
  47. package/dist/types/types/typeCheckScope.d.ts +0 -18
  48. package/src/types/typeCheckScope.ts +0 -109
package/CHANGELOG.md CHANGED
@@ -1,11 +1,21 @@
1
1
  # Change Log
2
2
 
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
3
+ ## 1.18.0
4
+
5
+ - Added `defineModelMixin` and `composeMixins` helpers for type-safe class-model mixin composition without per-factory cast boilerplate.
6
+ - Fix: preserve intermediate model props when composing extended/decorated model classes in inheritance chains (for example chained mixins), so runtime-composed classes keep all props from previous composition steps.
7
+ - Fix: `composeMixins` now keeps mixin-added model prop typing markers for non-function fields, so `ModelData<>` and `ModelCreationData<>` reflect mixed-in props.
8
+
9
+ ## 1.17.0
10
+
11
+ - Performance: model auto type-checking is now faster for updates in large or deeply nested models. Type checks now re-run only for changed properties while unchanged branches reuse cached results, reducing repeated validation work during frequent updates. This is an internal optimization and does not change the public API.
12
+
13
+ ## 1.16.0
14
+
15
+ - 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.
16
+ - 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.
17
+
18
+ ## 1.15.0
9
19
 
10
20
  - Added `registerModels(...)` to explicitly keep model/data-model class references at runtime (useful in snapshot-heavy apps where imports may be elided).
11
21
  - Improved unknown model registry errors to include actionable guidance (`registerModels`, side-effect/runtime imports, and typed/runtime model references).