@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.
Files changed (60) hide show
  1. package/CHANGELOG.md +363 -341
  2. package/api-report/container-loader.legacy.alpha.api.md +0 -6
  3. package/dist/container.d.ts +3 -0
  4. package/dist/container.d.ts.map +1 -1
  5. package/dist/container.js +6 -2
  6. package/dist/container.js.map +1 -1
  7. package/dist/containerContext.d.ts +4 -0
  8. package/dist/containerContext.d.ts.map +1 -1
  9. package/dist/containerContext.js +6 -2
  10. package/dist/containerContext.js.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/legacy.d.ts +0 -1
  15. package/dist/loader.d.ts +1 -15
  16. package/dist/loader.d.ts.map +1 -1
  17. package/dist/loader.js.map +1 -1
  18. package/dist/{layerCompatState.d.ts → loaderLayerCompatState.d.ts} +20 -3
  19. package/dist/loaderLayerCompatState.d.ts.map +1 -0
  20. package/dist/{layerCompatState.js → loaderLayerCompatState.js} +19 -9
  21. package/dist/loaderLayerCompatState.js.map +1 -0
  22. package/dist/packageVersion.d.ts +1 -1
  23. package/dist/packageVersion.js +1 -1
  24. package/dist/packageVersion.js.map +1 -1
  25. package/lib/container.d.ts +3 -0
  26. package/lib/container.d.ts.map +1 -1
  27. package/lib/container.js +5 -1
  28. package/lib/container.js.map +1 -1
  29. package/lib/containerContext.d.ts +4 -0
  30. package/lib/containerContext.d.ts.map +1 -1
  31. package/lib/containerContext.js +6 -2
  32. package/lib/containerContext.js.map +1 -1
  33. package/lib/index.d.ts +1 -1
  34. package/lib/index.d.ts.map +1 -1
  35. package/lib/index.js.map +1 -1
  36. package/lib/legacy.d.ts +0 -1
  37. package/lib/loader.d.ts +1 -15
  38. package/lib/loader.d.ts.map +1 -1
  39. package/lib/loader.js.map +1 -1
  40. package/lib/{layerCompatState.d.ts → loaderLayerCompatState.d.ts} +20 -3
  41. package/lib/loaderLayerCompatState.d.ts.map +1 -0
  42. package/lib/{layerCompatState.js → loaderLayerCompatState.js} +18 -8
  43. package/lib/loaderLayerCompatState.js.map +1 -0
  44. package/lib/packageVersion.d.ts +1 -1
  45. package/lib/packageVersion.js +1 -1
  46. package/lib/packageVersion.js.map +1 -1
  47. package/lib/tsdoc-metadata.json +1 -1
  48. package/package.json +14 -17
  49. package/src/container.ts +5 -1
  50. package/src/containerContext.ts +6 -2
  51. package/src/index.ts +0 -1
  52. package/src/loader.ts +1 -16
  53. package/src/{layerCompatState.ts → loaderLayerCompatState.ts} +18 -7
  54. package/src/packageVersion.ts +1 -1
  55. package/tsconfig.json +1 -0
  56. package/dist/layerCompatState.d.ts.map +0 -1
  57. package/dist/layerCompatState.js.map +0 -1
  58. package/lib/layerCompatState.d.ts.map +0 -1
  59. package/lib/layerCompatState.js.map +0 -1
  60. 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
- * Loader's compatibility details that is exposed to the Runtime layer.
17
+ * The core compatibility details of the Loader layer that is the same across all layer boundaries.
18
+ * @internal
18
19
  */
19
- export const LoaderCompatDetails: ILayerCompatDetails = {
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 RuntimeSupportRequirements: ILayerCompatSupportRequirements = {
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
- RuntimeSupportRequirements,
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: LoaderCompatDetails.pkgVersion,
74
+ loaderVersion: loaderCompatDetailsForRuntime.pkgVersion,
64
75
  runtimeVersion: maybeRuntimeCompatDetails?.pkgVersion,
65
- loaderGeneration: LoaderCompatDetails.generation,
76
+ loaderGeneration: loaderCompatDetailsForRuntime.generation,
66
77
  runtimeGeneration: maybeRuntimeCompatDetails?.generation,
67
- minSupportedGeneration: RuntimeSupportRequirements.minSupportedGeneration,
78
+ minSupportedGeneration: runtimeSupportRequirements.minSupportedGeneration,
68
79
  isGenerationCompatible: layerCheckResult.isGenerationCompatible,
69
80
  unsupportedFeatures: layerCheckResult.unsupportedFeatures,
70
81
  }),
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "2.23.0";
9
+ export const pkgVersion = "2.31.0";
package/tsconfig.json CHANGED
@@ -5,6 +5,7 @@
5
5
  "compilerOptions": {
6
6
  "rootDir": "./src",
7
7
  "outDir": "./lib",
8
+ // TODO: AB#34166 Enable noUncheckedIndexedAccess for packages/loader/container-loader
8
9
  "noUncheckedIndexedAccess": false,
9
10
  "exactOptionalPropertyTypes": false,
10
11
  },
@@ -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,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BAAiB,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"]}
@@ -1,8 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- module.exports = {
7
- ...require("@fluidframework/build-common/prettier.config.cjs"),
8
- };