@fluidframework/container-loader 2.71.0 → 2.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.eslintrc.cjs +1 -1
  2. package/CHANGELOG.md +8 -12
  3. package/dist/connectionManager.d.ts +1 -7
  4. package/dist/connectionManager.d.ts.map +1 -1
  5. package/dist/connectionManager.js +4 -31
  6. package/dist/connectionManager.js.map +1 -1
  7. package/dist/container.d.ts +6 -50
  8. package/dist/container.d.ts.map +1 -1
  9. package/dist/container.js +2 -3
  10. package/dist/container.js.map +1 -1
  11. package/dist/loaderLayerCompatState.js +1 -1
  12. package/dist/loaderLayerCompatState.js.map +1 -1
  13. package/dist/memoryBlobStorage.js +1 -1
  14. package/dist/memoryBlobStorage.js.map +1 -1
  15. package/dist/packageVersion.d.ts +1 -1
  16. package/dist/packageVersion.js +1 -1
  17. package/dist/packageVersion.js.map +1 -1
  18. package/lib/connectionManager.d.ts +1 -7
  19. package/lib/connectionManager.d.ts.map +1 -1
  20. package/lib/connectionManager.js +4 -31
  21. package/lib/connectionManager.js.map +1 -1
  22. package/lib/container.d.ts +6 -50
  23. package/lib/container.d.ts.map +1 -1
  24. package/lib/container.js +2 -3
  25. package/lib/container.js.map +1 -1
  26. package/lib/loaderLayerCompatState.js +1 -1
  27. package/lib/loaderLayerCompatState.js.map +1 -1
  28. package/lib/memoryBlobStorage.js +1 -1
  29. package/lib/memoryBlobStorage.js.map +1 -1
  30. package/lib/packageVersion.d.ts +1 -1
  31. package/lib/packageVersion.js +1 -1
  32. package/lib/packageVersion.js.map +1 -1
  33. package/package.json +15 -15
  34. package/src/connectionManager.ts +3 -41
  35. package/src/container.ts +4 -57
  36. package/src/loaderLayerCompatState.ts +1 -1
  37. package/src/memoryBlobStorage.ts +1 -1
  38. package/src/packageVersion.ts +1 -1
@@ -16,7 +16,7 @@ export const loaderCoreCompatDetails = {
16
16
  /**
17
17
  * The current generation of the Loader layer.
18
18
  */
19
- generation: 1,
19
+ generation: 2,
20
20
  };
