@fluidframework/container-loader 2.0.0-dev-rc.2.0.0.245554 → 2.0.0-dev-rc.3.0.0.250606

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 (181) hide show
  1. package/dist/attachment.d.ts +5 -8
  2. package/dist/attachment.d.ts.map +1 -1
  3. package/dist/attachment.js +2 -2
  4. package/dist/attachment.js.map +1 -1
  5. package/dist/audience.d.ts.map +1 -1
  6. package/dist/audience.js +2 -2
  7. package/dist/audience.js.map +1 -1
  8. package/dist/catchUpMonitor.d.ts +1 -1
  9. package/dist/catchUpMonitor.d.ts.map +1 -1
  10. package/dist/catchUpMonitor.js.map +1 -1
  11. package/dist/connectionManager.d.ts +3 -3
  12. package/dist/connectionManager.d.ts.map +1 -1
  13. package/dist/connectionManager.js +1 -1
  14. package/dist/connectionManager.js.map +1 -1
  15. package/dist/connectionStateHandler.d.ts +3 -3
  16. package/dist/connectionStateHandler.d.ts.map +1 -1
  17. package/dist/connectionStateHandler.js.map +1 -1
  18. package/dist/container.d.ts +4 -43
  19. package/dist/container.d.ts.map +1 -1
  20. package/dist/container.js +24 -37
  21. package/dist/container.js.map +1 -1
  22. package/dist/containerContext.d.ts +17 -7
  23. package/dist/containerContext.d.ts.map +1 -1
  24. package/dist/containerContext.js +7 -2
  25. package/dist/containerContext.js.map +1 -1
  26. package/dist/containerStorageAdapter.d.ts +2 -2
  27. package/dist/containerStorageAdapter.d.ts.map +1 -1
  28. package/dist/containerStorageAdapter.js.map +1 -1
  29. package/dist/contracts.d.ts +3 -3
  30. package/dist/contracts.d.ts.map +1 -1
  31. package/dist/contracts.js.map +1 -1
  32. package/dist/debugLogger.d.ts.map +1 -1
  33. package/dist/debugLogger.js.map +1 -1
  34. package/dist/deltaManager.d.ts +5 -5
  35. package/dist/deltaManager.d.ts.map +1 -1
  36. package/dist/deltaManager.js +3 -3
  37. package/dist/deltaManager.js.map +1 -1
  38. package/dist/deltaQueue.d.ts +1 -1
  39. package/dist/deltaQueue.d.ts.map +1 -1
  40. package/dist/deltaQueue.js +1 -1
  41. package/dist/deltaQueue.js.map +1 -1
  42. package/dist/error.d.ts.map +1 -1
  43. package/dist/error.js.map +1 -1
  44. package/dist/loader.d.ts +3 -3
  45. package/dist/loader.d.ts.map +1 -1
  46. package/dist/loader.js +4 -4
  47. package/dist/loader.js.map +1 -1
  48. package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts +1 -1
  49. package/dist/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
  50. package/dist/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
  51. package/dist/noopHeuristic.d.ts +1 -1
  52. package/dist/noopHeuristic.d.ts.map +1 -1
  53. package/dist/noopHeuristic.js.map +1 -1
  54. package/dist/packageVersion.d.ts +1 -1
  55. package/dist/packageVersion.js +1 -1
  56. package/dist/packageVersion.js.map +1 -1
  57. package/dist/quorum.d.ts +1 -1
  58. package/dist/quorum.d.ts.map +1 -1
  59. package/dist/quorum.js +4 -0
  60. package/dist/quorum.js.map +1 -1
  61. package/dist/retriableDocumentStorageService.d.ts +1 -1
  62. package/dist/retriableDocumentStorageService.d.ts.map +1 -1
  63. package/dist/retriableDocumentStorageService.js +1 -1
  64. package/dist/retriableDocumentStorageService.js.map +1 -1
  65. package/dist/serializedStateManager.d.ts +57 -18
  66. package/dist/serializedStateManager.d.ts.map +1 -1
  67. package/dist/serializedStateManager.js +71 -80
  68. package/dist/serializedStateManager.js.map +1 -1
  69. package/dist/utils.d.ts +5 -6
  70. package/dist/utils.d.ts.map +1 -1
  71. package/dist/utils.js +27 -11
  72. package/dist/utils.js.map +1 -1
  73. package/lib/attachment.d.ts +5 -8
  74. package/lib/attachment.d.ts.map +1 -1
  75. package/lib/attachment.js.map +1 -1
  76. package/lib/audience.d.ts.map +1 -1
  77. package/lib/audience.js.map +1 -1
  78. package/lib/catchUpMonitor.d.ts +1 -1
  79. package/lib/catchUpMonitor.d.ts.map +1 -1
  80. package/lib/catchUpMonitor.js.map +1 -1
  81. package/lib/connectionManager.d.ts +3 -3
  82. package/lib/connectionManager.d.ts.map +1 -1
  83. package/lib/connectionManager.js +3 -3
  84. package/lib/connectionManager.js.map +1 -1
  85. package/lib/connectionStateHandler.d.ts +3 -3
  86. package/lib/connectionStateHandler.d.ts.map +1 -1
  87. package/lib/connectionStateHandler.js.map +1 -1
  88. package/lib/container.d.ts +4 -43
  89. package/lib/container.d.ts.map +1 -1
  90. package/lib/container.js +27 -40
  91. package/lib/container.js.map +1 -1
  92. package/lib/containerContext.d.ts +17 -7
  93. package/lib/containerContext.d.ts.map +1 -1
  94. package/lib/containerContext.js +7 -2
  95. package/lib/containerContext.js.map +1 -1
  96. package/lib/containerStorageAdapter.d.ts +2 -2
  97. package/lib/containerStorageAdapter.d.ts.map +1 -1
  98. package/lib/containerStorageAdapter.js.map +1 -1
  99. package/lib/contracts.d.ts +3 -3
  100. package/lib/contracts.d.ts.map +1 -1
  101. package/lib/contracts.js.map +1 -1
  102. package/lib/debugLogger.d.ts.map +1 -1
  103. package/lib/debugLogger.js.map +1 -1
  104. package/lib/deltaManager.d.ts +5 -5
  105. package/lib/deltaManager.d.ts.map +1 -1
  106. package/lib/deltaManager.js +3 -3
  107. package/lib/deltaManager.js.map +1 -1
  108. package/lib/deltaQueue.d.ts +1 -1
  109. package/lib/deltaQueue.d.ts.map +1 -1
  110. package/lib/deltaQueue.js +1 -1
  111. package/lib/deltaQueue.js.map +1 -1
  112. package/lib/error.d.ts.map +1 -1
  113. package/lib/error.js.map +1 -1
  114. package/lib/loader.d.ts +3 -3
  115. package/lib/loader.d.ts.map +1 -1
  116. package/lib/loader.js +4 -4
  117. package/lib/loader.js.map +1 -1
  118. package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts +1 -1
  119. package/lib/location-redirection-utilities/resolveWithLocationRedirection.d.ts.map +1 -1
  120. package/lib/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
  121. package/lib/noopHeuristic.d.ts +1 -1
  122. package/lib/noopHeuristic.d.ts.map +1 -1
  123. package/lib/noopHeuristic.js.map +1 -1
  124. package/lib/packageVersion.d.ts +1 -1
  125. package/lib/packageVersion.js +1 -1
  126. package/lib/packageVersion.js.map +1 -1
  127. package/lib/quorum.d.ts +1 -1
  128. package/lib/quorum.d.ts.map +1 -1
  129. package/lib/quorum.js +4 -0
  130. package/lib/quorum.js.map +1 -1
  131. package/lib/retriableDocumentStorageService.d.ts +1 -1
  132. package/lib/retriableDocumentStorageService.d.ts.map +1 -1
  133. package/lib/retriableDocumentStorageService.js +1 -1
  134. package/lib/retriableDocumentStorageService.js.map +1 -1
  135. package/lib/serializedStateManager.d.ts +57 -18
  136. package/lib/serializedStateManager.d.ts.map +1 -1
  137. package/lib/serializedStateManager.js +68 -79
  138. package/lib/serializedStateManager.js.map +1 -1
  139. package/lib/test/attachment.spec.js +2 -2
  140. package/lib/test/attachment.spec.js.map +1 -1
  141. package/lib/test/catchUpMonitor.spec.js.map +1 -1
  142. package/lib/test/connectionStateHandler.spec.js +1 -1
  143. package/lib/test/connectionStateHandler.spec.js.map +1 -1
  144. package/lib/test/container.spec.js +1 -1
  145. package/lib/test/container.spec.js.map +1 -1
  146. package/lib/test/deltaManager.spec.js +2 -2
  147. package/lib/test/deltaManager.spec.js.map +1 -1
  148. package/lib/test/loader.spec.js +4 -4
  149. package/lib/test/loader.spec.js.map +1 -1
  150. package/lib/test/serializedStateManager.spec.js +10 -7
  151. package/lib/test/serializedStateManager.spec.js.map +1 -1
  152. package/lib/test/snapshotConversionTest.spec.js +12 -12
  153. package/lib/test/snapshotConversionTest.spec.js.map +1 -1
  154. package/lib/test/utils.spec.js +66 -1
  155. package/lib/test/utils.spec.js.map +1 -1
  156. package/lib/utils.d.ts +5 -6
  157. package/lib/utils.d.ts.map +1 -1
  158. package/lib/utils.js +26 -11
  159. package/lib/utils.js.map +1 -1
  160. package/package.json +18 -15
  161. package/src/attachment.ts +7 -6
  162. package/src/audience.ts +2 -1
  163. package/src/catchUpMonitor.ts +1 -1
  164. package/src/connectionManager.ts +15 -15
  165. package/src/connectionStateHandler.ts +4 -4
  166. package/src/container.ts +68 -125
  167. package/src/containerContext.ts +16 -9
  168. package/src/containerStorageAdapter.ts +3 -3
  169. package/src/contracts.ts +4 -4
  170. package/src/debugLogger.ts +1 -1
  171. package/src/deltaManager.ts +24 -24
  172. package/src/deltaQueue.ts +1 -1
  173. package/src/error.ts +1 -1
  174. package/src/loader.ts +22 -21
  175. package/src/location-redirection-utilities/resolveWithLocationRedirection.ts +1 -1
  176. package/src/noopHeuristic.ts +2 -2
  177. package/src/packageVersion.ts +1 -1
  178. package/src/quorum.ts +2 -1
  179. package/src/retriableDocumentStorageService.ts +2 -2
  180. package/src/serializedStateManager.ts +133 -116
  181. package/src/utils.ts +47 -18
