@fluidframework/shared-object-base 2.70.0-361248 → 2.70.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 +10 -0
- package/api-report/shared-object-base.legacy.beta.api.md +1 -3
- package/dist/handle.d.ts +2 -2
- package/dist/handle.d.ts.map +1 -1
- package/dist/handle.js +4 -6
- package/dist/handle.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/sharedObject.d.ts +2 -29
- package/dist/sharedObject.d.ts.map +1 -1
- package/dist/sharedObject.js +27 -77
- package/dist/sharedObject.js.map +1 -1
- package/dist/sharedObjectKernel.d.ts.map +1 -1
- package/dist/sharedObjectKernel.js +0 -3
- package/dist/sharedObjectKernel.js.map +1 -1
- package/lib/handle.d.ts +2 -2
- package/lib/handle.d.ts.map +1 -1
- package/lib/handle.js +3 -5
- package/lib/handle.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/sharedObject.d.ts +2 -29
- package/lib/sharedObject.d.ts.map +1 -1
- package/lib/sharedObject.js +27 -77
- package/lib/sharedObject.js.map +1 -1
- package/lib/sharedObjectKernel.d.ts.map +1 -1
- package/lib/sharedObjectKernel.js +0 -3
- package/lib/sharedObjectKernel.js.map +1 -1
- package/package.json +15 -15
- package/src/handle.ts +4 -6
- package/src/packageVersion.ts +1 -1
- package/src/sharedObject.ts +34 -155
- package/src/sharedObjectKernel.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @fluidframework/shared-object-base
|
|
2
2
|
|
|
3
|
+
## 2.70.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Deprecated property processCore has been removed from SharedObject ([#25749](https://github.com/microsoft/FluidFramework/pull/25749)) [a33a2e370f](https://github.com/microsoft/FluidFramework/commit/a33a2e370fbb95b565f39c2a14abc7716bc01980)
|
|
8
|
+
|
|
9
|
+
The deprecated property `processCore` has been removed from `SharedObject`.
|
|
10
|
+
|
|
11
|
+
Please see [this github issue](https://github.com/microsoft/FluidFramework/issues/25176) for more details.
|
|
12
|
+
|
|
3
13
|
## 2.63.0
|
|
4
14
|
|
|
5
15
|
Dependency updates only.
|
|
@@ -80,9 +80,7 @@ export abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISha
|
|
|
80
80
|
protected newAckBasedPromise<T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: unknown) => void) => void): Promise<T>;
|
|
81
81
|
protected onConnect(): void;
|
|
82
82
|
protected abstract onDisconnect(): void;
|
|
83
|
-
|
|
84
|
-
protected abstract processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
85
|
-
protected processMessagesCore?(messagesCollection: IRuntimeMessageCollection): void;
|
|
83
|
+
protected abstract processMessagesCore(messagesCollection: IRuntimeMessageCollection): void;
|
|
86
84
|
protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
|
|
87
85
|
protected reSubmitSquashed(content: unknown, localOpMetadata: unknown): void;
|
|
88
86
|
protected rollback(content: unknown, localOpMetadata: unknown): void;
|
package/dist/handle.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
|
|
6
6
|
import { FluidObjectHandle } from "@fluidframework/datastore/internal";
|
|
7
|
-
import type {
|
|
7
|
+
import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal";
|
|
8
8
|
import type { ISharedObject } from "./types.js";
|
|
9
9
|
/**
|
|
10
10
|
* Handle for a shared object. See also `SharedObjectHandle`.
|
|
@@ -59,7 +59,7 @@ export declare class SharedObjectHandle extends FluidObjectHandle<ISharedObject>
|
|
|
59
59
|
* @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
|
|
60
60
|
* to this handle.
|
|
61
61
|
*/
|
|
62
|
-
constructor(value: ISharedObject, path: string, runtime:
|
|
62
|
+
constructor(value: ISharedObject, path: string, runtime: IFluidDataStoreRuntime);
|
|
63
63
|
/**
|
|
64
64
|
* Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.
|
|
65
65
|
* When attaching the handle, it registers the associated shared object.
|
package/dist/handle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAG7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB,CAAC,aAAa,CAAC;IAC/E;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,mBAAmB,CAEpF;AAED;;;;;;;;;GASG;AACH,qBAAa,kBACZ,SAAQ,iBAAiB,CAAC,aAAa,CACvC,YAAW,mBAAmB;IA2C7B,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa;IAEvC,OAAO,CAAC,QAAQ,CAAC,OAAO;IA3CzB;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;OAEG;IACH,OAAO,KAAK,SAAS,GAcpB;IAED;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAkB;IAE1C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwC;IAEvE;;;;;;OAMG;gBAEiB,KAAK,EAAE,aAAa,EACvC,IAAI,EAAE,MAAM,EACK,OAAO,EAAE,sBAAsB;IAKjD;;;OAGG;IACI,WAAW,IAAI,IAAI;IAmBnB,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;CAiB/C"}
|
package/dist/handle.js
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.SharedObjectHandle = exports.isISharedObjectHandle = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/datastore/internal");
|
|
9
|
-
const
|
|
9
|
+
const internal_2 = require("@fluidframework/runtime-utils/internal");
|
|
10
10
|
/**
|
|
11
11
|
* Type guard for {@link ISharedObjectHandle}.
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
function isISharedObjectHandle(handle) {
|
|
15
|
-
return (0,
|
|
15
|
+
return (0, internal_2.isFluidHandle)(handle) && typeof handle.bind === "function";
|
|
16
16
|
}
|
|
17
17
|
exports.isISharedObjectHandle = isISharedObjectHandle;
|
|
18
18
|
/**
|
|
@@ -57,9 +57,7 @@ class SharedObjectHandle extends internal_1.FluidObjectHandle {
|
|
|
57
57
|
* @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
|
|
58
58
|
* to this handle.
|
|
59
59
|
*/
|
|
60
|
-
constructor(value, path,
|
|
61
|
-
// eslint-disable-next-line import/no-deprecated
|
|
62
|
-
runtime) {
|
|
60
|
+
constructor(value, path, runtime) {
|
|
63
61
|
super(value, path, runtime.IFluidHandleContext);
|
|
64
62
|
this.value = value;
|
|
65
63
|
this.runtime = runtime;
|
|
@@ -92,7 +90,7 @@ class SharedObjectHandle extends internal_1.FluidObjectHandle {
|
|
|
92
90
|
// We don't bind handles in staging mode to defer the attachment of any new objects
|
|
93
91
|
// until we've exited staging mode. This way if we discard changes or a new handle is not present in the final
|
|
94
92
|
// committed state, we will never end up attaching the discarded object.
|
|
95
|
-
if (this.runtime.inStagingMode === true) {
|
|
93
|
+
if ((0, internal_2.asLegacyAlpha)(this.runtime).inStagingMode === true) {
|
|
96
94
|
return;
|
|
97
95
|
}
|
|
98
96
|
// If this handle is visible, attach the graph of the incoming handle as well.
|
package/dist/handle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.js","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,iEAAuE;
|
|
1
|
+
{"version":3,"file":"handle.js","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,iEAAuE;AAEvE,qEAAsF;AAoBtF;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,MAAe;IACpD,OAAO,IAAA,wBAAa,EAAC,MAAM,CAAC,IAAI,OAAQ,MAA8B,CAAC,IAAI,KAAK,UAAU,CAAC;AAC5F,CAAC;AAFD,sDAEC;AAED;;;;;;;;;GASG;AACH,MAAa,kBACZ,SAAQ,4BAAgC;IAGxC;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAY,SAAS;QACpB;;;;;;;;;;;WAWG;QACH,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,gBAAgB,CAAC;IACjD,CAAC;IASD;;;;;;OAMG;IACH,YACoB,KAAoB,EACvC,IAAY,EACK,OAA+B;QAEhD,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAJ7B,UAAK,GAAL,KAAK,CAAe;QAEtB,YAAO,GAAP,OAAO,CAAwB;QAjBjD;;WAEG;QACK,qBAAgB,GAAY,KAAK,CAAC;QAEzB,mBAAc,GAA8B,IAAI,GAAG,EAAE,CAAC;IAevE,CAAC;IAED;;;OAGG;IACI,WAAW;QACjB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,OAAO;QACR,CAAC;QAED,yCAAyC;QACzC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YAC1C,MAAM,CAAC,WAAW,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAE5B,yFAAyF;QACzF,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAE3B,8EAA8E;QAC9E,KAAK,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAEM,IAAI,CAAC,MAA4B;QACvC,mFAAmF;QACnF,8GAA8G;QAC9G,wEAAwE;QACxE,IAAI,IAAA,wBAAa,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;YACxD,OAAO;QACR,CAAC;QAED,8EAA8E;QAC9E,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO;QACR,CAAC;QAED,mGAAmG;QACnG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACD;AA5FD,gDA4FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore/internal\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\nimport { isFluidHandle, asLegacyAlpha } from \"@fluidframework/runtime-utils/internal\";\n\nimport type { ISharedObject } from \"./types.js\";\n\n/**\n * Handle for a shared object. See also `SharedObjectHandle`.\n * Supports binding other handles to the underlying Shared Object (see {@link ISharedObjectHandle.bind}).\n *\n * @internal\n */\nexport interface ISharedObjectHandle extends IFluidHandleInternal<ISharedObject> {\n\t/**\n\t * Binds the given handle to this DDS or attach the given handle if this DDS is attached.\n\t * A bound handle will also be attached once this DDS is attached.\n\t *\n\t * @param handle - The target handle to bind to this DDS\n\t */\n\tbind(handle: IFluidHandleInternal): void;\n}\n\n/**\n * Type guard for {@link ISharedObjectHandle}.\n * @internal\n */\nexport function isISharedObjectHandle(handle: unknown): handle is ISharedObjectHandle {\n\treturn isFluidHandle(handle) && typeof (handle as ISharedObjectHandle).bind === \"function\";\n}\n\n/**\n * Handle for a shared object (DDS).\n *\n * @remarks\n *\n * This object is used for already loaded (in-memory) shared objects.\n *\n * It provides a \"bind\" function that is expected to be invoked on all handles stored in this DDS,\n * ensuring the target object becomes attached along with this DDS.\n */\nexport class SharedObjectHandle\n\textends FluidObjectHandle<ISharedObject>\n\timplements ISharedObjectHandle\n{\n\t/**\n\t * Whether services have been attached for the associated shared object.\n\t */\n\tpublic get isAttached(): boolean {\n\t\treturn this.value.isAttached();\n\t}\n\n\t/**\n\t * Tells whether the object of this handle is visible in the container locally or globally.\n\t */\n\tprivate get isVisible(): boolean {\n\t\t/**\n\t\t * If the object of this handle is attached, it is visible in the container. Ideally, checking local visibility\n\t\t * should be enough for a handle. However, there are scenarios where the object becomes locally visible but the\n\t\t * handle does not know this - This will happen is attachGraph is never called on the handle. Couple of examples\n\t\t * where this can happen:\n\t\t *\n\t\t * 1. Handles to DDS other than the default handle won't know if the DDS becomes visible after the handle was\n\t\t * created.\n\t\t *\n\t\t * 2. Handles to root data stores will never know that it was visible because the handle will not be stores in\n\t\t * another DDS and so, attachGraph will never be called on it.\n\t\t */\n\t\treturn this.isAttached || this.isLocallyVisible;\n\t}\n\n\t/**\n\t * Tracks whether this handle is locally visible in the container.\n\t */\n\tprivate isLocallyVisible: boolean = false;\n\n\tprivate readonly pendingHandles: Set<IFluidHandleInternal> = new Set();\n\n\t/**\n\t * Creates a new SharedObjectHandle.\n\t * @param value - The shared object this handle is for.\n\t * @param path - The id of the shared object. It is also the path to this object relative to the routeContext.\n\t * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route\n\t * to this handle.\n\t */\n\tconstructor(\n\t\tprotected readonly value: ISharedObject,\n\t\tpath: string,\n\t\tprivate readonly runtime: IFluidDataStoreRuntime,\n\t) {\n\t\tsuper(value, path, runtime.IFluidHandleContext);\n\t}\n\n\t/**\n\t * Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.\n\t * When attaching the handle, it registers the associated shared object.\n\t */\n\tpublic attachGraph(): void {\n\t\tif (this.isVisible) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively attach all pending handles\n\t\tthis.isLocallyVisible = true;\n\t\tfor (const handle of this.pendingHandles) {\n\t\t\thandle.attachGraph();\n\t\t}\n\t\tthis.pendingHandles.clear();\n\n\t\t// Bind this SharedObject to its context (typically the DataStore) so it attaches with it\n\t\tthis.value.bindToContext();\n\n\t\t// This will trigger the context (typically the DataStore) to attach its graph\n\t\tsuper.attachGraph();\n\t}\n\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\t// We don't bind handles in staging mode to defer the attachment of any new objects\n\t\t// until we've exited staging mode. This way if we discard changes or a new handle is not present in the final\n\t\t// committed state, we will never end up attaching the discarded object.\n\t\tif (asLegacyAlpha(this.runtime).inStagingMode === true) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If this handle is visible, attach the graph of the incoming handle as well.\n\t\tif (this.isVisible) {\n\t\t\thandle.attachGraph();\n\t\t\treturn;\n\t\t}\n\n\t\t// If this handle is not visible, we will attach it later when this handle's attachGraph is called.\n\t\tthis.pendingHandles.add(handle);\n\t}\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/shared-object-base";
|
|
8
|
-
export declare const pkgVersion = "2.70.0
|
|
8
|
+
export declare const pkgVersion = "2.70.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,uCAAuC,CAAC;AAC5D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,uCAAuC,CAAC;AAC5D,eAAO,MAAM,UAAU,WAAW,CAAC"}
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/shared-object-base";
|
|
11
|
-
exports.pkgVersion = "2.70.0
|
|
11
|
+
exports.pkgVersion = "2.70.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,oCAAoC,CAAC;AAC/C,QAAA,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,oCAAoC,CAAC;AAC/C,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-object-base\";\nexport const pkgVersion = \"2.70.0\";\n"]}
|
package/dist/sharedObject.d.ts
CHANGED
|
@@ -169,18 +169,7 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
|
|
|
169
169
|
*/
|
|
170
170
|
protected didAttach(): void;
|
|
171
171
|
/**
|
|
172
|
-
* Derived classes must override this to do custom processing on a remote
|
|
173
|
-
* @param message - The message to process
|
|
174
|
-
* @param local - True if the shared object is local
|
|
175
|
-
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
176
|
-
* For messages from a remote client, this will be undefined.
|
|
177
|
-
*
|
|
178
|
-
* @deprecated Replaced by {@link SharedObjectCore.processMessagesCore}.
|
|
179
|
-
*/
|
|
180
|
-
protected abstract processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
181
|
-
/**
|
|
182
|
-
* Process a 'bunch' of messages for this shared object.
|
|
183
|
-
*
|
|
172
|
+
* Derived classes must override this to do custom processing on a 'bunch' of remote messages.
|
|
184
173
|
* @remarks
|
|
185
174
|
* A 'bunch' is a group of messages that have the following properties:
|
|
186
175
|
* - They are all part of the same grouped batch, which entails:
|
|
@@ -193,13 +182,7 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
|
|
|
193
182
|
* @param messageCollection - The collection of messages to process.
|
|
194
183
|
*
|
|
195
184
|
*/
|
|
196
|
-
protected processMessagesCore
|
|
197
|
-
/**
|
|
198
|
-
* Calls {@link SharedObjectCore.processCore} or {@link SharedObjectCore.processMessagesCore} depending on whether
|
|
199
|
-
* processMessagesCore is defined. This helper is used to keep the code cleaner while we have to support both these
|
|
200
|
-
* function.
|
|
201
|
-
*/
|
|
202
|
-
private readonly processMessagesHelper;
|
|
185
|
+
protected abstract processMessagesCore(messagesCollection: IRuntimeMessageCollection): void;
|
|
203
186
|
/**
|
|
204
187
|
* Called when the object has disconnected from the delta stream.
|
|
205
188
|
*/
|
|
@@ -257,16 +240,6 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
|
|
|
257
240
|
* @param connected - true if connected, false otherwise.
|
|
258
241
|
*/
|
|
259
242
|
private setConnectionState;
|
|
260
|
-
/**
|
|
261
|
-
* Handles a message being received from the remote delta server.
|
|
262
|
-
* @param message - The message to process
|
|
263
|
-
* @param local - Whether the message originated from the local client
|
|
264
|
-
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
265
|
-
* For messages from a remote client, this will be undefined.
|
|
266
|
-
*
|
|
267
|
-
* @deprecated Replaced by {@link SharedObjectCore.processMessages}.
|
|
268
|
-
*/
|
|
269
|
-
private process;
|
|
270
243
|
/**
|
|
271
244
|
* Process a bunch of messages for this shared object. A bunch is group of messages that have the following properties:
|
|
272
245
|
* - They are all part of the same grouped batch, which entails:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedObject.d.ts","sourceRoot":"","sources":["../src/sharedObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EAA4B,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,KAAK,EACX,oBAAoB,EACpB,cAAc,EACd,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EACX,gBAAgB,EAChB,sBAAsB,EAEtB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EAGtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,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;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EACnD,OAAO,EAAE,CAAC,UAAU,eAAe,CAAC,aAAa,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC7E,iBAAiB,CAAC,aAAa,CAAC,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAiBpE"}
|
package/dist/sharedObject.js
CHANGED
|
@@ -83,13 +83,6 @@ class SharedObjectCore extends internal_4.EventEmitterWithErrorHandling {
|
|
|
83
83
|
const { opProcessingHelper, callbacksHelper } = this.setUpSampledTelemetryHelpers();
|
|
84
84
|
this.opProcessingHelper = opProcessingHelper;
|
|
85
85
|
this.callbacksHelper = callbacksHelper;
|
|
86
|
-
const processMessagesCore = this.processMessagesCore?.bind(this);
|
|
87
|
-
this.processMessagesHelper =
|
|
88
|
-
processMessagesCore === undefined
|
|
89
|
-
? (messagesCollection) => processHelper(messagesCollection, this.process.bind(this))
|
|
90
|
-
: (messagesCollection) => {
|
|
91
|
-
processMessagesCoreHelper(messagesCollection, this.opProcessingHelper, this.emitInternal.bind(this), processMessagesCore);
|
|
92
|
-
};
|
|
93
86
|
}
|
|
94
87
|
/**
|
|
95
88
|
* Accessor for `this.runtime`'s {@link @fluidframework/datastore-definitions#IFluidDataStoreRuntime.deltaManager} as a {@link @fluidframework/container-definitions/internal#IDeltaManager}
|
|
@@ -379,29 +372,6 @@ class SharedObjectCore extends internal_4.EventEmitterWithErrorHandling {
|
|
|
379
372
|
this.onDisconnect();
|
|
380
373
|
}
|
|
381
374
|
}
|
|
382
|
-
/**
|
|
383
|
-
* Handles a message being received from the remote delta server.
|
|
384
|
-
* @param message - The message to process
|
|
385
|
-
* @param local - Whether the message originated from the local client
|
|
386
|
-
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
387
|
-
* For messages from a remote client, this will be undefined.
|
|
388
|
-
*
|
|
389
|
-
* @deprecated Replaced by {@link SharedObjectCore.processMessages}.
|
|
390
|
-
*/
|
|
391
|
-
process(message, local, localOpMetadata) {
|
|
392
|
-
this.verifyNotClosed(); // This will result in container closure.
|
|
393
|
-
this.emitInternal("pre-op", message, local, this);
|
|
394
|
-
this.opProcessingHelper.measure(() => {
|
|
395
|
-
this.processCore(message, local, localOpMetadata);
|
|
396
|
-
const telemetryProperties = {
|
|
397
|
-
sequenceDifference: message.sequenceNumber - message.referenceSequenceNumber,
|
|
398
|
-
};
|
|
399
|
-
return {
|
|
400
|
-
customData: telemetryProperties,
|
|
401
|
-
};
|
|
402
|
-
}, local ? "local" : "remote");
|
|
403
|
-
this.emitInternal("op", message, local, this);
|
|
404
|
-
}
|
|
405
375
|
/* eslint-disable jsdoc/check-indentation */
|
|
406
376
|
/**
|
|
407
377
|
* Process a bunch of messages for this shared object. A bunch is group of messages that have the following properties:
|
|
@@ -417,9 +387,10 @@ class SharedObjectCore extends internal_4.EventEmitterWithErrorHandling {
|
|
|
417
387
|
/* eslint-enable jsdoc/check-indentation */
|
|
418
388
|
processMessages(messagesCollection) {
|
|
419
389
|
this.verifyNotClosed(); // This will result in container closure.
|
|
390
|
+
const { envelope, local, messagesContent } = messagesCollection;
|
|
420
391
|
// Decode any handles in the contents before processing the messages.
|
|
421
392
|
const decodedMessagesContent = [];
|
|
422
|
-
for (const { contents, localOpMetadata, clientSequenceNumber
|
|
393
|
+
for (const { contents, localOpMetadata, clientSequenceNumber } of messagesContent) {
|
|
423
394
|
const decodedMessageContent = {
|
|
424
395
|
contents: (0, utils_js_1.parseHandles)(contents, this.serializer),
|
|
425
396
|
localOpMetadata,
|
|
@@ -427,11 +398,32 @@ class SharedObjectCore extends internal_4.EventEmitterWithErrorHandling {
|
|
|
427
398
|
};
|
|
428
399
|
decodedMessagesContent.push(decodedMessageContent);
|
|
429
400
|
}
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
|
|
401
|
+
const emitEvents = (event) => {
|
|
402
|
+
for (const { contents, clientSequenceNumber } of decodedMessagesContent) {
|
|
403
|
+
const message = {
|
|
404
|
+
...envelope,
|
|
405
|
+
contents,
|
|
406
|
+
clientSequenceNumber,
|
|
407
|
+
};
|
|
408
|
+
this.emitInternal(event, message, local);
|
|
409
|
+
}
|
|
433
410
|
};
|
|
434
|
-
|
|
411
|
+
emitEvents("pre-op");
|
|
412
|
+
this.opProcessingHelper.measure(() => {
|
|
413
|
+
const decodedMessagesCollection = {
|
|
414
|
+
envelope,
|
|
415
|
+
local,
|
|
416
|
+
messagesContent: decodedMessagesContent,
|
|
417
|
+
};
|
|
418
|
+
this.processMessagesCore(decodedMessagesCollection);
|
|
419
|
+
const telemetryProperties = {
|
|
420
|
+
sequenceDifference: envelope.sequenceNumber - envelope.referenceSequenceNumber,
|
|
421
|
+
};
|
|
422
|
+
return {
|
|
423
|
+
customData: telemetryProperties,
|
|
424
|
+
};
|
|
425
|
+
}, local ? "local" : "remote");
|
|
426
|
+
emitEvents("op");
|
|
435
427
|
}
|
|
436
428
|
/**
|
|
437
429
|
* Called when a message has to be resubmitted. This typically happens for unacked messages after a
|
|
@@ -620,46 +612,4 @@ function isChannel(loadable) {
|
|
|
620
612
|
// This assumes no other IFluidLoadable has an `attributes` field, and thus may not be fully robust.
|
|
621
613
|
return loadable.attributes !== undefined;
|
|
622
614
|
}
|
|
623
|
-
/**
|
|
624
|
-
* Utility that processes the given messages in the message collection together by calling `processMessagesCore`.
|
|
625
|
-
* This will be called when {@link SharedObjectCore.processMessagesCore} is defined.
|
|
626
|
-
*/
|
|
627
|
-
function processMessagesCoreHelper(messagesCollection, opProcessingHelper, emitInternal, processMessagesCore) {
|
|
628
|
-
const { envelope, local, messagesContent } = messagesCollection;
|
|
629
|
-
const emitEvents = (event, messagesContentForEvent) => {
|
|
630
|
-
for (const { contents, clientSequenceNumber } of messagesContentForEvent) {
|
|
631
|
-
const message = {
|
|
632
|
-
...envelope,
|
|
633
|
-
contents,
|
|
634
|
-
clientSequenceNumber,
|
|
635
|
-
};
|
|
636
|
-
emitInternal(event, message, local);
|
|
637
|
-
}
|
|
638
|
-
};
|
|
639
|
-
emitEvents("pre-op", messagesContent);
|
|
640
|
-
opProcessingHelper.measure(() => {
|
|
641
|
-
processMessagesCore(messagesCollection);
|
|
642
|
-
const telemetryProperties = {
|
|
643
|
-
sequenceDifference: envelope.sequenceNumber - envelope.referenceSequenceNumber,
|
|
644
|
-
};
|
|
645
|
-
return {
|
|
646
|
-
customData: telemetryProperties,
|
|
647
|
-
};
|
|
648
|
-
}, local ? "local" : "remote");
|
|
649
|
-
emitEvents("op", messagesContent);
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* Utility that processes the given messages in the message collection one by one by calling `process`. This will
|
|
653
|
-
* be called when {@link SharedObjectCore.processMessagesCore} is not defined.
|
|
654
|
-
*/
|
|
655
|
-
function processHelper(messagesCollection, process) {
|
|
656
|
-
const { envelope, local, messagesContent } = messagesCollection;
|
|
657
|
-
for (const { contents, localOpMetadata, clientSequenceNumber } of messagesContent) {
|
|
658
|
-
process({
|
|
659
|
-
...envelope,
|
|
660
|
-
contents,
|
|
661
|
-
clientSequenceNumber,
|
|
662
|
-
}, local, localOpMetadata);
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
615
|
//# sourceMappingURL=sharedObject.js.map
|