21
21
  /**
22
22
  * Loader's compatibility details that is exposed to the Runtime layer.
@@ -1 +1 @@
1
- {"version":3,"file":"loaderLayerCompatState.js","sourceRoot":"","sources":["../src/loaderLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EACN,0BAA0B,GAE1B,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC;;OAEG;IACH,UAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAwB;IACjE,GAAG,uBAAuB;IAC1B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAoC;IACnF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAoC;IAClF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC3C,yBAA0D,EAC1D,MAA2B;IAE3B,0BAA0B,CACzB,QAAQ,EACR,SAAS,EACT,6BAA6B,EAC7B,mCAAmC,EACnC,yBAAyB,EACzB,GAAG,EAAE,GAAE,CAAC,CAAC,2DAA2D,EACpE,MAAM,CACN,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAC1C,wBAAyD,EACzD,SAAoD,EACpD,MAA2B;IAE3B,0BAA0B,CACzB,QAAQ,EACR,QAAQ,EACR,6BAA6B,EAC7B,kCAAkC,EAClC,wBAAwB,EACxB,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\tvalidateLayerCompatibility,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the Loader layer that is the same across all layer boundaries.\n * @internal\n */\nexport const loaderCoreCompatDetails = {\n\t/**\n\t * The package version of the Loader layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Loader layer.\n\t */\n\tgeneration: 1,\n};\n\n/**\n * Loader's compatibility details that is exposed to the Runtime layer.\n * @internal\n */\nexport const loaderCompatDetailsForRuntime: ILayerCompatDetails = {\n\t...loaderCoreCompatDetails,\n\t/**\n\t * The features supported by the Loader layer across the Loader / Runtime boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Runtime layer must meet to be compatible with this Loader.\n * @internal\n */\nexport const runtimeSupportRequirementsForLoader: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Runtime must be at to be compatible with Loader. Note that 0 is used here for\n\t * Runtime layers before the introduction of the layer compatibility enforcement.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Runtime must support to be compatible with Loader.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * The requirements that the Driver layer must meet to be compatible with this Loader.\n * @internal\n */\nexport const driverSupportRequirementsForLoader: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Driver must be at to be compatible with Loader. Note that 0 is used here for\n\t * Driver layers before the introduction of the layer compatibility enforcement.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Driver must support to be compatible with Loader.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Runtime layer is compatible with the Loader. *\n * @internal\n */\nexport function validateRuntimeCompatibility(\n\tmaybeRuntimeCompatDetails: ILayerCompatDetails | undefined,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"loader\",\n\t\t\"runtime\",\n\t\tloaderCompatDetailsForRuntime,\n\t\truntimeSupportRequirementsForLoader,\n\t\tmaybeRuntimeCompatDetails,\n\t\t() => {} /* disposeFn - no op. This will be handled by the caller */,\n\t\tlogger,\n\t);\n}\n\n/**\n * Validates that the Driver layer is compatible with the Loader.\n * @internal\n */\nexport function validateDriverCompatibility(\n\tmaybeDriverCompatDetails: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: ICriticalContainerError) => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"loader\",\n\t\t\"driver\",\n\t\tloaderCompatDetailsForRuntime,\n\t\tdriverSupportRequirementsForLoader,\n\t\tmaybeDriverCompatDetails,\n\t\tdisposeFn,\n\t\tlogger,\n\t);\n}\n"]}
1
+ {"version":3,"file":"loaderLayerCompatState.js","sourceRoot":"","sources":["../src/loaderLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EACN,0BAA0B,GAE1B,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC;;OAEG;IACH,UAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAwB;IACjE,GAAG,uBAAuB;IAC1B;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAoC;IACnF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAoC;IAClF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC3C,yBAA0D,EAC1D,MAA2B;IAE3B,0BAA0B,CACzB,QAAQ,EACR,SAAS,EACT,6BAA6B,EAC7B,mCAAmC,EACnC,yBAAyB,EACzB,GAAG,EAAE,GAAE,CAAC,CAAC,2DAA2D,EACpE,MAAM,CACN,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAC1C,wBAAyD,EACzD,SAAoD,EACpD,MAA2B;IAE3B,0BAA0B,CACzB,QAAQ,EACR,QAAQ,EACR,6BAA6B,EAC7B,kCAAkC,EAClC,wBAAwB,EACxB,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport {\n\tvalidateLayerCompatibility,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * The core compatibility details of the Loader layer that is the same across all layer boundaries.\n * @internal\n */\nexport const loaderCoreCompatDetails = {\n\t/**\n\t * The package version of the Loader layer.\n\t */\n\tpkgVersion,\n\t/**\n\t * The current generation of the Loader layer.\n\t */\n\tgeneration: 2,\n};\n\n/**\n * Loader's compatibility details that is exposed to the Runtime layer.\n * @internal\n */\nexport const loaderCompatDetailsForRuntime: ILayerCompatDetails = {\n\t...loaderCoreCompatDetails,\n\t/**\n\t * The features supported by the Loader layer across the Loader / Runtime boundary.\n\t */\n\tsupportedFeatures: new Set<string>(),\n};\n\n/**\n * The requirements that the Runtime layer must meet to be compatible with this Loader.\n * @internal\n */\nexport const runtimeSupportRequirementsForLoader: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Runtime must be at to be compatible with Loader. Note that 0 is used here for\n\t * Runtime layers before the introduction of the layer compatibility enforcement.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Runtime must support to be compatible with Loader.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * The requirements that the Driver layer must meet to be compatible with this Loader.\n * @internal\n */\nexport const driverSupportRequirementsForLoader: ILayerCompatSupportRequirements = {\n\t/**\n\t * Minimum generation that Driver must be at to be compatible with Loader. Note that 0 is used here for\n\t * Driver layers before the introduction of the layer compatibility enforcement.\n\t */\n\tminSupportedGeneration: 0,\n\t/**\n\t * The features that the Driver must support to be compatible with Loader.\n\t */\n\trequiredFeatures: [],\n};\n\n/**\n * Validates that the Runtime layer is compatible with the Loader. *\n * @internal\n */\nexport function validateRuntimeCompatibility(\n\tmaybeRuntimeCompatDetails: ILayerCompatDetails | undefined,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"loader\",\n\t\t\"runtime\",\n\t\tloaderCompatDetailsForRuntime,\n\t\truntimeSupportRequirementsForLoader,\n\t\tmaybeRuntimeCompatDetails,\n\t\t() => {} /* disposeFn - no op. This will be handled by the caller */,\n\t\tlogger,\n\t);\n}\n\n/**\n * Validates that the Driver layer is compatible with the Loader.\n * @internal\n */\nexport function validateDriverCompatibility(\n\tmaybeDriverCompatDetails: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: ICriticalContainerError) => void,\n\tlogger: ITelemetryLoggerExt,\n): void {\n\tvalidateLayerCompatibility(\n\t\t\"loader\",\n\t\t\"driver\",\n\t\tloaderCompatDetailsForRuntime,\n\t\tdriverSupportRequirementsForLoader,\n\t\tmaybeDriverCompatDetails,\n\t\tdisposeFn,\n\t\tlogger,\n\t);\n}\n"]}
@@ -18,7 +18,7 @@ export function tryInitializeMemoryDetachedBlobStorage(detachedStorage, attachme
18
18
  * It also provides methods for serialization and initialization with attachment blobs.
19
19
  * @returns A new `MemoryDetachedBlobStorage` instance.
20
20
  */
21
- // eslint-disable-next-line import/no-deprecated
21
+ // eslint-disable-next-line import-x/no-deprecated
22
22
  export function createMemoryDetachedBlobStorage() {
23
23
  const blobs = [];
24
24
  const storage = {
@@ -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,MAAM,qCAAqC,CAAC;AA8B7D,MAAM,UAAU,sCAAsC,CACrD,eAA0C,EAC1C,eAAuB;IAEvB,MAAM,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACjF,mEAAmE;IACnE,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACzD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAEjF,iEAAiE;IACjE,eAAe,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,gDAAgD;AAChD,MAAM,UAAU,+BAA+B;IAC9C,MAAM,KAAK,GAAsB,EAAE,CAAC;IACpC,MAAM,OAAO,GAA8B;QAC1C,UAAU,EAAE,KAAK,EAAE,IAAqB,EAAgC,EAAE,CAAC,CAAC;YAC3E,EAAE,EAAE,GAAG,KAAK,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,CACf,KAAK,CAAC,MAAM,GAAG,CAAC;YACf,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;YAC7D,CAAC,CAAC,SAAS;QACb,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,MAAM,CAAC,CAAC,CAAC;KACrF,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 } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tICreateBlobResponse,\n\tIDocumentStorageService,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * An interface used to manage blobs in memory for detached containers.\n *\n * @remarks\n * On attach of the container the blobs are read, and uploaded to the server.\n * The interface also supports serialization and initialization which is\n * used when serializing and rehydrating a detached container with blobs.\n */\nexport interface MemoryDetachedBlobStorage\n\textends Pick<IDocumentStorageService, \"createBlob\" | \"readBlob\"> {\n\tsize: number;\n\t/**\n\t * Return an array of all blob IDs present in storage\n\t */\n\tgetBlobIds(): string[];\n\n\t/**\n\t * After the container is attached, the detached blob storage is no longer needed and will be disposed.\n\t */\n\tdispose?(): void;\n\tinitialize(attachmentBlobs: string[]): void;\n\tserialize(): string | undefined;\n}\n\nexport function tryInitializeMemoryDetachedBlobStorage(\n\tdetachedStorage: MemoryDetachedBlobStorage,\n\tattachmentBlobs: string,\n): void {\n\tassert(detachedStorage.size === 0, 0x99e /* Blob storage already initialized */);\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\tconst maybeAttachmentBlobs = JSON.parse(attachmentBlobs);\n\tassert(Array.isArray(maybeAttachmentBlobs), 0x99f /* Invalid attachmentBlobs */);\n\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\tdetachedStorage.initialize(maybeAttachmentBlobs);\n}\n\n/**\n * Creates a new instance of `MemoryDetachedBlobStorage`.\n * The returned storage allows for creating, reading, and managing blobs in memory.\n * It also provides methods for serialization and initialization with attachment blobs.\n * @returns A new `MemoryDetachedBlobStorage` instance.\n */\n// eslint-disable-next-line import/no-deprecated\nexport function createMemoryDetachedBlobStorage(): MemoryDetachedBlobStorage {\n\tconst blobs: ArrayBufferLike[] = [];\n\tconst storage: MemoryDetachedBlobStorage = {\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: () =>\n\t\t\tblobs.length > 0\n\t\t\t\t? JSON.stringify(blobs.map((b) => bufferToString(b, \"utf8\")))\n\t\t\t\t: undefined,\n\t\tinitialize: (attachmentBlobs: string[]) =>\n\t\t\tblobs.push(...attachmentBlobs.map((maybeBlob) => stringToBuffer(maybeBlob, \"utf8\"))),\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,MAAM,qCAAqC,CAAC;AA8B7D,MAAM,UAAU,sCAAsC,CACrD,eAA0C,EAC1C,eAAuB;IAEvB,MAAM,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACjF,mEAAmE;IACnE,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACzD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAEjF,iEAAiE;IACjE,eAAe,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,kDAAkD;AAClD,MAAM,UAAU,+BAA+B;IAC9C,MAAM,KAAK,GAAsB,EAAE,CAAC;IACpC,MAAM,OAAO,GAA8B;QAC1C,UAAU,EAAE,KAAK,EAAE,IAAqB,EAAgC,EAAE,CAAC,CAAC;YAC3E,EAAE,EAAE,GAAG,KAAK,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,CACf,KAAK,CAAC,MAAM,GAAG,CAAC;YACf,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;YAC7D,CAAC,CAAC,SAAS;QACb,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,MAAM,CAAC,CAAC,CAAC;KACrF,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 } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tICreateBlobResponse,\n\tIDocumentStorageService,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * An interface used to manage blobs in memory for detached containers.\n *\n * @remarks\n * On attach of the container the blobs are read, and uploaded to the server.\n * The interface also supports serialization and initialization which is\n * used when serializing and rehydrating a detached container with blobs.\n */\nexport interface MemoryDetachedBlobStorage\n\textends Pick<IDocumentStorageService, \"createBlob\" | \"readBlob\"> {\n\tsize: number;\n\t/**\n\t * Return an array of all blob IDs present in storage\n\t */\n\tgetBlobIds(): string[];\n\n\t/**\n\t * After the container is attached, the detached blob storage is no longer needed and will be disposed.\n\t */\n\tdispose?(): void;\n\tinitialize(attachmentBlobs: string[]): void;\n\tserialize(): string | undefined;\n}\n\nexport function tryInitializeMemoryDetachedBlobStorage(\n\tdetachedStorage: MemoryDetachedBlobStorage,\n\tattachmentBlobs: string,\n): void {\n\tassert(detachedStorage.size === 0, 0x99e /* Blob storage already initialized */);\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\tconst maybeAttachmentBlobs = JSON.parse(attachmentBlobs);\n\tassert(Array.isArray(maybeAttachmentBlobs), 0x99f /* Invalid attachmentBlobs */);\n\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\tdetachedStorage.initialize(maybeAttachmentBlobs);\n}\n\n/**\n * Creates a new instance of `MemoryDetachedBlobStorage`.\n * The returned storage allows for creating, reading, and managing blobs in memory.\n * It also provides methods for serialization and initialization with attachment blobs.\n * @returns A new `MemoryDetachedBlobStorage` instance.\n */\n// eslint-disable-next-line import-x/no-deprecated\nexport function createMemoryDetachedBlobStorage(): MemoryDetachedBlobStorage {\n\tconst blobs: ArrayBufferLike[] = [];\n\tconst storage: MemoryDetachedBlobStorage = {\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: () =>\n\t\t\tblobs.length > 0\n\t\t\t\t? JSON.stringify(blobs.map((b) => bufferToString(b, \"utf8\")))\n\t\t\t\t: undefined,\n\t\tinitialize: (attachmentBlobs: string[]) =>\n\t\t\tblobs.push(...attachmentBlobs.map((maybeBlob) => stringToBuffer(maybeBlob, \"utf8\"))),\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.71.0";
8
+ export declare const pkgVersion = "2.73.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -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.71.0";
8
+ export const pkgVersion = "2.73.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,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/container-loader\";\nexport const pkgVersion = \"2.71.0\";\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,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/container-loader\";\nexport const pkgVersion = \"2.73.0\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-loader",
3
- "version": "2.71.0",
3
+ "version": "2.73.0",
4
4
  "description": "Fluid container loader",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -129,13 +129,13 @@
129
129
  "temp-directory": "nyc/.nyc_output"
130
130
  },
131
131
  "dependencies": {
132
- "@fluid-internal/client-utils": "~2.71.0",
133
- "@fluidframework/container-definitions": "~2.71.0",
134
- "@fluidframework/core-interfaces": "~2.71.0",
135
- "@fluidframework/core-utils": "~2.71.0",
136
- "@fluidframework/driver-definitions": "~2.71.0",
137
- "@fluidframework/driver-utils": "~2.71.0",
138
- "@fluidframework/telemetry-utils": "~2.71.0",
132
+ "@fluid-internal/client-utils": "~2.73.0",
133
+ "@fluidframework/container-definitions": "~2.73.0",
134
+ "@fluidframework/core-interfaces": "~2.73.0",
135
+ "@fluidframework/core-utils": "~2.73.0",
136
+ "@fluidframework/driver-definitions": "~2.73.0",
137
+ "@fluidframework/driver-utils": "~2.73.0",
138
+ "@fluidframework/telemetry-utils": "~2.73.0",
139
139
  "@types/events_pkg": "npm:@types/events@^3.0.0",
140
140
  "@ungap/structured-clone": "^1.2.0",
141
141
  "debug": "^4.3.4",
@@ -146,14 +146,14 @@
146
146
  "devDependencies": {
147
147
  "@arethetypeswrong/cli": "^0.17.1",
148
148
  "@biomejs/biome": "~1.9.3",
149
- "@fluid-internal/client-utils": "~2.71.0",
150
- "@fluid-internal/mocha-test-setup": "~2.71.0",
151
- "@fluid-private/test-loader-utils": "~2.71.0",
152
- "@fluid-tools/build-cli": "^0.58.3",
149
+ "@fluid-internal/client-utils": "~2.73.0",
150
+ "@fluid-internal/mocha-test-setup": "~2.73.0",
151
+ "@fluid-private/test-loader-utils": "~2.73.0",
152
+ "@fluid-tools/build-cli": "^0.60.0",
153
153
  "@fluidframework/build-common": "^2.0.3",
154
- "@fluidframework/build-tools": "^0.58.3",
155
- "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.70.0",
156
- "@fluidframework/eslint-config-fluid": "^7.0.0",
154
+ "@fluidframework/build-tools": "^0.60.0",
155
+ "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.71.0",
156
+ "@fluidframework/eslint-config-fluid": "~2.73.0",
157
157
  "@microsoft/api-extractor": "7.52.11",
158
158
  "@types/debug": "^4.1.5",
159
159
  "@types/double-ended-queue": "^2.1.0",
@@ -186,12 +186,6 @@ export class ConnectionManager implements IConnectionManager {
186
186
 
187
187
  private connectFirstConnection = true;
188
188
 
189
- /**
190
- * Tracks the initial connection start time for the entire lifetime of the class.
191
- * This is used only for retryConnectionTimeoutMs checks and is never reset.
192
- */
193
- private initialConnectionStartTime: number | undefined;
194
-
195
189
  private _connectionVerboseProps: Record<string, string | number> = {};
196
190
 
197
191
  private _connectionProps: ITelemetryBaseProperties = {};
@@ -350,7 +344,6 @@ export class ConnectionManager implements IConnectionManager {
350
344
  reconnectAllowed: boolean,
351
345
  private readonly logger: ITelemetryLoggerExt,
352
346
  private readonly props: IConnectionManagerFactoryArgs,
353
- private readonly retryConnectionTimeoutMs?: number,
354
347
  ) {
355
348
  this.clientDetails = this.client.details;
356
349
  this.defaultReconnectionMode = this.client.mode;
@@ -517,11 +510,9 @@ export class ConnectionManager implements IConnectionManager {
517
510
 
518
511
  this.props.establishConnectionHandler(reason);
519
512
 
520
- let connection: IDocumentDeltaConnection | undefined;
521
-
522
513
  if (docService.policies?.storageOnly === true) {
523
- connection = new FrozenDeltaStream();
524
- this.setupNewSuccessfulConnection(connection, "read", reason);
514
+ const frozenDeltaStreamConnection = new FrozenDeltaStream();
515
+ this.setupNewSuccessfulConnection(frozenDeltaStreamConnection, "read", reason);
525
516
  assert(this.pendingConnection === undefined, 0x2b3 /* "logic error" */);
526
517
  return;
527
518
  }
@@ -530,11 +521,6 @@ export class ConnectionManager implements IConnectionManager {
530
521
  let connectRepeatCount = 0;
531
522
  const connectStartTime = performanceNow();
532
523
 
533
- // Set the initial connection start time only once for the entire lifetime of the class
534
- if (this.initialConnectionStartTime === undefined) {
535
- this.initialConnectionStartTime = connectStartTime;
536
- }
537
-
538
524
  let lastError: unknown;
539
525
 
540
526
  const abortController = new AbortController();
@@ -547,6 +533,7 @@ export class ConnectionManager implements IConnectionManager {
547
533
  };
548
534
 
549
535
  // This loop will keep trying to connect until successful, with a delay between each iteration.
536
+ let connection: IDocumentDeltaConnection | undefined;
550
537
  while (connection === undefined) {
551
538
  if (this._disposed) {
552
539
  throw new Error("Attempting to connect a closed DeltaManager");
@@ -655,31 +642,6 @@ export class ConnectionManager implements IConnectionManager {
655
642
  this.props.reconnectionDelayHandler(delayMs, origError);
656
643
  }
657
644
 
658
- // Check if the calculated delay would exceed the remaining timeout with a conservative buffer
659
- if (this.retryConnectionTimeoutMs !== undefined) {
660
- const elapsedTime = performanceNow() - this.initialConnectionStartTime;
661
- const remainingTime = this.retryConnectionTimeoutMs - elapsedTime;
662
- const connectionAttemptDuration = performanceNow() - connectStartTime;
663
-
664
- // Use a 75% buffer to be conservative about timeout usage
665
- const timeoutBufferThreshold = remainingTime * 0.75;
666
- // Estimate the next attempt time as the delay plus the time it took to connect
667
- const estimatedNextAttemptTime = delayMs + connectionAttemptDuration;
668
-
669
- if (estimatedNextAttemptTime >= timeoutBufferThreshold) {
670
- this.logger.sendTelemetryEvent({
671
- eventName: "RetryDelayExceedsConnectionTimeout",
672
- attempts: connectRepeatCount,
673
- duration: formatTick(elapsedTime),
674
- calculatedDelayMs: delayMs,
675
- remainingTimeMs: remainingTime,
676
- timeoutMs: this.retryConnectionTimeoutMs,
677
- });
678
- // Throw the error immediately since the estimated time for delay + next connection attempt would exceed our conservative timeout buffer
679
- throw normalizeError(origError, { props: fatalConnectErrorProp });
680
- }
681
- }
682
-
683
645
  await new Promise<void>((resolve) => {
684
646
  setTimeout(resolve, delayMs);
685
647
  });
package/src/container.ts CHANGED
@@ -126,6 +126,7 @@ import {
126
126
  getPackageName,
127
127
  } from "./contracts.js";
128
128
  import { DeltaManager, type IConnectionArgs } from "./deltaManager.js";
129
+ import type { ILoaderServices } from "./loader.js";
129
130
  import { RelativeLoader } from "./loader.js";
130
131
  import {
131
132
  validateDriverCompatibility,
@@ -142,7 +143,6 @@ import type { IQuorumSnapshot } from "./protocol/index.js";
142
143
  import {
143
144
  type InternalProtocolHandlerBuilder,
144
145
  ProtocolHandler,
145
- type ProtocolHandlerBuilder,
146
146
  type ProtocolHandlerInternal,
147
147
  protocolHandlerShouldProcessSignal,
148
148
  wrapProtocolHandlerBuilder,
@@ -173,6 +173,7 @@ const savedContainerEvent = "saved";
173
173
  const packageNotFactoryError = "Code package does not implement IRuntimeFactory";
174
174
 
175
175
  /**
176
+ * @remarks Export for testing only
176
177
  * @internal
177
178
  */
178
179
  export interface IContainerLoadProps {
@@ -196,9 +197,10 @@ export interface IContainerLoadProps {
196
197
  }
197
198
 
198
199
  /**
200
+ * @remarks Export for testing only
199
201
  * @internal
200
202
  */
201
- export interface IContainerCreateProps {
203
+ export interface IContainerCreateProps extends ILoaderServices {
202
204
  /**
203
205
  * Disables the Container from reconnecting if false, allows reconnect otherwise.
204
206
  */
@@ -207,57 +209,6 @@ export interface IContainerCreateProps {
207
209
  * Client details provided in the override will be merged over the default client.
208
210
  */
209
211
  readonly clientDetailsOverride?: IClientDetails;
210
-
211
- /**
212
- * The url resolver used by the loader for resolving external urls
213
- * into Fluid urls such that the container specified by the
214
- * external url can be loaded.
215
- */
216
- readonly urlResolver: IUrlResolver;
217
- /**
218
- * The document service factory take the Fluid url provided
219
- * by the resolved url and constructs all the necessary services
220
- * for communication with the container's server.
221
- */
222
- readonly documentServiceFactory: IDocumentServiceFactory;
223
- /**
224
- * The code loader handles loading the necessary code
225
- * for running a container once it is loaded.
226
- */
227
- readonly codeLoader: ICodeDetailsLoader;
228
-
229
- /**
230
- * A property bag of options used by various layers
231
- * to control features
232
- */
233
- readonly options: ILoaderOptions;
234
-
235
- /**
236
- * Scope is provided to all container and is a set of shared
237
- * services for container's to integrate with their host environment.
238
- */
239
- readonly scope: FluidObject;
240
-
241
- /**
242
- * The logger downstream consumers should construct their loggers from
243
- */
244
- readonly subLogger: ITelemetryLoggerExt;
245
-
246
- /**
247
- * Optional property for allowing the container to use a custom
248
- * protocol implementation for handling the quorum and/or the audience.
249
- */
250
- readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
251
-
252
- /**
253
- * Optional property for specifying a timeout for retry connection loop.
254
- *
255
- * If provided, container will use this value as the maximum time to wait
256
- * for a successful connection before giving up throwing the most recent error.
257
- *
258
- * If not provided, default behavior will be to retry until non-retryable error occurs.
259
- */
260
- readonly retryConnectionTimeoutMs?: number;
261
212
  }
262
213
 
263
214
  /**
@@ -627,7 +578,6 @@ export class Container
627
578
  private attachmentData: AttachmentData = { state: AttachState.Detached };
628
579
  private readonly serializedStateManager: SerializedStateManager;
629
580
  private readonly _containerId: string;
630
- private readonly _retryConnectionTimeoutMs: number | undefined;
631
581
 
632
582
  private lastVisible: number | undefined;
633
583
  private readonly visibilityEventHandler: (() => void) | undefined;
@@ -810,7 +760,6 @@ export class Container
810
760
  scope,
811
761
  subLogger,
812
762
  protocolHandlerBuilder,
813
- retryConnectionTimeoutMs,
814
763
  } = createProps;
815
764
 
816
765
  // Validate that the Driver is compatible with this Loader.
@@ -826,7 +775,6 @@ export class Container
826
775
  const pendingLocalState = loadProps?.pendingLocalState;
827
776
 
828
777
  this._canReconnect = canReconnect ?? true;
829
- this._retryConnectionTimeoutMs = retryConnectionTimeoutMs;
830
778
  this.clientDetailsOverride = clientDetailsOverride;
831
779
  this.urlResolver = urlResolver;
832
780
  this.serviceFactory = documentServiceFactory;
@@ -2067,7 +2015,6 @@ export class Container
2067
2015
  this._canReconnect,
2068
2016
  createChildLogger({ logger: this.subLogger, namespace: "ConnectionManager" }),
2069
2017
  props,
2070
- this._retryConnectionTimeoutMs,
2071
2018
  ),
2072
2019
  );
2073
2020
 
@@ -27,7 +27,7 @@ export const loaderCoreCompatDetails = {
27
27
  /**
28
28
  * The current generation of the Loader layer.
29
29
  */
30
- generation: 1,
30
+ generation: 2,
31
31
  };
32
32
 
33
33
  /**
@@ -53,7 +53,7 @@ export function tryInitializeMemoryDetachedBlobStorage(
53
53
  * It also provides methods for serialization and initialization with attachment blobs.
54
54
  * @returns A new `MemoryDetachedBlobStorage` instance.
55
55
  */
56
- // eslint-disable-next-line import/no-deprecated
56
+ // eslint-disable-next-line import-x/no-deprecated
57
57
  export function createMemoryDetachedBlobStorage(): MemoryDetachedBlobStorage {
58
58
  const blobs: ArrayBufferLike[] = [];
59
59
  const storage: MemoryDetachedBlobStorage = {
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "2.71.0";
9
+ export const pkgVersion = "2.73.0";