@fluidframework/fluid-static 2.101.1 → 2.102.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.alpha.api.md +1 -1
- package/api-report/fluid-static.beta.api.md +1 -1
- package/api-report/fluid-static.legacy.beta.api.md +9 -1
- package/api-report/fluid-static.legacy.public.api.md +1 -1
- package/api-report/fluid-static.public.api.md +1 -1
- package/dist/compatibilityConfiguration.d.ts +8 -7
- package/dist/compatibilityConfiguration.d.ts.map +1 -1
- package/dist/compatibilityConfiguration.js +22 -7
- package/dist/compatibilityConfiguration.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/rootDataObject.d.ts +5 -11
- package/dist/rootDataObject.d.ts.map +1 -1
- package/dist/rootDataObject.js +9 -9
- package/dist/rootDataObject.js.map +1 -1
- package/dist/treeRootDataObject.d.ts +38 -4
- package/dist/treeRootDataObject.d.ts.map +1 -1
- package/dist/treeRootDataObject.js +20 -19
- package/dist/treeRootDataObject.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +10 -7
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +18 -6
- package/dist/utils.js.map +1 -1
- package/lib/compatibilityConfiguration.d.ts +8 -7
- package/lib/compatibilityConfiguration.d.ts.map +1 -1
- package/lib/compatibilityConfiguration.js +20 -6
- package/lib/compatibilityConfiguration.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/rootDataObject.d.ts +5 -11
- package/lib/rootDataObject.d.ts.map +1 -1
- package/lib/rootDataObject.js +11 -11
- package/lib/rootDataObject.js.map +1 -1
- package/lib/treeRootDataObject.d.ts +38 -4
- package/lib/treeRootDataObject.d.ts.map +1 -1
- package/lib/treeRootDataObject.js +22 -21
- package/lib/treeRootDataObject.js.map +1 -1
- package/lib/types.d.ts +6 -0
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utils.d.ts +10 -7
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +16 -5
- package/lib/utils.js.map +1 -1
- package/package.json +24 -23
- package/src/compatibilityConfiguration.ts +27 -9
- package/src/index.ts +4 -1
- package/src/rootDataObject.ts +15 -32
- package/src/treeRootDataObject.ts +76 -17
- package/src/types.ts +6 -0
- package/src/utils.ts +18 -5
|
@@ -31,8 +31,9 @@ import type {
|
|
|
31
31
|
} from "@fluidframework/runtime-definitions/internal";
|
|
32
32
|
import type { SharedObjectKind } from "@fluidframework/shared-object-base/internal";
|
|
33
33
|
|
|
34
|
-
import {
|
|
34
|
+
import { defaultRuntimeOptionsForMinVersion } from "./compatibilityConfiguration.js";
|
|
35
35
|
import type {
|
|
36
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
36
37
|
CompatibilityMode,
|
|
37
38
|
IRootDataObject,
|
|
38
39
|
IStaticEntryPoint,
|
|
@@ -41,13 +42,13 @@ import type {
|
|
|
41
42
|
TreeContainerSchema,
|
|
42
43
|
} from "./types.js";
|
|
43
44
|
import {
|
|
44
|
-
compatibilityModeToMinVersionForCollab,
|
|
45
45
|
createDataObject,
|
|
46
46
|
createSharedObject,
|
|
47
47
|
isDataObjectKind,
|
|
48
48
|
isSharedObjectKind,
|
|
49
49
|
makeFluidObject,
|
|
50
50
|
parseDataObjectsFromSharedObjects,
|
|
51
|
+
resolveCompatibilityModeToMinVersionForCollab,
|
|
51
52
|
} from "./utils.js";
|
|
52
53
|
|
|
53
54
|
/**
|
|
@@ -135,23 +136,20 @@ class TreeContainerRuntimeFactory extends BaseContainerRuntimeFactory {
|
|
|
135
136
|
readonly #treeRootDataObjectFactory: TreeDataObjectFactory<TreeRootDataObject>;
|
|
136
137
|
|
|
137
138
|
public constructor(
|
|
138
|
-
compatibilityMode: CompatibilityMode,
|
|
139
139
|
treeRootDataObjectFactory: TreeDataObjectFactory<TreeRootDataObject>,
|
|
140
|
-
|
|
141
|
-
runtimeOptions: Partial<IContainerRuntimeOptions>;
|
|
140
|
+
config: {
|
|
142
141
|
minVersionForCollab: MinimumVersionForCollab;
|
|
143
|
-
|
|
142
|
+
runtimeOptions?: Partial<IContainerRuntimeOptions>;
|
|
143
|
+
},
|
|
144
144
|
) {
|
|
145
145
|
super({
|
|
146
146
|
registryEntries: [treeRootDataObjectFactory.registryEntry],
|
|
147
147
|
runtimeOptions: {
|
|
148
|
-
...
|
|
149
|
-
...
|
|
148
|
+
...defaultRuntimeOptionsForMinVersion(config.minVersionForCollab),
|
|
149
|
+
...config.runtimeOptions,
|
|
150
150
|
},
|
|
151
151
|
provideEntryPoint,
|
|
152
|
-
minVersionForCollab:
|
|
153
|
-
overrides?.minVersionForCollab ??
|
|
154
|
-
compatibilityModeToMinVersionForCollab[compatibilityMode],
|
|
152
|
+
minVersionForCollab: config.minVersionForCollab,
|
|
155
153
|
});
|
|
156
154
|
this.#treeRootDataObjectFactory = treeRootDataObjectFactory;
|
|
157
155
|
}
|
|
@@ -211,8 +209,45 @@ export function createTreeContainerRuntimeFactory(props: {
|
|
|
211
209
|
readonly schema: TreeContainerSchema;
|
|
212
210
|
|
|
213
211
|
/**
|
|
214
|
-
*
|
|
212
|
+
* Minimum Fluid Framework version required for collaboration as a
|
|
213
|
+
* {@link @fluidframework/runtime-definitions#MinimumVersionForCollab} SemVer string.
|
|
214
|
+
*/
|
|
215
|
+
readonly minVersionForCollaboration: MinimumVersionForCollab;
|
|
216
|
+
/**
|
|
217
|
+
* Optional registry of data stores to pass to the DataObject factory.
|
|
218
|
+
* If not provided, one will be created based on the schema.
|
|
215
219
|
*/
|
|
220
|
+
readonly rootDataStoreRegistry?: IFluidDataStoreRegistry;
|
|
221
|
+
/**
|
|
222
|
+
* Optional overrides for the container runtime options.
|
|
223
|
+
* If not provided, only the default options for the given minVersionForCollaboration will be used.
|
|
224
|
+
*/
|
|
225
|
+
readonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;
|
|
226
|
+
}): IRuntimeFactory;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Creates an {@link @fluidframework/aqueduct#IRuntimeFactory} which constructs containers
|
|
230
|
+
* with an entry point containing single tree-based root data object.
|
|
231
|
+
*
|
|
232
|
+
* @remarks
|
|
233
|
+
* The entry point is opaque to caller.
|
|
234
|
+
* The root data object's registry and shared objects are configured based on the provided
|
|
235
|
+
* SharedTree and optional data store registry.
|
|
236
|
+
*
|
|
237
|
+
* @deprecated Pass `minVersionForCollaboration` directly instead of using `compatibilityMode`.
|
|
238
|
+
*
|
|
239
|
+
* @legacy @beta
|
|
240
|
+
*/
|
|
241
|
+
export function createTreeContainerRuntimeFactory(props: {
|
|
242
|
+
/**
|
|
243
|
+
* The schema for the container.
|
|
244
|
+
*/
|
|
245
|
+
readonly schema: TreeContainerSchema;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Legacy compatibility mode for the container.
|
|
249
|
+
*/
|
|
250
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
216
251
|
readonly compatibilityMode: CompatibilityMode;
|
|
217
252
|
/**
|
|
218
253
|
* Optional registry of data stores to pass to the DataObject factory.
|
|
@@ -225,30 +260,54 @@ export function createTreeContainerRuntimeFactory(props: {
|
|
|
225
260
|
*/
|
|
226
261
|
readonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;
|
|
227
262
|
/**
|
|
228
|
-
* Optional override for minimum version for
|
|
229
|
-
* If not provided, the default for the given compatibilityMode will be used.
|
|
263
|
+
* Optional override for minimum version for collaboration.
|
|
230
264
|
* @remarks
|
|
231
|
-
*
|
|
265
|
+
* If not provided, the default for the given compatibilityMode will be used.
|
|
266
|
+
* Rather than defining this, omit `compatibilityMode` and pass `minVersionForCollaboration` directly.
|
|
232
267
|
*/
|
|
233
268
|
readonly minVersionForCollabOverride?: MinimumVersionForCollab;
|
|
269
|
+
}): IRuntimeFactory;
|
|
270
|
+
|
|
271
|
+
// Implementation
|
|
272
|
+
export function createTreeContainerRuntimeFactory(props: {
|
|
273
|
+
readonly schema: TreeContainerSchema;
|
|
274
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
275
|
+
readonly compatibilityMode?: CompatibilityMode;
|
|
276
|
+
readonly minVersionForCollaboration?: MinimumVersionForCollab;
|
|
277
|
+
readonly rootDataStoreRegistry?: IFluidDataStoreRegistry;
|
|
278
|
+
readonly runtimeOptionOverrides?: Partial<IContainerRuntimeOptions>;
|
|
279
|
+
readonly minVersionForCollabOverride?: MinimumVersionForCollab;
|
|
234
280
|
}): IRuntimeFactory {
|
|
235
281
|
const {
|
|
236
282
|
compatibilityMode,
|
|
283
|
+
minVersionForCollaboration,
|
|
237
284
|
minVersionForCollabOverride,
|
|
238
285
|
rootDataStoreRegistry,
|
|
239
286
|
runtimeOptionOverrides,
|
|
240
287
|
schema,
|
|
241
288
|
} = props;
|
|
242
289
|
|
|
290
|
+
let minVersionForCollab: MinimumVersionForCollab;
|
|
291
|
+
if (minVersionForCollaboration !== undefined) {
|
|
292
|
+
minVersionForCollab = minVersionForCollaboration;
|
|
293
|
+
} else if (compatibilityMode === undefined) {
|
|
294
|
+
throw new Error(
|
|
295
|
+
"Either minVersionForCollaboration or compatibilityMode (deprecated) must be provided.",
|
|
296
|
+
);
|
|
297
|
+
} else {
|
|
298
|
+
minVersionForCollab =
|
|
299
|
+
minVersionForCollabOverride ??
|
|
300
|
+
resolveCompatibilityModeToMinVersionForCollab(compatibilityMode);
|
|
301
|
+
}
|
|
302
|
+
|
|
243
303
|
const [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);
|
|
244
304
|
const registry = rootDataStoreRegistry ?? new FluidDataStoreRegistry(registryEntries);
|
|
245
305
|
|
|
246
306
|
return new TreeContainerRuntimeFactory(
|
|
247
|
-
compatibilityMode,
|
|
248
307
|
new TreeRootDataObjectFactory(sharedObjects, registry),
|
|
249
308
|
{
|
|
250
309
|
runtimeOptions: runtimeOptionOverrides,
|
|
251
|
-
minVersionForCollab
|
|
310
|
+
minVersionForCollab,
|
|
252
311
|
},
|
|
253
312
|
);
|
|
254
313
|
}
|
package/src/types.ts
CHANGED
|
@@ -22,6 +22,12 @@ import type { ITree } from "@fluidframework/tree";
|
|
|
22
22
|
* In "1" mode we support full interop between 2.x clients and 1.x clients,
|
|
23
23
|
* while in "2" mode we only support interop between 2.x clients.
|
|
24
24
|
*
|
|
25
|
+
* @deprecated Specify the minimum Fluid Framework version directly via the
|
|
26
|
+
* `minVersionForCollab` parameter, which accepts a
|
|
27
|
+
* {@link @fluidframework/runtime-definitions#MinimumVersionForCollab} SemVer string. The
|
|
28
|
+
* legacy mode "1" is equivalent to `minVersionForCollab: "1.0.0"`; mode "2" is
|
|
29
|
+
* equivalent to `"2.0.0"`.
|
|
30
|
+
*
|
|
25
31
|
* @public
|
|
26
32
|
*/
|
|
27
33
|
export type CompatibilityMode = "1" | "2";
|
package/src/utils.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
|
20
20
|
import { SharedTreeFactoryType } from "@fluidframework/tree/internal";
|
|
21
21
|
|
|
22
22
|
import type {
|
|
23
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
23
24
|
CompatibilityMode,
|
|
24
25
|
ContainerSchema,
|
|
25
26
|
LoadableObjectKind,
|
|
@@ -147,12 +148,24 @@ export function makeFluidObject<
|
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
/**
|
|
150
|
-
*
|
|
151
|
+
* Resolves the `compatibilityMode` input — either a `MinimumVersionForCollab`
|
|
152
|
+
* SemVer string or a legacy `CompatibilityMode` value — into a precise
|
|
153
|
+
* `MinimumVersionForCollab`.
|
|
154
|
+
*
|
|
155
|
+
* TODO: AB#73679: This can be removed when the deprecated CompatibilityMode is removed
|
|
156
|
+
*
|
|
157
|
+
* @internal
|
|
151
158
|
*/
|
|
152
|
-
export
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
export function resolveCompatibilityModeToMinVersionForCollab(
|
|
160
|
+
// eslint-disable-next-line import-x/no-deprecated
|
|
161
|
+
compatibilityMode: MinimumVersionForCollab | CompatibilityMode,
|
|
162
|
+
): MinimumVersionForCollab {
|
|
163
|
+
return compatibilityMode === "1"
|
|
164
|
+
? "1.0.0"
|
|
165
|
+
: compatibilityMode === "2"
|
|
166
|
+
? "2.0.0"
|
|
167
|
+
: compatibilityMode;
|
|
168
|
+
}
|
|
156
169
|
|
|
157
170
|
/**
|
|
158
171
|
* Determines if the provided schema is a valid tree-based container schema.
|