@fluidframework/devtools-core 2.71.0 → 2.73.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.cjs +1 -1
- package/CHANGELOG.md +8 -10
- package/dist/data-visualization/DataVisualization.js +1 -1
- package/dist/data-visualization/DataVisualization.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/data-visualization/DataVisualization.js +1 -1
- package/lib/data-visualization/DataVisualization.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +27 -27
- package/src/data-visualization/DataVisualization.ts +2 -2
- package/src/packageVersion.ts +1 -1
package/.eslintrc.cjs
CHANGED
|
@@ -22,7 +22,7 @@ module.exports = {
|
|
|
22
22
|
plugins: ["chai-expect"],
|
|
23
23
|
extends: ["plugin:chai-expect/recommended"],
|
|
24
24
|
rules: {
|
|
25
|
-
"import/no-nodejs-modules": "off",
|
|
25
|
+
"import-x/no-nodejs-modules": "off",
|
|
26
26
|
"unicorn/prefer-module": "off",
|
|
27
27
|
|
|
28
28
|
// Superseded by chai-expect rule
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @fluidframework/devtools-core
|
|
2
2
|
|
|
3
|
+
## 2.73.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.72.0
|
|
8
|
+
|
|
9
|
+
Dependency updates only.
|
|
10
|
+
|
|
3
11
|
## 2.71.0
|
|
4
12
|
|
|
5
13
|
Dependency updates only.
|
|
@@ -11,7 +19,6 @@ Dependency updates only.
|
|
|
11
19
|
- Promote core devtools APIs from alpha to beta ([#25695](https://github.com/microsoft/FluidFramework/pull/25695)) [7c8e203249](https://github.com/microsoft/FluidFramework/commit/7c8e20324935717d8f7b599c3ec2a1b570b96ba1)
|
|
12
20
|
|
|
13
21
|
The primary devtools APIs may now be imported from `/beta`. This includes:
|
|
14
|
-
|
|
15
22
|
- **`initializeDevtools`** - Initialize the devtools singleton
|
|
16
23
|
- **`tryGetFluidDevtools`** - Get the existing devtools instance if initialized
|
|
17
24
|
- **`IFluidDevtools`** - Main devtools interface for registering containers
|
|
@@ -133,12 +140,10 @@ Dependency updates only.
|
|
|
133
140
|
|
|
134
141
|
APIs that were never intended for direct consumer use have been marked as `@system`.
|
|
135
142
|
These are:
|
|
136
|
-
|
|
137
143
|
- HasContainerKey
|
|
138
144
|
|
|
139
145
|
APIs that were not intended to be extended by consumers have been marked as `@sealed`.
|
|
140
146
|
These are:
|
|
141
|
-
|
|
142
147
|
- ContainerDevtoolsProps
|
|
143
148
|
- DevtoolsProps
|
|
144
149
|
- HasContainerKey
|
|
@@ -159,7 +164,6 @@ Dependency updates only.
|
|
|
159
164
|
Similarly, `IDeltaManager.outbound` contained functionality that could break core runtime features such as generation of batches and chunking. Data loss or corruption could occur when `IDeltaManger.inbound.pause()` or `IDeltaManager.inbound.resume()` were called.
|
|
160
165
|
|
|
161
166
|
#### Alternatives
|
|
162
|
-
|
|
163
167
|
- Alternatives to `IDeltaManager.inbound.on("op", ...)` are `IDeltaManager.on("op", ...)`
|
|
164
168
|
- Alternatives to calling `IDeltaManager.inbound.pause`, `IDeltaManager.outbound.pause` for `IContainer` disconnect use `IContainer.disconnect`.
|
|
165
169
|
- Alternatives to calling `IDeltaManager.inbound.resume`, `IDeltaManager.outbound.resume` for `IContainer` reconnect use `IContainer.connect`.
|
|
@@ -207,7 +211,6 @@ Dependency updates only.
|
|
|
207
211
|
TypeScript types and implementation code.
|
|
208
212
|
|
|
209
213
|
This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
|
|
210
|
-
|
|
211
214
|
- `"moduleResolution": "Node16"` with `"module": "Node16"`
|
|
212
215
|
- `"moduleResolution": "Bundler"` with `"module": "ESNext"`
|
|
213
216
|
|
|
@@ -246,7 +249,6 @@ Dependency updates only.
|
|
|
246
249
|
limitation of serialization.
|
|
247
250
|
|
|
248
251
|
Additional modifications:
|
|
249
|
-
|
|
250
252
|
- `Jsonable`'s `TReplacement` parameter default has also been changed from `void` to `never`, which now disallows
|
|
251
253
|
`void`.
|
|
252
254
|
- Unrecognized primitive types like `symbol` are now filtered to `never` instead of `{}`.
|
|
@@ -284,7 +286,6 @@ Dependency updates only.
|
|
|
284
286
|
- Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
285
287
|
|
|
286
288
|
This included the following changes from the protocol-definitions release:
|
|
287
|
-
|
|
288
289
|
- Updating signal interfaces for some planned improvements. The intention is split the interface between signals
|
|
289
290
|
submitted by clients to the server and the resulting signals sent from the server to clients.
|
|
290
291
|
- A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
|
|
@@ -295,7 +296,6 @@ Dependency updates only.
|
|
|
295
296
|
- Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
296
297
|
|
|
297
298
|
Dependencies on the following Fluid server package have been updated to version 2.0.1:
|
|
298
|
-
|
|
299
299
|
- @fluidframework/gitresources: 2.0.1
|
|
300
300
|
- @fluidframework/server-kafka-orderer: 2.0.1
|
|
301
301
|
- @fluidframework/server-lambdas: 2.0.1
|
|
@@ -320,7 +320,6 @@ Dependency updates only.
|
|
|
320
320
|
- test-utils: provideEntryPoint is required [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
321
321
|
|
|
322
322
|
The optional `provideEntryPoint` method has become required on a number of constructors. A value will need to be provided to the following classes:
|
|
323
|
-
|
|
324
323
|
- `BaseContainerRuntimeFactory`
|
|
325
324
|
- `RuntimeFactory`
|
|
326
325
|
- `ContainerRuntime` (constructor and `loadRuntime`)
|
|
@@ -353,7 +352,6 @@ Dependency updates only.
|
|
|
353
352
|
|
|
354
353
|
The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
|
|
355
354
|
imported from the **@fluidframework/core-interfaces** package:
|
|
356
|
-
|
|
357
355
|
- interface IDisposable
|
|
358
356
|
- interface IErrorEvent
|
|
359
357
|
- interface IErrorEvent
|
|
@@ -311,7 +311,7 @@ async function visualizeChildData(data, resolveHandle) {
|
|
|
311
311
|
nodeKind: VisualTree_js_1.VisualNodeKind.ValueNode,
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
|
-
// eslint-disable-next-line import/no-deprecated
|
|
314
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
315
315
|
if (data?.IFluidHandle !== undefined) {
|
|
316
316
|
// If we encounter a Fluid handle, register it for future rendering, and return a node with its ID.
|
|
317
317
|
const handle = data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataVisualization.js","sourceRoot":"","sources":["../../src/data-visualization/DataVisualization.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,sDAAsD;AACtD,uEAAuE;AAEvE,+DAAiE;AACjE,gEAA+E;AAa/E,4DAA4D;AAE5D,mEAIiC;AACjC,mDAQyB;AA0FzB;;;;;;;;;;;GAWG;AACH,MAAa,mBACZ,SAAQ,gCAAuC;IAwB/C;IACC;;OAEG;IACc,QAAwC;IAEzD;;OAEG;IACc,WAAoC;QAErD,KAAK,EAAE,CAAC;QAPS,aAAQ,GAAR,QAAQ,CAAgC;QAKxC,gBAAW,GAAX,WAAW,CAAyB;QAlBtD;;;WAGG;QACc,0BAAqB,GAAG,CAAC,UAA2B,EAAW,EAAE;YACjF,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YAClC,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;QAeD,IAAI,CAAC,eAAe,GAAG,IAAI,GAAG,EAAiC,CA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B,CAAC,OAAQ,KAAwB,CAAC,kBAAkB,KAAK,UAAU;YAClE,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,SAAS,CAAC,EACzF,CAAC;QACF,MAAM,IAAI,GAAI,KAA2C,CAAC,IAAI,CAAC;QAC/D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACtF,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Indexed-object style is used to ease documentation.\n/* eslint-disable @typescript-eslint/consistent-indexed-object-style */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { DataObject, TreeDataObject } from \"@fluidframework/aqueduct/internal\";\nimport type {\n\tIDisposable,\n\tIEvent,\n\tIFluidHandle,\n\tIFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\n// eslint-disable-next-line import/no-deprecated\nimport type { IProvideFluidHandle } from \"@fluidframework/core-interfaces/internal\";\nimport type { ISharedDirectory } from \"@fluidframework/map/internal\";\nimport type { ISharedObject, SharedObject } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { FluidObjectId } from \"../CommonInterfaces.js\";\nimport { getKeyForFluidObject } from \"../FluidObjectKey.js\";\n\nimport {\n\tvisualizeDataObject,\n\tvisualizeTreeDataObject,\n\tvisualizeUnknownSharedObject,\n} from \"./DefaultVisualizers.js\";\nimport {\n\ttype FluidObjectNode,\n\ttype Primitive,\n\ttype RootHandleNode,\n\ttype VisualChildNode,\n\tVisualNodeKind,\n\tcreateHandleNode,\n\tunknownObjectNode,\n} from \"./VisualTree.js\";\n\n// Ideas:\n// - Hold onto previous summary and only transmit diff?\n\n// TODOs:\n// - Dependency tracking\n// - When a particular DDS is no longer reachable via the input data, we need to remove it from the map and stop\n// emitting updates.\n\n/**\n * The type of a shared object.\n *\n * @remarks\n *\n * This can be acquired via {@link @fluidframework/datastore-definitions#IChannelFactory.Type} field of\n * your shared object's factory class.\n */\nexport type SharedObjectType = string;\n\n/**\n * Generates a visual description of the provided {@link @fluidframework/shared-object-base#ISharedObject}'s\n * current state.\n *\n * @param sharedObject - The object whose data will be rendered.\n * @param visualizeChildData - Callback to render child content of the shared object.\n *\n * @returns A visual tree representation of the provided `sharedObject`.\n *\n * @internal\n */\nexport type VisualizeSharedObject = (\n\tsharedObject: ISharedObject,\n\tvisualizeChildData: VisualizeChildData,\n) => Promise<FluidObjectNode>;\n\n/**\n * Recursively renders child contents of a {@link @fluidframework/shared-object-base#ISharedObject}.\n *\n * @param data - The child data to render.\n * Since this is child data of a DDS (and must be serializable), we know that it must be one of the following:\n *\n * - Primitive data\n *\n * - A serializable Record\n *\n * - A handle to another Fluid object\n *\n * @returns A visual tree representation of the input `data`.\n *\n * @internal\n */\nexport type VisualizeChildData = (data: unknown) => Promise<VisualChildNode>;\n\n/**\n * Utility type for a union of things that can be visualized.\n */\nexport type VisualizableFluidObject = ISharedObject | DataObject | TreeDataObject;\n\n/**\n * Specifies renderers for different {@link @fluidframework/shared-object-base#ISharedObject} types.\n *\n * @remarks\n *\n * - `key`: The type of Shared object ({@link @fluidframework/datastore-definitions#IChannelFactory.Type}).\n *\n * - `value`: A renderer that takes a {@link @fluidframework/shared-object-base#ISharedObject} of the\n * specified type and generates a corresponding {@link VisualizerNode} for it.\n */\nexport interface SharedObjectVisualizers {\n\t/**\n\t * Individual Fluid object visualizers, keyed by {@link SharedObjectType}.\n\t */\n\t[k: SharedObjectType]: VisualizeSharedObject;\n}\n\n/**\n * Data visualization update events.\n */\nexport interface DataVisualizerEvents extends IEvent {\n\t/**\n\t * Emitted whenever the associated {@link @fluidframework/shared-object-base#ISharedObject}'s data is updated.\n\t *\n\t * @param visualTree - The updated visual tree representing the shared object's state.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"update\", listener: (visualTree: FluidObjectNode) => void): unknown;\n}\n\n/**\n * Manages {@link VisualizerNode | visualizers} for shared objects reachable by\n * the provided {@link DataVisualizerGraph.rootData}.\n *\n * @remarks\n *\n * {@link VisualizerNode}s are initialized lazily.\n *\n * Consumers can begin tree visualization by calling {@link DataVisualizerGraph.renderRootHandles}.\n * The returned handle nodes provide the IDs required to make subsequent calls to {@link DataVisualizerGraph.render}\n * to visualize subtrees as needed.\n */\nexport class DataVisualizerGraph\n\textends TypedEventEmitter<DataVisualizerEvents>\n\timplements IDisposable\n{\n\t/**\n\t * Map of registered {@link VisualizerNode}s, keyed by their corresponding {@link FluidObjectId}.\n\t *\n\t * @privateRemarks TODO: Dependency tracking so we don't leak memory.\n\t */\n\tprivate readonly visualizerNodes: Map<FluidObjectId, VisualizerNode>;\n\n\t/**\n\t * Private {@link VisualizerNode.disposed} tracking.\n\t */\n\tprivate _disposed: boolean;\n\n\t/**\n\t * Handler for a visualizer node's \"update\" event.\n\t * Bubbles up the event to graph subscribers.\n\t */\n\tprivate readonly onVisualUpdateHandler = (visualTree: FluidObjectNode): boolean => {\n\t\tthis.emitVisualUpdate(visualTree);\n\t\treturn true;\n\t};\n\n\tpublic constructor(\n\t\t/**\n\t\t * {@inheritDoc IContainerDevtools.containerData}\n\t\t */\n\t\tprivate readonly rootData: Record<string, IFluidLoadable>,\n\n\t\t/**\n\t\t * Policy object for visualizing different kinds of shared objects.\n\t\t */\n\t\tprivate readonly visualizers: SharedObjectVisualizers,\n\t) {\n\t\tsuper();\n\n\t\tthis.visualizerNodes = new Map<FluidObjectId, VisualizerNode>();\n\n\t\tthis._disposed = false;\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.disposed}\n\t */\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * Emits a visual tree update from one of the registered visualizer nodes.\n\t */\n\tprivate emitVisualUpdate(visualTree: FluidObjectNode): void {\n\t\tthis.emit(\"update\", visualTree);\n\t}\n\n\t/**\n\t * Generates and returns visual descriptions ({@link FluidHandleNode}s) for each of the specified\n\t * {@link DataVisualizerGraph.rootData | root shared objects}.\n\t */\n\tpublic async renderRootHandles(): Promise<Record<string, RootHandleNode>> {\n\t\t// TODO: We should be rendering the DataObject from the root, but this requires change in the devtools package in general.\n\n\t\t// Rendering the root entries amounts to initializing visualizer nodes for each of them, and returning\n\t\t// a list of handle nodes. Consumers can request data for each of these handles as needed.\n\t\tconst rootDataEntries = Object.entries(this.rootData);\n\n\t\tconst result: Record<string, RootHandleNode> = {};\n\t\tawait Promise.all(\n\t\t\trootDataEntries.map(async ([key, value]) => {\n\t\t\t\tif (value.handle === undefined) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Container data includes a non-Fluid object under key ${key}. Cannot visualize!`,\n\t\t\t\t\t);\n\t\t\t\t\tresult[key] = unknownObjectNode;\n\t\t\t\t} else {\n\t\t\t\t\tconst fluidObjectId = await this.registerVisualizerForHandle(value.handle);\n\t\t\t\t\tresult[key] =\n\t\t\t\t\t\tfluidObjectId === undefined ? unknownObjectNode : createHandleNode(fluidObjectId);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Generates and returns a visual description of the specified Fluid object if it exists in the graph.\n\t * If no such object exists in the graph, returns `undefined`.\n\t */\n\tpublic async render(fluidObjectId: FluidObjectId): Promise<FluidObjectNode | undefined> {\n\t\t// If we don't have anything registered for the requested Fluid object, return `undefined`.\n\t\t// This could indicate a stale data request from an external consumer, or could indicate a bug,\n\t\t// but this library isn't capable of telling the difference.\n\t\treturn this.visualizerNodes.get(fluidObjectId)?.render() ?? undefined;\n\t}\n\n\t/**\n\t * Adds a visualizer node to the collection for the specified\n\t * {@link VisualizableFluidObject} if one does not already exist.\n\t */\n\tprivate registerVisualizerForVisualizableObject(\n\t\tvisualizableObject: VisualizableFluidObject,\n\t): FluidObjectId {\n\t\t// Store type check results to avoid recomputing\n\t\tconst isDataObj = isDataObject(visualizableObject);\n\t\tconst isTreeDataObj = isTreeDataObject(visualizableObject);\n\n\t\tlet visualizationFunction: VisualizeSharedObject;\n\t\tlet rootSharedObject: ISharedObject;\n\t\tlet objectId: FluidObjectId;\n\n\t\tif (isDataObj) {\n\t\t\trootSharedObject = (visualizableObject as unknown as { readonly root: ISharedDirectory })\n\t\t\t\t.root;\n\t\t\tobjectId = getKeyForFluidObject(rootSharedObject);\n\t\t\tvisualizationFunction = visualizeDataObject;\n\t\t} else if (isTreeDataObj) {\n\t\t\trootSharedObject = (visualizableObject as unknown as { readonly tree: ISharedObject })\n\t\t\t\t.tree;\n\t\t\tobjectId = getKeyForFluidObject(rootSharedObject);\n\t\t\tvisualizationFunction = visualizeTreeDataObject;\n\t\t} else {\n\t\t\trootSharedObject = visualizableObject;\n\t\t\tobjectId = getKeyForFluidObject(visualizableObject);\n\t\t\tvisualizationFunction =\n\t\t\t\t(this.visualizers[visualizableObject.attributes.type] as VisualizeSharedObject) ??\n\t\t\t\tvisualizeUnknownSharedObject;\n\t\t}\n\n\t\tif (!this.visualizerNodes.has(objectId)) {\n\t\t\tconst visualizerNode = new VisualizerNode(\n\t\t\t\trootSharedObject,\n\t\t\t\tvisualizationFunction,\n\t\t\t\tasync (handle) => this.registerVisualizerForHandle(handle),\n\t\t\t);\n\n\t\t\t// Register event handler so we can bubble up update events\n\t\t\tvisualizerNode.on(\"update\", this.onVisualUpdateHandler);\n\n\t\t\t// Add the visualizer node to our collection\n\t\t\tthis.visualizerNodes.set(objectId, visualizerNode);\n\t\t}\n\n\t\treturn objectId;\n\t}\n\n\t/**\n\t * Adds a visualizer node to the collection for the specified {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}\n\t * if one does not already exist.\n\t *\n\t * @returns\n\t *\n\t * The ID of object associated with the provided handle, if the handle resolves to a {@link ISharedObject}.\n\t * If the handle resolves to something else, this sytem has no way to reason about it sufficiently to generate\n\t * visual descriptors from it.\n\t * In this case, we return `undefined`.\n\t */\n\tprivate async registerVisualizerForHandle(\n\t\thandle: IFluidHandle,\n\t): Promise<FluidObjectId | undefined> {\n\t\tconst resolvedObject = await handle.get();\n\n\t\tif (isDataObject(resolvedObject) || isTreeDataObject(resolvedObject)) {\n\t\t\treturn this.registerVisualizerForVisualizableObject(resolvedObject);\n\t\t}\n\n\t\t// TODO: is this the right type check for this?\n\t\tconst sharedObject = resolvedObject as Partial<ISharedObject>;\n\t\tif (isSharedObject(sharedObject)) {\n\t\t\treturn this.registerVisualizerForVisualizableObject(sharedObject);\n\t\t} else {\n\t\t\t// Unknown data.\n\t\t\tconsole.warn(\n\t\t\t\t\"Fluid Handle resolved to data that is not a SharedObject or a DataObject.\",\n\t\t\t);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.dispose}\n\t */\n\tpublic dispose(): void {\n\t\tif (!this._disposed) {\n\t\t\t// Dispose visualizer nodes.\n\t\t\tfor (const visualizerNode of this.visualizerNodes.values()) {\n\t\t\t\tvisualizerNode.dispose();\n\t\t\t}\n\t\t\tthis.visualizerNodes.clear();\n\n\t\t\tthis._disposed = true;\n\t\t}\n\t}\n}\n\n/**\n * Wraps a {@link @fluidframework/shared-object-base#ISharedObject} and encapsulates policy for\n * generating visual tree representations of its data.\n *\n * @remarks\n *\n * A visual representation can be requested via {@link VisualizerNode.render}.\n *\n * Additionally, whenever the associated `ISharedObject` is updated (i.e. whenever its \"op\" event is emitted),\n * an updated visual tree will be emitted via this object's {@link SharedObjectListenerEvents | \"update\" event}.\n */\nexport class VisualizerNode\n\textends TypedEventEmitter<DataVisualizerEvents>\n\timplements IDisposable\n{\n\t/**\n\t * Handler for {@link VisualizerNode.sharedObject}'s \"op\" event.\n\t * Will broadcast an updated visual tree representation of the DDS's data via the\n\t * {@link SharedObjectListenerEvents | \"update\"} event.\n\t */\n\tprivate readonly onOpHandler = async (): Promise<boolean> => {\n\t\ttry {\n\t\t\tawait this.emitVisualUpdate();\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\treturn false;\n\t\t}\n\t};\n\n\t/**\n\t * Private {@link VisualizerNode.disposed} tracking.\n\t */\n\tprivate _disposed: boolean;\n\n\t/**\n\t * Handles the returned promise for {@link onOpHandler}.\n\t */\n\tprivate readonly syncOpHandler = (): void => {\n\t\tthis.onOpHandler().catch((error) => console.error(error));\n\t};\n\n\tpublic constructor(\n\t\t/**\n\t\t * The Fluid object whose data will be emitted in visualized form when requested / whenever its data is updated.\n\t\t */\n\t\tpublic readonly sharedObject: ISharedObject,\n\n\t\t/**\n\t\t * Callback for visualizing {@link VisualizerNode.sharedObject}.\n\t\t * Encapsulates the policies for rendering different kinds of DDSs.\n\t\t */\n\t\tprivate readonly visualizeSharedObject: VisualizeSharedObject,\n\n\t\t/**\n\t\t * Registers some child handle to a Fluid object for future rendering.\n\t\t *\n\t\t * @remarks\n\t\t *\n\t\t * Called during {@link VisualizerNode.render} whenever a Fluid handle is encountered.\n\t\t * Ensures that the consumer of this object's visual tree will be able to request a rendering of the handle's\n\t\t * corresponding DDS as needed.\n\t\t */\n\t\tprivate readonly registerHandle: (\n\t\t\thandle: IFluidHandle,\n\t\t) => Promise<FluidObjectId | undefined>,\n\t) {\n\t\tsuper();\n\n\t\tthis.sharedObject.on?.(\"op\", this.syncOpHandler);\n\n\t\tthis._disposed = false;\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.disposed}\n\t */\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * Emits a {@link VisualizerNode.render | visual tree representation} of\n\t * {@link VisualizerNode.sharedObject}'s current state as an\n\t * {@link SharedObjectListenerEvents | \"update\"} event.\n\t */\n\tprivate async emitVisualUpdate(): Promise<void> {\n\t\ttry {\n\t\t\tconst visualTree: FluidObjectNode = await this.render();\n\t\t\tthis.emit(\"update\", visualTree);\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t}\n\n\t/**\n\t * Generates a visual description of the associated {@link VisualizerNode.sharedObject}'s\n\t * current state.\n\t *\n\t * @remarks\n\t *\n\t * Will recursively render child contents of {@link VisualizerNode.sharedObject}, terminating at\n\t * primitive data and handles to other Fluid objects.\n\t *\n\t * @returns A visual tree representation of {@link VisualizerNode.sharedObject}.\n\t */\n\tpublic async render(): Promise<FluidObjectNode> {\n\t\treturn this.visualizeSharedObject(this.sharedObject, async (data) =>\n\t\t\tthis.renderChildData(data),\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc VisualizeChildData}\n\t */\n\tprivate async renderChildData(data: unknown): Promise<VisualChildNode> {\n\t\treturn visualizeChildData(data, this.registerHandle);\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.dispose}\n\t */\n\tpublic dispose(): void {\n\t\tif (!this._disposed) {\n\t\t\tthis.sharedObject.off(\"op\", this.syncOpHandler);\n\t\t\tthis._disposed = true;\n\t\t}\n\t}\n}\n\n/**\n * See {@link VisualizeChildData}.\n *\n * @param data - The child data to (recursively) render.\n * @param resolveHandle - Function which accepts an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}\n * and returns its resolved object ID.\n *\n * @privateRemarks Exported from this module for testing purposes. This is not intended to be exported by the package.\n */\nexport async function visualizeChildData(\n\tdata: unknown,\n\tresolveHandle: (handle: IFluidHandle) => Promise<FluidObjectId | undefined>,\n): Promise<VisualChildNode> {\n\t// Special case for `null` because `typeof null === \"object\"`.\n\tif (data === null) {\n\t\treturn {\n\t\t\tvalue: data,\n\t\t\ttypeMetadata: \"null\",\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\tif (typeof data !== \"object\" && typeof data !== \"function\") {\n\t\t// Render primitives and falsy types via their string representation\n\t\treturn {\n\t\t\tvalue: data as Primitive,\n\t\t\ttypeMetadata: typeof data,\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tif ((data as IProvideFluidHandle)?.IFluidHandle !== undefined) {\n\t\t// If we encounter a Fluid handle, register it for future rendering, and return a node with its ID.\n\t\tconst handle = data as IFluidHandle;\n\t\tconst fluidObjectId = await resolveHandle(handle);\n\t\t// If no ID was found, then the data is not a SharedObject.\n\t\t// In this case, return an \"Unknown Data\" node so consumers can note this (as desired) to the user.\n\t\treturn fluidObjectId === undefined ? unknownObjectNode : createHandleNode(fluidObjectId);\n\t}\n\n\t// Assume any other data must be a record of some kind (since DDS contents must be serializable)\n\t// and simply recurse over its keys.\n\tconst childEntries = Object.entries(data as Record<string | number | symbol, unknown>);\n\n\tconst children: Record<string, VisualChildNode> = {};\n\tawait Promise.all(\n\t\tchildEntries.map(async ([key, value]) => {\n\t\t\tconst childNode = await visualizeChildData(value, resolveHandle);\n\t\t\tchildren[key] = childNode;\n\t\t}),\n\t);\n\n\treturn {\n\t\tchildren,\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\ttypeMetadata: \"object\",\n\t};\n}\n\n/**\n * Determines whether or not the provided value is an {@link ISharedObject}, for the purposes of this library.\n * @remarks Implemented by checking for the particular properties / methods we use in this module.\n */\nfunction isSharedObject(value: unknown): value is ISharedObject {\n\treturn (\n\t\t(value as SharedObject).id !== undefined &&\n\t\t(value as SharedObject).attributes?.type !== undefined &&\n\t\t(value as SharedObject).on !== undefined\n\t);\n}\n\n/**\n * Determines whether or not the provided value is an {@link DataObject} using `instanceof`, for the purposes of this library.\n * @remarks\n * Uses `instanceof` over checking specific properties or methods, because we decided that a version mix-up with\n * {@link @fluidframework/aqueduct#} is unlikely between devtools and end-user applications, and we don't support it anyway.\n */\nfunction isDataObject(value: unknown): value is DataObject {\n\tif (\n\t\tvalue instanceof DataObject ||\n\t\t(typeof (value as DataObject).initializeInternal === \"function\" &&\n\t\t\ttypeof (value as { getUninitializedErrorString(): string })\n\t\t\t\t.getUninitializedErrorString) === \"function\"\n\t) {\n\t\t// If root is missing, throw an error instead of returning false\n\t\tconst root = (value as { readonly root?: ISharedDirectory }).root;\n\t\tif (!root) {\n\t\t\tthrow new Error(\"DataObject must have a `root` property, but it was undefined.\");\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Determines whether or not the provided value is a {@link TreeDataObject} using `instanceof`, for the purposes of this library.\n * @remarks\n * Tries to use `instanceof` because we decided that a version mix-up with\n * {@link @fluidframework/aqueduct#} is unlikely between devtools and end-user applications, and we don't support it anyway.\n * In addition, we check for the presence of key properties that make a `TreeDataObject` unique:\n * - `TreeDataObject.tree` getter\n * - `TreeDataObject.treeView` getter\n * - `TreeDataObject.initializeInternal` method\n */\nfunction isTreeDataObject(value: unknown): value is TreeDataObject {\n\tif (\n\t\tvalue instanceof TreeDataObject ||\n\t\t(typeof (value as TreeDataObject).initializeInternal === \"function\" &&\n\t\t\tObject.getOwnPropertyDescriptor(Object.getPrototypeOf(value), \"tree\")?.get !== undefined)\n\t) {\n\t\tconst tree = (value as { readonly tree?: ISharedObject }).tree;\n\t\tif (tree === undefined) {\n\t\t\tthrow new Error(\"TreeDataObject must have a `tree` property, but it was undefined.\");\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DataVisualization.js","sourceRoot":"","sources":["../../src/data-visualization/DataVisualization.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,sDAAsD;AACtD,uEAAuE;AAEvE,+DAAiE;AACjE,gEAA+E;AAa/E,4DAA4D;AAE5D,mEAIiC;AACjC,mDAQyB;AA0FzB;;;;;;;;;;;GAWG;AACH,MAAa,mBACZ,SAAQ,gCAAuC;IAwB/C;IACC;;OAEG;IACc,QAAwC;IAEzD;;OAEG;IACc,WAAoC;QAErD,KAAK,EAAE,CAAC;QAPS,aAAQ,GAAR,QAAQ,CAAgC;QAKxC,gBAAW,GAAX,WAAW,CAAyB;QAlBtD;;;WAGG;QACc,0BAAqB,GAAG,CAAC,UAA2B,EAAW,EAAE;YAC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AAI,CAAC;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,gBAAgB,CAAC,KAAc;IACvC,IACC,KAAK,YAAY,yBAAc;QAC/B,CAAC,OAAQ,KAAwB,CAAC,kBAAkB,KAAK,UAAU;YAClE,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,SAAS,CAAC,EACzF,CAAC;QACF,MAAM,IAAI,GAAI,KAA2C,CAAC,IAAI,CAAC;QAC/D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACtF,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Indexed-object style is used to ease documentation.\n/* eslint-disable @typescript-eslint/consistent-indexed-object-style */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { DataObject, TreeDataObject } from \"@fluidframework/aqueduct/internal\";\nimport type {\n\tIDisposable,\n\tIEvent,\n\tIFluidHandle,\n\tIFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\n// eslint-disable-next-line import-x/no-deprecated\nimport type { IProvideFluidHandle } from \"@fluidframework/core-interfaces/internal\";\nimport type { ISharedDirectory } from \"@fluidframework/map/internal\";\nimport type { ISharedObject, SharedObject } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { FluidObjectId } from \"../CommonInterfaces.js\";\nimport { getKeyForFluidObject } from \"../FluidObjectKey.js\";\n\nimport {\n\tvisualizeDataObject,\n\tvisualizeTreeDataObject,\n\tvisualizeUnknownSharedObject,\n} from \"./DefaultVisualizers.js\";\nimport {\n\ttype FluidObjectNode,\n\ttype Primitive,\n\ttype RootHandleNode,\n\ttype VisualChildNode,\n\tVisualNodeKind,\n\tcreateHandleNode,\n\tunknownObjectNode,\n} from \"./VisualTree.js\";\n\n// Ideas:\n// - Hold onto previous summary and only transmit diff?\n\n// TODOs:\n// - Dependency tracking\n// - When a particular DDS is no longer reachable via the input data, we need to remove it from the map and stop\n// emitting updates.\n\n/**\n * The type of a shared object.\n *\n * @remarks\n *\n * This can be acquired via {@link @fluidframework/datastore-definitions#IChannelFactory.Type} field of\n * your shared object's factory class.\n */\nexport type SharedObjectType = string;\n\n/**\n * Generates a visual description of the provided {@link @fluidframework/shared-object-base#ISharedObject}'s\n * current state.\n *\n * @param sharedObject - The object whose data will be rendered.\n * @param visualizeChildData - Callback to render child content of the shared object.\n *\n * @returns A visual tree representation of the provided `sharedObject`.\n *\n * @internal\n */\nexport type VisualizeSharedObject = (\n\tsharedObject: ISharedObject,\n\tvisualizeChildData: VisualizeChildData,\n) => Promise<FluidObjectNode>;\n\n/**\n * Recursively renders child contents of a {@link @fluidframework/shared-object-base#ISharedObject}.\n *\n * @param data - The child data to render.\n * Since this is child data of a DDS (and must be serializable), we know that it must be one of the following:\n *\n * - Primitive data\n *\n * - A serializable Record\n *\n * - A handle to another Fluid object\n *\n * @returns A visual tree representation of the input `data`.\n *\n * @internal\n */\nexport type VisualizeChildData = (data: unknown) => Promise<VisualChildNode>;\n\n/**\n * Utility type for a union of things that can be visualized.\n */\nexport type VisualizableFluidObject = ISharedObject | DataObject | TreeDataObject;\n\n/**\n * Specifies renderers for different {@link @fluidframework/shared-object-base#ISharedObject} types.\n *\n * @remarks\n *\n * - `key`: The type of Shared object ({@link @fluidframework/datastore-definitions#IChannelFactory.Type}).\n *\n * - `value`: A renderer that takes a {@link @fluidframework/shared-object-base#ISharedObject} of the\n * specified type and generates a corresponding {@link VisualizerNode} for it.\n */\nexport interface SharedObjectVisualizers {\n\t/**\n\t * Individual Fluid object visualizers, keyed by {@link SharedObjectType}.\n\t */\n\t[k: SharedObjectType]: VisualizeSharedObject;\n}\n\n/**\n * Data visualization update events.\n */\nexport interface DataVisualizerEvents extends IEvent {\n\t/**\n\t * Emitted whenever the associated {@link @fluidframework/shared-object-base#ISharedObject}'s data is updated.\n\t *\n\t * @param visualTree - The updated visual tree representing the shared object's state.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"update\", listener: (visualTree: FluidObjectNode) => void): unknown;\n}\n\n/**\n * Manages {@link VisualizerNode | visualizers} for shared objects reachable by\n * the provided {@link DataVisualizerGraph.rootData}.\n *\n * @remarks\n *\n * {@link VisualizerNode}s are initialized lazily.\n *\n * Consumers can begin tree visualization by calling {@link DataVisualizerGraph.renderRootHandles}.\n * The returned handle nodes provide the IDs required to make subsequent calls to {@link DataVisualizerGraph.render}\n * to visualize subtrees as needed.\n */\nexport class DataVisualizerGraph\n\textends TypedEventEmitter<DataVisualizerEvents>\n\timplements IDisposable\n{\n\t/**\n\t * Map of registered {@link VisualizerNode}s, keyed by their corresponding {@link FluidObjectId}.\n\t *\n\t * @privateRemarks TODO: Dependency tracking so we don't leak memory.\n\t */\n\tprivate readonly visualizerNodes: Map<FluidObjectId, VisualizerNode>;\n\n\t/**\n\t * Private {@link VisualizerNode.disposed} tracking.\n\t */\n\tprivate _disposed: boolean;\n\n\t/**\n\t * Handler for a visualizer node's \"update\" event.\n\t * Bubbles up the event to graph subscribers.\n\t */\n\tprivate readonly onVisualUpdateHandler = (visualTree: FluidObjectNode): boolean => {\n\t\tthis.emitVisualUpdate(visualTree);\n\t\treturn true;\n\t};\n\n\tpublic constructor(\n\t\t/**\n\t\t * {@inheritDoc IContainerDevtools.containerData}\n\t\t */\n\t\tprivate readonly rootData: Record<string, IFluidLoadable>,\n\n\t\t/**\n\t\t * Policy object for visualizing different kinds of shared objects.\n\t\t */\n\t\tprivate readonly visualizers: SharedObjectVisualizers,\n\t) {\n\t\tsuper();\n\n\t\tthis.visualizerNodes = new Map<FluidObjectId, VisualizerNode>();\n\n\t\tthis._disposed = false;\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.disposed}\n\t */\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * Emits a visual tree update from one of the registered visualizer nodes.\n\t */\n\tprivate emitVisualUpdate(visualTree: FluidObjectNode): void {\n\t\tthis.emit(\"update\", visualTree);\n\t}\n\n\t/**\n\t * Generates and returns visual descriptions ({@link FluidHandleNode}s) for each of the specified\n\t * {@link DataVisualizerGraph.rootData | root shared objects}.\n\t */\n\tpublic async renderRootHandles(): Promise<Record<string, RootHandleNode>> {\n\t\t// TODO: We should be rendering the DataObject from the root, but this requires change in the devtools package in general.\n\n\t\t// Rendering the root entries amounts to initializing visualizer nodes for each of them, and returning\n\t\t// a list of handle nodes. Consumers can request data for each of these handles as needed.\n\t\tconst rootDataEntries = Object.entries(this.rootData);\n\n\t\tconst result: Record<string, RootHandleNode> = {};\n\t\tawait Promise.all(\n\t\t\trootDataEntries.map(async ([key, value]) => {\n\t\t\t\tif (value.handle === undefined) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Container data includes a non-Fluid object under key ${key}. Cannot visualize!`,\n\t\t\t\t\t);\n\t\t\t\t\tresult[key] = unknownObjectNode;\n\t\t\t\t} else {\n\t\t\t\t\tconst fluidObjectId = await this.registerVisualizerForHandle(value.handle);\n\t\t\t\t\tresult[key] =\n\t\t\t\t\t\tfluidObjectId === undefined ? unknownObjectNode : createHandleNode(fluidObjectId);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Generates and returns a visual description of the specified Fluid object if it exists in the graph.\n\t * If no such object exists in the graph, returns `undefined`.\n\t */\n\tpublic async render(fluidObjectId: FluidObjectId): Promise<FluidObjectNode | undefined> {\n\t\t// If we don't have anything registered for the requested Fluid object, return `undefined`.\n\t\t// This could indicate a stale data request from an external consumer, or could indicate a bug,\n\t\t// but this library isn't capable of telling the difference.\n\t\treturn this.visualizerNodes.get(fluidObjectId)?.render() ?? undefined;\n\t}\n\n\t/**\n\t * Adds a visualizer node to the collection for the specified\n\t * {@link VisualizableFluidObject} if one does not already exist.\n\t */\n\tprivate registerVisualizerForVisualizableObject(\n\t\tvisualizableObject: VisualizableFluidObject,\n\t): FluidObjectId {\n\t\t// Store type check results to avoid recomputing\n\t\tconst isDataObj = isDataObject(visualizableObject);\n\t\tconst isTreeDataObj = isTreeDataObject(visualizableObject);\n\n\t\tlet visualizationFunction: VisualizeSharedObject;\n\t\tlet rootSharedObject: ISharedObject;\n\t\tlet objectId: FluidObjectId;\n\n\t\tif (isDataObj) {\n\t\t\trootSharedObject = (visualizableObject as unknown as { readonly root: ISharedDirectory })\n\t\t\t\t.root;\n\t\t\tobjectId = getKeyForFluidObject(rootSharedObject);\n\t\t\tvisualizationFunction = visualizeDataObject;\n\t\t} else if (isTreeDataObj) {\n\t\t\trootSharedObject = (visualizableObject as unknown as { readonly tree: ISharedObject })\n\t\t\t\t.tree;\n\t\t\tobjectId = getKeyForFluidObject(rootSharedObject);\n\t\t\tvisualizationFunction = visualizeTreeDataObject;\n\t\t} else {\n\t\t\trootSharedObject = visualizableObject;\n\t\t\tobjectId = getKeyForFluidObject(visualizableObject);\n\t\t\tvisualizationFunction =\n\t\t\t\t(this.visualizers[visualizableObject.attributes.type] as VisualizeSharedObject) ??\n\t\t\t\tvisualizeUnknownSharedObject;\n\t\t}\n\n\t\tif (!this.visualizerNodes.has(objectId)) {\n\t\t\tconst visualizerNode = new VisualizerNode(\n\t\t\t\trootSharedObject,\n\t\t\t\tvisualizationFunction,\n\t\t\t\tasync (handle) => this.registerVisualizerForHandle(handle),\n\t\t\t);\n\n\t\t\t// Register event handler so we can bubble up update events\n\t\t\tvisualizerNode.on(\"update\", this.onVisualUpdateHandler);\n\n\t\t\t// Add the visualizer node to our collection\n\t\t\tthis.visualizerNodes.set(objectId, visualizerNode);\n\t\t}\n\n\t\treturn objectId;\n\t}\n\n\t/**\n\t * Adds a visualizer node to the collection for the specified {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}\n\t * if one does not already exist.\n\t *\n\t * @returns\n\t *\n\t * The ID of object associated with the provided handle, if the handle resolves to a {@link ISharedObject}.\n\t * If the handle resolves to something else, this sytem has no way to reason about it sufficiently to generate\n\t * visual descriptors from it.\n\t * In this case, we return `undefined`.\n\t */\n\tprivate async registerVisualizerForHandle(\n\t\thandle: IFluidHandle,\n\t): Promise<FluidObjectId | undefined> {\n\t\tconst resolvedObject = await handle.get();\n\n\t\tif (isDataObject(resolvedObject) || isTreeDataObject(resolvedObject)) {\n\t\t\treturn this.registerVisualizerForVisualizableObject(resolvedObject);\n\t\t}\n\n\t\t// TODO: is this the right type check for this?\n\t\tconst sharedObject = resolvedObject as Partial<ISharedObject>;\n\t\tif (isSharedObject(sharedObject)) {\n\t\t\treturn this.registerVisualizerForVisualizableObject(sharedObject);\n\t\t} else {\n\t\t\t// Unknown data.\n\t\t\tconsole.warn(\n\t\t\t\t\"Fluid Handle resolved to data that is not a SharedObject or a DataObject.\",\n\t\t\t);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.dispose}\n\t */\n\tpublic dispose(): void {\n\t\tif (!this._disposed) {\n\t\t\t// Dispose visualizer nodes.\n\t\t\tfor (const visualizerNode of this.visualizerNodes.values()) {\n\t\t\t\tvisualizerNode.dispose();\n\t\t\t}\n\t\t\tthis.visualizerNodes.clear();\n\n\t\t\tthis._disposed = true;\n\t\t}\n\t}\n}\n\n/**\n * Wraps a {@link @fluidframework/shared-object-base#ISharedObject} and encapsulates policy for\n * generating visual tree representations of its data.\n *\n * @remarks\n *\n * A visual representation can be requested via {@link VisualizerNode.render}.\n *\n * Additionally, whenever the associated `ISharedObject` is updated (i.e. whenever its \"op\" event is emitted),\n * an updated visual tree will be emitted via this object's {@link SharedObjectListenerEvents | \"update\" event}.\n */\nexport class VisualizerNode\n\textends TypedEventEmitter<DataVisualizerEvents>\n\timplements IDisposable\n{\n\t/**\n\t * Handler for {@link VisualizerNode.sharedObject}'s \"op\" event.\n\t * Will broadcast an updated visual tree representation of the DDS's data via the\n\t * {@link SharedObjectListenerEvents | \"update\"} event.\n\t */\n\tprivate readonly onOpHandler = async (): Promise<boolean> => {\n\t\ttry {\n\t\t\tawait this.emitVisualUpdate();\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\treturn false;\n\t\t}\n\t};\n\n\t/**\n\t * Private {@link VisualizerNode.disposed} tracking.\n\t */\n\tprivate _disposed: boolean;\n\n\t/**\n\t * Handles the returned promise for {@link onOpHandler}.\n\t */\n\tprivate readonly syncOpHandler = (): void => {\n\t\tthis.onOpHandler().catch((error) => console.error(error));\n\t};\n\n\tpublic constructor(\n\t\t/**\n\t\t * The Fluid object whose data will be emitted in visualized form when requested / whenever its data is updated.\n\t\t */\n\t\tpublic readonly sharedObject: ISharedObject,\n\n\t\t/**\n\t\t * Callback for visualizing {@link VisualizerNode.sharedObject}.\n\t\t * Encapsulates the policies for rendering different kinds of DDSs.\n\t\t */\n\t\tprivate readonly visualizeSharedObject: VisualizeSharedObject,\n\n\t\t/**\n\t\t * Registers some child handle to a Fluid object for future rendering.\n\t\t *\n\t\t * @remarks\n\t\t *\n\t\t * Called during {@link VisualizerNode.render} whenever a Fluid handle is encountered.\n\t\t * Ensures that the consumer of this object's visual tree will be able to request a rendering of the handle's\n\t\t * corresponding DDS as needed.\n\t\t */\n\t\tprivate readonly registerHandle: (\n\t\t\thandle: IFluidHandle,\n\t\t) => Promise<FluidObjectId | undefined>,\n\t) {\n\t\tsuper();\n\n\t\tthis.sharedObject.on?.(\"op\", this.syncOpHandler);\n\n\t\tthis._disposed = false;\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.disposed}\n\t */\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * Emits a {@link VisualizerNode.render | visual tree representation} of\n\t * {@link VisualizerNode.sharedObject}'s current state as an\n\t * {@link SharedObjectListenerEvents | \"update\"} event.\n\t */\n\tprivate async emitVisualUpdate(): Promise<void> {\n\t\ttry {\n\t\t\tconst visualTree: FluidObjectNode = await this.render();\n\t\t\tthis.emit(\"update\", visualTree);\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t}\n\n\t/**\n\t * Generates a visual description of the associated {@link VisualizerNode.sharedObject}'s\n\t * current state.\n\t *\n\t * @remarks\n\t *\n\t * Will recursively render child contents of {@link VisualizerNode.sharedObject}, terminating at\n\t * primitive data and handles to other Fluid objects.\n\t *\n\t * @returns A visual tree representation of {@link VisualizerNode.sharedObject}.\n\t */\n\tpublic async render(): Promise<FluidObjectNode> {\n\t\treturn this.visualizeSharedObject(this.sharedObject, async (data) =>\n\t\t\tthis.renderChildData(data),\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc VisualizeChildData}\n\t */\n\tprivate async renderChildData(data: unknown): Promise<VisualChildNode> {\n\t\treturn visualizeChildData(data, this.registerHandle);\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.dispose}\n\t */\n\tpublic dispose(): void {\n\t\tif (!this._disposed) {\n\t\t\tthis.sharedObject.off(\"op\", this.syncOpHandler);\n\t\t\tthis._disposed = true;\n\t\t}\n\t}\n}\n\n/**\n * See {@link VisualizeChildData}.\n *\n * @param data - The child data to (recursively) render.\n * @param resolveHandle - Function which accepts an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}\n * and returns its resolved object ID.\n *\n * @privateRemarks Exported from this module for testing purposes. This is not intended to be exported by the package.\n */\nexport async function visualizeChildData(\n\tdata: unknown,\n\tresolveHandle: (handle: IFluidHandle) => Promise<FluidObjectId | undefined>,\n): Promise<VisualChildNode> {\n\t// Special case for `null` because `typeof null === \"object\"`.\n\tif (data === null) {\n\t\treturn {\n\t\t\tvalue: data,\n\t\t\ttypeMetadata: \"null\",\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\tif (typeof data !== \"object\" && typeof data !== \"function\") {\n\t\t// Render primitives and falsy types via their string representation\n\t\treturn {\n\t\t\tvalue: data as Primitive,\n\t\t\ttypeMetadata: typeof data,\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\t// eslint-disable-next-line import-x/no-deprecated\n\tif ((data as IProvideFluidHandle)?.IFluidHandle !== undefined) {\n\t\t// If we encounter a Fluid handle, register it for future rendering, and return a node with its ID.\n\t\tconst handle = data as IFluidHandle;\n\t\tconst fluidObjectId = await resolveHandle(handle);\n\t\t// If no ID was found, then the data is not a SharedObject.\n\t\t// In this case, return an \"Unknown Data\" node so consumers can note this (as desired) to the user.\n\t\treturn fluidObjectId === undefined ? unknownObjectNode : createHandleNode(fluidObjectId);\n\t}\n\n\t// Assume any other data must be a record of some kind (since DDS contents must be serializable)\n\t// and simply recurse over its keys.\n\tconst childEntries = Object.entries(data as Record<string | number | symbol, unknown>);\n\n\tconst children: Record<string, VisualChildNode> = {};\n\tawait Promise.all(\n\t\tchildEntries.map(async ([key, value]) => {\n\t\t\tconst childNode = await visualizeChildData(value, resolveHandle);\n\t\t\tchildren[key] = childNode;\n\t\t}),\n\t);\n\n\treturn {\n\t\tchildren,\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\ttypeMetadata: \"object\",\n\t};\n}\n\n/**\n * Determines whether or not the provided value is an {@link ISharedObject}, for the purposes of this library.\n * @remarks Implemented by checking for the particular properties / methods we use in this module.\n */\nfunction isSharedObject(value: unknown): value is ISharedObject {\n\treturn (\n\t\t(value as SharedObject).id !== undefined &&\n\t\t(value as SharedObject).attributes?.type !== undefined &&\n\t\t(value as SharedObject).on !== undefined\n\t);\n}\n\n/**\n * Determines whether or not the provided value is an {@link DataObject} using `instanceof`, for the purposes of this library.\n * @remarks\n * Uses `instanceof` over checking specific properties or methods, because we decided that a version mix-up with\n * {@link @fluidframework/aqueduct#} is unlikely between devtools and end-user applications, and we don't support it anyway.\n */\nfunction isDataObject(value: unknown): value is DataObject {\n\tif (\n\t\tvalue instanceof DataObject ||\n\t\t(typeof (value as DataObject).initializeInternal === \"function\" &&\n\t\t\ttypeof (value as { getUninitializedErrorString(): string })\n\t\t\t\t.getUninitializedErrorString) === \"function\"\n\t) {\n\t\t// If root is missing, throw an error instead of returning false\n\t\tconst root = (value as { readonly root?: ISharedDirectory }).root;\n\t\tif (!root) {\n\t\t\tthrow new Error(\"DataObject must have a `root` property, but it was undefined.\");\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Determines whether or not the provided value is a {@link TreeDataObject} using `instanceof`, for the purposes of this library.\n * @remarks\n * Tries to use `instanceof` because we decided that a version mix-up with\n * {@link @fluidframework/aqueduct#} is unlikely between devtools and end-user applications, and we don't support it anyway.\n * In addition, we check for the presence of key properties that make a `TreeDataObject` unique:\n * - `TreeDataObject.tree` getter\n * - `TreeDataObject.treeView` getter\n * - `TreeDataObject.initializeInternal` method\n */\nfunction isTreeDataObject(value: unknown): value is TreeDataObject {\n\tif (\n\t\tvalue instanceof TreeDataObject ||\n\t\t(typeof (value as TreeDataObject).initializeInternal === \"function\" &&\n\t\t\tObject.getOwnPropertyDescriptor(Object.getPrototypeOf(value), \"tree\")?.get !== undefined)\n\t) {\n\t\tconst tree = (value as { readonly tree?: ISharedObject }).tree;\n\t\tif (tree === undefined) {\n\t\t\tthrow new Error(\"TreeDataObject must have a `tree` property, but it was undefined.\");\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\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/devtools-core";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.73.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/devtools-core";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.73.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,+BAA+B,CAAC;AAC1C,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/devtools-core\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,+BAA+B,CAAC;AAC1C,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/devtools-core\";\nexport const pkgVersion = \"2.73.0\";\n"]}
|
|
@@ -306,7 +306,7 @@ export async function visualizeChildData(data, resolveHandle) {
|
|
|
306
306
|
nodeKind: VisualNodeKind.ValueNode,
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
|
-
// eslint-disable-next-line import/no-deprecated
|
|
309
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
310
310
|
if (data?.IFluidHandle !== undefined) {
|
|
311
311
|
// If we encounter a Fluid handle, register it for future rendering, and return a node with its ID.
|
|
312
312
|
const handle = data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataVisualization.js","sourceRoot":"","sources":["../../src/data-visualization/DataVisualization.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sDAAsD;AACtD,uEAAuE;AAEvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAa/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EACN,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAKN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,GACjB,MAAM,iBAAiB,CAAC;AA0FzB;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,mBACZ,SAAQ,iBAAuC;IAwB/C;IACC;;OAEG;IACc,QAAwC;IAEzD;;OAEG;IACc,WAAoC;QAErD,KAAK,EAAE,CAAC;QAPS,aAAQ,GAAR,QAAQ,CAAgC;QAKxC,gBAAW,GAAX,WAAW,CAAyB;QAlBtD;;;WAGG;QACc,0BAAqB,GAAG,CAAC,UAA2B,EAAW,EAAE;YACjF,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YAClC,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;QAeD,IAAI,CAAC,eAAe,GAAG,IAAI,GAAG,EAAiC,CAAC;QAEhE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,UAA2B;QACnD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,iBAAiB;QAC7B,0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CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Indexed-object style is used to ease documentation.\n/* eslint-disable @typescript-eslint/consistent-indexed-object-style */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { DataObject, TreeDataObject } from \"@fluidframework/aqueduct/internal\";\nimport type {\n\tIDisposable,\n\tIEvent,\n\tIFluidHandle,\n\tIFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\n// eslint-disable-next-line import/no-deprecated\nimport type { IProvideFluidHandle } from \"@fluidframework/core-interfaces/internal\";\nimport type { ISharedDirectory } from \"@fluidframework/map/internal\";\nimport type { ISharedObject, SharedObject } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { FluidObjectId } from \"../CommonInterfaces.js\";\nimport { getKeyForFluidObject } from \"../FluidObjectKey.js\";\n\nimport {\n\tvisualizeDataObject,\n\tvisualizeTreeDataObject,\n\tvisualizeUnknownSharedObject,\n} from \"./DefaultVisualizers.js\";\nimport {\n\ttype FluidObjectNode,\n\ttype Primitive,\n\ttype RootHandleNode,\n\ttype VisualChildNode,\n\tVisualNodeKind,\n\tcreateHandleNode,\n\tunknownObjectNode,\n} from \"./VisualTree.js\";\n\n// Ideas:\n// - Hold onto previous summary and only transmit diff?\n\n// TODOs:\n// - Dependency tracking\n// - When a particular DDS is no longer reachable via the input data, we need to remove it from the map and stop\n// emitting updates.\n\n/**\n * The type of a shared object.\n *\n * @remarks\n *\n * This can be acquired via {@link @fluidframework/datastore-definitions#IChannelFactory.Type} field of\n * your shared object's factory class.\n */\nexport type SharedObjectType = string;\n\n/**\n * Generates a visual description of the provided {@link @fluidframework/shared-object-base#ISharedObject}'s\n * current state.\n *\n * @param sharedObject - The object whose data will be rendered.\n * @param visualizeChildData - Callback to render child content of the shared object.\n *\n * @returns A visual tree representation of the provided `sharedObject`.\n *\n * @internal\n */\nexport type VisualizeSharedObject = (\n\tsharedObject: ISharedObject,\n\tvisualizeChildData: VisualizeChildData,\n) => Promise<FluidObjectNode>;\n\n/**\n * Recursively renders child contents of a {@link @fluidframework/shared-object-base#ISharedObject}.\n *\n * @param data - The child data to render.\n * Since this is child data of a DDS (and must be serializable), we know that it must be one of the following:\n *\n * - Primitive data\n *\n * - A serializable Record\n *\n * - A handle to another Fluid object\n *\n * @returns A visual tree representation of the input `data`.\n *\n * @internal\n */\nexport type VisualizeChildData = (data: unknown) => Promise<VisualChildNode>;\n\n/**\n * Utility type for a union of things that can be visualized.\n */\nexport type VisualizableFluidObject = ISharedObject | DataObject | TreeDataObject;\n\n/**\n * Specifies renderers for different {@link @fluidframework/shared-object-base#ISharedObject} types.\n *\n * @remarks\n *\n * - `key`: The type of Shared object ({@link @fluidframework/datastore-definitions#IChannelFactory.Type}).\n *\n * - `value`: A renderer that takes a {@link @fluidframework/shared-object-base#ISharedObject} of the\n * specified type and generates a corresponding {@link VisualizerNode} for it.\n */\nexport interface SharedObjectVisualizers {\n\t/**\n\t * Individual Fluid object visualizers, keyed by {@link SharedObjectType}.\n\t */\n\t[k: SharedObjectType]: VisualizeSharedObject;\n}\n\n/**\n * Data visualization update events.\n */\nexport interface DataVisualizerEvents extends IEvent {\n\t/**\n\t * Emitted whenever the associated {@link @fluidframework/shared-object-base#ISharedObject}'s data is updated.\n\t *\n\t * @param visualTree - The updated visual tree representing the shared object's state.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"update\", listener: (visualTree: FluidObjectNode) => void): unknown;\n}\n\n/**\n * Manages {@link VisualizerNode | visualizers} for shared objects reachable by\n * the provided {@link DataVisualizerGraph.rootData}.\n *\n * @remarks\n *\n * {@link VisualizerNode}s are initialized lazily.\n *\n * Consumers can begin tree visualization by calling {@link DataVisualizerGraph.renderRootHandles}.\n * The returned handle nodes provide the IDs required to make subsequent calls to {@link DataVisualizerGraph.render}\n * to visualize subtrees as needed.\n */\nexport class DataVisualizerGraph\n\textends TypedEventEmitter<DataVisualizerEvents>\n\timplements IDisposable\n{\n\t/**\n\t * Map of registered {@link VisualizerNode}s, keyed by their corresponding {@link FluidObjectId}.\n\t *\n\t * @privateRemarks TODO: Dependency tracking so we don't leak memory.\n\t */\n\tprivate readonly visualizerNodes: Map<FluidObjectId, VisualizerNode>;\n\n\t/**\n\t * Private {@link VisualizerNode.disposed} tracking.\n\t */\n\tprivate _disposed: boolean;\n\n\t/**\n\t * Handler for a visualizer node's \"update\" event.\n\t * Bubbles up the event to graph subscribers.\n\t */\n\tprivate readonly onVisualUpdateHandler = (visualTree: FluidObjectNode): boolean => {\n\t\tthis.emitVisualUpdate(visualTree);\n\t\treturn true;\n\t};\n\n\tpublic constructor(\n\t\t/**\n\t\t * {@inheritDoc IContainerDevtools.containerData}\n\t\t */\n\t\tprivate readonly rootData: Record<string, IFluidLoadable>,\n\n\t\t/**\n\t\t * Policy object for visualizing different kinds of shared objects.\n\t\t */\n\t\tprivate readonly visualizers: SharedObjectVisualizers,\n\t) {\n\t\tsuper();\n\n\t\tthis.visualizerNodes = new Map<FluidObjectId, VisualizerNode>();\n\n\t\tthis._disposed = false;\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.disposed}\n\t */\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * Emits a visual tree update from one of the registered visualizer nodes.\n\t */\n\tprivate emitVisualUpdate(visualTree: FluidObjectNode): void {\n\t\tthis.emit(\"update\", visualTree);\n\t}\n\n\t/**\n\t * Generates and returns visual descriptions ({@link FluidHandleNode}s) for each of the specified\n\t * {@link DataVisualizerGraph.rootData | root shared objects}.\n\t */\n\tpublic async renderRootHandles(): Promise<Record<string, RootHandleNode>> {\n\t\t// TODO: We should be rendering the DataObject from the root, but this requires change in the devtools package in general.\n\n\t\t// Rendering the root entries amounts to initializing visualizer nodes for each of them, and returning\n\t\t// a list of handle nodes. Consumers can request data for each of these handles as needed.\n\t\tconst rootDataEntries = Object.entries(this.rootData);\n\n\t\tconst result: Record<string, RootHandleNode> = {};\n\t\tawait Promise.all(\n\t\t\trootDataEntries.map(async ([key, value]) => {\n\t\t\t\tif (value.handle === undefined) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Container data includes a non-Fluid object under key ${key}. Cannot visualize!`,\n\t\t\t\t\t);\n\t\t\t\t\tresult[key] = unknownObjectNode;\n\t\t\t\t} else {\n\t\t\t\t\tconst fluidObjectId = await this.registerVisualizerForHandle(value.handle);\n\t\t\t\t\tresult[key] =\n\t\t\t\t\t\tfluidObjectId === undefined ? unknownObjectNode : createHandleNode(fluidObjectId);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Generates and returns a visual description of the specified Fluid object if it exists in the graph.\n\t * If no such object exists in the graph, returns `undefined`.\n\t */\n\tpublic async render(fluidObjectId: FluidObjectId): Promise<FluidObjectNode | undefined> {\n\t\t// If we don't have anything registered for the requested Fluid object, return `undefined`.\n\t\t// This could indicate a stale data request from an external consumer, or could indicate a bug,\n\t\t// but this library isn't capable of telling the difference.\n\t\treturn this.visualizerNodes.get(fluidObjectId)?.render() ?? undefined;\n\t}\n\n\t/**\n\t * Adds a visualizer node to the collection for the specified\n\t * {@link VisualizableFluidObject} if one does not already exist.\n\t */\n\tprivate registerVisualizerForVisualizableObject(\n\t\tvisualizableObject: VisualizableFluidObject,\n\t): FluidObjectId {\n\t\t// Store type check results to avoid recomputing\n\t\tconst isDataObj = isDataObject(visualizableObject);\n\t\tconst isTreeDataObj = isTreeDataObject(visualizableObject);\n\n\t\tlet visualizationFunction: VisualizeSharedObject;\n\t\tlet rootSharedObject: ISharedObject;\n\t\tlet objectId: FluidObjectId;\n\n\t\tif (isDataObj) {\n\t\t\trootSharedObject = (visualizableObject as unknown as { readonly root: ISharedDirectory })\n\t\t\t\t.root;\n\t\t\tobjectId = getKeyForFluidObject(rootSharedObject);\n\t\t\tvisualizationFunction = visualizeDataObject;\n\t\t} else if (isTreeDataObj) {\n\t\t\trootSharedObject = (visualizableObject as unknown as { readonly tree: ISharedObject })\n\t\t\t\t.tree;\n\t\t\tobjectId = getKeyForFluidObject(rootSharedObject);\n\t\t\tvisualizationFunction = visualizeTreeDataObject;\n\t\t} else {\n\t\t\trootSharedObject = visualizableObject;\n\t\t\tobjectId = getKeyForFluidObject(visualizableObject);\n\t\t\tvisualizationFunction =\n\t\t\t\t(this.visualizers[visualizableObject.attributes.type] as VisualizeSharedObject) ??\n\t\t\t\tvisualizeUnknownSharedObject;\n\t\t}\n\n\t\tif (!this.visualizerNodes.has(objectId)) {\n\t\t\tconst visualizerNode = new VisualizerNode(\n\t\t\t\trootSharedObject,\n\t\t\t\tvisualizationFunction,\n\t\t\t\tasync (handle) => this.registerVisualizerForHandle(handle),\n\t\t\t);\n\n\t\t\t// Register event handler so we can bubble up update events\n\t\t\tvisualizerNode.on(\"update\", this.onVisualUpdateHandler);\n\n\t\t\t// Add the visualizer node to our collection\n\t\t\tthis.visualizerNodes.set(objectId, visualizerNode);\n\t\t}\n\n\t\treturn objectId;\n\t}\n\n\t/**\n\t * Adds a visualizer node to the collection for the specified {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}\n\t * if one does not already exist.\n\t *\n\t * @returns\n\t *\n\t * The ID of object associated with the provided handle, if the handle resolves to a {@link ISharedObject}.\n\t * If the handle resolves to something else, this sytem has no way to reason about it sufficiently to generate\n\t * visual descriptors from it.\n\t * In this case, we return `undefined`.\n\t */\n\tprivate async registerVisualizerForHandle(\n\t\thandle: IFluidHandle,\n\t): Promise<FluidObjectId | undefined> {\n\t\tconst resolvedObject = await handle.get();\n\n\t\tif (isDataObject(resolvedObject) || isTreeDataObject(resolvedObject)) {\n\t\t\treturn this.registerVisualizerForVisualizableObject(resolvedObject);\n\t\t}\n\n\t\t// TODO: is this the right type check for this?\n\t\tconst sharedObject = resolvedObject as Partial<ISharedObject>;\n\t\tif (isSharedObject(sharedObject)) {\n\t\t\treturn this.registerVisualizerForVisualizableObject(sharedObject);\n\t\t} else {\n\t\t\t// Unknown data.\n\t\t\tconsole.warn(\n\t\t\t\t\"Fluid Handle resolved to data that is not a SharedObject or a DataObject.\",\n\t\t\t);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.dispose}\n\t */\n\tpublic dispose(): void {\n\t\tif (!this._disposed) {\n\t\t\t// Dispose visualizer nodes.\n\t\t\tfor (const visualizerNode of this.visualizerNodes.values()) {\n\t\t\t\tvisualizerNode.dispose();\n\t\t\t}\n\t\t\tthis.visualizerNodes.clear();\n\n\t\t\tthis._disposed = true;\n\t\t}\n\t}\n}\n\n/**\n * Wraps a {@link @fluidframework/shared-object-base#ISharedObject} and encapsulates policy for\n * generating visual tree representations of its data.\n *\n * @remarks\n *\n * A visual representation can be requested via {@link VisualizerNode.render}.\n *\n * Additionally, whenever the associated `ISharedObject` is updated (i.e. whenever its \"op\" event is emitted),\n * an updated visual tree will be emitted via this object's {@link SharedObjectListenerEvents | \"update\" event}.\n */\nexport class VisualizerNode\n\textends TypedEventEmitter<DataVisualizerEvents>\n\timplements IDisposable\n{\n\t/**\n\t * Handler for {@link VisualizerNode.sharedObject}'s \"op\" event.\n\t * Will broadcast an updated visual tree representation of the DDS's data via the\n\t * {@link SharedObjectListenerEvents | \"update\"} event.\n\t */\n\tprivate readonly onOpHandler = async (): Promise<boolean> => {\n\t\ttry {\n\t\t\tawait this.emitVisualUpdate();\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\treturn false;\n\t\t}\n\t};\n\n\t/**\n\t * Private {@link VisualizerNode.disposed} tracking.\n\t */\n\tprivate _disposed: boolean;\n\n\t/**\n\t * Handles the returned promise for {@link onOpHandler}.\n\t */\n\tprivate readonly syncOpHandler = (): void => {\n\t\tthis.onOpHandler().catch((error) => console.error(error));\n\t};\n\n\tpublic constructor(\n\t\t/**\n\t\t * The Fluid object whose data will be emitted in visualized form when requested / whenever its data is updated.\n\t\t */\n\t\tpublic readonly sharedObject: ISharedObject,\n\n\t\t/**\n\t\t * Callback for visualizing {@link VisualizerNode.sharedObject}.\n\t\t * Encapsulates the policies for rendering different kinds of DDSs.\n\t\t */\n\t\tprivate readonly visualizeSharedObject: VisualizeSharedObject,\n\n\t\t/**\n\t\t * Registers some child handle to a Fluid object for future rendering.\n\t\t *\n\t\t * @remarks\n\t\t *\n\t\t * Called during {@link VisualizerNode.render} whenever a Fluid handle is encountered.\n\t\t * Ensures that the consumer of this object's visual tree will be able to request a rendering of the handle's\n\t\t * corresponding DDS as needed.\n\t\t */\n\t\tprivate readonly registerHandle: (\n\t\t\thandle: IFluidHandle,\n\t\t) => Promise<FluidObjectId | undefined>,\n\t) {\n\t\tsuper();\n\n\t\tthis.sharedObject.on?.(\"op\", this.syncOpHandler);\n\n\t\tthis._disposed = false;\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.disposed}\n\t */\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * Emits a {@link VisualizerNode.render | visual tree representation} of\n\t * {@link VisualizerNode.sharedObject}'s current state as an\n\t * {@link SharedObjectListenerEvents | \"update\"} event.\n\t */\n\tprivate async emitVisualUpdate(): Promise<void> {\n\t\ttry {\n\t\t\tconst visualTree: FluidObjectNode = await this.render();\n\t\t\tthis.emit(\"update\", visualTree);\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t}\n\n\t/**\n\t * Generates a visual description of the associated {@link VisualizerNode.sharedObject}'s\n\t * current state.\n\t *\n\t * @remarks\n\t *\n\t * Will recursively render child contents of {@link VisualizerNode.sharedObject}, terminating at\n\t * primitive data and handles to other Fluid objects.\n\t *\n\t * @returns A visual tree representation of {@link VisualizerNode.sharedObject}.\n\t */\n\tpublic async render(): Promise<FluidObjectNode> {\n\t\treturn this.visualizeSharedObject(this.sharedObject, async (data) =>\n\t\t\tthis.renderChildData(data),\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc VisualizeChildData}\n\t */\n\tprivate async renderChildData(data: unknown): Promise<VisualChildNode> {\n\t\treturn visualizeChildData(data, this.registerHandle);\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.dispose}\n\t */\n\tpublic dispose(): void {\n\t\tif (!this._disposed) {\n\t\t\tthis.sharedObject.off(\"op\", this.syncOpHandler);\n\t\t\tthis._disposed = true;\n\t\t}\n\t}\n}\n\n/**\n * See {@link VisualizeChildData}.\n *\n * @param data - The child data to (recursively) render.\n * @param resolveHandle - Function which accepts an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}\n * and returns its resolved object ID.\n *\n * @privateRemarks Exported from this module for testing purposes. This is not intended to be exported by the package.\n */\nexport async function visualizeChildData(\n\tdata: unknown,\n\tresolveHandle: (handle: IFluidHandle) => Promise<FluidObjectId | undefined>,\n): Promise<VisualChildNode> {\n\t// Special case for `null` because `typeof null === \"object\"`.\n\tif (data === null) {\n\t\treturn {\n\t\t\tvalue: data,\n\t\t\ttypeMetadata: \"null\",\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\tif (typeof data !== \"object\" && typeof data !== \"function\") {\n\t\t// Render primitives and falsy types via their string representation\n\t\treturn {\n\t\t\tvalue: data as Primitive,\n\t\t\ttypeMetadata: typeof data,\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tif ((data as IProvideFluidHandle)?.IFluidHandle !== undefined) {\n\t\t// If we encounter a Fluid handle, register it for future rendering, and return a node with its ID.\n\t\tconst handle = data as IFluidHandle;\n\t\tconst fluidObjectId = await resolveHandle(handle);\n\t\t// If no ID was found, then the data is not a SharedObject.\n\t\t// In this case, return an \"Unknown Data\" node so consumers can note this (as desired) to the user.\n\t\treturn fluidObjectId === undefined ? unknownObjectNode : createHandleNode(fluidObjectId);\n\t}\n\n\t// Assume any other data must be a record of some kind (since DDS contents must be serializable)\n\t// and simply recurse over its keys.\n\tconst childEntries = Object.entries(data as Record<string | number | symbol, unknown>);\n\n\tconst children: Record<string, VisualChildNode> = {};\n\tawait Promise.all(\n\t\tchildEntries.map(async ([key, value]) => {\n\t\t\tconst childNode = await visualizeChildData(value, resolveHandle);\n\t\t\tchildren[key] = childNode;\n\t\t}),\n\t);\n\n\treturn {\n\t\tchildren,\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\ttypeMetadata: \"object\",\n\t};\n}\n\n/**\n * Determines whether or not the provided value is an {@link ISharedObject}, for the purposes of this library.\n * @remarks Implemented by checking for the particular properties / methods we use in this module.\n */\nfunction isSharedObject(value: unknown): value is ISharedObject {\n\treturn (\n\t\t(value as SharedObject).id !== undefined &&\n\t\t(value as SharedObject).attributes?.type !== undefined &&\n\t\t(value as SharedObject).on !== undefined\n\t);\n}\n\n/**\n * Determines whether or not the provided value is an {@link DataObject} using `instanceof`, for the purposes of this library.\n * @remarks\n * Uses `instanceof` over checking specific properties or methods, because we decided that a version mix-up with\n * {@link @fluidframework/aqueduct#} is unlikely between devtools and end-user applications, and we don't support it anyway.\n */\nfunction isDataObject(value: unknown): value is DataObject {\n\tif (\n\t\tvalue instanceof DataObject ||\n\t\t(typeof (value as DataObject).initializeInternal === \"function\" &&\n\t\t\ttypeof (value as { getUninitializedErrorString(): string })\n\t\t\t\t.getUninitializedErrorString) === \"function\"\n\t) {\n\t\t// If root is missing, throw an error instead of returning false\n\t\tconst root = (value as { readonly root?: ISharedDirectory }).root;\n\t\tif (!root) {\n\t\t\tthrow new Error(\"DataObject must have a `root` property, but it was undefined.\");\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Determines whether or not the provided value is a {@link TreeDataObject} using `instanceof`, for the purposes of this library.\n * @remarks\n * Tries to use `instanceof` because we decided that a version mix-up with\n * {@link @fluidframework/aqueduct#} is unlikely between devtools and end-user applications, and we don't support it anyway.\n * In addition, we check for the presence of key properties that make a `TreeDataObject` unique:\n * - `TreeDataObject.tree` getter\n * - `TreeDataObject.treeView` getter\n * - `TreeDataObject.initializeInternal` method\n */\nfunction isTreeDataObject(value: unknown): value is TreeDataObject {\n\tif (\n\t\tvalue instanceof TreeDataObject ||\n\t\t(typeof (value as TreeDataObject).initializeInternal === \"function\" &&\n\t\t\tObject.getOwnPropertyDescriptor(Object.getPrototypeOf(value), \"tree\")?.get !== undefined)\n\t) {\n\t\tconst tree = (value as { readonly tree?: ISharedObject }).tree;\n\t\tif (tree === undefined) {\n\t\t\tthrow new Error(\"TreeDataObject must have a `tree` property, but it was undefined.\");\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DataVisualization.js","sourceRoot":"","sources":["../../src/data-visualization/DataVisualization.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sDAAsD;AACtD,uEAAuE;AAEvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAa/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EACN,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAKN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,GACjB,MAAM,iBAAiB,CAAC;AA0FzB;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,mBACZ,SAAQ,iBAAuC;IAwB/C;IACC;;OAEG;IACc,QAAwC;IAEzD;;OAEG;IACc,WAAoC;QAErD,KAAK,EAAE,CAAC;QAPS,aAAQ,GAAR,QAAQ,CAAgC;QAKxC,gBAAW,GAAX,WAAW,CAAyB;QAlBtD;;;WAGG;QACc,0BAAqB,GAAG,CAAC,UAA2B,EAAW,EAAE;YACjF,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YAClC,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;QAeD,IAAI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CAAC,kBAAkB,KAAK,UAAU;YAClE,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,SAAS,CAAC,EACzF,CAAC;QACF,MAAM,IAAI,GAAI,KAA2C,CAAC,IAAI,CAAC;QAC/D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACtF,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Indexed-object style is used to ease documentation.\n/* eslint-disable @typescript-eslint/consistent-indexed-object-style */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { DataObject, TreeDataObject } from \"@fluidframework/aqueduct/internal\";\nimport type {\n\tIDisposable,\n\tIEvent,\n\tIFluidHandle,\n\tIFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\n// eslint-disable-next-line import-x/no-deprecated\nimport type { IProvideFluidHandle } from \"@fluidframework/core-interfaces/internal\";\nimport type { ISharedDirectory } from \"@fluidframework/map/internal\";\nimport type { ISharedObject, SharedObject } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { FluidObjectId } from \"../CommonInterfaces.js\";\nimport { getKeyForFluidObject } from \"../FluidObjectKey.js\";\n\nimport {\n\tvisualizeDataObject,\n\tvisualizeTreeDataObject,\n\tvisualizeUnknownSharedObject,\n} from \"./DefaultVisualizers.js\";\nimport {\n\ttype FluidObjectNode,\n\ttype Primitive,\n\ttype RootHandleNode,\n\ttype VisualChildNode,\n\tVisualNodeKind,\n\tcreateHandleNode,\n\tunknownObjectNode,\n} from \"./VisualTree.js\";\n\n// Ideas:\n// - Hold onto previous summary and only transmit diff?\n\n// TODOs:\n// - Dependency tracking\n// - When a particular DDS is no longer reachable via the input data, we need to remove it from the map and stop\n// emitting updates.\n\n/**\n * The type of a shared object.\n *\n * @remarks\n *\n * This can be acquired via {@link @fluidframework/datastore-definitions#IChannelFactory.Type} field of\n * your shared object's factory class.\n */\nexport type SharedObjectType = string;\n\n/**\n * Generates a visual description of the provided {@link @fluidframework/shared-object-base#ISharedObject}'s\n * current state.\n *\n * @param sharedObject - The object whose data will be rendered.\n * @param visualizeChildData - Callback to render child content of the shared object.\n *\n * @returns A visual tree representation of the provided `sharedObject`.\n *\n * @internal\n */\nexport type VisualizeSharedObject = (\n\tsharedObject: ISharedObject,\n\tvisualizeChildData: VisualizeChildData,\n) => Promise<FluidObjectNode>;\n\n/**\n * Recursively renders child contents of a {@link @fluidframework/shared-object-base#ISharedObject}.\n *\n * @param data - The child data to render.\n * Since this is child data of a DDS (and must be serializable), we know that it must be one of the following:\n *\n * - Primitive data\n *\n * - A serializable Record\n *\n * - A handle to another Fluid object\n *\n * @returns A visual tree representation of the input `data`.\n *\n * @internal\n */\nexport type VisualizeChildData = (data: unknown) => Promise<VisualChildNode>;\n\n/**\n * Utility type for a union of things that can be visualized.\n */\nexport type VisualizableFluidObject = ISharedObject | DataObject | TreeDataObject;\n\n/**\n * Specifies renderers for different {@link @fluidframework/shared-object-base#ISharedObject} types.\n *\n * @remarks\n *\n * - `key`: The type of Shared object ({@link @fluidframework/datastore-definitions#IChannelFactory.Type}).\n *\n * - `value`: A renderer that takes a {@link @fluidframework/shared-object-base#ISharedObject} of the\n * specified type and generates a corresponding {@link VisualizerNode} for it.\n */\nexport interface SharedObjectVisualizers {\n\t/**\n\t * Individual Fluid object visualizers, keyed by {@link SharedObjectType}.\n\t */\n\t[k: SharedObjectType]: VisualizeSharedObject;\n}\n\n/**\n * Data visualization update events.\n */\nexport interface DataVisualizerEvents extends IEvent {\n\t/**\n\t * Emitted whenever the associated {@link @fluidframework/shared-object-base#ISharedObject}'s data is updated.\n\t *\n\t * @param visualTree - The updated visual tree representing the shared object's state.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"update\", listener: (visualTree: FluidObjectNode) => void): unknown;\n}\n\n/**\n * Manages {@link VisualizerNode | visualizers} for shared objects reachable by\n * the provided {@link DataVisualizerGraph.rootData}.\n *\n * @remarks\n *\n * {@link VisualizerNode}s are initialized lazily.\n *\n * Consumers can begin tree visualization by calling {@link DataVisualizerGraph.renderRootHandles}.\n * The returned handle nodes provide the IDs required to make subsequent calls to {@link DataVisualizerGraph.render}\n * to visualize subtrees as needed.\n */\nexport class DataVisualizerGraph\n\textends TypedEventEmitter<DataVisualizerEvents>\n\timplements IDisposable\n{\n\t/**\n\t * Map of registered {@link VisualizerNode}s, keyed by their corresponding {@link FluidObjectId}.\n\t *\n\t * @privateRemarks TODO: Dependency tracking so we don't leak memory.\n\t */\n\tprivate readonly visualizerNodes: Map<FluidObjectId, VisualizerNode>;\n\n\t/**\n\t * Private {@link VisualizerNode.disposed} tracking.\n\t */\n\tprivate _disposed: boolean;\n\n\t/**\n\t * Handler for a visualizer node's \"update\" event.\n\t * Bubbles up the event to graph subscribers.\n\t */\n\tprivate readonly onVisualUpdateHandler = (visualTree: FluidObjectNode): boolean => {\n\t\tthis.emitVisualUpdate(visualTree);\n\t\treturn true;\n\t};\n\n\tpublic constructor(\n\t\t/**\n\t\t * {@inheritDoc IContainerDevtools.containerData}\n\t\t */\n\t\tprivate readonly rootData: Record<string, IFluidLoadable>,\n\n\t\t/**\n\t\t * Policy object for visualizing different kinds of shared objects.\n\t\t */\n\t\tprivate readonly visualizers: SharedObjectVisualizers,\n\t) {\n\t\tsuper();\n\n\t\tthis.visualizerNodes = new Map<FluidObjectId, VisualizerNode>();\n\n\t\tthis._disposed = false;\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.disposed}\n\t */\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * Emits a visual tree update from one of the registered visualizer nodes.\n\t */\n\tprivate emitVisualUpdate(visualTree: FluidObjectNode): void {\n\t\tthis.emit(\"update\", visualTree);\n\t}\n\n\t/**\n\t * Generates and returns visual descriptions ({@link FluidHandleNode}s) for each of the specified\n\t * {@link DataVisualizerGraph.rootData | root shared objects}.\n\t */\n\tpublic async renderRootHandles(): Promise<Record<string, RootHandleNode>> {\n\t\t// TODO: We should be rendering the DataObject from the root, but this requires change in the devtools package in general.\n\n\t\t// Rendering the root entries amounts to initializing visualizer nodes for each of them, and returning\n\t\t// a list of handle nodes. Consumers can request data for each of these handles as needed.\n\t\tconst rootDataEntries = Object.entries(this.rootData);\n\n\t\tconst result: Record<string, RootHandleNode> = {};\n\t\tawait Promise.all(\n\t\t\trootDataEntries.map(async ([key, value]) => {\n\t\t\t\tif (value.handle === undefined) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Container data includes a non-Fluid object under key ${key}. Cannot visualize!`,\n\t\t\t\t\t);\n\t\t\t\t\tresult[key] = unknownObjectNode;\n\t\t\t\t} else {\n\t\t\t\t\tconst fluidObjectId = await this.registerVisualizerForHandle(value.handle);\n\t\t\t\t\tresult[key] =\n\t\t\t\t\t\tfluidObjectId === undefined ? unknownObjectNode : createHandleNode(fluidObjectId);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Generates and returns a visual description of the specified Fluid object if it exists in the graph.\n\t * If no such object exists in the graph, returns `undefined`.\n\t */\n\tpublic async render(fluidObjectId: FluidObjectId): Promise<FluidObjectNode | undefined> {\n\t\t// If we don't have anything registered for the requested Fluid object, return `undefined`.\n\t\t// This could indicate a stale data request from an external consumer, or could indicate a bug,\n\t\t// but this library isn't capable of telling the difference.\n\t\treturn this.visualizerNodes.get(fluidObjectId)?.render() ?? undefined;\n\t}\n\n\t/**\n\t * Adds a visualizer node to the collection for the specified\n\t * {@link VisualizableFluidObject} if one does not already exist.\n\t */\n\tprivate registerVisualizerForVisualizableObject(\n\t\tvisualizableObject: VisualizableFluidObject,\n\t): FluidObjectId {\n\t\t// Store type check results to avoid recomputing\n\t\tconst isDataObj = isDataObject(visualizableObject);\n\t\tconst isTreeDataObj = isTreeDataObject(visualizableObject);\n\n\t\tlet visualizationFunction: VisualizeSharedObject;\n\t\tlet rootSharedObject: ISharedObject;\n\t\tlet objectId: FluidObjectId;\n\n\t\tif (isDataObj) {\n\t\t\trootSharedObject = (visualizableObject as unknown as { readonly root: ISharedDirectory })\n\t\t\t\t.root;\n\t\t\tobjectId = getKeyForFluidObject(rootSharedObject);\n\t\t\tvisualizationFunction = visualizeDataObject;\n\t\t} else if (isTreeDataObj) {\n\t\t\trootSharedObject = (visualizableObject as unknown as { readonly tree: ISharedObject })\n\t\t\t\t.tree;\n\t\t\tobjectId = getKeyForFluidObject(rootSharedObject);\n\t\t\tvisualizationFunction = visualizeTreeDataObject;\n\t\t} else {\n\t\t\trootSharedObject = visualizableObject;\n\t\t\tobjectId = getKeyForFluidObject(visualizableObject);\n\t\t\tvisualizationFunction =\n\t\t\t\t(this.visualizers[visualizableObject.attributes.type] as VisualizeSharedObject) ??\n\t\t\t\tvisualizeUnknownSharedObject;\n\t\t}\n\n\t\tif (!this.visualizerNodes.has(objectId)) {\n\t\t\tconst visualizerNode = new VisualizerNode(\n\t\t\t\trootSharedObject,\n\t\t\t\tvisualizationFunction,\n\t\t\t\tasync (handle) => this.registerVisualizerForHandle(handle),\n\t\t\t);\n\n\t\t\t// Register event handler so we can bubble up update events\n\t\t\tvisualizerNode.on(\"update\", this.onVisualUpdateHandler);\n\n\t\t\t// Add the visualizer node to our collection\n\t\t\tthis.visualizerNodes.set(objectId, visualizerNode);\n\t\t}\n\n\t\treturn objectId;\n\t}\n\n\t/**\n\t * Adds a visualizer node to the collection for the specified {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}\n\t * if one does not already exist.\n\t *\n\t * @returns\n\t *\n\t * The ID of object associated with the provided handle, if the handle resolves to a {@link ISharedObject}.\n\t * If the handle resolves to something else, this sytem has no way to reason about it sufficiently to generate\n\t * visual descriptors from it.\n\t * In this case, we return `undefined`.\n\t */\n\tprivate async registerVisualizerForHandle(\n\t\thandle: IFluidHandle,\n\t): Promise<FluidObjectId | undefined> {\n\t\tconst resolvedObject = await handle.get();\n\n\t\tif (isDataObject(resolvedObject) || isTreeDataObject(resolvedObject)) {\n\t\t\treturn this.registerVisualizerForVisualizableObject(resolvedObject);\n\t\t}\n\n\t\t// TODO: is this the right type check for this?\n\t\tconst sharedObject = resolvedObject as Partial<ISharedObject>;\n\t\tif (isSharedObject(sharedObject)) {\n\t\t\treturn this.registerVisualizerForVisualizableObject(sharedObject);\n\t\t} else {\n\t\t\t// Unknown data.\n\t\t\tconsole.warn(\n\t\t\t\t\"Fluid Handle resolved to data that is not a SharedObject or a DataObject.\",\n\t\t\t);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.dispose}\n\t */\n\tpublic dispose(): void {\n\t\tif (!this._disposed) {\n\t\t\t// Dispose visualizer nodes.\n\t\t\tfor (const visualizerNode of this.visualizerNodes.values()) {\n\t\t\t\tvisualizerNode.dispose();\n\t\t\t}\n\t\t\tthis.visualizerNodes.clear();\n\n\t\t\tthis._disposed = true;\n\t\t}\n\t}\n}\n\n/**\n * Wraps a {@link @fluidframework/shared-object-base#ISharedObject} and encapsulates policy for\n * generating visual tree representations of its data.\n *\n * @remarks\n *\n * A visual representation can be requested via {@link VisualizerNode.render}.\n *\n * Additionally, whenever the associated `ISharedObject` is updated (i.e. whenever its \"op\" event is emitted),\n * an updated visual tree will be emitted via this object's {@link SharedObjectListenerEvents | \"update\" event}.\n */\nexport class VisualizerNode\n\textends TypedEventEmitter<DataVisualizerEvents>\n\timplements IDisposable\n{\n\t/**\n\t * Handler for {@link VisualizerNode.sharedObject}'s \"op\" event.\n\t * Will broadcast an updated visual tree representation of the DDS's data via the\n\t * {@link SharedObjectListenerEvents | \"update\"} event.\n\t */\n\tprivate readonly onOpHandler = async (): Promise<boolean> => {\n\t\ttry {\n\t\t\tawait this.emitVisualUpdate();\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t\treturn false;\n\t\t}\n\t};\n\n\t/**\n\t * Private {@link VisualizerNode.disposed} tracking.\n\t */\n\tprivate _disposed: boolean;\n\n\t/**\n\t * Handles the returned promise for {@link onOpHandler}.\n\t */\n\tprivate readonly syncOpHandler = (): void => {\n\t\tthis.onOpHandler().catch((error) => console.error(error));\n\t};\n\n\tpublic constructor(\n\t\t/**\n\t\t * The Fluid object whose data will be emitted in visualized form when requested / whenever its data is updated.\n\t\t */\n\t\tpublic readonly sharedObject: ISharedObject,\n\n\t\t/**\n\t\t * Callback for visualizing {@link VisualizerNode.sharedObject}.\n\t\t * Encapsulates the policies for rendering different kinds of DDSs.\n\t\t */\n\t\tprivate readonly visualizeSharedObject: VisualizeSharedObject,\n\n\t\t/**\n\t\t * Registers some child handle to a Fluid object for future rendering.\n\t\t *\n\t\t * @remarks\n\t\t *\n\t\t * Called during {@link VisualizerNode.render} whenever a Fluid handle is encountered.\n\t\t * Ensures that the consumer of this object's visual tree will be able to request a rendering of the handle's\n\t\t * corresponding DDS as needed.\n\t\t */\n\t\tprivate readonly registerHandle: (\n\t\t\thandle: IFluidHandle,\n\t\t) => Promise<FluidObjectId | undefined>,\n\t) {\n\t\tsuper();\n\n\t\tthis.sharedObject.on?.(\"op\", this.syncOpHandler);\n\n\t\tthis._disposed = false;\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.disposed}\n\t */\n\tpublic get disposed(): boolean {\n\t\treturn this._disposed;\n\t}\n\n\t/**\n\t * Emits a {@link VisualizerNode.render | visual tree representation} of\n\t * {@link VisualizerNode.sharedObject}'s current state as an\n\t * {@link SharedObjectListenerEvents | \"update\"} event.\n\t */\n\tprivate async emitVisualUpdate(): Promise<void> {\n\t\ttry {\n\t\t\tconst visualTree: FluidObjectNode = await this.render();\n\t\t\tthis.emit(\"update\", visualTree);\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t}\n\n\t/**\n\t * Generates a visual description of the associated {@link VisualizerNode.sharedObject}'s\n\t * current state.\n\t *\n\t * @remarks\n\t *\n\t * Will recursively render child contents of {@link VisualizerNode.sharedObject}, terminating at\n\t * primitive data and handles to other Fluid objects.\n\t *\n\t * @returns A visual tree representation of {@link VisualizerNode.sharedObject}.\n\t */\n\tpublic async render(): Promise<FluidObjectNode> {\n\t\treturn this.visualizeSharedObject(this.sharedObject, async (data) =>\n\t\t\tthis.renderChildData(data),\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc VisualizeChildData}\n\t */\n\tprivate async renderChildData(data: unknown): Promise<VisualChildNode> {\n\t\treturn visualizeChildData(data, this.registerHandle);\n\t}\n\n\t/**\n\t * {@inheritDoc IDisposable.dispose}\n\t */\n\tpublic dispose(): void {\n\t\tif (!this._disposed) {\n\t\t\tthis.sharedObject.off(\"op\", this.syncOpHandler);\n\t\t\tthis._disposed = true;\n\t\t}\n\t}\n}\n\n/**\n * See {@link VisualizeChildData}.\n *\n * @param data - The child data to (recursively) render.\n * @param resolveHandle - Function which accepts an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}\n * and returns its resolved object ID.\n *\n * @privateRemarks Exported from this module for testing purposes. This is not intended to be exported by the package.\n */\nexport async function visualizeChildData(\n\tdata: unknown,\n\tresolveHandle: (handle: IFluidHandle) => Promise<FluidObjectId | undefined>,\n): Promise<VisualChildNode> {\n\t// Special case for `null` because `typeof null === \"object\"`.\n\tif (data === null) {\n\t\treturn {\n\t\t\tvalue: data,\n\t\t\ttypeMetadata: \"null\",\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\tif (typeof data !== \"object\" && typeof data !== \"function\") {\n\t\t// Render primitives and falsy types via their string representation\n\t\treturn {\n\t\t\tvalue: data as Primitive,\n\t\t\ttypeMetadata: typeof data,\n\t\t\tnodeKind: VisualNodeKind.ValueNode,\n\t\t};\n\t}\n\n\t// eslint-disable-next-line import-x/no-deprecated\n\tif ((data as IProvideFluidHandle)?.IFluidHandle !== undefined) {\n\t\t// If we encounter a Fluid handle, register it for future rendering, and return a node with its ID.\n\t\tconst handle = data as IFluidHandle;\n\t\tconst fluidObjectId = await resolveHandle(handle);\n\t\t// If no ID was found, then the data is not a SharedObject.\n\t\t// In this case, return an \"Unknown Data\" node so consumers can note this (as desired) to the user.\n\t\treturn fluidObjectId === undefined ? unknownObjectNode : createHandleNode(fluidObjectId);\n\t}\n\n\t// Assume any other data must be a record of some kind (since DDS contents must be serializable)\n\t// and simply recurse over its keys.\n\tconst childEntries = Object.entries(data as Record<string | number | symbol, unknown>);\n\n\tconst children: Record<string, VisualChildNode> = {};\n\tawait Promise.all(\n\t\tchildEntries.map(async ([key, value]) => {\n\t\t\tconst childNode = await visualizeChildData(value, resolveHandle);\n\t\t\tchildren[key] = childNode;\n\t\t}),\n\t);\n\n\treturn {\n\t\tchildren,\n\t\tnodeKind: VisualNodeKind.TreeNode,\n\t\ttypeMetadata: \"object\",\n\t};\n}\n\n/**\n * Determines whether or not the provided value is an {@link ISharedObject}, for the purposes of this library.\n * @remarks Implemented by checking for the particular properties / methods we use in this module.\n */\nfunction isSharedObject(value: unknown): value is ISharedObject {\n\treturn (\n\t\t(value as SharedObject).id !== undefined &&\n\t\t(value as SharedObject).attributes?.type !== undefined &&\n\t\t(value as SharedObject).on !== undefined\n\t);\n}\n\n/**\n * Determines whether or not the provided value is an {@link DataObject} using `instanceof`, for the purposes of this library.\n * @remarks\n * Uses `instanceof` over checking specific properties or methods, because we decided that a version mix-up with\n * {@link @fluidframework/aqueduct#} is unlikely between devtools and end-user applications, and we don't support it anyway.\n */\nfunction isDataObject(value: unknown): value is DataObject {\n\tif (\n\t\tvalue instanceof DataObject ||\n\t\t(typeof (value as DataObject).initializeInternal === \"function\" &&\n\t\t\ttypeof (value as { getUninitializedErrorString(): string })\n\t\t\t\t.getUninitializedErrorString) === \"function\"\n\t) {\n\t\t// If root is missing, throw an error instead of returning false\n\t\tconst root = (value as { readonly root?: ISharedDirectory }).root;\n\t\tif (!root) {\n\t\t\tthrow new Error(\"DataObject must have a `root` property, but it was undefined.\");\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Determines whether or not the provided value is a {@link TreeDataObject} using `instanceof`, for the purposes of this library.\n * @remarks\n * Tries to use `instanceof` because we decided that a version mix-up with\n * {@link @fluidframework/aqueduct#} is unlikely between devtools and end-user applications, and we don't support it anyway.\n * In addition, we check for the presence of key properties that make a `TreeDataObject` unique:\n * - `TreeDataObject.tree` getter\n * - `TreeDataObject.treeView` getter\n * - `TreeDataObject.initializeInternal` method\n */\nfunction isTreeDataObject(value: unknown): value is TreeDataObject {\n\tif (\n\t\tvalue instanceof TreeDataObject ||\n\t\t(typeof (value as TreeDataObject).initializeInternal === \"function\" &&\n\t\t\tObject.getOwnPropertyDescriptor(Object.getPrototypeOf(value), \"tree\")?.get !== undefined)\n\t) {\n\t\tconst tree = (value as { readonly tree?: ISharedObject }).tree;\n\t\tif (tree === undefined) {\n\t\t\tthrow new Error(\"TreeDataObject must have a `tree` property, but it was undefined.\");\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n"]}
|
package/lib/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/devtools-core";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.73.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,+BAA+B,CAAC;AACvD,MAAM,CAAC,MAAM,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/devtools-core\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,+BAA+B,CAAC;AACvD,MAAM,CAAC,MAAM,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/devtools-core\";\nexport const pkgVersion = \"2.73.0\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/devtools-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.73.0",
|
|
4
4
|
"description": "Fluid Framework developer tools core functionality",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -77,37 +77,37 @@
|
|
|
77
77
|
"temp-directory": "nyc/.nyc_output"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@fluid-internal/client-utils": "~2.
|
|
81
|
-
"@fluidframework/aqueduct": "~2.
|
|
82
|
-
"@fluidframework/cell": "~2.
|
|
83
|
-
"@fluidframework/container-definitions": "~2.
|
|
84
|
-
"@fluidframework/container-loader": "~2.
|
|
85
|
-
"@fluidframework/container-runtime": "~2.
|
|
86
|
-
"@fluidframework/container-runtime-definitions": "~2.
|
|
87
|
-
"@fluidframework/core-interfaces": "~2.
|
|
88
|
-
"@fluidframework/core-utils": "~2.
|
|
89
|
-
"@fluidframework/counter": "~2.
|
|
90
|
-
"@fluidframework/datastore-definitions": "~2.
|
|
91
|
-
"@fluidframework/driver-definitions": "~2.
|
|
92
|
-
"@fluidframework/map": "~2.
|
|
93
|
-
"@fluidframework/matrix": "~2.
|
|
94
|
-
"@fluidframework/runtime-definitions": "~2.
|
|
95
|
-
"@fluidframework/sequence": "~2.
|
|
96
|
-
"@fluidframework/shared-object-base": "~2.
|
|
97
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
98
|
-
"@fluidframework/tree": "~2.
|
|
80
|
+
"@fluid-internal/client-utils": "~2.73.0",
|
|
81
|
+
"@fluidframework/aqueduct": "~2.73.0",
|
|
82
|
+
"@fluidframework/cell": "~2.73.0",
|
|
83
|
+
"@fluidframework/container-definitions": "~2.73.0",
|
|
84
|
+
"@fluidframework/container-loader": "~2.73.0",
|
|
85
|
+
"@fluidframework/container-runtime": "~2.73.0",
|
|
86
|
+
"@fluidframework/container-runtime-definitions": "~2.73.0",
|
|
87
|
+
"@fluidframework/core-interfaces": "~2.73.0",
|
|
88
|
+
"@fluidframework/core-utils": "~2.73.0",
|
|
89
|
+
"@fluidframework/counter": "~2.73.0",
|
|
90
|
+
"@fluidframework/datastore-definitions": "~2.73.0",
|
|
91
|
+
"@fluidframework/driver-definitions": "~2.73.0",
|
|
92
|
+
"@fluidframework/map": "~2.73.0",
|
|
93
|
+
"@fluidframework/matrix": "~2.73.0",
|
|
94
|
+
"@fluidframework/runtime-definitions": "~2.73.0",
|
|
95
|
+
"@fluidframework/sequence": "~2.73.0",
|
|
96
|
+
"@fluidframework/shared-object-base": "~2.73.0",
|
|
97
|
+
"@fluidframework/telemetry-utils": "~2.73.0",
|
|
98
|
+
"@fluidframework/tree": "~2.73.0"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
102
102
|
"@biomejs/biome": "~1.9.3",
|
|
103
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
104
|
-
"@fluid-tools/build-cli": "^0.
|
|
103
|
+
"@fluid-internal/mocha-test-setup": "~2.73.0",
|
|
104
|
+
"@fluid-tools/build-cli": "^0.60.0",
|
|
105
105
|
"@fluidframework/build-common": "^2.0.3",
|
|
106
|
-
"@fluidframework/build-tools": "^0.
|
|
107
|
-
"@fluidframework/devtools-core-previous": "npm:@fluidframework/devtools-core@2.
|
|
108
|
-
"@fluidframework/eslint-config-fluid": "
|
|
109
|
-
"@fluidframework/id-compressor": "~2.
|
|
110
|
-
"@fluidframework/test-runtime-utils": "~2.
|
|
106
|
+
"@fluidframework/build-tools": "^0.60.0",
|
|
107
|
+
"@fluidframework/devtools-core-previous": "npm:@fluidframework/devtools-core@2.71.0",
|
|
108
|
+
"@fluidframework/eslint-config-fluid": "~2.73.0",
|
|
109
|
+
"@fluidframework/id-compressor": "~2.73.0",
|
|
110
|
+
"@fluidframework/test-runtime-utils": "~2.73.0",
|
|
111
111
|
"@microsoft/api-extractor": "7.52.11",
|
|
112
112
|
"@types/chai": "^4.0.0",
|
|
113
113
|
"@types/mocha": "^10.0.10",
|
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
IFluidHandle,
|
|
15
15
|
IFluidLoadable,
|
|
16
16
|
} from "@fluidframework/core-interfaces";
|
|
17
|
-
// eslint-disable-next-line import/no-deprecated
|
|
17
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
18
18
|
import type { IProvideFluidHandle } from "@fluidframework/core-interfaces/internal";
|
|
19
19
|
import type { ISharedDirectory } from "@fluidframework/map/internal";
|
|
20
20
|
import type { ISharedObject, SharedObject } from "@fluidframework/shared-object-base/internal";
|
|
@@ -494,7 +494,7 @@ export async function visualizeChildData(
|
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
// eslint-disable-next-line import/no-deprecated
|
|
497
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
498
498
|
if ((data as IProvideFluidHandle)?.IFluidHandle !== undefined) {
|
|
499
499
|
// If we encounter a Fluid handle, register it for future rendering, and return a node with its ID.
|
|
500
500
|
const handle = data as IFluidHandle;
|
package/src/packageVersion.ts
CHANGED