@fluidframework/container-loader 2.33.2 → 2.40.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 +15 -0
- package/api-report/container-loader.legacy.alpha.api.md +0 -10
- package/dist/attachment.d.ts +2 -2
- package/dist/attachment.d.ts.map +1 -1
- package/dist/attachment.js.map +1 -1
- package/dist/container.d.ts +1 -14
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +4 -16
- package/dist/container.js.map +1 -1
- package/dist/containerStorageAdapter.d.ts +2 -2
- package/dist/containerStorageAdapter.d.ts.map +1 -1
- package/dist/containerStorageAdapter.js +2 -7
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +0 -1
- package/dist/loader.d.ts +1 -29
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +1 -2
- package/dist/loader.js.map +1 -1
- package/dist/memoryBlobStorage.d.ts +30 -4
- package/dist/memoryBlobStorage.d.ts.map +1 -1
- package/dist/memoryBlobStorage.js +11 -28
- package/dist/memoryBlobStorage.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/attachment.d.ts +2 -2
- package/lib/attachment.d.ts.map +1 -1
- package/lib/attachment.js.map +1 -1
- package/lib/container.d.ts +1 -14
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +5 -17
- package/lib/container.js.map +1 -1
- package/lib/containerStorageAdapter.d.ts +2 -2
- package/lib/containerStorageAdapter.d.ts.map +1 -1
- package/lib/containerStorageAdapter.js +2 -7
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +0 -1
- package/lib/loader.d.ts +1 -29
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.js +1 -2
- package/lib/loader.js.map +1 -1
- package/lib/memoryBlobStorage.d.ts +30 -4
- package/lib/memoryBlobStorage.d.ts.map +1 -1
- package/lib/memoryBlobStorage.js +11 -27
- package/lib/memoryBlobStorage.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +17 -12
- package/src/attachment.ts +2 -4
- package/src/container.ts +8 -29
- package/src/containerStorageAdapter.ts +4 -8
- package/src/index.ts +0 -1
- package/src/loader.ts +0 -35
- package/src/memoryBlobStorage.ts +36 -45
- package/src/packageVersion.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @fluidframework/container-loader
|
|
2
2
|
|
|
3
|
+
## 2.40.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- IDetachedBlobStorage (deprecated) has been removed from Loader ([#24490](https://github.com/microsoft/FluidFramework/pull/24490)) [ef47644da8](https://github.com/microsoft/FluidFramework/commit/ef47644da889d13b81c7233c3afe8600eaa1600f)
|
|
8
|
+
|
|
9
|
+
It is no longer necessary or supported to provide `detachedBlobStorage` to the Loader.
|
|
10
|
+
This functionality is now provided by default, and the deprecated `IDetachedBlobStorage` has been removed.
|
|
11
|
+
|
|
12
|
+
- IContainer.getContainerPackageInfo has been removed ([#24525](https://github.com/microsoft/FluidFramework/pull/24525)) [15a541265b](https://github.com/microsoft/FluidFramework/commit/15a541265ba6293bf24e95308a5e667d5f7e9794)
|
|
13
|
+
|
|
14
|
+
`IContainer.getContainerPackageInfo()` was set to be removed in release 2.40.0. To access the package name `getContainerPackageInfo()` provided, use `IFluidCodeDetails.package` returned by `IContainer.getLoadedCodeDetails()`.
|
|
15
|
+
|
|
16
|
+
See [issue #23898](https://github.com/microsoft/FluidFramework/issues/23898) for more information.
|
|
17
|
+
|
|
3
18
|
## 2.33.0
|
|
4
19
|
|
|
5
20
|
Dependency updates only.
|
|
@@ -57,13 +57,6 @@ export interface ICreateDetachedContainerProps extends ICreateAndLoadContainerPr
|
|
|
57
57
|
readonly codeDetails: IFluidCodeDetails;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// @alpha @deprecated @legacy
|
|
61
|
-
export type IDetachedBlobStorage = Pick<IDocumentStorageService, "createBlob" | "readBlob"> & {
|
|
62
|
-
size: number;
|
|
63
|
-
getBlobIds(): string[];
|
|
64
|
-
dispose?(): void;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
60
|
// @alpha @deprecated @legacy (undocumented)
|
|
68
61
|
export interface IFluidModuleWithDetails {
|
|
69
62
|
details: IFluidCodeDetails;
|
|
@@ -74,7 +67,6 @@ export interface IFluidModuleWithDetails {
|
|
|
74
67
|
export interface ILoaderProps {
|
|
75
68
|
readonly codeLoader: ICodeDetailsLoader;
|
|
76
69
|
readonly configProvider?: IConfigProviderBase;
|
|
77
|
-
readonly detachedBlobStorage?: IDetachedBlobStorage;
|
|
78
70
|
readonly documentServiceFactory: IDocumentServiceFactory;
|
|
79
71
|
readonly logger?: ITelemetryBaseLogger;
|
|
80
72
|
readonly options?: ILoaderOptions;
|
|
@@ -86,8 +78,6 @@ export interface ILoaderProps {
|
|
|
86
78
|
// @alpha @legacy
|
|
87
79
|
export interface ILoaderServices {
|
|
88
80
|
readonly codeLoader: ICodeDetailsLoader;
|
|
89
|
-
// @deprecated
|
|
90
|
-
readonly detachedBlobStorage?: IDetachedBlobStorage;
|
|
91
81
|
readonly documentServiceFactory: IDocumentServiceFactory;
|
|
92
82
|
readonly options: ILoaderOptions;
|
|
93
83
|
readonly protocolHandlerBuilder?: ProtocolHandlerBuilder;
|
package/dist/attachment.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { AttachState } from "@fluidframework/container-definitions";
|
|
|
6
6
|
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
7
7
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions/internal";
|
|
8
8
|
import { CombinedAppAndProtocolSummary } from "@fluidframework/driver-utils/internal";
|
|
9
|
-
import {
|
|
9
|
+
import type { MemoryDetachedBlobStorage } from "./memoryBlobStorage.js";
|
|
10
10
|
import type { SnapshotWithBlobs } from "./serializedStateManager.js";
|
|
11
11
|
/**
|
|
12
12
|
* The default state a newly created detached container will have.
|
|
@@ -90,7 +90,7 @@ export interface AttachProcessProps {
|
|
|
90
90
|
/**
|
|
91
91
|
* The detached blob storage if it exists.
|
|
92
92
|
*/
|
|
93
|
-
readonly detachedBlobStorage?: Pick<
|
|
93
|
+
readonly detachedBlobStorage?: Pick<MemoryDetachedBlobStorage, "getBlobIds" | "readBlob" | "size">;
|
|
94
94
|
/**
|
|
95
95
|
* The caller should create the attachment summary for the container.
|
|
96
96
|
* @param redirectTable - Maps local blob ids to remote blobs ids.
|
package/dist/attachment.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../src/attachment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../src/attachment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAEtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,w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,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;YACpC,CAAC;QACF,CAAC;QACD,iBAAiB,CAChB,CAAC,WAAW,GAAG;YACd,KAAK,EAAE,mCAAW,CAAC,SAAS;YAC5B,OAAO,EAAE,uBAAuB,CAAC,aAAa,CAAC;YAC/C,KAAK,EAAE,MAAM;SACb,CAAC,CACF,CAAC;IACH,CAAC;IAED,IAAA,iBAAM,EACL,WAAW,CAAC,KAAK,KAAK,mCAAW,CAAC,SAAS,EAC3C,KAAK,CAAC,qCAAqC,CAC3C,CAAC;IAEF,IAAI,WAAW,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;QAClC,8CAA8C;QAC9C,kEAAkE;QAClE,2CAA2C;QAC3C,MAAM,OAAO,CAAC,wBAAwB,CAAC,WAAW,CAAC,OAAO,EAAE;YAC3D,uBAAuB,EAAE,CAAC;YAC1B,SAAS,EAAE,SAAS;YACpB,cAAc,EAAE,SAAS;SACzB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAkC,kBAAkB;QACjE,CAAC,CAAC,IAAA,yDAA8C,EAAC,WAAW,CAAC,OAAO,CAAC;QACrE,CAAC,CAAC,SAAS,CAAC;IAEb,iBAAiB,CAChB,CAAC,WAAW,GAAG;QACd,KAAK,EAAE,mCAAW,CAAC,QAAQ;KAC3B,CAAC,CACF,CAAC;IACF,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AArFW,QAAA,yBAAyB,6BAqFpC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions/internal\";\nimport { CombinedAppAndProtocolSummary } from \"@fluidframework/driver-utils/internal\";\n\n// eslint-disable-next-line import/no-deprecated\nimport { IDetachedBlobStorage } from \"./loader.js\";\nimport type { SnapshotWithBlobs } from \"./serializedStateManager.js\";\nimport { getSnapshotTreeAndBlobsFromSerializedContainer } from \"./utils.js\";\n\n/**\n * The default state a newly created detached container will have.\n * All but the state are optional and undefined, they just exist\n * to make the union easy to deal with for both Detached types\n */\nexport interface DetachedDefaultData {\n\treadonly state: AttachState.Detached;\n\treadonly blobs?: undefined;\n\treadonly summary?: undefined;\n\treadonly redirectTable?: undefined;\n}\n\n/**\n * This always follows DetachedDefaultData when there are\n * outstanding blobs in the detached blob storage.\n * The redirect table will get filled up to include data\n * about the blobs as they are uploaded.\n */\nexport interface DetachedDataWithOutstandingBlobs {\n\treadonly state: AttachState.Detached;\n\treadonly blobs: \"outstanding\";\n\treadonly summary?: undefined;\n\treadonly redirectTable: Map<string, string>;\n}\n\n/**\n * This state always follows DetachedDataWithOutstandingBlobs.\n * It signals that all outstanding blobs are done being uploaded,\n * so the container can move to the attaching state.\n */\nexport interface AttachingDataWithBlobs {\n\treadonly state: AttachState.Attaching;\n\treadonly blobs: \"done\";\n\treadonly summary: CombinedAppAndProtocolSummary;\n}\n\n/**\n * This always follows DefaultDetachedState when there are\n * no blobs in the detached blob storage. Because there are\n * no blobs we can immediately get the summary and transition\n * to the attaching state.\n */\nexport interface AttachingDataWithoutBlobs {\n\treadonly state: AttachState.Attaching;\n\treadonly summary: CombinedAppAndProtocolSummary;\n\treadonly blobs: \"none\";\n}\n\n/**\n * The final attachment state which signals the container is fully attached.\n * The baseSnapshotAndBlobs will only be enabled when offline load is enabled.\n */\nexport interface AttachedData {\n\treadonly state: AttachState.Attached;\n}\n\n/**\n * A union of all the attachment data types for\n * tracking across all container attachment states\n */\nexport type AttachmentData =\n\t| DetachedDefaultData\n\t| DetachedDataWithOutstandingBlobs\n\t| AttachingDataWithoutBlobs\n\t| AttachingDataWithBlobs\n\t| AttachedData;\n\n/**\n * The data and services necessary for runRetriableAttachProcess.\n */\nexport interface AttachProcessProps {\n\t/**\n\t * The initial attachment data this call should start with\n\t */\n\treadonly initialAttachmentData: Exclude<AttachmentData, AttachedData>;\n\n\t/**\n\t * The caller should use this callback to keep track of the current\n\t * attachment data, and perform any other operations necessary\n\t * for dealing with attachment state changes, like emitting events\n\t *\n\t * @param attachmentData - the updated attachment data\n\t */\n\treadonly setAttachmentData: (attachmentData: AttachmentData) => void;\n\n\t/**\n\t * The caller should create and or get services based on the data, and its own information.\n\t * @param data - the data to create services from,\n\t * the summary property being the most relevant part of the data.\n\t * @returns A compatible storage service\n\t */\n\treadonly createOrGetStorageService: (\n\t\tdata: ISummaryTree | undefined,\n\t) => Promise<Pick<IDocumentStorageService, \"createBlob\" | \"uploadSummaryWithContext\">>;\n\n\t/**\n\t * The detached blob storage if it exists.\n\t */\n\treadonly detachedBlobStorage?: Pick<\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tIDetachedBlobStorage,\n\t\t\"getBlobIds\" | \"readBlob\" | \"size\"\n\t>;\n\n\t/**\n\t * The caller should create the attachment summary for the container.\n\t * @param redirectTable - Maps local blob ids to remote blobs ids.\n\t * @returns The attachment summary for the container.\n\t */\n\treadonly createAttachmentSummary: (\n\t\tredirectTable?: Map<string, string>,\n\t) => CombinedAppAndProtocolSummary;\n\n\t/**\n\t * Whether offline load is enabled or not.\n\t */\n\treadonly offlineLoadEnabled: boolean;\n}\n\n/**\n * Executes the attach process state machine based on the provided data and services.\n * This method is retriable on failure. Based on the provided initialAttachmentData\n * this method will resume the attachment process and attempt to complete it.\n *\n * @param AttachProcessProps - The data and services necessary to run the attachment process\n * @returns - The attach summary (only if offline load is enabled), or undefined\n */\nexport const runRetriableAttachProcess = async ({\n\tdetachedBlobStorage,\n\tcreateOrGetStorageService,\n\tsetAttachmentData,\n\tcreateAttachmentSummary,\n\tofflineLoadEnabled,\n\tinitialAttachmentData,\n}: AttachProcessProps): Promise<SnapshotWithBlobs | undefined> => {\n\tlet currentData: AttachmentData = initialAttachmentData;\n\n\tif (currentData.blobs === undefined) {\n\t\t// If attachment blobs were uploaded in detached state we will go through a different attach flow\n\t\tconst outstandingAttachmentBlobs =\n\t\t\tdetachedBlobStorage !== undefined && detachedBlobStorage.size > 0;\n\t\t// Determine the next phase of attaching which depends on if there are attachment blobs\n\t\t// if there are, we will stay detached, so an empty file can be created, and the blobs\n\t\t// uploaded, otherwise we will get the summary to create the file with and move to attaching\n\t\tcurrentData = outstandingAttachmentBlobs\n\t\t\t? {\n\t\t\t\t\tstate: AttachState.Detached,\n\t\t\t\t\tblobs: \"outstanding\",\n\t\t\t\t\tredirectTable: new Map<string, string>(),\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tstate: AttachState.Attaching,\n\t\t\t\t\tsummary: createAttachmentSummary(),\n\t\t\t\t\tblobs: \"none\",\n\t\t\t\t};\n\t\tsetAttachmentData(currentData);\n\t}\n\n\t// this has to run here, as it is what creates the file\n\t// and we need to file for all possible cases after this point\n\tconst storage = await createOrGetStorageService(currentData.summary);\n\n\tif (currentData.blobs === \"outstanding\") {\n\t\tconst { redirectTable } = currentData;\n\t\t// upload blobs to storage\n\t\tassert(!!detachedBlobStorage, 0x24e /* \"assertion for type narrowing\" */);\n\n\t\t// build a table mapping IDs assigned locally to IDs assigned by storage and pass it to runtime to\n\t\t// support blob handles that only know about the local IDs\n\t\twhile (redirectTable.size < detachedBlobStorage.size) {\n\t\t\tconst newIds = detachedBlobStorage.getBlobIds().filter((id) => !redirectTable.has(id));\n\t\t\tfor (const id of newIds) {\n\t\t\t\tconst blob = await detachedBlobStorage.readBlob(id);\n\t\t\t\tconst response = await storage.createBlob(blob);\n\t\t\t\tredirectTable.set(id, response.id);\n\t\t\t}\n\t\t}\n\t\tsetAttachmentData(\n\t\t\t(currentData = {\n\t\t\t\tstate: AttachState.Attaching,\n\t\t\t\tsummary: createAttachmentSummary(redirectTable),\n\t\t\t\tblobs: \"done\",\n\t\t\t}),\n\t\t);\n\t}\n\n\tassert(\n\t\tcurrentData.state === AttachState.Attaching,\n\t\t0x8e2 /* must be attaching by this point */,\n\t);\n\n\tif (currentData.blobs === \"done\") {\n\t\t// done means outstanding blobs were uploaded.\n\t\t// in that case an empty file was created, the blobs were uploaded\n\t\t// and now this finally uploads the summary\n\t\tawait storage.uploadSummaryWithContext(currentData.summary, {\n\t\t\treferenceSequenceNumber: 0,\n\t\t\tackHandle: undefined,\n\t\t\tproposalHandle: undefined,\n\t\t});\n\t}\n\n\tconst snapshot: SnapshotWithBlobs | undefined = offlineLoadEnabled\n\t\t? getSnapshotTreeAndBlobsFromSerializedContainer(currentData.summary)\n\t\t: undefined;\n\n\tsetAttachmentData(\n\t\t(currentData = {\n\t\t\tstate: AttachState.Attached,\n\t\t}),\n\t);\n\treturn snapshot;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"attachment.js","sourceRoot":"","sources":["../src/attachment.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iFAAoE;AACpE,kEAA6D;AAO7D,yCAA4E;AAwH5E;;;;;;;GAOG;AACI,MAAM,yBAAyB,GAAG,KAAK,EAAE,EAC/C,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,GACD,EAA0C,EAAE;IAChE,IAAI,WAAW,GAAmB,qBAAqB,CAAC;IAExD,IAAI,WAAW,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACrC,iGAAiG;QACjG,MAAM,0BAA0B,GAC/B,mBAAmB,KAAK,SAAS,IAAI,mBAAmB,CAAC,IAAI,GAAG,CAAC,CAAC;QACnE,uFAAuF;QACvF,sFAAsF;QACtF,4FAA4F;QAC5F,WAAW,GAAG,0BAA0B;YACvC,CAAC,CAAC;gBACA,KAAK,EAAE,mCAAW,CAAC,QAAQ;gBAC3B,KAAK,EAAE,aAAa;gBACpB,aAAa,EAAE,IAAI,GAAG,EAAkB;aACxC;YACF,CAAC,CAAC;gBACA,KAAK,EAAE,mCAAW,CAAC,SAAS;gBAC5B,OAAO,E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CAC3C,CAAC;IAEF,IAAI,WAAW,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;QAClC,8CAA8C;QAC9C,kEAAkE;QAClE,2CAA2C;QAC3C,MAAM,OAAO,CAAC,wBAAwB,CAAC,WAAW,CAAC,OAAO,EAAE;YAC3D,uBAAuB,EAAE,CAAC;YAC1B,SAAS,EAAE,SAAS;YACpB,cAAc,EAAE,SAAS;SACzB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAkC,kBAAkB;QACjE,CAAC,CAAC,IAAA,yDAA8C,EAAC,WAAW,CAAC,OAAO,CAAC;QACrE,CAAC,CAAC,SAAS,CAAC;IAEb,iBAAiB,CAChB,CAAC,WAAW,GAAG;QACd,KAAK,EAAE,mCAAW,CAAC,QAAQ;KAC3B,CAAC,CACF,CAAC;IACF,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AArFW,QAAA,yBAAyB,6BAqFpC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions/internal\";\nimport { CombinedAppAndProtocolSummary } from \"@fluidframework/driver-utils/internal\";\n\nimport type { MemoryDetachedBlobStorage } from \"./memoryBlobStorage.js\";\nimport type { SnapshotWithBlobs } from \"./serializedStateManager.js\";\nimport { getSnapshotTreeAndBlobsFromSerializedContainer } from \"./utils.js\";\n\n/**\n * The default state a newly created detached container will have.\n * All but the state are optional and undefined, they just exist\n * to make the union easy to deal with for both Detached types\n */\nexport interface DetachedDefaultData {\n\treadonly state: AttachState.Detached;\n\treadonly blobs?: undefined;\n\treadonly summary?: undefined;\n\treadonly redirectTable?: undefined;\n}\n\n/**\n * This always follows DetachedDefaultData when there are\n * outstanding blobs in the detached blob storage.\n * The redirect table will get filled up to include data\n * about the blobs as they are uploaded.\n */\nexport interface DetachedDataWithOutstandingBlobs {\n\treadonly state: AttachState.Detached;\n\treadonly blobs: \"outstanding\";\n\treadonly summary?: undefined;\n\treadonly redirectTable: Map<string, string>;\n}\n\n/**\n * This state always follows DetachedDataWithOutstandingBlobs.\n * It signals that all outstanding blobs are done being uploaded,\n * so the container can move to the attaching state.\n */\nexport interface AttachingDataWithBlobs {\n\treadonly state: AttachState.Attaching;\n\treadonly blobs: \"done\";\n\treadonly summary: CombinedAppAndProtocolSummary;\n}\n\n/**\n * This always follows DefaultDetachedState when there are\n * no blobs in the detached blob storage. Because there are\n * no blobs we can immediately get the summary and transition\n * to the attaching state.\n */\nexport interface AttachingDataWithoutBlobs {\n\treadonly state: AttachState.Attaching;\n\treadonly summary: CombinedAppAndProtocolSummary;\n\treadonly blobs: \"none\";\n}\n\n/**\n * The final attachment state which signals the container is fully attached.\n * The baseSnapshotAndBlobs will only be enabled when offline load is enabled.\n */\nexport interface AttachedData {\n\treadonly state: AttachState.Attached;\n}\n\n/**\n * A union of all the attachment data types for\n * tracking across all container attachment states\n */\nexport type AttachmentData =\n\t| DetachedDefaultData\n\t| DetachedDataWithOutstandingBlobs\n\t| AttachingDataWithoutBlobs\n\t| AttachingDataWithBlobs\n\t| AttachedData;\n\n/**\n * The data and services necessary for runRetriableAttachProcess.\n */\nexport interface AttachProcessProps {\n\t/**\n\t * The initial attachment data this call should start with\n\t */\n\treadonly initialAttachmentData: Exclude<AttachmentData, AttachedData>;\n\n\t/**\n\t * The caller should use this callback to keep track of the current\n\t * attachment data, and perform any other operations necessary\n\t * for dealing with attachment state changes, like emitting events\n\t *\n\t * @param attachmentData - the updated attachment data\n\t */\n\treadonly setAttachmentData: (attachmentData: AttachmentData) => void;\n\n\t/**\n\t * The caller should create and or get services based on the data, and its own information.\n\t * @param data - the data to create services from,\n\t * the summary property being the most relevant part of the data.\n\t * @returns A compatible storage service\n\t */\n\treadonly createOrGetStorageService: (\n\t\tdata: ISummaryTree | undefined,\n\t) => Promise<Pick<IDocumentStorageService, \"createBlob\" | \"uploadSummaryWithContext\">>;\n\n\t/**\n\t * The detached blob storage if it exists.\n\t */\n\treadonly detachedBlobStorage?: Pick<\n\t\tMemoryDetachedBlobStorage,\n\t\t\"getBlobIds\" | \"readBlob\" | \"size\"\n\t>;\n\n\t/**\n\t * The caller should create the attachment summary for the container.\n\t * @param redirectTable - Maps local blob ids to remote blobs ids.\n\t * @returns The attachment summary for the container.\n\t */\n\treadonly createAttachmentSummary: (\n\t\tredirectTable?: Map<string, string>,\n\t) => CombinedAppAndProtocolSummary;\n\n\t/**\n\t * Whether offline load is enabled or not.\n\t */\n\treadonly offlineLoadEnabled: boolean;\n}\n\n/**\n * Executes the attach process state machine based on the provided data and services.\n * This method is retriable on failure. Based on the provided initialAttachmentData\n * this method will resume the attachment process and attempt to complete it.\n *\n * @param AttachProcessProps - The data and services necessary to run the attachment process\n * @returns - The attach summary (only if offline load is enabled), or undefined\n */\nexport const runRetriableAttachProcess = async ({\n\tdetachedBlobStorage,\n\tcreateOrGetStorageService,\n\tsetAttachmentData,\n\tcreateAttachmentSummary,\n\tofflineLoadEnabled,\n\tinitialAttachmentData,\n}: AttachProcessProps): Promise<SnapshotWithBlobs | undefined> => {\n\tlet currentData: AttachmentData = initialAttachmentData;\n\n\tif (currentData.blobs === undefined) {\n\t\t// If attachment blobs were uploaded in detached state we will go through a different attach flow\n\t\tconst outstandingAttachmentBlobs =\n\t\t\tdetachedBlobStorage !== undefined && detachedBlobStorage.size > 0;\n\t\t// Determine the next phase of attaching which depends on if there are attachment blobs\n\t\t// if there are, we will stay detached, so an empty file can be created, and the blobs\n\t\t// uploaded, otherwise we will get the summary to create the file with and move to attaching\n\t\tcurrentData = outstandingAttachmentBlobs\n\t\t\t? {\n\t\t\t\t\tstate: AttachState.Detached,\n\t\t\t\t\tblobs: \"outstanding\",\n\t\t\t\t\tredirectTable: new Map<string, string>(),\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tstate: AttachState.Attaching,\n\t\t\t\t\tsummary: createAttachmentSummary(),\n\t\t\t\t\tblobs: \"none\",\n\t\t\t\t};\n\t\tsetAttachmentData(currentData);\n\t}\n\n\t// this has to run here, as it is what creates the file\n\t// and we need to file for all possible cases after this point\n\tconst storage = await createOrGetStorageService(currentData.summary);\n\n\tif (currentData.blobs === \"outstanding\") {\n\t\tconst { redirectTable } = currentData;\n\t\t// upload blobs to storage\n\t\tassert(!!detachedBlobStorage, 0x24e /* \"assertion for type narrowing\" */);\n\n\t\t// build a table mapping IDs assigned locally to IDs assigned by storage and pass it to runtime to\n\t\t// support blob handles that only know about the local IDs\n\t\twhile (redirectTable.size < detachedBlobStorage.size) {\n\t\t\tconst newIds = detachedBlobStorage.getBlobIds().filter((id) => !redirectTable.has(id));\n\t\t\tfor (const id of newIds) {\n\t\t\t\tconst blob = await detachedBlobStorage.readBlob(id);\n\t\t\t\tconst response = await storage.createBlob(blob);\n\t\t\t\tredirectTable.set(id, response.id);\n\t\t\t}\n\t\t}\n\t\tsetAttachmentData(\n\t\t\t(currentData = {\n\t\t\t\tstate: AttachState.Attaching,\n\t\t\t\tsummary: createAttachmentSummary(redirectTable),\n\t\t\t\tblobs: \"done\",\n\t\t\t}),\n\t\t);\n\t}\n\n\tassert(\n\t\tcurrentData.state === AttachState.Attaching,\n\t\t0x8e2 /* must be attaching by this point */,\n\t);\n\n\tif (currentData.blobs === \"done\") {\n\t\t// done means outstanding blobs were uploaded.\n\t\t// in that case an empty file was created, the blobs were uploaded\n\t\t// and now this finally uploads the summary\n\t\tawait storage.uploadSummaryWithContext(currentData.summary, {\n\t\t\treferenceSequenceNumber: 0,\n\t\t\tackHandle: undefined,\n\t\t\tproposalHandle: undefined,\n\t\t});\n\t}\n\n\tconst snapshot: SnapshotWithBlobs | undefined = offlineLoadEnabled\n\t\t? getSnapshotTreeAndBlobsFromSerializedContainer(currentData.summary)\n\t\t: undefined;\n\n\tsetAttachmentData(\n\t\t(currentData = {\n\t\t\tstate: AttachState.Attached,\n\t\t}),\n\t);\n\treturn snapshot;\n};\n"]}
|
package/dist/container.d.ts
CHANGED
|
@@ -6,10 +6,9 @@ import { AttachState, IAudience, ICriticalContainerError } from "@fluidframework
|
|
|
6
6
|
import { ICodeDetailsLoader, IContainer, IContainerEvents, IContainerLoadMode, IDeltaManager, IFluidCodeDetails, ReadOnlyInfo, type ILoaderOptions } from "@fluidframework/container-definitions/internal";
|
|
7
7
|
import { FluidObject, IRequest, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
|
|
8
8
|
import { IClientDetails, IQuorumClients } from "@fluidframework/driver-definitions";
|
|
9
|
-
import { IDocumentServiceFactory, IResolvedUrl, IUrlResolver, IDocumentMessage, ISequencedDocumentMessage
|
|
9
|
+
import { IDocumentServiceFactory, IResolvedUrl, IUrlResolver, IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
10
10
|
import { ITelemetryLoggerExt, EventEmitterWithErrorHandling } from "@fluidframework/telemetry-utils/internal";
|
|
11
11
|
import { ConnectionState } from "./connectionState.js";
|
|
12
|
-
import { IDetachedBlobStorage } from "./loader.js";
|
|
13
12
|
import { ProtocolHandlerBuilder } from "./protocol.js";
|
|
14
13
|
import { type IPendingContainerState } from "./serializedStateManager.js";
|
|
15
14
|
/**
|
|
@@ -76,10 +75,6 @@ export interface IContainerCreateProps {
|
|
|
76
75
|
* The logger downstream consumers should construct their loggers from
|
|
77
76
|
*/
|
|
78
77
|
readonly subLogger: ITelemetryLoggerExt;
|
|
79
|
-
/**
|
|
80
|
-
* Blobs storage for detached containers.
|
|
81
|
-
*/
|
|
82
|
-
readonly detachedBlobStorage?: IDetachedBlobStorage;
|
|
83
78
|
/**
|
|
84
79
|
* Optional property for allowing the container to use a custom
|
|
85
80
|
* protocol implementation for handling the quorum and/or the audience.
|
|
@@ -234,14 +229,6 @@ export declare class Container extends EventEmitterWithErrorHandling<IContainerE
|
|
|
234
229
|
* loaded.
|
|
235
230
|
*/
|
|
236
231
|
getLoadedCodeDetails(): IFluidCodeDetails | undefined;
|
|
237
|
-
/**
|
|
238
|
-
* Get the package info for the code details that were used to load the container.
|
|
239
|
-
* @returns The package info for the code details that were used to load the container if it is loaded, undefined otherwise
|
|
240
|
-
* @deprecated To be removed in 2.40.
|
|
241
|
-
* Use getLoadedCodeDetails instead; see https://github.com/microsoft/FluidFramework/issues/23898 for details.
|
|
242
|
-
* Deprecating the function here to avoid polluting public container api surface.
|
|
243
|
-
*/
|
|
244
|
-
getContainerPackageInfo?(): IContainerPackageInfo | undefined;
|
|
245
232
|
private _loadedModule;
|
|
246
233
|
/**
|
|
247
234
|
* Retrieves the audience associated with the document
|
package/dist/container.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../src/container.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EACN,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAGN,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EAQjB,YAAY,EAEZ,KAAK,cAAc,EACnB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACN,WAAW,EAEX,QAAQ,EACR,wBAAwB,EAExB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAEN,cAAc,EACd,cAAc,EAId,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEN,uBAAuB,EAEvB,YAAY,EAGZ,YAAY,EAGZ,gBAAgB,EAOhB,yBAAyB,EAGzB,
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../src/container.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EACN,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAGN,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,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AAO,CAAC,kBAAkB;YA8FZ,2BAA2B;IAmBzC,OAAO,CAAC,iCAAiC;IA4DzC,OAAO,CAAC,wBAAwB;IAgChC,OAAO,CAAC,sBAAsB;IAyB9B;;OAEG;IACH,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,oBAAoB;IAsB5B,OAAO,CAAC,aAAa;IAwBrB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA+C5B,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,aAAa;YAUP,kBAAkB;IAuFhC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAMxC;IAEF;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;IAYhC,OAAO,CAAC,wBAAwB;CAuChC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,UAAU;IACzD;;;;;OAKG;IACH,oBAAoB,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzC;;;OAGG;IACH,4BAA4B,CAAC,CAAC,uBAAuB,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACtF"}
|
package/dist/container.js
CHANGED
|
@@ -336,16 +336,6 @@ class Container extends internal_5.EventEmitterWithErrorHandling {
|
|
|
336
336
|
getLoadedCodeDetails() {
|
|
337
337
|
return this._loadedCodeDetails;
|
|
338
338
|
}
|
|
339
|
-
/**
|
|
340
|
-
* Get the package info for the code details that were used to load the container.
|
|
341
|
-
* @returns The package info for the code details that were used to load the container if it is loaded, undefined otherwise
|
|
342
|
-
* @deprecated To be removed in 2.40.
|
|
343
|
-
* Use getLoadedCodeDetails instead; see https://github.com/microsoft/FluidFramework/issues/23898 for details.
|
|
344
|
-
* Deprecating the function here to avoid polluting public container api surface.
|
|
345
|
-
*/
|
|
346
|
-
getContainerPackageInfo() {
|
|
347
|
-
return (0, contracts_js_1.getPackageName)(this._loadedCodeDetails);
|
|
348
|
-
}
|
|
349
339
|
/**
|
|
350
340
|
* Retrieves the audience associated with the document
|
|
351
341
|
*/
|
|
@@ -517,7 +507,7 @@ class Container extends internal_5.EventEmitterWithErrorHandling {
|
|
|
517
507
|
this._dirtyContainer = dirty;
|
|
518
508
|
this.emit(dirty ? dirtyContainerEvent : savedContainerEvent);
|
|
519
509
|
};
|
|
520
|
-
const { canReconnect, clientDetailsOverride, urlResolver, documentServiceFactory, codeLoader, options, scope, subLogger,
|
|
510
|
+
const { canReconnect, clientDetailsOverride, urlResolver, documentServiceFactory, codeLoader, options, scope, subLogger, protocolHandlerBuilder, } = createProps;
|
|
521
511
|
this.connectionTransitionTimes[connectionState_js_1.ConnectionState.Disconnected] = (0, client_utils_1.performanceNow)();
|
|
522
512
|
const pendingLocalState = loadProps?.pendingLocalState;
|
|
523
513
|
this._canReconnect = canReconnect ?? true;
|
|
@@ -657,10 +647,7 @@ class Container extends internal_5.EventEmitterWithErrorHandling {
|
|
|
657
647
|
this.detachedBlobStorage =
|
|
658
648
|
this.attachState === container_definitions_1.AttachState.Attached
|
|
659
649
|
? undefined
|
|
660
|
-
: (
|
|
661
|
-
(this.mc.config.getBoolean("Fluid.Container.MemoryBlobStorageEnabled") === false
|
|
662
|
-
? undefined
|
|
663
|
-
: (0, memoryBlobStorage_js_1.createMemoryDetachedBlobStorage)()));
|
|
650
|
+
: (0, memoryBlobStorage_js_1.createMemoryDetachedBlobStorage)();
|
|
664
651
|
this.storageAdapter = new containerStorageAdapter_js_1.ContainerStorageAdapter(this.detachedBlobStorage, this.mc.logger, pendingLocalState?.snapshotBlobs, pendingLocalState?.loadedGroupIdSnapshots, addProtocolSummaryIfMissing, enableSummarizeProtocolTree);
|
|
665
652
|
const offlineLoadEnabled = (this.isInteractiveClient &&
|
|
666
653
|
this.mc.config.getBoolean("Fluid.Container.enableOfflineLoad")) ??
|
|
@@ -848,7 +835,7 @@ class Container extends internal_5.EventEmitterWithErrorHandling {
|
|
|
848
835
|
snapshotBlobs,
|
|
849
836
|
pendingRuntimeState,
|
|
850
837
|
hasAttachmentBlobs: this.detachedBlobStorage !== undefined && this.detachedBlobStorage.size > 0,
|
|
851
|
-
attachmentBlobs:
|
|
838
|
+
attachmentBlobs: this.detachedBlobStorage?.serialize(),
|
|
852
839
|
};
|
|
853
840
|
return JSON.stringify(detachedContainerState);
|
|
854
841
|
}
|
|
@@ -1137,6 +1124,7 @@ class Container extends internal_5.EventEmitterWithErrorHandling {
|
|
|
1137
1124
|
async rehydrateDetachedFromSnapshot({ baseSnapshot, snapshotBlobs, hasAttachmentBlobs, attachmentBlobs, pendingRuntimeState, }) {
|
|
1138
1125
|
if (hasAttachmentBlobs) {
|
|
1139
1126
|
if (attachmentBlobs !== undefined) {
|
|
1127
|
+
(0, internal_2.assert)(this.detachedBlobStorage !== undefined, 0xb8e /* detached blob storage should always exist when detached */);
|
|
1140
1128
|
(0, memoryBlobStorage_js_1.tryInitializeMemoryDetachedBlobStorage)(this.detachedBlobStorage, attachmentBlobs);
|
|
1141
1129
|
}
|
|
1142
1130
|
(0, internal_2.assert)(this.detachedBlobStorage !== undefined && this.detachedBlobStorage.size > 0, 0x250 /* "serialized container with attachment blobs must be rehydrated with detached blob storage" */);
|