@fluidframework/container-loader 2.23.0 → 2.31.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 +363 -341
- package/api-report/container-loader.legacy.alpha.api.md +0 -6
- package/dist/container.d.ts +3 -0
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +6 -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/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 -15
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.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 +3 -0
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +5 -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/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 -15
- package/lib/loader.d.ts.map +1 -1
- package/lib/loader.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 -17
- package/src/container.ts +5 -1
- package/src/containerContext.ts +6 -2
- package/src/index.ts +0 -1
- package/src/loader.ts +1 -16
- 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
|
@@ -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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,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"]}
|