@fluidframework/container-runtime 2.70.0-360374 → 2.70.0-361092

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 (47) hide show
  1. package/api-report/container-runtime.legacy.beta.api.md +0 -3
  2. package/container-runtime.test-files.tar +0 -0
  3. package/dist/blobManager/blobManager.d.ts +11 -11
  4. package/dist/blobManager/blobManager.d.ts.map +1 -1
  5. package/dist/blobManager/blobManager.js +16 -16
  6. package/dist/blobManager/blobManager.js.map +1 -1
  7. package/dist/blobManager/index.d.ts +1 -1
  8. package/dist/blobManager/index.d.ts.map +1 -1
  9. package/dist/blobManager/index.js.map +1 -1
  10. package/dist/containerRuntime.d.ts +40 -25
  11. package/dist/containerRuntime.d.ts.map +1 -1
  12. package/dist/containerRuntime.js +24 -16
  13. package/dist/containerRuntime.js.map +1 -1
  14. package/dist/index.d.ts +0 -5
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/legacy.d.ts +0 -1
  18. package/dist/packageVersion.d.ts +1 -1
  19. package/dist/packageVersion.js +1 -1
  20. package/dist/packageVersion.js.map +1 -1
  21. package/dist/summary/orderedClientElection.js.map +1 -1
  22. package/lib/blobManager/blobManager.d.ts +11 -11
  23. package/lib/blobManager/blobManager.d.ts.map +1 -1
  24. package/lib/blobManager/blobManager.js +16 -16
  25. package/lib/blobManager/blobManager.js.map +1 -1
  26. package/lib/blobManager/index.d.ts +1 -1
  27. package/lib/blobManager/index.d.ts.map +1 -1
  28. package/lib/blobManager/index.js.map +1 -1
  29. package/lib/containerRuntime.d.ts +40 -25
  30. package/lib/containerRuntime.d.ts.map +1 -1
  31. package/lib/containerRuntime.js +24 -16
  32. package/lib/containerRuntime.js.map +1 -1
  33. package/lib/index.d.ts +0 -5
  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/packageVersion.d.ts +1 -1
  38. package/lib/packageVersion.js +1 -1
  39. package/lib/packageVersion.js.map +1 -1
  40. package/lib/summary/orderedClientElection.js.map +1 -1
  41. package/package.json +23 -37
  42. package/src/blobManager/blobManager.ts +27 -27
  43. package/src/blobManager/index.ts +1 -0
  44. package/src/containerRuntime.ts +55 -32
  45. package/src/index.ts +0 -6
  46. package/src/packageVersion.ts +1 -1
  47. package/src/summary/orderedClientElection.ts +1 -1