package/src/container.ts CHANGED
@@ -3,16 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { v4 as uuid } from "uuid";
7
- import { assert, unreachableCase, isPromiseLike } from "@fluidframework/core-utils";
8
6
  import { TypedEventEmitter, performance } from "@fluid-internal/client-utils";
9
- import {
10
- IEvent,
11
- ITelemetryBaseProperties,
12
- FluidObject,
13
- LogLevel,
14
- IRequest,
15
- } from "@fluidframework/core-interfaces";
16
7
  import {
17
8
  AttachState,
18
9
  ContainerWarning,
@@ -25,16 +16,25 @@ import {
25
16
  ICriticalContainerError,
26
17
  IDeltaManager,
27
18
  IFluidCodeDetails,
28
- IHostLoader,
19
+ IFluidCodeDetailsComparer,
29
20
  IFluidModuleWithDetails,
30
- IProvideRuntimeFactory,
21
+ IGetPendingLocalStateProps,
22
+ IHostLoader,
31
23
  IProvideFluidCodeDetailsComparer,
32
- IFluidCodeDetailsComparer,
24
+ IProvideRuntimeFactory,
33
25
  IRuntime,
34
26
  ReadOnlyInfo,
35
27
  isFluidCodeDetails,
36
- IGetPendingLocalStateProps,
37
28
  } from "@fluidframework/container-definitions";
29
+ import {
30
+ FluidObject,
31
+ IEvent,
32
+ IRequest,
33
+ type ISignalEnvelope,
34
+ ITelemetryBaseProperties,
35
+ LogLevel,
36
+ } from "@fluidframework/core-interfaces";
37
+ import { assert, isPromiseLike, unreachableCase } from "@fluidframework/core-utils";
38
38
  import {
39
39
  IDocumentService,
40
40
  IDocumentServiceFactory,
@@ -45,12 +45,12 @@ import {
45
45
  IUrlResolver,
46
46
  } from "@fluidframework/driver-definitions";
47
47
  import {
48
- readAndParse,
48
+ MessageType2,
49
49
  OnlineStatus,
50
- isOnline,
51
50
  isCombinedAppAndProtocolSummary,
52
- MessageType2,
53
51
  isInstanceOfISnapshot,
52
+ isOnline,
53
+ readAndParse,
54
54
  runWithRetry,
55
55
  } from "@fluidframework/driver-utils";
56
56
  import { IQuorumSnapshot } from "@fluidframework/protocol-base";
@@ -74,58 +74,64 @@ import {
74
74
  SummaryType,
75
75
  } from "@fluidframework/protocol-definitions";
76
76
  import {
77
- createChildLogger,
78
77
  EventEmitterWithErrorHandling,
78
+ GenericError,
79
+ IFluidErrorBase,
80
+ ITelemetryLoggerExt,
81
+ MonitoringContext,
79
82
  PerformanceEvent,
80
- raiseConnectedEvent,
83
+ type TelemetryEventCategory,
84
+ UsageError,
81
85
  connectedEventName,
82
- normalizeError,
83
- MonitoringContext,
86
+ createChildLogger,
84
87
  createChildMonitoringContext,
85
- wrapError,
86
- ITelemetryLoggerExt,
87
88
  formatTick,
88
- GenericError,
89
- UsageError,
90
- IFluidErrorBase,
91
- type TelemetryEventCategory,
89
+ normalizeError,
90
+ raiseConnectedEvent,
91
+ wrapError,
92
92
  } from "@fluidframework/telemetry-utils";
93
93
  import structuredClone from "@ungap/structured-clone";
94
+ import { v4 as uuid } from "uuid";
95
+ import { AttachProcessProps, AttachmentData, runRetriableAttachProcess } from "./attachment.js";
94
96
  import { Audience } from "./audience.js";
97
+ import { ConnectionManager } from "./connectionManager.js";
98
+ import { ConnectionState } from "./connectionState.js";
99
+ import { IConnectionStateHandler, createConnectionStateHandler } from "./connectionStateHandler.js";
95
100
  import { ContainerContext } from "./containerContext.js";
101
+ import { ContainerStorageAdapter } from "./containerStorageAdapter.js";
96
102
  import {
97
- ReconnectMode,
98
- IConnectionManagerFactoryArgs,
99
- getPackageName,
100
103
  IConnectionDetailsInternal,
104
+ IConnectionManagerFactoryArgs,
101
105
  IConnectionStateChangeReason,
106
+ ReconnectMode,
107
+ getPackageName,
102
108
  } from "./contracts.js";
103
109
  import { DeltaManager, IConnectionArgs } from "./deltaManager.js";
104
110
  import { IDetachedBlobStorage, ILoaderOptions, RelativeLoader } from "./loader.js";
111
+ import { NoopHeuristic } from "./noopHeuristic.js";
105
112
  import { pkgVersion } from "./packageVersion.js";
106
- import { ContainerStorageAdapter, ISerializableBlobContents } from "./containerStorageAdapter.js";
107
- import { IConnectionStateHandler, createConnectionStateHandler } from "./connectionStateHandler.js";
113
+ import {
114
+ IProtocolHandler,
115
+ ProtocolHandler,
116
+ ProtocolHandlerBuilder,
117
+ protocolHandlerShouldProcessSignal,
118
+ } from "./protocol.js";
119
+ import { initQuorumValuesFromCodeDetails } from "./quorum.js";
120
+ import {
121
+ type IPendingContainerState,
122
+ type IPendingDetachedContainerState,
123
+ SerializedStateManager,
124
+ } from "./serializedStateManager.js";
108
125
  import {
109
126
  ISnapshotTreeWithBlobContents,
110
127
  combineAppAndProtocolSummary,
111
- getProtocolSnapshotTree,
112
- getSnapshotTreeAndBlobsFromSerializedContainer,
113
128
  combineSnapshotTreeAndSnapshotBlobs,
114
129
  getDetachedContainerStateFromSerializedContainer,
130
+ getDocumentAttributes,
131
+ getProtocolSnapshotTree,
132
+ getSnapshotTreeAndBlobsFromSerializedContainer,
115
133
  runSingle,
116
134
  } from "./utils.js";
117
- import { initQuorumValuesFromCodeDetails } from "./quorum.js";
118
- import { NoopHeuristic } from "./noopHeuristic.js";
119
- import { ConnectionManager } from "./connectionManager.js";
120
- import { ConnectionState } from "./connectionState.js";
121
- import {
122
- IProtocolHandler,
123
- ProtocolHandler,
124
- ProtocolHandlerBuilder,
125
- protocolHandlerShouldProcessSignal,
126
- } from "./protocol.js";
127
- import { AttachProcessProps, AttachmentData, runRetriableAttachProcess } from "./attachment.js";
128
- import { SerializedStateManager } from "./serializedStateManager.js";
129
135
 
130
136
  const detachedContainerRefSeqNumber = 0;
131
137
 
@@ -335,46 +341,6 @@ export async function ReportIfTooLong(
335
341
  }
336
342
  }
337
343
 
338
- /**
339
- * State saved by a container at close time, to be used to load a new instance
340
- * of the container to the same state
341
- * @internal
342
- */
343
- export interface IPendingContainerState {
344
- attached: true;
345
- pendingRuntimeState: unknown;
346
- /**
347
- * Snapshot from which container initially loaded.
348
- */
349
- baseSnapshot: ISnapshotTree;
350
- /**
351
- * Serializable blobs from the base snapshot. Used to load offline since
352
- * storage is not available.
353
- */
354
- snapshotBlobs: ISerializableBlobContents;
355
- /**
356
- * All ops since base snapshot sequence number up to the latest op
357
- * seen when the container was closed. Used to apply stashed (saved pending)
358
- * ops at the same sequence number at which they were made.
359
- */
360
- savedOps: ISequencedDocumentMessage[];
361
- url: string;
362
- clientId?: string;
363
- }
364
-
365
- /**
366
- * State saved by a container in detached state, to be used to load a new instance
367
- * of the container to the same state (rehydrate)
368
- * @internal
369
- */
370
- export interface IPendingDetachedContainerState {
371
- attached: false;
372
- baseSnapshot: ISnapshotTree;
373
- snapshotBlobs: ISerializableBlobContents;
374
- hasAttachmentBlobs: boolean;
375
- pendingRuntimeState?: unknown;
376
- }
377
-
378
344
  const summarizerClientType = "summarizer";
379
345
 
380
346
  interface IContainerLifecycleEvents extends IEvent {
@@ -1188,17 +1154,16 @@ export class Container
1188
1154
  this.captureProtocolSummary(),
1189
1155
  );
1190
1156
 
1191
- const { tree: snapshot, blobs } =
1157
+ const { baseSnapshot, snapshotBlobs } =
1192
1158
  getSnapshotTreeAndBlobsFromSerializedContainer(combinedSummary);
1193
-
1194
1159
  const pendingRuntimeState =
1195
1160
  attachingData !== undefined ? this.runtime.getPendingLocalState() : undefined;
1196
1161
  assert(!isPromiseLike(pendingRuntimeState), 0x8e3 /* should not be a promise */);
1197
1162
 
1198
1163
  const detachedContainerState: IPendingDetachedContainerState = {
1199
1164
  attached: false,
1200
- baseSnapshot: snapshot,
1201
- snapshotBlobs: blobs,
1165
+ baseSnapshot,
1166
+ snapshotBlobs,
1202
1167
  pendingRuntimeState,
1203
1168
  hasAttachmentBlobs: !!this.detachedBlobStorage && this.detachedBlobStorage.size > 0,
1204
1169
  };
@@ -1578,15 +1543,19 @@ export class Container
1578
1543
  };
