@fluidframework/container-loader 2.41.0 → 2.43.0-343119
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 +4 -0
- package/dist/container.d.ts +7 -0
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +29 -15
- package/dist/container.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/loaderLayerCompatState.d.ts +10 -0
- package/dist/loaderLayerCompatState.d.ts.map +1 -1
- package/dist/loaderLayerCompatState.js +39 -1
- package/dist/loaderLayerCompatState.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/container.d.ts +7 -0
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +30 -16
- package/lib/container.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/loaderLayerCompatState.d.ts +10 -0
- package/lib/loaderLayerCompatState.d.ts.map +1 -1
- package/lib/loaderLayerCompatState.js +37 -0
- package/lib/loaderLayerCompatState.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +12 -12
- package/src/container.ts +56 -34
- package/src/index.ts +5 -0
- package/src/loaderLayerCompatState.ts +45 -0
- package/src/packageVersion.ts +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { ConnectionState } from "./connectionState.js";
|
|
|
6
6
|
export { IContainerExperimental, waitContainerToCatchUp } from "./container.js";
|
|
7
7
|
export { createDetachedContainer, loadExistingContainer, rehydrateDetachedContainer, ICreateAndLoadContainerProps, ICreateDetachedContainerProps, ILoadExistingContainerProps, IRehydrateDetachedContainerProps, } from "./createAndLoadContainerUtils.js";
|
|
8
8
|
export { ICodeDetailsLoader, IFluidModuleWithDetails, ILoaderProps, ILoaderServices, Loader, } from "./loader.js";
|
|
9
|
+
export { driverSupportRequirements, loaderCoreCompatDetails, runtimeSupportRequirements, } from "./loaderLayerCompatState.js";
|
|
9
10
|
export { loadContainerPaused } from "./loadPaused.js";
|
|
10
11
|
export { isLocationRedirectionError, resolveWithLocationRedirectionHandling, } from "./location-redirection-utilities/index.js";
|
|
11
12
|
export { IProtocolHandler, ProtocolHandlerBuilder } from "./protocol.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,gCAAgC,GAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACN,6BAA6B,EAC7B,UAAU,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,gCAAgC,GAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACN,6BAA6B,EAC7B,UAAU,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { ConnectionState } from "./connectionState.js";
|
|
|
6
6
|
export { waitContainerToCatchUp } from "./container.js";
|
|
7
7
|
export { createDetachedContainer, loadExistingContainer, rehydrateDetachedContainer, } from "./createAndLoadContainerUtils.js";
|
|
8
8
|
export { Loader, } from "./loader.js";
|
|
9
|
+
export { driverSupportRequirements, loaderCoreCompatDetails, runtimeSupportRequirements, } from "./loaderLayerCompatState.js";
|
|
9
10
|
export { loadContainerPaused } from "./loadPaused.js";
|
|
10
11
|
export { isLocationRedirectionError, resolveWithLocationRedirectionHandling, } from "./location-redirection-utilities/index.js";
|
|
11
12
|
export { tryParseCompatibleResolvedUrl, } from "./utils.js";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAA0B,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,GAK1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAKN,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACN,6BAA6B,GAE7B,MAAM,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { IContainerExperimental, waitContainerToCatchUp } from \"./container.js\";\nexport {\n\tcreateDetachedContainer,\n\tloadExistingContainer,\n\trehydrateDetachedContainer,\n\tICreateAndLoadContainerProps,\n\tICreateDetachedContainerProps,\n\tILoadExistingContainerProps,\n\tIRehydrateDetachedContainerProps,\n} from \"./createAndLoadContainerUtils.js\";\nexport {\n\tICodeDetailsLoader,\n\tIFluidModuleWithDetails,\n\tILoaderProps,\n\tILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\tIParsedUrl,\n} from \"./utils.js\";\nexport {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAA0B,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACN,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,GAK1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAKN,MAAM,GACN,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACN,0BAA0B,EAC1B,sCAAsC,GACtC,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACN,6BAA6B,GAE7B,MAAM,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ConnectionState } from \"./connectionState.js\";\nexport { IContainerExperimental, waitContainerToCatchUp } from \"./container.js\";\nexport {\n\tcreateDetachedContainer,\n\tloadExistingContainer,\n\trehydrateDetachedContainer,\n\tICreateAndLoadContainerProps,\n\tICreateDetachedContainerProps,\n\tILoadExistingContainerProps,\n\tIRehydrateDetachedContainerProps,\n} from \"./createAndLoadContainerUtils.js\";\nexport {\n\tICodeDetailsLoader,\n\tIFluidModuleWithDetails,\n\tILoaderProps,\n\tILoaderServices,\n\tLoader,\n} from \"./loader.js\";\nexport {\n\tdriverSupportRequirements,\n\tloaderCoreCompatDetails,\n\truntimeSupportRequirements,\n} from \"./loaderLayerCompatState.js\";\nexport { loadContainerPaused } from \"./loadPaused.js\";\nexport {\n\tisLocationRedirectionError,\n\tresolveWithLocationRedirectionHandling,\n} from \"./location-redirection-utilities/index.js\";\nexport { IProtocolHandler, ProtocolHandlerBuilder } from \"./protocol.js\";\nexport {\n\ttryParseCompatibleResolvedUrl,\n\tIParsedUrl,\n} from \"./utils.js\";\nexport {\n\tIBaseProtocolHandler,\n\tIScribeProtocolState,\n\tIQuorumSnapshot,\n\tQuorumClientsSnapshot,\n\tQuorumProposalsSnapshot,\n} from \"./protocol/index.js\";\n"]}
|
|
@@ -28,9 +28,19 @@ export declare const loaderCompatDetailsForRuntime: ILayerCompatDetails;
|
|
|
28
28
|
* @internal
|
|
29
29
|
*/
|
|
30
30
|
export declare const runtimeSupportRequirements: ILayerCompatSupportRequirements;
|
|
31
|
+
/**
|
|
32
|
+
* The requirements that the Driver layer must meet to be compatible with this Loader.
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare const driverSupportRequirements: ILayerCompatSupportRequirements;
|
|
31
36
|
/**
|
|
32
37
|
* Validates that the Runtime layer is compatible with the Loader.
|
|
33
38
|
* @internal
|
|
34
39
|
*/
|
|
35
40
|
export declare function validateRuntimeCompatibility(maybeRuntimeCompatDetails: ILayerCompatDetails | undefined, disposeFn: (error?: ICriticalContainerError) => void): void;
|
|
41
|
+
/**
|
|
42
|
+
* Validates that the Driver layer is compatible with the Loader.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function validateDriverCompatibility(maybeDriverCompatDetails: ILayerCompatDetails | undefined, disposeFn: (error?: ICriticalContainerError) => void): void;
|
|
36
46
|
//# sourceMappingURL=loaderLayerCompatState.d.ts.map
|
|
@@ -1 +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"}
|
|
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,eAAO,MAAM,yBAAyB,EAAE,+BAUvC,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;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAC1C,wBAAwB,EAAE,mBAAmB,GAAG,SAAS,EACzD,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,uBAAuB,KAAK,IAAI,GAClD,IAAI,CAoBN"}
|
|
@@ -45,6 +45,21 @@ export const runtimeSupportRequirements = {
|
|
|
45
45
|
*/
|
|
46
46
|
requiredFeatures: [],
|
|
47
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* The requirements that the Driver layer must meet to be compatible with this Loader.
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export const driverSupportRequirements = {
|
|
53
|
+
/**
|
|
54
|
+
* Minimum generation that Driver must be at to be compatible with Loader. Note that 0 is used here for
|
|
55
|
+
* Driver layers before the introduction of the layer compatibility enforcement.
|
|
56
|
+
*/
|
|
57
|
+
minSupportedGeneration: 0,
|
|
58
|
+
/**
|
|
59
|
+
* The features that the Driver must support to be compatible with Loader.
|
|
60
|
+
*/
|
|
61
|
+
requiredFeatures: [],
|
|
62
|
+
};
|
|
48
63
|
/**
|
|
49
64
|
* Validates that the Runtime layer is compatible with the Loader.
|
|
50
65
|
* @internal
|
|
@@ -67,4 +82,26 @@ export function validateRuntimeCompatibility(maybeRuntimeCompatDetails, disposeF
|
|
|
67
82
|
throw error;
|
|
68
83
|
}
|
|
69
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Validates that the Driver layer is compatible with the Loader.
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
export function validateDriverCompatibility(maybeDriverCompatDetails, disposeFn) {
|
|
90
|
+
const layerCheckResult = checkLayerCompatibility(driverSupportRequirements, maybeDriverCompatDetails);
|
|
91
|
+
if (!layerCheckResult.isCompatible) {
|
|
92
|
+
const error = new UsageError("Loader is not compatible with Driver", {
|
|
93
|
+
errorDetails: JSON.stringify({
|
|
94
|
+
loaderVersion: loaderCoreCompatDetails.pkgVersion,
|
|
95
|
+
driverVersion: maybeDriverCompatDetails?.pkgVersion,
|
|
96
|
+
loaderGeneration: loaderCoreCompatDetails.generation,
|
|
97
|
+
driverGeneration: maybeDriverCompatDetails?.generation,
|
|
98
|
+
minSupportedGeneration: driverSupportRequirements.minSupportedGeneration,
|
|
99
|
+
isGenerationCompatible: layerCheckResult.isGenerationCompatible,
|
|
100
|
+
unsupportedFeatures: layerCheckResult.unsupportedFeatures,
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
disposeFn(error);
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
70
107
|
//# sourceMappingURL=loaderLayerCompatState.js.map
|
|
@@ -1 +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,0CAA0C,CAAC;AAEtE,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,0BAA0B,GAAoC;IAC1E;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;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,6BAA6B,CAAC,UAAU;gBACvD,cAAc,EAAE,yBAAyB,EAAE,UAAU;gBACrD,gBAAgB,EAAE,6BAA6B,CAAC,UAAU;gBAC1D,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 * 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"]}
|
|
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,0CAA0C,CAAC;AAEtE,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,0BAA0B,GAAoC;IAC1E;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAoC;IACzE;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;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,6BAA6B,CAAC,UAAU;gBACvD,cAAc,EAAE,yBAAyB,EAAE,UAAU;gBACrD,gBAAgB,EAAE,6BAA6B,CAAC,UAAU;gBAC1D,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;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAC1C,wBAAyD,EACzD,SAAoD;IAEpD,MAAM,gBAAgB,GAAG,uBAAuB,CAC/C,yBAAyB,EACzB,wBAAwB,CACxB,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,sCAAsC,EAAE;YACpE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;gBAC5B,aAAa,EAAE,uBAAuB,CAAC,UAAU;gBACjD,aAAa,EAAE,wBAAwB,EAAE,UAAU;gBACnD,gBAAgB,EAAE,uBAAuB,CAAC,UAAU;gBACpD,gBAAgB,EAAE,wBAAwB,EAAE,UAAU;gBACtD,sBAAsB,EAAE,yBAAyB,CAAC,sBAAsB;gBACxE,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 * 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 * The requirements that the Driver layer must meet to be compatible with this Loader.\n * @internal\n */\nexport const driverSupportRequirements: 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\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\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): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\tdriverSupportRequirements,\n\t\tmaybeDriverCompatDetails,\n\t);\n\tif (!layerCheckResult.isCompatible) {\n\t\tconst error = new UsageError(\"Loader is not compatible with Driver\", {\n\t\t\terrorDetails: JSON.stringify({\n\t\t\t\tloaderVersion: loaderCoreCompatDetails.pkgVersion,\n\t\t\t\tdriverVersion: maybeDriverCompatDetails?.pkgVersion,\n\t\t\t\tloaderGeneration: loaderCoreCompatDetails.generation,\n\t\t\t\tdriverGeneration: maybeDriverCompatDetails?.generation,\n\t\t\t\tminSupportedGeneration: driverSupportRequirements.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.43.0-343119";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,qCAAqC,CAAC;AAC1D,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
|
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,
|
|
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,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-loader\";\nexport const pkgVersion = \"2.43.0-343119\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-loader",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.43.0-343119",
|
|
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": "
|
|
123
|
-
"@fluidframework/container-definitions": "
|
|
124
|
-
"@fluidframework/core-interfaces": "
|
|
125
|
-
"@fluidframework/core-utils": "
|
|
126
|
-
"@fluidframework/driver-definitions": "
|
|
127
|
-
"@fluidframework/driver-utils": "
|
|
128
|
-
"@fluidframework/telemetry-utils": "
|
|
122
|
+
"@fluid-internal/client-utils": "2.43.0-343119",
|
|
123
|
+
"@fluidframework/container-definitions": "2.43.0-343119",
|
|
124
|
+
"@fluidframework/core-interfaces": "2.43.0-343119",
|
|
125
|
+
"@fluidframework/core-utils": "2.43.0-343119",
|
|
126
|
+
"@fluidframework/driver-definitions": "2.43.0-343119",
|
|
127
|
+
"@fluidframework/driver-utils": "2.43.0-343119",
|
|
128
|
+
"@fluidframework/telemetry-utils": "2.43.0-343119",
|
|
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,13 +136,13 @@
|
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
138
138
|
"@biomejs/biome": "~1.9.3",
|
|
139
|
-
"@fluid-internal/client-utils": "
|
|
140
|
-
"@fluid-internal/mocha-test-setup": "
|
|
141
|
-
"@fluid-private/test-loader-utils": "
|
|
139
|
+
"@fluid-internal/client-utils": "2.43.0-343119",
|
|
140
|
+
"@fluid-internal/mocha-test-setup": "2.43.0-343119",
|
|
141
|
+
"@fluid-private/test-loader-utils": "2.43.0-343119",
|
|
142
142
|
"@fluid-tools/build-cli": "^0.55.0",
|
|
143
143
|
"@fluidframework/build-common": "^2.0.3",
|
|
144
144
|
"@fluidframework/build-tools": "^0.55.0",
|
|
145
|
-
"@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.
|
|
145
|
+
"@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.42.0",
|
|
146
146
|
"@fluidframework/eslint-config-fluid": "^5.7.4",
|
|
147
147
|
"@microsoft/api-extractor": "7.52.8",
|
|
148
148
|
"@types/debug": "^4.1.5",
|
package/src/container.ts
CHANGED
|
@@ -128,7 +128,10 @@ import {
|
|
|
128
128
|
} from "./contracts.js";
|
|
129
129
|
import { DeltaManager, IConnectionArgs } from "./deltaManager.js";
|
|
130
130
|
import { RelativeLoader } from "./loader.js";
|
|
131
|
-
import {
|
|
131
|
+
import {
|
|
132
|
+
validateDriverCompatibility,
|
|
133
|
+
validateRuntimeCompatibility,
|
|
134
|
+
} from "./loaderLayerCompatState.js";
|
|
132
135
|
import {
|
|
133
136
|
createMemoryDetachedBlobStorage,
|
|
134
137
|
tryInitializeMemoryDetachedBlobStorage,
|
|
@@ -1336,20 +1339,10 @@ export class Container
|
|
|
1336
1339
|
createNewResolvedUrl !== undefined,
|
|
1337
1340
|
0x2c4 /* "client should not be summarizer before container is created" */,
|
|
1338
1341
|
);
|
|
1339
|
-
this.service = await
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
createNewResolvedUrl,
|
|
1344
|
-
this.subLogger,
|
|
1345
|
-
false, // clientIsSummarizer
|
|
1346
|
-
),
|
|
1347
|
-
"containerAttach",
|
|
1348
|
-
this.mc.logger,
|
|
1349
|
-
{
|
|
1350
|
-
cancel: this._deltaManager.closeAbortController.signal,
|
|
1351
|
-
}, // progress
|
|
1352
|
-
);
|
|
1342
|
+
this.service = await this.createDocumentService(createNewResolvedUrl, {
|
|
1343
|
+
mode: "attach",
|
|
1344
|
+
summary,
|
|
1345
|
+
});
|
|
1353
1346
|
}
|
|
1354
1347
|
this.storageAdapter.connectToService(this.service);
|
|
1355
1348
|
return this.storageAdapter;
|
|
@@ -1588,14 +1581,51 @@ export class Container
|
|
|
1588
1581
|
this.emit("metadataUpdate", metadata);
|
|
1589
1582
|
};
|
|
1590
1583
|
|
|
1584
|
+
/**
|
|
1585
|
+
* Creates a document service during container attachment or loading.
|
|
1586
|
+
* @param resolvedUrl - The resolved URL of the container.
|
|
1587
|
+
* @param props - Properties indicating whether to load or attach the container. For attaching,
|
|
1588
|
+
* a summary tree can be provided.
|
|
1589
|
+
* @remarks This method validates that the driver is compatible with the Loader.
|
|
1590
|
+
*/
|
|
1591
1591
|
private async createDocumentService(
|
|
1592
|
-
|
|
1592
|
+
resolvedUrl: IResolvedUrl,
|
|
1593
|
+
props: { mode: "load" } | { mode: "attach"; summary: ISummaryTree | undefined },
|
|
1593
1594
|
): Promise<IDocumentService> {
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1595
|
+
let service: IDocumentService;
|
|
1596
|
+
if (props.mode === "load") {
|
|
1597
|
+
service = await this.serviceFactory.createDocumentService(
|
|
1598
|
+
resolvedUrl,
|
|
1599
|
+
this.subLogger,
|
|
1600
|
+
this.client.details.type === summarizerClientType,
|
|
1601
|
+
);
|
|
1602
|
+
if (service.on !== undefined) {
|
|
1603
|
+
// Back-compat for Old driver
|
|
1604
|
+
service.on("metadataUpdate", this.metadataUpdateHandler);
|
|
1605
|
+
}
|
|
1606
|
+
} else {
|
|
1607
|
+
service = await runWithRetry(
|
|
1608
|
+
async () =>
|
|
1609
|
+
this.serviceFactory.createContainer(
|
|
1610
|
+
props.summary,
|
|
1611
|
+
resolvedUrl,
|
|
1612
|
+
this.subLogger,
|
|
1613
|
+
false, // clientIsSummarizer
|
|
1614
|
+
),
|
|
1615
|
+
"containerAttach",
|
|
1616
|
+
this.mc.logger,
|
|
1617
|
+
{
|
|
1618
|
+
cancel: this._deltaManager.closeAbortController.signal,
|
|
1619
|
+
}, // progress
|
|
1620
|
+
);
|
|
1598
1621
|
}
|
|
1622
|
+
|
|
1623
|
+
// Validate that the Driver is compatible with this Loader.
|
|
1624
|
+
const maybeDriverCompatDetails = service as FluidObject<ILayerCompatDetails>;
|
|
1625
|
+
validateDriverCompatibility(maybeDriverCompatDetails.ILayerCompatDetails, (error) =>
|
|
1626
|
+
this.dispose(error),
|
|
1627
|
+
);
|
|
1628
|
+
|
|
1599
1629
|
return service;
|
|
1600
1630
|
}
|
|
1601
1631
|
|
|
@@ -1616,13 +1646,7 @@ export class Container
|
|
|
1616
1646
|
dmLastKnownSeqNumber: number;
|
|
1617
1647
|
}> {
|
|
1618
1648
|
const timings: Record<string, number> = { phase1: performanceNow() };
|
|
1619
|
-
this.service = await this.createDocumentService(
|
|
1620
|
-
this.serviceFactory.createDocumentService(
|
|
1621
|
-
resolvedUrl,
|
|
1622
|
-
this.subLogger,
|
|
1623
|
-
this.client.details.type === summarizerClientType,
|
|
1624
|
-
),
|
|
1625
|
-
);
|
|
1649
|
+
this.service = await this.createDocumentService(resolvedUrl, { mode: "load" });
|
|
1626
1650
|
|
|
1627
1651
|
// Except in cases where it has stashed ops or requested by feature gate, the container will connect in "read" mode
|
|
1628
1652
|
const mode =
|
|
@@ -2486,13 +2510,11 @@ export class Container
|
|
|
2486
2510
|
*/
|
|
2487
2511
|
private setContextConnectedState(connected: boolean, readonly: boolean): void {
|
|
2488
2512
|
if (this._runtime?.disposed === false && this.loaded) {
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
*/
|
|
2495
|
-
this.runtime.setConnectionState(connected && !readonly, this.clientId);
|
|
2513
|
+
this.runtime.setConnectionState(
|
|
2514
|
+
connected &&
|
|
2515
|
+
!readonly /* container can send ops if connected to service and not in readonly mode */,
|
|
2516
|
+
this.clientId,
|
|
2517
|
+
);
|
|
2496
2518
|
}
|
|
2497
2519
|
}
|
|
2498
2520
|
|
package/src/index.ts
CHANGED
|
@@ -21,6 +21,11 @@ export {
|
|
|
21
21
|
ILoaderServices,
|
|
22
22
|
Loader,
|
|
23
23
|
} from "./loader.js";
|
|
24
|
+
export {
|
|
25
|
+
driverSupportRequirements,
|
|
26
|
+
loaderCoreCompatDetails,
|
|
27
|
+
runtimeSupportRequirements,
|
|
28
|
+
} from "./loaderLayerCompatState.js";
|
|
24
29
|
export { loadContainerPaused } from "./loadPaused.js";
|
|
25
30
|
export {
|
|
26
31
|
isLocationRedirectionError,
|
|
@@ -56,6 +56,22 @@ export const runtimeSupportRequirements: ILayerCompatSupportRequirements = {
|
|
|
56
56
|
requiredFeatures: [],
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* The requirements that the Driver layer must meet to be compatible with this Loader.
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export const driverSupportRequirements: ILayerCompatSupportRequirements = {
|
|
64
|
+
/**
|
|
65
|
+
* Minimum generation that Driver must be at to be compatible with Loader. Note that 0 is used here for
|
|
66
|
+
* Driver layers before the introduction of the layer compatibility enforcement.
|
|
67
|
+
*/
|
|
68
|
+
minSupportedGeneration: 0,
|
|
69
|
+
/**
|
|
70
|
+
* The features that the Driver must support to be compatible with Loader.
|
|
71
|
+
*/
|
|
72
|
+
requiredFeatures: [],
|
|
73
|
+
};
|
|
74
|
+
|
|
59
75
|
/**
|
|
60
76
|
* Validates that the Runtime layer is compatible with the Loader.
|
|
61
77
|
* @internal
|
|
@@ -84,3 +100,32 @@ export function validateRuntimeCompatibility(
|
|
|
84
100
|
throw error;
|
|
85
101
|
}
|
|
86
102
|
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Validates that the Driver layer is compatible with the Loader.
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
export function validateDriverCompatibility(
|
|
109
|
+
maybeDriverCompatDetails: ILayerCompatDetails | undefined,
|
|
110
|
+
disposeFn: (error?: ICriticalContainerError) => void,
|
|
111
|
+
): void {
|
|
112
|
+
const layerCheckResult = checkLayerCompatibility(
|
|
113
|
+
driverSupportRequirements,
|
|
114
|
+
maybeDriverCompatDetails,
|
|
115
|
+
);
|
|
116
|
+
if (!layerCheckResult.isCompatible) {
|
|
117
|
+
const error = new UsageError("Loader is not compatible with Driver", {
|
|
118
|
+
errorDetails: JSON.stringify({
|
|
119
|
+
loaderVersion: loaderCoreCompatDetails.pkgVersion,
|
|
120
|
+
driverVersion: maybeDriverCompatDetails?.pkgVersion,
|
|
121
|
+
loaderGeneration: loaderCoreCompatDetails.generation,
|
|
122
|
+
driverGeneration: maybeDriverCompatDetails?.generation,
|
|
123
|
+
minSupportedGeneration: driverSupportRequirements.minSupportedGeneration,
|
|
124
|
+
isGenerationCompatible: layerCheckResult.isGenerationCompatible,
|
|
125
|
+
unsupportedFeatures: layerCheckResult.unsupportedFeatures,
|
|
126
|
+
}),
|
|
127
|
+
});
|
|
128
|
+
disposeFn(error);
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
131
|
+
}
|
package/src/packageVersion.ts
CHANGED