@fluidframework/shared-object-base 2.0.0-rc.1.0.3 → 2.0.0-rc.2.0.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/{.eslintrc.js → .eslintrc.cjs} +4 -1
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +10 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/shared-object-base.api.md +7 -9
- package/dist/handle.d.ts +1 -1
- package/dist/handle.d.ts.map +1 -1
- package/dist/handle.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/serializer.js +2 -2
- package/dist/serializer.js.map +1 -1
- package/dist/shared-object-base-alpha.d.ts +26 -10
- package/dist/shared-object-base-beta.d.ts +6 -277
- package/dist/shared-object-base-public.d.ts +6 -277
- package/dist/shared-object-base-untrimmed.d.ts +31 -10
- package/dist/sharedObject.d.ts +26 -12
- package/dist/sharedObject.d.ts.map +1 -1
- package/dist/sharedObject.js +56 -41
- package/dist/sharedObject.js.map +1 -1
- package/dist/summarySerializer.d.ts +1 -1
- package/dist/summarySerializer.d.ts.map +1 -1
- package/dist/summarySerializer.js +2 -2
- package/dist/summarySerializer.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/utils.d.ts +7 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +14 -1
- package/dist/utils.js.map +1 -1
- package/lib/{handle.d.mts → handle.d.ts} +2 -2
- package/lib/handle.d.ts.map +1 -0
- package/lib/{handle.mjs → handle.js} +1 -1
- package/lib/handle.js.map +1 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
- package/lib/packageVersion.js.map +1 -0
- package/lib/{remoteObjectHandle.d.mts → remoteObjectHandle.d.ts} +1 -1
- package/lib/remoteObjectHandle.d.ts.map +1 -0
- package/lib/{remoteObjectHandle.mjs → remoteObjectHandle.js} +1 -1
- package/lib/remoteObjectHandle.js.map +1 -0
- package/lib/{serializer.d.mts → serializer.d.ts} +1 -1
- package/lib/serializer.d.ts.map +1 -0
- package/lib/{serializer.mjs → serializer.js} +4 -2
- package/lib/serializer.js.map +1 -0
- package/lib/{shared-object-base-alpha.d.mts → shared-object-base-alpha.d.ts} +26 -10
- package/lib/shared-object-base-beta.d.ts +118 -0
- package/lib/shared-object-base-public.d.ts +118 -0
- package/lib/{shared-object-base-untrimmed.d.mts → shared-object-base-untrimmed.d.ts} +31 -10
- package/lib/{sharedObject.d.mts → sharedObject.d.ts} +27 -13
- package/lib/sharedObject.d.ts.map +1 -0
- package/lib/{sharedObject.mjs → sharedObject.js} +54 -39
- package/lib/sharedObject.js.map +1 -0
- package/lib/{summarySerializer.d.mts → summarySerializer.d.ts} +2 -2
- package/lib/summarySerializer.d.ts.map +1 -0
- package/lib/{summarySerializer.mjs → summarySerializer.js} +2 -2
- package/lib/summarySerializer.js.map +1 -0
- package/lib/test/attachingBindingAndConnecting.spec.js +334 -0
- package/lib/test/attachingBindingAndConnecting.spec.js.map +1 -0
- package/lib/test/serializer.spec.js +166 -0
- package/lib/test/serializer.spec.js.map +1 -0
- package/lib/test/sharedObject.spec.js +72 -0
- package/lib/test/sharedObject.spec.js.map +1 -0
- package/lib/test/types/validateSharedObjectBasePrevious.generated.js +26 -0
- package/lib/test/types/validateSharedObjectBasePrevious.generated.js.map +1 -0
- package/lib/test/utils.js +37 -0
- package/lib/test/utils.js.map +1 -0
- package/lib/{types.d.mts → types.d.ts} +1 -1
- package/lib/types.d.ts.map +1 -0
- package/lib/{types.mjs → types.js} +1 -1
- package/lib/types.js.map +1 -0
- package/lib/{utils.d.mts → utils.d.ts} +8 -2
- package/lib/utils.d.ts.map +1 -0
- package/lib/{utils.mjs → utils.js} +13 -1
- package/lib/utils.js.map +1 -0
- package/lib/{valueType.d.mts → valueType.d.ts} +1 -1
- package/lib/valueType.d.ts.map +1 -0
- package/lib/{valueType.mjs → valueType.js} +1 -1
- package/lib/valueType.js.map +1 -0
- package/package.json +44 -49
- package/src/handle.ts +1 -1
- package/src/index.ts +7 -6
- package/src/packageVersion.ts +1 -1
- package/src/serializer.ts +1 -1
- package/src/sharedObject.ts +84 -53
- package/src/summarySerializer.ts +1 -1
- package/src/utils.ts +14 -1
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/handle.d.mts.map +0 -1
- package/lib/handle.mjs.map +0 -1
- package/lib/index.d.mts +0 -11
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs +0 -10
- package/lib/index.mjs.map +0 -1
- package/lib/packageVersion.d.mts.map +0 -1
- package/lib/packageVersion.mjs.map +0 -1
- package/lib/remoteObjectHandle.d.mts.map +0 -1
- package/lib/remoteObjectHandle.mjs.map +0 -1
- package/lib/serializer.d.mts.map +0 -1
- package/lib/serializer.mjs.map +0 -1
- package/lib/shared-object-base-beta.d.mts +0 -389
- package/lib/shared-object-base-public.d.mts +0 -389
- package/lib/sharedObject.d.mts.map +0 -1
- package/lib/sharedObject.mjs.map +0 -1
- package/lib/summarySerializer.d.mts.map +0 -1
- package/lib/summarySerializer.mjs.map +0 -1
- package/lib/types.d.mts.map +0 -1
- package/lib/types.mjs.map +0 -1
- package/lib/utils.d.mts.map +0 -1
- package/lib/utils.mjs.map +0 -1
- package/lib/valueType.d.mts.map +0 -1
- package/lib/valueType.mjs.map +0 -1
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
extends: [
|
|
7
|
+
extends: [
|
|
8
|
+
require.resolve("@fluidframework/eslint-config-fluid/minimal-deprecated"),
|
|
9
|
+
"prettier",
|
|
10
|
+
],
|
|
8
11
|
parserOptions: {
|
|
9
12
|
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
13
|
},
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
const getFluidTestMochaConfig = require("@
|
|
8
|
+
const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");
|
|
9
9
|
|
|
10
10
|
const packageDir = __dirname;
|
|
11
11
|
const config = getFluidTestMochaConfig(packageDir);
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @fluidframework/shared-object-base
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.2.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fluid-framework: SharedObject classes are no longer exported as public ([#19717](https://github.com/microsoft/FluidFramework/issues/19717)) [ae1d0be26d](https://github.com/microsoft/FluidFramework/commits/ae1d0be26d61453cff316b3f622a9f3647149167)
|
|
8
|
+
|
|
9
|
+
`SharedObject` and `SharedObjectCore` are intended for authoring DDSes, and thus are only intended for use within the Fluid Framework client packages.
|
|
10
|
+
They is no longer publicly exported: any users should fine their own solution or be upstreamed.
|
|
11
|
+
`SharedObject` and `SharedObjectCore` are available for now as `@alpha` to make this migration less disrupting for any existing users.
|
|
12
|
+
|
|
3
13
|
## 2.0.0-rc.1.0.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-base
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
|
|
4
|
+
// CJS is actually secondary; so, no report.
|
|
5
|
+
"apiReport": {
|
|
6
|
+
"enabled": false
|
|
7
|
+
}
|
|
4
8
|
}
|
package/api-extractor-lint.json
CHANGED
package/api-extractor.json
CHANGED
|
@@ -23,6 +23,9 @@ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
|
23
23
|
import { ITelemetryContext } from '@fluidframework/runtime-definitions';
|
|
24
24
|
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
25
25
|
|
|
26
|
+
// @internal
|
|
27
|
+
export function bindHandles(value: any, serializer: IFluidSerializer, bind: IFluidHandle): void;
|
|
28
|
+
|
|
26
29
|
// @internal
|
|
27
30
|
export function createSingleBlobSummary(key: string, content: string | Uint8Array): ISummaryTreeWithStats;
|
|
28
31
|
|
|
@@ -75,34 +78,30 @@ export function parseHandles(value: any, serializer: IFluidSerializer): any;
|
|
|
75
78
|
// @internal
|
|
76
79
|
export function serializeHandles(value: any, serializer: IFluidSerializer, bind: IFluidHandle): string | undefined;
|
|
77
80
|
|
|
78
|
-
// @
|
|
81
|
+
// @alpha
|
|
79
82
|
export abstract class SharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends SharedObjectCore<TEvent> {
|
|
80
83
|
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes, telemetryContextPrefix: string);
|
|
81
|
-
// (undocumented)
|
|
82
84
|
getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
83
85
|
getGCData(fullGC?: boolean): IGarbageCollectionData;
|
|
84
86
|
protected processGCDataCore(serializer: IFluidSerializer): void;
|
|
85
87
|
// (undocumented)
|
|
86
88
|
protected get serializer(): IFluidSerializer;
|
|
87
|
-
// (undocumented)
|
|
88
89
|
summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): Promise<ISummaryTreeWithStats>;
|
|
89
90
|
protected abstract summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): ISummaryTreeWithStats;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
// @
|
|
93
|
+
// @alpha
|
|
93
94
|
export abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends EventEmitterWithErrorHandling<TEvent> implements ISharedObject<TEvent> {
|
|
94
95
|
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
|
|
95
|
-
protected abstract applyStashedOp(content: any):
|
|
96
|
+
protected abstract applyStashedOp(content: any): void;
|
|
96
97
|
// (undocumented)
|
|
97
98
|
readonly attributes: IChannelAttributes;
|
|
98
99
|
bindToContext(): void;
|
|
99
|
-
// (undocumented)
|
|
100
100
|
connect(services: IChannelServices): void;
|
|
101
101
|
get connected(): boolean;
|
|
102
102
|
protected didAttach(): void;
|
|
103
103
|
protected dirty(): void;
|
|
104
104
|
emit(event: EventEmitterEventType, ...args: any[]): boolean;
|
|
105
|
-
// (undocumented)
|
|
106
105
|
abstract getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
107
106
|
abstract getGCData(fullGC?: boolean): IGarbageCollectionData;
|
|
108
107
|
readonly handle: IFluidHandle;
|
|
@@ -113,7 +112,6 @@ export abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISha
|
|
|
113
112
|
get IFluidLoadable(): this;
|
|
114
113
|
initializeLocal(): void;
|
|
115
114
|
protected initializeLocalCore(): void;
|
|
116
|
-
// (undocumented)
|
|
117
115
|
isAttached(): boolean;
|
|
118
116
|
load(services: IChannelServices): Promise<void>;
|
|
119
117
|
protected abstract loadCore(services: IChannelStorageService): Promise<void>;
|
|
@@ -126,8 +124,8 @@ export abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISha
|
|
|
126
124
|
protected rollback(content: any, localOpMetadata: unknown): void;
|
|
127
125
|
// (undocumented)
|
|
128
126
|
protected runtime: IFluidDataStoreRuntime;
|
|
127
|
+
protected abstract get serializer(): IFluidSerializer;
|
|
129
128
|
protected submitLocalMessage(content: any, localOpMetadata?: unknown): void;
|
|
130
|
-
// (undocumented)
|
|
131
129
|
abstract summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
|
|
132
130
|
}
|
|
133
131
|
|
package/dist/handle.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IFluidHandleContext } from "@fluidframework/core-interfaces";
|
|
6
6
|
import { FluidObjectHandle } from "@fluidframework/datastore";
|
|
7
|
-
import { ISharedObject } from "./types";
|
|
7
|
+
import { ISharedObject } from "./types.js";
|
|
8
8
|
/**
|
|
9
9
|
* Handle for a shared object.
|
|
10
10
|
*
|
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,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;GAUG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB,CAAC,aAAa,CAAC;IAgBtE,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa;IAfxC;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;;;;;OAMG;gBAEiB,KAAK,EAAE,aAAa,EACvC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB;IAKlC;;;OAGG;IACI,WAAW,IAAI,IAAI;CAI1B"}
|
package/dist/handle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.js","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yDAA8D;AAG9D;;;;;;;;;;GAUG;AACH,MAAa,kBAAmB,SAAQ,6BAAgC;IACvE;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACH,YACoB,KAAoB,EACvC,IAAY,EACZ,YAAiC;QAEjC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QAJd,UAAK,GAAL,KAAK,CAAe;IAKxC,CAAC;IAED;;;OAGG;IACI,WAAW;QACjB,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;CACD;AA/BD,gDA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore\";\nimport { ISharedObject } from \"./types\";\n\n/**\n * Handle for a shared object.\n *\n * @remarks\n *\n * This object is used for already loaded (in-memory) shared objects and is used only for serialization purposes.\n *\n * De-serialization process goes through {@link @fluidframework/datastore#FluidObjectHandle}, and request flow:\n * {@link @fluidframework/datastore#FluidDataStoreRuntime.request} recognizes requests in the form of\n * '/\\<shared object id\\>' and loads shared object.\n */\nexport class SharedObjectHandle extends FluidObjectHandle<ISharedObject> {\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 * 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\trouteContext: IFluidHandleContext,\n\t) {\n\t\tsuper(value, path, routeContext);\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\tthis.value.bindToContext();\n\t\tsuper.attachGraph();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"handle.js","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yDAA8D;AAG9D;;;;;;;;;;GAUG;AACH,MAAa,kBAAmB,SAAQ,6BAAgC;IACvE;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACH,YACoB,KAAoB,EACvC,IAAY,EACZ,YAAiC;QAEjC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QAJd,UAAK,GAAL,KAAK,CAAe;IAKxC,CAAC;IAED;;;OAGG;IACI,WAAW;QACjB,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;CACD;AA/BD,gDA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore\";\nimport { ISharedObject } from \"./types.js\";\n\n/**\n * Handle for a shared object.\n *\n * @remarks\n *\n * This object is used for already loaded (in-memory) shared objects and is used only for serialization purposes.\n *\n * De-serialization process goes through {@link @fluidframework/datastore#FluidObjectHandle}, and request flow:\n * {@link @fluidframework/datastore#FluidDataStoreRuntime.request} recognizes requests in the form of\n * '/\\<shared object id\\>' and loads shared object.\n */\nexport class SharedObjectHandle extends FluidObjectHandle<ISharedObject> {\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 * 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\trouteContext: IFluidHandleContext,\n\t) {\n\t\tsuper(value, path, routeContext);\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\tthis.value.bindToContext();\n\t\tsuper.attachGraph();\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { FluidSerializer, IFluidSerializer } from "./serializer";
|
|
6
|
-
export { SharedObject, SharedObjectCore } from "./sharedObject";
|
|
7
|
-
export { SummarySerializer } from "./summarySerializer";
|
|
8
|
-
export { ISharedObject, ISharedObjectEvents } from "./types";
|
|
9
|
-
export { createSingleBlobSummary, makeHandlesSerializable, parseHandles, serializeHandles, } from "./utils";
|
|
10
|
-
export { ValueType } from "./valueType";
|
|
5
|
+
export { FluidSerializer, IFluidSerializer } from "./serializer.js";
|
|
6
|
+
export { SharedObject, SharedObjectCore } from "./sharedObject.js";
|
|
7
|
+
export { SummarySerializer } from "./summarySerializer.js";
|
|
8
|
+
export { ISharedObject, ISharedObjectEvents } from "./types.js";
|
|
9
|
+
export { createSingleBlobSummary, makeHandlesSerializable, parseHandles, serializeHandles, bindHandles, } from "./utils.js";
|
|
10
|
+
export { ValueType } from "./valueType.js";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EACN,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,WAAW,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ValueType = exports.serializeHandles = exports.parseHandles = exports.makeHandlesSerializable = exports.createSingleBlobSummary = exports.SummarySerializer = exports.SharedObjectCore = exports.SharedObject = exports.FluidSerializer = void 0;
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "FluidSerializer", { enumerable: true, get: function () { return
|
|
10
|
-
var
|
|
11
|
-
Object.defineProperty(exports, "SharedObject", { enumerable: true, get: function () { return
|
|
12
|
-
Object.defineProperty(exports, "SharedObjectCore", { enumerable: true, get: function () { return
|
|
13
|
-
var
|
|
14
|
-
Object.defineProperty(exports, "SummarySerializer", { enumerable: true, get: function () { return
|
|
15
|
-
var
|
|
16
|
-
Object.defineProperty(exports, "createSingleBlobSummary", { enumerable: true, get: function () { return
|
|
17
|
-
Object.defineProperty(exports, "makeHandlesSerializable", { enumerable: true, get: function () { return
|
|
18
|
-
Object.defineProperty(exports, "parseHandles", { enumerable: true, get: function () { return
|
|
19
|
-
Object.defineProperty(exports, "serializeHandles", { enumerable: true, get: function () { return
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
exports.ValueType = exports.bindHandles = exports.serializeHandles = exports.parseHandles = exports.makeHandlesSerializable = exports.createSingleBlobSummary = exports.SummarySerializer = exports.SharedObjectCore = exports.SharedObject = exports.FluidSerializer = void 0;
|
|
8
|
+
var serializer_js_1 = require("./serializer.js");
|
|
9
|
+
Object.defineProperty(exports, "FluidSerializer", { enumerable: true, get: function () { return serializer_js_1.FluidSerializer; } });
|
|
10
|
+
var sharedObject_js_1 = require("./sharedObject.js");
|
|
11
|
+
Object.defineProperty(exports, "SharedObject", { enumerable: true, get: function () { return sharedObject_js_1.SharedObject; } });
|
|
12
|
+
Object.defineProperty(exports, "SharedObjectCore", { enumerable: true, get: function () { return sharedObject_js_1.SharedObjectCore; } });
|
|
13
|
+
var summarySerializer_js_1 = require("./summarySerializer.js");
|
|
14
|
+
Object.defineProperty(exports, "SummarySerializer", { enumerable: true, get: function () { return summarySerializer_js_1.SummarySerializer; } });
|
|
15
|
+
var utils_js_1 = require("./utils.js");
|
|
16
|
+
Object.defineProperty(exports, "createSingleBlobSummary", { enumerable: true, get: function () { return utils_js_1.createSingleBlobSummary; } });
|
|
17
|
+
Object.defineProperty(exports, "makeHandlesSerializable", { enumerable: true, get: function () { return utils_js_1.makeHandlesSerializable; } });
|
|
18
|
+
Object.defineProperty(exports, "parseHandles", { enumerable: true, get: function () { return utils_js_1.parseHandles; } });
|
|
19
|
+
Object.defineProperty(exports, "serializeHandles", { enumerable: true, get: function () { return utils_js_1.serializeHandles; } });
|
|
20
|
+
Object.defineProperty(exports, "bindHandles", { enumerable: true, get: function () { return utils_js_1.bindHandles; } });
|
|
21
|
+
var valueType_js_1 = require("./valueType.js");
|
|
22
|
+
Object.defineProperty(exports, "ValueType", { enumerable: true, get: function () { return valueType_js_1.ValueType; } });
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAAoE;AAA3D,gHAAA,eAAe,OAAA;AACxB,qDAAmE;AAA1D,+GAAA,YAAY,OAAA;AAAE,mHAAA,gBAAgB,OAAA;AACvC,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA;AAE1B,uCAMoB;AALnB,mHAAA,uBAAuB,OAAA;AACvB,mHAAA,uBAAuB,OAAA;AACvB,wGAAA,YAAY,OAAA;AACZ,4GAAA,gBAAgB,OAAA;AAChB,uGAAA,WAAW,OAAA;AAEZ,+CAA2C;AAAlC,yGAAA,SAAS,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { FluidSerializer, IFluidSerializer } from \"./serializer.js\";\nexport { SharedObject, SharedObjectCore } from \"./sharedObject.js\";\nexport { SummarySerializer } from \"./summarySerializer.js\";\nexport { ISharedObject, ISharedObjectEvents } from \"./types.js\";\nexport {\n\tcreateSingleBlobSummary,\n\tmakeHandlesSerializable,\n\tparseHandles,\n\tserializeHandles,\n\tbindHandles,\n} from \"./utils.js\";\nexport { ValueType } from \"./valueType.js\";\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.0.0-rc.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-rc.2.0.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
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.0.0-rc.
|
|
11
|
+
exports.pkgVersion = "2.0.0-rc.2.0.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,gBAAgB,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.0.0-rc.
|
|
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,gBAAgB,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.0.0-rc.2.0.0\";\n"]}
|
package/dist/serializer.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.FluidSerializer = void 0;
|
|
|
8
8
|
// RATIONALE: Many methods consume and return 'any' by necessity.
|
|
9
9
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
10
10
|
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
11
|
-
const
|
|
11
|
+
const remoteObjectHandle_js_1 = require("./remoteObjectHandle.js");
|
|
12
12
|
/**
|
|
13
13
|
* Data Store serializer implementation
|
|
14
14
|
* @internal
|
|
@@ -37,7 +37,7 @@ class FluidSerializer {
|
|
|
37
37
|
const absolutePath = value.url.startsWith("/")
|
|
38
38
|
? value.url
|
|
39
39
|
: (0, runtime_utils_1.generateHandleContextPath)(value.url, this.context);
|
|
40
|
-
const parsedHandle = new
|
|
40
|
+
const parsedHandle = new remoteObjectHandle_js_1.RemoteFluidObjectHandle(absolutePath, this.root);
|
|
41
41
|
this.handleParsedCb(parsedHandle);
|
|
42
42
|
return parsedHandle;
|
|
43
43
|
}
|
package/dist/serializer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iEAAiE;AACjE,wDAAwD;AAExD,iEAA8F;AAE9F,6DAA+D;AAsC/D;;;GAGG;AACH,MAAa,eAAe;IAG3B,YACkB,OAA4B;IAC7C,+DAA+D;IAC9C,iBAAiD,GAAG,EAAE,GAAE,CAAC;QAF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a,KAAK,KAAK,EAAE;YAC5B,OAAO,aAAa,CAAC;SACrB;QAED,8EAA8E;QAC9E,IAAI,KAAyB,CAAC;QAC9B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;YACrC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;YACzB,yEAAyE;YACzE,IAAI,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBACzC,8FAA8F;gBAC9F,+FAA+F;gBAC/F,8DAA8D;gBAC9D,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAEnE,kGAAkG;gBAClG,+FAA+F;gBAC/F,wDAAwD;gBACxD,IAAI,QAAQ,KAAK,KAAK,EAAE;oBACvB,qFAAqF;oBACrF,KAAK,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;oBAEpE,+EAA+E;oBAC/E,oEAAoE;oBACpE,KAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;iBACvB;aACD;SACD;QACD,OAAO,KAAK,IAAI,KAAK,CAAC;IACvB,CAAC;IAES,eAAe,CAAC,MAAoB,EAAE,IAAkB;QACjE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClB,OAAO;YACN,IAAI,EAAE,kBAAkB;YACxB,GAAG,EAAE,MAAM,CAAC,YAAY;SACxB,CAAC;IACH,CAAC;CACD;AAnJD,0CAmJC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// RATIONALE: Many methods consume and return 'any' by necessity.\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n\nimport { generateHandleContextPath, isSerializedHandle } from \"@fluidframework/runtime-utils\";\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { RemoteFluidObjectHandle } from \"./remoteObjectHandle\";\n\n/**\n * @public\n */\nexport interface IFluidSerializer {\n\t/**\n\t * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object\n\t * where any embedded IFluidHandles have been replaced with a serializable form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t */\n\tencode(value: any, bind: IFluidHandle): any;\n\n\t/**\n\t * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an\n\t * equivalent object tree where any encoded IFluidHandles have been replaced with their decoded form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clone all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t *\n\t * The decoded handles are implicitly bound to the handle context of this serializer.\n\t */\n\tdecode(input: any): any;\n\n\t/**\n\t * Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.\n\t */\n\tstringify(value: any, bind: IFluidHandle): string;\n\n\t/**\n\t * Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid\n\t * handles will be realized as part of the parse\n\t */\n\tparse(value: string): any;\n}\n\n/**\n * Data Store serializer implementation\n * @internal\n */\nexport class FluidSerializer implements IFluidSerializer {\n\tprivate readonly root: IFluidHandleContext;\n\n\tpublic constructor(\n\t\tprivate readonly context: IFluidHandleContext,\n\t\t// To be called whenever a handle is parsed by this serializer.\n\t\tprivate readonly handleParsedCb: (handle: IFluidHandle) => void = () => {},\n\t) {\n\t\tthis.root = this.context;\n\t\twhile (this.root.routeContext !== undefined) {\n\t\t\tthis.root = this.root.routeContext;\n\t\t}\n\t}\n\n\tpublic get IFluidSerializer() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Given a mostly-jsonable object tree that may have handle objects embedded within, will return a\n\t * fully-jsonable object tree where any embedded IFluidHandles have been replaced with a serializable form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clone all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t *\n\t * Any unbound handles encountered are bound to the provided IFluidHandle.\n\t */\n\tpublic encode(input: any, bind: IFluidHandle) {\n\t\t// If the given 'input' cannot contain handles, return it immediately. Otherwise,\n\t\t// return the result of 'recursivelyReplace()'.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\treturn !!input && typeof input === \"object\"\n\t\t\t? this.recursivelyReplace(input, this.encodeValue, bind)\n\t\t\t: input;\n\t}\n\n\t/**\n\t * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an\n\t * equivalent object tree where any encoded IFluidHandles have been replaced with their decoded form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clone all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t *\n\t * The decoded handles are implicitly bound to the handle context of this serializer.\n\t */\n\tpublic decode(input: any) {\n\t\t// If the given 'input' cannot contain handles, return it immediately. Otherwise,\n\t\t// return the result of 'recursivelyReplace()'.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\treturn !!input && typeof input === \"object\"\n\t\t\t? this.recursivelyReplace(input, this.decodeValue)\n\t\t\t: input;\n\t}\n\n\tpublic stringify(input: any, bind: IFluidHandle) {\n\t\treturn JSON.stringify(input, (key, value) => this.encodeValue(value, bind));\n\t}\n\n\t// Parses the serialized data - context must match the context with which the JSON was stringified\n\tpublic parse(input: string) {\n\t\treturn JSON.parse(input, (key, value) => this.decodeValue(value));\n\t}\n\n\t// If the given 'value' is an IFluidHandle, returns the encoded IFluidHandle.\n\t// Otherwise returns the original 'value'. Used by 'encode()' and 'stringify()'.\n\tprivate readonly encodeValue = (value: any, bind: IFluidHandle) => {\n\t\t// Detect if 'value' is an IFluidHandle.\n\t\tconst handle = value?.IFluidHandle;\n\n\t\t// If 'value' is an IFluidHandle return its encoded form.\n\t\treturn handle !== undefined ? this.serializeHandle(handle, bind) : value;\n\t};\n\n\t// If the given 'value' is an encoded IFluidHandle, returns the decoded IFluidHandle.\n\t// Otherwise returns the original 'value'. Used by 'decode()' and 'parse()'.\n\tprivate readonly decodeValue = (value: any) => {\n\t\t// If 'value' is a serialized IFluidHandle return the deserialized result.\n\t\tif (isSerializedHandle(value)) {\n\t\t\t// Old documents may have handles with relative path in their summaries. Convert these to absolute\n\t\t\t// paths. This will ensure that future summaries will have absolute paths for these handles.\n\t\t\tconst absolutePath = value.url.startsWith(\"/\")\n\t\t\t\t? value.url\n\t\t\t\t: generateHandleContextPath(value.url, this.context);\n\n\t\t\tconst parsedHandle = new RemoteFluidObjectHandle(absolutePath, this.root);\n\t\t\tthis.handleParsedCb(parsedHandle);\n\t\t\treturn parsedHandle;\n\t\t} else {\n\t\t\treturn value;\n\t\t}\n\t};\n\n\t// Invoked for non-null objects to recursively replace references to IFluidHandles.\n\t// Clones as-needed to avoid mutating the `input` object. If no IFluidHandes are present,\n\t// returns the original `input`.\n\tprivate recursivelyReplace(\n\t\tinput: any,\n\t\treplacer: (input: any, context: any) => any,\n\t\tcontext?: any,\n\t) {\n\t\t// Note: Caller is responsible for ensuring that `input` is defined / non-null.\n\t\t// (Required for Object.keys() below.)\n\n\t\t// Execute the `replace` on the current input. Note that Caller is responsible for ensuring that `input`\n\t\t// is a non-null object.\n\t\tconst maybeReplaced = replacer(input, context);\n\n\t\t// If the replacer made a substitution there is no need to decscend further. IFluidHandles are always\n\t\t// leaves in the object graph.\n\t\tif (maybeReplaced !== input) {\n\t\t\treturn maybeReplaced;\n\t\t}\n\n\t\t// Otherwise descend into the object graph looking for IFluidHandle instances.\n\t\tlet clone: object | undefined;\n\t\tfor (const key of Object.keys(input)) {\n\t\t\tconst value = input[key];\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\tif (!!value && typeof value === \"object\") {\n\t\t\t\t// Note: Except for IFluidHandle, `input` must not contain circular references (as object must\n\t\t\t\t// be JSON serializable.) Therefore, guarding against infinite recursion here would only\n\t\t\t\t// lead to a later error when attempting to stringify().\n\t\t\t\tconst replaced = this.recursivelyReplace(value, replacer, context);\n\n\t\t\t\t// If the `replaced` object is different than the original `value` then the subgraph contained one\n\t\t\t\t// or more handles. If this happens, we need to return a clone of the `input` object where the\n\t\t\t\t// current property is replaced by the `replaced` value.\n\t\t\t\tif (replaced !== value) {\n\t\t\t\t\t// Lazily create a shallow clone of the `input` object if we haven't done so already.\n\t\t\t\t\tclone = clone ?? (Array.isArray(input) ? [...input] : { ...input });\n\n\t\t\t\t\t// Overwrite the current property `key` in the clone with the `replaced` value.\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tclone![key] = replaced;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn clone ?? input;\n\t}\n\n\tprotected serializeHandle(handle: IFluidHandle, bind: IFluidHandle) {\n\t\tbind.bind(handle);\n\t\treturn {\n\t\t\ttype: \"__fluid_handle__\",\n\t\t\turl: handle.absolutePath,\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../src/serializer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iEAAiE;AACjE,wDAAwD;AAExD,iEAA8F;AAE9F,mEAAkE;AAsClE;;;GAGG;AACH,MAAa,eAAe;IAG3B,YACkB,OAA4B;IAC7C,+DAA+D;IAC9C,iBAAiD,GAAG,EAAE,GAAE,CAAC;QAFzD,YAAO,GAAP,OAAO,CAAqB;QAE5B,mBAAc,GAAd,cAAc,CAA2C;QAyD3E,6EAA6E;QAC7E,iFAAiF;QAChE,gBAAW,GAAG,CAAC,KAAU,EAAE,IAAkB,EAAE,EAAE;YACjE,wCAAwC;YACxC,MAAM,MAAM,GAAG,KAAK,EAAE,YAAY,CAAC;YAEnC,yDAAyD;YACzD,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,C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AE;gBACzC,8FAA8F;gBAC9F,+FAA+F;gBAC/F,8DAA8D;gBAC9D,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAEnE,kGAAkG;gBAClG,+FAA+F;gBAC/F,wDAAwD;gBACxD,IAAI,QAAQ,KAAK,KAAK,EAAE;oBACvB,qFAAqF;oBACrF,KAAK,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;oBAEpE,+EAA+E;oBAC/E,oEAAoE;oBACpE,KAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;iBACvB;aACD;SACD;QACD,OAAO,KAAK,IAAI,KAAK,CAAC;IACvB,CAAC;IAES,eAAe,CAAC,MAAoB,EAAE,IAAkB;QACjE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClB,OAAO;YACN,IAAI,EAAE,kBAAkB;YACxB,GAAG,EAAE,MAAM,CAAC,YAAY;SACxB,CAAC;IACH,CAAC;CACD;AAnJD,0CAmJC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// RATIONALE: Many methods consume and return 'any' by necessity.\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n\nimport { generateHandleContextPath, isSerializedHandle } from \"@fluidframework/runtime-utils\";\nimport { IFluidHandle, IFluidHandleContext } from \"@fluidframework/core-interfaces\";\nimport { RemoteFluidObjectHandle } from \"./remoteObjectHandle.js\";\n\n/**\n * @public\n */\nexport interface IFluidSerializer {\n\t/**\n\t * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object\n\t * where any embedded IFluidHandles have been replaced with a serializable form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clones all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t */\n\tencode(value: any, bind: IFluidHandle): any;\n\n\t/**\n\t * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an\n\t * equivalent object tree where any encoded IFluidHandles have been replaced with their decoded form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clone all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t *\n\t * The decoded handles are implicitly bound to the handle context of this serializer.\n\t */\n\tdecode(input: any): any;\n\n\t/**\n\t * Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.\n\t */\n\tstringify(value: any, bind: IFluidHandle): string;\n\n\t/**\n\t * Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid\n\t * handles will be realized as part of the parse\n\t */\n\tparse(value: string): any;\n}\n\n/**\n * Data Store serializer implementation\n * @internal\n */\nexport class FluidSerializer implements IFluidSerializer {\n\tprivate readonly root: IFluidHandleContext;\n\n\tpublic constructor(\n\t\tprivate readonly context: IFluidHandleContext,\n\t\t// To be called whenever a handle is parsed by this serializer.\n\t\tprivate readonly handleParsedCb: (handle: IFluidHandle) => void = () => {},\n\t) {\n\t\tthis.root = this.context;\n\t\twhile (this.root.routeContext !== undefined) {\n\t\t\tthis.root = this.root.routeContext;\n\t\t}\n\t}\n\n\tpublic get IFluidSerializer() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Given a mostly-jsonable object tree that may have handle objects embedded within, will return a\n\t * fully-jsonable object tree where any embedded IFluidHandles have been replaced with a serializable form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clone all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t *\n\t * Any unbound handles encountered are bound to the provided IFluidHandle.\n\t */\n\tpublic encode(input: any, bind: IFluidHandle) {\n\t\t// If the given 'input' cannot contain handles, return it immediately. Otherwise,\n\t\t// return the result of 'recursivelyReplace()'.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\treturn !!input && typeof input === \"object\"\n\t\t\t? this.recursivelyReplace(input, this.encodeValue, bind)\n\t\t\t: input;\n\t}\n\n\t/**\n\t * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an\n\t * equivalent object tree where any encoded IFluidHandles have been replaced with their decoded form.\n\t *\n\t * The original `input` object is not mutated. This method will shallowly clone all objects in the path from\n\t * the root to any replaced handles. (If no handles are found, returns the original object.)\n\t *\n\t * The decoded handles are implicitly bound to the handle context of this serializer.\n\t */\n\tpublic decode(input: any) {\n\t\t// If the given 'input' cannot contain handles, return it immediately. Otherwise,\n\t\t// return the result of 'recursivelyReplace()'.\n\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\treturn !!input && typeof input === \"object\"\n\t\t\t? this.recursivelyReplace(input, this.decodeValue)\n\t\t\t: input;\n\t}\n\n\tpublic stringify(input: any, bind: IFluidHandle) {\n\t\treturn JSON.stringify(input, (key, value) => this.encodeValue(value, bind));\n\t}\n\n\t// Parses the serialized data - context must match the context with which the JSON was stringified\n\tpublic parse(input: string) {\n\t\treturn JSON.parse(input, (key, value) => this.decodeValue(value));\n\t}\n\n\t// If the given 'value' is an IFluidHandle, returns the encoded IFluidHandle.\n\t// Otherwise returns the original 'value'. Used by 'encode()' and 'stringify()'.\n\tprivate readonly encodeValue = (value: any, bind: IFluidHandle) => {\n\t\t// Detect if 'value' is an IFluidHandle.\n\t\tconst handle = value?.IFluidHandle;\n\n\t\t// If 'value' is an IFluidHandle return its encoded form.\n\t\treturn handle !== undefined ? this.serializeHandle(handle, bind) : value;\n\t};\n\n\t// If the given 'value' is an encoded IFluidHandle, returns the decoded IFluidHandle.\n\t// Otherwise returns the original 'value'. Used by 'decode()' and 'parse()'.\n\tprivate readonly decodeValue = (value: any) => {\n\t\t// If 'value' is a serialized IFluidHandle return the deserialized result.\n\t\tif (isSerializedHandle(value)) {\n\t\t\t// Old documents may have handles with relative path in their summaries. Convert these to absolute\n\t\t\t// paths. This will ensure that future summaries will have absolute paths for these handles.\n\t\t\tconst absolutePath = value.url.startsWith(\"/\")\n\t\t\t\t? value.url\n\t\t\t\t: generateHandleContextPath(value.url, this.context);\n\n\t\t\tconst parsedHandle = new RemoteFluidObjectHandle(absolutePath, this.root);\n\t\t\tthis.handleParsedCb(parsedHandle);\n\t\t\treturn parsedHandle;\n\t\t} else {\n\t\t\treturn value;\n\t\t}\n\t};\n\n\t// Invoked for non-null objects to recursively replace references to IFluidHandles.\n\t// Clones as-needed to avoid mutating the `input` object. If no IFluidHandes are present,\n\t// returns the original `input`.\n\tprivate recursivelyReplace(\n\t\tinput: any,\n\t\treplacer: (input: any, context: any) => any,\n\t\tcontext?: any,\n\t) {\n\t\t// Note: Caller is responsible for ensuring that `input` is defined / non-null.\n\t\t// (Required for Object.keys() below.)\n\n\t\t// Execute the `replace` on the current input. Note that Caller is responsible for ensuring that `input`\n\t\t// is a non-null object.\n\t\tconst maybeReplaced = replacer(input, context);\n\n\t\t// If the replacer made a substitution there is no need to decscend further. IFluidHandles are always\n\t\t// leaves in the object graph.\n\t\tif (maybeReplaced !== input) {\n\t\t\treturn maybeReplaced;\n\t\t}\n\n\t\t// Otherwise descend into the object graph looking for IFluidHandle instances.\n\t\tlet clone: object | undefined;\n\t\tfor (const key of Object.keys(input)) {\n\t\t\tconst value = input[key];\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\tif (!!value && typeof value === \"object\") {\n\t\t\t\t// Note: Except for IFluidHandle, `input` must not contain circular references (as object must\n\t\t\t\t// be JSON serializable.) Therefore, guarding against infinite recursion here would only\n\t\t\t\t// lead to a later error when attempting to stringify().\n\t\t\t\tconst replaced = this.recursivelyReplace(value, replacer, context);\n\n\t\t\t\t// If the `replaced` object is different than the original `value` then the subgraph contained one\n\t\t\t\t// or more handles. If this happens, we need to return a clone of the `input` object where the\n\t\t\t\t// current property is replaced by the `replaced` value.\n\t\t\t\tif (replaced !== value) {\n\t\t\t\t\t// Lazily create a shallow clone of the `input` object if we haven't done so already.\n\t\t\t\t\tclone = clone ?? (Array.isArray(input) ? [...input] : { ...input });\n\n\t\t\t\t\t// Overwrite the current property `key` in the clone with the `replaced` value.\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tclone![key] = replaced;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn clone ?? input;\n\t}\n\n\tprotected serializeHandle(handle: IFluidHandle, bind: IFluidHandle) {\n\t\tbind.bind(handle);\n\t\treturn {\n\t\t\ttype: \"__fluid_handle__\",\n\t\t\turl: handle.absolutePath,\n\t\t};\n\t}\n}\n"]}
|
|
@@ -17,6 +17,8 @@ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
|
17
17
|
import { ITelemetryContext } from '@fluidframework/runtime-definitions';
|
|
18
18
|
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
19
19
|
|
|
20
|
+
/* Excluded from this release type: bindHandles */
|
|
21
|
+
|
|
20
22
|
/* Excluded from this release type: createSingleBlobSummary */
|
|
21
23
|
|
|
22
24
|
/* Excluded from this release type: FluidSerializer */
|
|
@@ -128,7 +130,7 @@ export declare function parseHandles(value: any, serializer: IFluidSerializer):
|
|
|
128
130
|
/**
|
|
129
131
|
* SharedObject with simplified, synchronous summarization and GC.
|
|
130
132
|
* DDS implementations with async and incremental summarization should extend SharedObjectCore directly instead.
|
|
131
|
-
* @
|
|
133
|
+
* @alpha
|
|
132
134
|
*/
|
|
133
135
|
export declare abstract class SharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends SharedObjectCore<TEvent> {
|
|
134
136
|
private readonly telemetryContextPrefix;
|
|
@@ -174,7 +176,7 @@ export declare abstract class SharedObject<TEvent extends ISharedObjectEvents =
|
|
|
174
176
|
|
|
175
177
|
/**
|
|
176
178
|
* Base class from which all shared objects derive.
|
|
177
|
-
* @
|
|
179
|
+
* @alpha
|
|
178
180
|
*/
|
|
179
181
|
export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends EventEmitterWithErrorHandling<TEvent> implements ISharedObject<TEvent> {
|
|
180
182
|
id: string;
|
|
@@ -247,7 +249,7 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
|
|
|
247
249
|
* allow processing of ops or local changes, which very quickly results in container closure.
|
|
248
250
|
*/
|
|
249
251
|
private eventListenerErrorHandler;
|
|
250
|
-
private
|
|
252
|
+
private setBoundAndHandleAttach;
|
|
251
253
|
/**
|
|
252
254
|
* A shared object, after construction, can either be loaded in the case that it is already part of
|
|
253
255
|
* a shared document. Or later attached if it is being newly added.
|
|
@@ -315,9 +317,14 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
|
|
|
315
317
|
* Called when the object has disconnected from the delta stream.
|
|
316
318
|
*/
|
|
317
319
|
protected abstract onDisconnect(): any;
|
|
320
|
+
/**
|
|
321
|
+
* The serializer to serialize / parse handles.
|
|
322
|
+
*/
|
|
323
|
+
protected abstract get serializer(): IFluidSerializer;
|
|
318
324
|
/**
|
|
319
325
|
* Submits a message by the local client to the runtime.
|
|
320
|
-
* @param content - Content of the message
|
|
326
|
+
* @param content - Content of the message. Note: handles contained in the
|
|
327
|
+
* message object should not be encoded in any way
|
|
321
328
|
* @param localOpMetadata - The local metadata associated with the message. This is kept locally by the runtime
|
|
322
329
|
* and not sent to the server. This will be sent back when this message is received back from the server. This is
|
|
323
330
|
* also sent if we are asked to resubmit the message.
|
|
@@ -375,14 +382,23 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
|
|
|
375
382
|
*/
|
|
376
383
|
protected rollback(content: any, localOpMetadata: unknown): void;
|
|
377
384
|
/**
|
|
378
|
-
* Apply changes from
|
|
379
|
-
*
|
|
380
|
-
*
|
|
385
|
+
* Apply changes from the provided op content just as if a local client has made the change,
|
|
386
|
+
* including submitting the op. Used when rehydrating an attached container
|
|
387
|
+
* with pending changes. The rehydration process replays all remote ops
|
|
388
|
+
* and applies stashed ops after the remote op with a sequence number
|
|
389
|
+
* that matches that of the stashed op is applied. This ensures
|
|
390
|
+
* stashed ops are applied at the same state they were originally created.
|
|
391
|
+
*
|
|
392
|
+
* It is possible that stashed ops have been sent in the past, and will be found when
|
|
393
|
+
* the shared object catches up with remotes ops.
|
|
394
|
+
* So this prepares the SharedObject for seeing potentially seeing the ACK.
|
|
395
|
+
* If no matching remote op is found, all the applied stashed ops will go
|
|
396
|
+
* through the normal resubmit flow upon reconnection, which allows the dds
|
|
397
|
+
* to rebase them to the latest state, and then resubmit them.
|
|
398
|
+
*
|
|
381
399
|
* @param content - Contents of a stashed op.
|
|
382
|
-
* @returns localMetadata of the op, to be passed to process() or resubmit()
|
|
383
|
-
* when the op is ACKed or resubmitted, respectively
|
|
384
400
|
*/
|
|
385
|
-
protected abstract applyStashedOp(content: any):
|
|
401
|
+
protected abstract applyStashedOp(content: any): void;
|
|
386
402
|
/**
|
|
387
403
|
* Emit an event. This function is only intended for use by DDS classes that extend SharedObject/SharedObjectCore,
|
|
388
404
|
* specifically to emit events that are part of the public interface of the DDS (i.e. those that can have listeners
|