@fluidframework/runtime-utils 2.50.0-345060 → 2.51.0-347100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @fluidframework/runtime-utils
2
2
 
3
+ ## 2.50.0
4
+
5
+ ### Minor Changes
6
+
7
+ - IFluidHandleInternal.bind (deprecated) has been removed ([#24974](https://github.com/microsoft/FluidFramework/pull/24974)) [07e183795f](https://github.com/microsoft/FluidFramework/commit/07e183795fa8118fae717c118ab7a7945ac1ad57)
8
+
9
+ `IFluidHandleInternal.bind` was deprecated in 2.40 and has now been removed. See [release notes entry](https://github.com/microsoft/FluidFramework/releases/tag/client_v2.40.0#user-content-ifluidhandleinternalbind-has-been-deprecated-24553) for more details.
10
+
3
11
  ## 2.43.0
4
12
 
5
13
  Dependency updates only.
@@ -21,8 +21,6 @@ export abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {
21
21
  abstract absolutePath: string;
22
22
  // (undocumented)
23
23
  abstract attachGraph(): void;
24
- // @deprecated (undocumented)
25
- abstract bind(handle: IFluidHandleInternal): void;
26
24
  // (undocumented)
27
25
  abstract get(): Promise<T>;
28
26
  get IFluidHandle(): IFluidHandleInternal;
package/dist/handles.d.ts CHANGED
@@ -89,10 +89,6 @@ export declare function toFluidHandleErased<T>(handle: IFluidHandleInternal<T>):
89
89
  export declare abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {
90
90
  abstract absolutePath: string;
91
91
  abstract attachGraph(): void;
92
- /**
93
- * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
94
- */
95
- abstract bind(handle: IFluidHandleInternal): void;
96
92
  abstract readonly isAttached: boolean;
97
93
  abstract get(): Promise<T>;
98
94
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE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ourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleErased } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandle, fluidHandleSymbol } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @internal\n */\nexport interface ISerializedHandle {\n\t// Marker to indicate to JSON.parse that the object is a Fluid handle\n\ttype: \"__fluid_handle__\";\n\n\t// URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n\turl: string;\n\n\t/**\n\t * The handle may have a pending payload, as determined by and resolvable by the subsystem that\n\t * the handle relates to. For instance, the BlobManager uses this to distinguish blob handles\n\t * which may not yet have an attached blob yet.\n\t *\n\t * @remarks\n\t * Will only exist if the handle was created with a pending payload, will be omitted entirely from\n\t * the serialized format if the handle was created with an already-shared payload.\n\t */\n\treadonly payloadPending?: true;\n}\n\n/**\n * Is the input object a @see ISerializedHandle?\n * @internal\n */\nexport const isSerializedHandle = (value: any): value is ISerializedHandle =>\n\tvalue?.type === \"__fluid_handle__\";\n\n/**\n * @internal\n */\nexport const isFluidHandleInternalPayloadPending = (\n\tfluidHandleInternal: IFluidHandleInternal,\n): fluidHandleInternal is IFluidHandleInternalPayloadPending =>\n\t\"payloadPending\" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;\n\n/**\n * Check if the handle is an IFluidHandlePayloadPending.\n * @privateRemarks\n * This should be true for locally-created BlobHandles currently. When IFluidHandlePayloadPending is merged\n * to IFluidHandle, this type guard will no longer be necessary.\n * @legacy\n * @alpha\n */\nexport const isFluidHandlePayloadPending = <T>(\n\thandle: IFluidHandle<T>,\n): handle is IFluidHandlePayloadPending<T> =>\n\t\"payloadState\" in handle &&\n\t(handle.payloadState === \"shared\" || handle.payloadState === \"pending\");\n\n/**\n * Check if the handle is an ILocalFluidHandle.\n * @legacy\n * @alpha\n */\nexport const isLocalFluidHandle = <T>(\n\thandle: IFluidHandle<T>,\n): handle is ILocalFluidHandle<T> =>\n\tisFluidHandlePayloadPending(handle) && \"payloadShareError\" in handle;\n/**\n * Encodes the given IFluidHandle into a JSON-serializable form,\n * @param handle - The IFluidHandle to serialize.\n * @returns The serialized handle.\n *\n * @internal\n */\nexport function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {\n\treturn isFluidHandleInternalPayloadPending(handle)\n\t\t? {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t\tpayloadPending: true,\n\t\t\t}\n\t\t: {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t};\n}\n\n/**\n * Setting to opt into compatibility with handles from before {@link fluidHandleSymbol} existed (Fluid Framework client 2.0.0-rc.3.0.0 and earlier).\n *\n * Some code which uses this library might dynamically load multiple versions of it,\n * as well as old or duplicated versions of packages which produce or implement handles.\n * To correctly interoperate with this old packages and object produced by them, the old in-memory format for handles, without the symbol, are explicitly supported.\n *\n * This setting mostly exists as a way to easily find any code that only exists to provide this compatibility and clarify how to remove that compatibility.\n * At some point this might be removed or turned into an actual configuration option, but for now its really just documentation.\n */\nconst enableBackwardsCompatibility = true;\n\n/**\n * Check if a value is an {@link @fluidframework/core-interfaces#IFluidHandle}.\n * @remarks\n * Objects which have a field named `IFluidHandle` can in some cases produce a false positive.\n * @public\n */\nexport function isFluidHandle(value: unknown): value is IFluidHandle {\n\t// `in` gives a type error on non-objects and null, so filter them out\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\tif (fluidHandleSymbol in value) {\n\t\treturn true;\n\t}\n\t// If enableBackwardsCompatibility, run check for FluidHandles predating use of fluidHandleSymbol.\n\tif (enableBackwardsCompatibility && IFluidHandle in value) {\n\t\t// Since this check can have false positives, make it a bit more robust by checking value[IFluidHandle][IFluidHandle]\n\t\tconst inner = value[IFluidHandle] as IFluidHandle;\n\t\tif (typeof inner !== \"object\" || inner === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn IFluidHandle in inner;\n\t}\n\treturn false;\n}\n\n/**\n * Compare two {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}.\n * @remarks\n * Returns true iff both handles have the same internal `absolutePath`.\n * @public\n */\nexport function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean {\n\tconst aInternal = toFluidHandleInternal(a);\n\tconst bInternal = toFluidHandleInternal(b);\n\treturn aInternal.absolutePath === bInternal.absolutePath;\n}\n\n/**\n * Downcast an IFluidHandle to an IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {\n\tif (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {\n\t\tif (enableBackwardsCompatibility && IFluidHandle in handle) {\n\t\t\treturn handle[IFluidHandle] as IFluidHandleInternal<T>;\n\t\t}\n\t\tthrow new TypeError(\"Invalid IFluidHandle\");\n\t}\n\n\t// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone\n\t// implements their own IFluidHandle in terms of an existing handle, it won't break anything.\n\treturn handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;\n}\n\n/**\n * Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleErased<T>(\n\thandle: IFluidHandleInternal<T>,\n): IFluidHandleErased<T> {\n\treturn handle as unknown as IFluidHandleErased<T>;\n}\n\n/**\n * Base class which can be uses to assist implementing IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {\n\tpublic abstract absolutePath: string;\n\tpublic abstract attachGraph(): void;\n\t/**\n\t * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.\n\t */\n\tpublic abstract bind(handle: IFluidHandleInternal): void;\n\tpublic abstract readonly isAttached: boolean;\n\tpublic abstract get(): Promise<T>;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal {\n\t\treturn this;\n\t}\n\n\tpublic get [fluidHandleSymbol](): IFluidHandleErased<T> {\n\t\treturn toFluidHandleErased(this);\n\t}\n}\n"]}
1
+ {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,qEAAkF;AA+BlF;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAU,EAA8B,EAAE,CAC5E,KAAK,EAAE,IAAI,KAAK,kBAAkB,CAAC;AADvB,QAAA,kBAAkB,sBACK;AAEpC;;GAEG;AACI,MAAM,mCAAmC,GAAG,CAClD,mBAAyC,EACmB,EAAE,CAC9D,gBAAgB,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,cAAc,KAAK,IAAI,CAAC;AAH3E,QAAA,mCAAmC,uCAGwC;AAExF;;;;;;;GAOG;AACI,MAAM,2BAA2B,GAAG,CAC1C,MAAuB,EACmB,EAAE,CAC5C,cAAc,IAAI,MAAM;IACxB,CAAC,MAAM,CAAC,YAAY,KAAK,QAAQ,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC;AAJ5D,QAAA,2BAA2B,+BAIiC;AAEzE;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CACjC,MAAuB,EACU,EAAE,CACnC,IAAA,mCAA2B,EAAC,MAAM,CAAC,IAAI,mBAAmB,IAAI,MAAM,CAAC;AAHzD,QAAA,kBAAkB,sBAGuC;AACtE;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAAC,MAA4B;IACxE,OAAO,IAAA,2CAAmC,EAAC,MAAM,CAAC;QACjD,CAAC,CAAC;YACA,IAAI,EAAE,k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,IAAI,MAAM,CAAC,mCAAiB,CAAC,CAAC,EAAE,CAAC;QACzF,IAAI,4BAA4B,IAAI,8BAAY,IAAI,MAAM,EAAE,CAAC;YAC5D,OAAO,MAAM,CAAC,8BAAY,CAA4B,CAAC;QACxD,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAC7C,CAAC;IAED,kGAAkG;IAClG,6FAA6F;IAC7F,OAAO,MAAM,CAAC,mCAAiB,CAAuC,CAAC;AACxE,CAAC;AAXD,sDAWC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAClC,MAA+B;IAE/B,OAAO,MAA0C,CAAC;AACnD,CAAC;AAJD,kDAIC;AAED;;;;GAIG;AACH,MAAsB,eAAe;IAMpC;;OAEG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,CAAC,mCAAiB,CAAC;QAC7B,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACD;AAhBD,0CAgBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleErased } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandle, fluidHandleSymbol } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @internal\n */\nexport interface ISerializedHandle {\n\t// Marker to indicate to JSON.parse that the object is a Fluid handle\n\ttype: \"__fluid_handle__\";\n\n\t// URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n\turl: string;\n\n\t/**\n\t * The handle may have a pending payload, as determined by and resolvable by the subsystem that\n\t * the handle relates to. For instance, the BlobManager uses this to distinguish blob handles\n\t * which may not yet have an attached blob yet.\n\t *\n\t * @remarks\n\t * Will only exist if the handle was created with a pending payload, will be omitted entirely from\n\t * the serialized format if the handle was created with an already-shared payload.\n\t */\n\treadonly payloadPending?: true;\n}\n\n/**\n * Is the input object a @see ISerializedHandle?\n * @internal\n */\nexport const isSerializedHandle = (value: any): value is ISerializedHandle =>\n\tvalue?.type === \"__fluid_handle__\";\n\n/**\n * @internal\n */\nexport const isFluidHandleInternalPayloadPending = (\n\tfluidHandleInternal: IFluidHandleInternal,\n): fluidHandleInternal is IFluidHandleInternalPayloadPending =>\n\t\"payloadPending\" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;\n\n/**\n * Check if the handle is an IFluidHandlePayloadPending.\n * @privateRemarks\n * This should be true for locally-created BlobHandles currently. When IFluidHandlePayloadPending is merged\n * to IFluidHandle, this type guard will no longer be necessary.\n * @legacy\n * @alpha\n */\nexport const isFluidHandlePayloadPending = <T>(\n\thandle: IFluidHandle<T>,\n): handle is IFluidHandlePayloadPending<T> =>\n\t\"payloadState\" in handle &&\n\t(handle.payloadState === \"shared\" || handle.payloadState === \"pending\");\n\n/**\n * Check if the handle is an ILocalFluidHandle.\n * @legacy\n * @alpha\n */\nexport const isLocalFluidHandle = <T>(\n\thandle: IFluidHandle<T>,\n): handle is ILocalFluidHandle<T> =>\n\tisFluidHandlePayloadPending(handle) && \"payloadShareError\" in handle;\n/**\n * Encodes the given IFluidHandle into a JSON-serializable form,\n * @param handle - The IFluidHandle to serialize.\n * @returns The serialized handle.\n *\n * @internal\n */\nexport function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {\n\treturn isFluidHandleInternalPayloadPending(handle)\n\t\t? {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t\tpayloadPending: true,\n\t\t\t}\n\t\t: {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t};\n}\n\n/**\n * Setting to opt into compatibility with handles from before {@link fluidHandleSymbol} existed (Fluid Framework client 2.0.0-rc.3.0.0 and earlier).\n *\n * Some code which uses this library might dynamically load multiple versions of it,\n * as well as old or duplicated versions of packages which produce or implement handles.\n * To correctly interoperate with this old packages and object produced by them, the old in-memory format for handles, without the symbol, are explicitly supported.\n *\n * This setting mostly exists as a way to easily find any code that only exists to provide this compatibility and clarify how to remove that compatibility.\n * At some point this might be removed or turned into an actual configuration option, but for now its really just documentation.\n */\nconst enableBackwardsCompatibility = true;\n\n/**\n * Check if a value is an {@link @fluidframework/core-interfaces#IFluidHandle}.\n * @remarks\n * Objects which have a field named `IFluidHandle` can in some cases produce a false positive.\n * @public\n */\nexport function isFluidHandle(value: unknown): value is IFluidHandle {\n\t// `in` gives a type error on non-objects and null, so filter them out\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\tif (fluidHandleSymbol in value) {\n\t\treturn true;\n\t}\n\t// If enableBackwardsCompatibility, run check for FluidHandles predating use of fluidHandleSymbol.\n\tif (enableBackwardsCompatibility && IFluidHandle in value) {\n\t\t// Since this check can have false positives, make it a bit more robust by checking value[IFluidHandle][IFluidHandle]\n\t\tconst inner = value[IFluidHandle] as IFluidHandle;\n\t\tif (typeof inner !== \"object\" || inner === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn IFluidHandle in inner;\n\t}\n\treturn false;\n}\n\n/**\n * Compare two {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}.\n * @remarks\n * Returns true iff both handles have the same internal `absolutePath`.\n * @public\n */\nexport function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean {\n\tconst aInternal = toFluidHandleInternal(a);\n\tconst bInternal = toFluidHandleInternal(b);\n\treturn aInternal.absolutePath === bInternal.absolutePath;\n}\n\n/**\n * Downcast an IFluidHandle to an IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {\n\tif (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {\n\t\tif (enableBackwardsCompatibility && IFluidHandle in handle) {\n\t\t\treturn handle[IFluidHandle] as IFluidHandleInternal<T>;\n\t\t}\n\t\tthrow new TypeError(\"Invalid IFluidHandle\");\n\t}\n\n\t// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone\n\t// implements their own IFluidHandle in terms of an existing handle, it won't break anything.\n\treturn handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;\n}\n\n/**\n * Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleErased<T>(\n\thandle: IFluidHandleInternal<T>,\n): IFluidHandleErased<T> {\n\treturn handle as unknown as IFluidHandleErased<T>;\n}\n\n/**\n * Base class which can be uses to assist implementing IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {\n\tpublic abstract absolutePath: string;\n\tpublic abstract attachGraph(): void;\n\tpublic abstract readonly isAttached: boolean;\n\tpublic abstract get(): Promise<T>;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal {\n\t\treturn this;\n\t}\n\n\tpublic get [fluidHandleSymbol](): IFluidHandleErased<T> {\n\t\treturn toFluidHandleErased(this);\n\t}\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { FluidObject } from "@fluidframework/core-interfaces";
6
- import { IFluidHandleContext, type IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
6
+ import { IFluidHandleContext } from "@fluidframework/core-interfaces/internal";
7
7
  import { FluidHandleBase } from "./handles.js";
8
8
  /**
9
9
  * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized
@@ -29,9 +29,5 @@ export declare class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject
29
29
  constructor(absolutePath: string, routeContext: IFluidHandleContext, payloadPending: boolean);
30
30
  get(): Promise<FluidObject>;
31
31
  attachGraph(): void;
32
- /**
33
- * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
34
- */
35
- bind(handle: IFluidHandleInternal): void;
36
32
  }
37
33
  //# sourceMappingURL=remoteFluidObjectHandle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remoteFluidObjectHandle.d.ts","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAY,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACN,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,eAAe,CAAC,WAAW,CAAC;aAWvD,YAAY,EAAE,MAAM;aACpB,YAAY,EAAE,mBAAmB;aACjC,cAAc,EAAE,OAAO;IAZxC,SAAgB,UAAU,QAAQ;IAClC,OAAO,CAAC,OAAO,CAAmC;IAElD;;;;;OAKG;gBAEc,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,mBAAmB,EACjC,cAAc,EAAE,OAAO;IAS3B,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;IAqBjC,WAAW,IAAI,IAAI;IAI1B;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;CAG/C"}
1
+ {"version":3,"file":"remoteFluidObjectHandle.d.ts","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAY,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAI/E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,eAAe,CAAC,WAAW,CAAC;aAWvD,YAAY,EAAE,MAAM;aACpB,YAAY,EAAE,mBAAmB;aACjC,cAAc,EAAE,OAAO;IAZxC,SAAgB,UAAU,QAAQ;IAClC,OAAO,CAAC,OAAO,CAAmC;IAElD;;;;;OAKG;gBAEc,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,mBAAmB,EACjC,cAAc,EAAE,OAAO;IAS3B,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;IAqBjC,WAAW,IAAI,IAAI;CAG1B"}
@@ -56,12 +56,6 @@ class RemoteFluidObjectHandle extends handles_js_1.FluidHandleBase {
56
56
  attachGraph() {
57
57
  return;
58
58
  }
59
- /**
60
- * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
61
- */
62
- bind(handle) {
63
- (0, internal_1.fail)("RemoteFluidObjectHandle not supported as a bind source");
64
- }
65
59
  }
66
60
  exports.RemoteFluidObjectHandle = RemoteFluidObjectHandle;
67
61
  //# sourceMappingURL=remoteFluidObjectHandle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"remoteFluidObjectHandle.js","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,kEAAmE;AAEnE,+DAA4D;AAC5D,6CAA+C;AAC/C,yCAA4C;AAE5C;;;;;;;;GAQG;AACH,MAAa,uBAAwB,SAAQ,4BAA4B;IAIxE;;;;;OAKG;IACH,YACiB,YAAoB,EACpB,YAAiC,EACjC,cAAuB;QAEvC,KAAK,EAAE,CAAC;QAJQ,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QACjC,mBAAc,GAAd,cAAc,CAAS;QAZxB,eAAU,GAAG,IAAI,CAAC;QAejC,IAAA,iBAAM,EACL,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAC5B,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,GAAG;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,6EAA6E;YAC7E,MAAM,OAAO,GAAa;gBACzB,GAAG,EAAE,IAAI,CAAC,YAAY;gBACtB,OAAO,EAAE;oBACR,CAAC,yBAAc,CAAC,SAAS,CAAC,EAAE,IAAI;oBAChC,CAAC,yBAAc,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc;iBACpD;aACD,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBACtF,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE,CAAC;oBAC1C,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAoB,CAAC;oBAC/D,OAAO,WAAW,CAAC;gBACpB,CAAC;gBACD,MAAM,IAAA,yCAAmB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,WAAW;QACjB,OAAO;IACR,CAAC;IAED;;OAEG;IACI,IAAI,CAAC,MAA4B;QACvC,IAAA,eAAI,EAAC,wDAAwD,CAAC,CAAC;IAChE,CAAC;CACD;AArDD,0DAqDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tIFluidHandleContext,\n\ttype IFluidHandleInternal,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport { responseToException } from \"./dataStoreHelpers.js\";\nimport { FluidHandleBase } from \"./handles.js\";\nimport { RuntimeHeaders } from \"./utils.js\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n *\n * @internal\n */\nexport class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject> {\n\tpublic readonly isAttached = true;\n\tprivate objectP: Promise<FluidObject> | undefined;\n\n\t/**\n\t * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n\t * @param absolutePath - The absolute path to the handle from the container runtime.\n\t * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n\t * @param payloadPending - Whether the handle may have a pending payload that is not yet available.\n\t */\n\tconstructor(\n\t\tpublic readonly absolutePath: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t\tpublic readonly payloadPending: boolean,\n\t) {\n\t\tsuper();\n\t\tassert(\n\t\t\tabsolutePath.startsWith(\"/\"),\n\t\t\t0x19d /* \"Handles should always have absolute paths\" */,\n\t\t);\n\t}\n\n\tpublic async get(): Promise<FluidObject> {\n\t\tif (this.objectP === undefined) {\n\t\t\t// Add `viaHandle` header to distinguish from requests from non-handle paths.\n\t\t\tconst request: IRequest = {\n\t\t\t\turl: this.absolutePath,\n\t\t\t\theaders: {\n\t\t\t\t\t[RuntimeHeaders.viaHandle]: true,\n\t\t\t\t\t[RuntimeHeaders.payloadPending]: this.payloadPending,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.objectP = this.routeContext.resolveHandle(request).then<FluidObject>((response) => {\n\t\t\t\tif (response.mimeType === \"fluid/object\") {\n\t\t\t\t\tconst fluidObject: FluidObject = response.value as FluidObject;\n\t\t\t\t\treturn fluidObject;\n\t\t\t\t}\n\t\t\t\tthrow responseToException(response, request);\n\t\t\t});\n\t\t}\n\t\treturn this.objectP;\n\t}\n\n\tpublic attachGraph(): void {\n\t\treturn;\n\t}\n\n\t/**\n\t * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.\n\t */\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\tfail(\"RemoteFluidObjectHandle not supported as a bind source\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"remoteFluidObjectHandle.js","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,kEAA6D;AAE7D,+DAA4D;AAC5D,6CAA+C;AAC/C,yCAA4C;AAE5C;;;;;;;;GAQG;AACH,MAAa,uBAAwB,SAAQ,4BAA4B;IAIxE;;;;;OAKG;IACH,YACiB,YAAoB,EACpB,YAAiC,EACjC,cAAuB;QAEvC,KAAK,EAAE,CAAC;QAJQ,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QACjC,mBAAc,GAAd,cAAc,CAAS;QAZxB,eAAU,GAAG,IAAI,CAAC;QAejC,IAAA,iBAAM,EACL,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAC5B,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,GAAG;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,6EAA6E;YAC7E,MAAM,OAAO,GAAa;gBACzB,GAAG,EAAE,IAAI,CAAC,YAAY;gBACtB,OAAO,EAAE;oBACR,CAAC,yBAAc,CAAC,SAAS,CAAC,EAAE,IAAI;oBAChC,CAAC,yBAAc,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc;iBACpD;aACD,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBACtF,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE,CAAC;oBAC1C,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAoB,CAAC;oBAC/D,OAAO,WAAW,CAAC;gBACpB,CAAC;gBACD,MAAM,IAAA,yCAAmB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,WAAW;QACjB,OAAO;IACR,CAAC;CACD;AA9CD,0DA8CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { responseToException } from \"./dataStoreHelpers.js\";\nimport { FluidHandleBase } from \"./handles.js\";\nimport { RuntimeHeaders } from \"./utils.js\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n *\n * @internal\n */\nexport class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject> {\n\tpublic readonly isAttached = true;\n\tprivate objectP: Promise<FluidObject> | undefined;\n\n\t/**\n\t * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n\t * @param absolutePath - The absolute path to the handle from the container runtime.\n\t * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n\t * @param payloadPending - Whether the handle may have a pending payload that is not yet available.\n\t */\n\tconstructor(\n\t\tpublic readonly absolutePath: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t\tpublic readonly payloadPending: boolean,\n\t) {\n\t\tsuper();\n\t\tassert(\n\t\t\tabsolutePath.startsWith(\"/\"),\n\t\t\t0x19d /* \"Handles should always have absolute paths\" */,\n\t\t);\n\t}\n\n\tpublic async get(): Promise<FluidObject> {\n\t\tif (this.objectP === undefined) {\n\t\t\t// Add `viaHandle` header to distinguish from requests from non-handle paths.\n\t\t\tconst request: IRequest = {\n\t\t\t\turl: this.absolutePath,\n\t\t\t\theaders: {\n\t\t\t\t\t[RuntimeHeaders.viaHandle]: true,\n\t\t\t\t\t[RuntimeHeaders.payloadPending]: this.payloadPending,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.objectP = this.routeContext.resolveHandle(request).then<FluidObject>((response) => {\n\t\t\t\tif (response.mimeType === \"fluid/object\") {\n\t\t\t\t\tconst fluidObject: FluidObject = response.value as FluidObject;\n\t\t\t\t\treturn fluidObject;\n\t\t\t\t}\n\t\t\t\tthrow responseToException(response, request);\n\t\t\t});\n\t\t}\n\t\treturn this.objectP;\n\t}\n\n\tpublic attachGraph(): void {\n\t\treturn;\n\t}\n}\n"]}
package/lib/handles.d.ts CHANGED
@@ -89,10 +89,6 @@ export declare function toFluidHandleErased<T>(handle: IFluidHandleInternal<T>):
89
89
  export declare abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {
90
90
  abstract absolutePath: string;
91
91
  abstract attachGraph(): void;
92
- /**
93
- * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
94
- */
95
- abstract bind(handle: IFluidHandleInternal): void;
96
92
  abstract readonly isAttached: boolean;
97
93
  abstract get(): Promise<T>;
98
94
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,KAAK,EACX,oBAAoB,EACpB,kCAAkC,EAClC,0BAA0B,EAC1B,iBAAiB,EACjB,MAAM,0CAA0C,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAEjC,IAAI,EAAE,kBAAkB,CAAC;IAGzB,GAAG,EAAE,MAAM,CAAC;IAEZ;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,I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AAS,CAAC,YAAY,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAI,MAAuB;IAC/D,IAAI,CAAC,CAAC,iBAAiB,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,iBAAiB,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC;QACzF,IAAI,4BAA4B,IAAI,YAAY,IAAI,MAAM,EAAE,CAAC;YAC5D,OAAO,MAAM,CAAC,YAAY,CAA4B,CAAC;QACxD,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,sBAAsB,CAAC,CAAC;IAC7C,CAAC;IAED,kGAAkG;IAClG,6FAA6F;IAC7F,OAAO,MAAM,CAAC,iBAAiB,CAAuC,CAAC;AACxE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAClC,MAA+B;IAE/B,OAAO,MAA0C,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAgB,eAAe;IAUpC;;OAEG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,CAAC,iBAAiB,CAAC;QAC7B,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleErased } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandle, fluidHandleSymbol } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @internal\n */\nexport interface ISerializedHandle {\n\t// Marker to indicate to JSON.parse that the object is a Fluid handle\n\ttype: \"__fluid_handle__\";\n\n\t// URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n\turl: string;\n\n\t/**\n\t * The handle may have a pending payload, as determined by and resolvable by the subsystem that\n\t * the handle relates to. For instance, the BlobManager uses this to distinguish blob handles\n\t * which may not yet have an attached blob yet.\n\t *\n\t * @remarks\n\t * Will only exist if the handle was created with a pending payload, will be omitted entirely from\n\t * the serialized format if the handle was created with an already-shared payload.\n\t */\n\treadonly payloadPending?: true;\n}\n\n/**\n * Is the input object a @see ISerializedHandle?\n * @internal\n */\nexport const isSerializedHandle = (value: any): value is ISerializedHandle =>\n\tvalue?.type === \"__fluid_handle__\";\n\n/**\n * @internal\n */\nexport const isFluidHandleInternalPayloadPending = (\n\tfluidHandleInternal: IFluidHandleInternal,\n): fluidHandleInternal is IFluidHandleInternalPayloadPending =>\n\t\"payloadPending\" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;\n\n/**\n * Check if the handle is an IFluidHandlePayloadPending.\n * @privateRemarks\n * This should be true for locally-created BlobHandles currently. When IFluidHandlePayloadPending is merged\n * to IFluidHandle, this type guard will no longer be necessary.\n * @legacy\n * @alpha\n */\nexport const isFluidHandlePayloadPending = <T>(\n\thandle: IFluidHandle<T>,\n): handle is IFluidHandlePayloadPending<T> =>\n\t\"payloadState\" in handle &&\n\t(handle.payloadState === \"shared\" || handle.payloadState === \"pending\");\n\n/**\n * Check if the handle is an ILocalFluidHandle.\n * @legacy\n * @alpha\n */\nexport const isLocalFluidHandle = <T>(\n\thandle: IFluidHandle<T>,\n): handle is ILocalFluidHandle<T> =>\n\tisFluidHandlePayloadPending(handle) && \"payloadShareError\" in handle;\n/**\n * Encodes the given IFluidHandle into a JSON-serializable form,\n * @param handle - The IFluidHandle to serialize.\n * @returns The serialized handle.\n *\n * @internal\n */\nexport function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {\n\treturn isFluidHandleInternalPayloadPending(handle)\n\t\t? {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t\tpayloadPending: true,\n\t\t\t}\n\t\t: {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t};\n}\n\n/**\n * Setting to opt into compatibility with handles from before {@link fluidHandleSymbol} existed (Fluid Framework client 2.0.0-rc.3.0.0 and earlier).\n *\n * Some code which uses this library might dynamically load multiple versions of it,\n * as well as old or duplicated versions of packages which produce or implement handles.\n * To correctly interoperate with this old packages and object produced by them, the old in-memory format for handles, without the symbol, are explicitly supported.\n *\n * This setting mostly exists as a way to easily find any code that only exists to provide this compatibility and clarify how to remove that compatibility.\n * At some point this might be removed or turned into an actual configuration option, but for now its really just documentation.\n */\nconst enableBackwardsCompatibility = true;\n\n/**\n * Check if a value is an {@link @fluidframework/core-interfaces#IFluidHandle}.\n * @remarks\n * Objects which have a field named `IFluidHandle` can in some cases produce a false positive.\n * @public\n */\nexport function isFluidHandle(value: unknown): value is IFluidHandle {\n\t// `in` gives a type error on non-objects and null, so filter them out\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\tif (fluidHandleSymbol in value) {\n\t\treturn true;\n\t}\n\t// If enableBackwardsCompatibility, run check for FluidHandles predating use of fluidHandleSymbol.\n\tif (enableBackwardsCompatibility && IFluidHandle in value) {\n\t\t// Since this check can have false positives, make it a bit more robust by checking value[IFluidHandle][IFluidHandle]\n\t\tconst inner = value[IFluidHandle] as IFluidHandle;\n\t\tif (typeof inner !== \"object\" || inner === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn IFluidHandle in inner;\n\t}\n\treturn false;\n}\n\n/**\n * Compare two {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}.\n * @remarks\n * Returns true iff both handles have the same internal `absolutePath`.\n * @public\n */\nexport function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean {\n\tconst aInternal = toFluidHandleInternal(a);\n\tconst bInternal = toFluidHandleInternal(b);\n\treturn aInternal.absolutePath === bInternal.absolutePath;\n}\n\n/**\n * Downcast an IFluidHandle to an IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {\n\tif (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {\n\t\tif (enableBackwardsCompatibility && IFluidHandle in handle) {\n\t\t\treturn handle[IFluidHandle] as IFluidHandleInternal<T>;\n\t\t}\n\t\tthrow new TypeError(\"Invalid IFluidHandle\");\n\t}\n\n\t// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone\n\t// implements their own IFluidHandle in terms of an existing handle, it won't break anything.\n\treturn handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;\n}\n\n/**\n * Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleErased<T>(\n\thandle: IFluidHandleInternal<T>,\n): IFluidHandleErased<T> {\n\treturn handle as unknown as IFluidHandleErased<T>;\n}\n\n/**\n * Base class which can be uses to assist implementing IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {\n\tpublic abstract absolutePath: string;\n\tpublic abstract attachGraph(): void;\n\t/**\n\t * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.\n\t */\n\tpublic abstract bind(handle: IFluidHandleInternal): void;\n\tpublic abstract readonly isAttached: boolean;\n\tpublic abstract get(): Promise<T>;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal {\n\t\treturn this;\n\t}\n\n\tpublic get [fluidHandleSymbol](): IFluidHandleErased<T> {\n\t\treturn toFluidHandleErased(this);\n\t}\n}\n"]}
1
+ {"version":3,"file":"handles.js","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AA+BlF;;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CAAC,iBAAiB,CAAC;QAC7B,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleErased } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandle, fluidHandleSymbol } from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIFluidHandleInternalPayloadPending,\n\tIFluidHandlePayloadPending,\n\tILocalFluidHandle,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * JSON serialized form of an IFluidHandle\n * @internal\n */\nexport interface ISerializedHandle {\n\t// Marker to indicate to JSON.parse that the object is a Fluid handle\n\ttype: \"__fluid_handle__\";\n\n\t// URL to the object. Relative URLs are relative to the handle context passed to the stringify.\n\turl: string;\n\n\t/**\n\t * The handle may have a pending payload, as determined by and resolvable by the subsystem that\n\t * the handle relates to. For instance, the BlobManager uses this to distinguish blob handles\n\t * which may not yet have an attached blob yet.\n\t *\n\t * @remarks\n\t * Will only exist if the handle was created with a pending payload, will be omitted entirely from\n\t * the serialized format if the handle was created with an already-shared payload.\n\t */\n\treadonly payloadPending?: true;\n}\n\n/**\n * Is the input object a @see ISerializedHandle?\n * @internal\n */\nexport const isSerializedHandle = (value: any): value is ISerializedHandle =>\n\tvalue?.type === \"__fluid_handle__\";\n\n/**\n * @internal\n */\nexport const isFluidHandleInternalPayloadPending = (\n\tfluidHandleInternal: IFluidHandleInternal,\n): fluidHandleInternal is IFluidHandleInternalPayloadPending =>\n\t\"payloadPending\" in fluidHandleInternal && fluidHandleInternal.payloadPending === true;\n\n/**\n * Check if the handle is an IFluidHandlePayloadPending.\n * @privateRemarks\n * This should be true for locally-created BlobHandles currently. When IFluidHandlePayloadPending is merged\n * to IFluidHandle, this type guard will no longer be necessary.\n * @legacy\n * @alpha\n */\nexport const isFluidHandlePayloadPending = <T>(\n\thandle: IFluidHandle<T>,\n): handle is IFluidHandlePayloadPending<T> =>\n\t\"payloadState\" in handle &&\n\t(handle.payloadState === \"shared\" || handle.payloadState === \"pending\");\n\n/**\n * Check if the handle is an ILocalFluidHandle.\n * @legacy\n * @alpha\n */\nexport const isLocalFluidHandle = <T>(\n\thandle: IFluidHandle<T>,\n): handle is ILocalFluidHandle<T> =>\n\tisFluidHandlePayloadPending(handle) && \"payloadShareError\" in handle;\n/**\n * Encodes the given IFluidHandle into a JSON-serializable form,\n * @param handle - The IFluidHandle to serialize.\n * @returns The serialized handle.\n *\n * @internal\n */\nexport function encodeHandleForSerialization(handle: IFluidHandleInternal): ISerializedHandle {\n\treturn isFluidHandleInternalPayloadPending(handle)\n\t\t? {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t\tpayloadPending: true,\n\t\t\t}\n\t\t: {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: handle.absolutePath,\n\t\t\t};\n}\n\n/**\n * Setting to opt into compatibility with handles from before {@link fluidHandleSymbol} existed (Fluid Framework client 2.0.0-rc.3.0.0 and earlier).\n *\n * Some code which uses this library might dynamically load multiple versions of it,\n * as well as old or duplicated versions of packages which produce or implement handles.\n * To correctly interoperate with this old packages and object produced by them, the old in-memory format for handles, without the symbol, are explicitly supported.\n *\n * This setting mostly exists as a way to easily find any code that only exists to provide this compatibility and clarify how to remove that compatibility.\n * At some point this might be removed or turned into an actual configuration option, but for now its really just documentation.\n */\nconst enableBackwardsCompatibility = true;\n\n/**\n * Check if a value is an {@link @fluidframework/core-interfaces#IFluidHandle}.\n * @remarks\n * Objects which have a field named `IFluidHandle` can in some cases produce a false positive.\n * @public\n */\nexport function isFluidHandle(value: unknown): value is IFluidHandle {\n\t// `in` gives a type error on non-objects and null, so filter them out\n\tif (typeof value !== \"object\" || value === null) {\n\t\treturn false;\n\t}\n\tif (fluidHandleSymbol in value) {\n\t\treturn true;\n\t}\n\t// If enableBackwardsCompatibility, run check for FluidHandles predating use of fluidHandleSymbol.\n\tif (enableBackwardsCompatibility && IFluidHandle in value) {\n\t\t// Since this check can have false positives, make it a bit more robust by checking value[IFluidHandle][IFluidHandle]\n\t\tconst inner = value[IFluidHandle] as IFluidHandle;\n\t\tif (typeof inner !== \"object\" || inner === null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn IFluidHandle in inner;\n\t}\n\treturn false;\n}\n\n/**\n * Compare two {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}.\n * @remarks\n * Returns true iff both handles have the same internal `absolutePath`.\n * @public\n */\nexport function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean {\n\tconst aInternal = toFluidHandleInternal(a);\n\tconst bInternal = toFluidHandleInternal(b);\n\treturn aInternal.absolutePath === bInternal.absolutePath;\n}\n\n/**\n * Downcast an IFluidHandle to an IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T> {\n\tif (!(fluidHandleSymbol in handle) || !(fluidHandleSymbol in handle[fluidHandleSymbol])) {\n\t\tif (enableBackwardsCompatibility && IFluidHandle in handle) {\n\t\t\treturn handle[IFluidHandle] as IFluidHandleInternal<T>;\n\t\t}\n\t\tthrow new TypeError(\"Invalid IFluidHandle\");\n\t}\n\n\t// This casts the IFluidHandleErased from the symbol instead of `handle` to ensure that if someone\n\t// implements their own IFluidHandle in terms of an existing handle, it won't break anything.\n\treturn handle[fluidHandleSymbol] as unknown as IFluidHandleInternal<T>;\n}\n\n/**\n * Type erase IFluidHandleInternal for use with {@link @fluidframework/core-interfaces#fluidHandleSymbol}.\n * @legacy\n * @alpha\n */\nexport function toFluidHandleErased<T>(\n\thandle: IFluidHandleInternal<T>,\n): IFluidHandleErased<T> {\n\treturn handle as unknown as IFluidHandleErased<T>;\n}\n\n/**\n * Base class which can be uses to assist implementing IFluidHandleInternal.\n * @legacy\n * @alpha\n */\nexport abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {\n\tpublic abstract absolutePath: string;\n\tpublic abstract attachGraph(): void;\n\tpublic abstract readonly isAttached: boolean;\n\tpublic abstract get(): Promise<T>;\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal {\n\t\treturn this;\n\t}\n\n\tpublic get [fluidHandleSymbol](): IFluidHandleErased<T> {\n\t\treturn toFluidHandleErased(this);\n\t}\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { FluidObject } from "@fluidframework/core-interfaces";
6
- import { IFluidHandleContext, type IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
6
+ import { IFluidHandleContext } from "@fluidframework/core-interfaces/internal";
7
7
  import { FluidHandleBase } from "./handles.js";
8
8
  /**
9
9
  * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized
@@ -29,9 +29,5 @@ export declare class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject
29
29
  constructor(absolutePath: string, routeContext: IFluidHandleContext, payloadPending: boolean);
30
30
  get(): Promise<FluidObject>;
31
31
  attachGraph(): void;
32
- /**
33
- * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
34
- */
35
- bind(handle: IFluidHandleInternal): void;
36
32
  }
37
33
  //# sourceMappingURL=remoteFluidObjectHandle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remoteFluidObjectHandle.d.ts","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAY,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACN,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,eAAe,CAAC,WAAW,CAAC;aAWvD,YAAY,EAAE,MAAM;aACpB,YAAY,EAAE,mBAAmB;aACjC,cAAc,EAAE,OAAO;IAZxC,SAAgB,UAAU,QAAQ;IAClC,OAAO,CAAC,OAAO,CAAmC;IAElD;;;;;OAKG;gBAEc,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,mBAAmB,EACjC,cAAc,EAAE,OAAO;IAS3B,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;IAqBjC,WAAW,IAAI,IAAI;IAI1B;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;CAG/C"}
1
+ {"version":3,"file":"remoteFluidObjectHandle.d.ts","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAY,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAI/E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,eAAe,CAAC,WAAW,CAAC;aAWvD,YAAY,EAAE,MAAM;aACpB,YAAY,EAAE,mBAAmB;aACjC,cAAc,EAAE,OAAO;IAZxC,SAAgB,UAAU,QAAQ;IAClC,OAAO,CAAC,OAAO,CAAmC;IAElD;;;;;OAKG;gBAEc,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,mBAAmB,EACjC,cAAc,EAAE,OAAO;IAS3B,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;IAqBjC,WAAW,IAAI,IAAI;CAG1B"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { assert, fail } from "@fluidframework/core-utils/internal";
5
+ import { assert } from "@fluidframework/core-utils/internal";
6
6
  import { responseToException } from "./dataStoreHelpers.js";
7
7
  import { FluidHandleBase } from "./handles.js";
8
8
  import { RuntimeHeaders } from "./utils.js";
@@ -53,11 +53,5 @@ export class RemoteFluidObjectHandle extends FluidHandleBase {
53
53
  attachGraph() {
54
54
  return;
55
55
  }
56
- /**
57
- * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
58
- */
59
- bind(handle) {
60
- fail("RemoteFluidObjectHandle not supported as a bind source");
61
- }
62
56
  }
63
57
  //# sourceMappingURL=remoteFluidObjectHandle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"remoteFluidObjectHandle.js","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAA4B;IAIxE;;;;;OAKG;IACH,YACiB,YAAoB,EACpB,YAAiC,EACjC,cAAuB;QAEvC,KAAK,EAAE,CAAC;QAJQ,iBAAY,GAAZ,YAAY,CAAQ;QACpB,iBAAY,GAAZ,YAAY,CAAqB;QACjC,mBAAc,GAAd,cAAc,CAAS;QAZxB,eAAU,GAAG,IAAI,CAAC;QAejC,MAAM,CACL,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAC5B,KAAK,CAAC,iDAAiD,CACvD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,GAAG;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,6EAA6E;YAC7E,MAAM,OAAO,GAAa;gBACzB,GAAG,EAAE,IAAI,CAAC,YAAY;gBACtB,OAAO,EAAE;oBACR,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI;oBAChC,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc;iBACpD;aACD,CAAC;YACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAc,CAAC,QAAQ,EAAE,EAAE;gBACtF,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE,CAAC;oBAC1C,MAAM,WAAW,GAAgB,QAAQ,CAAC,KAAoB,CAAC;oBAC/D,OAAO,WAAW,CAAC;gBACpB,CAAC;gBACD,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,WAAW;QACjB,OAAO;IACR,CAAC;IAED;;OAEG;IACI,IAAI,CAAC,MAA4B;QACvC,IAAI,CAAC,wDAAwD,CAAC,CAAC;IAChE,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tIFluidHandleContext,\n\ttype IFluidHandleInternal,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport { responseToException } from \"./dataStoreHelpers.js\";\nimport { FluidHandleBase } from \"./handles.js\";\nimport { RuntimeHeaders } from \"./utils.js\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n *\n * @internal\n */\nexport class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject> {\n\tpublic readonly isAttached = true;\n\tprivate objectP: Promise<FluidObject> | undefined;\n\n\t/**\n\t * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n\t * @param absolutePath - The absolute path to the handle from the container runtime.\n\t * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n\t * @param payloadPending - Whether the handle may have a pending payload that is not yet available.\n\t */\n\tconstructor(\n\t\tpublic readonly absolutePath: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t\tpublic readonly payloadPending: boolean,\n\t) {\n\t\tsuper();\n\t\tassert(\n\t\t\tabsolutePath.startsWith(\"/\"),\n\t\t\t0x19d /* \"Handles should always have absolute paths\" */,\n\t\t);\n\t}\n\n\tpublic async get(): Promise<FluidObject> {\n\t\tif (this.objectP === undefined) {\n\t\t\t// Add `viaHandle` header to distinguish from requests from non-handle paths.\n\t\t\tconst request: IRequest = {\n\t\t\t\turl: this.absolutePath,\n\t\t\t\theaders: {\n\t\t\t\t\t[RuntimeHeaders.viaHandle]: true,\n\t\t\t\t\t[RuntimeHeaders.payloadPending]: this.payloadPending,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.objectP = this.routeContext.resolveHandle(request).then<FluidObject>((response) => {\n\t\t\t\tif (response.mimeType === \"fluid/object\") {\n\t\t\t\t\tconst fluidObject: FluidObject = response.value as FluidObject;\n\t\t\t\t\treturn fluidObject;\n\t\t\t\t}\n\t\t\t\tthrow responseToException(response, request);\n\t\t\t});\n\t\t}\n\t\treturn this.objectP;\n\t}\n\n\tpublic attachGraph(): void {\n\t\treturn;\n\t}\n\n\t/**\n\t * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.\n\t */\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\tfail(\"RemoteFluidObjectHandle not supported as a bind source\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"remoteFluidObjectHandle.js","sourceRoot":"","sources":["../src/remoteFluidObjectHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM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AAO;IACR,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { responseToException } from \"./dataStoreHelpers.js\";\nimport { FluidHandleBase } from \"./handles.js\";\nimport { RuntimeHeaders } from \"./utils.js\";\n\n/**\n * This handle is used to dynamically load a Fluid object on a remote client and is created on parsing a serialized\n * FluidObjectHandle.\n * This class is used to generate an IFluidHandle when de-serializing any all handles (including handles to DDSes,\n * custom objects) that are stored in SharedObjects. The Data Store or SharedObject corresponding to the\n * IFluidHandle can be retrieved by calling `get` on it.\n *\n * @internal\n */\nexport class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject> {\n\tpublic readonly isAttached = true;\n\tprivate objectP: Promise<FluidObject> | undefined;\n\n\t/**\n\t * Creates a new RemoteFluidObjectHandle when parsing an IFluidHandle.\n\t * @param absolutePath - The absolute path to the handle from the container runtime.\n\t * @param routeContext - The root IFluidHandleContext that has a route to this handle.\n\t * @param payloadPending - Whether the handle may have a pending payload that is not yet available.\n\t */\n\tconstructor(\n\t\tpublic readonly absolutePath: string,\n\t\tpublic readonly routeContext: IFluidHandleContext,\n\t\tpublic readonly payloadPending: boolean,\n\t) {\n\t\tsuper();\n\t\tassert(\n\t\t\tabsolutePath.startsWith(\"/\"),\n\t\t\t0x19d /* \"Handles should always have absolute paths\" */,\n\t\t);\n\t}\n\n\tpublic async get(): Promise<FluidObject> {\n\t\tif (this.objectP === undefined) {\n\t\t\t// Add `viaHandle` header to distinguish from requests from non-handle paths.\n\t\t\tconst request: IRequest = {\n\t\t\t\turl: this.absolutePath,\n\t\t\t\theaders: {\n\t\t\t\t\t[RuntimeHeaders.viaHandle]: true,\n\t\t\t\t\t[RuntimeHeaders.payloadPending]: this.payloadPending,\n\t\t\t\t},\n\t\t\t};\n\t\t\tthis.objectP = this.routeContext.resolveHandle(request).then<FluidObject>((response) => {\n\t\t\t\tif (response.mimeType === \"fluid/object\") {\n\t\t\t\t\tconst fluidObject: FluidObject = response.value as FluidObject;\n\t\t\t\t\treturn fluidObject;\n\t\t\t\t}\n\t\t\t\tthrow responseToException(response, request);\n\t\t\t});\n\t\t}\n\t\treturn this.objectP;\n\t}\n\n\tpublic attachGraph(): void {\n\t\treturn;\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/runtime-utils",
3
- "version": "2.50.0-345060",
3
+ "version": "2.51.0-347100",
4
4
  "description": "Collection of utility functions for Fluid Runtime",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -69,26 +69,26 @@
69
69
  "temp-directory": "nyc/.nyc_output"
70
70
  },
71
71
  "dependencies": {
72
- "@fluid-internal/client-utils": "2.50.0-345060",
73
- "@fluidframework/container-definitions": "2.50.0-345060",
74
- "@fluidframework/container-runtime-definitions": "2.50.0-345060",
75
- "@fluidframework/core-interfaces": "2.50.0-345060",
76
- "@fluidframework/core-utils": "2.50.0-345060",
77
- "@fluidframework/datastore-definitions": "2.50.0-345060",
78
- "@fluidframework/driver-definitions": "2.50.0-345060",
79
- "@fluidframework/driver-utils": "2.50.0-345060",
80
- "@fluidframework/runtime-definitions": "2.50.0-345060",
81
- "@fluidframework/telemetry-utils": "2.50.0-345060"
72
+ "@fluid-internal/client-utils": "2.51.0-347100",
73
+ "@fluidframework/container-definitions": "2.51.0-347100",
74
+ "@fluidframework/container-runtime-definitions": "2.51.0-347100",
75
+ "@fluidframework/core-interfaces": "2.51.0-347100",
76
+ "@fluidframework/core-utils": "2.51.0-347100",
77
+ "@fluidframework/datastore-definitions": "2.51.0-347100",
78
+ "@fluidframework/driver-definitions": "2.51.0-347100",
79
+ "@fluidframework/driver-utils": "2.51.0-347100",
80
+ "@fluidframework/runtime-definitions": "2.51.0-347100",
81
+ "@fluidframework/telemetry-utils": "2.51.0-347100"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@arethetypeswrong/cli": "^0.17.1",
85
85
  "@biomejs/biome": "~1.9.3",
86
- "@fluid-internal/mocha-test-setup": "2.50.0-345060",
86
+ "@fluid-internal/mocha-test-setup": "2.51.0-347100",
87
87
  "@fluid-tools/build-cli": "^0.56.0",
88
88
  "@fluidframework/build-common": "^2.0.3",
89
89
  "@fluidframework/build-tools": "^0.56.0",
90
90
  "@fluidframework/eslint-config-fluid": "^5.7.4",
91
- "@fluidframework/runtime-utils-previous": "npm:@fluidframework/runtime-utils@2.43.0",
91
+ "@fluidframework/runtime-utils-previous": "npm:@fluidframework/runtime-utils@2.50.0",
92
92
  "@microsoft/api-extractor": "7.52.8",
93
93
  "@types/mocha": "^10.0.10",
94
94
  "@types/node": "^18.19.0",
package/src/handles.ts CHANGED
@@ -180,10 +180,6 @@ export function toFluidHandleErased<T>(
180
180
  export abstract class FluidHandleBase<T> implements IFluidHandleInternal<T> {
181
181
  public abstract absolutePath: string;
182
182
  public abstract attachGraph(): void;
183
- /**
184
- * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
185
- */
186
- public abstract bind(handle: IFluidHandleInternal): void;
187
183
  public abstract readonly isAttached: boolean;
188
184
  public abstract get(): Promise<T>;
189
185
 
@@ -4,11 +4,8 @@
4
4
  */
5
5
 
6
6
  import { FluidObject, IRequest } from "@fluidframework/core-interfaces";
7
- import {
8
- IFluidHandleContext,
9
- type IFluidHandleInternal,
10
- } from "@fluidframework/core-interfaces/internal";
11
- import { assert, fail } from "@fluidframework/core-utils/internal";
7
+ import { IFluidHandleContext } from "@fluidframework/core-interfaces/internal";
8
+ import { assert } from "@fluidframework/core-utils/internal";
12
9
 
13
10
  import { responseToException } from "./dataStoreHelpers.js";
14
11
  import { FluidHandleBase } from "./handles.js";
@@ -69,11 +66,4 @@ export class RemoteFluidObjectHandle extends FluidHandleBase<FluidObject> {
69
66
  public attachGraph(): void {
70
67
  return;
71
68
  }
72
-
73
- /**
74
- * @deprecated No replacement provided. Arbitrary handles may not serve as a bind source.
75
- */
76
- public bind(handle: IFluidHandleInternal): void {
77
- fail("RemoteFluidObjectHandle not supported as a bind source");
78
- }
79
69
  }