@fluidframework/container-loader 0.58.3000-61081 → 0.59.1001-62246

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 (49) hide show
  1. package/dist/container.d.ts +2 -9
  2. package/dist/container.d.ts.map +1 -1
  3. package/dist/container.js +15 -24
  4. package/dist/container.js.map +1 -1
  5. package/dist/containerContext.d.ts +5 -7
  6. package/dist/containerContext.d.ts.map +1 -1
  7. package/dist/containerContext.js +6 -4
  8. package/dist/containerContext.js.map +1 -1
  9. package/dist/contracts.d.ts +8 -1
  10. package/dist/contracts.d.ts.map +1 -1
  11. package/dist/contracts.js +21 -1
  12. package/dist/contracts.js.map +1 -1
  13. package/dist/loader.d.ts +4 -4
  14. package/dist/loader.d.ts.map +1 -1
  15. package/dist/loader.js.map +1 -1
  16. package/dist/packageVersion.d.ts +1 -1
  17. package/dist/packageVersion.js +1 -1
  18. package/dist/packageVersion.js.map +1 -1
  19. package/dist/utils.d.ts.map +1 -1
  20. package/dist/utils.js +0 -1
  21. package/dist/utils.js.map +1 -1
  22. package/lib/container.d.ts +2 -9
  23. package/lib/container.d.ts.map +1 -1
  24. package/lib/container.js +15 -24
  25. package/lib/container.js.map +1 -1
  26. package/lib/containerContext.d.ts +5 -7
  27. package/lib/containerContext.d.ts.map +1 -1
  28. package/lib/containerContext.js +6 -4
  29. package/lib/containerContext.js.map +1 -1
  30. package/lib/contracts.d.ts +8 -1
  31. package/lib/contracts.d.ts.map +1 -1
  32. package/lib/contracts.js +19 -0
  33. package/lib/contracts.js.map +1 -1
  34. package/lib/loader.d.ts +4 -4
  35. package/lib/loader.d.ts.map +1 -1
  36. package/lib/loader.js.map +1 -1
  37. package/lib/packageVersion.d.ts +1 -1
  38. package/lib/packageVersion.js +1 -1
  39. package/lib/packageVersion.js.map +1 -1
  40. package/lib/utils.d.ts.map +1 -1
  41. package/lib/utils.js +0 -1
  42. package/lib/utils.js.map +1 -1
  43. package/package.json +17 -16
  44. package/src/container.ts +16 -25
  45. package/src/containerContext.ts +11 -13
  46. package/src/contracts.ts +20 -0
  47. package/src/loader.ts +5 -6
  48. package/src/packageVersion.ts +1 -1
  49. package/src/utils.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-loader",
3
- "version": "0.58.3000-61081",
3
+ "version": "0.59.1001-62246",
4
4
  "description": "Fluid container loader",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -62,14 +62,14 @@
62
62
  "dependencies": {
63
63
  "@fluidframework/common-definitions": "^0.20.1",
64
64
  "@fluidframework/common-utils": "^0.32.1",
65
- "@fluidframework/container-definitions": "^0.47.1000",
66
- "@fluidframework/container-utils": "0.58.3000-61081",
67
- "@fluidframework/core-interfaces": "^0.42.0",
68
- "@fluidframework/driver-definitions": "^0.45.2000-0",
69
- "@fluidframework/driver-utils": "0.58.3000-61081",
70
- "@fluidframework/protocol-base": "^0.1035.1000",
71
- "@fluidframework/protocol-definitions": "^0.1027.1000",
72
- "@fluidframework/telemetry-utils": "0.58.3000-61081",
65
+ "@fluidframework/container-definitions": "^0.48.1000",
66
+ "@fluidframework/container-utils": "0.59.1001-62246",
67
+ "@fluidframework/core-interfaces": "^0.43.1000",
68
+ "@fluidframework/driver-definitions": "^0.46.1000",
69
+ "@fluidframework/driver-utils": "0.59.1001-62246",
70
+ "@fluidframework/protocol-base": "^0.1036.1000",
71
+ "@fluidframework/protocol-definitions": "^0.1028.1000",
72
+ "@fluidframework/telemetry-utils": "0.59.1001-62246",
73
73
  "abort-controller": "^3.0.0",
74
74
  "double-ended-queue": "^2.1.0-0",
75
75
  "lodash": "^4.17.21",
@@ -77,10 +77,10 @@
77
77
  },
