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.
- package/CHANGELOG.md +11 -0
- package/dist/action/modelFlow.d.ts +1 -1
- package/dist/action/pendingActions.d.ts +1 -8
- package/dist/action/wrapInAction.d.ts +1 -22
- package/dist/actionMiddlewares/utils.d.ts +1 -10
- package/dist/dataModel/utils.d.ts +1 -1
- package/dist/mobx-keystone.es.js +134 -94
- package/dist/mobx-keystone.es.mjs +134 -94
- package/dist/mobx-keystone.umd.js +132 -93
- package/dist/model/utils.d.ts +1 -1
- package/dist/modelShared/BaseModelShared.d.ts +4 -2
- package/dist/modelShared/modelInfo.d.ts +1 -24
- package/dist/modelShared/prop.d.ts +26 -24
- package/dist/parent/core.d.ts +1 -29
- package/dist/snapshot/internal.d.ts +0 -11
- package/dist/tweaker/tweakArray.d.ts +1 -5
- package/dist/tweaker/tweakFrozen.d.ts +1 -6
- package/dist/tweaker/tweakModel.d.ts +1 -5
- package/dist/tweaker/tweakPlainObject.d.ts +1 -5
- package/dist/types/TypeChecker.d.ts +0 -30
- package/package.json +12 -11
- package/src/action/applyDelete.ts +0 -1
- package/src/action/applyMethodCall.ts +0 -1
- package/src/action/applySet.ts +42 -42
- package/src/action/builtInActions.ts +2 -2
- package/src/action/context.ts +0 -1
- package/src/action/hookActions.ts +2 -2
- package/src/action/isModelAction.ts +1 -2
- package/src/action/middleware.ts +1 -2
- package/src/action/modelFlow.ts +2 -4
- package/src/action/pendingActions.ts +42 -42
- package/src/action/protection.ts +0 -3
- package/src/action/wrapInAction.ts +3 -3
- package/src/actionMiddlewares/actionSerialization/primitiveSerializer.ts +49 -49
- package/src/actionMiddlewares/utils.ts +2 -2
- package/src/computedTree/index.ts +1 -1
- package/src/context/context.ts +274 -274
- package/src/dataModel/DataModelConstructorOptions.ts +0 -1
- package/src/dataModel/_BaseDataModel.ts +0 -2
- package/src/dataModel/actions.ts +0 -2
- package/src/dataModel/newDataModel.ts +0 -1
- package/src/dataModel/utils.ts +2 -5
- package/src/frozen/Frozen.ts +2 -3
- package/src/globalConfig/globalConfig.ts +0 -1
- package/src/index.ts +23 -23
- package/src/model/BaseModel.ts +1 -1
- package/src/model/ModelConstructorOptions.ts +0 -1
- package/src/model/_BaseModel.ts +0 -2
- package/src/model/getModelMetadata.ts +0 -1
- package/src/model/newModel.ts +0 -1
- package/src/model/utils.ts +4 -8
- package/src/modelShared/BaseModelShared.ts +7 -6
- package/src/modelShared/Model.ts +1 -1
- package/src/modelShared/checkModelDecoratorArgs.ts +0 -1
- package/src/modelShared/modelClassInitializer.ts +0 -3
- package/src/modelShared/modelDecorator.ts +190 -190
- package/src/modelShared/modelInfo.ts +4 -4
- package/src/modelShared/modelPropsInfo.ts +0 -2
- package/src/modelShared/prop.ts +31 -41
- package/src/modelShared/utils.ts +0 -1
- package/src/parent/core.ts +7 -7
- package/src/parent/coreObjectChildren.ts +0 -6
- package/src/parent/onChildAttachedTo.ts +138 -138
- package/src/parent/path.ts +371 -380
- package/src/parent/setParent.ts +0 -1
- package/src/parent/walkTree.ts +1 -3
- package/src/patch/applyPatches.ts +0 -1
- package/src/patch/emitPatch.ts +0 -1
- package/src/patch/patchRecorder.ts +0 -1
- package/src/ref/core.ts +0 -1
- package/src/rootStore/attachDetach.ts +0 -2
- package/src/rootStore/rootStore.ts +0 -2
- package/src/snapshot/SnapshotterAndReconcilerPriority.ts +0 -1
- package/src/snapshot/applySnapshot.ts +1 -2
- package/src/snapshot/fromModelSnapshot.ts +1 -1
- package/src/snapshot/fromSnapshot.ts +0 -4
- package/src/snapshot/getSnapshot.ts +7 -2
- package/src/snapshot/internal.ts +102 -68
- package/src/snapshot/onSnapshot.ts +1 -1
- package/src/snapshot/reconcileArraySnapshot.ts +1 -1
- package/src/snapshot/reconcileSnapshot.ts +0 -3
- package/src/standardActions/actions.ts +0 -2
- package/src/standardActions/arrayActions.ts +109 -109
- package/src/standardActions/objectActions.ts +57 -57
- package/src/transforms/ImmutableDate.ts +0 -2
- package/src/treeUtils/deepEquals.ts +2 -2
- package/src/treeUtils/sandbox.ts +266 -266
- package/src/tweaker/TweakerPriority.ts +0 -1
- package/src/tweaker/core.ts +0 -5
- package/src/tweaker/tweak.ts +1 -5
- package/src/tweaker/tweakArray.ts +56 -18
- package/src/tweaker/tweakFrozen.ts +6 -6
- package/src/tweaker/tweakModel.ts +1 -1
- package/src/tweaker/tweakPlainObject.ts +33 -18
- package/src/tweaker/typeChecking.ts +1 -2
- package/src/types/TypeChecker.ts +3 -10
- package/src/types/getTypeInfo.ts +19 -19
- package/src/types/primitiveBased/enum.ts +68 -63
- package/src/types/resolveTypeChecker.ts +0 -4
- package/src/utils/index.ts +408 -451
- 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
|
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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 {};
|