@fluidframework/container-loader 2.43.0-343119 → 2.50.0-345060

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/lib/index.d.ts CHANGED
@@ -6,7 +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
+ export { driverSupportRequirementsForLoader, loaderCoreCompatDetails, runtimeSupportRequirementsForLoader, loaderCompatDetailsForRuntime, } from "./loaderLayerCompatState.js";
10
10
  export { loadContainerPaused } from "./loadPaused.js";
11
11
  export { isLocationRedirectionError, resolveWithLocationRedirectionHandling, } from "./location-redirection-utilities/index.js";
12
12
  export { IProtocolHandler, ProtocolHandlerBuilder } from "./protocol.js";
@@ -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,EACN,y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oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,qBAAqB,CAAC"}
package/lib/index.js CHANGED
@@ -6,7 +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
+ export { driverSupportRequirementsForLoader, loaderCoreCompatDetails, runtimeSupportRequirementsForLoader, loaderCompatDetailsForRuntime, } from "./loaderLayerCompatState.js";
10
10
  export { loadContainerPaused } from "./loadPaused.js";
11
11
  export { isLocationRedirectionError, resolveWithLocationRedirectionHandling, } from "./location-redirection-utilities/index.js";
12
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,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"]}
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,kCAAkC,EAClC,uBAAuB,EACvB,mCAAmC,EACnC,6BAA6B,GAC7B,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\tdriverSupportRequirementsForLoader,\n\tloaderCoreCompatDetails,\n\truntimeSupportRequirementsForLoader,\n\tloaderCompatDetailsForRuntime,\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"]}
@@ -27,17 +27,17 @@ export declare const loaderCompatDetailsForRuntime: ILayerCompatDetails;
27
27
  * The requirements that the Runtime layer must meet to be compatible with this Loader.
28
28
  * @internal
29
29
  */
30
- export declare const runtimeSupportRequirements: ILayerCompatSupportRequirements;
30
+ export declare const runtimeSupportRequirementsForLoader: ILayerCompatSupportRequirements;
31
31
  /**
32
32
  * The requirements that the Driver layer must meet to be compatible with this Loader.
33
33
  * @internal
34
34
  */
35
- export declare const driverSupportRequirements: ILayerCompatSupportRequirements;
35
+ export declare const driverSupportRequirementsForLoader: ILayerCompatSupportRequirements;
36
36
  /**
37
- * Validates that the Runtime layer is compatible with the Loader.
37
+ * Validates that the Runtime layer is compatible with the Loader. *
38
38
  * @internal
39
39
  */
40
- export declare function validateRuntimeCompatibility(maybeRuntimeCompatDetails: ILayerCompatDetails | undefined, disposeFn: (error?: ICriticalContainerError) => void): void;
40
+ export declare function validateRuntimeCompatibility(maybeRuntimeCompatDetails: ILayerCompatDetails | undefined): void;
41
41
  /**
42
42
  * Validates that the Driver layer is compatible with the Loader.
43
43
  * @internal
@@ -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,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"}
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,mCAAmC,EAAE,+BAUjD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kCAAkC,EAAE,+BAUhD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,4BAA4B,CAC3C,yBAAyB,EAAE,mBAAmB,GAAG,SAAS,GACxD,IAAI,CAmBN;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAC1C,wBAAwB,EAAE,mBAAmB,GAAG,SAAS,EACzD,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,uBAAuB,KAAK,IAAI,GAClD,IAAI,CAoBN"}
@@ -34,7 +34,7 @@ export const loaderCompatDetailsForRuntime = {
34
34
  * The requirements that the Runtime layer must meet to be compatible with this Loader.
35
35
  * @internal
36
36
  */
