@fluidframework/shared-object-base
Advanced tools
Comparing version 0.30.4 to 0.31.0
@@ -8,3 +8,3 @@ /*! | ||
export declare const pkgName = "@fluidframework/shared-object-base"; | ||
export declare const pkgVersion = "0.30.4"; | ||
export declare const pkgVersion = "0.31.0"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.pkgName = "@fluidframework/shared-object-base"; | ||
exports.pkgVersion = "0.30.4"; | ||
exports.pkgVersion = "0.31.0"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -9,3 +9,3 @@ /*! | ||
import { ISequencedDocumentMessage, ITree } from "@fluidframework/protocol-definitions"; | ||
import { IChannelSummarizeResult } from "@fluidframework/runtime-definitions"; | ||
import { IChannelSummarizeResult, IGCData } from "@fluidframework/runtime-definitions"; | ||
import { EventEmitterWithErrorHandling } from "@fluidframework/telemetry-utils"; | ||
@@ -102,2 +102,6 @@ import { ISharedObject, ISharedObjectEvents } from "./types"; | ||
/** | ||
* {@inheritDoc (ISharedObject:interface).getGCData} | ||
*/ | ||
getGCData(): IGCData; | ||
/** | ||
* back-compat 0.30 - This is deprecated. summarize() should be used instead. | ||
@@ -104,0 +108,0 @@ */ |
@@ -152,22 +152,54 @@ "use strict"; | ||
summarize(fullTree = false, trackState = false) { | ||
// Set _isSummarizing to true. This flag is used to ensure that we only use SummarySerializer (created below) | ||
// to serialize handles in this object's data. The routes of these serialized handles are outbound routes | ||
// to other Fluid objects. | ||
common_utils_1.assert(!this._isSummarizing, "Possible re-entrancy! Summary should not already be in progress."); | ||
this._isSummarizing = true; | ||
/** | ||
* Create a SummarySerializer that will be used to serialize IFluidHandles in this object. SummarySerializer | ||
* tracks the routes of all handles that it serializes. These represent routes to referenced Fluid object. | ||
*/ | ||
const serializer = new summarySerializer_1.SummarySerializer(this.runtime.channelsRoutingContext); | ||
const snapshot = this.snapshotCore(serializer); | ||
const summaryTree = runtime_utils_1.convertToSummaryTreeWithStats(snapshot, fullTree); | ||
/** | ||
* We need to add this channel's garbage collection node to the summarize result. | ||
* The outbound routes of this channel are all the routes of all the handles that are tracked by the | ||
* SummarySerializer created above. | ||
*/ | ||
const gcNodes = [ | ||
{ id: "/", outboundRoutes: serializer.getSerializedRoutes() }, | ||
]; | ||
this._isSummarizing = false; | ||
return Object.assign(Object.assign({}, summaryTree), { gcNodes }); | ||
let summaryTree; | ||
let gcData; | ||
try { | ||
const serializer = new summarySerializer_1.SummarySerializer(this.runtime.channelsRoutingContext); | ||
const snapshot = this.snapshotCore(serializer); | ||
summaryTree = runtime_utils_1.convertToSummaryTreeWithStats(snapshot, fullTree); | ||
// Add this channel's garbage collection data to the summarize result. The outbound routes of this channel | ||
// are all the routes of all the handles that are tracked by the SummarySerializer above. | ||
gcData = { | ||
gcNodes: { "/": serializer.getSerializedRoutes() }, | ||
}; | ||
common_utils_1.assert(this._isSummarizing, "Possible re-entrancy! Summary should have been in progress."); | ||
} | ||
finally { | ||
this._isSummarizing = false; | ||
} | ||
return Object.assign(Object.assign({}, summaryTree), { gcData }); | ||
} | ||
/** | ||
* {@inheritDoc (ISharedObject:interface).getGCData} | ||
*/ | ||
getGCData() { | ||
// We run the full summarize logic to get the list of outbound routes from this object. This is a little | ||
// expensive but its okay for now. It will be udpated to not use full summarize and make it more efficient. | ||
// See: https://github.com/microsoft/FluidFramework/issues/4547 | ||
// Set _isSummarizing to true. This flag is used to ensure that we only use SummarySerializer (created below) | ||
// to serialize handles in this object's data. The routes of these serialized handles are outbound routes | ||
// to other Fluid objects. | ||
common_utils_1.assert(!this._isSummarizing, "Possible re-entrancy! Summary should not already be in progress."); | ||
this._isSummarizing = true; | ||
let gcData; | ||
try { | ||
const serializer = new summarySerializer_1.SummarySerializer(this.runtime.channelsRoutingContext); | ||
this.snapshotCore(serializer); | ||
// The GC data for this shared object contains a single GC node. The outbound routes of this node are the | ||
// routes of handles serialized during snapshot. | ||
gcData = { | ||
gcNodes: { "/": serializer.getSerializedRoutes() }, | ||
}; | ||
common_utils_1.assert(this._isSummarizing, "Possible re-entrancy! Summary should have been in progress."); | ||
} | ||
finally { | ||
this._isSummarizing = false; | ||
} | ||
return gcData; | ||
} | ||
/** | ||
* back-compat 0.30 - This is deprecated. summarize() should be used instead. | ||
@@ -174,0 +206,0 @@ */ |
@@ -8,3 +8,3 @@ /*! | ||
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions"; | ||
import { IChannelSummarizeResult } from "@fluidframework/runtime-definitions"; | ||
import { IChannelSummarizeResult, IGCData } from "@fluidframework/runtime-definitions"; | ||
export interface ISharedObjectEvents extends IErrorEvent { | ||
@@ -37,3 +37,8 @@ (event: "pre-op" | "op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any; | ||
connect(services: IChannelServices): void; | ||
/** | ||
* Returns the GC data for this shared object. It contains a list of GC nodes that contains references to | ||
* other GC nodes. | ||
*/ | ||
getGCData(): IGCData; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
@@ -8,3 +8,3 @@ /*! | ||
export declare const pkgName = "@fluidframework/shared-object-base"; | ||
export declare const pkgVersion = "0.30.4"; | ||
export declare const pkgVersion = "0.31.0"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -8,3 +8,3 @@ /*! | ||
export const pkgName = "@fluidframework/shared-object-base"; | ||
export const pkgVersion = "0.30.4"; | ||
export const pkgVersion = "0.31.0"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -9,3 +9,3 @@ /*! | ||
import { ISequencedDocumentMessage, ITree } from "@fluidframework/protocol-definitions"; | ||
import { IChannelSummarizeResult } from "@fluidframework/runtime-definitions"; | ||
import { IChannelSummarizeResult, IGCData } from "@fluidframework/runtime-definitions"; | ||
import { EventEmitterWithErrorHandling } from "@fluidframework/telemetry-utils"; | ||
@@ -102,2 +102,6 @@ import { ISharedObject, ISharedObjectEvents } from "./types"; | ||
/** | ||
* {@inheritDoc (ISharedObject:interface).getGCData} | ||
*/ | ||
getGCData(): IGCData; | ||
/** | ||
* back-compat 0.30 - This is deprecated. summarize() should be used instead. | ||
@@ -104,0 +108,0 @@ */ |
@@ -150,22 +150,54 @@ /*! | ||
summarize(fullTree = false, trackState = false) { | ||
// Set _isSummarizing to true. This flag is used to ensure that we only use SummarySerializer (created below) | ||
// to serialize handles in this object's data. The routes of these serialized handles are outbound routes | ||
// to other Fluid objects. | ||
assert(!this._isSummarizing, "Possible re-entrancy! Summary should not already be in progress."); | ||
this._isSummarizing = true; | ||
/** | ||
* Create a SummarySerializer that will be used to serialize IFluidHandles in this object. SummarySerializer | ||
* tracks the routes of all handles that it serializes. These represent routes to referenced Fluid object. | ||
*/ | ||
const serializer = new SummarySerializer(this.runtime.channelsRoutingContext); | ||
const snapshot = this.snapshotCore(serializer); | ||
const summaryTree = convertToSummaryTreeWithStats(snapshot, fullTree); | ||
/** | ||
* We need to add this channel's garbage collection node to the summarize result. | ||
* The outbound routes of this channel are all the routes of all the handles that are tracked by the | ||
* SummarySerializer created above. | ||
*/ | ||
const gcNodes = [ | ||
{ id: "/", outboundRoutes: serializer.getSerializedRoutes() }, | ||
]; | ||
this._isSummarizing = false; | ||
return Object.assign(Object.assign({}, summaryTree), { gcNodes }); | ||
let summaryTree; | ||
let gcData; | ||
try { | ||
const serializer = new SummarySerializer(this.runtime.channelsRoutingContext); | ||
const snapshot = this.snapshotCore(serializer); | ||
summaryTree = convertToSummaryTreeWithStats(snapshot, fullTree); | ||
// Add this channel's garbage collection data to the summarize result. The outbound routes of this channel | ||
// are all the routes of all the handles that are tracked by the SummarySerializer above. | ||
gcData = { | ||
gcNodes: { "/": serializer.getSerializedRoutes() }, | ||
}; | ||
assert(this._isSummarizing, "Possible re-entrancy! Summary should have been in progress."); | ||
} | ||
finally { | ||
this._isSummarizing = false; | ||
} | ||
return Object.assign(Object.assign({}, summaryTree), { gcData }); | ||
} | ||
/** | ||
* {@inheritDoc (ISharedObject:interface).getGCData} | ||
*/ | ||
getGCData() { | ||
// We run the full summarize logic to get the list of outbound routes from this object. This is a little | ||
// expensive but its okay for now. It will be udpated to not use full summarize and make it more efficient. | ||
// See: https://github.com/microsoft/FluidFramework/issues/4547 | ||
// Set _isSummarizing to true. This flag is used to ensure that we only use SummarySerializer (created below) | ||
// to serialize handles in this object's data. The routes of these serialized handles are outbound routes | ||
// to other Fluid objects. | ||
assert(!this._isSummarizing, "Possible re-entrancy! Summary should not already be in progress."); | ||
this._isSummarizing = true; | ||
let gcData; | ||
try { | ||
const serializer = new SummarySerializer(this.runtime.channelsRoutingContext); | ||
this.snapshotCore(serializer); | ||
// The GC data for this shared object contains a single GC node. The outbound routes of this node are the | ||
// routes of handles serialized during snapshot. | ||
gcData = { | ||
gcNodes: { "/": serializer.getSerializedRoutes() }, | ||
}; | ||
assert(this._isSummarizing, "Possible re-entrancy! Summary should have been in progress."); | ||
} | ||
finally { | ||
this._isSummarizing = false; | ||
} | ||
return gcData; | ||
} | ||
/** | ||
* back-compat 0.30 - This is deprecated. summarize() should be used instead. | ||
@@ -172,0 +204,0 @@ */ |
@@ -8,3 +8,3 @@ /*! | ||
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions"; | ||
import { IChannelSummarizeResult } from "@fluidframework/runtime-definitions"; | ||
import { IChannelSummarizeResult, IGCData } from "@fluidframework/runtime-definitions"; | ||
export interface ISharedObjectEvents extends IErrorEvent { | ||
@@ -37,3 +37,8 @@ (event: "pre-op" | "op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any; | ||
connect(services: IChannelServices): void; | ||
/** | ||
* Returns the GC data for this shared object. It contains a list of GC nodes that contains references to | ||
* other GC nodes. | ||
*/ | ||
getGCData(): IGCData; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@fluidframework/shared-object-base", | ||
"version": "0.30.4", | ||
"version": "0.31.0", | ||
"description": "Fluid base class for shared distributed data structures", | ||
@@ -23,3 +23,3 @@ "homepage": "https://fluidframework.com", | ||
"eslint": "eslint --format stylish src", | ||
"eslint:fix": "eslint --ext=ts,tsx --format stylish src --fix", | ||
"eslint:fix": "eslint --format stylish src --fix", | ||
"lint": "npm run eslint", | ||
@@ -33,14 +33,14 @@ "lint:fix": "npm run eslint:fix", | ||
"@fluidframework/common-definitions": "^0.19.1", | ||
"@fluidframework/common-utils": "^0.25.0", | ||
"@fluidframework/container-definitions": "^0.30.4", | ||
"@fluidframework/core-interfaces": "^0.30.4", | ||
"@fluidframework/datastore": "^0.30.4", | ||
"@fluidframework/datastore-definitions": "^0.30.4", | ||
"@fluidframework/protocol-definitions": "^0.1015.0", | ||
"@fluidframework/runtime-definitions": "^0.30.4", | ||
"@fluidframework/runtime-utils": "^0.30.4", | ||
"@fluidframework/telemetry-utils": "^0.30.4", | ||
"@fluidframework/common-utils": "^0.26.0", | ||
"@fluidframework/container-definitions": "^0.31.0", | ||
"@fluidframework/core-interfaces": "^0.31.0", | ||
"@fluidframework/datastore": "^0.31.0", | ||
"@fluidframework/datastore-definitions": "^0.31.0", | ||
"@fluidframework/protocol-definitions": "^0.1016.1", | ||
"@fluidframework/runtime-definitions": "^0.31.0", | ||
"@fluidframework/runtime-utils": "^0.31.0", | ||
"@fluidframework/telemetry-utils": "^0.31.0", | ||
"assert": "^2.0.0", | ||
"debug": "^4.1.1", | ||
"uuid": "^3.3.2" | ||
"uuid": "^8.3.1" | ||
}, | ||
@@ -47,0 +47,0 @@ "devDependencies": { |
@@ -9,2 +9,2 @@ /*! | ||
export const pkgName = "@fluidframework/shared-object-base"; | ||
export const pkgVersion = "0.30.4"; | ||
export const pkgVersion = "0.31.0"; |
@@ -18,3 +18,3 @@ /*! | ||
import { ISequencedDocumentMessage, ITree } from "@fluidframework/protocol-definitions"; | ||
import { IChannelSummarizeResult, IGraphNode } from "@fluidframework/runtime-definitions"; | ||
import { IChannelSummarizeResult, IGCData, ISummaryTreeWithStats } from "@fluidframework/runtime-definitions"; | ||
import { convertToSummaryTreeWithStats, FluidSerializer } from "@fluidframework/runtime-utils"; | ||
@@ -212,26 +212,29 @@ import { ChildLogger, EventEmitterWithErrorHandling } from "@fluidframework/telemetry-utils"; | ||
public summarize(fullTree: boolean = false, trackState: boolean = false): IChannelSummarizeResult { | ||
// Set _isSummarizing to true. This flag is used to ensure that we only use SummarySerializer (created below) | ||
// to serialize handles in this object's data. The routes of these serialized handles are outbound routes | ||
// to other Fluid objects. | ||
assert(!this._isSummarizing, "Possible re-entrancy! Summary should not already be in progress."); | ||
this._isSummarizing = true; | ||
/** | ||
* Create a SummarySerializer that will be used to serialize IFluidHandles in this object. SummarySerializer | ||
* tracks the routes of all handles that it serializes. These represent routes to referenced Fluid object. | ||
*/ | ||
const serializer = new SummarySerializer(this.runtime.channelsRoutingContext); | ||
const snapshot: ITree = this.snapshotCore(serializer); | ||
const summaryTree = convertToSummaryTreeWithStats(snapshot, fullTree); | ||
let summaryTree: ISummaryTreeWithStats; | ||
let gcData: IGCData; | ||
try { | ||
const serializer = new SummarySerializer(this.runtime.channelsRoutingContext); | ||
const snapshot: ITree = this.snapshotCore(serializer); | ||
summaryTree = convertToSummaryTreeWithStats(snapshot, fullTree); | ||
/** | ||
* We need to add this channel's garbage collection node to the summarize result. | ||
* The outbound routes of this channel are all the routes of all the handles that are tracked by the | ||
* SummarySerializer created above. | ||
*/ | ||
const gcNodes: IGraphNode[] = [ | ||
{ id: "/", outboundRoutes: serializer.getSerializedRoutes() }, | ||
]; | ||
// Add this channel's garbage collection data to the summarize result. The outbound routes of this channel | ||
// are all the routes of all the handles that are tracked by the SummarySerializer above. | ||
gcData = { | ||
gcNodes: { "/": serializer.getSerializedRoutes() }, | ||
}; | ||
this._isSummarizing = false; | ||
assert(this._isSummarizing, "Possible re-entrancy! Summary should have been in progress."); | ||
} finally { | ||
this._isSummarizing = false; | ||
} | ||
return { | ||
...summaryTree, | ||
gcNodes, | ||
gcData, | ||
}; | ||
@@ -241,2 +244,35 @@ } | ||
/** | ||
* {@inheritDoc (ISharedObject:interface).getGCData} | ||
*/ | ||
public getGCData(): IGCData { | ||
// We run the full summarize logic to get the list of outbound routes from this object. This is a little | ||
// expensive but its okay for now. It will be udpated to not use full summarize and make it more efficient. | ||
// See: https://github.com/microsoft/FluidFramework/issues/4547 | ||
// Set _isSummarizing to true. This flag is used to ensure that we only use SummarySerializer (created below) | ||
// to serialize handles in this object's data. The routes of these serialized handles are outbound routes | ||
// to other Fluid objects. | ||
assert(!this._isSummarizing, "Possible re-entrancy! Summary should not already be in progress."); | ||
this._isSummarizing = true; | ||
let gcData: IGCData; | ||
try { | ||
const serializer = new SummarySerializer(this.runtime.channelsRoutingContext); | ||
this.snapshotCore(serializer); | ||
// The GC data for this shared object contains a single GC node. The outbound routes of this node are the | ||
// routes of handles serialized during snapshot. | ||
gcData = { | ||
gcNodes: { "/": serializer.getSerializedRoutes() }, | ||
}; | ||
assert(this._isSummarizing, "Possible re-entrancy! Summary should have been in progress."); | ||
} finally { | ||
this._isSummarizing = false; | ||
} | ||
return gcData; | ||
} | ||
/** | ||
* back-compat 0.30 - This is deprecated. summarize() should be used instead. | ||
@@ -243,0 +279,0 @@ */ |
@@ -9,3 +9,3 @@ /*! | ||
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions"; | ||
import { IChannelSummarizeResult } from "@fluidframework/runtime-definitions"; | ||
import { IChannelSummarizeResult, IGCData } from "@fluidframework/runtime-definitions"; | ||
@@ -45,2 +45,8 @@ export interface ISharedObjectEvents extends IErrorEvent { | ||
connect(services: IChannelServices): void; | ||
/** | ||
* Returns the GC data for this shared object. It contains a list of GC nodes that contains references to | ||
* other GC nodes. | ||
*/ | ||
getGCData(): IGCData; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
200583
2546
+ Added@fluidframework/common-utils@0.26.0(transitive)
+ Added@fluidframework/container-definitions@0.31.2(transitive)
+ Added@fluidframework/container-utils@0.31.2(transitive)
+ Added@fluidframework/core-interfaces@0.31.2(transitive)
+ Added@fluidframework/datastore@0.31.2(transitive)
+ Added@fluidframework/datastore-definitions@0.31.2(transitive)
+ Added@fluidframework/driver-definitions@0.31.2(transitive)
+ Added@fluidframework/driver-utils@0.31.2(transitive)
+ Added@fluidframework/garbage-collector@0.31.2(transitive)
+ Added@fluidframework/gitresources@0.1016.1(transitive)
+ Added@fluidframework/protocol-base@0.1016.1(transitive)
+ Added@fluidframework/protocol-definitions@0.1016.1(transitive)
+ Added@fluidframework/runtime-definitions@0.31.2(transitive)
+ Added@fluidframework/runtime-utils@0.31.2(transitive)
+ Added@fluidframework/telemetry-utils@0.31.2(transitive)
+ Addeduuid@8.3.2(transitive)
- Removed@fluidframework/common-utils@0.25.0(transitive)
- Removed@fluidframework/container-definitions@0.30.4(transitive)
- Removed@fluidframework/container-utils@0.30.4(transitive)
- Removed@fluidframework/core-interfaces@0.30.4(transitive)
- Removed@fluidframework/datastore@0.30.4(transitive)
- Removed@fluidframework/datastore-definitions@0.30.4(transitive)
- Removed@fluidframework/driver-definitions@0.30.4(transitive)
- Removed@fluidframework/driver-utils@0.30.4(transitive)
- Removed@fluidframework/gitresources@0.1015.0(transitive)
- Removed@fluidframework/protocol-base@0.1015.0(transitive)
- Removed@fluidframework/protocol-definitions@0.1015.0(transitive)
- Removed@fluidframework/runtime-definitions@0.30.4(transitive)
- Removed@fluidframework/runtime-utils@0.30.4(transitive)
- Removed@fluidframework/telemetry-utils@0.30.4(transitive)
- Removeduuid@3.4.0(transitive)
Updateduuid@^8.3.1