mobx-keystone 0.66.0 → 0.67.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 (101) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/action/modelFlow.d.ts +1 -1
  3. package/dist/action/pendingActions.d.ts +1 -8
  4. package/dist/action/wrapInAction.d.ts +1 -22
  5. package/dist/actionMiddlewares/utils.d.ts +1 -10
  6. package/dist/dataModel/utils.d.ts +1 -1
  7. package/dist/mobx-keystone.es.js +134 -94
  8. package/dist/mobx-keystone.es.mjs +134 -94
  9. package/dist/mobx-keystone.umd.js +132 -93
  10. package/dist/model/utils.d.ts +1 -1
  11. package/dist/modelShared/BaseModelShared.d.ts +4 -2
  12. package/dist/modelShared/modelInfo.d.ts +1 -24
  13. package/dist/modelShared/prop.d.ts +26 -24
  14. package/dist/parent/core.d.ts +1 -29
  15. package/dist/snapshot/internal.d.ts +0 -11
  16. package/dist/tweaker/tweakArray.d.ts +1 -5
  17. package/dist/tweaker/tweakFrozen.d.ts +1 -6
  18. package/dist/tweaker/tweakModel.d.ts +1 -5
  19. package/dist/tweaker/tweakPlainObject.d.ts +1 -5
  20. package/dist/types/TypeChecker.d.ts +0 -30
  21. package/package.json +12 -11
  22. package/src/action/applyDelete.ts +0 -1
  23. package/src/action/applyMethodCall.ts +0 -1
  24. package/src/action/applySet.ts +42 -42
  25. package/src/action/builtInActions.ts +2 -2
  26. package/src/action/context.ts +0 -1
  27. package/src/action/hookActions.ts +2 -2
  28. package/src/action/isModelAction.ts +1 -2
  29. package/src/action/middleware.ts +1 -2
  30. package/src/action/modelFlow.ts +2 -4
  31. package/src/action/pendingActions.ts +42 -42
  32. package/src/action/protection.ts +0 -3
  33. package/src/action/wrapInAction.ts +3 -3
  34. package/src/actionMiddlewares/actionSerialization/primitiveSerializer.ts +49 -49
  35. package/src/actionMiddlewares/utils.ts +2 -2
  36. package/src/computedTree/index.ts +1 -1
  37. package/src/context/context.ts +274 -274
  38. package/src/dataModel/DataModelConstructorOptions.ts +0 -1
  39. package/src/dataModel/_BaseDataModel.ts +0 -2
  40. package/src/dataModel/actions.ts +0 -2
  41. package/src/dataModel/newDataModel.ts +0 -1
  42. package/src/dataModel/utils.ts +2 -5
  43. package/src/frozen/Frozen.ts +2 -3
  44. package/src/globalConfig/globalConfig.ts +0 -1
  45. package/src/index.ts +23 -23
  46. package/src/model/BaseModel.ts +1 -1
  47. package/src/model/ModelConstructorOptions.ts +0 -1
  48. package/src/model/_BaseModel.ts +0 -2
  49. package/src/model/getModelMetadata.ts +0 -1
  50. package/src/model/newModel.ts +0 -1
  51. package/src/model/utils.ts +4 -8
  52. package/src/modelShared/BaseModelShared.ts +7 -6
  53. package/src/modelShared/Model.ts +1 -1
  54. package/src/modelShared/checkModelDecoratorArgs.ts +0 -1
  55. package/src/modelShared/modelClassInitializer.ts +0 -3
  56. package/src/modelShared/modelDecorator.ts +190 -190
  57. package/src/modelShared/modelInfo.ts +4 -4
  58. package/src/modelShared/modelPropsInfo.ts +0 -2
  59. package/src/modelShared/prop.ts +31 -41
  60. package/src/modelShared/utils.ts +0 -1
  61. package/src/parent/core.ts +7 -7
  62. package/src/parent/coreObjectChildren.ts +0 -6
  63. package/src/parent/onChildAttachedTo.ts +138 -138
  64. package/src/parent/path.ts +371 -380
  65. package/src/parent/setParent.ts +0 -1
  66. package/src/parent/walkTree.ts +1 -3
  67. package/src/patch/applyPatches.ts +0 -1
  68. package/src/patch/emitPatch.ts +0 -1
  69. package/src/patch/patchRecorder.ts +0 -1
  70. package/src/ref/core.ts +0 -1
  71. package/src/rootStore/attachDetach.ts +0 -2
  72. package/src/rootStore/rootStore.ts +0 -2
  73. package/src/snapshot/SnapshotterAndReconcilerPriority.ts +0 -1
  74. package/src/snapshot/applySnapshot.ts +1 -2
  75. package/src/snapshot/fromModelSnapshot.ts +1 -1
  76. package/src/snapshot/fromSnapshot.ts +0 -4
  77. package/src/snapshot/getSnapshot.ts +7 -2
  78. package/src/snapshot/internal.ts +102 -68
  79. package/src/snapshot/onSnapshot.ts +1 -1
  80. package/src/snapshot/reconcileArraySnapshot.ts +1 -1
  81. package/src/snapshot/reconcileSnapshot.ts +0 -3
  82. package/src/standardActions/actions.ts +0 -2
  83. package/src/standardActions/arrayActions.ts +109 -109
  84. package/src/standardActions/objectActions.ts +57 -57
  85. package/src/transforms/ImmutableDate.ts +0 -2
  86. package/src/treeUtils/deepEquals.ts +2 -2
  87. package/src/treeUtils/sandbox.ts +266 -266
  88. package/src/tweaker/TweakerPriority.ts +0 -1
  89. package/src/tweaker/core.ts +0 -5
  90. package/src/tweaker/tweak.ts +1 -5
  91. package/src/tweaker/tweakArray.ts +56 -18
  92. package/src/tweaker/tweakFrozen.ts +6 -6
  93. package/src/tweaker/tweakModel.ts +1 -1
  94. package/src/tweaker/tweakPlainObject.ts +33 -18
  95. package/src/tweaker/typeChecking.ts +1 -2
  96. package/src/types/TypeChecker.ts +3 -10
  97. package/src/types/getTypeInfo.ts +19 -19
  98. package/src/types/primitiveBased/enum.ts +68 -63
  99. package/src/types/resolveTypeChecker.ts +0 -4
  100. package/src/utils/index.ts +408 -451
  101. package/src/utils/types.ts +48 -48
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.67.0
4
+
5
+ - Big speedup in certain cases (when many mutations are done between getSnapshot calls) by delaying the inmmutable object creation to the point when getSnapshot is called.
6
+ - Fixed typing issue related to generics with optional props.
7
+
8
+ ## 0.66.1
9
+
10
+ - Fixed typing issue related to generics.
11
+
12
+ ## 0.66.0
13
+
3
14
  - Restored compatibility with mobx 4/5 and added CI tests to ensure it never gets broken again.
