@fluidframework/shared-object-base 2.70.0-361788 → 2.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @fluidframework/shared-object-base
2
2
 
3
+ ## 2.70.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Deprecated property processCore has been removed from SharedObject ([#25749](https://github.com/microsoft/FluidFramework/pull/25749)) [a33a2e370f](https://github.com/microsoft/FluidFramework/commit/a33a2e370fbb95b565f39c2a14abc7716bc01980)
8
+
9
+ The deprecated property `processCore` has been removed from `SharedObject`.
10
+
11
+ Please see [this github issue](https://github.com/microsoft/FluidFramework/issues/25176) for more details.
12
+
3
13
  ## 2.63.0
4
14
 
5
15
  Dependency updates only.
package/dist/handle.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
6
6
  import { FluidObjectHandle } from "@fluidframework/datastore/internal";
7
- import type { IFluidDataStoreRuntimeExperimental } from "@fluidframework/datastore-definitions/internal";
7
+ import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal";
8
8
  import type { ISharedObject } from "./types.js";
9
9
  /**
10
10
  * Handle for a shared object. See also `SharedObjectHandle`.
@@ -59,7 +59,7 @@ export declare class SharedObjectHandle extends FluidObjectHandle<ISharedObject>
59
59
  * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
60
60
  * to this handle.
61
61
  */
62
- constructor(value: ISharedObject, path: string, runtime: IFluidDataStoreRuntimeExperimental);
62
+ constructor(value: ISharedObject, path: string, runtime: IFluidDataStoreRuntime);
63
63
  /**
64
64
  * Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.
65
65
  * When attaching the handle, it registers the associated shared object.
@@ -1 +1 @@
1
- {"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"A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AoC,CAAC;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAG7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB,CAAC,aAAa,CAAC;IAC/E;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,mBAAmB,CAEpF;AAED;;;;;;;;;GASG;AACH,qBAAa,kBACZ,SAAQ,iBAAiB,CAAC,aAAa,CACvC,YAAW,mBAAmB;IA2C7B,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa;IAEvC,OAAO,CAAC,QAAQ,CAAC,OAAO;IA3CzB;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;OAEG;IACH,OAAO,KAAK,SAAS,GAcpB;IAED;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAkB;IAE1C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwC;IAEvE;;;;;;OAMG;gBAEiB,KAAK,EAAE,aAAa,EACvC,IAAI,EAAE,MAAM,EACK,OAAO,EAAE,sBAAsB;IAKjD;;;OAGG;IACI,WAAW,IAAI,IAAI;IAmBnB,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;CAiB/C"}
package/dist/handle.js CHANGED
@@ -6,13 +6,13 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SharedObjectHandle = exports.isISharedObjectHandle = void 0;
8
8
  const internal_1 = require("@fluidframework/datastore/internal");
9
- const runtime_utils_1 = require("@fluidframework/runtime-utils");
9
+ const internal_2 = require("@fluidframework/runtime-utils/internal");
10
10
  /**
11
11
  * Type guard for {@link ISharedObjectHandle}.
12
12
  * @internal
13
13
  */
14
14
  function isISharedObjectHandle(handle) {
15
- return (0, runtime_utils_1.isFluidHandle)(handle) && typeof handle.bind === "function";
15
+ return (0, internal_2.isFluidHandle)(handle) && typeof handle.bind === "function";
16
16
  }
17
17
  exports.isISharedObjectHandle = isISharedObjectHandle;
18
18
  /**
@@ -57,9 +57,7 @@ class SharedObjectHandle extends internal_1.FluidObjectHandle {
57
57
  * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
58
58
  * to this handle.
59
59
  */
60
- constructor(value, path,
61
- // eslint-disable-next-line import/no-deprecated
62
- runtime) {
60
+ constructor(value, path, runtime) {
63
61
  super(value, path, runtime.IFluidHandleContext);
64
62
  this.value = value;
65
63
  this.runtime = runtime;
@@ -92,7 +90,7 @@ class SharedObjectHandle extends internal_1.FluidObjectHandle {
92
90
  // We don't bind handles in staging mode to defer the attachment of any new objects
93
91
  // until we've exited staging mode. This way if we discard changes or a new handle is not present in the final
94
92
  // committed state, we will never end up attaching the discarded object.
95
- if (this.runtime.inStagingMode === true) {
93
+ if ((0, internal_2.asLegacyAlpha)(this.runtime).inStagingMode === true) {
96
94
  return;
97
95
  }
98
96
  // If this handle is visible, attach the graph of the incoming handle as well.
@@ -1 +1 @@
1
- {"version":3,"file":"handle.js","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,iEAAuE;AAGvE,iEAA8D;AAoB9D;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,MAAe;IACpD,OAAO,IAAA,6BAAa,EAAC,MAAM,CAAC,IAAI,OAAQ,MAA8B,CAAC,IAAI,KAAK,UAAU,CAAC;AAC5F,CAAC;AAFD,sDAEC;AAED;;;;;;;;;GASG;AACH,MAAa,kBACZ,SAAQ,4BAAgC;IAGxC;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAY,SAAS;QACpB;;;;;;;;;;;WAWG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(c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore/internal\";\n// eslint-disable-next-line import/no-deprecated\nimport type { IFluidDataStoreRuntimeExperimental } from \"@fluidframework/datastore-definitions/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\nimport type { ISharedObject } from \"./types.js\";\n\n/**\n * Handle for a shared object. See also `SharedObjectHandle`.\n * Supports binding other handles to the underlying Shared Object (see {@link ISharedObjectHandle.bind}).\n *\n * @internal\n */\nexport interface ISharedObjectHandle extends IFluidHandleInternal<ISharedObject> {\n\t/**\n\t * Binds the given handle to this DDS or attach the given handle if this DDS is attached.\n\t * A bound handle will also be attached once this DDS is attached.\n\t *\n\t * @param handle - The target handle to bind to this DDS\n\t */\n\tbind(handle: IFluidHandleInternal): void;\n}\n\n/**\n * Type guard for {@link ISharedObjectHandle}.\n * @internal\n */\nexport function isISharedObjectHandle(handle: unknown): handle is ISharedObjectHandle {\n\treturn isFluidHandle(handle) && typeof (handle as ISharedObjectHandle).bind === \"function\";\n}\n\n/**\n * Handle for a shared object (DDS).\n *\n * @remarks\n *\n * This object is used for already loaded (in-memory) shared objects.\n *\n * It provides a \"bind\" function that is expected to be invoked on all handles stored in this DDS,\n * ensuring the target object becomes attached along with this DDS.\n */\nexport class SharedObjectHandle\n\textends FluidObjectHandle<ISharedObject>\n\timplements ISharedObjectHandle\n{\n\t/**\n\t * Whether services have been attached for the associated shared object.\n\t */\n\tpublic get isAttached(): boolean {\n\t\treturn this.value.isAttached();\n\t}\n\n\t/**\n\t * Tells whether the object of this handle is visible in the container locally or globally.\n\t */\n\tprivate get isVisible(): boolean {\n\t\t/**\n\t\t * If the object of this handle is attached, it is visible in the container. Ideally, checking local visibility\n\t\t * should be enough for a handle. However, there are scenarios where the object becomes locally visible but the\n\t\t * handle does not know this - This will happen is attachGraph is never called on the handle. Couple of examples\n\t\t * where this can happen:\n\t\t *\n\t\t * 1. Handles to DDS other than the default handle won't know if the DDS becomes visible after the handle was\n\t\t * created.\n\t\t *\n\t\t * 2. Handles to root data stores will never know that it was visible because the handle will not be stores in\n\t\t * another DDS and so, attachGraph will never be called on it.\n\t\t */\n\t\treturn this.isAttached || this.isLocallyVisible;\n\t}\n\n\t/**\n\t * Tracks whether this handle is locally visible in the container.\n\t */\n\tprivate isLocallyVisible: boolean = false;\n\n\tprivate readonly pendingHandles: Set<IFluidHandleInternal> = new Set();\n\n\t/**\n\t * Creates a new SharedObjectHandle.\n\t * @param value - The shared object this handle is for.\n\t * @param path - The id of the shared object. It is also the path to this object relative to the routeContext.\n\t * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route\n\t * to this handle.\n\t */\n\tconstructor(\n\t\tprotected readonly value: ISharedObject,\n\t\tpath: string,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tprivate readonly runtime: IFluidDataStoreRuntimeExperimental,\n\t) {\n\t\tsuper(value, path, runtime.IFluidHandleContext);\n\t}\n\n\t/**\n\t * Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.\n\t * When attaching the handle, it registers the associated shared object.\n\t */\n\tpublic attachGraph(): void {\n\t\tif (this.isVisible) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively attach all pending handles\n\t\tthis.isLocallyVisible = true;\n\t\tfor (const handle of this.pendingHandles) {\n\t\t\thandle.attachGraph();\n\t\t}\n\t\tthis.pendingHandles.clear();\n\n\t\t// Bind this SharedObject to its context (typically the DataStore) so it attaches with it\n\t\tthis.value.bindToContext();\n\n\t\t// This will trigger the context (typically the DataStore) to attach its graph\n\t\tsuper.attachGraph();\n\t}\n\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\t// We don't bind handles in staging mode to defer the attachment of any new objects\n\t\t// until we've exited staging mode. This way if we discard changes or a new handle is not present in the final\n\t\t// committed state, we will never end up attaching the discarded object.\n\t\tif (this.runtime.inStagingMode === true) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If this handle is visible, attach the graph of the incoming handle as well.\n\t\tif (this.isVisible) {\n\t\t\thandle.attachGraph();\n\t\t\treturn;\n\t\t}\n\n\t\t// If this handle is not visible, we will attach it later when this handle's attachGraph is called.\n\t\tthis.pendingHandles.add(handle);\n\t}\n}\n"]}
1
+ {"version":3,"file":"handle.js","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,iEAAuE;AAEvE,qEAAsF;AAoBtF;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,MAAe;IACpD,OAAO,IAAA,wBAAa,EAAC,MAAM,CAAC,IAAI,OAAQ,MAA8B,CAAC,IAAI,KAAK,UAAU,CAAC;AAC5F,CAAC;AAFD,sDAEC;AAED;;;;;;;;;GASG;AACH,MAAa,kBACZ,SAAQ,4BAAgC;IAGxC;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAY,SAAS;QACpB;;;;;;;;;;;WAWG;QACH,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,gBAAgB,CAAC;IACjD,CAAC;IASD;;;;;;OAMG;IACH,YACoB,KAAoB,EACvC,IAAY,EACK,OAA+B;QAEhD,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAJ7B,UAAK,GAAL,KAAK,CAAe;QAEtB,YAAO,GAAP,OAAO,CAAwB;QAjBjD;;WAEG;QACK,qBAAgB,GAAY,KAAK,CAAC;QAEzB,mBAAc,GAA8B,IAAI,GAAG,EAAE,CAAC;IAevE,CAAC;IAED;;;OAGG;IACI,WAAW;QACjB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,OAAO;QACR,CAAC;QAED,yCAAyC;QACzC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YAC1C,MAAM,CAAC,WAAW,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAE5B,yFAAyF;QACzF,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAE3B,8EAA8E;QAC9E,KAAK,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAEM,IAAI,CAAC,MAA4B;QACvC,mFAAmF;QACnF,8GAA8G;QAC9G,wEAAwE;QACxE,IAAI,IAAA,wBAAa,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;YACxD,OAAO;QACR,CAAC;QAED,8EAA8E;QAC9E,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO;QACR,CAAC;QAED,mGAAmG;QACnG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACD;AA5FD,gDA4FC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore/internal\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\nimport { isFluidHandle, asLegacyAlpha } from \"@fluidframework/runtime-utils/internal\";\n\nimport type { ISharedObject } from \"./types.js\";\n\n/**\n * Handle for a shared object. See also `SharedObjectHandle`.\n * Supports binding other handles to the underlying Shared Object (see {@link ISharedObjectHandle.bind}).\n *\n * @internal\n */\nexport interface ISharedObjectHandle extends IFluidHandleInternal<ISharedObject> {\n\t/**\n\t * Binds the given handle to this DDS or attach the given handle if this DDS is attached.\n\t * A bound handle will also be attached once this DDS is attached.\n\t *\n\t * @param handle - The target handle to bind to this DDS\n\t */\n\tbind(handle: IFluidHandleInternal): void;\n}\n\n/**\n * Type guard for {@link ISharedObjectHandle}.\n * @internal\n */\nexport function isISharedObjectHandle(handle: unknown): handle is ISharedObjectHandle {\n\treturn isFluidHandle(handle) && typeof (handle as ISharedObjectHandle).bind === \"function\";\n}\n\n/**\n * Handle for a shared object (DDS).\n *\n * @remarks\n *\n * This object is used for already loaded (in-memory) shared objects.\n *\n * It provides a \"bind\" function that is expected to be invoked on all handles stored in this DDS,\n * ensuring the target object becomes attached along with this DDS.\n */\nexport class SharedObjectHandle\n\textends FluidObjectHandle<ISharedObject>\n\timplements ISharedObjectHandle\n{\n\t/**\n\t * Whether services have been attached for the associated shared object.\n\t */\n\tpublic get isAttached(): boolean {\n\t\treturn this.value.isAttached();\n\t}\n\n\t/**\n\t * Tells whether the object of this handle is visible in the container locally or globally.\n\t */\n\tprivate get isVisible(): boolean {\n\t\t/**\n\t\t * If the object of this handle is attached, it is visible in the container. Ideally, checking local visibility\n\t\t * should be enough for a handle. However, there are scenarios where the object becomes locally visible but the\n\t\t * handle does not know this - This will happen is attachGraph is never called on the handle. Couple of examples\n\t\t * where this can happen:\n\t\t *\n\t\t * 1. Handles to DDS other than the default handle won't know if the DDS becomes visible after the handle was\n\t\t * created.\n\t\t *\n\t\t * 2. Handles to root data stores will never know that it was visible because the handle will not be stores in\n\t\t * another DDS and so, attachGraph will never be called on it.\n\t\t */\n\t\treturn this.isAttached || this.isLocallyVisible;\n\t}\n\n\t/**\n\t * Tracks whether this handle is locally visible in the container.\n\t */\n\tprivate isLocallyVisible: boolean = false;\n\n\tprivate readonly pendingHandles: Set<IFluidHandleInternal> = new Set();\n\n\t/**\n\t * Creates a new SharedObjectHandle.\n\t * @param value - The shared object this handle is for.\n\t * @param path - The id of the shared object. It is also the path to this object relative to the routeContext.\n\t * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route\n\t * to this handle.\n\t */\n\tconstructor(\n\t\tprotected readonly value: ISharedObject,\n\t\tpath: string,\n\t\tprivate readonly runtime: IFluidDataStoreRuntime,\n\t) {\n\t\tsuper(value, path, runtime.IFluidHandleContext);\n\t}\n\n\t/**\n\t * Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.\n\t * When attaching the handle, it registers the associated shared object.\n\t */\n\tpublic attachGraph(): void {\n\t\tif (this.isVisible) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively attach all pending handles\n\t\tthis.isLocallyVisible = true;\n\t\tfor (const handle of this.pendingHandles) {\n\t\t\thandle.attachGraph();\n\t\t}\n\t\tthis.pendingHandles.clear();\n\n\t\t// Bind this SharedObject to its context (typically the DataStore) so it attaches with it\n\t\tthis.value.bindToContext();\n\n\t\t// This will trigger the context (typically the DataStore) to attach its graph\n\t\tsuper.attachGraph();\n\t}\n\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\t// We don't bind handles in staging mode to defer the attachment of any new objects\n\t\t// until we've exited staging mode. This way if we discard changes or a new handle is not present in the final\n\t\t// committed state, we will never end up attaching the discarded object.\n\t\tif (asLegacyAlpha(this.runtime).inStagingMode === true) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If this handle is visible, attach the graph of the incoming handle as well.\n\t\tif (this.isVisible) {\n\t\t\thandle.attachGraph();\n\t\t\treturn;\n\t\t}\n\n\t\t// If this handle is not visible, we will attach it later when this handle's attachGraph is called.\n\t\tthis.pendingHandles.add(handle);\n\t}\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/shared-object-base";
8
- export declare const pkgVersion = "2.70.0-361788";
8
+ export declare const pkgVersion = "2.70.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,uCAAuC,CAAC;AAC5D,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,uCAAuC,CAAC;AAC5D,eAAO,MAAM,UAAU,WAAW,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/shared-object-base";
11
- exports.pkgVersion = "2.70.0-361788";
11
+ exports.pkgVersion = "2.70.0";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,oCAAoC,CAAC;AAC/C,QAAA,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-object-base\";\nexport const pkgVersion = \"2.70.0-361788\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,oCAAoC,CAAC;AAC/C,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-object-base\";\nexport const pkgVersion = \"2.70.0\";\n"]}
package/lib/handle.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
6
6
  import { FluidObjectHandle } from "@fluidframework/datastore/internal";
7
- import type { IFluidDataStoreRuntimeExperimental } from "@fluidframework/datastore-definitions/internal";
7
+ import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal";
8
8
  import type { ISharedObject } from "./types.js";
9
9
  /**
10
10
  * Handle for a shared object. See also `SharedObjectHandle`.
@@ -59,7 +59,7 @@ export declare class SharedObjectHandle extends FluidObjectHandle<ISharedObject>
59
59
  * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
60
60
  * to this handle.
61
61
  */
62
- constructor(value: ISharedObject, path: string, runtime: IFluidDataStoreRuntimeExperimental);
62
+ constructor(value: ISharedObject, path: string, runtime: IFluidDataStoreRuntime);
63
63
  /**
64
64
  * Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.
65
65
  * When attaching the handle, it registers the associated shared object.
@@ -1 +1 @@
1
- {"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAGzG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB,CAAC,aAAa,CAAC;IAC/E;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,mBAAmB,CAEpF;AAED;;;;;;;;;GASG;AACH,qBAAa,kBACZ,SAAQ,iBAAiB,CAAC,aAAa,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zB;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;OAEG;IACH,OAAO,KAAK,SAAS,GAcpB;IAED;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAkB;IAE1C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwC;IAEvE;;;;;;OAMG;gBAEiB,KAAK,EAAE,aAAa,EACvC,IAAI,EAAE,MAAM,EACK,OAAO,EAAE,sBAAsB;IAKjD;;;OAGG;IACI,WAAW,IAAI,IAAI;IAmBnB,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;CAiB/C"}
package/lib/handle.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { FluidObjectHandle } from "@fluidframework/datastore/internal";
6
- import { isFluidHandle } from "@fluidframework/runtime-utils";
6
+ import { isFluidHandle, asLegacyAlpha } from "@fluidframework/runtime-utils/internal";
7
7
  /**
8
8
  * Type guard for {@link ISharedObjectHandle}.
9
9
  * @internal
@@ -53,9 +53,7 @@ export class SharedObjectHandle extends FluidObjectHandle {
53
53
  * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
54
54
  * to this handle.
55
55
  */
56
- constructor(value, path,
57
- // eslint-disable-next-line import/no-deprecated
58
- runtime) {
56
+ constructor(value, path, runtime) {
59
57
  super(value, path, runtime.IFluidHandleContext);
60
58
  this.value = value;
61
59
  this.runtime = runtime;
@@ -88,7 +86,7 @@ export class SharedObjectHandle extends FluidObjectHandle {
88
86
  // We don't bind handles in staging mode to defer the attachment of any new objects
89
87
  // until we've exited staging mode. This way if we discard changes or a new handle is not present in the final
90
88
  // committed state, we will never end up attaching the discarded object.
91
- if (this.runtime.inStagingMode === true) {
89
+ if (asLegacyAlpha(this.runtime).inStagingMode === true) {
92
90
  return;
93
91
  }
94
92
  // If this handle is visible, attach the graph of the incoming handle as well.
package/lib/handle.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"handle.js","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FAAyF;QACzF,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAE3B,8EAA8E;QAC9E,KAAK,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAEM,IAAI,CAAC,MAA4B;QACvC,mFAAmF;QACnF,8GAA8G;QAC9G,wEAAwE;QACxE,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;YACzC,OAAO;QACR,CAAC;QAED,8EAA8E;QAC9E,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO;QACR,CAAC;QAED,mGAAmG;QACnG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore/internal\";\n// eslint-disable-next-line import/no-deprecated\nimport type { IFluidDataStoreRuntimeExperimental } from \"@fluidframework/datastore-definitions/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\nimport type { ISharedObject } from \"./types.js\";\n\n/**\n * Handle for a shared object. See also `SharedObjectHandle`.\n * Supports binding other handles to the underlying Shared Object (see {@link ISharedObjectHandle.bind}).\n *\n * @internal\n */\nexport interface ISharedObjectHandle extends IFluidHandleInternal<ISharedObject> {\n\t/**\n\t * Binds the given handle to this DDS or attach the given handle if this DDS is attached.\n\t * A bound handle will also be attached once this DDS is attached.\n\t *\n\t * @param handle - The target handle to bind to this DDS\n\t */\n\tbind(handle: IFluidHandleInternal): void;\n}\n\n/**\n * Type guard for {@link ISharedObjectHandle}.\n * @internal\n */\nexport function isISharedObjectHandle(handle: unknown): handle is ISharedObjectHandle {\n\treturn isFluidHandle(handle) && typeof (handle as ISharedObjectHandle).bind === \"function\";\n}\n\n/**\n * Handle for a shared object (DDS).\n *\n * @remarks\n *\n * This object is used for already loaded (in-memory) shared objects.\n *\n * It provides a \"bind\" function that is expected to be invoked on all handles stored in this DDS,\n * ensuring the target object becomes attached along with this DDS.\n */\nexport class SharedObjectHandle\n\textends FluidObjectHandle<ISharedObject>\n\timplements ISharedObjectHandle\n{\n\t/**\n\t * Whether services have been attached for the associated shared object.\n\t */\n\tpublic get isAttached(): boolean {\n\t\treturn this.value.isAttached();\n\t}\n\n\t/**\n\t * Tells whether the object of this handle is visible in the container locally or globally.\n\t */\n\tprivate get isVisible(): boolean {\n\t\t/**\n\t\t * If the object of this handle is attached, it is visible in the container. Ideally, checking local visibility\n\t\t * should be enough for a handle. However, there are scenarios where the object becomes locally visible but the\n\t\t * handle does not know this - This will happen is attachGraph is never called on the handle. Couple of examples\n\t\t * where this can happen:\n\t\t *\n\t\t * 1. Handles to DDS other than the default handle won't know if the DDS becomes visible after the handle was\n\t\t * created.\n\t\t *\n\t\t * 2. Handles to root data stores will never know that it was visible because the handle will not be stores in\n\t\t * another DDS and so, attachGraph will never be called on it.\n\t\t */\n\t\treturn this.isAttached || this.isLocallyVisible;\n\t}\n\n\t/**\n\t * Tracks whether this handle is locally visible in the container.\n\t */\n\tprivate isLocallyVisible: boolean = false;\n\n\tprivate readonly pendingHandles: Set<IFluidHandleInternal> = new Set();\n\n\t/**\n\t * Creates a new SharedObjectHandle.\n\t * @param value - The shared object this handle is for.\n\t * @param path - The id of the shared object. It is also the path to this object relative to the routeContext.\n\t * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route\n\t * to this handle.\n\t */\n\tconstructor(\n\t\tprotected readonly value: ISharedObject,\n\t\tpath: string,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tprivate readonly runtime: IFluidDataStoreRuntimeExperimental,\n\t) {\n\t\tsuper(value, path, runtime.IFluidHandleContext);\n\t}\n\n\t/**\n\t * Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.\n\t * When attaching the handle, it registers the associated shared object.\n\t */\n\tpublic attachGraph(): void {\n\t\tif (this.isVisible) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively attach all pending handles\n\t\tthis.isLocallyVisible = true;\n\t\tfor (const handle of this.pendingHandles) {\n\t\t\thandle.attachGraph();\n\t\t}\n\t\tthis.pendingHandles.clear();\n\n\t\t// Bind this SharedObject to its context (typically the DataStore) so it attaches with it\n\t\tthis.value.bindToContext();\n\n\t\t// This will trigger the context (typically the DataStore) to attach its graph\n\t\tsuper.attachGraph();\n\t}\n\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\t// We don't bind handles in staging mode to defer the attachment of any new objects\n\t\t// until we've exited staging mode. This way if we discard changes or a new handle is not present in the final\n\t\t// committed state, we will never end up attaching the discarded object.\n\t\tif (this.runtime.inStagingMode === true) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If this handle is visible, attach the graph of the incoming handle as well.\n\t\tif (this.isVisible) {\n\t\t\thandle.attachGraph();\n\t\t\treturn;\n\t\t}\n\n\t\t// If this handle is not visible, we will attach it later when this handle's attachGraph is called.\n\t\tthis.pendingHandles.add(handle);\n\t}\n}\n"]}
1
+ {"version":3,"file":"handle.js","sourceRoot":"","sources":["../src/handle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAoBtF;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAe;IACpD,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,OAAQ,MAA8B,CAAC,IAAI,KAAK,UAAU,CAAC;AAC5F,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,kBACZ,SAAQ,iBAAgC;IAGxC;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAChC,CAA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IACjC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore/internal\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\nimport { isFluidHandle, asLegacyAlpha } from \"@fluidframework/runtime-utils/internal\";\n\nimport type { ISharedObject } from \"./types.js\";\n\n/**\n * Handle for a shared object. See also `SharedObjectHandle`.\n * Supports binding other handles to the underlying Shared Object (see {@link ISharedObjectHandle.bind}).\n *\n * @internal\n */\nexport interface ISharedObjectHandle extends IFluidHandleInternal<ISharedObject> {\n\t/**\n\t * Binds the given handle to this DDS or attach the given handle if this DDS is attached.\n\t * A bound handle will also be attached once this DDS is attached.\n\t *\n\t * @param handle - The target handle to bind to this DDS\n\t */\n\tbind(handle: IFluidHandleInternal): void;\n}\n\n/**\n * Type guard for {@link ISharedObjectHandle}.\n * @internal\n */\nexport function isISharedObjectHandle(handle: unknown): handle is ISharedObjectHandle {\n\treturn isFluidHandle(handle) && typeof (handle as ISharedObjectHandle).bind === \"function\";\n}\n\n/**\n * Handle for a shared object (DDS).\n *\n * @remarks\n *\n * This object is used for already loaded (in-memory) shared objects.\n *\n * It provides a \"bind\" function that is expected to be invoked on all handles stored in this DDS,\n * ensuring the target object becomes attached along with this DDS.\n */\nexport class SharedObjectHandle\n\textends FluidObjectHandle<ISharedObject>\n\timplements ISharedObjectHandle\n{\n\t/**\n\t * Whether services have been attached for the associated shared object.\n\t */\n\tpublic get isAttached(): boolean {\n\t\treturn this.value.isAttached();\n\t}\n\n\t/**\n\t * Tells whether the object of this handle is visible in the container locally or globally.\n\t */\n\tprivate get isVisible(): boolean {\n\t\t/**\n\t\t * If the object of this handle is attached, it is visible in the container. Ideally, checking local visibility\n\t\t * should be enough for a handle. However, there are scenarios where the object becomes locally visible but the\n\t\t * handle does not know this - This will happen is attachGraph is never called on the handle. Couple of examples\n\t\t * where this can happen:\n\t\t *\n\t\t * 1. Handles to DDS other than the default handle won't know if the DDS becomes visible after the handle was\n\t\t * created.\n\t\t *\n\t\t * 2. Handles to root data stores will never know that it was visible because the handle will not be stores in\n\t\t * another DDS and so, attachGraph will never be called on it.\n\t\t */\n\t\treturn this.isAttached || this.isLocallyVisible;\n\t}\n\n\t/**\n\t * Tracks whether this handle is locally visible in the container.\n\t */\n\tprivate isLocallyVisible: boolean = false;\n\n\tprivate readonly pendingHandles: Set<IFluidHandleInternal> = new Set();\n\n\t/**\n\t * Creates a new SharedObjectHandle.\n\t * @param value - The shared object this handle is for.\n\t * @param path - The id of the shared object. It is also the path to this object relative to the routeContext.\n\t * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route\n\t * to this handle.\n\t */\n\tconstructor(\n\t\tprotected readonly value: ISharedObject,\n\t\tpath: string,\n\t\tprivate readonly runtime: IFluidDataStoreRuntime,\n\t) {\n\t\tsuper(value, path, runtime.IFluidHandleContext);\n\t}\n\n\t/**\n\t * Attaches all bound handles first (which may in turn attach further handles), then attaches this handle.\n\t * When attaching the handle, it registers the associated shared object.\n\t */\n\tpublic attachGraph(): void {\n\t\tif (this.isVisible) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively attach all pending handles\n\t\tthis.isLocallyVisible = true;\n\t\tfor (const handle of this.pendingHandles) {\n\t\t\thandle.attachGraph();\n\t\t}\n\t\tthis.pendingHandles.clear();\n\n\t\t// Bind this SharedObject to its context (typically the DataStore) so it attaches with it\n\t\tthis.value.bindToContext();\n\n\t\t// This will trigger the context (typically the DataStore) to attach its graph\n\t\tsuper.attachGraph();\n\t}\n\n\tpublic bind(handle: IFluidHandleInternal): void {\n\t\t// We don't bind handles in staging mode to defer the attachment of any new objects\n\t\t// until we've exited staging mode. This way if we discard changes or a new handle is not present in the final\n\t\t// committed state, we will never end up attaching the discarded object.\n\t\tif (asLegacyAlpha(this.runtime).inStagingMode === true) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If this handle is visible, attach the graph of the incoming handle as well.\n\t\tif (this.isVisible) {\n\t\t\thandle.attachGraph();\n\t\t\treturn;\n\t\t}\n\n\t\t// If this handle is not visible, we will attach it later when this handle's attachGraph is called.\n\t\tthis.pendingHandles.add(handle);\n\t}\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/shared-object-base";
8
- export declare const pkgVersion = "2.70.0-361788";
8
+ export declare const pkgVersion = "2.70.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,uCAAuC,CAAC;AAC5D,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,uCAAuC,CAAC;AAC5D,eAAO,MAAM,UAAU,WAAW,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/shared-object-base";
8
- export const pkgVersion = "2.70.0-361788";
8
+ export const pkgVersion = "2.70.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,oCAAoC,CAAC;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-object-base\";\nexport const pkgVersion = \"2.70.0-361788\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,oCAAoC,CAAC;AAC5D,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/shared-object-base\";\nexport const pkgVersion = \"2.70.0\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/shared-object-base",
3
- "version": "2.70.0-361788",
3
+ "version": "2.70.0",
4
4
  "description": "Fluid base class for shared distributed data structures",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -69,30 +69,30 @@
69
69
  "temp-directory": "nyc/.nyc_output"
70
70
  },
71
71
  "dependencies": {
72
- "@fluid-internal/client-utils": "2.70.0-361788",
73
- "@fluidframework/container-definitions": "2.70.0-361788",
74
- "@fluidframework/core-interfaces": "2.70.0-361788",
75
- "@fluidframework/core-utils": "2.70.0-361788",
76
- "@fluidframework/datastore": "2.70.0-361788",
77
- "@fluidframework/datastore-definitions": "2.70.0-361788",
78
- "@fluidframework/driver-definitions": "2.70.0-361788",
79
- "@fluidframework/id-compressor": "2.70.0-361788",
80
- "@fluidframework/runtime-definitions": "2.70.0-361788",
81
- "@fluidframework/runtime-utils": "2.70.0-361788",
82
- "@fluidframework/telemetry-utils": "2.70.0-361788",
72
+ "@fluid-internal/client-utils": "~2.70.0",
73
+ "@fluidframework/container-definitions": "~2.70.0",
74
+ "@fluidframework/core-interfaces": "~2.70.0",
75
+ "@fluidframework/core-utils": "~2.70.0",
76
+ "@fluidframework/datastore": "~2.70.0",
77
+ "@fluidframework/datastore-definitions": "~2.70.0",
78
+ "@fluidframework/driver-definitions": "~2.70.0",
79
+ "@fluidframework/id-compressor": "~2.70.0",
80
+ "@fluidframework/runtime-definitions": "~2.70.0",
81
+ "@fluidframework/runtime-utils": "~2.70.0",
82
+ "@fluidframework/telemetry-utils": "~2.70.0",
83
83
  "uuid": "^11.1.0"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@arethetypeswrong/cli": "^0.17.1",
87
87
  "@biomejs/biome": "~1.9.3",
88
- "@fluid-internal/mocha-test-setup": "2.70.0-361788",
89
- "@fluid-private/test-pairwise-generator": "2.70.0-361788",
88
+ "@fluid-internal/mocha-test-setup": "~2.70.0",
89
+ "@fluid-private/test-pairwise-generator": "~2.70.0",
90
90
  "@fluid-tools/build-cli": "^0.58.3",
91
91
  "@fluidframework/build-common": "^2.0.3",
92
92
  "@fluidframework/build-tools": "^0.58.3",
93
93
  "@fluidframework/eslint-config-fluid": "^6.1.0",
94
94
  "@fluidframework/shared-object-base-previous": "npm:@fluidframework/shared-object-base@2.63.0",
95
- "@fluidframework/test-runtime-utils": "2.70.0-361788",
95
+ "@fluidframework/test-runtime-utils": "~2.70.0",
96
96
  "@microsoft/api-extractor": "7.52.11",
97
97
  "@types/benchmark": "^2.1.0",
98
98
  "@types/mocha": "^10.0.10",
package/src/handle.ts CHANGED
@@ -5,9 +5,8 @@
5
5
 
6
6
  import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
7
7
  import { FluidObjectHandle } from "@fluidframework/datastore/internal";
8
- // eslint-disable-next-line import/no-deprecated
9
- import type { IFluidDataStoreRuntimeExperimental } from "@fluidframework/datastore-definitions/internal";
10
- import { isFluidHandle } from "@fluidframework/runtime-utils";
8
+ import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal";
9
+ import { isFluidHandle, asLegacyAlpha } from "@fluidframework/runtime-utils/internal";
11
10
 
12
11
  import type { ISharedObject } from "./types.js";
13
12
 
@@ -92,8 +91,7 @@ export class SharedObjectHandle
92
91
  constructor(
93
92
  protected readonly value: ISharedObject,
94
93
  path: string,
95
- // eslint-disable-next-line import/no-deprecated
96
- private readonly runtime: IFluidDataStoreRuntimeExperimental,
94
+ private readonly runtime: IFluidDataStoreRuntime,
97
95
  ) {
98
96
  super(value, path, runtime.IFluidHandleContext);
99
97
  }
@@ -125,7 +123,7 @@ export class SharedObjectHandle
125
123
  // We don't bind handles in staging mode to defer the attachment of any new objects
126
124
  // until we've exited staging mode. This way if we discard changes or a new handle is not present in the final
127
125
  // committed state, we will never end up attaching the discarded object.
128
- if (this.runtime.inStagingMode === true) {
126
+ if (asLegacyAlpha(this.runtime).inStagingMode === true) {
129
127
  return;
130
128
  }
131
129
 
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/shared-object-base";
9
- export const pkgVersion = "2.70.0-361788";
9
+ export const pkgVersion = "2.70.0";