@fluidframework/fluid-static 2.103.0 → 2.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/api-report/fluid-static.legacy.beta.api.md +0 -1
- package/dist/treeRootDataObject.d.ts +0 -7
- package/dist/treeRootDataObject.d.ts.map +1 -1
- package/dist/treeRootDataObject.js +2 -4
- package/dist/treeRootDataObject.js.map +1 -1
- package/lib/treeRootDataObject.d.ts +0 -7
- package/lib/treeRootDataObject.d.ts.map +1 -1
- package/lib/treeRootDataObject.js +2 -4
- package/lib/treeRootDataObject.js.map +1 -1
- package/package.json +24 -24
- package/src/treeRootDataObject.ts +3 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @fluidframework/fluid-static
|
|
2
2
|
|
|
3
|
+
## 2.110.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- minVersionForCollabOverride removed from createTreeContainerRuntimeFactory props argument ([#27540](https://github.com/microsoft/FluidFramework/pull/27540)) [da469ffe44a](https://github.com/microsoft/FluidFramework/commit/da469ffe44a189ba8741e8d98a62f82ecf6bc348)
|
|
8
|
+
|
|
9
|
+
Instead specify `minVersionForCollaboration` property directly.
|
|
10
|
+
(Deprecated `compatibilityMode` property should also be removed.)
|
|
11
|
+
See [#27356](https://github.com/microsoft/FluidFramework/issues/27356) and [#23289](https://github.com/microsoft/FluidFramework/issues/23289).
|
|
12
|
+
|
|
3
13
|
## 2.103.0
|
|
4
14
|
|
|
5
15
|
Dependency updates only.
|
|
@@ -30,7 +30,6 @@ export function createTreeContainerRuntimeFactory(props: {
|
|
|
30
30
|
readonly compatibilityMode: CompatibilityMode;
|
|
31
31
|
readonly rootDataStoreRegistry?: IFluidDataStoreRegistry;
|
|
32
32
|
readonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;
|
|
33
|
-
readonly minVersionForCollabOverride?: MinimumVersionForCollab;
|
|
34
33
|
}): IRuntimeFactory;
|
|
35
34
|
|
|
36
35
|
// @public
|
|
@@ -70,12 +70,5 @@ export declare function createTreeContainerRuntimeFactory(props: {
|
|
|
70
70
|
* If not provided, only the default options for the given compatibilityMode will be used.
|
|
71
71
|
*/
|
|
72
72
|
readonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;
|
|
73
|
-
/**
|
|
74
|
-
* Optional override for minimum version for collaboration.
|
|
75
|
-
* @remarks
|
|
76
|
-
* If not provided, the default for the given compatibilityMode will be used.
|
|
77
|
-
* Rather than defining this, omit `compatibilityMode` and pass `minVersionForCollaboration` directly.
|
|
78
|
-
*/
|
|
79
|
-
readonly minVersionForCollabOverride?: MinimumVersionForCollab;
|
|
80
73
|
}): IRuntimeFactory;
|
|
81
74
|
//# sourceMappingURL=treeRootDataObject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeRootDataObject.d.ts","sourceRoot":"","sources":["../src/treeRootDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAEN,KAAK,wBAAwB,EAC7B,MAAM,4CAA4C,CAAC;AAYpD,OAAO,KAAK,EACX,uBAAuB,EACvB,uBAAuB,EACvB,MAAM,8CAA8C,CAAC;AAItD,OAAO,KAAK,EAEX,iBAAiB,EAKjB,mBAAmB,EACnB,MAAM,YAAY,CAAC;AAuJpB;;;;;;;;;;GAUG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACxD;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,0BAA0B,EAAE,uBAAuB,CAAC;IAC7D;;;OAGG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,uBAAuB,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAA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AAE,mBAAmB,CAAC;IAErC;;OAEG;IAEH,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C;;;OAGG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,uBAAuB,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACpE,GAAG,eAAe,CAAC"}
|
|
@@ -134,7 +134,7 @@ class TreeRootDataObjectFactory extends internal_1.TreeDataObjectFactory {
|
|
|
134
134
|
}
|
|
135
135
|
// Implementation
|
|
136
136
|
function createTreeContainerRuntimeFactory(props) {
|
|
137
|
-
const { compatibilityMode, minVersionForCollaboration,
|
|
137
|
+
const { compatibilityMode, minVersionForCollaboration, rootDataStoreRegistry, runtimeOptionOverrides, schema, } = props;
|
|
138
138
|
let minVersionForCollab;
|
|
139
139
|
if (minVersionForCollaboration !== undefined) {
|
|
140
140
|
minVersionForCollab = minVersionForCollaboration;
|
|
@@ -143,9 +143,7 @@ function createTreeContainerRuntimeFactory(props) {
|
|
|
143
143
|
throw new Error("Either minVersionForCollaboration or compatibilityMode (deprecated) must be provided.");
|
|
144
144
|
}
|
|
145
145
|
else {
|
|
146
|
-
minVersionForCollab =
|
|
147
|
-
minVersionForCollabOverride ??
|
|
148
|
-
(0, utils_js_1.resolveCompatibilityModeToMinVersionForCollab)(compatibilityMode);
|
|
146
|
+
minVersionForCollab = (0, utils_js_1.resolveCompatibilityModeToMinVersionForCollab)(compatibilityMode);
|
|
149
147
|
}
|
|
150
148
|
const [registryEntries, sharedObjects] = (0, utils_js_1.parseDataObjectsFromSharedObjects)(schema);
|
|
151
149
|
const registry = rootDataStoreRegistry ?? new internal_2.FluidDataStoreRegistry(registryEntries);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeRootDataObject.js","sourceRoot":"","sources":["../src/treeRootDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AA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AE,sBAAsB;YAC5B,IAAI;YACJ,aAAa;SACb,CAAC,CAAC;QAjBc,sBAAiB,GAAjB,iBAAiB,CAAyB;IAkB5D,CAAC;IAED,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAC/B,CAAC;CACD;AA+ED,iBAAiB;AACjB,SAAgB,iCAAiC,CAAC,KAQjD;IACA,MAAM,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,MAAM,GACN,GAAG,KAAK,CAAC;IAEV,IAAI,mBAA4C,CAAC;IACjD,IAAI,0BAA0B,KAAK,SAAS,EAAE,CAAC;QAC9C,mBAAmB,GAAG,0BAA0B,CAAC;IAClD,CAAC;SAAM,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CACd,uFAAuF,CACvF,CAAC;IACH,CAAC;SAAM,CAAC;QACP,mBAAmB;YAClB,2BAA2B;gBAC3B,IAAA,wDAA6C,EAAC,iBAAiB,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,GAAG,IAAA,4CAAiC,EAAC,MAAM,CAAC,CAAC;IACnF,MAAM,QAAQ,GAAG,qBAAqB,IAAI,IAAI,iCAAsB,CAAC,eAAe,CAAC,CAAC;IAEtF,OAAO,IAAI,2BAA2B,CACrC,IAAI,yBAAyB,CAAC,aAAa,EAAE,QAAQ,CAAC,EACtD;QACC,cAAc,EAAE,sBAAsB;QACtC,mBAAmB;KACnB,CACD,CAAC;AACH,CAAC;AAzCD,8EAyCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tBaseContainerRuntimeFactory,\n\tTreeDataObject,\n\tTreeDataObjectFactory,\n} from \"@fluidframework/aqueduct/internal\";\nimport type { IDataObjectProps } from \"@fluidframework/aqueduct/internal\";\nimport type { IRuntimeFactory } from \"@fluidframework/container-definitions/internal\";\nimport {\n\tFluidDataStoreRegistry,\n\ttype IContainerRuntimeOptions,\n} from \"@fluidframework/container-runtime/internal\";\nimport type {\n\tIContainerRuntime,\n\tIContainerRuntimeInternal,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIFluidHandle,\n\tIFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelFactory } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIFluidDataStoreRegistry,\n\tMinimumVersionForCollab,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport { defaultRuntimeOptionsForMinVersion } from \"./compatibilityConfiguration.js\";\nimport type {\n\t// eslint-disable-next-line import-x/no-deprecated\n\tCompatibilityMode,\n\tIRootDataObject,\n\tIStaticEntryPoint,\n\tLoadableObjectKind,\n\tLoadableObjectRecord,\n\tTreeContainerSchema,\n} from \"./types.js\";\nimport {\n\tcreateDataObject,\n\tcreateSharedObject,\n\tisDataObjectKind,\n\tisSharedObjectKind,\n\tmakeFluidObject,\n\tparseDataObjectsFromSharedObjects,\n\tresolveCompatibilityModeToMinVersionForCollab,\n} from \"./utils.js\";\n\n/**\n * This module contains types and factories for creating tree-based root data objects.\n * They exist as an alternative to the APIs in `rootDataObject.ts`.\n *\n * These APIs are currently shaped to parallel `RootDataObject`, but this is not intended as the long-term design.\n * The current shape is a short-term solution to allow for easier migration from the old APIs.\n */\n\n/**\n * The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.\n *\n * @remarks\n * Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.\n */\nclass TreeRootDataObject extends TreeDataObject implements IRootDataObject {\n\tpublic constructor(props: IDataObjectProps) {\n\t\tsuper(props);\n\t}\n\n\tpublic get TreeRootDataObject(): TreeRootDataObject {\n\t\treturn this;\n\t}\n\n\t// TODO: longer term, it would be better to not have to fit into the `initialObjects` model for tree-based containers.\n\t// But in the short term, fitting into this model makes migration easier.\n\tpublic get initialObjects(): LoadableObjectRecord {\n\t\treturn {\n\t\t\ttree: this.tree,\n\t\t};\n\t}\n\n\tpublic async create<T>(objectClass: SharedObjectKind<T>): Promise<T> {\n\t\tconst internal = objectClass as unknown as LoadableObjectKind<T & IFluidLoadable>;\n\t\tif (isDataObjectKind(internal)) {\n\t\t\treturn createDataObject(internal, this.context);\n\t\t} else if (isSharedObjectKind(internal)) {\n\t\t\treturn createSharedObject(internal, this.runtime);\n\t\t}\n\t\tthrow new Error(\"Could not create new Fluid object because an unknown object was passed\");\n\t}\n\n\tpublic async uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n\t\treturn this.runtime.uploadBlob(blob);\n\t}\n}\n\nconst treeRootDataStoreId = \"treeRootDOId\";\n\n/**\n * Type of the {@link TreeRootDataObject}.\n * @remarks Used in the PureDataObjectFactory to create the root data object.\n */\nconst treeRootDataObjectType = \"treeRootDO\";\n\nasync function provideEntryPoint(\n\tcontainerRuntime: IContainerRuntime,\n): Promise<IStaticEntryPoint> {\n\tconst entryPoint = await containerRuntime.getAliasedDataStoreEntryPoint(treeRootDataStoreId);\n\tif (entryPoint === undefined) {\n\t\tthrow new Error(`default dataStore [${treeRootDataStoreId}] must exist`);\n\t}\n\tconst treeRootDataObject = ((await entryPoint.get()) as FluidObject<TreeRootDataObject>)\n\t\t.TreeRootDataObject;\n\tassert(\n\t\ttreeRootDataObject !== undefined,\n\t\t0xbe7 /* entryPoint must be of type TreeRootDataObject */,\n\t);\n\treturn makeFluidObject<IStaticEntryPoint>(\n\t\t{\n\t\t\trootDataObject: treeRootDataObject,\n\t\t\textensionStore: containerRuntime as IContainerRuntimeInternal,\n\t\t},\n\t\t\"IStaticEntryPoint\",\n\t);\n}\n\n/**\n * Factory for Container Runtime instances that provide a {@link IStaticEntryPoint}\n * (containing single {@link IRootDataObject}) as their entry point.\n */\nclass TreeContainerRuntimeFactory extends BaseContainerRuntimeFactory {\n\t// TODO: use for runtime factory.\n\treadonly #treeRootDataObjectFactory: TreeDataObjectFactory<TreeRootDataObject>;\n\n\tpublic constructor(\n\t\ttreeRootDataObjectFactory: TreeDataObjectFactory<TreeRootDataObject>,\n\t\tconfig: {\n\t\t\tminVersionForCollab: MinimumVersionForCollab;\n\t\t\truntimeOptions?: Partial<IContainerRuntimeOptions>;\n\t\t},\n\t) {\n\t\tsuper({\n\t\t\tregistryEntries: [treeRootDataObjectFactory.registryEntry],\n\t\t\truntimeOptions: {\n\t\t\t\t...defaultRuntimeOptionsForMinVersion(config.minVersionForCollab),\n\t\t\t\t...config.runtimeOptions,\n\t\t\t},\n\t\t\tprovideEntryPoint,\n\t\t\tminVersionForCollab: config.minVersionForCollab,\n\t\t});\n\t\tthis.#treeRootDataObjectFactory = treeRootDataObjectFactory;\n\t}\n\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void> {\n\t\t// The first time we create the container we create the RootDataObject\n\t\tawait this.#treeRootDataObjectFactory.createRootInstance(treeRootDataStoreId, runtime);\n\t}\n}\n\n/**\n * Factory that creates instances of a tree-based root data object.\n */\nclass TreeRootDataObjectFactory extends TreeDataObjectFactory<TreeRootDataObject> {\n\tpublic constructor(\n\t\tsharedObjects: readonly IChannelFactory[] = [],\n\t\tprivate readonly dataStoreRegistry: IFluidDataStoreRegistry,\n\t) {\n\t\ttype Ctor = new (props: IDataObjectProps) => TreeRootDataObject;\n\t\tconst ctor: Ctor = function (_props) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\treturn new TreeRootDataObject({\n\t\t\t\t..._props,\n\t\t\t\t// Add any additional injected properties here\n\t\t\t});\n\t\t} as unknown as Ctor;\n\n\t\t// Note: we're not specifying registry entries to the base class, so it won't create a registry itself,\n\t\t// and instead we override the necessary methods in this class to use the registry received in the constructor.\n\t\tsuper({\n\t\t\ttype: treeRootDataObjectType,\n\t\t\tctor,\n\t\t\tsharedObjects,\n\t\t});\n\t}\n\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry {\n\t\treturn this.dataStoreRegistry;\n\t}\n}\n\n/**\n * Creates an {@link @fluidframework/aqueduct#IRuntimeFactory} which constructs containers\n * with an entry point containing single tree-based root data object.\n *\n * @remarks\n * The entry point is opaque to caller.\n * The root data object's registry and shared objects are configured based on the provided\n * SharedTree and optionally data store registry.\n *\n * @legacy @beta\n */\nexport function createTreeContainerRuntimeFactory(props: {\n\t/**\n\t * The schema for the container.\n\t */\n\treadonly schema: TreeContainerSchema;\n\n\t/**\n\t * Minimum Fluid Framework version required for collaboration as a\n\t * {@link @fluidframework/runtime-definitions#MinimumVersionForCollab} SemVer string.\n\t */\n\treadonly minVersionForCollaboration: MinimumVersionForCollab;\n\t/**\n\t * Optional registry of data stores to pass to the DataObject factory.\n\t * If not provided, one will be created based on the schema.\n\t */\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\t/**\n\t * Optional overrides for the container runtime options.\n\t * If not provided, only the default options for the given minVersionForCollaboration will be used.\n\t */\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n}): IRuntimeFactory;\n\n/**\n * Creates an {@link @fluidframework/aqueduct#IRuntimeFactory} which constructs containers\n * with an entry point containing single tree-based root data object.\n *\n * @remarks\n * The entry point is opaque to caller.\n * The root data object's registry and shared objects are configured based on the provided\n * SharedTree and optional data store registry.\n *\n * @deprecated Pass `minVersionForCollaboration` directly instead of using `compatibilityMode`.\n *\n * @legacy @beta\n */\nexport function createTreeContainerRuntimeFactory(props: {\n\t/**\n\t * The schema for the container.\n\t */\n\treadonly schema: TreeContainerSchema;\n\n\t/**\n\t * Legacy compatibility mode for the container.\n\t */\n\t// eslint-disable-next-line import-x/no-deprecated\n\treadonly compatibilityMode: CompatibilityMode;\n\t/**\n\t * Optional registry of data stores to pass to the DataObject factory.\n\t * If not provided, one will be created based on the schema.\n\t */\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\t/**\n\t * Optional overrides for the container runtime options.\n\t * If not provided, only the default options for the given compatibilityMode will be used.\n\t */\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n\t/**\n\t * Optional override for minimum version for collaboration.\n\t * @remarks\n\t * If not provided, the default for the given compatibilityMode will be used.\n\t * Rather than defining this, omit `compatibilityMode` and pass `minVersionForCollaboration` directly.\n\t */\n\treadonly minVersionForCollabOverride?: MinimumVersionForCollab;\n}): IRuntimeFactory;\n\n// Implementation\nexport function createTreeContainerRuntimeFactory(props: {\n\treadonly schema: TreeContainerSchema;\n\t// eslint-disable-next-line import-x/no-deprecated\n\treadonly compatibilityMode?: CompatibilityMode;\n\treadonly minVersionForCollaboration?: MinimumVersionForCollab;\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n\treadonly minVersionForCollabOverride?: MinimumVersionForCollab;\n}): IRuntimeFactory {\n\tconst {\n\t\tcompatibilityMode,\n\t\tminVersionForCollaboration,\n\t\tminVersionForCollabOverride,\n\t\trootDataStoreRegistry,\n\t\truntimeOptionOverrides,\n\t\tschema,\n\t} = props;\n\n\tlet minVersionForCollab: MinimumVersionForCollab;\n\tif (minVersionForCollaboration !== undefined) {\n\t\tminVersionForCollab = minVersionForCollaboration;\n\t} else if (compatibilityMode === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Either minVersionForCollaboration or compatibilityMode (deprecated) must be provided.\",\n\t\t);\n\t} else {\n\t\tminVersionForCollab =\n\t\t\tminVersionForCollabOverride ??\n\t\t\tresolveCompatibilityModeToMinVersionForCollab(compatibilityMode);\n\t}\n\n\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\tconst registry = rootDataStoreRegistry ?? new FluidDataStoreRegistry(registryEntries);\n\n\treturn new TreeContainerRuntimeFactory(\n\t\tnew TreeRootDataObjectFactory(sharedObjects, registry),\n\t\t{\n\t\t\truntimeOptions: runtimeOptionOverrides,\n\t\t\tminVersionForCollab,\n\t\t},\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"treeRootDataObject.js","sourceRoot":"","sources":["../src/treeRootDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAEH,gEAI2C;AAG3C,yEAGoD;AAUpD,kEAA6D;AAQ7D,mFAAqF;AAUrF,yCAQoB;AAEpB;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,kBAAmB,SAAQ,yBAAc;IAC9C,YAAmB,KAAuB;QACzC,KAAK,CAAC,KAAK,CAAC,CAAC;IACd,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,sHAAsH;IACtH,yEAAyE;IACzE,IAAW,cAAc;QACxB,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;SACf,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,MAAM,CAAI,WAAgC;QACtD,MAAM,QAAQ,GAAG,WAAgE,CAAC;QAClF,IAAI,IAAA,2BAAgB,EAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,OAAO,IAAA,2BAAgB,EAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,CAAC;aAAM,IAAI,IAAA,6BAAkB,EAAC,QAAQ,CAAC,EAAE,CAAC;YACzC,OAAO,IAAA,6BAAkB,EAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IAC3F,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,IAAqB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CACD;AAED,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAE3C;;;GAGG;AACH,MAAM,sBAAsB,GAAG,YAAY,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rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tBaseContainerRuntimeFactory,\n\tTreeDataObject,\n\tTreeDataObjectFactory,\n} from \"@fluidframework/aqueduct/internal\";\nimport type { IDataObjectProps } from \"@fluidframework/aqueduct/internal\";\nimport type { IRuntimeFactory } from \"@fluidframework/container-definitions/internal\";\nimport {\n\tFluidDataStoreRegistry,\n\ttype IContainerRuntimeOptions,\n} from \"@fluidframework/container-runtime/internal\";\nimport type {\n\tIContainerRuntime,\n\tIContainerRuntimeInternal,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIFluidHandle,\n\tIFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelFactory } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIFluidDataStoreRegistry,\n\tMinimumVersionForCollab,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport { defaultRuntimeOptionsForMinVersion } from \"./compatibilityConfiguration.js\";\nimport type {\n\t// eslint-disable-next-line import-x/no-deprecated\n\tCompatibilityMode,\n\tIRootDataObject,\n\tIStaticEntryPoint,\n\tLoadableObjectKind,\n\tLoadableObjectRecord,\n\tTreeContainerSchema,\n} from \"./types.js\";\nimport {\n\tcreateDataObject,\n\tcreateSharedObject,\n\tisDataObjectKind,\n\tisSharedObjectKind,\n\tmakeFluidObject,\n\tparseDataObjectsFromSharedObjects,\n\tresolveCompatibilityModeToMinVersionForCollab,\n} from \"./utils.js\";\n\n/**\n * This module contains types and factories for creating tree-based root data objects.\n * They exist as an alternative to the APIs in `rootDataObject.ts`.\n *\n * These APIs are currently shaped to parallel `RootDataObject`, but this is not intended as the long-term design.\n * The current shape is a short-term solution to allow for easier migration from the old APIs.\n */\n\n/**\n * The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.\n *\n * @remarks\n * Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.\n */\nclass TreeRootDataObject extends TreeDataObject implements IRootDataObject {\n\tpublic constructor(props: IDataObjectProps) {\n\t\tsuper(props);\n\t}\n\n\tpublic get TreeRootDataObject(): TreeRootDataObject {\n\t\treturn this;\n\t}\n\n\t// TODO: longer term, it would be better to not have to fit into the `initialObjects` model for tree-based containers.\n\t// But in the short term, fitting into this model makes migration easier.\n\tpublic get initialObjects(): LoadableObjectRecord {\n\t\treturn {\n\t\t\ttree: this.tree,\n\t\t};\n\t}\n\n\tpublic async create<T>(objectClass: SharedObjectKind<T>): Promise<T> {\n\t\tconst internal = objectClass as unknown as LoadableObjectKind<T & IFluidLoadable>;\n\t\tif (isDataObjectKind(internal)) {\n\t\t\treturn createDataObject(internal, this.context);\n\t\t} else if (isSharedObjectKind(internal)) {\n\t\t\treturn createSharedObject(internal, this.runtime);\n\t\t}\n\t\tthrow new Error(\"Could not create new Fluid object because an unknown object was passed\");\n\t}\n\n\tpublic async uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n\t\treturn this.runtime.uploadBlob(blob);\n\t}\n}\n\nconst treeRootDataStoreId = \"treeRootDOId\";\n\n/**\n * Type of the {@link TreeRootDataObject}.\n * @remarks Used in the PureDataObjectFactory to create the root data object.\n */\nconst treeRootDataObjectType = \"treeRootDO\";\n\nasync function provideEntryPoint(\n\tcontainerRuntime: IContainerRuntime,\n): Promise<IStaticEntryPoint> {\n\tconst entryPoint = await containerRuntime.getAliasedDataStoreEntryPoint(treeRootDataStoreId);\n\tif (entryPoint === undefined) {\n\t\tthrow new Error(`default dataStore [${treeRootDataStoreId}] must exist`);\n\t}\n\tconst treeRootDataObject = ((await entryPoint.get()) as FluidObject<TreeRootDataObject>)\n\t\t.TreeRootDataObject;\n\tassert(\n\t\ttreeRootDataObject !== undefined,\n\t\t0xbe7 /* entryPoint must be of type TreeRootDataObject */,\n\t);\n\treturn makeFluidObject<IStaticEntryPoint>(\n\t\t{\n\t\t\trootDataObject: treeRootDataObject,\n\t\t\textensionStore: containerRuntime as IContainerRuntimeInternal,\n\t\t},\n\t\t\"IStaticEntryPoint\",\n\t);\n}\n\n/**\n * Factory for Container Runtime instances that provide a {@link IStaticEntryPoint}\n * (containing single {@link IRootDataObject}) as their entry point.\n */\nclass TreeContainerRuntimeFactory extends BaseContainerRuntimeFactory {\n\t// TODO: use for runtime factory.\n\treadonly #treeRootDataObjectFactory: TreeDataObjectFactory<TreeRootDataObject>;\n\n\tpublic constructor(\n\t\ttreeRootDataObjectFactory: TreeDataObjectFactory<TreeRootDataObject>,\n\t\tconfig: {\n\t\t\tminVersionForCollab: MinimumVersionForCollab;\n\t\t\truntimeOptions?: Partial<IContainerRuntimeOptions>;\n\t\t},\n\t) {\n\t\tsuper({\n\t\t\tregistryEntries: [treeRootDataObjectFactory.registryEntry],\n\t\t\truntimeOptions: {\n\t\t\t\t...defaultRuntimeOptionsForMinVersion(config.minVersionForCollab),\n\t\t\t\t...config.runtimeOptions,\n\t\t\t},\n\t\t\tprovideEntryPoint,\n\t\t\tminVersionForCollab: config.minVersionForCollab,\n\t\t});\n\t\tthis.#treeRootDataObjectFactory = treeRootDataObjectFactory;\n\t}\n\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void> {\n\t\t// The first time we create the container we create the RootDataObject\n\t\tawait this.#treeRootDataObjectFactory.createRootInstance(treeRootDataStoreId, runtime);\n\t}\n}\n\n/**\n * Factory that creates instances of a tree-based root data object.\n */\nclass TreeRootDataObjectFactory extends TreeDataObjectFactory<TreeRootDataObject> {\n\tpublic constructor(\n\t\tsharedObjects: readonly IChannelFactory[] = [],\n\t\tprivate readonly dataStoreRegistry: IFluidDataStoreRegistry,\n\t) {\n\t\ttype Ctor = new (props: IDataObjectProps) => TreeRootDataObject;\n\t\tconst ctor: Ctor = function (_props) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\treturn new TreeRootDataObject({\n\t\t\t\t..._props,\n\t\t\t\t// Add any additional injected properties here\n\t\t\t});\n\t\t} as unknown as Ctor;\n\n\t\t// Note: we're not specifying registry entries to the base class, so it won't create a registry itself,\n\t\t// and instead we override the necessary methods in this class to use the registry received in the constructor.\n\t\tsuper({\n\t\t\ttype: treeRootDataObjectType,\n\t\t\tctor,\n\t\t\tsharedObjects,\n\t\t});\n\t}\n\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry {\n\t\treturn this.dataStoreRegistry;\n\t}\n}\n\n/**\n * Creates an {@link @fluidframework/aqueduct#IRuntimeFactory} which constructs containers\n * with an entry point containing single tree-based root data object.\n *\n * @remarks\n * The entry point is opaque to caller.\n * The root data object's registry and shared objects are configured based on the provided\n * SharedTree and optionally data store registry.\n *\n * @legacy @beta\n */\nexport function createTreeContainerRuntimeFactory(props: {\n\t/**\n\t * The schema for the container.\n\t */\n\treadonly schema: TreeContainerSchema;\n\n\t/**\n\t * Minimum Fluid Framework version required for collaboration as a\n\t * {@link @fluidframework/runtime-definitions#MinimumVersionForCollab} SemVer string.\n\t */\n\treadonly minVersionForCollaboration: MinimumVersionForCollab;\n\t/**\n\t * Optional registry of data stores to pass to the DataObject factory.\n\t * If not provided, one will be created based on the schema.\n\t */\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\t/**\n\t * Optional overrides for the container runtime options.\n\t * If not provided, only the default options for the given minVersionForCollaboration will be used.\n\t */\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n}): IRuntimeFactory;\n\n/**\n * Creates an {@link @fluidframework/aqueduct#IRuntimeFactory} which constructs containers\n * with an entry point containing single tree-based root data object.\n *\n * @remarks\n * The entry point is opaque to caller.\n * The root data object's registry and shared objects are configured based on the provided\n * SharedTree and optional data store registry.\n *\n * @deprecated Pass `minVersionForCollaboration` directly instead of using `compatibilityMode`.\n *\n * @legacy @beta\n */\nexport function createTreeContainerRuntimeFactory(props: {\n\t/**\n\t * The schema for the container.\n\t */\n\treadonly schema: TreeContainerSchema;\n\n\t/**\n\t * Legacy compatibility mode for the container.\n\t */\n\t// eslint-disable-next-line import-x/no-deprecated -- specify minVersionForCollaboration instead; see #23289\n\treadonly compatibilityMode: CompatibilityMode;\n\t/**\n\t * Optional registry of data stores to pass to the DataObject factory.\n\t * If not provided, one will be created based on the schema.\n\t */\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\t/**\n\t * Optional overrides for the container runtime options.\n\t * If not provided, only the default options for the given compatibilityMode will be used.\n\t */\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n}): IRuntimeFactory;\n\n// Implementation\nexport function createTreeContainerRuntimeFactory(props: {\n\treadonly schema: TreeContainerSchema;\n\t// eslint-disable-next-line import-x/no-deprecated -- specify minVersionForCollaboration instead; see #23289\n\treadonly compatibilityMode?: CompatibilityMode;\n\treadonly minVersionForCollaboration?: MinimumVersionForCollab;\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n}): IRuntimeFactory {\n\tconst {\n\t\tcompatibilityMode,\n\t\tminVersionForCollaboration,\n\t\trootDataStoreRegistry,\n\t\truntimeOptionOverrides,\n\t\tschema,\n\t} = props;\n\n\tlet minVersionForCollab: MinimumVersionForCollab;\n\tif (minVersionForCollaboration !== undefined) {\n\t\tminVersionForCollab = minVersionForCollaboration;\n\t} else if (compatibilityMode === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Either minVersionForCollaboration or compatibilityMode (deprecated) must be provided.\",\n\t\t);\n\t} else {\n\t\tminVersionForCollab = resolveCompatibilityModeToMinVersionForCollab(compatibilityMode);\n\t}\n\n\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\tconst registry = rootDataStoreRegistry ?? new FluidDataStoreRegistry(registryEntries);\n\n\treturn new TreeContainerRuntimeFactory(\n\t\tnew TreeRootDataObjectFactory(sharedObjects, registry),\n\t\t{\n\t\t\truntimeOptions: runtimeOptionOverrides,\n\t\t\tminVersionForCollab,\n\t\t},\n\t);\n}\n"]}
|
|
@@ -70,12 +70,5 @@ export declare function createTreeContainerRuntimeFactory(props: {
|
|
|
70
70
|
* If not provided, only the default options for the given compatibilityMode will be used.
|
|
71
71
|
*/
|
|
72
72
|
readonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;
|
|
73
|
-
/**
|
|
74
|
-
* Optional override for minimum version for collaboration.
|
|
75
|
-
* @remarks
|
|
76
|
-
* If not provided, the default for the given compatibilityMode will be used.
|
|
77
|
-
* Rather than defining this, omit `compatibilityMode` and pass `minVersionForCollaboration` directly.
|
|
78
|
-
*/
|
|
79
|
-
readonly minVersionForCollabOverride?: MinimumVersionForCollab;
|
|
80
73
|
}): IRuntimeFactory;
|
|
81
74
|
//# sourceMappingURL=treeRootDataObject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeRootDataObject.d.ts","sourceRoot":"","sources":["../src/treeRootDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAEN,KAAK,wBAAwB,EAC7B,MAAM,4CAA4C,CAAC;AAYpD,OAAO,KAAK,EACX,uBAAuB,EACvB,uBAAuB,EACvB,MAAM,8CAA8C,CAAC;AAItD,OAAO,KAAK,EAEX,iBAAiB,EAKjB,mBAAmB,EACnB,MAAM,YAAY,CAAC;AAuJpB;;;;;;;;;;GAUG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACxD;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,0BAA0B,EAAE,uBAAuB,CAAC;IAC7D;;;OAGG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,uBAAuB,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC,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AAC;IAErC;;OAEG;IAEH,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C;;;OAGG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,uBAAuB,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACpE,GAAG,eAAe,CAAC"}
|
|
@@ -131,7 +131,7 @@ class TreeRootDataObjectFactory extends TreeDataObjectFactory {
|
|
|
131
131
|
}
|
|
132
132
|
// Implementation
|
|
133
133
|
export function createTreeContainerRuntimeFactory(props) {
|
|
134
|
-
const { compatibilityMode, minVersionForCollaboration,
|
|
134
|
+
const { compatibilityMode, minVersionForCollaboration, rootDataStoreRegistry, runtimeOptionOverrides, schema, } = props;
|
|
135
135
|
let minVersionForCollab;
|
|
136
136
|
if (minVersionForCollaboration !== undefined) {
|
|
137
137
|
minVersionForCollab = minVersionForCollaboration;
|
|
@@ -140,9 +140,7 @@ export function createTreeContainerRuntimeFactory(props) {
|
|
|
140
140
|
throw new Error("Either minVersionForCollaboration or compatibilityMode (deprecated) must be provided.");
|
|
141
141
|
}
|
|
142
142
|
else {
|
|
143
|
-
minVersionForCollab =
|
|
144
|
-
minVersionForCollabOverride ??
|
|
145
|
-
resolveCompatibilityModeToMinVersionForCollab(compatibilityMode);
|
|
143
|
+
minVersionForCollab = resolveCompatibilityModeToMinVersionForCollab(compatibilityMode);
|
|
146
144
|
}
|
|
147
145
|
const [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);
|
|
148
146
|
const registry = rootDataStoreRegistry ?? new FluidDataStoreRegistry(registryEntries);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeRootDataObject.js","sourceRoot":"","sources":["../src/treeRootDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;AAEH,OAAO,EACN,2BAA2B,EAC3B,cAAc,EACd,qBAAqB,GACrB,MAAM,mCAA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M;YAClC,iEAAiE;YACjE,OAAO,IAAI,kBAAkB,CAAC;gBAC7B,GAAG,MAAM;gBACT,8CAA8C;aAC9C,CAAC,CAAC;QACJ,CAAoB,CAAC;QAErB,uGAAuG;QACvG,+GAA+G;QAC/G,KAAK,CAAC;YACL,IAAI,EAAE,sBAAsB;YAC5B,IAAI;YACJ,aAAa;SACb,CAAC,CAAC;QAjBc,sBAAiB,GAAjB,iBAAiB,CAAyB;IAkB5D,CAAC;IAED,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAC/B,CAAC;CACD;AA+ED,iBAAiB;AACjB,MAAM,UAAU,iCAAiC,CAAC,KAQjD;IACA,MAAM,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,MAAM,GACN,GAAG,KAAK,CAAC;IAEV,IAAI,mBAA4C,CAAC;IACjD,IAAI,0BAA0B,KAAK,SAAS,EAAE,CAAC;QAC9C,mBAAmB,GAAG,0BAA0B,CAAC;IAClD,CAAC;SAAM,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CACd,uFAAuF,CACvF,CAAC;IACH,CAAC;SAAM,CAAC;QACP,mBAAmB;YAClB,2BAA2B;gBAC3B,6CAA6C,CAAC,iBAAiB,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,GAAG,iCAAiC,CAAC,MAAM,CAAC,CAAC;IACnF,MAAM,QAAQ,GAAG,qBAAqB,IAAI,IAAI,sBAAsB,CAAC,eAAe,CAAC,CAAC;IAEtF,OAAO,IAAI,2BAA2B,CACrC,IAAI,yBAAyB,CAAC,aAAa,EAAE,QAAQ,CAAC,EACtD;QACC,cAAc,EAAE,sBAAsB;QACtC,mBAAmB;KACnB,CACD,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tBaseContainerRuntimeFactory,\n\tTreeDataObject,\n\tTreeDataObjectFactory,\n} from \"@fluidframework/aqueduct/internal\";\nimport type { IDataObjectProps } from \"@fluidframework/aqueduct/internal\";\nimport type { IRuntimeFactory } from \"@fluidframework/container-definitions/internal\";\nimport {\n\tFluidDataStoreRegistry,\n\ttype IContainerRuntimeOptions,\n} from \"@fluidframework/container-runtime/internal\";\nimport type {\n\tIContainerRuntime,\n\tIContainerRuntimeInternal,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIFluidHandle,\n\tIFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelFactory } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIFluidDataStoreRegistry,\n\tMinimumVersionForCollab,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport { defaultRuntimeOptionsForMinVersion } from \"./compatibilityConfiguration.js\";\nimport type {\n\t// eslint-disable-next-line import-x/no-deprecated\n\tCompatibilityMode,\n\tIRootDataObject,\n\tIStaticEntryPoint,\n\tLoadableObjectKind,\n\tLoadableObjectRecord,\n\tTreeContainerSchema,\n} from \"./types.js\";\nimport {\n\tcreateDataObject,\n\tcreateSharedObject,\n\tisDataObjectKind,\n\tisSharedObjectKind,\n\tmakeFluidObject,\n\tparseDataObjectsFromSharedObjects,\n\tresolveCompatibilityModeToMinVersionForCollab,\n} from \"./utils.js\";\n\n/**\n * This module contains types and factories for creating tree-based root data objects.\n * They exist as an alternative to the APIs in `rootDataObject.ts`.\n *\n * These APIs are currently shaped to parallel `RootDataObject`, but this is not intended as the long-term design.\n * The current shape is a short-term solution to allow for easier migration from the old APIs.\n */\n\n/**\n * The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.\n *\n * @remarks\n * Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.\n */\nclass TreeRootDataObject extends TreeDataObject implements IRootDataObject {\n\tpublic constructor(props: IDataObjectProps) {\n\t\tsuper(props);\n\t}\n\n\tpublic get TreeRootDataObject(): TreeRootDataObject {\n\t\treturn this;\n\t}\n\n\t// TODO: longer term, it would be better to not have to fit into the `initialObjects` model for tree-based containers.\n\t// But in the short term, fitting into this model makes migration easier.\n\tpublic get initialObjects(): LoadableObjectRecord {\n\t\treturn {\n\t\t\ttree: this.tree,\n\t\t};\n\t}\n\n\tpublic async create<T>(objectClass: SharedObjectKind<T>): Promise<T> {\n\t\tconst internal = objectClass as unknown as LoadableObjectKind<T & IFluidLoadable>;\n\t\tif (isDataObjectKind(internal)) {\n\t\t\treturn createDataObject(internal, this.context);\n\t\t} else if (isSharedObjectKind(internal)) {\n\t\t\treturn createSharedObject(internal, this.runtime);\n\t\t}\n\t\tthrow new Error(\"Could not create new Fluid object because an unknown object was passed\");\n\t}\n\n\tpublic async uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n\t\treturn this.runtime.uploadBlob(blob);\n\t}\n}\n\nconst treeRootDataStoreId = \"treeRootDOId\";\n\n/**\n * Type of the {@link TreeRootDataObject}.\n * @remarks Used in the PureDataObjectFactory to create the root data object.\n */\nconst treeRootDataObjectType = \"treeRootDO\";\n\nasync function provideEntryPoint(\n\tcontainerRuntime: IContainerRuntime,\n): Promise<IStaticEntryPoint> {\n\tconst entryPoint = await containerRuntime.getAliasedDataStoreEntryPoint(treeRootDataStoreId);\n\tif (entryPoint === undefined) {\n\t\tthrow new Error(`default dataStore [${treeRootDataStoreId}] must exist`);\n\t}\n\tconst treeRootDataObject = ((await entryPoint.get()) as FluidObject<TreeRootDataObject>)\n\t\t.TreeRootDataObject;\n\tassert(\n\t\ttreeRootDataObject !== undefined,\n\t\t0xbe7 /* entryPoint must be of type TreeRootDataObject */,\n\t);\n\treturn makeFluidObject<IStaticEntryPoint>(\n\t\t{\n\t\t\trootDataObject: treeRootDataObject,\n\t\t\textensionStore: containerRuntime as IContainerRuntimeInternal,\n\t\t},\n\t\t\"IStaticEntryPoint\",\n\t);\n}\n\n/**\n * Factory for Container Runtime instances that provide a {@link IStaticEntryPoint}\n * (containing single {@link IRootDataObject}) as their entry point.\n */\nclass TreeContainerRuntimeFactory extends BaseContainerRuntimeFactory {\n\t// TODO: use for runtime factory.\n\treadonly #treeRootDataObjectFactory: TreeDataObjectFactory<TreeRootDataObject>;\n\n\tpublic constructor(\n\t\ttreeRootDataObjectFactory: TreeDataObjectFactory<TreeRootDataObject>,\n\t\tconfig: {\n\t\t\tminVersionForCollab: MinimumVersionForCollab;\n\t\t\truntimeOptions?: Partial<IContainerRuntimeOptions>;\n\t\t},\n\t) {\n\t\tsuper({\n\t\t\tregistryEntries: [treeRootDataObjectFactory.registryEntry],\n\t\t\truntimeOptions: {\n\t\t\t\t...defaultRuntimeOptionsForMinVersion(config.minVersionForCollab),\n\t\t\t\t...config.runtimeOptions,\n\t\t\t},\n\t\t\tprovideEntryPoint,\n\t\t\tminVersionForCollab: config.minVersionForCollab,\n\t\t});\n\t\tthis.#treeRootDataObjectFactory = treeRootDataObjectFactory;\n\t}\n\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void> {\n\t\t// The first time we create the container we create the RootDataObject\n\t\tawait this.#treeRootDataObjectFactory.createRootInstance(treeRootDataStoreId, runtime);\n\t}\n}\n\n/**\n * Factory that creates instances of a tree-based root data object.\n */\nclass TreeRootDataObjectFactory extends TreeDataObjectFactory<TreeRootDataObject> {\n\tpublic constructor(\n\t\tsharedObjects: readonly IChannelFactory[] = [],\n\t\tprivate readonly dataStoreRegistry: IFluidDataStoreRegistry,\n\t) {\n\t\ttype Ctor = new (props: IDataObjectProps) => TreeRootDataObject;\n\t\tconst ctor: Ctor = function (_props) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\treturn new TreeRootDataObject({\n\t\t\t\t..._props,\n\t\t\t\t// Add any additional injected properties here\n\t\t\t});\n\t\t} as unknown as Ctor;\n\n\t\t// Note: we're not specifying registry entries to the base class, so it won't create a registry itself,\n\t\t// and instead we override the necessary methods in this class to use the registry received in the constructor.\n\t\tsuper({\n\t\t\ttype: treeRootDataObjectType,\n\t\t\tctor,\n\t\t\tsharedObjects,\n\t\t});\n\t}\n\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry {\n\t\treturn this.dataStoreRegistry;\n\t}\n}\n\n/**\n * Creates an {@link @fluidframework/aqueduct#IRuntimeFactory} which constructs containers\n * with an entry point containing single tree-based root data object.\n *\n * @remarks\n * The entry point is opaque to caller.\n * The root data object's registry and shared objects are configured based on the provided\n * SharedTree and optionally data store registry.\n *\n * @legacy @beta\n */\nexport function createTreeContainerRuntimeFactory(props: {\n\t/**\n\t * The schema for the container.\n\t */\n\treadonly schema: TreeContainerSchema;\n\n\t/**\n\t * Minimum Fluid Framework version required for collaboration as a\n\t * {@link @fluidframework/runtime-definitions#MinimumVersionForCollab} SemVer string.\n\t */\n\treadonly minVersionForCollaboration: MinimumVersionForCollab;\n\t/**\n\t * Optional registry of data stores to pass to the DataObject factory.\n\t * If not provided, one will be created based on the schema.\n\t */\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\t/**\n\t * Optional overrides for the container runtime options.\n\t * If not provided, only the default options for the given minVersionForCollaboration will be used.\n\t */\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n}): IRuntimeFactory;\n\n/**\n * Creates an {@link @fluidframework/aqueduct#IRuntimeFactory} which constructs containers\n * with an entry point containing single tree-based root data object.\n *\n * @remarks\n * The entry point is opaque to caller.\n * The root data object's registry and shared objects are configured based on the provided\n * SharedTree and optional data store registry.\n *\n * @deprecated Pass `minVersionForCollaboration` directly instead of using `compatibilityMode`.\n *\n * @legacy @beta\n */\nexport function createTreeContainerRuntimeFactory(props: {\n\t/**\n\t * The schema for the container.\n\t */\n\treadonly schema: TreeContainerSchema;\n\n\t/**\n\t * Legacy compatibility mode for the container.\n\t */\n\t// eslint-disable-next-line import-x/no-deprecated\n\treadonly compatibilityMode: CompatibilityMode;\n\t/**\n\t * Optional registry of data stores to pass to the DataObject factory.\n\t * If not provided, one will be created based on the schema.\n\t */\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\t/**\n\t * Optional overrides for the container runtime options.\n\t * If not provided, only the default options for the given compatibilityMode will be used.\n\t */\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n\t/**\n\t * Optional override for minimum version for collaboration.\n\t * @remarks\n\t * If not provided, the default for the given compatibilityMode will be used.\n\t * Rather than defining this, omit `compatibilityMode` and pass `minVersionForCollaboration` directly.\n\t */\n\treadonly minVersionForCollabOverride?: MinimumVersionForCollab;\n}): IRuntimeFactory;\n\n// Implementation\nexport function createTreeContainerRuntimeFactory(props: {\n\treadonly schema: TreeContainerSchema;\n\t// eslint-disable-next-line import-x/no-deprecated\n\treadonly compatibilityMode?: CompatibilityMode;\n\treadonly minVersionForCollaboration?: MinimumVersionForCollab;\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n\treadonly minVersionForCollabOverride?: MinimumVersionForCollab;\n}): IRuntimeFactory {\n\tconst {\n\t\tcompatibilityMode,\n\t\tminVersionForCollaboration,\n\t\tminVersionForCollabOverride,\n\t\trootDataStoreRegistry,\n\t\truntimeOptionOverrides,\n\t\tschema,\n\t} = props;\n\n\tlet minVersionForCollab: MinimumVersionForCollab;\n\tif (minVersionForCollaboration !== undefined) {\n\t\tminVersionForCollab = minVersionForCollaboration;\n\t} else if (compatibilityMode === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Either minVersionForCollaboration or compatibilityMode (deprecated) must be provided.\",\n\t\t);\n\t} else {\n\t\tminVersionForCollab =\n\t\t\tminVersionForCollabOverride ??\n\t\t\tresolveCompatibilityModeToMinVersionForCollab(compatibilityMode);\n\t}\n\n\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\tconst registry = rootDataStoreRegistry ?? new FluidDataStoreRegistry(registryEntries);\n\n\treturn new TreeContainerRuntimeFactory(\n\t\tnew TreeRootDataObjectFactory(sharedObjects, registry),\n\t\t{\n\t\t\truntimeOptions: runtimeOptionOverrides,\n\t\t\tminVersionForCollab,\n\t\t},\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"treeRootDataObject.js","sourceRoot":"","sources":["../src/treeRootDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;AAEH,OAAO,EACN,2BAA2B,EAC3B,cAAc,EACd,qBAAqB,GACrB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACN,sBAAsB,GAEtB,MAAM,4CAA4C,CAAC;AAUpD,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAQ7D,OAAO,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AAUrF,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,iCAAiC,EACjC,6CAA6C,GAC7C,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,kBAAmB,SAAQ,cAAc;IAC9C,YAAmB,KAAuB;QACzC,KAAK,CAAC,KAAK,CAAC,CAAC;IACd,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,sHAAsH;IACtH,yEAAyE;IACzE,IAAW,cAAc;QACxB,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;SACf,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,MAAM,CAAI,WAAgC;QACtD,MAAM,QAAQ,GAAG,WAAgE,CAAC;QAClF,IAAI,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,OAAO,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,OA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,iBAAiB,CAAC,CAAC;IACxF,CAAC;IAED,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,GAAG,iCAAiC,CAAC,MAAM,CAAC,CAAC;IACnF,MAAM,QAAQ,GAAG,qBAAqB,IAAI,IAAI,sBAAsB,CAAC,eAAe,CAAC,CAAC;IAEtF,OAAO,IAAI,2BAA2B,CACrC,IAAI,yBAAyB,CAAC,aAAa,EAAE,QAAQ,CAAC,EACtD;QACC,cAAc,EAAE,sBAAsB;QACtC,mBAAmB;KACnB,CACD,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tBaseContainerRuntimeFactory,\n\tTreeDataObject,\n\tTreeDataObjectFactory,\n} from \"@fluidframework/aqueduct/internal\";\nimport type { IDataObjectProps } from \"@fluidframework/aqueduct/internal\";\nimport type { IRuntimeFactory } from \"@fluidframework/container-definitions/internal\";\nimport {\n\tFluidDataStoreRegistry,\n\ttype IContainerRuntimeOptions,\n} from \"@fluidframework/container-runtime/internal\";\nimport type {\n\tIContainerRuntime,\n\tIContainerRuntimeInternal,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIFluidHandle,\n\tIFluidLoadable,\n} from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelFactory } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIFluidDataStoreRegistry,\n\tMinimumVersionForCollab,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport { defaultRuntimeOptionsForMinVersion } from \"./compatibilityConfiguration.js\";\nimport type {\n\t// eslint-disable-next-line import-x/no-deprecated\n\tCompatibilityMode,\n\tIRootDataObject,\n\tIStaticEntryPoint,\n\tLoadableObjectKind,\n\tLoadableObjectRecord,\n\tTreeContainerSchema,\n} from \"./types.js\";\nimport {\n\tcreateDataObject,\n\tcreateSharedObject,\n\tisDataObjectKind,\n\tisSharedObjectKind,\n\tmakeFluidObject,\n\tparseDataObjectsFromSharedObjects,\n\tresolveCompatibilityModeToMinVersionForCollab,\n} from \"./utils.js\";\n\n/**\n * This module contains types and factories for creating tree-based root data objects.\n * They exist as an alternative to the APIs in `rootDataObject.ts`.\n *\n * These APIs are currently shaped to parallel `RootDataObject`, but this is not intended as the long-term design.\n * The current shape is a short-term solution to allow for easier migration from the old APIs.\n */\n\n/**\n * The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.\n *\n * @remarks\n * Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.\n */\nclass TreeRootDataObject extends TreeDataObject implements IRootDataObject {\n\tpublic constructor(props: IDataObjectProps) {\n\t\tsuper(props);\n\t}\n\n\tpublic get TreeRootDataObject(): TreeRootDataObject {\n\t\treturn this;\n\t}\n\n\t// TODO: longer term, it would be better to not have to fit into the `initialObjects` model for tree-based containers.\n\t// But in the short term, fitting into this model makes migration easier.\n\tpublic get initialObjects(): LoadableObjectRecord {\n\t\treturn {\n\t\t\ttree: this.tree,\n\t\t};\n\t}\n\n\tpublic async create<T>(objectClass: SharedObjectKind<T>): Promise<T> {\n\t\tconst internal = objectClass as unknown as LoadableObjectKind<T & IFluidLoadable>;\n\t\tif (isDataObjectKind(internal)) {\n\t\t\treturn createDataObject(internal, this.context);\n\t\t} else if (isSharedObjectKind(internal)) {\n\t\t\treturn createSharedObject(internal, this.runtime);\n\t\t}\n\t\tthrow new Error(\"Could not create new Fluid object because an unknown object was passed\");\n\t}\n\n\tpublic async uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {\n\t\treturn this.runtime.uploadBlob(blob);\n\t}\n}\n\nconst treeRootDataStoreId = \"treeRootDOId\";\n\n/**\n * Type of the {@link TreeRootDataObject}.\n * @remarks Used in the PureDataObjectFactory to create the root data object.\n */\nconst treeRootDataObjectType = \"treeRootDO\";\n\nasync function provideEntryPoint(\n\tcontainerRuntime: IContainerRuntime,\n): Promise<IStaticEntryPoint> {\n\tconst entryPoint = await containerRuntime.getAliasedDataStoreEntryPoint(treeRootDataStoreId);\n\tif (entryPoint === undefined) {\n\t\tthrow new Error(`default dataStore [${treeRootDataStoreId}] must exist`);\n\t}\n\tconst treeRootDataObject = ((await entryPoint.get()) as FluidObject<TreeRootDataObject>)\n\t\t.TreeRootDataObject;\n\tassert(\n\t\ttreeRootDataObject !== undefined,\n\t\t0xbe7 /* entryPoint must be of type TreeRootDataObject */,\n\t);\n\treturn makeFluidObject<IStaticEntryPoint>(\n\t\t{\n\t\t\trootDataObject: treeRootDataObject,\n\t\t\textensionStore: containerRuntime as IContainerRuntimeInternal,\n\t\t},\n\t\t\"IStaticEntryPoint\",\n\t);\n}\n\n/**\n * Factory for Container Runtime instances that provide a {@link IStaticEntryPoint}\n * (containing single {@link IRootDataObject}) as their entry point.\n */\nclass TreeContainerRuntimeFactory extends BaseContainerRuntimeFactory {\n\t// TODO: use for runtime factory.\n\treadonly #treeRootDataObjectFactory: TreeDataObjectFactory<TreeRootDataObject>;\n\n\tpublic constructor(\n\t\ttreeRootDataObjectFactory: TreeDataObjectFactory<TreeRootDataObject>,\n\t\tconfig: {\n\t\t\tminVersionForCollab: MinimumVersionForCollab;\n\t\t\truntimeOptions?: Partial<IContainerRuntimeOptions>;\n\t\t},\n\t) {\n\t\tsuper({\n\t\t\tregistryEntries: [treeRootDataObjectFactory.registryEntry],\n\t\t\truntimeOptions: {\n\t\t\t\t...defaultRuntimeOptionsForMinVersion(config.minVersionForCollab),\n\t\t\t\t...config.runtimeOptions,\n\t\t\t},\n\t\t\tprovideEntryPoint,\n\t\t\tminVersionForCollab: config.minVersionForCollab,\n\t\t});\n\t\tthis.#treeRootDataObjectFactory = treeRootDataObjectFactory;\n\t}\n\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void> {\n\t\t// The first time we create the container we create the RootDataObject\n\t\tawait this.#treeRootDataObjectFactory.createRootInstance(treeRootDataStoreId, runtime);\n\t}\n}\n\n/**\n * Factory that creates instances of a tree-based root data object.\n */\nclass TreeRootDataObjectFactory extends TreeDataObjectFactory<TreeRootDataObject> {\n\tpublic constructor(\n\t\tsharedObjects: readonly IChannelFactory[] = [],\n\t\tprivate readonly dataStoreRegistry: IFluidDataStoreRegistry,\n\t) {\n\t\ttype Ctor = new (props: IDataObjectProps) => TreeRootDataObject;\n\t\tconst ctor: Ctor = function (_props) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\treturn new TreeRootDataObject({\n\t\t\t\t..._props,\n\t\t\t\t// Add any additional injected properties here\n\t\t\t});\n\t\t} as unknown as Ctor;\n\n\t\t// Note: we're not specifying registry entries to the base class, so it won't create a registry itself,\n\t\t// and instead we override the necessary methods in this class to use the registry received in the constructor.\n\t\tsuper({\n\t\t\ttype: treeRootDataObjectType,\n\t\t\tctor,\n\t\t\tsharedObjects,\n\t\t});\n\t}\n\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry {\n\t\treturn this.dataStoreRegistry;\n\t}\n}\n\n/**\n * Creates an {@link @fluidframework/aqueduct#IRuntimeFactory} which constructs containers\n * with an entry point containing single tree-based root data object.\n *\n * @remarks\n * The entry point is opaque to caller.\n * The root data object's registry and shared objects are configured based on the provided\n * SharedTree and optionally data store registry.\n *\n * @legacy @beta\n */\nexport function createTreeContainerRuntimeFactory(props: {\n\t/**\n\t * The schema for the container.\n\t */\n\treadonly schema: TreeContainerSchema;\n\n\t/**\n\t * Minimum Fluid Framework version required for collaboration as a\n\t * {@link @fluidframework/runtime-definitions#MinimumVersionForCollab} SemVer string.\n\t */\n\treadonly minVersionForCollaboration: MinimumVersionForCollab;\n\t/**\n\t * Optional registry of data stores to pass to the DataObject factory.\n\t * If not provided, one will be created based on the schema.\n\t */\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\t/**\n\t * Optional overrides for the container runtime options.\n\t * If not provided, only the default options for the given minVersionForCollaboration will be used.\n\t */\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n}): IRuntimeFactory;\n\n/**\n * Creates an {@link @fluidframework/aqueduct#IRuntimeFactory} which constructs containers\n * with an entry point containing single tree-based root data object.\n *\n * @remarks\n * The entry point is opaque to caller.\n * The root data object's registry and shared objects are configured based on the provided\n * SharedTree and optional data store registry.\n *\n * @deprecated Pass `minVersionForCollaboration` directly instead of using `compatibilityMode`.\n *\n * @legacy @beta\n */\nexport function createTreeContainerRuntimeFactory(props: {\n\t/**\n\t * The schema for the container.\n\t */\n\treadonly schema: TreeContainerSchema;\n\n\t/**\n\t * Legacy compatibility mode for the container.\n\t */\n\t// eslint-disable-next-line import-x/no-deprecated -- specify minVersionForCollaboration instead; see #23289\n\treadonly compatibilityMode: CompatibilityMode;\n\t/**\n\t * Optional registry of data stores to pass to the DataObject factory.\n\t * If not provided, one will be created based on the schema.\n\t */\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\t/**\n\t * Optional overrides for the container runtime options.\n\t * If not provided, only the default options for the given compatibilityMode will be used.\n\t */\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n}): IRuntimeFactory;\n\n// Implementation\nexport function createTreeContainerRuntimeFactory(props: {\n\treadonly schema: TreeContainerSchema;\n\t// eslint-disable-next-line import-x/no-deprecated -- specify minVersionForCollaboration instead; see #23289\n\treadonly compatibilityMode?: CompatibilityMode;\n\treadonly minVersionForCollaboration?: MinimumVersionForCollab;\n\treadonly rootDataStoreRegistry?: IFluidDataStoreRegistry;\n\treadonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;\n}): IRuntimeFactory {\n\tconst {\n\t\tcompatibilityMode,\n\t\tminVersionForCollaboration,\n\t\trootDataStoreRegistry,\n\t\truntimeOptionOverrides,\n\t\tschema,\n\t} = props;\n\n\tlet minVersionForCollab: MinimumVersionForCollab;\n\tif (minVersionForCollaboration !== undefined) {\n\t\tminVersionForCollab = minVersionForCollaboration;\n\t} else if (compatibilityMode === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Either minVersionForCollaboration or compatibilityMode (deprecated) must be provided.\",\n\t\t);\n\t} else {\n\t\tminVersionForCollab = resolveCompatibilityModeToMinVersionForCollab(compatibilityMode);\n\t}\n\n\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\tconst registry = rootDataStoreRegistry ?? new FluidDataStoreRegistry(registryEntries);\n\n\treturn new TreeContainerRuntimeFactory(\n\t\tnew TreeRootDataObjectFactory(sharedObjects, registry),\n\t\t{\n\t\t\truntimeOptions: runtimeOptionOverrides,\n\t\t\tminVersionForCollab,\n\t\t},\n\t);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/fluid-static",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.110.0",
|
|
4
4
|
"description": "A tool to enable consumption of Fluid Data Objects without requiring custom container code.",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -79,37 +79,37 @@
|
|
|
79
79
|
"temp-directory": "nyc/.nyc_output"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@fluid-internal/client-utils": "~2.
|
|
83
|
-
"@fluid-internal/presence-definitions": "~2.
|
|
84
|
-
"@fluid-internal/presence-runtime": "~2.
|
|
85
|
-
"@fluidframework/aqueduct": "~2.
|
|
86
|
-
"@fluidframework/container-definitions": "~2.
|
|
87
|
-
"@fluidframework/container-loader": "~2.
|
|
88
|
-
"@fluidframework/container-runtime": "~2.
|
|
89
|
-
"@fluidframework/container-runtime-definitions": "~2.
|
|
90
|
-
"@fluidframework/core-interfaces": "~2.
|
|
91
|
-
"@fluidframework/core-utils": "~2.
|
|
92
|
-
"@fluidframework/datastore-definitions": "~2.
|
|
93
|
-
"@fluidframework/driver-definitions": "~2.
|
|
94
|
-
"@fluidframework/request-handler": "~2.
|
|
95
|
-
"@fluidframework/runtime-definitions": "~2.
|
|
96
|
-
"@fluidframework/runtime-utils": "~2.
|
|
97
|
-
"@fluidframework/shared-object-base": "~2.
|
|
98
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
99
|
-
"@fluidframework/tree": "~2.
|
|
82
|
+
"@fluid-internal/client-utils": "~2.110.0",
|
|
83
|
+
"@fluid-internal/presence-definitions": "~2.110.0",
|
|
84
|
+
"@fluid-internal/presence-runtime": "~2.110.0",
|
|
85
|
+
"@fluidframework/aqueduct": "~2.110.0",
|
|
86
|
+
"@fluidframework/container-definitions": "~2.110.0",
|
|
87
|
+
"@fluidframework/container-loader": "~2.110.0",
|
|
88
|
+
"@fluidframework/container-runtime": "~2.110.0",
|
|
89
|
+
"@fluidframework/container-runtime-definitions": "~2.110.0",
|
|
90
|
+
"@fluidframework/core-interfaces": "~2.110.0",
|
|
91
|
+
"@fluidframework/core-utils": "~2.110.0",
|
|
92
|
+
"@fluidframework/datastore-definitions": "~2.110.0",
|
|
93
|
+
"@fluidframework/driver-definitions": "~2.110.0",
|
|
94
|
+
"@fluidframework/request-handler": "~2.110.0",
|
|
95
|
+
"@fluidframework/runtime-definitions": "~2.110.0",
|
|
96
|
+
"@fluidframework/runtime-utils": "~2.110.0",
|
|
97
|
+
"@fluidframework/shared-object-base": "~2.110.0",
|
|
98
|
+
"@fluidframework/telemetry-utils": "~2.110.0",
|
|
99
|
+
"@fluidframework/tree": "~2.110.0",
|
|
100
100
|
"semver-ts": "^1.0.3"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
104
104
|
"@biomejs/biome": "~2.4.5",
|
|
105
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
105
|
+
"@fluid-internal/mocha-test-setup": "~2.110.0",
|
|
106
106
|
"@fluid-tools/build-cli": "^0.65.0",
|
|
107
107
|
"@fluidframework/build-common": "^2.0.3",
|
|
108
108
|
"@fluidframework/build-tools": "^0.65.0",
|
|
109
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
110
|
-
"@fluidframework/fluid-static-previous": "npm:@fluidframework/fluid-static@2.
|
|
111
|
-
"@fluidframework/map": "~2.
|
|
112
|
-
"@fluidframework/sequence": "~2.
|
|
109
|
+
"@fluidframework/eslint-config-fluid": "^13.0.0",
|
|
110
|
+
"@fluidframework/fluid-static-previous": "npm:@fluidframework/fluid-static@2.103.0",
|
|
111
|
+
"@fluidframework/map": "~2.110.0",
|
|
112
|
+
"@fluidframework/sequence": "~2.110.0",
|
|
113
113
|
"@microsoft/api-extractor": "7.58.1",
|
|
114
114
|
"@types/mocha": "^10.0.10",
|
|
115
115
|
"@types/node": "~22.19.17",
|
|
@@ -247,7 +247,7 @@ export function createTreeContainerRuntimeFactory(props: {
|
|
|
247
247
|
/**
|
|
248
248
|
* Legacy compatibility mode for the container.
|
|
249
249
|
*/
|
|
250
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
250
|
+
// eslint-disable-next-line import-x/no-deprecated -- specify minVersionForCollaboration instead; see #23289
|
|
251
251
|
readonly compatibilityMode: CompatibilityMode;
|
|
252
252
|
/**
|
|
253
253
|
* Optional registry of data stores to pass to the DataObject factory.
|
|
@@ -259,29 +259,20 @@ export function createTreeContainerRuntimeFactory(props: {
|
|
|
259
259
|
* If not provided, only the default options for the given compatibilityMode will be used.
|
|
260
260
|
*/
|
|
261
261
|
readonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;
|
|
262
|
-
/**
|
|
263
|
-
* Optional override for minimum version for collaboration.
|
|
264
|
-
* @remarks
|
|
265
|
-
* If not provided, the default for the given compatibilityMode will be used.
|
|
266
|
-
* Rather than defining this, omit `compatibilityMode` and pass `minVersionForCollaboration` directly.
|
|
267
|
-
*/
|
|
268
|
-
readonly minVersionForCollabOverride?: MinimumVersionForCollab;
|
|
269
262
|
}): IRuntimeFactory;
|
|
270
263
|
|
|
271
264
|
// Implementation
|
|
272
265
|
export function createTreeContainerRuntimeFactory(props: {
|
|
273
266
|
readonly schema: TreeContainerSchema;
|
|
274
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
267
|
+
// eslint-disable-next-line import-x/no-deprecated -- specify minVersionForCollaboration instead; see #23289
|
|
275
268
|
readonly compatibilityMode?: CompatibilityMode;
|
|
276
269
|
readonly minVersionForCollaboration?: MinimumVersionForCollab;
|
|
277
270
|
readonly rootDataStoreRegistry?: IFluidDataStoreRegistry;
|
|
278
271
|
readonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;
|
|
279
|
-
readonly minVersionForCollabOverride?: MinimumVersionForCollab;
|
|
280
272
|
}): IRuntimeFactory {
|
|
281
273
|
const {
|
|
282
274
|
compatibilityMode,
|
|
283
275
|
minVersionForCollaboration,
|
|
284
|
-
minVersionForCollabOverride,
|
|
285
276
|
rootDataStoreRegistry,
|
|
286
277
|
runtimeOptionOverrides,
|
|
287
278
|
schema,
|
|
@@ -295,9 +286,7 @@ export function createTreeContainerRuntimeFactory(props: {
|
|
|
295
286
|
"Either minVersionForCollaboration or compatibilityMode (deprecated) must be provided.",
|
|
296
287
|
);
|
|
297
288
|
} else {
|
|
298
|
-
minVersionForCollab =
|
|
299
|
-
minVersionForCollabOverride ??
|
|
300
|
-
resolveCompatibilityModeToMinVersionForCollab(compatibilityMode);
|
|
289
|
+
minVersionForCollab = resolveCompatibilityModeToMinVersionForCollab(compatibilityMode);
|
|
301
290
|
}
|
|
302
291
|
|
|
303
292
|
const [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);
|