4
15
  - Added `@computedTree` decorator for reactively deriving an alternative view of an original tree that is attached as a property to the original tree to support tree traversal functions, contexts, references, etc. (see "Computed Trees" section in the docs).
5
16
 
@@ -4,7 +4,7 @@
4
4
  * @param fn Function to check.
5
5
  * @returns
6
6
  */
7
- export declare function isModelFlow(fn: any): any;
7
+ export declare function isModelFlow(fn: unknown): boolean;
8
8
  /**
9
9
  * Decorator that turns a function generator into a model flow.
10
10
  *
@@ -1,8 +1 @@
1
- /**
2
- * @ignore
3
- */
4
- export declare function enqueuePendingAction(action: () => void): void;
5
- /**
6
- * @ignore
7
- */
8
- export declare function tryRunPendingActions(): void;
1
+ export {};
@@ -1,22 +1 @@
1
- import type { O } from "ts-toolbelt";
2
- import type { AnyDataModel } from "../dataModel/BaseDataModel";
3
- import type { AnyModel } from "../model/BaseModel";
4
- import { ActionContext, ActionContextActionType } from "./context";
5
- /**
6
- * @ignore
7
- */
8
- export declare type WrapInActionOverrideContextFn = (ctx: O.Writable<ActionContext>, self: any) => void;
9
- /**
10
- * @ignore
11
- */
12
- export declare function wrapInAction<T extends Function>({ nameOrNameFn, fn, actionType, overrideContext, isFlowFinisher, }: {
13
- nameOrNameFn: string | (() => string);
14
- fn: T;
15
- actionType: ActionContextActionType;
16
- overrideContext?: WrapInActionOverrideContextFn;
17
- isFlowFinisher?: boolean;
18
- }): T;
19
- /**
20
- * @ignore
21
- */
22
- export declare function wrapModelMethodInActionIfNeeded<M extends AnyModel | AnyDataModel>(model: M, propertyKey: keyof M, name: string): void;
1
+ export {};
@@ -1,10 +1 @@
1
- import type { RootPath } from "../parent/path";
2
- import type { Path } from "../parent/pathTypes";
3
- /**
4
- * @ignore
5
- */
6
- export declare function rootPathToTargetPathIds(rootPath: RootPath<any>): (string | null)[];
7
- /**
8
- * @ignore
9
- */
10
- export declare function pathToTargetPathIds(root: any, path: Path): (string | null)[];
1
+ export {};
@@ -5,4 +5,4 @@ import type { AnyDataModel } from "./BaseDataModel";
5
5
  * @param model
6
6
  * @returns
7
7
  */
8
- export declare function isDataModel(model: any): model is AnyDataModel;
8
+ export declare function isDataModel(model: unknown): model is AnyDataModel;