78
78
  "devDependencies": {
79
79
  "@fluidframework/build-common": "^0.23.0",
80
- "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@0.58.2000",
81
- "@fluidframework/eslint-config-fluid": "^0.27.2000-59622",
82
- "@fluidframework/mocha-test-setup": "0.58.3000-61081",
83
- "@fluidframework/test-loader-utils": "0.58.3000-61081",
80
+ "@fluidframework/container-loader-previous": "npm:@fluidframework/container-loader@^0.58.0",
81
+ "@fluidframework/eslint-config-fluid": "^0.28.1000",
82
+ "@fluidframework/mocha-test-setup": "0.59.1001-62246",
83
+ "@fluidframework/test-loader-utils": "0.59.1001-62246",
84
84
  "@microsoft/api-extractor": "^7.16.1",
85
85
  "@rushstack/eslint-config": "^2.5.1",
86
86
  "@types/double-ended-queue": "^2.1.0",
@@ -108,11 +108,12 @@
108
108
  "typescript-formatter": "7.1.0"
109
109
  },
110
110
  "typeValidation": {
111
- "version": "0.58.3000",
111
+ "version": "0.59.1000",
112
112
  "broken": {
113
- "0.58.2000": {
113
+ "0.58.2002": {
114
114
  "ClassDeclaration_Container": {
115
- "forwardCompat": false
115
+ "forwardCompat": false,
116
+ "backCompat": false
116
117
  }
117
118
  }
118
119
  }
package/src/container.ts CHANGED
@@ -14,8 +14,6 @@ import {
14
14
  IRequest,
15
15
  IResponse,
16
16
  IFluidRouter,
17
- IFluidCodeDetails,
18
- isFluidCodeDetails,
19
17
  } from "@fluidframework/core-interfaces";
20
18
  import {
21
19
  IAudience,
@@ -30,6 +28,8 @@ import {
30
28
  IPendingLocalState,
31
29
  ReadOnlyInfo,
32
30
  IContainerLoadMode,
31
+ IFluidCodeDetails,
32
+ isFluidCodeDetails,
33
33
  } from "@fluidframework/container-definitions";
34
34
  import {
35
35
  DataCorruptionError,
@@ -92,7 +92,7 @@ import {
92
92
  } from "@fluidframework/telemetry-utils";
93
93
  import { Audience } from "./audience";
94
94
  import { ContainerContext } from "./containerContext";
95
- import { ReconnectMode, IConnectionManagerFactoryArgs } from "./contracts";
95
+ import { ReconnectMode, IConnectionManagerFactoryArgs, getPackageName } from "./contracts";
96
96
  import { DeltaManager, IConnectionArgs } from "./deltaManager";
97
97
  import { DeltaManagerProxy } from "./deltaManagerProxy";
98
98
  import { ILoaderOptions, Loader, RelativeLoader } from "./loader";
@@ -824,7 +824,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
824
824
  ensureFluidResolvedUrl(createNewResolvedUrl);
825
825
  if (this.service === undefined) {
826
826
  assert(this.client.details.type !== summarizerClientType,
827
- "client should not be summarizer before container is created");
827
+ 0x2c4 /* "client should not be summarizer before container is created" */);
828
828
  this.service = await runWithRetry(
829
829
  async () => this.serviceFactory.createContainer(
830
830
  summary,
@@ -969,8 +969,9 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
969
969
  }
970
970
 
971
971
  private connectInternal(args: IConnectionArgs) {
972
- assert(!this.closed, "Attempting to connect() a closed Container");
973
- assert(this._attachState === AttachState.Attached, "Attempting to connect() a container that is not attached");
972
+ assert(!this.closed, 0x2c5 /* "Attempting to connect() a closed Container" */);
973
+ assert(this._attachState === AttachState.Attached,
974
+ 0x2c6 /* "Attempting to connect() a container that is not attached" */);
974
975
 
975
976
  // Resume processing ops and connect to delta stream
976
977
  this.resumeInternal(args);
@@ -990,7 +991,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
990
991
  }
991
992
 
992
993
  private disconnectInternal() {
993
- assert(!this.closed, "Attempting to disconnect() a closed Container");
994
+ assert(!this.closed, 0x2c7 /* "Attempting to disconnect() a closed Container" */);
994
995
 
995
996
  // Set Auto Reconnect Mode
996
997
  const mode = ReconnectMode.Disabled;
@@ -1026,21 +1027,6 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
1026
1027
  this.connectToDeltaStream(args);
1027
1028
  }
1028
1029
 
1029
- /**
1030
- * @deprecated 0.56, will be removed in next release from IContainerContext
1031
- * Raise non-critical error to host. Calling this API will not close container.
1032
- * For critical errors, please call Container.close(error).
1033
- * @param error - an error to raise
1034
- */
1035
- public raiseContainerWarning(warning: ContainerWarning) {
1036
- // Some "warning" events come from outside the container and are logged
1037
- // elsewhere (e.g. summarizing container). We shouldn't log these here.
1038
- if (warning.logged !== true) {
1039
- this.logContainerError(warning);
1040
- }
1041
- this.emit("warning", warning);
1042
- }
1043
-
1044
1030
  public async getAbsoluteUrl(relativeUrl: string): Promise<string | undefined> {
1045
1031
  if (this.resolvedUrl === undefined) {
1046
1032
  return undefined;
@@ -1049,7 +1035,7 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
1049
1035
  return this.urlResolver.getAbsoluteUrl(
1050
1036
  this.resolvedUrl,
1051
1037
  relativeUrl,
1052
- this._context?.codeDetails);
1038
+ getPackageName(this._context?.codeDetails));
1053
1039
  }
1054
1040
 
1055
1041
  public async proposeCodeDetails(codeDetails: IFluidCodeDetails) {
@@ -1553,7 +1539,13 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
1553
1539
  });
1554
1540
 
1555
1541
  deltaManager.on("throttled", (warning: IThrottlingWarning) => {
1556
- this.raiseContainerWarning(warning);
1542
+ const warn = warning as ContainerWarning;
1543
+ // Some "warning" events come from outside the container and are logged
1544
+ // elsewhere (e.g. summarizing container). We shouldn't log these here.
1545
+ if (warn.logged !== true) {
1546
+ this.logContainerError(warn);
1547
+ }
1548
+ this.emit("warning", warn);
1557
1549
  });
1558
1550
 
1559
1551
  deltaManager.on("readonly", (readonly) => {
@@ -1823,7 +1815,6 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
1823
1815
  new DeltaManagerProxy(this._deltaManager),
1824
1816
  new QuorumProxy(this.protocolHandler.quorum),
1825
1817
  loader,
1826
- (warning: ContainerWarning) => this.raiseContainerWarning(warning),
1827
1818
  (type, contents, batch, metadata) => this.submitContainerMessage(type, contents, batch, metadata),
1828
1819
  (message) => this.submitSignal(message),
1829
1820
  (error?: ICriticalContainerError) => this.close(error),
@@ -12,20 +12,19 @@ import {
12
12
  ILoader,
13
13
  IRuntime,
14
14
  ICriticalContainerError,
15
- ContainerWarning,
16
15
  AttachState,
17
16
  ILoaderOptions,
18
17
  IRuntimeFactory,
19
- ICodeLoader,
20
18
  IProvideRuntimeFactory,
19
+ IFluidCodeDetails,
20
+ IFluidCodeDetailsComparer,
21
+ IProvideFluidCodeDetailsComparer,
22
+ ICodeDetailsLoader,
23
+ IFluidModuleWithDetails,
21
24
  } from "@fluidframework/container-definitions";
22
25
  import {
23
- IFluidObject,
24
26
  IRequest,
25
27
  IResponse,
26
- IFluidCodeDetails,
27
- IFluidCodeDetailsComparer,
28
- IProvideFluidCodeDetailsComparer,
29
28
  FluidObject,
30
29
  } from "@fluidframework/core-interfaces";
31
30
  import { IDocumentStorageService } from "@fluidframework/driver-definitions";
@@ -45,7 +44,6 @@ import {
45
44
  } from "@fluidframework/protocol-definitions";
46
45
  import { PerformanceEvent } from "@fluidframework/telemetry-utils";
47
46
  import { Container } from "./container";
48
- import { ICodeDetailsLoader, IFluidModuleWithDetails } from "./loader";
49
47
 
50
48
  const PackageNotFactoryError = "Code package does not implement IRuntimeFactory";
51
49
 
@@ -53,13 +51,12 @@ export class ContainerContext implements IContainerContext {
53
51
  public static async createOrLoad(
54
52
  container: Container,
55
53
  scope: FluidObject,
56
- codeLoader: ICodeDetailsLoader | ICodeLoader,
54
+ codeLoader: ICodeDetailsLoader,
57
55
  codeDetails: IFluidCodeDetails,
58
56
  baseSnapshot: ISnapshotTree | undefined,
59
57
  deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
60
58
  quorum: IQuorum,
61
59
  loader: ILoader,
62
- raiseContainerWarning: (warning: ContainerWarning) => void,
63
60
  submitFn: (type: MessageType, contents: any, batch: boolean, appData: any) => number,
64
61
  submitSignalFn: (contents: any) => void,
65
62
  closeFn: (error?: ICriticalContainerError) => void,
@@ -77,7 +74,6 @@ export class ContainerContext implements IContainerContext {
77
74
  deltaManager,
78
75
  quorum,
79
76
  loader,
80
- raiseContainerWarning,
81
77
  submitFn,
82
78
  submitSignalFn,
83
79
  closeFn,
@@ -159,14 +155,13 @@ export class ContainerContext implements IContainerContext {
159
155
 
160
156
  constructor(
161
157
  private readonly container: Container,
162
- public readonly scope: IFluidObject & FluidObject,
163
- private readonly codeLoader: ICodeDetailsLoader | ICodeLoader,
158
+ public readonly scope: FluidObject,
159
+ private readonly codeLoader: ICodeDetailsLoader,
164
160
  private readonly _codeDetails: IFluidCodeDetails,
165
161
  private readonly _baseSnapshot: ISnapshotTree | undefined,
166
162
  public readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
167
163
  quorum: IQuorum,
168
164
  public readonly loader: ILoader,
169
- public readonly raiseContainerWarning: (warning: ContainerWarning) => void,
170
165
  public readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData: any) => number,
171
166
  public readonly submitSignalFn: (contents: any) => void,
172
167
  public readonly closeFn: (error?: ICriticalContainerError) => void,
@@ -333,6 +328,9 @@ export class ContainerContext implements IContainerContext {
333
328
  details: details ?? codeDetails,
334
329
  };
335
330
  } else {
331
+ // If "module" is not in the result, we are using a legacy ICodeLoader. Fix the result up with details.
332
+ // Once usage drops to 0 we can remove this compat path.
333
+ this.taggedLogger.sendTelemetryEvent({ eventName: "LegacyCodeLoader" });
336
334
  return { module: loadCodeResult, details: codeDetails };
337
335
  }
338
336
  }
package/src/contracts.ts CHANGED
@@ -11,6 +11,8 @@ import {
11
11
  ReadOnlyInfo,
12
12
  IConnectionDetails,
13
13
  ICriticalContainerError,
14
+ IFluidCodeDetails,
15
+ isFluidPackage,
14
16
  } from "@fluidframework/container-definitions";
15
17
  import {
16
18
  ConnectionMode,
@@ -20,6 +22,7 @@ import {
20
22
  IClientDetails,
21
23
  ISignalMessage,
22
24
  } from "@fluidframework/protocol-definitions";
25
+ import { IContainerPackageInfo } from "@fluidframework/driver-definitions";
23
26
 
24
27
  export enum ReconnectMode {
25
28
  Never = "Never",
@@ -155,3 +158,20 @@ export interface IConnectionManagerFactoryArgs {
155
158
  */
156
159
  readonly readonlyChangeHandler: (readonly?: boolean) => void,
157
160
  }
161
+
162
+ /**
163
+ *
164
+ * @param codeDetails- Data structure used to describe the code to load on the Fluid document
165
+ * @returns The name of the Fluid package
166
+ */
167
+ export const getPackageName = (codeDetails: IFluidCodeDetails | undefined): IContainerPackageInfo => {
168
+ let containerPackageName;
169
+ if (codeDetails && "name" in codeDetails) {
170
+ containerPackageName = codeDetails;
171
+ } else if (isFluidPackage(codeDetails?.package)) {
172
+ containerPackageName = codeDetails?.package.name;
173
+ } else {
174
+ containerPackageName = codeDetails?.package;
175
+ }
176
+ return { name: containerPackageName };
177
+ };
package/src/loader.ts CHANGED
@@ -7,15 +7,12 @@ import { v4 as uuid } from "uuid";
7
7
  import { ITelemetryBaseLogger, ITelemetryLogger } from "@fluidframework/common-definitions";
8
8
  import {
9
9
  FluidObject,
10
- IFluidCodeDetails,
11
10
  IFluidRouter,
12
- IProvideFluidCodeDetailsComparer,
13
11
  IRequest,
14
12
  IRequestHeader,
15
13
  IResponse,
16
14
  } from "@fluidframework/core-interfaces";
17
15
  import {
18
- ICodeLoader,
19
16
  IContainer,
20
17
  IFluidModule,
21
18
  IHostLoader,
@@ -24,6 +21,8 @@ import {
24
21
  ILoaderOptions as ILoaderOptions1,
25
22
  IProxyLoaderFactory,
26
23
  LoaderHeader,
24
+ IProvideFluidCodeDetailsComparer,
25
+ IFluidCodeDetails,
27
26
  } from "@fluidframework/container-definitions";
28
27
  import {
29
28
  ChildLogger,
@@ -187,7 +186,7 @@ export interface ILoaderProps {
187
186
  * The code loader handles loading the necessary code
188
187
  * for running a container once it is loaded.
189
188
  */
190
- readonly codeLoader: ICodeDetailsLoader | ICodeLoader;
189
+ readonly codeLoader: ICodeDetailsLoader;
191
190
 
192
191
  /**
193
192
  * A property bag of options used by various layers
@@ -243,7 +242,7 @@ export interface ILoaderServices {
243
242
  * The code loader handles loading the necessary code
244
243
  * for running a container once it is loaded.
245
244
  */
246
- readonly codeLoader: ICodeDetailsLoader | ICodeLoader;
245
+ readonly codeLoader: ICodeDetailsLoader;
247
246
 
248
247
  /**
249
248
  * A property bag of options used by various layers
@@ -295,7 +294,7 @@ export class Loader implements IHostLoader {
295
294
  private readonly mc: MonitoringContext;
296
295
 
297
296
  constructor(loaderProps: ILoaderProps) {
298
- const scope = { ...loaderProps.scope as FluidObject<ILoader> };
297
+ const scope: FluidObject<ILoader> = { ...loaderProps.scope };
299
298
  if (loaderProps.options?.provideScopeLoader !== false) {
300
299
  scope.ILoader = this;
301
300
  }
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "0.58.3000-61081";
9
+ export const pkgVersion = "0.59.1001-62246";
package/src/utils.ts CHANGED
@@ -62,7 +62,6 @@ function convertSummaryToSnapshotWithEmbeddedBlobContents(
62
62
  blobs: {},
63
63
  blobsContents: {},
64
64
  trees: {},
65
- commits: {},
66
65
  id: uuid(),
67
66
  unreferenced: summary.unreferenced,
68
67
  };