1579
1544
 
1580
1545
  timings.phase2 = performance.now();
1546
+
1547
+ const supportGetSnapshotApi: boolean =
1548
+ this.mc.config.getBoolean("Fluid.Container.UseLoadingGroupIdForSnapshotFetch") ===
1549
+ true && this.service?.policies?.supportGetSnapshotApi === true;
1581
1550
  // Fetch specified snapshot.
1582
- const { snapshotTree, version } = await this.serializedStateManager.fetchSnapshot(
1551
+ const { baseSnapshot, version } = await this.serializedStateManager.fetchSnapshot(
1583
1552
  specifiedVersion,
1584
- this.service?.policies?.supportGetSnapshotApi,
1553
+ supportGetSnapshotApi,
1585
1554
  );
1586
1555
  this._loadedFromVersion = version;
1587
- const attributes: IDocumentAttributes = await this.getDocumentAttributes(
1556
+ const attributes: IDocumentAttributes = await getDocumentAttributes(
1588
1557
  this.storageAdapter,
1589
- snapshotTree,
1558
+ baseSnapshot,
1590
1559
  );
1591
1560
 
1592
1561
  // If we saved ops, we will replay them and don't need DeltaManager to fetch them
@@ -1676,17 +1645,17 @@ export class Container
1676
1645
  await this.initializeProtocolStateFromSnapshot(
1677
1646
  attributes,
1678
1647
  this.storageAdapter,
1679
- snapshotTree,
1648
+ baseSnapshot,
1680
1649
  );
1681
1650
 
1682
1651
  timings.phase3 = performance.now();
1683
1652
  const codeDetails = this.getCodeDetailsFromQuorum();
1684
1653
  await this.instantiateRuntime(
1685
1654
  codeDetails,
1686
- snapshotTree,
1655
+ baseSnapshot,
1687
1656
  // give runtime a dummy value so it knows we're loading from a stash blob
1688
1657
  pendingLocalState ? pendingLocalState?.pendingRuntimeState ?? {} : undefined,
1689
- isInstanceOfISnapshot(snapshotTree) ? snapshotTree : undefined,
1658
+ isInstanceOfISnapshot(baseSnapshot) ? baseSnapshot : undefined,
1690
1659
  );
1691
1660
 
1692
1661
  // replay saved ops
@@ -1814,7 +1783,7 @@ export class Container
1814
1783
  const snapshotTreeWithBlobContents: ISnapshotTreeWithBlobContents =
1815
1784
  combineSnapshotTreeAndSnapshotBlobs(baseSnapshot, snapshotBlobs);
1816
1785
  this.storageAdapter.loadSnapshotFromSnapshotBlobs(snapshotBlobs);
1817
- const attributes = await this.getDocumentAttributes(
1786
+ const attributes = await getDocumentAttributes(
1818
1787
  this.storageAdapter,
1819
1788
  snapshotTreeWithBlobContents,
1820
1789
  );
@@ -1846,28 +1815,6 @@ export class Container
1846
1815
  this.setLoaded();
1847
1816
  }
1848
1817
 
1849
- private async getDocumentAttributes(
1850
- storage: IDocumentStorageService,
1851
- tree: ISnapshotTree | undefined,
1852
- ): Promise<IDocumentAttributes> {
1853
- if (tree === undefined) {
1854
- return {
1855
- minimumSequenceNumber: 0,
1856
- sequenceNumber: 0,
1857
- };
1858
- }
1859
-
1860
- // Backward compatibility: old docs would have ".attributes" instead of "attributes"
1861
- const attributesHash =
1862
- ".protocol" in tree.trees
1863
- ? tree.trees[".protocol"].blobs.attributes
1864
- : tree.blobs[".attributes"];
1865
-
1866
- const attributes = await readAndParse<IDocumentAttributes>(storage, attributesHash);
1867
-
1868
- return attributes;
1869
- }
1870
-
1871
1818
  private async initializeProtocolStateFromSnapshot(
1872
1819
  attributes: IDocumentAttributes,
1873
1820
  storage: IDocumentStorageService,
@@ -2341,7 +2288,8 @@ export class Container
2341
2288
  this.emit("op", message);
2342
2289
  }
2343
2290
 
2344
- private submitSignal(content: any, targetClientId?: string) {
2291
+ // unknown should be removed once `@alpha` tag is removed from IContainerContext
2292
+ private submitSignal(content: unknown | ISignalEnvelope, targetClientId?: string) {
2345
2293
  this._deltaManager.submitSignal(JSON.stringify(content), targetClientId);
2346
2294
  }
2347
2295
 
@@ -2389,10 +2337,6 @@ export class Container
2389
2337
  throw new Error(packageNotFactoryError);
2390
2338
  }
2391
2339
 
2392
- const getSpecifiedCodeDetails = () =>
2393
- (this.protocolHandler.quorum.get("code") ??
2394
- this.protocolHandler.quorum.get("code2")) as IFluidCodeDetails | undefined;
2395
-
2396
2340
  const existing = snapshotTree !== undefined;
2397
2341
 
2398
2342
  const context = new ContainerContext(
@@ -2420,7 +2364,6 @@ export class Container
2420
2364
  () => this.clientId,
2421
2365
  () => this.attachState,
2422
2366
  () => this.connected,
2423
- getSpecifiedCodeDetails,
2424
2367
  this._deltaManager.clientDetails,
2425
2368
  existing,
2426
2369
  this.subLogger,
@@ -3,19 +3,17 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
7
6
  import {
7
+ AttachState,
8
8
  IAudience,
9
+ IBatchMessage,
9
10
  IContainerContext,
11
+ ICriticalContainerError,
10
12
  IDeltaManager,
11
13
  ILoader,
12
- ICriticalContainerError,
13
- AttachState,
14
14
  ILoaderOptions,
15
- IFluidCodeDetails,
16
- IBatchMessage,
17
15
  } from "@fluidframework/container-definitions";
18
- import { FluidObject } from "@fluidframework/core-interfaces";
16
+ import { type FluidObject, type ISignalEnvelope } from "@fluidframework/core-interfaces";
19
17
  import { IDocumentStorageService, ISnapshot } from "@fluidframework/driver-definitions";
20
18
  import {
21
19
  IClientDetails,
@@ -23,10 +21,11 @@ import {
23
21
  IQuorumClients,
24
22
  ISequencedDocumentMessage,
25
23
  ISnapshotTree,
24
+ ISummaryContent,
26
25
  IVersion,
27
26
  MessageType,
28
- ISummaryContent,
29
27
  } from "@fluidframework/protocol-definitions";
28
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
30
29
 
31
30
  /**
32
31
  * {@inheritDoc @fluidframework/container-definitions#IContainerContext}
@@ -85,7 +84,16 @@ export class ContainerContext implements IContainerContext {
85
84
  batch: IBatchMessage[],
86
85
  referenceSequenceNumber?: number,
87
86
  ) => number,
88
- public readonly submitSignalFn: (content: any, targetClientId?: string) => void,
87
+
88
+ /**
89
+ * `unknown` should be removed once `@alpha` tag is removed from IContainerContext
90
+ * @see {@link https://dev.azure.com/fluidframework/internal/_workitems/edit/7462}
91
+ * Any changes to submitSignalFn `content` should be checked internally by temporarily changing IContainerContext and removing all `unknown`s
92
+ */
93
+ public readonly submitSignalFn: (
94
+ content: unknown | ISignalEnvelope,
95
+ targetClientId?: string,
96
+ ) => void,
89
97
  public readonly disposeFn: (error?: ICriticalContainerError) => void,
90
98
  public readonly closeFn: (error?: ICriticalContainerError) => void,
91
99
  public readonly updateDirtyContainerState: (dirty: boolean) => void,
@@ -94,7 +102,6 @@ export class ContainerContext implements IContainerContext {
94
102
  private readonly _getClientId: () => string | undefined,
95
103
  private readonly _getAttachState: () => AttachState,
96
104
  private readonly _getConnected: () => boolean,
97
- public readonly getSpecifiedCodeDetails: () => IFluidCodeDetails | undefined,
98
105
  public readonly clientDetails: IClientDetails,
99
106
  public readonly existing: boolean,
100
107
  public readonly taggedLogger: ITelemetryLoggerExt,
@@ -3,11 +3,10 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IDisposable } from "@fluidframework/core-interfaces";
7
- import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
8
6
  import { bufferToString, stringToBuffer } from "@fluid-internal/client-utils";
9
- import { assert } from "@fluidframework/core-utils";
10
7
  import { ISnapshotTreeWithBlobContents } from "@fluidframework/container-definitions";
8
+ import { IDisposable } from "@fluidframework/core-interfaces";
9
+ import { assert } from "@fluidframework/core-utils";
11
10
  import {
12
11
  FetchSource,
13
12
  IDocumentService,
@@ -25,6 +24,7 @@ import {
25
24
  ISummaryTree,
26
25
  IVersion,
27
26
  } from "@fluidframework/protocol-definitions";
27
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
28
28
  import { IDetachedBlobStorage } from "./loader.js";
29
29
  import { ProtocolTreeStorageService } from "./protocolTreeDocumentStorageService.js";
30
30
  import { RetriableDocumentStorageService } from "./retriableDocumentStorageService.js";
package/src/contracts.ts CHANGED
@@ -3,15 +3,16 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IErrorBase, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
7
6
  import {
8
7
  IConnectionDetails,
9
8
  ICriticalContainerError,
10
9
  IDeltaQueue,
11
10
  IFluidCodeDetails,
12
- isFluidPackage,
13
11
  ReadOnlyInfo,
12
+ isFluidPackage,
14
13
  } from "@fluidframework/container-definitions";
14
+ import { IErrorBase, ITelemetryBaseProperties } from "@fluidframework/core-interfaces";
15
+ import { IContainerPackageInfo } from "@fluidframework/driver-definitions";
15
16
  import {
16
17
  ConnectionMode,
17
18
  IClientConfiguration,
@@ -21,7 +22,6 @@ import {
21
22
  ISignalClient,
22
23
  ISignalMessage,
23
24
  } from "@fluidframework/protocol-definitions";
24
- import { IContainerPackageInfo } from "@fluidframework/driver-definitions";
25
25
 
26
26
  export enum ReconnectMode {
27
27
  Never = "Never",
@@ -100,7 +100,7 @@ export interface IConnectionManager {
100
100
  * Submits signal to relay service.
101
101
  * Called only when active connection is present.
102
102
  */
103
- submitSignal(content: any, targetClientId?: string): void;
103
+ submitSignal: (content: string, targetClientId?: string) => void;
104
104
 
105
105
  /**
106
106
  * Submits messages to relay service.
@@ -3,12 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import { performance } from "@fluid-internal/client-utils";
6
7
  import {
7
8
  ITelemetryBaseEvent,
8
9
  ITelemetryBaseLogger,
9
10
  ITelemetryBaseProperties,
10
11
  } from "@fluidframework/core-interfaces";
11
- import { performance } from "@fluid-internal/client-utils";
12
12
 
13
13
  import {
14
14
  ITelemetryLoggerExt,
@@ -3,46 +3,46 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { v4 as uuid } from "uuid";
7
- import {
8
- IThrottlingWarning,
9
- IEventProvider,
10
- ITelemetryBaseProperties,
11
- type ITelemetryBaseEvent,
12
- } from "@fluidframework/core-interfaces";
6
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
13
7
  import {
14
8
  ICriticalContainerError,
15
9
  IDeltaManager,
16
10
  IDeltaManagerEvents,
17
11
  IDeltaQueue,
18
12
  } from "@fluidframework/container-definitions";
19
- import { TypedEventEmitter } from "@fluid-internal/client-utils";
20
- import { assert } from "@fluidframework/core-utils";
21
13
  import {
22
- DataProcessingError,
23
- extractSafePropertiesFromMessage,
24
- normalizeError,
25
- safeRaiseEvent,
26
- isFluidError,
27
- ITelemetryLoggerExt,
28
- DataCorruptionError,
29
- UsageError,
30
- type ITelemetryGenericEventExt,
31
- type ITelemetryErrorEventExt,
32
- } from "@fluidframework/telemetry-utils";
14
+ IEventProvider,
15
+ type ITelemetryBaseEvent,
16
+ ITelemetryBaseProperties,
17
+ IThrottlingWarning,
18
+ } from "@fluidframework/core-interfaces";
19
+ import { assert } from "@fluidframework/core-utils";
33
20
  import {
21
+ DriverErrorTypes,
34
22
  IDocumentDeltaStorageService,
35
23
  IDocumentService,
36
- DriverErrorTypes,
37
24
  } from "@fluidframework/driver-definitions";
25
+ import { MessageType2, NonRetryableError, isRuntimeMessage } from "@fluidframework/driver-utils";
38
26
  import {
27
+ ConnectionMode,
39
28
  IDocumentMessage,
40
29
  ISequencedDocumentMessage,
41
30
  ISignalMessage,
42
31
  MessageType,
43
- ConnectionMode,
44
32
  } from "@fluidframework/protocol-definitions";
45
- import { NonRetryableError, isRuntimeMessage, MessageType2 } from "@fluidframework/driver-utils";
33
+ import {
34
+ DataCorruptionError,
35
+ DataProcessingError,
36
+ type ITelemetryErrorEventExt,
37
+ type ITelemetryGenericEventExt,
38
+ ITelemetryLoggerExt,
39
+ UsageError,
40
+ extractSafePropertiesFromMessage,
41
+ isFluidError,
42
+ normalizeError,
43
+ safeRaiseEvent,
44
+ } from "@fluidframework/telemetry-utils";
45
+ import { v4 as uuid } from "uuid";
46
46
 
47
47
  import {
48
48
  IConnectionDetailsInternal,
@@ -325,7 +325,7 @@ export class DeltaManager<TConnectionManager extends IConnectionManager>
325
325
  return message.clientSequenceNumber;
326
326
  }
327
327
 
328
- public submitSignal(content: any, targetClientId?: string) {
328
+ public submitSignal(content: string, targetClientId?: string) {
329
329
  return this.connectionManager.submitSignal(content, targetClientId);
330
330
  }
331
331
 
package/src/deltaQueue.ts CHANGED
@@ -3,9 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import { TypedEventEmitter, performance } from "@fluid-internal/client-utils";
6
7
  import { IDeltaQueue, IDeltaQueueEvents } from "@fluidframework/container-definitions";
7
8
  import { assert } from "@fluidframework/core-utils";
8
- import { performance, TypedEventEmitter } from "@fluid-internal/client-utils";
9
9
  import Deque from "double-ended-queue";
10
10
 
11
11
  export interface IDeltaQueueWriter<T> {
package/src/error.ts CHANGED
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryBaseProperties, IThrottlingWarning } from "@fluidframework/core-interfaces";
7
6
  import { ContainerErrorTypes } from "@fluidframework/container-definitions";
7
+ import { ITelemetryBaseProperties, IThrottlingWarning } from "@fluidframework/core-interfaces";
8
8
  import {
9
9
  IFluidErrorBase,
10
10
  ITelemetryLoggerExt,
package/src/loader.ts CHANGED
@@ -3,32 +3,22 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { v4 as uuid } from "uuid";
7
- import {
8
- ITelemetryLoggerExt,
9
- mixinMonitoringContext,
10
- MonitoringContext,
11
- PerformanceEvent,
12
- sessionStorageConfigProvider,
13
- createChildMonitoringContext,
14
- UsageError,
15
- } from "@fluidframework/telemetry-utils";
16
- import {
17
- ITelemetryBaseLogger,
18
- FluidObject,
19
- IRequest,
20
- IConfigProviderBase,
21
- } from "@fluidframework/core-interfaces";
22
6
  import {
23
7
  IContainer,
8
+ IFluidCodeDetails,
24
9
  IFluidModule,
25
10
  IHostLoader,
26
11
  ILoader,
27
12
  ILoaderOptions as ILoaderOptions1,
28
- LoaderHeader,
29
13
  IProvideFluidCodeDetailsComparer,
30
- IFluidCodeDetails,
14
+ LoaderHeader,
31
15
  } from "@fluidframework/container-definitions";
16
+ import {
17
+ FluidObject,
18
+ IConfigProviderBase,
19
+ IRequest,
20
+ ITelemetryBaseLogger,
21
+ } from "@fluidframework/core-interfaces";
32
22
  import {
33
23
  IDocumentServiceFactory,
34
24
  IDocumentStorageService,
@@ -36,11 +26,22 @@ import {
36
26
  IUrlResolver,
37
27
  } from "@fluidframework/driver-definitions";
38
28
  import { IClientDetails } from "@fluidframework/protocol-definitions";
39
- import { Container, IPendingContainerState } from "./container.js";
40
- import { tryParseCompatibleResolvedUrl } from "./utils.js";
29
+ import {
30
+ ITelemetryLoggerExt,
31
+ MonitoringContext,
32
+ PerformanceEvent,
33
+ UsageError,
34
+ createChildMonitoringContext,
35
+ mixinMonitoringContext,
36
+ sessionStorageConfigProvider,
37
+ } from "@fluidframework/telemetry-utils";
38
+ import { v4 as uuid } from "uuid";
39
+ import { Container } from "./container.js";
40
+ import { DebugLogger } from "./debugLogger.js";
41
41
  import { pkgVersion } from "./packageVersion.js";
42
42
  import { ProtocolHandlerBuilder } from "./protocol.js";
43
- import { DebugLogger } from "./debugLogger.js";
43
+ import type { IPendingContainerState } from "./serializedStateManager.js";
44
+ import { tryParseCompatibleResolvedUrl } from "./utils.js";
44
45
 
45
46
  function ensureResolvedUrlDefined(
46
47
  resolved: IResolvedUrl | undefined,
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryBaseLogger, IRequest } from "@fluidframework/core-interfaces";
6
+ import { IRequest, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
7
7
  import {
8
8
  DriverErrorTypes,
9
9
  ILocationRedirectionError,
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
7
+ import { IEvent } from "@fluidframework/core-interfaces";
7
8
  import { assert, Timer } from "@fluidframework/core-utils";
8
- import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
9
9
  import { isRuntimeMessage } from "@fluidframework/driver-utils";
10
- import { IEvent } from "@fluidframework/core-interfaces";
10
+ import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
11
11
 
12
12
  const defaultNoopTimeFrequency = 2000;
13
13
  const defaultNoopCountFrequency = 50;
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-loader";
9
- export const pkgVersion = "2.0.0-dev-rc.2.0.0.245554";
9
+ export const pkgVersion = "2.0.0-dev-rc.3.0.0.250606";
package/src/quorum.ts CHANGED
@@ -2,7 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IFluidCodeDetails } from "@fluidframework/core-interfaces";
5
+
6
+ import { IFluidCodeDetails } from "@fluidframework/container-definitions";
6
7
  import { ICommittedProposal } from "@fluidframework/protocol-definitions";
7
8
 
8
9
  export function initQuorumValuesFromCodeDetails(