@fluidframework/container-loader 2.0.0-rc.5.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { IDetachedBlobStorage } from "./loader.js";
6
- export declare function serializeMemoryDetachedBlobStorage(detachedStorage: IDetachedBlobStorage): string | undefined;
7
- export declare function tryInitializeMemoryDetachedBlobStorage(detachedStorage: IDetachedBlobStorage, attachmentBlobs: string): void;
6
+ export declare function serializeMemoryDetachedBlobStorage(detachedStorage: IDetachedBlobStorage | undefined): string | undefined;
7
+ export declare function tryInitializeMemoryDetachedBlobStorage(detachedStorage: IDetachedBlobStorage | undefined, attachmentBlobs: string): void;
8
8
  export declare function createMemoryDetachedBlobStorage(): IDetachedBlobStorage;
9
9
  //# sourceMappingURL=memoryBlobStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"memoryBlobStorage.d.ts","sourceRoot":"","sources":["../src/memoryBlobStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAuBxD,wBAAgB,kCAAkC,CAEjD,eAAe,EAAE,oBAAoB,GACnC,MAAM,GAAG,SAAS,CAIpB;AAED,wBAAgB,sCAAsC,CAErD,eAAe,EAAE,oBAAoB,EACrC,eAAe,EAAE,MAAM,QAavB;AAGD,wBAAgB,+BAA+B,IAAI,oBAAoB,CAmBtE"}
