@fluidframework/container-loader 2.30.0 → 2.31.1
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 +354 -347
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +3 -2
- package/dist/container.js.map +1 -1
- package/dist/containerContext.d.ts +4 -0
- package/dist/containerContext.d.ts.map +1 -1
- package/dist/containerContext.js +6 -2
- package/dist/containerContext.js.map +1 -1
- package/dist/{layerCompatState.d.ts → loaderLayerCompatState.d.ts} +20 -3
- package/dist/loaderLayerCompatState.d.ts.map +1 -0
- package/dist/{layerCompatState.js → loaderLayerCompatState.js} +19 -9
- package/dist/loaderLayerCompatState.js.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +2 -1
- package/lib/container.js.map +1 -1
- package/lib/containerContext.d.ts +4 -0
- package/lib/containerContext.d.ts.map +1 -1
- package/lib/containerContext.js +6 -2
- package/lib/containerContext.js.map +1 -1
- package/lib/{layerCompatState.d.ts → loaderLayerCompatState.d.ts} +20 -3
- package/lib/loaderLayerCompatState.d.ts.map +1 -0
- package/lib/{layerCompatState.js → loaderLayerCompatState.js} +18 -8
- package/lib/loaderLayerCompatState.js.map +1 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +14 -22
- package/src/container.ts +2 -1
- package/src/containerContext.ts +6 -2
- package/src/{layerCompatState.ts → loaderLayerCompatState.ts} +18 -7
- package/src/packageVersion.ts +1 -1
- package/tsconfig.json +1 -0
- package/dist/layerCompatState.d.ts.map +0 -1
- package/dist/layerCompatState.js.map +0 -1
- package/lib/layerCompatState.d.ts.map +0 -1
- package/lib/layerCompatState.js.map +0 -1
- package/prettier.config.cjs +0 -8
|
@@ -62,6 +62,10 @@ export declare class ContainerContext implements IContainerContext, IProvideLaye
|
|
|
62
62
|
* When false, ops should be kept as pending or rejected
|
|
63
63
|
*/
|
|
64
64
|
get connected(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The compatibility details of the Loader layer that is exposed to the Runtime layer
|
|
67
|
+
* for validating Runtime-Loader compatibility.
|
|
68
|
+
*/
|
|
65
69
|
get ILayerCompatDetails(): ILayerCompatDetails;
|
|
66
70
|
constructor(options: ILoaderOptions, scope: FluidObject, baseSnapshot: ISnapshotTree | undefined, _version: IVersion | undefined, deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, storage: IDocumentStorageService, quorum: IQuorumClients, audience: IAudience, loader: ILoader, submitFn: (type: MessageType, contents: unknown, batch: boolean, appData: unknown) => number, submitSummaryFn: (summaryOp: ISummaryContent, referenceSequenceNumber?: number) => number,
|
|
67
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerContext.d.ts","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,0BAA0B,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,cAAc,EACd,aAAa,EACb,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EACN,uBAAuB,EACvB,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAI/E;;GAEG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB,EAAE,0BAA0B;
|
|
1
|
+
{"version":3,"file":"containerContext.d.ts","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,0BAA0B,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,cAAc,EACd,aAAa,EACb,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EACN,uBAAuB,EACvB,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAI/E;;GAEG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB,EAAE,0BAA0B;aAyCpE,OAAO,EAAE,cAAc;aACvB,KAAK,EAAE,WAAW;aAClB,YAAY,EAAE,aAAa,GAAG,SAAS;IACvD,OAAO,CAAC,QAAQ,CAAC,QAAQ;aACT,YAAY,EAAE,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC;aACxE,OAAO,EAAE,uBAAuB;aAChC,MAAM,EAAE,cAAc;aACtB,QAAQ,EAAE,SAAS;aACnB,MAAM,EAAE,OAAO;aACf,QAAQ,EAAE,CACzB,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,OAAO,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IAAI,QAAQ,GAAG,SAAS;IAInD,IAAW,WAAW,IAAI,WAAW,CAEpC;CACD"}
|
package/lib/containerContext.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { loaderCompatDetailsForRuntime } from "./loaderLayerCompatState.js";
|
|
6
6
|
/**
|
|
7
7
|
* {@inheritDoc @fluidframework/container-definitions#IContainerContext}
|
|
8
8
|
*/
|
|
@@ -23,8 +23,12 @@ export class ContainerContext {
|
|
|
23
23
|
get connected() {
|
|
24
24
|
return this._getConnected();
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* The compatibility details of the Loader layer that is exposed to the Runtime layer
|
|
28
|
+
* for validating Runtime-Loader compatibility.
|
|
29
|
+
*/
|
|
26
30
|
get ILayerCompatDetails() {
|
|
27
|
-
return
|
|
31
|
+
return loaderCompatDetailsForRuntime;
|
|
28
32
|
}
|
|
29
33
|
constructor(options, scope, baseSnapshot, _version, deltaManager, storage, quorum, audience, loader, submitFn, submitSummaryFn,
|
|
30
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerContext.js","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"containerContext.js","sourceRoot":"","sources":["../src/containerContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAE5E;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAa5B,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,EAAE;QACZ,OAAO,IAAI,CAAC,yBAAyB,EAAE,IAAI,EAAE,CAAC;IAC/C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BAAa,GAAb,aAAa,CAAgB;QAC7B,aAAQ,GAAR,QAAQ,CAAS;QACjB,iBAAY,GAAZ,YAAY,CAAqB;QACjC,sBAAiB,GAAjB,iBAAiB,CAAU;QAC3B,yBAAoB,GAApB,oBAAoB,CAAY;QAxFjD;;WAEG;QACa,sBAAiB,GAAiC,IAAI,GAAG,CAAC;YACzE;;;;eAIG;YACH,CAAC,0BAA0B,EAAE,IAAI,CAAC;SAClC,CAAC,CAAC;IA+EA,CAAC;IAEG,oBAAoB;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;IAC/B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tILayerCompatDetails,\n\tIProvideLayerCompatDetails,\n} from \"@fluid-internal/client-utils\";\nimport {\n\tAttachState,\n\tIAudience,\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nimport {\n\tIBatchMessage,\n\tIContainerContext,\n\tILoader,\n\tILoaderOptions,\n\tIDeltaManager,\n} from \"@fluidframework/container-definitions/internal\";\nimport { type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { type ISignalEnvelope } from \"@fluidframework/core-interfaces/internal\";\nimport { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentStorageService,\n\tISnapshot,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISummaryContent,\n\tIVersion,\n\tMessageType,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { loaderCompatDetailsForRuntime } from \"./loaderLayerCompatState.js\";\n\n/**\n * {@inheritDoc @fluidframework/container-definitions#IContainerContext}\n */\nexport class ContainerContext implements IContainerContext, IProvideLayerCompatDetails {\n\t/**\n\t * @deprecated - This has been replaced by ILayerCompatDetails.\n\t */\n\tpublic readonly supportedFeatures: ReadonlyMap<string, unknown> = new Map([\n\t\t/**\n\t\t * This version of the loader accepts `referenceSequenceNumber`, provided by the container runtime,\n\t\t * as a parameter to the `submitBatchFn` and `submitSummaryFn` functions.\n\t\t * This is then used to set the reference sequence numbers of the submitted ops in the DeltaManager.\n\t\t */\n\t\t[\"referenceSequenceNumbers\", true],\n\t]);\n\n\tpublic get clientId(): string | undefined {\n\t\treturn this._getClientId();\n\t}\n\n\t/**\n\t * DISCLAIMER: this id is only for telemetry purposes. Not suitable for any other usages.\n\t */\n\tpublic get id(): string {\n\t\treturn this._getContainerDiagnosticId() ?? \"\";\n\t}\n\n\t/**\n\t * When true, ops are free to flow\n\t * When false, ops should be kept as pending or rejected\n\t */\n\tpublic get connected(): boolean {\n\t\treturn this._getConnected();\n\t}\n\n\t/**\n\t * The compatibility details of the Loader layer that is exposed to the Runtime layer\n\t * for validating Runtime-Loader compatibility.\n\t */\n\tpublic get ILayerCompatDetails(): ILayerCompatDetails {\n\t\treturn loaderCompatDetailsForRuntime;\n\t}\n\n\tconstructor(\n\t\tpublic readonly options: ILoaderOptions,\n\t\tpublic readonly scope: FluidObject,\n\t\tpublic readonly baseSnapshot: ISnapshotTree | undefined,\n\t\tprivate readonly _version: IVersion | undefined,\n\t\tpublic readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tpublic readonly storage: IDocumentStorageService,\n\t\tpublic readonly quorum: IQuorumClients,\n\t\tpublic readonly audience: IAudience,\n\t\tpublic readonly loader: ILoader,\n\t\tpublic readonly submitFn: (\n\t\t\ttype: MessageType,\n\t\t\tcontents: unknown,\n\t\t\tbatch: boolean,\n\t\t\tappData: unknown,\n\t\t) => number,\n\t\tpublic readonly submitSummaryFn: (\n\t\t\tsummaryOp: ISummaryContent,\n\t\t\treferenceSequenceNumber?: number,\n\t\t) => number,\n\t\t/**\n\t\t * @returns clientSequenceNumber of last message in a batch\n\t\t */\n\t\tpublic readonly submitBatchFn: (\n\t\t\tbatch: IBatchMessage[],\n\t\t\treferenceSequenceNumber?: number,\n\t\t) => number,\n\n\t\t/**\n\t\t * `unknown` should be removed once `@alpha` tag is removed from IContainerContext\n\t\t * @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}\n\t\t * Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s\n\t\t */\n\t\tpublic readonly submitSignalFn: (\n\t\t\tcontent: unknown | ISignalEnvelope,\n\t\t\ttargetClientId?: string,\n\t\t) => void,\n\t\tpublic readonly disposeFn: (error?: ICriticalContainerError) => void,\n\t\tpublic readonly closeFn: (error?: ICriticalContainerError) => void,\n\t\tpublic readonly updateDirtyContainerState: (dirty: boolean) => void,\n\t\tpublic readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>,\n\t\tprivate readonly _getContainerDiagnosticId: () => string | undefined,\n\t\tprivate readonly _getClientId: () => string | undefined,\n\t\tprivate readonly _getAttachState: () => AttachState,\n\t\tprivate readonly _getConnected: () => boolean,\n\t\tpublic readonly clientDetails: IClientDetails,\n\t\tpublic readonly existing: boolean,\n\t\tpublic readonly taggedLogger: ITelemetryLoggerExt,\n\t\tpublic readonly pendingLocalState?: unknown,\n\t\tpublic readonly snapshotWithContents?: ISnapshot,\n\t) {}\n\n\tpublic getLoadedFromVersion(): IVersion | undefined {\n\t\treturn this._version;\n\t}\n\n\tpublic get attachState(): AttachState {\n\t\treturn this._getAttachState();\n\t}\n}\n"]}
|
|
@@ -4,16 +4,33 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type ILayerCompatDetails, type ILayerCompatSupportRequirements } from "@fluid-internal/client-utils";
|
|
6
6
|
import type { ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
7
|
+
/**
|
|
8
|
+
* The core compatibility details of the Loader layer that is the same across all layer boundaries.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare const loaderCoreCompatDetails: {
|
|
12
|
+
/**
|
|
13
|
+
* The package version of the Loader layer.
|
|
14
|
+
*/
|
|
15
|
+
pkgVersion: string;
|
|
16
|
+
/**
|
|
17
|
+
* The current generation of the Loader layer.
|
|
18
|
+
*/
|
|
19
|
+
generation: number;
|
|
20
|
+
};
|
|
7
21
|
/**
|
|
8
22
|
* Loader's compatibility details that is exposed to the Runtime layer.
|
|
23
|
+
* @internal
|
|
9
24
|
*/
|
|
10
|
-
export declare const
|
|
25
|
+
export declare const loaderCompatDetailsForRuntime: ILayerCompatDetails;
|
|
11
26
|
/**
|
|
12
27
|
* The requirements that the Runtime layer must meet to be compatible with this Loader.
|
|
28
|
+
* @internal
|
|
13
29
|
*/
|
|
14
|
-
export declare const
|
|
30
|
+
export declare const runtimeSupportRequirements: ILayerCompatSupportRequirements;
|
|
15
31
|
/**
|
|
16
32
|
* Validates that the Runtime layer is compatible with the Loader.
|
|
33
|
+
* @internal
|
|
17
34
|
*/
|
|
18
35
|
export declare function validateRuntimeCompatibility(maybeRuntimeCompatDetails: ILayerCompatDetails | undefined, disposeFn: (error?: ICriticalContainerError) => void): void;
|
|
19
|
-
//# sourceMappingURL=
|
|
36
|
+
//# sourceMappingURL=loaderLayerCompatState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loaderLayerCompatState.d.ts","sourceRoot":"","sources":["../src/loaderLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAKrF;;;GAGG;AACH,eAAO,MAAM,uBAAuB;IACnC;;OAEG;;IAEH;;OAEG;;CAEH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,mBAM3C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,+BAUxC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,4BAA4B,CAC3C,yBAAyB,EAAE,mBAAmB,GAAG,SAAS,EAC1D,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,uBAAuB,KAAK,IAAI,GAClD,IAAI,CAoBN"}
|
|
@@ -6,9 +6,10 @@ import { checkLayerCompatibility, } from "@fluid-internal/client-utils";
|
|
|
6
6
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
7
7
|
import { pkgVersion } from "./packageVersion.js";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* The core compatibility details of the Loader layer that is the same across all layer boundaries.
|
|
10
|
+
* @internal
|
|
10
11
|
*/
|
|
11
|
-
export const
|
|
12
|
+
export const loaderCoreCompatDetails = {
|
|
12
13
|
/**
|
|
13
14
|
* The package version of the Loader layer.
|
|
14
15
|
*/
|
|
@@ -17,6 +18,13 @@ export const LoaderCompatDetails = {
|
|
|
17
18
|
* The current generation of the Loader layer.
|
|
18
19
|
*/
|
|
19
20
|
generation: 1,
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Loader's compatibility details that is exposed to the Runtime layer.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export const loaderCompatDetailsForRuntime = {
|
|
27
|
+
...loaderCoreCompatDetails,
|
|
20
28
|
/**
|
|
21
29
|
* The features supported by the Loader layer across the Loader / Runtime boundary.
|
|
22
30
|
*/
|
|
@@ -24,8 +32,9 @@ export const LoaderCompatDetails = {
|
|
|
24
32
|
};
|
|
25
33
|
/**
|
|
26
34
|
* The requirements that the Runtime layer must meet to be compatible with this Loader.
|
|
35
|
+
* @internal
|
|
27
36
|
*/
|
|
28
|
-
export const
|
|
37
|
+
export const runtimeSupportRequirements = {
|
|
29
38
|
/**
|
|
30
39
|
* Minimum generation that Runtime must be at to be compatible with Loader. Note that 0 is used here for
|
|
31
40
|
* Runtime layers before the introduction of the layer compatibility enforcement.
|
|
@@ -38,17 +47,18 @@ export const RuntimeSupportRequirements = {
|
|
|
38
47
|
};
|
|
39
48
|
/**
|
|
40
49
|
* Validates that the Runtime layer is compatible with the Loader.
|
|
50
|
+
* @internal
|
|
41
51
|
*/
|
|
42
52
|
export function validateRuntimeCompatibility(maybeRuntimeCompatDetails, disposeFn) {
|
|
43
|
-
const layerCheckResult = checkLayerCompatibility(
|
|
53
|
+
const layerCheckResult = checkLayerCompatibility(runtimeSupportRequirements, maybeRuntimeCompatDetails);
|
|
44
54
|
if (!layerCheckResult.isCompatible) {
|
|
45
55
|
const error = new UsageError("Loader is not compatible with Runtime", {
|
|
46
56
|
errorDetails: JSON.stringify({
|
|
47
|
-
loaderVersion:
|
|
57
|
+
loaderVersion: loaderCompatDetailsForRuntime.pkgVersion,
|
|
48
58
|
runtimeVersion: maybeRuntimeCompatDetails?.pkgVersion,
|
|
49
|
-
loaderGeneration:
|
|
59
|
+
loaderGeneration: loaderCompatDetailsForRuntime.generation,
|
|
50
60
|
runtimeGeneration: maybeRuntimeCompatDetails?.generation,
|
|
51
|
-
minSupportedGeneration:
|
|
61
|
+
minSupportedGeneration: runtimeSupportRequirements.minSupportedGeneration,
|
|
52
62
|
isGenerationCompatible: layerCheckResult.isGenerationCompatible,
|
|
53
63
|
unsupportedFeatures: layerCheckResult.unsupportedFeatures,
|
|
54
64
|
}),
|
|
@@ -57,4 +67,4 @@ export function validateRuntimeCompatibility(maybeRuntimeCompatDetails, disposeF
|
|
|
57
67
|
throw error;
|
|
58
68
|
}
|
|
59
69
|
}
|
|
60
|
-
//# sourceMappingURL=
|
|
70
|
+
//# sourceMappingURL=loaderLayerCompatState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loaderLayerCompatState.js","sourceRoot":"","sources":["../src/loaderLayerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,uBAAuB,GAGvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,0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licensed under the MIT License.\n */\n\nimport {\n\tcheckLayerCompatibility,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { UsageError } 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 runtimeSupportRequirements: 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 * Validates that the Runtime layer is compatible with the Loader.\n * @internal\n */\nexport function validateRuntimeCompatibility(\n\tmaybeRuntimeCompatDetails: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: ICriticalContainerError) => void,\n): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\truntimeSupportRequirements,\n\t\tmaybeRuntimeCompatDetails,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst error = new UsageError(\"Loader is not compatible with Runtime\", {\n\t\t\terrorDetails: JSON.stringify({\n\t\t\t\tloaderVersion: loaderCompatDetailsForRuntime.pkgVersion,\n\t\t\t\truntimeVersion: maybeRuntimeCompatDetails?.pkgVersion,\n\t\t\t\tloaderGeneration: loaderCompatDetailsForRuntime.generation,\n\t\t\t\truntimeGeneration: maybeRuntimeCompatDetails?.generation,\n\t\t\t\tminSupportedGeneration: runtimeSupportRequirements.minSupportedGeneration,\n\t\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t\t}),\n\t\t});\n\t\tdisposeFn(error);\n\t\tthrow error;\n\t}\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -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.
|
|
8
|
+
export declare const pkgVersion = "2.31.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -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.
|
|
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.31.1\";\n"]}
|
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-loader",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.1",
|
|
4
4
|
"description": "Fluid container loader",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -119,13 +119,13 @@
|
|
|
119
119
|
"temp-directory": "nyc/.nyc_output"
|
|
120
120
|
},
|
|
121
121
|
"dependencies": {
|
|
122
|
-
"@fluid-internal/client-utils": "~2.
|
|
123
|
-
"@fluidframework/container-definitions": "~2.
|
|
124
|
-
"@fluidframework/core-interfaces": "~2.
|
|
125
|
-
"@fluidframework/core-utils": "~2.
|
|
126
|
-
"@fluidframework/driver-definitions": "~2.
|
|
127
|
-
"@fluidframework/driver-utils": "~2.
|
|
128
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
122
|
+
"@fluid-internal/client-utils": "~2.31.1",
|
|
123
|
+
"@fluidframework/container-definitions": "~2.31.1",
|
|
124
|
+
"@fluidframework/core-interfaces": "~2.31.1",
|
|
125
|
+
"@fluidframework/core-utils": "~2.31.1",
|
|
126
|
+
"@fluidframework/driver-definitions": "~2.31.1",
|
|
127
|
+
"@fluidframework/driver-utils": "~2.31.1",
|
|
128
|
+
"@fluidframework/telemetry-utils": "~2.31.1",
|
|
129
129
|
"@types/events_pkg": "npm:@types/events@^3.0.0",
|
|
130
130
|
"@ungap/structured-clone": "^1.2.0",
|
|
131
131
|
"debug": "^4.3.4",
|
|
@@ -136,15 +136,15 @@
|
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
138
138
|
"@biomejs/biome": "~1.9.3",
|
|
139
|
-
"@fluid-internal/client-utils": "~2.
|
|
140
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
141
|
-
"@fluid-private/test-loader-utils": "~2.
|
|
139
|
+
"@fluid-internal/client-utils": "~2.31.1",
|
|
140
|
+
"@fluid-internal/mocha-test-setup": "~2.31.1",
|
|
141
|
+
"@fluid-private/test-loader-utils": "~2.31.1",
|
|
142
142
|
"@fluid-tools/build-cli": "^0.54.0",
|
|
143
143
|
"@fluidframework/build-common": "^2.0.3",
|
|
144
144
|
"@fluidframework/build-tools": "^0.54.0",
|
|
145
|
-
"@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.
|
|
145
|
+
"@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.31.0",
|
|
146
146
|
"@fluidframework/eslint-config-fluid": "^5.7.3",
|
|
147
|
-
"@microsoft/api-extractor": "7.
|
|
147
|
+
"@microsoft/api-extractor": "7.50.1",
|
|
148
148
|
"@types/debug": "^4.1.5",
|
|
149
149
|
"@types/double-ended-queue": "^2.1.0",
|
|
150
150
|
"@types/mocha": "^10.0.10",
|
|
@@ -160,18 +160,12 @@
|
|
|
160
160
|
"mocha": "^10.8.2",
|
|
161
161
|
"mocha-multi-reporters": "^1.5.1",
|
|
162
162
|
"moment": "^2.21.0",
|
|
163
|
-
"prettier": "~3.0.3",
|
|
164
163
|
"rimraf": "^4.4.0",
|
|
165
164
|
"sinon": "^18.0.1",
|
|
166
165
|
"typescript": "~5.4.5"
|
|
167
166
|
},
|
|
168
167
|
"typeValidation": {
|
|
169
|
-
"broken": {
|
|
170
|
-
"Interface_ILoaderOptions": {
|
|
171
|
-
"forwardCompat": false,
|
|
172
|
-
"backCompat": false
|
|
173
|
-
}
|
|
174
|
-
},
|
|
168
|
+
"broken": {},
|
|
175
169
|
"entrypoint": "legacy"
|
|
176
170
|
},
|
|
177
171
|
"scripts": {
|
|
@@ -199,7 +193,6 @@
|
|
|
199
193
|
"check:exports:esm:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.esm.json",
|
|
200
194
|
"check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
|
|
201
195
|
"check:format": "npm run check:biome",
|
|
202
|
-
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
203
196
|
"ci:build:api-reports": "concurrently \"npm:ci:build:api-reports:*\"",
|
|
204
197
|
"ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor.current.json",
|
|
205
198
|
"ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
|
|
@@ -209,7 +202,6 @@
|
|
|
209
202
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
210
203
|
"format": "npm run format:biome",
|
|
211
204
|
"format:biome": "biome check . --write",
|
|
212
|
-
"format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
213
205
|
"lint": "fluid-build . --task lint",
|
|
214
206
|
"lint:fix": "fluid-build . --task eslint:fix --task format",
|
|
215
207
|
"place:cjs:package-stub": "copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
|
package/src/container.ts
CHANGED
|
@@ -128,10 +128,10 @@ import {
|
|
|
128
128
|
getPackageName,
|
|
129
129
|
} from "./contracts.js";
|
|
130
130
|
import { DeltaManager, IConnectionArgs } from "./deltaManager.js";
|
|
131
|
-
import { validateRuntimeCompatibility } from "./layerCompatState.js";
|
|
132
131
|
// eslint-disable-next-line import/no-deprecated
|
|
133
132
|
import { IDetachedBlobStorage } from "./loader.js";
|
|
134
133
|
import { RelativeLoader } from "./loader.js";
|
|
134
|
+
import { validateRuntimeCompatibility } from "./loaderLayerCompatState.js";
|
|
135
135
|
import {
|
|
136
136
|
serializeMemoryDetachedBlobStorage,
|
|
137
137
|
createMemoryDetachedBlobStorage,
|
|
@@ -2476,6 +2476,7 @@ export class Container
|
|
|
2476
2476
|
async () => runtimeFactory.instantiateRuntime(context, existing),
|
|
2477
2477
|
);
|
|
2478
2478
|
|
|
2479
|
+
// Validate that the Runtime is compatible with this Loader.
|
|
2479
2480
|
const maybeRuntimeCompatDetails = runtime as FluidObject<ILayerCompatDetails>;
|
|
2480
2481
|
validateRuntimeCompatibility(maybeRuntimeCompatDetails.ILayerCompatDetails, (error) =>
|
|
2481
2482
|
this.dispose(error),
|
package/src/containerContext.ts
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "@fluidframework/driver-definitions/internal";
|
|
35
35
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
36
36
|
|
|
37
|
-
import {
|
|
37
|
+
import { loaderCompatDetailsForRuntime } from "./loaderLayerCompatState.js";
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* {@inheritDoc @fluidframework/container-definitions#IContainerContext}
|
|
@@ -71,8 +71,12 @@ export class ContainerContext implements IContainerContext, IProvideLayerCompatD
|
|
|
71
71
|
return this._getConnected();
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* The compatibility details of the Loader layer that is exposed to the Runtime layer
|
|
76
|
+
* for validating Runtime-Loader compatibility.
|
|
77
|
+
*/
|
|
74
78
|
public get ILayerCompatDetails(): ILayerCompatDetails {
|
|
75
|
-
return
|
|
79
|
+
return loaderCompatDetailsForRuntime;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
constructor(
|
|
@@ -14,9 +14,10 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
|
14
14
|
import { pkgVersion } from "./packageVersion.js";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* The core compatibility details of the Loader layer that is the same across all layer boundaries.
|
|
18
|
+
* @internal
|
|
18
19
|
*/
|
|
19
|
-
export const
|
|
20
|
+
export const loaderCoreCompatDetails = {
|
|
20
21
|
/**
|
|
21
22
|
* The package version of the Loader layer.
|
|
22
23
|
*/
|
|
@@ -25,6 +26,14 @@ export const LoaderCompatDetails: ILayerCompatDetails = {
|
|
|
25
26
|
* The current generation of the Loader layer.
|
|
26
27
|
*/
|
|
27
28
|
generation: 1,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Loader's compatibility details that is exposed to the Runtime layer.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export const loaderCompatDetailsForRuntime: ILayerCompatDetails = {
|
|
36
|
+
...loaderCoreCompatDetails,
|
|
28
37
|
/**
|
|
29
38
|
* The features supported by the Loader layer across the Loader / Runtime boundary.
|
|
30
39
|
*/
|
|
@@ -33,8 +42,9 @@ export const LoaderCompatDetails: ILayerCompatDetails = {
|
|
|
33
42
|
|
|
34
43
|
/**
|
|
35
44
|
* The requirements that the Runtime layer must meet to be compatible with this Loader.
|
|
45
|
+
* @internal
|
|
36
46
|
*/
|
|
37
|
-
export const
|
|
47
|
+
export const runtimeSupportRequirements: ILayerCompatSupportRequirements = {
|
|
38
48
|
/**
|
|
39
49
|
* Minimum generation that Runtime must be at to be compatible with Loader. Note that 0 is used here for
|
|
40
50
|
* Runtime layers before the introduction of the layer compatibility enforcement.
|
|
@@ -48,23 +58,24 @@ export const RuntimeSupportRequirements: ILayerCompatSupportRequirements = {
|
|
|
48
58
|
|
|
49
59
|
/**
|
|
50
60
|
* Validates that the Runtime layer is compatible with the Loader.
|
|
61
|
+
* @internal
|
|
51
62
|
*/
|
|
52
63
|
export function validateRuntimeCompatibility(
|
|
53
64
|
maybeRuntimeCompatDetails: ILayerCompatDetails | undefined,
|
|
54
65
|
disposeFn: (error?: ICriticalContainerError) => void,
|
|
55
66
|
): void {
|
|
56
67
|
const layerCheckResult = checkLayerCompatibility(
|
|
57
|
-
|
|
68
|
+
runtimeSupportRequirements,
|
|
58
69
|
maybeRuntimeCompatDetails,
|
|
59
70
|
);
|
|
60
71
|
if (!layerCheckResult.isCompatible) {
|
|
61
72
|
const error = new UsageError("Loader is not compatible with Runtime", {
|
|
62
73
|
errorDetails: JSON.stringify({
|
|
63
|
-
loaderVersion:
|
|
74
|
+
loaderVersion: loaderCompatDetailsForRuntime.pkgVersion,
|
|
64
75
|
runtimeVersion: maybeRuntimeCompatDetails?.pkgVersion,
|
|
65
|
-
loaderGeneration:
|
|
76
|
+
loaderGeneration: loaderCompatDetailsForRuntime.generation,
|
|
66
77
|
runtimeGeneration: maybeRuntimeCompatDetails?.generation,
|
|
67
|
-
minSupportedGeneration:
|
|
78
|
+
minSupportedGeneration: runtimeSupportRequirements.minSupportedGeneration,
|
|
68
79
|
isGenerationCompatible: layerCheckResult.isGenerationCompatible,
|
|
69
80
|
unsupportedFeatures: layerCheckResult.unsupportedFeatures,
|
|
70
81
|
}),
|
package/src/packageVersion.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layerCompatState.d.ts","sourceRoot":"","sources":["../src/layerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAKrF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,mBAajC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,+BAUxC,CAAC;AAEF;;GAEG;AACH,wBAAgB,4BAA4B,CAC3C,yBAAyB,EAAE,mBAAmB,GAAG,SAAS,EAC1D,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,uBAAuB,KAAK,IAAI,GAClD,IAAI,CAoBN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layerCompatState.js","sourceRoot":"","sources":["../src/layerCompatState.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAIsC;AAEtC,uEAAsE;AAEtE,2DAAiD;AAEjD;;GAEG;AACU,QAAA,mBAAmB,GAAwB;IACvD;;OAEG;IACH,UAAU,EAAV,8BAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;IACb;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;GAEG;AACU,QAAA,0BAA0B,GAAoC;IAC1E;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;GAEG;AACH,SAAgB,4BAA4B,CAC3C,yBAA0D,EAC1D,SAAoD;IAEpD,MAAM,gBAAgB,GAAG,IAAA,sCAAuB,EAC/C,kCAA0B,EAC1B,yBAAyB,CACzB,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,qBAAU,CAAC,uCAAuC,EAAE;YACrE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;gBAC5B,aAAa,EAAE,2BAAmB,CAAC,UAAU;gBAC7C,cAAc,EAAE,yBAAyB,EAAE,UAAU;gBACrD,gBAAgB,EAAE,2BAAmB,CAAC,UAAU;gBAChD,iBAAiB,EAAE,yBAAyB,EAAE,UAAU;gBACxD,sBAAsB,EAAE,kCAA0B,CAAC,sBAAsB;gBACzE,sBAAsB,EAAE,gBAAgB,CAAC,sBAAsB;gBAC/D,mBAAmB,EAAE,gBAAgB,CAAC,mBAAmB;aACzD,CAAC;SACF,CAAC,CAAC;QACH,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AAvBD,oEAuBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tcheckLayerCompatibility,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * Loader's compatibility details that is exposed to the Runtime layer.\n */\nexport const LoaderCompatDetails: ILayerCompatDetails = {\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\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 */\nexport const RuntimeSupportRequirements: 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 * Validates that the Runtime layer is compatible with the Loader.\n */\nexport function validateRuntimeCompatibility(\n\tmaybeRuntimeCompatDetails: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: ICriticalContainerError) => void,\n): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\tRuntimeSupportRequirements,\n\t\tmaybeRuntimeCompatDetails,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst error = new UsageError(\"Loader is not compatible with Runtime\", {\n\t\t\terrorDetails: JSON.stringify({\n\t\t\t\tloaderVersion: LoaderCompatDetails.pkgVersion,\n\t\t\t\truntimeVersion: maybeRuntimeCompatDetails?.pkgVersion,\n\t\t\t\tloaderGeneration: LoaderCompatDetails.generation,\n\t\t\t\truntimeGeneration: maybeRuntimeCompatDetails?.generation,\n\t\t\t\tminSupportedGeneration: RuntimeSupportRequirements.minSupportedGeneration,\n\t\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t\t}),\n\t\t});\n\t\tdisposeFn(error);\n\t\tthrow error;\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layerCompatState.d.ts","sourceRoot":"","sources":["../src/layerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,+BAA+B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAKrF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,mBAajC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,+BAUxC,CAAC;AAEF;;GAEG;AACH,wBAAgB,4BAA4B,CAC3C,yBAAyB,EAAE,mBAAmB,GAAG,SAAS,EAC1D,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,uBAAuB,KAAK,IAAI,GAClD,IAAI,CAoBN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layerCompatState.js","sourceRoot":"","sources":["../src/layerCompatState.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,uBAAuB,GAGvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAwB;IACvD;;OAEG;IACH,UAAU;IACV;;OAEG;IACH,UAAU,EAAE,CAAC;IACb;;OAEG;IACH,iBAAiB,EAAE,IAAI,GAAG,EAAU;CACpC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAoC;IAC1E;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC3C,yBAA0D,EAC1D,SAAoD;IAEpD,MAAM,gBAAgB,GAAG,uBAAuB,CAC/C,0BAA0B,EAC1B,yBAAyB,CACzB,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,uCAAuC,EAAE;YACrE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;gBAC5B,aAAa,EAAE,mBAAmB,CAAC,UAAU;gBAC7C,cAAc,EAAE,yBAAyB,EAAE,UAAU;gBACrD,gBAAgB,EAAE,mBAAmB,CAAC,UAAU;gBAChD,iBAAiB,EAAE,yBAAyB,EAAE,UAAU;gBACxD,sBAAsB,EAAE,0BAA0B,CAAC,sBAAsB;gBACzE,sBAAsB,EAAE,gBAAgB,CAAC,sBAAsB;gBAC/D,mBAAmB,EAAE,gBAAgB,CAAC,mBAAmB;aACzD,CAAC;SACF,CAAC,CAAC;QACH,SAAS,CAAC,KAAK,CAAC,CAAC;QACjB,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tcheckLayerCompatibility,\n\ttype ILayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n} from \"@fluid-internal/client-utils\";\nimport type { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * Loader's compatibility details that is exposed to the Runtime layer.\n */\nexport const LoaderCompatDetails: ILayerCompatDetails = {\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\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 */\nexport const RuntimeSupportRequirements: 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 * Validates that the Runtime layer is compatible with the Loader.\n */\nexport function validateRuntimeCompatibility(\n\tmaybeRuntimeCompatDetails: ILayerCompatDetails | undefined,\n\tdisposeFn: (error?: ICriticalContainerError) => void,\n): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\tRuntimeSupportRequirements,\n\t\tmaybeRuntimeCompatDetails,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst error = new UsageError(\"Loader is not compatible with Runtime\", {\n\t\t\terrorDetails: JSON.stringify({\n\t\t\t\tloaderVersion: LoaderCompatDetails.pkgVersion,\n\t\t\t\truntimeVersion: maybeRuntimeCompatDetails?.pkgVersion,\n\t\t\t\tloaderGeneration: LoaderCompatDetails.generation,\n\t\t\t\truntimeGeneration: maybeRuntimeCompatDetails?.generation,\n\t\t\t\tminSupportedGeneration: RuntimeSupportRequirements.minSupportedGeneration,\n\t\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t\t}),\n\t\t});\n\t\tdisposeFn(error);\n\t\tthrow error;\n\t}\n}\n"]}
|