@@ -730,7 +730,9 @@ export interface LoadContainerRuntimeParams {
730
730
  */
731
731
  existing: boolean;
732
732
  /**
733
- * Additional options to be passed to the runtime
733
+ * Additional options to be passed to the runtime.
734
+ * @remarks
735
+ * Defaults to `{}`.
734
736
  */
735
737
  runtimeOptions?: IContainerRuntimeOptions;
736
738
  /**
@@ -829,37 +831,60 @@ export class ContainerRuntime
829
831
  {
830
832
  /**
831
833
  * Load the stores from a snapshot and returns the runtime.
832
- * @param params - An object housing the runtime properties:
833
- * - context - Context of the container.
834
- * - registryEntries - Mapping from data store types to their corresponding factories.
835
- * - existing - Pass 'true' if loading from an existing snapshot.
836
- * - requestHandler - (optional) Request handler for the request() method of the container runtime.
837
- * Only relevant for back-compat while we remove the request() method and move fully to entryPoint as the main pattern.
838
- * - runtimeOptions - Additional options to be passed to the runtime
839
- * - containerScope - runtime services provided with context
840
- * - containerRuntimeCtor - Constructor to use to create the ContainerRuntime instance.
841
- * This allows mixin classes to leverage this method to define their own async initializer.
842
- * - provideEntryPoint - Promise that resolves to an object which will act as entryPoint for the Container.
843
- * - minVersionForCollab - Minimum version of the FF runtime that this runtime supports collaboration with.
844
- * This object should provide all the functionality that the Container is expected to provide to the loader layer.
834
+ * @param params - An object housing the runtime properties.
835
+ * {@link LoadContainerRuntimeParams} except internal, while still having layer compat obligations.
836
+ * @privateRemarks
837
+ * Despite this being `@internal`, `@fluidframework/test-utils` uses it in `createTestContainerRuntimeFactory` and assumes multiple versions of the package expose the same API.
838
+ *
839
+ * Also note that `mixinAttributor` from `@fluid-experimental/attributor` overrides this function:
840
+ * that will have to be updated if changing the signature of this function as well.
841
+ *
842
+ * Assuming these usages are updated appropriately,
843
+ * `loadRuntime` could be removed (replaced by `loadRuntime2` which could be renamed back to `loadRuntime`).
845
844
  */
846
- public static async loadRuntime(params: {
847
- context: IContainerContext;
848
- registryEntries: NamedFluidDataStoreRegistryEntries;
849
- existing: boolean;
850
- runtimeOptions?: IContainerRuntimeOptionsInternal;
851
- containerScope?: FluidObject;
852
- containerRuntimeCtor?: typeof ContainerRuntime;
853
- /**
854
- * @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
855
- */
856
- requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
857
- provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>;
858
- minVersionForCollab?: MinimumVersionForCollab;
859
- }): Promise<ContainerRuntime> {
845
+ public static async loadRuntime(
846
+ params: LoadContainerRuntimeParams & {
847
+ /**
848
+ * Constructor to use to create the ContainerRuntime instance.
849
+ * @remarks
850
+ * Defaults to {@link ContainerRuntime}.
851
+ */
852
+ containerRuntimeCtor?: typeof ContainerRuntime;
853
+ },
854
+ ): Promise<ContainerRuntime> {
855
+ return ContainerRuntime.loadRuntime2({
856
+ ...params,
857
+ registry: new FluidDataStoreRegistry(params.registryEntries),
858
+ });
859
+ }
860
+
861
+ /**
862
+ * Load the stores from a snapshot and returns the runtime.
863
+ * @remarks
864
+ * Same as {@link ContainerRuntime.loadRuntime},
865
+ * but with `registry` instead of `registryEntries` and more `runtimeOptions`.
866
+ */
867
+ public static async loadRuntime2(
868
+ params: Omit<LoadContainerRuntimeParams, "registryEntries" | "runtimeOptions"> & {
869
+ /**
870
+ * Mapping from data store types to their corresponding factories.
871
+ */
872
+ registry: IFluidDataStoreRegistry;
873
+ /**
874
+ * Constructor to use to create the ContainerRuntime instance.
875
+ * @remarks
876
+ * Defaults to {@link ContainerRuntime}.
877
+ */
878
+ containerRuntimeCtor?: typeof ContainerRuntime;
879
+ /**
880
+ * {@link LoadContainerRuntimeParams.runtimeOptions}, except with additional internal only options.
881
+ */
882
+ runtimeOptions?: IContainerRuntimeOptionsInternal;
883
+ },
884
+ ): Promise<ContainerRuntime> {
860
885
  const {
861
886
  context,
862
- registryEntries,
887
+ registry,
863
888
  existing,
864
889
  requestHandler,
865
890
  provideEntryPoint,
@@ -959,8 +984,6 @@ export class ContainerRuntime
959
984
  ? runtimeOptions.enableRuntimeIdCompressor
960
985
  : defaultConfigs.enableRuntimeIdCompressor;
961
986
 
962
- const registry = new FluidDataStoreRegistry(registryEntries);
963
-
964
987
  const tryFetchBlob = async <T>(blobName: string): Promise<T | undefined> => {
965
988
  const blobId = context.baseSnapshot?.blobs[blobName];
966
989
  if (context.baseSnapshot !== undefined && blobId !== undefined) {
@@ -1916,7 +1939,7 @@ export class ContainerRuntime
1916
1939
  routeContext: this.handleContext,
1917
1940
  blobManagerLoadInfo,
1918
1941
  storage: this.storage,
1919
- sendBlobAttachOp: (localId: string, blobId: string) => {
1942
+ sendBlobAttachMessage: (localId: string, blobId: string) => {
1920
1943
  if (!this.disposed) {
1921
1944
  this.submit(
1922
1945
  { type: ContainerMessageType.BlobAttach, contents: undefined },
package/src/index.ts CHANGED
@@ -20,12 +20,6 @@ export {
20
20
  } from "./containerRuntime.js";
21
21
  export type { ICompressionRuntimeOptions } from "./compressionDefinitions.js";
22
22
  export { CompressionAlgorithms, disabledCompressionConfig } from "./compressionDefinitions.js";
23
- export type {
24
- /**
25
- * @deprecated Import from `@fluidframework/runtime-definitions/legacy` instead.
26
- */
27
- MinimumVersionForCollab,
28
- } from "@fluidframework/runtime-definitions/internal";
29
23
  export {
30
24
  ContainerMessageType,
31
25
  type UnknownContainerRuntimeMessage,
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-runtime";
9
- export const pkgVersion = "2.70.0-360374";
9
+ export const pkgVersion = "2.70.0-361092";
@@ -27,7 +27,7 @@ import {
27
27
  import { summarizerClientType } from "./summarizerTypes.js";
28
28
 
29
29
  // helper types for recursive readonly.
30
- // eslint-disable-next-line @typescript-eslint/ban-types
30
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type, @typescript-eslint/ban-types
31
31
  export type ImmutablePrimitives = undefined | null | boolean | string | number | Function;
32
32
  export type Immutable<T> = T extends ImmutablePrimitives
33
33
  ? T