37
- export const runtimeSupportRequirements = {
37
+ export const runtimeSupportRequirementsForLoader = {
38
38
  /**
39
39
  * Minimum generation that Runtime must be at to be compatible with Loader. Note that 0 is used here for
40
40
  * Runtime layers before the introduction of the layer compatibility enforcement.
@@ -49,7 +49,7 @@ export const runtimeSupportRequirements = {
49
49
  * The requirements that the Driver layer must meet to be compatible with this Loader.
50
50
  * @internal
51
51
  */
52
- export const driverSupportRequirements = {
52
+ export const driverSupportRequirementsForLoader = {
53
53
  /**
54
54
  * Minimum generation that Driver must be at to be compatible with Loader. Note that 0 is used here for
55
55
  * Driver layers before the introduction of the layer compatibility enforcement.
@@ -61,11 +61,11 @@ export const driverSupportRequirements = {
61
61
  requiredFeatures: [],
62
62
  };
63
63
  /**
64
- * Validates that the Runtime layer is compatible with the Loader.
64
+ * Validates that the Runtime layer is compatible with the Loader. *
65
65
  * @internal
66
66
  */
67
- export function validateRuntimeCompatibility(maybeRuntimeCompatDetails, disposeFn) {
68
- const layerCheckResult = checkLayerCompatibility(runtimeSupportRequirements, maybeRuntimeCompatDetails);
67
+ export function validateRuntimeCompatibility(maybeRuntimeCompatDetails) {
68
+ const layerCheckResult = checkLayerCompatibility(runtimeSupportRequirementsForLoader, maybeRuntimeCompatDetails);
69
69
  if (!layerCheckResult.isCompatible) {
70
70
  const error = new UsageError("Loader is not compatible with Runtime", {
71
71
  errorDetails: JSON.stringify({
@@ -73,12 +73,11 @@ export function validateRuntimeCompatibility(maybeRuntimeCompatDetails, disposeF
73
73
  runtimeVersion: maybeRuntimeCompatDetails?.pkgVersion,
74
74
  loaderGeneration: loaderCompatDetailsForRuntime.generation,
75
75
  runtimeGeneration: maybeRuntimeCompatDetails?.generation,
76
- minSupportedGeneration: runtimeSupportRequirements.minSupportedGeneration,
76
+ minSupportedGeneration: runtimeSupportRequirementsForLoader.minSupportedGeneration,
77
77
  isGenerationCompatible: layerCheckResult.isGenerationCompatible,
78
78
  unsupportedFeatures: layerCheckResult.unsupportedFeatures,
79
79
  }),
80
80
  });
81
- disposeFn(error);
82
81
  throw error;
83
82
  }
84
83
  }
@@ -87,7 +86,7 @@ export function validateRuntimeCompatibility(maybeRuntimeCompatDetails, disposeF
87
86
  * @internal
88
87
  */
89
88
  export function validateDriverCompatibility(maybeDriverCompatDetails, disposeFn) {
90
- const layerCheckResult = checkLayerCompatibility(driverSupportRequirements, maybeDriverCompatDetails);
89
+ const layerCheckResult = checkLayerCompatibility(driverSupportRequirementsForLoader, maybeDriverCompatDetails);
91
90
  if (!layerCheckResult.isCompatible) {
92
91
  const error = new UsageError("Loader is not compatible with Driver", {
93
92
  errorDetails: JSON.stringify({
@@ -95,7 +94,7 @@ export function validateDriverCompatibility(maybeDriverCompatDetails, disposeFn)
95
94
  driverVersion: maybeDriverCompatDetails?.pkgVersion,
96
95
  loaderGeneration: loaderCoreCompatDetails.generation,
97
96
  driverGeneration: maybeDriverCompatDetails?.generation,
98
- minSupportedGeneration: driverSupportRequirements.minSupportedGeneration,
97
+ minSupportedGeneration: driverSupportRequirementsForLoader.minSupportedGeneration,
99
98
  isGenerationCompatible: layerCheckResult.isGenerationCompatible,
100
99
  unsupportedFeatures: layerCheckResult.unsupportedFeatures,
101
100
  }),
@@ -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,CAAC,MAAM,yBAAyB,GAAoC;IACzE;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;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AAsB,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"]}
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,mCAAmC,GAAoC;IACnF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAoC;IAClF;;;OAGG;IACH,sBAAsB,EAAE,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,EAAE;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC3C,yBAA0D;IAE1D,MAAM,gBAAgB,GAAG,uBAAuB,CAC/C,mCAAmC,EACnC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AC;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 runtimeSupportRequirementsForLoader: 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 driverSupportRequirementsForLoader: 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): void {\n\tconst layerCheckResult = checkLayerCompatibility(\n\t\truntimeSupportRequirementsForLoader,\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: runtimeSupportRequirementsForLoader.minSupportedGeneration,\n\t\t\t\tisGenerationCompatible: layerCheckResult.isGenerationCompatible,\n\t\t\t\tunsupportedFeatures: layerCheckResult.unsupportedFeatures,\n\t\t\t}),\n\t\t});\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\tdriverSupportRequirementsForLoader,\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: driverSupportRequirementsForLoader.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"]}
@@ -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.43.0-343119";
8
+ export declare const pkgVersion = "2.50.0-345060";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/container-loader";
8
- export const pkgVersion = "2.43.0-343119";
8
+ export const pkgVersion = "2.50.0-345060";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -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,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"]}
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.50.0-345060\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-loader",
3
- "version": "2.43.0-343119",
3
+ "version": "2.50.0-345060",
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.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",
122
+ "@fluid-internal/client-utils": "2.50.0-345060",
123
+ "@fluidframework/container-definitions": "2.50.0-345060",
124
+ "@fluidframework/core-interfaces": "2.50.0-345060",
125
+ "@fluidframework/core-utils": "2.50.0-345060",
126
+ "@fluidframework/driver-definitions": "2.50.0-345060",
127
+ "@fluidframework/driver-utils": "2.50.0-345060",
128
+ "@fluidframework/telemetry-utils": "2.50.0-345060",
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": "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
- "@fluid-tools/build-cli": "^0.55.0",
139
+ "@fluid-internal/client-utils": "2.50.0-345060",
140
+ "@fluid-internal/mocha-test-setup": "2.50.0-345060",
141
+ "@fluid-private/test-loader-utils": "2.50.0-345060",
142
+ "@fluid-tools/build-cli": "^0.56.0",
143
143
  "@fluidframework/build-common": "^2.0.3",
144
- "@fluidframework/build-tools": "^0.55.0",
145
- "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.42.0",
144
+ "@fluidframework/build-tools": "^0.56.0",
145
+ "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@2.43.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
@@ -2415,83 +2415,84 @@ export class Container
2415
2415
  ): Promise<void> {
2416
2416
  assert(this._runtime?.disposed !== false, 0x0dd /* "Existing runtime not disposed" */);
2417
2417
 
2418
- // The relative loader will proxy requests to '/' to the loader itself assuming no non-cache flags
2419
- // are set. Global requests will still go directly to the loader
2420
- const maybeLoader: FluidObject<ILoader> = this.scope;
2421
- const loader = new RelativeLoader(this, maybeLoader.ILoader);
2422
-
2423
- const loadCodeResult = await PerformanceEvent.timedExecAsync(
2424
- this.subLogger,
2425
- { eventName: "CodeLoad" },
2426
- async () => this.codeLoader.load(codeDetails),
2427
- );
2428
-
2429
- this._loadedModule = {
2430
- module: loadCodeResult.module,
2431
- // An older interface ICodeLoader could return an IFluidModule which didn't have details.
2432
- // If we're using one of those older ICodeLoaders, then we fix up the module with the specified details here.
2433
- // TODO: Determine if this is still a realistic scenario or if this fixup could be removed.
2434
- details: loadCodeResult.details ?? codeDetails,
2435
- };
2436
-
2437
- const fluidExport: FluidObject<IProvideRuntimeFactory> | undefined =
2438
- this._loadedModule.module.fluidExport;
2439
- const runtimeFactory = fluidExport?.IRuntimeFactory;
2440
- if (runtimeFactory === undefined) {
2441
- throw new Error(packageNotFactoryError);
2442
- }
2418
+ try {
2419
+ // The relative loader will proxy requests to '/' to the loader itself assuming no non-cache flags
2420
+ // are set. Global requests will still go directly to the loader
2421
+ const maybeLoader: FluidObject<ILoader> = this.scope;
2422
+ const loader = new RelativeLoader(this, maybeLoader.ILoader);
2443
2423
 
2444
- const existing = snapshotTree !== undefined;
2424
+ const loadCodeResult = await PerformanceEvent.timedExecAsync(
2425
+ this.subLogger,
2426
+ { eventName: "CodeLoad" },
2427
+ async () => this.codeLoader.load(codeDetails),
2428
+ );
2445
2429
 
2446
- const context = new ContainerContext(
2447
- this.options,
2448
- this.scope,
2449
- snapshotTree,
2450
- this._loadedFromVersion,
2451
- this._deltaManager,
2452
- this.storageAdapter,
2453
- this.protocolHandler.quorum,
2454
- this.protocolHandler.audience,
2455
- loader,
2456
- (type, contents, batch, metadata) =>
2457
- this.submitContainerMessage(type, contents, batch, metadata),
2458
- (summaryOp: ISummaryContent, referenceSequenceNumber?: number) =>
2459
- this.submitSummaryMessage(summaryOp, referenceSequenceNumber),
2460
- (batch: IBatchMessage[], referenceSequenceNumber?: number) =>
2461
- this.submitBatch(batch, referenceSequenceNumber),
2462
- (content, targetClientId) => this.submitSignal(content, targetClientId),
2463
- (error?: ICriticalContainerError) => this.dispose(error),
2464
- (error?: ICriticalContainerError) => this.close(error),
2465
- this.updateDirtyContainerState,
2466
- this.getAbsoluteUrl,
2467
- () => this.resolvedUrl?.id,
2468
- () => this.clientId,
2469
- () => this.attachState,
2470
- () => this.connected,
2471
- this._deltaManager.clientDetails,
2472
- existing,
2473
- this.subLogger,
2474
- pendingLocalState,
2475
- snapshot,
2476
- );
2430
+ this._loadedModule = {
2431
+ module: loadCodeResult.module,
2432
+ // An older interface ICodeLoader could return an IFluidModule which didn't have details.
2433
+ // If we're using one of those older ICodeLoaders, then we fix up the module with the specified details here.
2434
+ // TODO: Determine if this is still a realistic scenario or if this fixup could be removed.
2435
+ details: loadCodeResult.details ?? codeDetails,
2436
+ };
2477
2437
 
2478
- const runtime = await PerformanceEvent.timedExecAsync(
2479
- this.subLogger,
2480
- { eventName: "InstantiateRuntime" },
2481
- async () => runtimeFactory.instantiateRuntime(context, existing),
2482
- );
2438
+ const fluidExport: FluidObject<IProvideRuntimeFactory> | undefined =
2439
+ this._loadedModule.module.fluidExport;
2440
+ const runtimeFactory = fluidExport?.IRuntimeFactory;
2441
+ if (runtimeFactory === undefined) {
2442
+ throw new Error(packageNotFactoryError);
2443
+ }
2483
2444
 
2484
- // Validate that the Runtime is compatible with this Loader.
2485
- const maybeRuntimeCompatDetails = runtime as FluidObject<ILayerCompatDetails>;
2486
- validateRuntimeCompatibility(maybeRuntimeCompatDetails.ILayerCompatDetails, (error) =>
2487
- this.dispose(error),
2488
- );
2445
+ const existing = snapshotTree !== undefined;
2446
+
2447
+ const context = new ContainerContext(
2448
+ this.options,
2449
+ this.scope,
2450
+ snapshotTree,
2451
+ this._loadedFromVersion,
2452
+ this._deltaManager,
2453
+ this.storageAdapter,
2454
+ this.protocolHandler.quorum,
2455
+ this.protocolHandler.audience,
2456
+ loader,
2457
+ (type, contents, batch, metadata) =>
2458
+ this.submitContainerMessage(type, contents, batch, metadata),
2459
+ (summaryOp: ISummaryContent, referenceSequenceNumber?: number) =>
2460
+ this.submitSummaryMessage(summaryOp, referenceSequenceNumber),
2461
+ (batch: IBatchMessage[], referenceSequenceNumber?: number) =>
2462
+ this.submitBatch(batch, referenceSequenceNumber),
2463
+ (content, targetClientId) => this.submitSignal(content, targetClientId),
2464
+ (error?: ICriticalContainerError) => this.dispose(error),
2465
+ (error?: ICriticalContainerError) => this.close(error),
2466
+ this.updateDirtyContainerState,
2467
+ this.getAbsoluteUrl,
2468
+ () => this.resolvedUrl?.id,
2469
+ () => this.clientId,
2470
+ () => this.attachState,
2471
+ () => this.connected,
2472
+ this._deltaManager.clientDetails,
2473
+ existing,
2474
+ this.subLogger,
2475
+ pendingLocalState,
2476
+ snapshot,
2477
+ );
2489
2478
 
2490
- this._runtime = runtime;
2479
+ const runtime = await PerformanceEvent.timedExecAsync(
2480
+ this.subLogger,
2481
+ { eventName: "InstantiateRuntime" },
2482
+ async () => runtimeFactory.instantiateRuntime(context, existing),
2483
+ );
2491
2484
 
2492
- this._lifecycleEvents.emit("runtimeInstantiated");
2485
+ // Validate that the Runtime is compatible with this Loader.
2486
+ const maybeRuntimeCompatDetails = runtime as FluidObject<ILayerCompatDetails>;
2487
+ validateRuntimeCompatibility(maybeRuntimeCompatDetails.ILayerCompatDetails);
2493
2488
 
2494
- this._loadedCodeDetails = codeDetails;
2489
+ this._runtime = runtime;
2490
+ this._lifecycleEvents.emit("runtimeInstantiated");
2491
+ this._loadedCodeDetails = codeDetails;
2492
+ } catch (error) {
2493
+ this.dispose(normalizeError(error));
2494
+ throw error;
2495
+ }
2495
2496
  }
2496
2497
 
2497
2498
  private readonly updateDirtyContainerState = (dirty: boolean): void => {
package/src/index.ts CHANGED
@@ -22,9 +22,10 @@ export {
22
22
  Loader,
23
23
  } from "./loader.js";
24
24
  export {
25
- driverSupportRequirements,
25
+ driverSupportRequirementsForLoader,
26
26
  loaderCoreCompatDetails,
27
- runtimeSupportRequirements,
27
+ runtimeSupportRequirementsForLoader,
28
+ loaderCompatDetailsForRuntime,
28
29
  } from "./loaderLayerCompatState.js";
29
30
  export { loadContainerPaused } from "./loadPaused.js";
30
31
  export {
@@ -44,7 +44,7 @@ export const loaderCompatDetailsForRuntime: ILayerCompatDetails = {
44
44
  * The requirements that the Runtime layer must meet to be compatible with this Loader.
45
45
  * @internal
46
46
  */
47
- export const runtimeSupportRequirements: ILayerCompatSupportRequirements = {
47
+ export const runtimeSupportRequirementsForLoader: ILayerCompatSupportRequirements = {
48
48
  /**
49
49
  * Minimum generation that Runtime must be at to be compatible with Loader. Note that 0 is used here for
50
50
  * Runtime layers before the introduction of the layer compatibility enforcement.
@@ -60,7 +60,7 @@ export const runtimeSupportRequirements: ILayerCompatSupportRequirements = {
60
60
  * The requirements that the Driver layer must meet to be compatible with this Loader.
61
61
  * @internal
62
62
  */
63
- export const driverSupportRequirements: ILayerCompatSupportRequirements = {
63
+ export const driverSupportRequirementsForLoader: ILayerCompatSupportRequirements = {
64
64
  /**
65
65
  * Minimum generation that Driver must be at to be compatible with Loader. Note that 0 is used here for
66
66
  * Driver layers before the introduction of the layer compatibility enforcement.
@@ -73,15 +73,14 @@ export const driverSupportRequirements: ILayerCompatSupportRequirements = {
73
73
  };
74
74
 
75
75
  /**
76
- * Validates that the Runtime layer is compatible with the Loader.
76
+ * Validates that the Runtime layer is compatible with the Loader. *
77
77
  * @internal
78
78
  */
79
79
  export function validateRuntimeCompatibility(
80
80
  maybeRuntimeCompatDetails: ILayerCompatDetails | undefined,
81
- disposeFn: (error?: ICriticalContainerError) => void,
82
81
  ): void {
83
82
  const layerCheckResult = checkLayerCompatibility(
84
- runtimeSupportRequirements,
83
+ runtimeSupportRequirementsForLoader,
85
84
  maybeRuntimeCompatDetails,
86
85
  );
87
86
  if (!layerCheckResult.isCompatible) {
@@ -91,12 +90,11 @@ export function validateRuntimeCompatibility(
91
90
  runtimeVersion: maybeRuntimeCompatDetails?.pkgVersion,
92
91
  loaderGeneration: loaderCompatDetailsForRuntime.generation,
93
92
  runtimeGeneration: maybeRuntimeCompatDetails?.generation,
94
- minSupportedGeneration: runtimeSupportRequirements.minSupportedGeneration,
93
+ minSupportedGeneration: runtimeSupportRequirementsForLoader.minSupportedGeneration,
95
94
  isGenerationCompatible: layerCheckResult.isGenerationCompatible,
96
95
  unsupportedFeatures: layerCheckResult.unsupportedFeatures,
97
96
  }),
98
97
  });
99
- disposeFn(error);
100
98
  throw error;
101
99
  }
102
100
  }
@@ -110,7 +108,7 @@ export function validateDriverCompatibility(
110
108
  disposeFn: (error?: ICriticalContainerError) => void,
111
109
  ): void {
112
110
  const layerCheckResult = checkLayerCompatibility(
113
- driverSupportRequirements,
111
+ driverSupportRequirementsForLoader,
114
112
  maybeDriverCompatDetails,
115
113
  );
116
114
  if (!layerCheckResult.isCompatible) {
@@ -120,7 +118,7 @@ export function validateDriverCompatibility(
120
118
  driverVersion: maybeDriverCompatDetails?.pkgVersion,
121
119
  loaderGeneration: loaderCoreCompatDetails.generation,
122
120
  driverGeneration: maybeDriverCompatDetails?.generation,
123
- minSupportedGeneration: driverSupportRequirements.minSupportedGeneration,
121
+ minSupportedGeneration: driverSupportRequirementsForLoader.minSupportedGeneration,
124
122
  isGenerationCompatible: layerCheckResult.isGenerationCompatible,
125
123
  unsupportedFeatures: layerCheckResult.unsupportedFeatures,
126
124
  }),
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "2.43.0-343119";
9
+ export const pkgVersion = "2.50.0-345060";