1
+ {"version":3,"file":"memoryBlobStorage.d.ts","sourceRoot":"","sources":["../src/memoryBlobStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAuBxD,wBAAgB,kCAAkC,CAEjD,eAAe,EAAE,oBAAoB,GAAG,SAAS,GAC/C,MAAM,GAAG,SAAS,CAQpB;AAED,wBAAgB,sCAAsC,CAErD,eAAe,EAAE,oBAAoB,GAAG,SAAS,EACjD,eAAe,EAAE,MAAM,QAavB;AAGD,wBAAgB,+BAA+B,IAAI,oBAAoB,CAmBtE"}
@@ -16,7 +16,9 @@ detachedStorage) {
16
16
  export function serializeMemoryDetachedBlobStorage(
17
17
  // eslint-disable-next-line import/no-deprecated
18
18
  detachedStorage) {
19
- if (detachedStorage.size > 0 && isMemoryDetachedBlobStorage(detachedStorage)) {
19
+ if (detachedStorage !== undefined &&
20
+ detachedStorage.size > 0 &&
21
+ isMemoryDetachedBlobStorage(detachedStorage)) {
20
22
  return detachedStorage.serialize();
21
23
  }
22
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"memoryBlobStorage.js","sourceRoot":"","sources":["../src/memoryBlobStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAMvE,MAAM,mCAAmC,GAAG,MAAM,EAAE,CAAC;AASrD,SAAS,2BAA2B;AACnC,gDAAgD;AAChD,eAAqC;IAErC,OAAO,CACN,QAAQ,CAAC,eAAe,CAAC;QACzB,mCAAmC,IAAI,eAAe;QACtD,eAAe,CAAC,mCAAmC,CAAC;YACnD,mCAAmC,CACpC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kCAAkC;AACjD,gDAAgD;AAChD,eAAqC;IAErC,IAAI,eAAe,CAAC,IAAI,GAAG,CAAC,IAAI,2BAA2B,CAAC,eAAe,CAAC,EAAE,CAAC;QAC9E,OAAO,eAAe,CAAC,SAAS,EAAE,CAAC;IACpC,CAAC;AACF,CAAC;AAED,MAAM,UAAU,sCAAsC;AACrD,gDAAgD;AAChD,eAAqC,EACrC,eAAuB;IAEvB,IAAI,CAAC,2BAA2B,CAAC,eAAe,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CACd,6GAA6G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CAAC,CAAC;QAC7E,UAAU,EAAE,CAAC,eAAyB,EAAE,EAAE,CACzC,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;KACtF,CAAC;IACF,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { assert, isObject } from \"@fluidframework/core-utils/internal\";\nimport type { ICreateBlobResponse } from \"@fluidframework/driver-definitions/internal\";\n\n// eslint-disable-next-line import/no-deprecated\nimport type { IDetachedBlobStorage } from \"./loader.js\";\n\nconst MemoryDetachedBlobStorageIdentifier = Symbol();\n\n// eslint-disable-next-line import/no-deprecated\ninterface MemoryDetachedBlobStorage extends IDetachedBlobStorage {\n\t[MemoryDetachedBlobStorageIdentifier]: typeof MemoryDetachedBlobStorageIdentifier;\n\tinitialize(attachmentBlobs: string[]): void;\n\tserialize(): string | undefined;\n}\n\nfunction isMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage,\n): detachedStorage is MemoryDetachedBlobStorage {\n\treturn (\n\t\tisObject(detachedStorage) &&\n\t\tMemoryDetachedBlobStorageIdentifier in detachedStorage &&\n\t\tdetachedStorage[MemoryDetachedBlobStorageIdentifier] ===\n\t\t\tMemoryDetachedBlobStorageIdentifier\n\t);\n}\n\nexport function serializeMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage,\n): string | undefined {\n\tif (detachedStorage.size > 0 && isMemoryDetachedBlobStorage(detachedStorage)) {\n\t\treturn detachedStorage.serialize();\n\t}\n}\n\nexport function tryInitializeMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage,\n\tattachmentBlobs: string,\n) {\n\tif (!isMemoryDetachedBlobStorage(detachedStorage)) {\n\t\tthrow new Error(\n\t\t\t\"DetachedBlobStorage was not provided to the loader during serialize so cannot be provided during rehydrate.\",\n\t\t);\n\t}\n\n\tassert(detachedStorage.size === 0, 0x99e /* Blob storage already initialized */);\n\tconst maybeAttachmentBlobs = JSON.parse(attachmentBlobs);\n\tassert(Array.isArray(maybeAttachmentBlobs), 0x99f /* Invalid attachmentBlobs */);\n\n\tdetachedStorage.initialize(maybeAttachmentBlobs);\n}\n\n// eslint-disable-next-line import/no-deprecated\nexport function createMemoryDetachedBlobStorage(): IDetachedBlobStorage {\n\tconst blobs: ArrayBufferLike[] = [];\n\tconst storage: MemoryDetachedBlobStorage = {\n\t\t[MemoryDetachedBlobStorageIdentifier]: MemoryDetachedBlobStorageIdentifier,\n\t\tcreateBlob: async (file: ArrayBufferLike): Promise<ICreateBlobResponse> => ({\n\t\t\tid: `${blobs.push(file) - 1}`,\n\t\t}),\n\t\treadBlob: async (id: string): Promise<ArrayBufferLike> =>\n\t\t\tblobs[Number(id)] ?? Promise.reject(new Error(`Blob not found: ${id}`)),\n\t\tget size() {\n\t\t\treturn blobs.length;\n\t\t},\n\t\tgetBlobIds: (): string[] => blobs.map((_, i) => `${i}`),\n\t\tdispose: () => blobs.splice(0),\n\t\tserialize: () => JSON.stringify(blobs.map((b) => bufferToString(b, \"utf-8\"))),\n\t\tinitialize: (attachmentBlobs: string[]) =>\n\t\t\tblobs.push(...attachmentBlobs.map((maybeBlob) => stringToBuffer(maybeBlob, \"utf-8\"))),\n\t};\n\treturn storage;\n}\n"]}
1
+ {"version":3,"file":"memoryBlobStorage.js","sourceRoot":"","sources":["../src/memoryBlobStorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,QAA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CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;SAC7B,CAAC;QACF,QAAQ,EAAE,KAAK,EAAE,EAAU,EAA4B,EAAE,CACxD,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QACxE,IAAI,IAAI;YACP,OAAO,KAAK,CAAC,MAAM,CAAC;QACrB,CAAC;QACD,UAAU,EAAE,GAAa,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9B,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,UAAU,EAAE,CAAC,eAAyB,EAAE,EAAE,CACzC,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;KACtF,CAAC;IACF,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString, stringToBuffer } from \"@fluid-internal/client-utils\";\nimport { assert, isObject } from \"@fluidframework/core-utils/internal\";\nimport type { ICreateBlobResponse } from \"@fluidframework/driver-definitions/internal\";\n\n// eslint-disable-next-line import/no-deprecated\nimport type { IDetachedBlobStorage } from \"./loader.js\";\n\nconst MemoryDetachedBlobStorageIdentifier = Symbol();\n\n// eslint-disable-next-line import/no-deprecated\ninterface MemoryDetachedBlobStorage extends IDetachedBlobStorage {\n\t[MemoryDetachedBlobStorageIdentifier]: typeof MemoryDetachedBlobStorageIdentifier;\n\tinitialize(attachmentBlobs: string[]): void;\n\tserialize(): string | undefined;\n}\n\nfunction isMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage | undefined,\n): detachedStorage is MemoryDetachedBlobStorage {\n\treturn (\n\t\tisObject(detachedStorage) &&\n\t\tMemoryDetachedBlobStorageIdentifier in detachedStorage &&\n\t\tdetachedStorage[MemoryDetachedBlobStorageIdentifier] ===\n\t\t\tMemoryDetachedBlobStorageIdentifier\n\t);\n}\n\nexport function serializeMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage | undefined,\n): string | undefined {\n\tif (\n\t\tdetachedStorage !== undefined &&\n\t\tdetachedStorage.size > 0 &&\n\t\tisMemoryDetachedBlobStorage(detachedStorage)\n\t) {\n\t\treturn detachedStorage.serialize();\n\t}\n}\n\nexport function tryInitializeMemoryDetachedBlobStorage(\n\t// eslint-disable-next-line import/no-deprecated\n\tdetachedStorage: IDetachedBlobStorage | undefined,\n\tattachmentBlobs: string,\n) {\n\tif (!isMemoryDetachedBlobStorage(detachedStorage)) {\n\t\tthrow new Error(\n\t\t\t\"DetachedBlobStorage was not provided to the loader during serialize so cannot be provided during rehydrate.\",\n\t\t);\n\t}\n\n\tassert(detachedStorage.size === 0, 0x99e /* Blob storage already initialized */);\n\tconst maybeAttachmentBlobs = JSON.parse(attachmentBlobs);\n\tassert(Array.isArray(maybeAttachmentBlobs), 0x99f /* Invalid attachmentBlobs */);\n\n\tdetachedStorage.initialize(maybeAttachmentBlobs);\n}\n\n// eslint-disable-next-line import/no-deprecated\nexport function createMemoryDetachedBlobStorage(): IDetachedBlobStorage {\n\tconst blobs: ArrayBufferLike[] = [];\n\tconst storage: MemoryDetachedBlobStorage = {\n\t\t[MemoryDetachedBlobStorageIdentifier]: MemoryDetachedBlobStorageIdentifier,\n\t\tcreateBlob: async (file: ArrayBufferLike): Promise<ICreateBlobResponse> => ({\n\t\t\tid: `${blobs.push(file) - 1}`,\n\t\t}),\n\t\treadBlob: async (id: string): Promise<ArrayBufferLike> =>\n\t\t\tblobs[Number(id)] ?? Promise.reject(new Error(`Blob not found: ${id}`)),\n\t\tget size() {\n\t\t\treturn blobs.length;\n\t\t},\n\t\tgetBlobIds: (): string[] => blobs.map((_, i) => `${i}`),\n\t\tdispose: () => blobs.splice(0),\n\t\tserialize: () => JSON.stringify(blobs.map((b) => bufferToString(b, \"utf-8\"))),\n\t\tinitialize: (attachmentBlobs: string[]) =>\n\t\t\tblobs.push(...attachmentBlobs.map((maybeBlob) => stringToBuffer(maybeBlob, \"utf-8\"))),\n\t};\n\treturn storage;\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/container-loader";
8
- export declare const pkgVersion = "2.0.0-rc.5.0.1";
8
+ export declare const pkgVersion = "2.0.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,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,mBAAmB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,UAAU,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/container-loader";
8
- export const pkgVersion = "2.0.0-rc.5.0.1";
8
+ export const pkgVersion = "2.0.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,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.0.0-rc.5.0.1\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,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/container-loader\";\nexport const pkgVersion = \"2.0.0\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-loader",
3
- "version": "2.0.0-rc.5.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "Fluid container loader",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -117,13 +117,13 @@
117
117
  "temp-directory": "nyc/.nyc_output"
118
118
  },
119
119
  "dependencies": {
120
- "@fluid-internal/client-utils": ">=2.0.0-rc.5.0.1 <2.0.0-rc.5.1.0",
121
- "@fluidframework/container-definitions": ">=2.0.0-rc.5.0.1 <2.0.0-rc.5.1.0",
122
- "@fluidframework/core-interfaces": ">=2.0.0-rc.5.0.1 <2.0.0-rc.5.1.0",
123
- "@fluidframework/core-utils": ">=2.0.0-rc.5.0.1 <2.0.0-rc.5.1.0",
124
- "@fluidframework/driver-definitions": ">=2.0.0-rc.5.0.1 <2.0.0-rc.5.1.0",
125
- "@fluidframework/driver-utils": ">=2.0.0-rc.5.0.1 <2.0.0-rc.5.1.0",
126
- "@fluidframework/telemetry-utils": ">=2.0.0-rc.5.0.1 <2.0.0-rc.5.1.0",
120
+ "@fluid-internal/client-utils": "~2.0.0",
121
+ "@fluidframework/container-definitions": "~2.0.0",
122
+ "@fluidframework/core-interfaces": "~2.0.0",
123
+ "@fluidframework/core-utils": "~2.0.0",
124
+ "@fluidframework/driver-definitions": "~2.0.0",
125
+ "@fluidframework/driver-utils": "~2.0.0",
126
+ "@fluidframework/telemetry-utils": "~2.0.0",
127
127
  "@types/events_pkg": "npm:@types/events@^3.0.0",
128
128
  "@ungap/structured-clone": "^1.2.0",
129
129
  "debug": "^4.3.4",
@@ -134,9 +134,9 @@
134
134
  "devDependencies": {
135
135
  "@arethetypeswrong/cli": "^0.15.2",
136
136
  "@biomejs/biome": "^1.7.3",
137
- "@fluid-internal/client-utils": ">=2.0.0-rc.5.0.1 <2.0.0-rc.5.1.0",
138
- "@fluid-internal/mocha-test-setup": ">=2.0.0-rc.5.0.1 <2.0.0-rc.5.1.0",
139
- "@fluid-private/test-loader-utils": ">=2.0.0-rc.5.0.1 <2.0.0-rc.5.1.0",
137
+ "@fluid-internal/client-utils": "~2.0.0",
138
+ "@fluid-internal/mocha-test-setup": "~2.0.0",
139
+ "@fluid-private/test-loader-utils": "~2.0.0",
140
140
  "@fluid-tools/build-cli": "^0.39.0",
141
141
  "@fluidframework/build-common": "^2.0.3",
142
142
  "@fluidframework/build-tools": "^0.39.0",
package/src/container.ts CHANGED
@@ -480,7 +480,7 @@ export class Container
480
480
  private readonly scope: FluidObject;
481
481
  private readonly subLogger: ITelemetryLoggerExt;
482
482
  // eslint-disable-next-line import/no-deprecated
483
- private readonly detachedBlobStorage: IDetachedBlobStorage;
483
+ private readonly detachedBlobStorage: IDetachedBlobStorage | undefined;
484
484
  private readonly protocolHandlerBuilder: ProtocolHandlerBuilder;
485
485
  private readonly client: IClient;
486
486
 
@@ -798,7 +798,6 @@ export class Container
798
798
  // Tracking alternative ways to handle this in AB#4129.
799
799
  this.options = { ...options };
800
800
  this.scope = scope;
801
- this.detachedBlobStorage = detachedBlobStorage ?? createMemoryDetachedBlobStorage();
802
801
  this.protocolHandlerBuilder =
803
802
  protocolHandlerBuilder ??
804
803
  ((
@@ -975,6 +974,12 @@ export class Container
975
974
  this.mc.config.getBoolean("Fluid.Container.summarizeProtocolTree2") ??
976
975
  options.summarizeProtocolTree;
977
976
 
977
+ this.detachedBlobStorage =
978
+ detachedBlobStorage ??
979
+ (this.mc.config.getBoolean("Fluid.Container.MemoryBlobStorageEnabled") === true
980
+ ? createMemoryDetachedBlobStorage()
981
+ : undefined);
982
+
978
983
  this.storageAdapter = new ContainerStorageAdapter(
979
984
  this.detachedBlobStorage,
980
985
  this.mc.logger,
@@ -1236,7 +1241,8 @@ export class Container
1236
1241
  baseSnapshot,
1237
1242
  snapshotBlobs,
1238
1243
  pendingRuntimeState,
1239
- hasAttachmentBlobs: this.detachedBlobStorage.size > 0,
1244
+ hasAttachmentBlobs:
1245
+ this.detachedBlobStorage !== undefined && this.detachedBlobStorage.size > 0,
1240
1246
  attachmentBlobs: serializeMemoryDetachedBlobStorage(this.detachedBlobStorage),
1241
1247
  };
1242
1248
  return JSON.stringify(detachedContainerState);
@@ -1353,7 +1359,7 @@ export class Container
1353
1359
  const snapshotWithBlobs = await attachP;
1354
1360
  this.serializedStateManager.setInitialSnapshot(snapshotWithBlobs);
1355
1361
  if (!this.closed) {
1356
- this.detachedBlobStorage.dispose?.();
1362
+ this.detachedBlobStorage?.dispose?.();
1357
1363
  this.handleDeltaConnectionArg(attachProps?.deltaConnection, {
1358
1364
  fetchOpsFromStorage: false,
1359
1365
  reason: { text: "createDetached" },
@@ -1791,7 +1797,7 @@ export class Container
1791
1797
  tryInitializeMemoryDetachedBlobStorage(this.detachedBlobStorage, attachmentBlobs);
1792
1798
  }
1793
1799
  assert(
1794
- this.detachedBlobStorage.size > 0,
1800
+ this.detachedBlobStorage !== undefined && this.detachedBlobStorage.size > 0,
1795
1801
  0x250 /* "serialized container with attachment blobs must be rehydrated with detached blob storage" */,
1796
1802
  );
1797
1803
  }
@@ -21,7 +21,7 @@ interface MemoryDetachedBlobStorage extends IDetachedBlobStorage {
21
21
 
22
22
  function isMemoryDetachedBlobStorage(
23
23
  // eslint-disable-next-line import/no-deprecated
24
- detachedStorage: IDetachedBlobStorage,
24
+ detachedStorage: IDetachedBlobStorage | undefined,
25
25
  ): detachedStorage is MemoryDetachedBlobStorage {
26
26
  return (
27
27
  isObject(detachedStorage) &&
@@ -33,16 +33,20 @@ function isMemoryDetachedBlobStorage(
33
33
 
34
34
  export function serializeMemoryDetachedBlobStorage(
35
35
  // eslint-disable-next-line import/no-deprecated
36
- detachedStorage: IDetachedBlobStorage,
36
+ detachedStorage: IDetachedBlobStorage | undefined,
37
37
  ): string | undefined {
38
- if (detachedStorage.size > 0 && isMemoryDetachedBlobStorage(detachedStorage)) {
38
+ if (
39
+ detachedStorage !== undefined &&
40
+ detachedStorage.size > 0 &&
41
+ isMemoryDetachedBlobStorage(detachedStorage)
42
+ ) {
39
43
  return detachedStorage.serialize();
40
44
  }
41
45
  }
42
46
 
43
47
  export function tryInitializeMemoryDetachedBlobStorage(
44
48
  // eslint-disable-next-line import/no-deprecated
45
- detachedStorage: IDetachedBlobStorage,
49
+ detachedStorage: IDetachedBlobStorage | undefined,
46
50
  attachmentBlobs: string,
47
51
  ) {
48
52
  if (!isMemoryDetachedBlobStorage(detachedStorage)) {
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "2.0.0-rc.5.0.1";
9
+ export const pkgVersion = "2.0.0";