mobx-keystone 1.19.0 → 1.20.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 -3
- package/dist/mobx-keystone.esm.js +7801 -6658
- package/dist/mobx-keystone.esm.mjs +7801 -6658
- package/dist/mobx-keystone.umd.js +7800 -6657
- package/dist/types/actionMiddlewares/undoMiddleware.d.ts +10 -2
- package/dist/types/modelShared/prop.d.ts +23 -9
- package/dist/types/ref/Ref.d.ts +4 -1
- package/dist/types/snapshot/fromSnapshot.d.ts +2 -5
- package/dist/types/snapshot/getSnapshot.d.ts +2 -2
- package/dist/types/transforms/asMap.d.ts +8 -0
- package/dist/types/transforms/asSet.d.ts +4 -0
- package/dist/types/transforms/bigint.d.ts +4 -0
- package/dist/types/transforms/date.d.ts +8 -0
- package/dist/types/types/schemas.d.ts +50 -21
- package/dist/types/types/tProp.d.ts +23 -10
- package/dist/types/types/types.d.ts +26 -1
- package/dist/types/types/utility/typeToStoredData.d.ts +12 -0
- package/dist/types/types/utility/typesBigInt.d.ts +1 -0
- package/dist/types/types/utility/typesCodec.d.ts +12 -0
- package/dist/types/types/utility/typesCodecCore.d.ts +46 -0
- package/dist/types/types/utility/typesCodecSupport.d.ts +7 -0
- package/dist/types/types/utility/typesDate.d.ts +2 -0
- package/dist/types/types/utility/typesMap.d.ts +4 -0
- package/dist/types/types/utility/typesOr.d.ts +2 -1
- package/dist/types/types/utility/typesSet.d.ts +4 -0
- package/dist/types/types/utility/typesSkipCheck.d.ts +34 -0
- package/dist/types/utils/AnyFunction.d.ts +4 -1
- package/dist/types/wrappers/ArraySet.d.ts +13 -88
- package/dist/types/wrappers/ObjectMap.d.ts +13 -90
- package/package.json +3 -3
- package/src/model/BaseModel.ts +4 -1
- package/src/modelShared/prop.ts +81 -12
- package/src/modelShared/sharedInternalModel.ts +6 -6
- package/src/parent/coreObjectChildren.ts +180 -172
- package/src/parent/setParent.ts +149 -149
- package/src/ref/core.ts +345 -310
- package/src/ref/rootRef.ts +100 -94
- package/src/snapshot/fromSnapshot.ts +24 -17
- package/src/snapshot/getSnapshot.ts +79 -62
- package/src/transforms/asMap.ts +50 -42
- package/src/transforms/asSet.ts +22 -18
- package/src/transforms/bigint.ts +20 -16
- package/src/transforms/date.ts +40 -32
- package/src/types/TypeChecker.ts +2 -1
- package/src/types/arrayBased/typesArray.ts +1 -1
- package/src/types/arrayBased/typesTuple.ts +5 -1
- package/src/types/objectBased/typesArraySet.ts +8 -3
- package/src/types/objectBased/typesDataModelData.ts +15 -2
- package/src/types/objectBased/typesModel.ts +15 -2
- package/src/types/objectBased/typesObject.ts +1 -1
- package/src/types/objectBased/typesObjectMap.ts +6 -3
- package/src/types/objectBased/typesRecord.ts +1 -1
- package/src/types/registerDefaultStandardTypeResolvers.ts +21 -19
- package/src/types/schemas.ts +208 -113
- package/src/types/tProp.ts +268 -258
- package/src/types/typeCheck.ts +1 -1
- package/src/types/types.ts +142 -97
- package/src/types/utility/typeToStoredData.ts +37 -0
- package/src/types/utility/typesBigInt.ts +15 -0
- package/src/types/utility/typesCodec.ts +38 -0
- package/src/types/utility/typesCodecCore.ts +178 -0
- package/src/types/utility/typesCodecSupport.ts +806 -0
- package/src/types/utility/typesDate.ts +27 -0
- package/src/types/utility/typesMap.ts +222 -0
- package/src/types/utility/typesOr.ts +18 -4
- package/src/types/utility/typesSet.ts +110 -0
- package/src/types/utility/typesSkipCheck.ts +70 -0
- package/src/utils/AnyFunction.ts +1 -1
- package/src/wrappers/ArraySet.ts +24 -9
- package/src/wrappers/ObjectMap.ts +136 -121
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.20.0
|
|
4
4
|
|
|
5
|
-
- Added `
|
|
5
|
+
- Added `types.codec(...)` plus built-in codecs/factories for `bigint`, dates, maps, and sets (`types.bigint`, `types.dateAsTimestamp`, `types.dateAsIsoString`, `types.mapFromObject(...)`, `types.mapFromArray(...)`, `types.setFromArray(...)`).
|
|
6
|
+
- Added `TypeToSnapshotIn<T>` / `TypeToSnapshotOut<T>` helper types and `CodecTypeInfo`.
|
|
7
|
+
- Fixed `$modelId` getter typing to return the proper `ModelIdPropertyType` instead of a loosely-typed value.
|
|
8
|
+
- Performance: optimized `rootRef` resolution and backref updates in large reference-heavy initialization flows by skipping `resolveId(...)` work for detached refs and avoiding no-op backref update actions.
|
|
9
|
+
- Added `types.skipCheck(type)` — a wrapper type that disables runtime validation while preserving snapshot processing, codec conversions, and transforms.
|
|
10
|
+
- Deprecated built-in transform helpers in favor of codec equivalents with `types.skipCheck(...)`: `timestampToDateTransform`, `isoStringToDateTransform`, `stringToBigIntTransform`, `objectToMapTransform`, `arrayToMapTransform`, `arrayToSetTransform`. Also soft-deprecated `.withTransform(...)` — prefer `tProp(types.codec(...))` or `tProp(types.skipCheck(...))` for new code.
|
|
6
11
|
|
|
7
|
-
## 1.
|
|
12
|
+
## 1.19.0
|
|
13
|
+
|
|
14
|
+
- Added `idProp.withGenerator(...)` to define per-model ID generation for `idProp` fields, including inheritance-aware behavior in `ExtendedModel`.
|
|
15
|
+
|
|
16
|
+
## 1.18.0
|
|
8
17
|
|
|
9
18
|
- Added `defineModelMixin` and `composeMixins` helpers for type-safe class-model mixin composition without per-factory cast boilerplate.
|
|
10
19
|
- 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.
|